]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: Override default MMIO mask if memory encryption is enabled
authorTom Lendacky <thomas.lendacky@amd.com>
Thu, 9 Jan 2020 23:42:16 +0000 (17:42 -0600)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 21 Jan 2020 13:45:30 +0000 (14:45 +0100)
commit279f6094227cc74b063defe969d61f8f19048a62
tree36df23567a2b7494773f4022c2f0d951bdeecbaf
parent91610218530c74250fc3a9c216840c81f29d89d3
KVM: SVM: Override default MMIO mask if memory encryption is enabled

The KVM MMIO support uses bit 51 as the reserved bit to cause nested page
faults when a guest performs MMIO. The AMD memory encryption support uses
a CPUID function to define the encryption bit position. Given this, it is
possible that these bits can conflict.

Use svm_hardware_setup() to override the MMIO mask if memory encryption
support is enabled. Various checks are performed to ensure that the mask
is properly defined and rsvd_bits() is used to generate the new mask (as
was done prior to the change that necessitated this patch).

Fixes: c76b2bdecbc3 ("kvm: x86: Set highest physical address bits in non-present/reserved SPTEs")
Suggested-by: Sean Christopherson <sean.j.christopherson@intel.com>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c