OpenCloudOS-Kernel/arch/x86/kvm/mmu
Binbin Wu bf50c92b5c KVM: x86/mmu: Drop non-PA bits when getting GFN for guest's PGD
Upstream commit: a130066f74008858ac425b7497d231742474a0ea
Conflict: none

Drop non-PA bits when getting GFN for guest's PGD with the maximum theoretical
mask for guest MAXPHYADDR.

Do it unconditionally because it's harmless for 32-bit guests, querying 64-bit
mode would be more expensive, and for EPT the mask isn't tied to guest mode.
Using PT_BASE_ADDR_MASK would be technically wrong (PAE paging has 64-bit
elements _except_ for CR3, which has only 32 valid bits), it wouldn't matter
in practice though.

Opportunistically use GENMASK_ULL() to define __PT_BASE_ADDR_MASK.

Intel-SIG: commit a130066f7400 KVM: x86/mmu: Drop non-PA bits when
getting GFN for guest's PGD
Backport KVM Linear Address Masking (LAM) support.

Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com>
Tested-by: Xuelian Guo <xuelian.guo@intel.com>
Link: https://lore.kernel.org/r/20230913124227.12574-6-binbin.wu@linux.intel.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
[ Zhiquan Li: amend commit log ]
Signed-off-by: Zhiquan Li <zhiquan1.li@intel.com>
2024-11-01 17:19:00 +08:00
..
mmu.c KVM: x86/mmu: Drop non-PA bits when getting GFN for guest's PGD 2024-11-01 17:19:00 +08:00
mmu_internal.h KVM: x86/mmu: Drop non-PA bits when getting GFN for guest's PGD 2024-11-01 17:19:00 +08:00
mmutrace.h KVM: x86/mmu: Add RET_PF_CONTINUE to eliminate bool+int* "returns" 2022-05-12 09:51:42 -04:00
page_track.c KVM: x86/mmu: Handle KVM bookkeeping in page-track APIs, not callers 2023-08-31 14:08:19 -04:00
page_track.h KVM: x86/mmu: Drop @slot param from exported/external page-track APIs 2023-08-31 14:08:18 -04:00
paging_tmpl.h KVM: x86/mmu: Drop non-PA bits when getting GFN for guest's PGD 2024-11-01 17:19:00 +08:00
spte.c KVM: x86/mmu: Convert "runtime" WARN_ON() assertions to WARN_ON_ONCE() 2023-08-31 13:48:44 -04:00
spte.h KVM: x86/mmu: Include mmu.h in spte.h 2023-08-31 14:08:25 -04:00
tdp_iter.c KVM: x86/mmu: Harden TDP MMU iteration against root w/o shadow page 2023-08-31 14:08:22 -04:00
tdp_iter.h KVM: x86/mmu: Atomically clear SPTE dirty state in the clear-dirty-log flow 2023-04-04 12:37:30 -07:00
tdp_mmu.c KVM: x86/mmu: Write-protect L2 SPTEs in TDP MMU when clearing dirty status 2024-04-27 17:11:41 +02:00
tdp_mmu.h KVM: x86/mmu: Stop zapping invalidated TDP MMU roots asynchronously 2023-09-23 05:35:48 -04:00