x86/sev-es: Do not support MMIO to/from encrypted memory
authorJoerg Roedel <jroedel@suse.de>
Wed, 28 Oct 2020 16:46:59 +0000 (17:46 +0100)
committerBorislav Petkov <bp@suse.de>
Thu, 29 Oct 2020 18:27:42 +0000 (19:27 +0100)
commit2411cd82112397bfb9d8f0f19cd46c3d71e0ce67
treeb49db12b5fb9ca93bd04725ab135439b153b381f
parentc9f09539e16e281f92a27760fdfae71e8af036f6
x86/sev-es: Do not support MMIO to/from encrypted memory

MMIO memory is usually not mapped encrypted, so there is no reason to
support emulated MMIO when it is mapped encrypted.

Prevent a possible hypervisor attack where a RAM page is mapped as
an MMIO page in the nested page-table, so that any guest access to it
will trigger a #VC exception and leak the data on that page to the
hypervisor via the GHCB (like with valid MMIO). On the read side this
attack would allow the HV to inject data into the guest.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lkml.kernel.org/r/20201028164659.27002-6-joro@8bytes.org
arch/x86/kernel/sev-es.c