Commit 5982a53
KVM: x86/mmu: Use kvm_ad_enabled() to determine if TDP MMU SPTEs need wrprot
Use the constant-after-module-load kvm_ad_enabled() to check if SPTEs in
the TDP MMU need to be write-protected when clearing accessed/dirty status
instead of manually checking every SPTE. The per-SPTE A/D enabling is
specific to nested EPT MMUs, i.e. when KVM is using EPT A/D bits but L1 is
not, and so cannot happen in the TDP MMU (which is non-nested only).
Keep the original code as sanity checks buried under MMU_WARN_ON().
MMU_WARN_ON() is more or less useless at the moment, but there are plans
to change that.
Link: https://lore.kernel.org/all/Yz4Qi7cn7TWTWQjj@google.com
Signed-off-by: Vipin Sharma <vipinsh@google.com>
[sean: split to separate patch, apply to dirty path, write changelog]
Link: https://lore.kernel.org/r/20230321220021.2119033-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 41e0766 commit 5982a53
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1621 | 1621 | | |
1622 | 1622 | | |
1623 | 1623 | | |
1624 | | - | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
1625 | 1628 | | |
1626 | 1629 | | |
1627 | 1630 | | |
| |||
1685 | 1688 | | |
1686 | 1689 | | |
1687 | 1690 | | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
1688 | 1694 | | |
1689 | 1695 | | |
1690 | 1696 | | |
1691 | 1697 | | |
1692 | 1698 | | |
1693 | 1699 | | |
1694 | | - | |
| 1700 | + | |
1695 | 1701 | | |
1696 | 1702 | | |
1697 | 1703 | | |
| |||
0 commit comments