Skip to content
Commit 0de704d2 authored by Michal Luczaj's avatar Michal Luczaj Committed by Sean Christopherson
Browse files

KVM: selftests: Extend x86's sync_regs_test to check for exception races



Attempt to set the to-be-queued exception to be both pending and injected
_after_ KVM_CAP_SYNC_REGS's kvm_vcpu_ioctl_x86_set_vcpu_events() squashes
the pending exception (if there's also an injected exception).  Buggy KVM
versions will eventually yell loudly about having impossible state when
processing queued excpetions, e.g.

  WARNING: CPU: 0 PID: 1115 at arch/x86/kvm/x86.c:10095 kvm_check_and_inject_events+0x220/0x500 [kvm]

  arch/x86/kvm/x86.c:kvm_check_and_inject_events():
  WARN_ON_ONCE(vcpu->arch.exception.injected &&
	       vcpu->arch.exception.pending);

Signed-off-by: default avatarMichal Luczaj <mhal@rbox.co>
Link: https://lore.kernel.org/r/20230728001606.2275586-3-mhal@rbox.co


[sean: split to separate patch, massage changelog and comment]
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 60c4063b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment