Skip to content
Snippets Groups Projects
Commit 07f1314d authored by Vitaly Kuznetsov's avatar Vitaly Kuznetsov
Browse files

KVM: x86/mmu: Add sanity check that MMIO SPTE mask doesn't overlap gen

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2119111



commit 8bad4606
Author: Sean Christopherson <seanjc@google.com>
Date:   Fri Aug 5 19:41:33 2022 +0000

    KVM: x86/mmu: Add sanity check that MMIO SPTE mask doesn't overlap gen

    Add compile-time and init-time sanity checks to ensure that the MMIO SPTE
    mask doesn't overlap the MMIO SPTE generation or the MMU-present bit.
    The generation currently avoids using bit 63, but that's as much
    coincidence as it is strictly necessarly.  That will change in the future,
    as TDX support will require setting bit 63 (SUPPRESS_VE) in the mask.

    Explicitly carve out the bits that are allowed in the mask so that any
    future shuffling of SPTE bits doesn't silently break MMIO caching (KVM
    has broken MMIO caching more than once due to overlapping the generation
    with other things).

Suggested-by: default avatarKai Huang <kai.huang@intel.com>
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Reviewed-by: default avatarKai Huang <kai.huang@intel.com>
    Message-Id: <20220805194133.86299-1-seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>

Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
parent 68f636eb
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment