From patchwork Fri Mar 11 19:18:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 12778540 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 98D88C433F5 for ; Fri, 11 Mar 2022 19:19:34 +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: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:In-Reply-To:References: List-Owner; bh=wMjhLe7Q/OHdWqsq9Xts8LhK+OddKoiP7FcrSSCvko4=; b=CbSIbVYl0g68KJ iqEUuEU9E2oL0UacE+bmfybrYYXZU43HSrmu0aKckxVwMLjrqYgIyc0eqMsMecW2CHNEww30YMvWq fUqPgn/QcnUTW86nQH+9FMTNXqfuOmyfIGJutVUVy581tqcSw0FbldAhhpoVT/3VsdjIweIIecKPK q1Ys8VS7XwtMicUMDI5LQ9L0uA0G660s7ap5figdkxvz5/xtF1hCu4QAkSi1+VV8ueyiIJ1VVaCgn D3S5C4hMBcwPM0Aa6CedYLd4moiiGEIeuUTZBlc5S0xa7f8x+pfx5osa9BOKFTW6FsN65RUTNQacx z6cSsrLCUgmpldnsMgLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nSkmP-0004zQ-8g; Fri, 11 Mar 2022 19:18:25 +0000 Received: from [2601:1c0:6280:3f0::aa0b] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nSkmN-0004z2-1s; Fri, 11 Mar 2022 19:18:23 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , kernel test robot , Russell King , Catalin Marinas , linux-arm-kernel@lists.infradead.org, patches@armlinux.org.uk Subject: [PATCH] ARM: Spectre-BHB: provide empty stub for non-config Date: Fri, 11 Mar 2022 11:18:20 -0800 Message-Id: <20220311191820.25771-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 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) --- KernelVersion: v5.17-rc7-205-g79b00034e9dc arch/arm/include/asm/spectre.h | 6 ++++++ 1 file changed, 6 insertions(+) --- linux-next-20220310.orig/arch/arm/include/asm/spectre.h +++ linux-next-20220310/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);