Skip to content

x86: nSVM: Fix bugs in LBRV tests

Sean Christopherson kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6x86: nSVM: Set up a guest stack in LBRV testsx86/svm.c x86/svm.h x86/svm_tests.c+11 -60 replies
2/6lib: Expose a subset of VMX's assertion macroslib/util.h x86/vmx.h+34 -290 replies
3/6x86: Add defines for the various LBR record bit definitionslib/x86/msr.h+11 -00 replies
4/6x86: nSVM: Ignore mispredict bit in LBR recordsx86/svm_tests.c+29 -360 replies
5/6x86: nSVM: Replace check_dbgctl() with TEST_EXPECT_EQ() in LBRV testx86/svm_tests.c+6 -150 replies
6/6x86: nSVM: Print out RIP and LBRs from VMCB if LBRV guest test failsx86/svm_tests.c+10 -80 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [kvm-unit-tests PATCH 0/6] x86: nSVM: Fix bugs in LBRV tests

Fix bugs in the LBRV tests, and try to make them a bit less painful to debug (goes from "excruitating" to just "awful"). The tests have been failing on our Milan systems for quite some time, but debugging them was painful and I wasn't sufficiently motivated until I wanted to clean up KVM's code :-/

The Milan failures are due to AMD shoving a "mispredict" bit in the LBR records, i.e. the tests fail if the CPU mispredicts the branch being tested. Debug was especially difficult because the tests also neglected to setup a guest stack, i.e. adding debug code created a completely different failure that looked similar at first glance.

Sean Christopherson (6):
x86: nSVM: Set up a guest stack in LBRV tests
lib: Expose a subset of VMX's assertion macros
x86: Add defines for the various LBR record bit definitions
x86: nSVM: Ignore mispredict bit in LBR records
x86: nSVM: Replace check_dbgctl() with TEST_EXPECT_EQ() in LBRV test
x86: nSVM: Print out RIP and LBRs from VMCB if LBRV guest test fails

 lib/util.h      |  31 ++++++++++++++
 lib/x86/msr.h   |  11 +++++
 x86/svm.c       |   7 +++-
 x86/svm.h       |   2 +-
 x86/svm_tests.c | 108 +++++++++++++++++++++---------------------------
 x86/vmx.h       |  32 ++------------
 6 files changed, 99 insertions(+), 92 deletions(-)

base-commit: 02d8befe99f8205d4caea402d8b0800354255681

Signature · 1 line
2.41.0.162.gfafddb0af9-goog