Skip to content

Commit f74bb1d

Browse files
committed
KVM: nVMX: Precisely mark vAPIC and PID maps dirty when delivering nested PI
Explicitly mark the vmcs12 vAPIC and PI descriptor pages as dirty when delivering a nested posted interrupt instead of marking all vmcs12 pages as dirty. This will allow marking the APIC access page (and any future vmcs12 pages) as dirty in nested_mark_vmcs12_pages_dirty() without over- dirtying in the nested PI case. Manually marking the vAPIC and PID pages as dirty also makes the flow a bit more self-documenting, e.g. it's not obvious at first glance that vmx->nested.pi_desc is actually a host kernel mapping of a vmcs12 page. No functional change intended. Link: https://patch.msgid.link/20251121223444.355422-4-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 70b0280 commit f74bb1d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

arch/x86/kvm/vmx/nested.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4028,7 +4028,8 @@ static int vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu)
40284028
}
40294029
}
40304030

4031-
nested_mark_vmcs12_pages_dirty(vcpu);
4031+
kvm_vcpu_map_mark_dirty(vcpu, &vmx->nested.virtual_apic_map);
4032+
kvm_vcpu_map_mark_dirty(vcpu, &vmx->nested.pi_desc_map);
40324033
return 0;
40334034

40344035
mmio_needed:

0 commit comments

Comments
 (0)