lkml.org 
[lkml]   [2022]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v10 02/39] KVM: x86: hyper-v: Resurrect dedicated KVM_REQ_HV_TLB_FLUSH flag
On Wed, Sep 21, 2022, Vitaly Kuznetsov wrote:
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index f62d5799fcd7..86504a8bfd9a 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3418,11 +3418,17 @@ static inline void kvm_vcpu_flush_tlb_current(struct kvm_vcpu *vcpu)
> */
> void kvm_service_local_tlb_flush_requests(struct kvm_vcpu *vcpu)
> {
> - if (kvm_check_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu))
> + if (kvm_check_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu)) {
> kvm_vcpu_flush_tlb_current(vcpu);
> + kvm_clear_request(KVM_REQ_HV_TLB_FLUSH, vcpu);

This isn't correct, flush_tlb_current() flushes "host" TLB entries, i.e. guest-physical
mappings in Intel terminology, where flush_tlb_guest() and (IIUC) Hyper-V's paravirt
TLB flush both flesh "guest" TLB entries, i.e. linear and combined mappings.

Amusing side topic, apparently I like arm's stage-2 terminology better than "TDP",
because I actually typed out "stage-2" first.

> + }
>
> - if (kvm_check_request(KVM_REQ_TLB_FLUSH_GUEST, vcpu))
> + if (kvm_check_request(KVM_REQ_TLB_FLUSH_GUEST, vcpu)) {
> + kvm_vcpu_flush_tlb_guest(vcpu);
> + kvm_clear_request(KVM_REQ_HV_TLB_FLUSH, vcpu);
> + } else if (kvm_check_request(KVM_REQ_HV_TLB_FLUSH, vcpu)) {
> kvm_vcpu_flush_tlb_guest(vcpu);
> + }
> }
> EXPORT_SYMBOL_GPL(kvm_service_local_tlb_flush_requests);
>
> --
> 2.37.3
>

\
 
 \ /
  Last update: 2022-09-21 18:39    [W:0.247 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site