]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Document and enforce MMU-writable and Host-writable invariants
authorDavid Matlack <dmatlack@google.com>
Thu, 13 Jan 2022 23:30:19 +0000 (23:30 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 19 Jan 2022 17:07:06 +0000 (12:07 -0500)
commitaf2f4b8092912ca4216dfb0b81a3e55856fb292b
treec681ede4a333e6ec0fb340f1aa170860667702a6
parent868388c7cf13ee4c744dd306c7f8305f85b6b1f5
KVM: x86/mmu: Document and enforce MMU-writable and Host-writable invariants

SPTEs are tagged with software-only bits to indicate if it is
"MMU-writable" and "Host-writable". These bits are used to determine why
KVM has marked an SPTE as read-only.

Document these bits and their invariants, and enforce the invariants
with new WARNs in spte_can_locklessly_be_made_writable() to ensure they
are not accidentally violated in the future.

Opportunistically move DEFAULT_SPTE_{MMU,HOST}_WRITABLE next to
EPT_SPTE_{MMU,HOST}_WRITABLE since the new documentation applies to
both.

No functional change intended.

Signed-off-by: David Matlack <dmatlack@google.com>
Message-Id: <20220113233020.3986005-4-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/spte.h