From: Fred Griffoul Date: Fri, 21 Nov 2025 22:34:44 +0000 (-0800) Subject: KVM: nVMX: Mark APIC access page dirty when syncing vmcs12 pages X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9d7134679ebf038c3d1d0b324e378dfc464d198;p=thirdparty%2Flinux.git KVM: nVMX: Mark APIC access page dirty when syncing vmcs12 pages For consistency with commit 7afe79f5734a ("KVM: nVMX: Mark vmcs12's APIC access page dirty when unmapping"), which marks the page dirty during unmap operations, also mark it dirty during vmcs12 page synchronization. Signed-off-by: Fred Griffoul [sean: use kvm_vcpu_map_mark_dirty()] Link: https://patch.msgid.link/20251121223444.355422-6-seanjc@google.com Signed-off-by: Sean Christopherson --- diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index b38bdbd7a7fa8..1f4d15cc898ed 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -6382,10 +6382,7 @@ static void nested_vmx_mark_all_vmcs12_pages_dirty(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); - /* - * Don't need to mark the APIC access page dirty; it is never - * written to by the CPU during APIC virtualization. - */ + kvm_vcpu_map_mark_dirty(vcpu, &vmx->nested.apic_access_page_map); kvm_vcpu_map_mark_dirty(vcpu, &vmx->nested.virtual_apic_map); kvm_vcpu_map_mark_dirty(vcpu, &vmx->nested.pi_desc_map); }