[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cf994608-c5cc-6e0b-6fd3-a7975cc4c8cf@infradead.org>
Date: Wed, 18 Mar 2020 12:30:09 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Borislav Petkov <bp@...en8.de>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>,
Linux Next Mailing List <linux-next@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
X86 ML <x86@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
Tom Lendacky <thomas.lendacky@....com>
Subject: Re: [PATCH] x86/ioremap: Fix CONFIG_EFI=n build
On 3/18/20 11:34 AM, Borislav Petkov wrote:
> On Wed, Mar 18, 2020 at 04:17:07PM +0100, Borislav Petkov wrote:
>>> ld: arch/x86/mm/ioremap.o: in function `__ioremap_caller':
>>> ioremap.c:(.text+0x150): undefined reference to `efi_mem_type'
>>
>> Working on it.
>
> The below should fix it:
>
> ---
> From: Borislav Petkov <bp@...e.de>
> Date: Wed, 18 Mar 2020 19:27:48 +0100
>
> 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: 985e537a4082 ("x86/ioremap: Map EFI runtime services data as encrypted for SEV")
> Reported-by: Randy Dunlap <rdunlap@...radead.org>
> Signed-off-by: Borislav Petkov <bp@...e.de>
> Cc: Tom Lendacky <thomas.lendacky@....com>
> Link: https://lkml.kernel.org/r/7561e981-0d9b-d62c-0ef2-ce6007aff1ab@infradead.org
Acked-by: Randy Dunlap <rdunlap@...radead.org> # build-tested
Thanks.
> ---
> arch/x86/mm/ioremap.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
> index 935a91e1fd77..18c637c0dc6f 100644
> --- a/arch/x86/mm/ioremap.c
> +++ b/arch/x86/mm/ioremap.c
> @@ -115,6 +115,9 @@ static void __ioremap_check_other(resource_size_t addr, struct ioremap_desc *des
> if (!sev_active())
> return;
>
> + if (!IS_ENABLED(CONFIG_EFI))
> + return;
> +
> if (efi_mem_type(addr) == EFI_RUNTIME_SERVICES_DATA)
> desc->flags |= IORES_MAP_ENCRYPTED;
> }
>
--
~Randy
Powered by blists - more mailing lists