Skip to content

RFC KVM: nSVM: Emulate Page Modification Logging

Nikunj A Dadhania kvm sashiko-reviews 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: x86/mmu: Log dirty GPAs only for the nested GPA walkarch/x86/kvm/mmu/paging_tmpl.h+3 -13 replies
2/5KVM: nSVM: Add nested PML emulationarch/x86/kvm/mmu/paging_tmpl.h arch/x86/kvm/svm/nested.c arch/x86/kvm/svm/svm.h+83 -23 replies
3/5KVM: nSVM: Advertise PML to L1arch/x86/include/asm/kvm_host.h arch/x86/kvm/cpuid.c arch/x86/kvm/reverse_cpuid.h +2 more+17 -10 replies
4/5KVM: selftests: nVMX: Add nested PML coverage to nested_dirty_log_testtools/testing/selftests/kvm/include/x86/vmx.h tools/testing/selftests/kvm/lib/x86/vmx.c tools/testing/selftests/kvm/x86/nested_dirty_log_test.c+171 -11 reply
5/5KVM: selftests: nSVM: Add nested PML coverage to nested_dirty_log_testtools/testing/selftests/kvm/include/x86/processor.h tools/testing/selftests/kvm/include/x86/svm.h tools/testing/selftests/kvm/include/x86/svm_util.h +2 more+58 -41 reply

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/5] KVM: nSVM: Emulate Page Modification Logging

Emulate Page Modification Logging for nested SVM guests, allowing an L1 hypervisor to use PML to track dirty pages in its L2 guests, e.g. for nested live migration. Hardware PML is never enabled for L2; KVM instead logs L2 GPAs into L1's buffer during the nested NPT walk and synthesizes PML Full exits when it fills, following the existing nVMX emulation.

Based on kvm-x86/next (dea4f6380f4e).

Tested on AMD hardware with PML:

- A 16G 2-vCPU L2 guest running stress-ng was ping-pong migrated 100 times within L1, with liveness and memory writes checked after each iteration.

- nested_dirty_log_test and dirty_log_test pass with npt=1 pml=1, npt=1 pml=0 and npt=0, with no kernel warnings.

Nikunj A Dadhania (5):
KVM: x86/mmu: Log dirty GPAs only for the nested GPA walk
KVM: nSVM: Add nested PML emulation
KVM: nSVM: Advertise PML to L1
KVM: selftests: nVMX: Add nested PML coverage to nested_dirty_log_test
KVM: selftests: nSVM: Add nested PML coverage to nested_dirty_log_test

 arch/x86/include/asm/kvm_host.h               |   1 +
 arch/x86/kvm/cpuid.c                          |   6 +-
 arch/x86/kvm/mmu/paging_tmpl.h                |   6 +-
 arch/x86/kvm/reverse_cpuid.h                  |   5 +
 arch/x86/kvm/svm/nested.c                     |  78 ++++++-
 arch/x86/kvm/svm/svm.c                        |   3 +
 arch/x86/kvm/svm/svm.h                        |   8 +
 .../selftests/kvm/include/x86/processor.h     |   1 +
 tools/testing/selftests/kvm/include/x86/svm.h |   6 +-
 .../selftests/kvm/include/x86/svm_util.h      |   4 +
 tools/testing/selftests/kvm/include/x86/vmx.h |   5 +
 tools/testing/selftests/kvm/lib/x86/svm.c     |   3 +
 tools/testing/selftests/kvm/lib/x86/vmx.c     |  18 ++
 .../selftests/kvm/x86/nested_dirty_log_test.c | 191 +++++++++++++++++-
 14 files changed, 329 insertions(+), 6 deletions(-)

base-commit: dea4f6380f4ec96e8f3b0aaf2343764bd0d25ef4

Signature · 1 line
2.48.1