KVM: x86: Fix device passthrough when SME is active
authorTom Lendacky <thomas.lendacky@amd.com>
Thu, 8 Mar 2018 23:17:31 +0000 (17:17 -0600)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 16 Mar 2018 13:32:23 +0000 (14:32 +0100)
commitdaaf216c06fba4ee4dc3f62715667da929d68774
treee9c04472a6219b67560ec95ab3d7c14c2cf490e1
parent52be7a467e4b45b0d8d3b700729fc65a9b8ebc94
KVM: x86: Fix device passthrough when SME is active

When using device passthrough with SME active, the MMIO range that is
mapped for the device should not be mapped encrypted.  Add a check in
set_spte() to insure that a page is not mapped encrypted if that page
is a device MMIO page as indicated by kvm_is_mmio_pfn().

Cc: <stable@vger.kernel.org> # 4.14.x-
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c