]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Flush current VPID (L1 vs. L2) for KVM_REQ_TLB_FLUSH_GUEST
authorSean Christopherson <seanjc@google.com>
Thu, 25 Nov 2021 01:49:43 +0000 (01:49 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Nov 2021 12:06:58 +0000 (07:06 -0500)
commit229853bdcb5f1628932e5a2a6e1351b652ceb696
treeea9999d967bfd1abacf93d65bf52f81d30476acd
parent86b72ed08ac7622e4594a99e761fcd226f47b99e
KVM: nVMX: Flush current VPID (L1 vs. L2) for KVM_REQ_TLB_FLUSH_GUEST

Flush the current VPID when handling KVM_REQ_TLB_FLUSH_GUEST instead of
always flushing vpid01.  Any TLB flush that is triggered when L2 is
active is scoped to L2's VPID (if it has one), e.g. if L2 toggles CR4.PGE
and L1 doesn't intercept PGE writes, then KVM's emulation of the TLB
flush needs to be applied to L2's VPID.

Reported-by: Lai Jiangshan <jiangshanlai+lkml@gmail.com>
Fixes: ae0546e4779a ("KVM: nVMX: Sync all PGDs on nested transition with shadow paging")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211125014944.536398-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c