Skip to content

Commit 870b433

Browse files
committed
x86/ioremap: Fix CONFIG_EFI=n build
In order to use efi_mem_type(), one needs CONFIG_EFI enabled. Otherwise that function is undefined. Use IS_ENABLED() to check and avoid the ifdeffery as the compiler optimizes away the following unreachable code then. Fixes: 985e537 ("x86/ioremap: Map EFI runtime services data as encrypted for SEV") Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Tested-by: Randy Dunlap <[email protected]> Cc: Tom Lendacky <[email protected]> Cc: <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent fb33c65 commit 870b433

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/mm/ioremap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ static void __ioremap_check_other(resource_size_t addr, struct ioremap_desc *des
115115
if (!sev_active())
116116
return;
117117

118+
if (!IS_ENABLED(CONFIG_EFI))
119+
return;
120+
118121
if (efi_mem_type(addr) == EFI_RUNTIME_SERVICES_DATA)
119122
desc->flags |= IORES_MAP_ENCRYPTED;
120123
}

0 commit comments

Comments
 (0)