• Sean Christopherson's avatar
    KVM: x86/mmu: WARN and zap SP when sync'ing if MMU role mismatches · 2640b086
    Sean Christopherson authored
    When synchronizing a shadow page, WARN and zap the page if its mmu role
    isn't compatible with the current MMU context, where "compatible" is an
    exact match sans the bits that have no meaning in the overall MMU context
    or will be explicitly overwritten during the sync.  Many of the helpers
    used by sync_page() are specific to the current context, updating a SMM
    vs. non-SMM shadow page would use the wrong memslots, updating L1 vs. L2
    PTEs might work but would be extremely bizaree, and so on and so forth.
    
    Drop the guard with respect to 8-byte vs. 4-byte PTEs in
    __kvm_sync_page(), it was made useless when kvm_mmu_get_page() stopped
    trying to sync shadow pages irrespective of the current MMU context.
    Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
    Message-Id: <20210622175739.3610207-12-seanjc@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    2640b086
paging_tmpl.h 32.1 KB