• David Matlack's avatar
    KVM: x86/mmu: Document and enforce MMU-writable and Host-writable invariants · 5f16bcac
    David Matlack authored
    
    
    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: default avatarDavid Matlack <dmatlack@google.com>
    Message-Id: <20220113233020.3986005-4-dmatlack@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    5f16bcac
spte.h 12.8 KB