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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Mar 2018 11:06:41 +0000 (12:06 +0100)
commit4b428e9998c175122d5c5b8f8fe74928a0847fd9
tree1603675e38e9aa83c31ddd004b47f0469a690960
parent732f9a89fc1e72158a2d14fb890a81a7c21b4363
KVM: x86: Fix device passthrough when SME is active

commit daaf216c06fba4ee4dc3f62715667da929d68774 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/mmu.c