lkml.org 
[lkml]   [2022]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v6 05/38] KVM: x86: hyper-v: Handle HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST{,EX} calls gently
Date
Maxim Levitsky <mlevitsk@redhat.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

\
 
 \ /
  Last update: 2022-06-13 19:36    [W:0.218 / U:2.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site