Skip to content

KVM: nSVM: Minor post-war fixups

Yosry Ahmed 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: nSVM: Simplify error handling of nested_svm_copy_vmcb12_to_cache()arch/x86/kvm/svm/nested.c+12 -110 replies
2/2KVM: selftests: Actually check #GP on VMRUN with invalid vmcb12tools/testing/selftests/kvm/x86/svm_nested_invalid_vmcb12_gpa.c+14 -170 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: nSVM: Minor post-war fixups

A couple of fixups in the aftermath of all nSVM patches, the first one is just a cleanup suggested offlist by Sean, and the second is a fix for the test to make sure it's checking #GP on VMRUN not VMLOAD.

In all honestly, I am not sure *why* the test was passing and a #GP was generated on VMLOAD with a very large but valid GPA. vls=1, so KVM should not be intercepting VMLOAD (in which case it would inject the #GP). A #NPF is generated on the VMLOAD, and through tracing I found out that kvm_mmu_page_fault() returns 1 (RETRY) to npf_interception(). There shouldn't be a corresponding memslot, so I am not sure if KVM stuffed an invalid mapping in the NPTs, or if KVM did nothing and the CPU #GP due to an infinite #NPF loop (although npf_interception() was only called once). Anyway, figuring that out is irrelevant to the fixup, which makes sure we're actually getting #GP on VMRUN.

Yosry Ahmed (2):
KVM: nSVM: Simplify error handling of

    nested_svm_copy_vmcb12_to_cache()

KVM: selftests: Actually check #GP on VMRUN with invalid vmcb12

 arch/x86/kvm/svm/nested.c                     | 23 +++++++-------
 .../kvm/x86/svm_nested_invalid_vmcb12_gpa.c   | 31 +++++++++----------
 2 files changed, 26 insertions(+), 28 deletions(-)

base-commit: 5128b972fb2801ad9aca54d990a75611ab5283a9

Signature · 1 line
2.53.0.473.g4a7958ca14-goog