x86/nSVM: Don't clear TLB_CONTROL on #VMEXIT
PATCH 1/1 x86/nSVM: Don't clear TLB_CONTROL on #VMEXIT
nsvm_vmcb_prepare4vmexit() zeroes TLB_CONTROL in the L1-provided VMCB. That VMCB is mapped writable, so the store lands in L1's memory and L1 sees a field it wrote come back as 0.
APM vol 2 rev 3.45 15.16.1 (p.550): "The VMRUN instruction reads, but does not change, the value of the TLB_CONTROL field."
--- xen/arch/x86/hvm/svm/nestedsvm.c | 3 --- 1 file changed, 3 deletions(-)
xen/arch/x86/hvm/svm/nestedsvm.c +0 -3
@@ -991,9 +991,6 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)/* ASID */ /* vmcb_set_asid(ns_vmcb, vmcb_get_asid(n2vmcb)); */ -/* TLB control */ - ns_vmcb->tlb_control =0 ; -/* Virtual Interrupts */ ns_vmcb->_vintr = n2vmcb->_vintr;if ( !svm->ns_hostflags.fields.vintrmask )
Signature · 1 line
2.52.0
Le 20/09/2026 à 05:37, Lin Liu a écrit :
Quoted 19 lines
nsvm_vmcb_prepare4vmexit()zeroesTLB_CONTROLin the L1-provided VMCB. That VMCB is mapped writable, so the store lands in L1's memory and L1 sees a field it wrote come back as 0.APM vol 2 rev 3.45 15.16.1 (p.550): "The VMRUN instruction reads, but does not change, the value of the
TLB_CONTROLfield."Fixes 9a779e4fc161 ("Implement SVM specific part for Nested Virtualization")Assisted-by Claude:claude-opus-5Signed-off-by Lin Liu <[email protected]>--- xen/arch/x86/hvm/svm/nestedsvm.c | 3 --- 1 file changed, 3 deletions(-)xen/arch/x86/hvm/svm/nestedsvm.c +0
-0
xen/arch/x86/hvm/svm/nestedsvm.c nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs) · line 996
Quoted 9 lines
xen/arch/x86/hvm/svm/nestedsvm.c +0
-3@@ -991,9 +991,6 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_user_regs *regs)/* ASID */ /* vmcb_set_asid(ns_vmcb, vmcb_get_asid(n2vmcb)); */ -/* TLB control */ - ns_vmcb->tlb_control =0 ; -/* Virtual Interrupts */ ns_vmcb->_vintr = n2vmcb->_vintr;if ( !svm->ns_hostflags.fields.vintrmask )