Re: [RFC PATCH V3 3/4] KVM: X86: Alloc role.pae_root shadow page

From: Paolo Bonzini
Date: Thu Apr 14 2022 - 06:04:35 EST


On 4/14/22 11:32, Lai Jiangshan wrote:
kvm_mmu_free_roots() can not free those new types of sp if they are still
valid. And different vcpu can use the same pae root sp if the guest cr3
of the vcpus are the same.

Right, but then load_pdptrs only needs to zap the page before (or instead of) calling kvm_mmu_free_roots().

Paolo

And new pae root can be put in prev_root too (not implemented yet)
because they are not too special anymore. As long as sp->gfn, sp->pae_off,
sp->role are matched, they can be reused.