From patchwork Tue Sep 1 15:09:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 310507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 358DFC433E2 for ; Tue, 1 Sep 2020 15:30:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B9E7207D3 for ; Tue, 1 Sep 2020 15:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974240; bh=iwwrjsRIAJUQyuCjybCmNKWMiu/9B3HjaHena9EblRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wY7kapfQBYwUTt4Ak0S3izQQ9PcThqlte1L9DA/vUsge+OSLHCT8SYe24hikceK0r XGD2yL17pl9vDtboS/Eh0p4yMnWG4xYpNdAOR6tG4QCFo1BAdV3NG+jTDDOlzdOUel N3XWX8/YKkIMvoaR7b4MaquxHcIp/N+WH2fm8rig= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730610AbgIAPae (ORCPT ); Tue, 1 Sep 2020 11:30:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:60758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730605AbgIAPaa (ORCPT ); Tue, 1 Sep 2020 11:30:30 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8AC0220767; Tue, 1 Sep 2020 15:30:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974230; bh=iwwrjsRIAJUQyuCjybCmNKWMiu/9B3HjaHena9EblRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jBGEnSKUqxwNHyUa/acC/dXYvCv+3I5kchd5ITXt8pwTy0ih360zrYTMFi4pqzyj7 YMeplzCBusSuFASwxosJPwLpQOfdG4mu/JMsiv/glPTM0+PuRui6eF42aKVmh3eeVL ww2bvmbZWb4MoDFYk8A4v5veuIclqgBTIqdrccTI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Andrey Konovalov , Andrew Morton , Ard Biesheuvel , Alexander Potapenko , Andrey Ryabinin , Catalin Marinas , Dmitry Vyukov , Elena Petrova , Marco Elver , Vincenzo Frascino , Walter Wu , Linus Torvalds , Sasha Levin Subject: [PATCH 5.4 065/214] efi: provide empty efi_enter_virtual_mode implementation Date: Tue, 1 Sep 2020 17:09:05 +0200 Message-Id: <20200901150956.091585597@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901150952.963606936@linuxfoundation.org> References: <20200901150952.963606936@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Andrey Konovalov [ Upstream commit 2c547f9da0539ad1f7ef7f08c8c82036d61b011a ] When CONFIG_EFI is not enabled, we might get an undefined reference to efi_enter_virtual_mode() error, if this efi_enabled() call isn't inlined into start_kernel(). This happens in particular, if start_kernel() is annodated with __no_sanitize_address. Reported-by: kernel test robot Signed-off-by: Andrey Konovalov Signed-off-by: Andrew Morton Acked-by: Ard Biesheuvel Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Elena Petrova Cc: Marco Elver Cc: Vincenzo Frascino Cc: Walter Wu Link: http://lkml.kernel.org/r/6514652d3a32d3ed33d6eb5c91d0af63bf0d1a0c.1596544734.git.andreyknvl@google.com Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/linux/efi.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/efi.h b/include/linux/efi.h index d87acf62958e2..13ed2c6b13f8b 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1039,7 +1039,11 @@ extern void *efi_get_pal_addr (void); extern void efi_map_pal_code (void); extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); extern void efi_gettimeofday (struct timespec64 *ts); +#ifdef CONFIG_EFI extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ +#else +static inline void efi_enter_virtual_mode (void) {} +#endif #ifdef CONFIG_X86 extern efi_status_t efi_query_variable_store(u32 attributes, unsigned long size,