• Kai Huang's avatar
    kvm, x86, mmu: Use kernel generic dynamic physical address mask · 8acc0993
    Kai Huang authored
    AMD's SME/SEV is no longer the only case which reduces supported
    physical address bits, since Intel introduced Multi-key Total Memory
    Encryption (MKTME), which repurposes high bits of physical address as
    keyID, thus effectively shrinks supported physical address bits. To
    cover both cases (and potential similar future features), kernel MM
    introduced generic dynamaic physical address mask instead of hard-coded
    __PHYSICAL_MASK in 'commit 94d49eb3 ("x86/mm: Decouple dynamic
    __PHYSICAL_MASK from AMD SME")'. KVM should use that too.
    
    Change PT64_BASE_ADDR_MASK to use kernel dynamic physical address mask
    when it is enabled, instead of sme_clr. PT64_DIR_BASE_ADDR_MASK is also
    deleted since it is not used at all.
    Signed-off-by: default avatarKai Huang <kai.huang@linux.intel.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    8acc0993
mmu.c 158 KB