mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: selftests: Fix sync_regs race tests on AMD
@ 2023-08-17 23:34 Sean Christopherson
  2023-08-17 23:34 ` [PATCH 1/2] KVM: selftests: Reload "good" vCPU state if vCPU hits shutdown Sean Christopherson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sean Christopherson @ 2023-08-17 23:34 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini; +Cc: kvm, linux-kernel, Michal Luczaj

The recently introduced sync_regs subtests to detect TOCTOU bugs hang on
AMD because KVM synthesizes INIT on triple fault shutdown (because AMD says
the VMCB is undefined after shutdown).  Fix it by loading known good state
if a shutdown occurs.

Patch two explicitly injects #UD as the "good" vector so that the test
doesn't rely on KVM inadvertantly setting the vector to #DE (old, buggy
behavior).

Sean Christopherson (2):
  KVM: selftests: Reload "good" vCPU state if vCPU hits shutdown
  KVM: selftests: Explicit set #UD when *potentially* injecting
    exception

 .../selftests/kvm/x86_64/sync_regs_test.c       | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)


base-commit: b6d40d24bb2eae6d4c2d4799ddbffcf7bae663db
-- 
2.42.0.rc1.204.g551eb34607-goog


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-25 19:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-17 23:34 [PATCH 0/2] KVM: selftests: Fix sync_regs race tests on AMD Sean Christopherson
2023-08-17 23:34 ` [PATCH 1/2] KVM: selftests: Reload "good" vCPU state if vCPU hits shutdown Sean Christopherson
2023-08-17 23:34 ` [PATCH 2/2] KVM: selftests: Explicit set #UD when *potentially* injecting exception Sean Christopherson
2023-08-25 19:01 ` [PATCH 0/2] KVM: selftests: Fix sync_regs race tests on AMD Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®