KVM: nVMX: mark vmcs12 pages dirty on L2 exit
authorDavid Matlack <dmatlack@google.com>
Tue, 1 Aug 2017 21:00:40 +0000 (14:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Feb 2018 11:36:02 +0000 (12:36 +0100)
commitb7649e1776706c28d837d423412c1763900e521e
tree5e1d13822c880fe61431dfc0b70c1168bbaca32a
parent1edccf20b9d82d318f0003ad67b8afed299ae93e
KVM: nVMX: mark vmcs12 pages dirty on L2 exit

(cherry picked from commit c9f04407f2e0b3fc9ff7913c65fcfcb0a4b61570)

The host physical addresses of L1's Virtual APIC Page and Posted
Interrupt descriptor are loaded into the VMCS02. The CPU may write
to these pages via their host physical address while L2 is running,
bypassing address-translation-based dirty tracking (e.g. EPT write
protection). Mark them dirty on every exit from L2 to prevent them
from getting out of sync with dirty tracking.

Also mark the virtual APIC page and the posted interrupt descriptor
dirty when KVM is virtualizing posted interrupt processing.

Signed-off-by: David Matlack <dmatlack@google.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/vmx.c