OSDN Git Service

kvm, x86, mmu: Use kernel generic dynamic physical address mask
authorKai Huang <kai.huang@linux.intel.com>
Tue, 15 Jan 2019 04:28:40 +0000 (17:28 +1300)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 20 Feb 2019 21:48:25 +0000 (22:48 +0100)
commit8acc0993e3f9a04a407ff1507dd329455f340121
tree53ac2de1ea6674679a16f8e72634c542fc8f9b0e
parente0dfacbfe91ad7947f0c44829c0358ac2e17d3c6
kvm, x86, mmu: Use kernel generic dynamic physical address mask

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 94d49eb30e854 ("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: Kai Huang <kai.huang@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c