[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87leu0k9ds.fsf@redhat.com>
Date: Mon, 13 Jun 2022 14:58:39 +0200
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: Maxim Levitsky <mlevitsk@...hat.com>, kvm@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>
Cc: Sean Christopherson <seanjc@...gle.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Michael Kelley <mikelley@...rosoft.com>,
Siddharth Chandrasekaran <sidcha@...zon.de>,
Yuan Yao <yuan.yao@...ux.intel.com>,
linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 05/38] KVM: x86: hyper-v: Handle
HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST{,EX} calls gently
Maxim Levitsky <mlevitsk@...hat.com> writes:
...
>>
>> void kvm_hv_vcpu_flush_tlb(struct kvm_vcpu *vcpu)
>> {
>> struct kvm_vcpu_hv_tlb_flush_fifo *tlb_flush_fifo;
>> struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
>> + u64 entries[KVM_HV_TLB_FLUSH_FIFO_SIZE];
>> + int i, j, count;
>> + gva_t gva;
>>
>> - kvm_vcpu_flush_tlb_guest(vcpu);
>> -
>> - if (!hv_vcpu)
>> + if (!tdp_enabled || !hv_vcpu) {
> I haven't noticed that in the review I did back then, but
> any reason why !tdp_enabled?
This follows the logic in kvm_vcpu_flush_tlb_guest():
if (!tdp_enabled) {
/*
* A TLB flush on behalf of the guest is equivalent to
* INVPCID(all), toggling CR4.PGE, etc., which requires
* a forced sync of the shadow page tables. Ensure all the
* roots are synced and the guest TLB in hardware is clean.
*/
kvm_mmu_sync_roots(vcpu);
kvm_mmu_sync_prev_roots(vcpu);
}
and as !tdp_enabled should be a rare debug or special case I decided to
take the shortcut and not drag any of this logic into hyperv emulation
code.
--
Vitaly
Powered by blists - more mailing lists