]> git.itanic.dy.fi Git - linux-stable/commit
KVM: x86: hyper-v: L2 TLB flush
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 1 Nov 2022 14:54:01 +0000 (15:54 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Nov 2022 17:59:14 +0000 (12:59 -0500)
commitc58a318f6090efe06e6702b8882e2026f44f620e
tree07825f8b81d108efc9d411075c00c701b03e1ee8
parent3c9eb0655fc03fb5e84f1db334ebc832d9c5ac31
KVM: x86: hyper-v: L2 TLB flush

Handle L2 TLB flush requests by going through all vCPUs and checking
whether there are vCPUs running the same VM_ID with a VP_ID specified
in the requests. Perform synthetic exit to L2 upon finish.

Note, while checking VM_ID/VP_ID of running vCPUs seem to be a bit
racy, we count on the fact that KVM flushes the whole L2 VPID upon
transition. Also, KVM_REQ_HV_TLB_FLUSH request needs to be done upon
transition between L1 and L2 to make sure all pending requests are
always processed.

For the reference, Hyper-V TLFS refers to the feature as "Direct
Virtual Flush".

Note, nVMX/nSVM code does not handle VMCALL/VMMCALL from L2 yet.

Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20221101145426.251680-24-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/hyperv.c
arch/x86/kvm/hyperv.h
arch/x86/kvm/trace.h