Skip to content

KVM: selftests: Fix sync_regs race tests on AMD

Sean Christopherson kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: selftests: Reload "good" vCPU state if vCPU hits shutdowntools/testing/selftests/kvm/x86_64/sync_regs_test.c+13 -10 replies
2/2KVM: selftests: Explicit set #UD when *potentially* injecting exceptiontools/testing/selftests/kvm/x86_64/sync_regs_test.c+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: selftests: Fix sync_regs race tests on AMD

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

Signature · 1 line
2.42.0.rc1.204.g551eb34607-goog