KVM: SVM: Add Page Modification Logging (PML) support
Status from this message: Applied to kvm-x86 misc, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v8 Latest8 patches 7 repliesApplied
- v77 patches 6 repliesSuperseded
- v67 patches 21 repliesSuperseded
Earlier versions · 5
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v5 | 8 patches | 13 replies | Superseded | |
| v4 | 7 patches | 17 replies | Superseded | |
| v3 | 5 patches | 6 replies | Superseded | |
| v2 | 4 patches | 8 replies | Superseded | |
| v1 RFC | 4 patches | 14 replies | Superseded |
Changes in v8 from the cover letter
* Rebased on latest kvm/next
* Drop redundant pml_addr=0 in nested_vmcb02_prepare_control() (Yosry)
* Fix misleading comment, pml_index=-1 is hardening not stale-data cleanup (Yosry, Sean)
* Route nested SVM_EXIT_PML_FULL to KVM and treat it as unexpected exit (Sean)
* Refactor update_cpu_dirty_logging() to common code as a separate pre-patch (Sean)
Patches in v8 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | KVM: VMX: Pass @vcpu, not @vmx to init_vmcs()arch/ | +13 | 0 replies | |
| 2/8 | KVM: x86: Move PML page to common vcpu arch structurearch/ arch/ arch/ +1 more | +17 | 0 replies | |
| 3/8 | KVM: x86: Carve out PML flush routinearch/ arch/ arch/ | +35 | 0 replies | |
| 4/8 | KVM: VMX: Use cpu_dirty_log_size instead of enable_pml for PML checksarch/ | +1 | 0 replies | |
| 5/8 | KVM: x86: Carve out common dirty logging updatearch/ arch/ arch/ +3 more | +23 | 0 replies | |
| 6/8 | x86/cpufeatures: Add Page modification loggingarch/ arch/ | +2 | 1 reply | |
| 7/8 | KVM: SVM: Use BIT_ULL for 64-bit misc_ctl bit definitionsarch/ | +4 | 0 replies | |
| 8/8 | KVM: SVM: Add Page modification logging supportarch/ arch/ arch/ +3 more | +127 | 3 replies |
Reviews trailers per patch
6 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Kai Huang | Pankaj Gupta | Borislav Petkov (AMD) |
|---|---|---|---|
| 1/8 | R-b | ||
| 2/8 | R-b | ||
| 3/8 | R-b | ||
| 4/8 | R-b | R-b | |
| 5/8 | |||
| 6/8 | A-b | ||
| 7/8 | |||
| 8/8 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v8 0/8] KVM: SVM: Add Page Modification Logging (PML) support
This series implements Page Modification Logging (PML) for guests on select AMD Zen6 and later processors, bringing hardware-assisted dirty logging support. PML is designed to track guest modified memory pages. PML enables the hypervisor to identify which pages in a guest's memory have been modified since the last checkpoint or during live migration. More details can be found in the latest AMD APM Volume 2 (System Programming), section "15.25.15 Page Modification Logging".
The PML feature uses two new VMCB fields (PML_ADDR and PML_INDEX) and generates a VMEXIT when the 4KB log buffer becomes full.
The feature is enabled by default when hardware support is detected and can be disabled via the 'pml' module parameter.
Changelog:
v8:
* Rebased on latest kvm/next
* Drop redundant pml_addr=0 in nested_vmcb02_prepare_control() (Yosry)
* Fix misleading comment, pml_index=-1 is hardening not stale-data cleanup (Yosry, Sean)
* Route nested SVM_EXIT_PML_FULL to KVM and treat it as unexpected exit (Sean)
* Refactor update_cpu_dirty_logging() to common code as a separate pre-patch (Sean)
v7: https://lore.kernel.org/kvm/[email protected]/
* Swap patch order to avoid adding @pml_page parameter only to remove it (Sean)
* Add Sean's prep patch to pass @vcpu to init_vmcs() instead of @vmx, cleaning up all vmx->vcpu usage (Sean)
* Drop guard(svm_vmcb01) patch; access vmcb01 directly in svm_update_cpu_dirty_logging() since VMCB is just memory (Sean, Yosry)
* Only initialize PML index on reset, leave unchanged on INIT to avoid discarding unflushed entries. PML_INDEX in the control area remains valid after intercepted SHUTDOWN (Sashiko, Sean, Kai)
Nikunj A Dadhania (7):
KVM: x86: Move PML page to common vcpu arch structure
KVM: x86: Carve out PML flush routine
KVM: VMX: Use cpu_dirty_log_size instead of enable_pml for PML checks
KVM: x86: Carve out common dirty logging update x86/cpufeatures: Add Page modification logging
KVM: SVM: Use BIT_ULL for 64-bit misc_ctl bit definitions
KVM: SVM: Add Page modification logging support
Sean Christopherson (1):
KVM: VMX: Pass @vcpu, not @vmx to init_vmcs()
arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/kvm_host.h | 4 +- arch/x86/include/asm/svm.h | 14 ++-- arch/x86/include/uapi/asm/svm.h | 2 + arch/x86/kernel/cpu/scattered.c | 1 + arch/x86/kvm/svm/nested.c | 14 ++++ arch/x86/kvm/svm/sev.c | 2 +- arch/x86/kvm/svm/svm.c | 106 ++++++++++++++++++++++++++++- arch/x86/kvm/svm/svm.h | 1 + arch/x86/kvm/vmx/main.c | 4 +- arch/x86/kvm/vmx/vmx.c | 82 +++++++--------------- arch/x86/kvm/vmx/vmx.h | 9 +-- arch/x86/kvm/vmx/x86_ops.h | 2 +- arch/x86/kvm/x86.c | 48 ++++++++++++- arch/x86/kvm/x86.h | 7 ++ 15 files changed, 220 insertions(+), 77 deletions(-)
base-commit: d4b7fb647204f0c81dfeae2d1a708e4d858e0c94
Signature · 1 line
2.48.1