Re: [PATCH] x86/kvm/mmu: make mmu->prev_roots cache work for NPT case

From: Paolo Bonzini
Date: Fri Feb 22 2019 - 15:29:35 EST


On 22/02/19 19:49, Vitaly Kuznetsov wrote:
>> Really cr4_pae means "are the PTEs 8 bytes". So I think your patch is
>> correct but on top we should set it to 1 (not zero!!) for
>> kvm_calc_shadow_ept_root_page_role, init_kvm_nested_mmu and
>> kvm_calc_tdp_mmu_root_page_role. Or maybe everything breaks with that
>> change.
>>
> Yes, exactly. If we put '1' there kvm_mmu_get_page() will again filter
> it out and we won't be able to find the root in prev_roots cache :-(
>

Well, of course then kvm_mmu_get_page() would have to remove the filtering.

Paolo