diff options
author | Yan Zhao <[email protected]> | 2023-07-14 14:50:06 +0800 |
---|---|---|
committer | Sean Christopherson <[email protected]> | 2023-10-09 14:34:57 -0700 |
commit | 1affe455d66de4e1743514afdeb99cb598a25aa2 (patch) | |
tree | 8eb07edc00105cd7a46986ea50fe5c8b1251d8fb /lib/test_fortify/write_overflow-memset.c | |
parent | 5804c19b80bf625c6a9925317f845e497434d6d3 (diff) |
KVM: x86/mmu: Add helpers to return if KVM honors guest MTRRs
Add helpers to check if KVM honors guest MTRRs instead of open coding the
logic in kvm_tdp_page_fault(). Future fixes and cleanups will also need
to determine if KVM should honor guest MTRRs, e.g. for CR0.CD toggling and
and non-coherent DMA transitions.
Provide an inner helper, __kvm_mmu_honors_guest_mtrrs(), so that KVM can
check if guest MTRRs were honored when stopping non-coherent DMA.
Note, there is no need to explicitly check that TDP is enabled, KVM clears
shadow_memtype_mask when TDP is disabled, i.e. it's non-zero if and only
if EPT is enabled.
Suggested-by: Sean Christopherson <[email protected]>
Signed-off-by: Yan Zhao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
[sean: squash into a one patch, drop explicit TDP check massage changelog]
Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-memset.c')
0 files changed, 0 insertions, 0 deletions