Skip to content

KVM: nSVM: Check addresses of MSR bitmap and IO bitmap tables on vmrun of nested guests

Krish Sadhukhan kvm 7 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest7 patches 16 repliesIn review
  2. v65 patches 4 repliesSuperseded
  3. v55 patches 1 replySuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v45 patches3 repliesSuperseded
v35 patches1 replySuperseded
v23 patches2 repliesSuperseded
v13 patches1 replySuperseded

Changes in v7 from the cover letter

1. In patch# 4, the logic in nested_svm_check_bitmap_pa() has been fixed. The size of IOPM passed to nested_svm_check_bitmap_pa() has also been corrected. Indentation has been improved.
2. In patch# 1, the names of the #defines have been changed.
3. In patch# 2, a new exit code is defined to differentiate between consistency failures and failures after switching to guest mode, because tests need to know the exact failure instead of SVM_EXIT_ERR. This exit code is similar to what nVMX does and appears to be the best solution to differentiate the above-mentioned error scenarios.
4. In patch# 3, code that unset bit 11:0 of the MSRPm and IOPM tables, has been removed because hardware doesn't care about the value these bits. Also, tests need to verify hardware behavior. So if these bits are unset, the checks in nested_svm_check_bitmap_pa() do not work as expected.
5. In patch# 7, additional test cases have been added.

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7KVM: SVM: Define actual size of IOPM and MSRPM tablesarch/x86/kvm/svm/svm.c arch/x86/kvm/svm/svm.h+13 -100 replies
2/7KVM: nSVM: Define an exit code to reflect consistency check failurearch/x86/include/uapi/asm/svm.h arch/x86/kvm/svm/nested.c+2 -14 replies
3/7KVM: nSVM: No need to set bits 11:0 in MSRPM and IOPM bitmapsarch/x86/kvm/svm/nested.c+0 -211 replies
4/7nSVM: Check addresses of MSR and IO permission mapsarch/x86/kvm/svm/nested.c+22 -30 replies
5/7SVM: Use ALIGN macro when aligning 'io_bitmap_area'x86/svm.c+1 -10 replies
6/7nSVM: Define an exit code to reflect consistency check failurex86/svm.h+1 -00 replies
7/7nSVM: Test addresses of MSR and IO permissions mapsx86/svm_tests.c+77 -10 replies

Reviews trailers per patch

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

Read the v7 thread

Cover letter [PATCH 0/7 v7] KVM: nSVM: Check addresses of MSR bitmap and IO bitmap tables on vmrun of nested guests

v6 -> v7:
1. In patch# 4, the logic in nested_svm_check_bitmap_pa() has been fixed. The size of IOPM passed to nested_svm_check_bitmap_pa() has also been corrected. Indentation has been improved.
2. In patch# 1, the names of the #defines have been changed.
3. In patch# 2, a new exit code is defined to differentiate between consistency failures and failures after switching to guest mode, because tests need to know the exact failure instead of SVM_EXIT_ERR. This exit code is similar to what nVMX does and appears to be the best solution to differentiate the above-mentioned error scenarios.
4. In patch# 3, code that unset bit 11:0 of the MSRPm and IOPM tables, has been removed because hardware doesn't care about the value these bits. Also, tests need to verify hardware behavior. So if these bits are unset, the checks in nested_svm_check_bitmap_pa() do not work as expected.
5. In patch# 7, additional test cases have been added.

[PATCH 1/7 v7] KVM: SVM: Define actual size of IOPM and MSRPM tables [PATCH 2/7 v7] KVM: nSVM: Define an exit code to reflect consistency [PATCH 3/7 v7] KVM: nSVM: No need to set bits 11:0 in MSRPM and IOPM [PATCH 4/7 v7] nSVM: Check addresses of MSR and IO permission maps [PATCH 5/7 v7] SVM: Use ALIGN macro when aligning 'io_bitmap_area' [PATCH 6/7 v7] nSVM: Define an exit code to reflect consistency check [PATCH 7/7 v7] nSVM: Test addresses of MSR and IO permissions maps

 arch/x86/include/uapi/asm/svm.h |  1 +
 arch/x86/kvm/svm/nested.c       | 29 +++++++++++++++++++++++------
 arch/x86/kvm/svm/svm.c          | 20 ++++++++++----------
 arch/x86/kvm/svm/svm.h          |  3 +++
 4 files changed, 37 insertions(+), 16 deletions(-)

Krish Sadhukhan (4):
KVM: SVM: Define actual size of IOPM and MSRPM tables
KVM: nSVM: Define an exit code to reflect consistency check failure
KVM: nSVM: No need to set bits 11:0 in MSRPM and IOPM bitmaps
nSVM: Check addresses of MSR and IO permission maps

 x86/svm.c       |  2 +-
 x86/svm.h       |  1 +
 x86/svm_tests.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 79 insertions(+), 2 deletions(-)

Krish Sadhukhan (3):
SVM: Use ALIGN macro when aligning 'io_bitmap_area'
nSVM: Define an exit code to reflect consistency check failure
nSVM: Test addresses of MSR and IO permissions maps