Skip to content

KVM: nSVM: nested VMSAVE/VMLOAD fixes

Yosry Ahmed kvm lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulationarch/x86/kvm/svm/svm.c+3 -20 replies
2/4KVM: SVM: Stop toggling virtual VMSAVE/VMLOAD on intercept recalcarch/x86/kvm/svm/svm.c+8 -20 replies
3/4KVM: selftests: Add a selftests for nested VMLOAD/VMSAVEtools/testing/selftests/kvm/Makefile.kvm tools/testing/selftests/kvm/include/x86/processor.h tools/testing/selftests/kvm/x86/nested_vmsave_vmload_test.c+199 -00 replies
4/4RFC: KVM: SVM: WARN if VMSAVE/VMLOAD are not intercepted or virtualizedarch/x86/kvm/svm/svm.c+8 -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/4] KVM: nSVM: nested VMSAVE/VMLOAD fixes

A couple of fixes for nested VMLOAD/VMSAVE and a selftest that verifies correct behavior. The test fails without patch 1.

Patch 4 is a proposed added WARNING, I am not sure if such warnings are generally acceptable and if that's the correct place for it (hence RFC), but I think it's useful to WARN if VMSAVE/VMLOAD are neither intercepted nor virtualized by the CPU, because it means that the guest is directly accessing host memory with them, a massive security hole.

The warning doesn't fire with or without the fixes, but at some point I thought there might be such a security bug, and having a warning will give me some peace of mind.

Yosry Ahmed (4):
KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulation
KVM: SVM: Stop toggling virtual VMSAVE/VMLOAD on intercept recalc
KVM: selftests: Add a selftests for nested VMLOAD/VMSAVE
RFC: KVM: SVM: WARN if VMSAVE/VMLOAD are not intercepted or
virtualized

 arch/x86/kvm/svm/svm.c                        |  23 +-
 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../selftests/kvm/include/x86/processor.h     |   1 +
 .../kvm/x86/nested_vmsave_vmload_test.c       | 197 ++++++++++++++++++
 4 files changed, 218 insertions(+), 4 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86/nested_vmsave_vmload_test.c
Signature · 1 line
2.52.0.457.g6b5491de43-goog