OSDN Git Service

KVM: nVMX: Do not mark vmcs02->apic_access_page as dirty when unpinning
authorLiran Alon <liran.alon@oracle.com>
Wed, 20 Nov 2019 22:31:47 +0000 (00:31 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Nov 2019 11:03:48 +0000 (12:03 +0100)
commitb11494bcabba7383c9db65132f6f73d64fb1407d
tree1b8701f55b2ea52113ed9161890140be7a0d7168
parent46f4f0aabc61bfd365e1eb3c8a6d766d1a49cf32
KVM: nVMX: Do not mark vmcs02->apic_access_page as dirty when unpinning

vmcs->apic_access_page is simply a token that the hypervisor puts into
the PFN of a 4KB EPTE (or PTE if using shadow-paging) that triggers
APIC-access VMExit or APIC virtualization logic whenever a CPU running
in VMX non-root mode read/write from/to this PFN.

As every write either triggers an APIC-access VMExit or write is
performed on vmcs->virtual_apic_page, the PFN pointed to by
vmcs->apic_access_page should never actually be touched by CPU.

Therefore, there is no need to mark vmcs02->apic_access_page as dirty
after unpin it on L2->L1 emulated VMExit or when L1 exit VMX operation.

Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c