]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
x86/ioremap: Map EFI runtime services data as encrypted for SEV
authorTom Lendacky <thomas.lendacky@amd.com>
Tue, 10 Mar 2020 17:35:57 +0000 (18:35 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Wed, 18 Mar 2020 10:39:18 +0000 (11:39 +0100)
commit558ec110c544f6a93ae3d52d9154528549a2a504
tree867d5ac69a1c274738dffb2f2b694ccde3706b2d
parentfabc7265eb32c566f37034d97d5c73a3c3265362
x86/ioremap: Map EFI runtime services data as encrypted for SEV

BugLink: https://bugs.launchpad.net/bugs/1867903
commit 985e537a4082b4635754a57f4f95430790afee6a upstream.

The dmidecode program fails to properly decode the SMBIOS data supplied
by OVMF/UEFI when running in an SEV guest. The SMBIOS area, under SEV, is
encrypted and resides in reserved memory that is marked as EFI runtime
services data.

As a result, when memremap() is attempted for the SMBIOS data, it
can't be mapped as regular RAM (through try_ram_remap()) and, since
the address isn't part of the iomem resources list, it isn't mapped
encrypted through the fallback ioremap().

Add a new __ioremap_check_other() to deal with memory types like
EFI_RUNTIME_SERVICES_DATA which are not covered by the resource ranges.

This allows any runtime services data which has been created encrypted,
to be mapped encrypted too.

 [ bp: Move functionality to a separate function. ]

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Joerg Roedel <jroedel@suse.de>
Tested-by: Joerg Roedel <jroedel@suse.de>
Cc: <stable@vger.kernel.org> # 5.3
Link: https://lkml.kernel.org/r/2d9e16eb5b53dc82665c95c6764b7407719df7a0.1582645327.git.thomas.lendacky@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/x86/mm/ioremap.c