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)
committerRadim Krčmář <rkrcmar@redhat.com>
Wed, 2 Aug 2017 20:41:04 +0000 (22:41 +0200)
commitc9f04407f2e0b3fc9ff7913c65fcfcb0a4b61570
tree10a40ecad7b4962fde8799db3e5f2f7e15eb6e64
parent8ca44e88c32f86721c6ceca8e5e9b0b40c98907d
KVM: nVMX: mark vmcs12 pages dirty on L2 exit

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>
arch/x86/kvm/vmx.c