[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ftlnm7o8.fsf@vitty.brq.redhat.com>
Date: Tue, 27 Aug 2019 08:41:43 +0200
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: lantianyu1986@...il.com
Cc: Tianyu Lan <Tianyu.Lan@...rosoft.com>, kvm@...r.kernel.org,
linux-doc@...r.kernel.org, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org, pbonzini@...hat.com,
rkrcmar@...hat.com, corbet@....net, kys@...rosoft.com,
haiyangz@...rosoft.com, sthemmin@...rosoft.com, sashal@...nel.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, hpa@...or.com,
x86@...nel.org, michael.h.kelley@...rosoft.com
Subject: Re: [PATCH V3 0/3] KVM/Hyper-V: Add Hyper-V direct tlb flush support
lantianyu1986@...il.com writes:
> From: Tianyu Lan <Tianyu.Lan@...rosoft.com>
>
> This patchset is to add Hyper-V direct tlb support in KVM. Hyper-V
> in L0 can delegate L1 hypervisor to handle tlb flush request from
> L2 guest when direct tlb flush is enabled in L1.
>
> Patch 2 introduces new cap KVM_CAP_HYPERV_DIRECT_TLBFLUSH to enable
> feature from user space. User space should enable this feature only
> when Hyper-V hypervisor capability is exposed to guest and KVM profile
> is hided. There is a parameter conflict between KVM and Hyper-V hypercall.
> We hope L2 guest doesn't use KVM hypercall when the feature is
> enabled. Detail please see comment of new API
> "KVM_CAP_HYPERV_DIRECT_TLBFLUSH"
I was thinking about this for awhile and I think I have a better
proposal. Instead of adding this new capability let's enable direct TLB
flush when KVM guest enables Hyper-V Hypercall page (writes to
HV_X64_MSR_HYPERCALL) - this guarantees that the guest doesn't need KVM
hypercalls as we can't handle both KVM-style and Hyper-V-style
hypercalls simultaneously and kvm_emulate_hypercall() does:
if (kvm_hv_hypercall_enabled(vcpu->kvm))
return kvm_hv_hypercall(vcpu);
What do you think?
(and instead of adding the capability we can add kvm.ko module parameter
to enable direct tlb flush unconditionally, like
'hv_direct_tlbflush=-1/0/1' with '-1' being the default (autoselect
based on Hyper-V hypercall enablement, '0' - permanently disabled, '1' -
permanenetly enabled)).
--
Vitaly
Powered by blists - more mailing lists