From patchwork Mon Mar 14 11:54:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 12780103 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 B88BFC433F5 for ; Mon, 14 Mar 2022 12:18:05 +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=KZf2guOqtQwY6E gapAXdZk8FQdJKuD7Su3K+YmvvADTAl8bNxZQcaUX/9wCB/tKOt5Np4O9fulC5kh4NaCpdjg3dmLk HCPCdEoyZGbjZoC1d8W6VkcL6RwxmdKjTOgl/QVzGvdPOIHzZOTTzD/n95EU2tghtFteBfsJlfiMo diAmCxy/gcvAxP1AoeqKu4n7rAQqTKx7ybtxRdpXN9L4wltAn3tZDXCynHzbaK40IYFfJRaR6t0zn C4QcjT6ruWCjQaV5JooFqn4s4+OVJoKgvNrN0UREoCel5tIopkMdN8YF0JAx1/Vk/fTOmMQXN/CVo h+xqbL/IoU4pIVYNc8lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTjd4-005Mg8-Pd; Mon, 14 Mar 2022 12:16:50 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTjd2-005MfJ-39 for linux-arm-kernel@lists.infradead.org; Mon, 14 Mar 2022 12:16:49 +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 A995FB80DC0; Mon, 14 Mar 2022 12:16:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BE3EC36AE3; Mon, 14 Mar 2022 12:16:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647260205; bh=boM+X7Jtz7xEMxABclzXsyS0I01CPMFAo2H06POull4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UoUntIXsC9wtHp58ds+Rtx173QViG3WuIB2S4AiEUC06eXihwsTOO2BfwyrkBz91U 2HM8XrOgD/gscNQFtch3iGLZOtlS5FtCLchGL+ZdUWj/WH/42SQDuXAwB3EftOym1U YAMff8ecqy4LBmrPwfoOby0JpVlIFs+odDX5TSZE= 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 5.16 086/121] ARM: Spectre-BHB: provide empty stub for non-config Date: Mon, 14 Mar 2022 12:54:29 +0100 Message-Id: <20220314112746.519389756@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112744.120491875@linuxfoundation.org> References: <20220314112744.120491875@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_051648_295288_A98611AA X-CRM114-Status: GOOD ( 11.44 ) 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);