OSDN Git Service

KVM: x86: selftests: test simultaneous uses of V_IRQ from L1 and L0
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 14 Sep 2021 15:48:13 +0000 (18:48 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Sep 2021 14:05:07 +0000 (10:05 -0400)
commit1ad32105d78e4b5da60688eca014bcd45271318f
tree726d035b835b30525426ce2da0406f1a663a9070
parentaee77e1169c1900fe4248dc186962e745b479d9e
KVM: x86: selftests: test simultaneous uses of V_IRQ from L1 and L0

Test that if:

* L1 disables virtual interrupt masking, and INTR intercept.

* L1 setups a virtual interrupt to be injected to L2 and enters L2 with
  interrupts disabled, thus the virtual interrupt is pending.

* Now an external interrupt arrives in L1 and since
  L1 doesn't intercept it, it should be delivered to L2 when
  it enables interrupts.

  to do this L0 (abuses) V_IRQ to setup an
  interrupt window, and returns to L2.

* L2 enables interrupts.
  This should trigger the interrupt window,
  injection of the external interrupt and delivery
  of the virtual interrupt that can now be done.

* Test that now L2 gets those interrupts.

This is the test that demonstrates the issue that was
fixed in the previous patch.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20210914154825.104886-3-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/.gitignore
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/x86_64/svm_int_ctl_test.c [new file with mode: 0644]