1. 24 6月, 2008 1 次提交
    • A
      KVM: ioapic: fix lost interrupt when changing a device's irq · 4fa6b9c5
      Avi Kivity 提交于
      The ioapic acknowledge path translates interrupt vectors to irqs.  It
      currently uses a first match algorithm, stopping when it finds the first
      redirection table entry containing the vector.  That fails however if the
      guest changes the irq to a different line, leaving the old redirection table
      entry in place (though masked).  Result is interrupts not making it to the
      guest.
      
      Fix by always scanning the entire redirection table.
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      4fa6b9c5
  2. 07 6月, 2008 1 次提交
    • M
      KVM: IOAPIC: only set remote_irr if interrupt was injected · ff4b9df8
      Marcelo Tosatti 提交于
      There's a bug in the IOAPIC code for level-triggered interrupts. Its
      relatively easy to trigger by sharing (virtio-blk + usbtablet was the
      testcase, initially reported by Gerd von Egidy).
      
      The "remote_irr" variable is used to indicate accepted but not yet acked
      interrupts. Its cleared from the EOI handler.
      
      Problem is that the EOI handler clears remote_irr unconditionally, even
      if it reinjected another pending interrupt.
      
      In that case, kvm_ioapic_set_irq() proceeds to ioapic_service() which
      sets remote_irr even if it failed to inject (since the IRR was high due
      to EOI reinjection).
      
      Since the TMR bit has been cleared by the first EOI, the second one
      fails to clear remote_irr.
      
      End result is interrupt line dead.
      
      Fix it by setting remote_irr only if a new pending interrupt has been
      generated (and the TMR bit for vector in question set).
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      ff4b9df8
  3. 04 3月, 2008 1 次提交
    • A
      KVM: Route irq 0 to vcpu 0 exclusively · 8c35f237
      Avi Kivity 提交于
      Some Linux versions allow the timer interrupt to be processed by more than
      one cpu, leading to hangs due to tsc instability.  Work around the issue
      by only disaptching the interrupt to vcpu 0.
      
      Problem analyzed (and patch tested) by Sheng Yang.
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      8c35f237
  4. 31 1月, 2008 3 次提交
  5. 30 1月, 2008 8 次提交
  6. 13 10月, 2007 1 次提交
    • E
      KVM: In-kernel I/O APIC model · 1fd4f2a5
      Eddie Dong 提交于
      This allows in-kernel host-side device drivers to raise guest interrupts
      without going to userspace.
      
      [avi: fix level-triggered interrupt redelivery on eoi]
      [avi: add missing #include]
      [avi: avoid redelivery of edge-triggered interrupt]
      [avi: implement polarity]
      [avi: don't deliver edge-triggered interrupts when unmasking]
      [avi: fix host oops on invalid guest access]
      Signed-off-by: NYaozu (Eddie) Dong <eddie.dong@intel.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      1fd4f2a5