From patchwork Mon Mar 14 11:34:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 12780060 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C14EFC433F5 for ; Mon, 14 Mar 2022 11:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kO2TaxfSKtk7NMtKKNXo4N+DUeuEbNnzHOq5VEEUhGU=; b=VbxS4v/MjD3c3W rdbdwgWkhHmmdZ3QDKo6RkxZmjkohfDvZE9pFlZZa6jsbUHnwxoHB5DpmtIZe16AjGJiGhZ5MN8/r mvN0ikxfz7QMjCvabuw394w/rVO/AFNQ4BeF5L1qc2FEVIvYeTuP/qAyAlbvRDWDtLHSyp6Q4Oa2j EdA3I9ztpF3vsMbNWSI4VMFSnkW0E0kLM02PvwLkLarEaWwLtCVPQb3rjajdO5RvyLyGGYD5KefT8 F+Nn02PrnuotzSsLVRSCTyUKGG8pThGIPaYDxmZ5aPRPsZO6dynwIdwcMtOe0NqXTNwNWOI9Bx47e 2ilvmhIn7OEBPjBRfPFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTj26-005C2p-H8; Mon, 14 Mar 2022 11:38:38 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTj21-005C0w-UV for linux-arm-kernel@lists.infradead.org; Mon, 14 Mar 2022 11:38:35 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 91729B80DC5; Mon, 14 Mar 2022 11:38:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D13EC340E9; Mon, 14 Mar 2022 11:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647257911; bh=boM+X7Jtz7xEMxABclzXsyS0I01CPMFAo2H06POull4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MdepRaIf0O2jCKEu5IpNWgJNL82mCYJSq0N4+b2JiWaEhUVSENevhKT7ThzQVyLTq qT3ApsN1HVGHl4z8pFTUMhbbNQRzhz1F4TwpBGm7B+j2vSU0p2cp/hAIxRdqnGAaYA nYdCXNMMVlYuvpyl0OCwNZDKAfgdapI65OMjK/MY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , kernel test robot , Russell King , Catalin Marinas , linux-arm-kernel@lists.infradead.org, patches@armlinux.org.uk, Linus Torvalds Subject: [PATCH 4.19 18/30] ARM: Spectre-BHB: provide empty stub for non-config Date: Mon, 14 Mar 2022 12:34:36 +0100 Message-Id: <20220314112732.302323192@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112731.785042288@linuxfoundation.org> References: <20220314112731.785042288@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220314_043834_136493_738B19D4 X-CRM114-Status: GOOD ( 11.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Randy Dunlap commit 68453767131a5deec1e8f9ac92a9042f929e585d upstream. When CONFIG_GENERIC_CPU_VULNERABILITIES is not set, references to spectre_v2_update_state() cause a build error, so provide an empty stub for that function when the Kconfig option is not set. Fixes this build error: arm-linux-gnueabi-ld: arch/arm/mm/proc-v7-bugs.o: in function `cpu_v7_bugs_init': proc-v7-bugs.c:(.text+0x52): undefined reference to `spectre_v2_update_state' arm-linux-gnueabi-ld: proc-v7-bugs.c:(.text+0x82): undefined reference to `spectre_v2_update_state' Fixes: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Russell King Cc: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org Cc: patches@armlinux.org.uk Acked-by: Russell King (Oracle) Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- arch/arm/include/asm/spectre.h | 6 ++++++ 1 file changed, 6 insertions(+) --- a/arch/arm/include/asm/spectre.h +++ b/arch/arm/include/asm/spectre.h @@ -25,7 +25,13 @@ enum { SPECTRE_V2_METHOD_LOOP8 = BIT(__SPECTRE_V2_METHOD_LOOP8), }; +#ifdef CONFIG_GENERIC_CPU_VULNERABILITIES void spectre_v2_update_state(unsigned int state, unsigned int methods); +#else +static inline void spectre_v2_update_state(unsigned int state, + unsigned int methods) +{} +#endif int spectre_bhb_update_vectors(unsigned int method);