Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] KVM: nSVM: Emulate Page Modification Logging
@ 2026-10-15 10:39 Nikunj A Dadhania
  2026-10-15 10:39 ` [RFC PATCH 1/5] KVM: x86/mmu: Log dirty GPAs only for the nested GPA walk Nikunj A Dadhania
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Nikunj A Dadhania @ 2026-10-15 10:39 UTC (permalink / raw)
  To: kvm, seanjc, pbonzini
  Cc: thomas.lendacky, mlevitsk, joao.m.martins, nikunj, kai.huang,
	yosry

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
-- 
2.48.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-10-15 11:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 10:39 [RFC PATCH 0/5] KVM: nSVM: Emulate Page Modification Logging Nikunj A Dadhania
2026-10-15 10:39 ` [RFC PATCH 1/5] KVM: x86/mmu: Log dirty GPAs only for the nested GPA walk Nikunj A Dadhania
2026-10-15 10:55   ` sashiko-bot
2026-10-15 10:39 ` [RFC PATCH 2/5] KVM: nSVM: Add nested PML emulation Nikunj A Dadhania
2026-10-15 11:03   ` sashiko-bot
2026-10-15 10:39 ` [RFC PATCH 3/5] KVM: nSVM: Advertise PML to L1 Nikunj A Dadhania
2026-10-15 10:39 ` [RFC PATCH 4/5] KVM: selftests: nVMX: Add nested PML coverage to nested_dirty_log_test Nikunj A Dadhania
2026-10-15 11:04   ` sashiko-bot
2026-10-15 10:39 ` [RFC PATCH 5/5] KVM: selftests: nSVM: " Nikunj A Dadhania
2026-10-15 11:04   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox