1. 24 11月, 2014 3 次提交
    • P
      apic: fix incorrect handling of ExtINT interrupts wrt processor priority · 5224c88d
      Paolo Bonzini 提交于
      This fixes another failure with ExtINT, demonstrated by QNX.  The failure
      mode is as follows:
      - IPI sent to cpu 0 (bit set in APIC irr)
      - IPI accepted by cpu 0 (bit cleared in irr, set in isr)
      - IPI sent to cpu 0 (bit set in both irr and isr)
      - PIC interrupt sent to cpu 0
      
      The PIC interrupt causes CPU_INTERRUPT_HARD to be set, but
      apic_irq_pending observes that the highest pending APIC interrupt priority
      (the IPI) is the same as the processor priority (since the IPI is still
      being handled), so apic_get_interrupt returns a spurious interrupt rather
      than the pending PIC interrupt. The result is an endless sequence of
      spurious interrupts, since nothing will clear CPU_INTERRUPT_HARD.
      
      Instead, ExtINT interrupts should have ignored the processor priority.
      Calling apic_check_pic early in apic_get_interrupt ensures that
      apic_deliver_pic_intr is called instead of delivering the spurious
      interrupt.  apic_deliver_pic_intr then clears CPU_INTERRUPT_HARD if needed.
      Reported-by: NRichard Bilson <rbilson@qnx.com>
      Tested-by: NRichard Bilson <rbilson@qnx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5224c88d
    • P
      apic: fix loss of IPI due to masked ExtINT · 8092cb71
      Paolo Bonzini 提交于
      This patch fixes an obscure failure of the QNX kernel on QEMU x86 SMP.
      In QNX, all hardware interrupts come via the PIC, and are delivered by
      the cpu 0 LAPIC in ExtINT mode, while IPIs are delivered by the LAPIC
      in fixed mode.
      
      This bug happens as follows:
      - cpu 0 masks a particular PIC interrupt
      - IPI sent to cpu 0 (CPU_INTERRUPT_HARD is set)
      - before the IPI is accepted, the masked interrupt line is asserted by the
      device
      
      Since the interrupt is masked, apic_deliver_pic_intr will clear
      CPU_INTERRUPT_HARD. The IPI will still be set in the APIC irr, but since
      CPU_INTERRUPT_HARD is not set the cpu will not notice. Depending on the
      scenario this can cause a system hang, i.e. if cpu 0 is expected to unmask
      the interrupt.
      
      In order to fix this, do a full check of the APIC before an EXTINT
      is acknowledged.  This can result in clearing CPU_INTERRUPT_HARD, but
      can also result in delivering the lost IPI.
      Reported-by: NRichard Bilson <rbilson@qnx.com>
      Tested-by: NRichard Bilson <rbilson@qnx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8092cb71
    • P
      apic: avoid getting out of halted state on masked PIC interrupts · 60e68042
      Paolo Bonzini 提交于
      After the next patch, if a masked PIC interrupts causes CPU_INTERRUPT_POLL
      to be set, the CPU will spuriously get out of halted state.  While this
      is technically valid, we should avoid that.
      
      Make CPU_INTERRUPT_POLL run apic_update_irq in the right thread and then
      look at CPU_INTERRUPT_HARD.  If CPU_INTERRUPT_HARD does not get set,
      do not report the CPU as having work.
      
      Also move the handling of software-disabled APIC from apic_update_irq
      to apic_irq_pending, and always trigger CPU_INTERRUPT_POLL.  This will
      be important once we will add a case that resets CPU_INTERRUPT_HARD
      from apic_update_irq.  We want to run it even if we go through
      CPU_INTERRUPT_POLL, and even if the local APIC is software disabled.
      Reported-by: NRichard Bilson <rbilson@qnx.com>
      Tested-by: NRichard Bilson <rbilson@qnx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      60e68042
  2. 15 8月, 2014 1 次提交
  3. 07 5月, 2014 1 次提交
  4. 27 4月, 2014 1 次提交
  5. 27 3月, 2014 1 次提交
  6. 11 2月, 2014 1 次提交
  7. 25 12月, 2013 2 次提交
  8. 23 8月, 2013 1 次提交
  9. 04 7月, 2013 2 次提交
  10. 02 6月, 2013 1 次提交
  11. 01 5月, 2013 1 次提交
  12. 09 4月, 2013 2 次提交
  13. 12 3月, 2013 2 次提交
  14. 01 3月, 2013 1 次提交
    • P
      hw: include hw header files with full paths · 83c9f4ca
      Paolo Bonzini 提交于
      Done with this script:
      
      cd hw
      for i in `find . -name '*.h' | sed 's/^..//'`; do
        echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,'
      done | sed -i -f - `find . -type f`
      
      This is so that paths remain valid as files are moved.
      
      Instead, files in hw/dataplane are referenced with the relative path.
      We know they are not going to move to include/, and they are the only
      include files that are in subdirectories _and_ move.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      83c9f4ca
  15. 11 1月, 2013 1 次提交
    • A
      Make all static TypeInfos const · 8c43a6f0
      Andreas Färber 提交于
      Since 39bffca2 (qdev: register all
      types natively through QEMU Object Model), TypeInfo as used in
      the common, non-iterative pattern is no longer amended with information
      and should therefore be const.
      
      Fix the documented QOM examples:
      
       sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h
      
      Since frequently the wrong examples are being copied by contributors of
      new devices, fix all types in the tree:
      
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c
       sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c
      
      This also avoids to piggy-back these changes onto real functional
      changes or other refactorings.
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      8c43a6f0
  16. 19 12月, 2012 1 次提交
  17. 17 12月, 2012 1 次提交
  18. 31 10月, 2012 3 次提交
  19. 23 10月, 2012 1 次提交
    • A
      Rename target_phys_addr_t to hwaddr · a8170e5e
      Avi Kivity 提交于
      target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
      reserved) and its purpose doesn't match the name (most target_phys_addr_t
      addresses are not target specific).  Replace it with a finger-friendly,
      standards conformant hwaddr.
      
      Outstanding patchsets can be fixed up with the command
      
        git rebase -i --exec 'find -name "*.[ch]"
                              | xargs s/target_phys_addr_t/hwaddr/g' origin
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a8170e5e
  20. 10 7月, 2012 3 次提交
  21. 22 6月, 2012 1 次提交
  22. 17 5月, 2012 1 次提交
  23. 18 2月, 2012 1 次提交
    • J
      kvmvapic: Introduce TPR access optimization for Windows guests · e5ad936b
      Jan Kiszka 提交于
      This enables acceleration for MMIO-based TPR registers accesses of
      32-bit Windows guest systems. It is mostly useful with KVM enabled,
      either on older Intel CPUs (without flexpriority feature, can also be
      manually disabled for testing) or any current AMD processor.
      
      The approach introduced here is derived from the original version of
      qemu-kvm. It was refactored, documented, and extended by support for
      user space APIC emulation, both with and without KVM acceleration. The
      VMState format was kept compatible, so was the ABI to the option ROM
      that implements the guest-side para-virtualized driver service. This
      enables seamless migration from qemu-kvm to upstream or, one day,
      between KVM and TCG mode.
      
      The basic concept goes like this:
       - VAPIC PV interface consisting of I/O port 0x7e and (for KVM in-kernel
         irqchip) a vmcall hypercall is registered
       - VAPIC option ROM is loaded into guest
       - option ROM activates TPR MMIO access reporting via port 0x7e
       - TPR accesses are trapped and patched in the guest to call into option
         ROM instead, VAPIC support is enabled
       - option ROM TPR helpers track state in memory and invoke hypercall to
         poll for pending IRQs if required
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      e5ad936b
  24. 15 2月, 2012 1 次提交
  25. 04 2月, 2012 1 次提交
    • A
      qdev: register all types natively through QEMU Object Model · 39bffca2
      Anthony Liguori 提交于
      This was done in a mostly automated fashion.  I did it in three steps and then
      rebased it into a single step which avoids repeatedly touching every file in
      the tree.
      
      The first step was a sed-based addition of the parent type to the subclass
      registration functions.
      
      The second step was another sed-based removal of subclass registration functions
      while also adding virtual functions from the base class into a class_init
      function as appropriate.
      
      Finally, a python script was used to convert the DeviceInfo structures and
      qdev_register_subclass functions to TypeInfo structures, class_init functions,
      and type_register_static calls.
      
      We are almost fully converted to QOM after this commit.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      39bffca2
  26. 28 1月, 2012 1 次提交
  27. 19 1月, 2012 4 次提交
    • J
      apic: Open-code timer save/restore · 7a380ca3
      Jan Kiszka 提交于
      To enable migration between accelerated and non-accelerated APIC models,
      we will need to handle the timer saving and restoring specially and can
      no longer rely on the automatics of VMSTATE_TIMER. Specifically,
      accelerated model will not start any QEMUTimer.
      
      This patch therefore factors out the generic bits into apic_next_timer
      and use a post-load callback to implemented model-specific logic.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      7a380ca3
    • J
      apic: Factor out base class for KVM reuse · dae01685
      Jan Kiszka 提交于
      The KVM in-kernel APIC model will reuse parts of the user space model
      while providing the same frontend view to guest and most management
      interfaces.
      
      Factor out an APIC base class to encapsulate those parts that will be
      shared by user space and KVM model. This class offers callback hooks for
      init, base/tpr setting, and the external NMI delivery that will be
      set via APICCommonInfo structure and implemented specifically in the
      subclasses.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      dae01685
    • J
      apic: Introduce apic_report_irq_delivered · 343270ea
      Jan Kiszka 提交于
      The in-kernel i8259 and IOAPIC backends for KVM will need this, so
      encapsulate the shared bits.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      343270ea
    • J
      apic: Inject external NMI events via LINT1 · 02c09195
      Jan Kiszka 提交于
      On real hardware, NMI button events are injected via the LINT1 line of
      the APICs. E.g. kdump expect this wiring and gets upset if the per-APIC
      LINT1 mask is not respected, i.e. if NMIs are injected to VCPUs that
      should not receive them. Change the APIC emulation code to reflect this.
      
      Based on qemu-kvm patch by Lai Jiangshan.
      
      CC: Lai Jiangshan <laijs@cn.fujitsu.com>
      Reported-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      02c09195