Re: exception vs SIGALRM race (was: Re: guest/host mem out of sync on core2duo?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 29/06/21 00:27, Jim Mattson wrote:
static int kvm_vcpu_ready_for_interrupt_injection(struct kvm_vcpu *vcpu)
{
          return kvm_arch_interrupt_allowed(vcpu) &&
                  kvm_cpu_accept_dm_intr(vcpu);
}
  It looks like Paolo may have broken this in commit 71cc849b7093
("KVM: x86: Fix split-irqchip vs interrupt injection window request").
The commit message seems focused only on
vcpu->arch.interrupt.injected. Perhaps he overlooked
vcpu->arch.exception.injected.

I was expecting the exception to be injected first and the interrupt second.
But something like this should fix it:

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 21877ad2214e..dddff682c9c2 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4277,6 +4277,9 @@ static int kvm_vcpu_ioctl_set_lapic(struct kvm_vcpu *vcpu,
static int kvm_cpu_accept_dm_intr(struct kvm_vcpu *vcpu)
 {
+	if (kvm_event_needs_reinjection(vcpu))
+		return false;
+
 	/*
 	 * We can accept userspace's request for interrupt injection
 	 * as long as we have a place to store the interrupt number.

I'll figure out a selftest to better understand what's going on.  In the meanwhile
Stas can test it!

Thanks,

Paolo




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux