Messages in this thread | | | From | Lai Jiangshan <> | Date | Fri, 13 May 2022 16:54:21 +0800 | Subject | Re: [PATCH] kvm: x86/svm/nested: Cache PDPTEs for nested NPT in PAE paging mode |
| |
On Fri, Apr 15, 2022 at 6:33 PM Lai Jiangshan <jiangshanlai@gmail.com> wrote: > > From: Lai Jiangshan <jiangshan.ljs@antgroup.com> > > When NPT enabled L1 is PAE paging, vcpu->arch.mmu->get_pdptrs() which > is nested_svm_get_tdp_pdptr() reads the guest NPT's PDPTE from memroy > unconditionally for each call. > > The guest PAE root page is not write-protected. > > The mmu->get_pdptrs() in FNAME(walk_addr_generic) might get different > values every time or it is different from the return value of > mmu->get_pdptrs() in mmu_alloc_shadow_roots(). > > And it will cause FNAME(fetch) installs the spte in a wrong sp > or links a sp to a wrong parent since FNAME(gpte_changed) can't > check these kind of changes. > > Cache the PDPTEs and the problem is resolved. The guest is responsible > to info the host if its PAE root page is updated which will cause > nested vmexit and the host updates the cache when next nested run. > > The commit e4e517b4be01 ("KVM: MMU: Do not unconditionally read PDPTE > from guest memory") fixs the same problem for non-nested case. > > Fixes: e4e517b4be01 ("KVM: MMU: Do not unconditionally read PDPTE from guest memory") > Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Ping
| |