On Fri, Dec 09, 2022, Robert Hoo wrote: > The get_cr3() is the implementation of kvm_mmu::get_guest_pgd(), well, CR3 > cannot be naturally equivalent to pgd, SDM says CR3 high bits are reserved, > must be zero. > And now, with LAM feature's introduction, bit 61 ~ 62 are used. > So, rename get_cr3() --> get_pgd() to better indicate function purpose and > in it, filtered out CR3 high bits. Depends on one's interpreation of "PGD". KVM says it's the full thing, e.g. the nEPT hook returns the full EPTP, not EP4TA (or EP5TA). I don't think stripping bits in get_cr3() is the right approach, e.g. the user might want the full thing for comparison. E.g. the PCID bits are left as is. Changing get_cr3() but not nested_svm_get_tdp_cr3() and nested_ept_get_eptp() is also weird. I think my preference would be to strip the LAM bits in the few places that want the physical address and keep get_cr3() as is.