From patchwork Tue Sep 1 15:08:52 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: 310471 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 3A04BC433E2 for ; Tue, 1 Sep 2020 15:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 058FA205F4 for ; Tue, 1 Sep 2020 15:39:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974749; bh=nfq+6Z0gn9+uR5oCqrA1Bl68yA5Kk/Q8rc+cxu5c2Ak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hZyZWP4Wpj/imz+/++2tSnYnS49sFjtADDOMExnn28wXYFy3m7qqD9PNdezBiHKHY Z4CO4fupzQx+xf1KHCIArZ+3jCmE3WiG7KM9rPi1Dz/mGFoo1KYlKj8dn8l/OiU+rt 6XdnwUnd8ibyOge7BLM9+4K7GF4XJ4uDQ/eBRH9E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730129AbgIAPjG (ORCPT ); Tue, 1 Sep 2020 11:39:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:48546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731264AbgIAPjC (ORCPT ); Tue, 1 Sep 2020 11:39:02 -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 396C8205F4; Tue, 1 Sep 2020 15:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974741; bh=nfq+6Z0gn9+uR5oCqrA1Bl68yA5Kk/Q8rc+cxu5c2Ak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SllABujb3oSlsMQPCCJuPmYY9sKxytxa4C/WpMRd2zx54cRHvBgZT01jDmxZIb5Mm eVA42yHpL7YvBV0OZ+k+a5Kv0yhREbt42VQupseI1dEDyrWsBuRBkEykNemHVlySXN tlJGQqFLlf1GgmLgzcbB152rVVizKiIA2XIOauug= 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.8 076/255] efi: provide empty efi_enter_virtual_mode implementation Date: Tue, 1 Sep 2020 17:08:52 +0200 Message-Id: <20200901151004.373653877@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901151000.800754757@linuxfoundation.org> References: <20200901151000.800754757@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 05c47f857383e..73db1ae04cef8 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -606,7 +606,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,