Commit 1affe45
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]>1 parent 5804c19 commit 1affe45
2 files changed
+23
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
240 | 247 | | |
241 | 248 | | |
242 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4479 | 4479 | | |
4480 | 4480 | | |
4481 | 4481 | | |
4482 | | - | |
| 4482 | + | |
4483 | 4483 | | |
4484 | 4484 | | |
4485 | | - | |
4486 | | - | |
4487 | | - | |
4488 | | - | |
4489 | | - | |
4490 | | - | |
4491 | | - | |
| 4485 | + | |
| 4486 | + | |
| 4487 | + | |
| 4488 | + | |
4492 | 4489 | | |
4493 | 4490 | | |
4494 | 4491 | | |
4495 | 4492 | | |
4496 | | - | |
| 4493 | + | |
| 4494 | + | |
| 4495 | + | |
| 4496 | + | |
| 4497 | + | |
| 4498 | + | |
| 4499 | + | |
| 4500 | + | |
| 4501 | + | |
| 4502 | + | |
| 4503 | + | |
4497 | 4504 | | |
4498 | 4505 | | |
4499 | 4506 | | |
| |||
0 commit comments