Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp770169pxp; Fri, 11 Mar 2022 14:40:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwk23YkF2x826PFZx58ePUkgaK7ZpuJsZdHJ70kI56JO0TDVVCz2rykJNoTaKonM60VEInm X-Received: by 2002:a17:902:ba8f:b0:153:237c:a77f with SMTP id k15-20020a170902ba8f00b00153237ca77fmr9815750pls.1.1647038402001; Fri, 11 Mar 2022 14:40:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647038401; cv=none; d=google.com; s=arc-20160816; b=XjpF40c/KFPTvLMUR1K/A3JgS38tIzCwIDIpxZfaPUZiJphME4VnwFMaibKdhwROqM EiDSzt9CQyc5eLBHgHpoo18rgURo391irN965+9725iRNzHfzqbd83F3xc6Kr9qMtUvq yjVyL48Am05uAGYxW8QPEUeePlKHpWGLTF/G7hXDFmz/hBEN4B13qA7j1adPZhcB1aw3 p6ffgrn1GzhKzMvSAVLnpAiQNl4/MYsVQNRL87dIp+jzjx9+DCEaQfmvHI6JkjxD3fA2 86NTYK7u02mXx14y+2nviJUuSX8OamRWgWrTCO/1Ej4XfrHGgsN/fQWtNPAsteybl4kC N/7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=J3NJVjWyKNpGT7siMqPZJ6BO7MwoPQt1ghuD0mMQpDU=; b=YJWpB17X7zib0KwNUmHIJPiCbKWYwZybgE3FGmt1SeCiiLSOTr4PCs10HW1iWwhy0b g6MwHBGiyuf0c12QCjvhGy1kiWbXk07G0+doOoGOTkSHs2l1fGuhFdNxqkSC8JgnKftM m1XYDq4H3YFp2JrZy7KGcc+NNYfnOeoT7fqG5ewd9yiWtSdrS4BbI1HCYvOGTNslXswH XDpWDvldKAS0t/DwwiOXMUtZMClyY7oqwQAfAEBmhUQvQb0ZBtPNDbbRgMPOTT33NuaS T1MykowCGxvlWV8fdP3blJKM6KZa294CYCqCV887ghW0fZXA5/1XYEAHhTMk/Nhe11aB CwUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=js7kcNeR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k15-20020a633d0f000000b00380c8a05d80si9254363pga.450.2022.03.11.14.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:40:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=js7kcNeR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 26A482B410C; Fri, 11 Mar 2022 13:45:12 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351052AbiCKTTd (ORCPT + 99 others); Fri, 11 Mar 2022 14:19:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351042AbiCKTTa (ORCPT ); Fri, 11 Mar 2022 14:19:30 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 086F565D21 for ; Fri, 11 Mar 2022 11:18:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=J3NJVjWyKNpGT7siMqPZJ6BO7MwoPQt1ghuD0mMQpDU=; b=js7kcNeRXz0/8UxYFWNuT8JAwC T3p5pYhe5Zb60f+przqDmp7opHk/zHt/g5O0BVFTJviEZcq7z+/UAZ2UZubslEW99z8MR6/+/sozq oMjO47Gh3mcbB82dSj6kx4QmC8P00AG9EVW6qnZOjmuGXHJizCPCOwE0lg+e1e+NoXbrTzLM3zBDy xPcHdIxafuy2NJsz4a+zFwnM4Eexi1f7A8MXkFxxlFHRi94m1EmU626ccx9d0i5Oel0U0Dh9paNwd nWkoNRTOGJsuZv+k7ZPrQo5HKM9NAaHXsqLRQzM92JQBWY+RBCkyG9AQiENuEX5gs5uIZtgp9OdEv zKCI24rA==; 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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);