diff options
| author | Sean Christopherson <seanjc@google.com> | 2025-11-22 01:34:42 +0300 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-01-08 22:58:22 +0300 |
| commit | f74bb1d2eda1b77c37f35876ca0c44be345e2b1f (patch) | |
| tree | e0aab733a9bdffa9b6a850989a9f9dbc1e1e062f | |
| parent | 70b02809ded96ec790721cd5061e20b63b622310 (diff) | |
| download | linux-f74bb1d2eda1b77c37f35876ca0c44be345e2b1f.tar.xz | |
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>
| -rw-r--r-- | arch/x86/kvm/vmx/nested.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 72fcb1228af4..f5ebd84a2f6b 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -4028,7 +4028,8 @@ static int vmx_complete_nested_posted_interrupt(struct kvm_vcpu *vcpu) } } - nested_mark_vmcs12_pages_dirty(vcpu); + kvm_vcpu_map_mark_dirty(vcpu, &vmx->nested.virtual_apic_map); + kvm_vcpu_map_mark_dirty(vcpu, &vmx->nested.pi_desc_map); return 0; mmio_needed: |
