Commit aa2024c
committed
KVM: x86/mmu: Embed direct bits into gpa for KVM_PRE_FAULT_MEMORY
Bug[*] reported for TDX case when enabling KVM_PRE_FAULT_MEMORY in QEMU.
It turns out that @gpa passed to kvm_mmu_do_page_fault() doesn't have
shared bit set when the memory attribute of it is shared, and it leads
to wrong root in tdp_mmu_get_root_for_fault().
Fix it by embedding the direct bits in the gpa that is passed to
kvm_tdp_map_page(), when the memory of the gpa is not private.
[*] https://lore.kernel.org/qemu-devel/4a757796-11c2-47f1-ae0d-335626e818fd@intel.com/
Reported-by: Xiaoyao Li <xiaoyao.li@intel.com>
Closes: https://lore.kernel.org/qemu-devel/4a757796-11c2-47f1-ae0d-335626e818fd@intel.com/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-ID: <20250611001018.2179964-1-xiaoyao.li@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent 179a842 commit aa2024c
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4896 | 4896 | | |
4897 | 4897 | | |
4898 | 4898 | | |
| 4899 | + | |
4899 | 4900 | | |
4900 | 4901 | | |
4901 | 4902 | | |
| |||
4910 | 4911 | | |
4911 | 4912 | | |
4912 | 4913 | | |
| 4914 | + | |
4913 | 4915 | | |
4914 | 4916 | | |
4915 | 4917 | | |
| 4918 | + | |
| 4919 | + | |
4916 | 4920 | | |
4917 | 4921 | | |
4918 | 4922 | | |
4919 | 4923 | | |
4920 | 4924 | | |
4921 | | - | |
| 4925 | + | |
4922 | 4926 | | |
4923 | 4927 | | |
4924 | 4928 | | |
| |||
0 commit comments