All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] KVM: x86/SVM: Fixes for AMD ERAPS virtualization
@ 2026-07-17 23:05 Jim Mattson
  2026-07-17 23:05 ` [PATCH v2 1/3] KVM: SVM: Configure ALLOW_LARGER_RAP in svm_vcpu_after_set_cpuid() Jim Mattson
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jim Mattson @ 2026-07-17 23:05 UTC (permalink / raw)
  To: jmattson; +Cc: amit.shah, kvm, pbonzini, seanjc, venkateshs, yosry

This series fixes three issues in KVM's virtualization of Enhanced Return
Address Predictor Security (ERAPS):

Patch 1 adds ALLOW_LARGER_RAP configuration to svm_vcpu_after_set_cpuid()
so that the BSP will be properly configured. The ALLOW_LARGER_RAP
configuration in init_vmcb() is retained to restore the bit after the VMCB
is cleared on the VCPU triple fault path.

Patch 2 moves ERAPS dirty tracking into svm_flush_tlb_asid(). AMD ERAPS
architecturally requires clearing the Return Address Predictor (RAP/RSB) on
all implicit TLB invalidations. Centralizing dirty tracking in
svm_flush_tlb_asid() ensures that local/current ASID flushes
(e.g. same-value CR3 reloads under shadow paging, CR4.PAE/SMEP toggles,
single-context INVPCID) correctly mark ERAPS dirty and clear the RAP on the
next VMRUN.

Patch 3 adds a KVM_REQ_TLB_FLUSH_GUEST request to kvm_mtrr_set_msr() when
MTRR MSRs are written via WRMSR. Per AMD APM and Intel SDM, MTRR writes are
implicit TLB invalidations. Requesting a guest TLB flush restores x86
architectural compliance and ensures ERAPS RAP clearing on MTRR writes.

v1 -> v2:

* Restored the ALLOW_LARGER_RAP configuration in init_vmcb() [Sashiko]

v1: https://lore.kernel.org/kvm/20260716232524.2092085-1-jmattson@google.com/

Jim Mattson (3):
  KVM: SVM: Configure ALLOW_LARGER_RAP in svm_vcpu_after_set_cpuid()
  KVM: SVM: Dirty ERAPS register on all ASID TLB flushes
  KVM: x86: Flush guest TLB on MTRR MSR writes

 arch/x86/kvm/mtrr.c    |  1 +
 arch/x86/kvm/svm/svm.c | 16 ++++++++--------
 2 files changed, 9 insertions(+), 8 deletions(-)


base-commit: 58717b2a1365d06c8c64b72aa948541b53fe31eb
-- 
2.55.0.229.g6434b31f56-goog


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

end of thread, other threads:[~2026-07-20 16:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17 23:05 [PATCH v2 0/3] KVM: x86/SVM: Fixes for AMD ERAPS virtualization Jim Mattson
2026-07-17 23:05 ` [PATCH v2 1/3] KVM: SVM: Configure ALLOW_LARGER_RAP in svm_vcpu_after_set_cpuid() Jim Mattson
2026-07-20 15:52   ` Sean Christopherson
2026-07-20 16:12     ` Sean Christopherson
2026-07-17 23:05 ` [PATCH v2 2/3] KVM: SVM: Dirty ERAPS register on all ASID TLB flushes Jim Mattson
2026-07-20 15:33   ` Sean Christopherson
2026-07-20 16:41     ` Jim Mattson
2026-07-17 23:05 ` [PATCH v2 3/3] KVM: x86: Flush guest TLB on MTRR MSR writes Jim Mattson
2026-07-20 15:46   ` Sean Christopherson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.