From patchwork Tue May 29 10:22:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 137152 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3863445lji; Tue, 29 May 2018 03:24:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq5QoijS/osIvbx3c53VIx85Jusxm6u15FPx13Tgwcz0glhwIqzvlYxv5u6YtojxppVz8rB X-Received: by 2002:a63:648:: with SMTP id 69-v6mr13362970pgg.205.1527589455142; Tue, 29 May 2018 03:24:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527589455; cv=none; d=google.com; s=arc-20160816; b=mqATbIHylKHX6EAVegqELgTZdI1b0jMFYAKEIYtuvaLI+b33aZ5KofY54rGBtPHU2l qFG1/3b9AsKkq0Pd/+9xQqZqiGJqVV2qupFCPRTQMC1UozcO5y4F5wPaOxZP9nax+uob MXyez0wjt+uiHcW5HUhcx6+PKFTEfL3YJmEepR3+m7abmIrKkE9558VVyRu/FzNiOjib FaEyh9ODztrO1OfwYu3++yKFzPSSsKsfOhi9ttbJ4RvVbiZDkhcEY6jZg6g0nUetY6nD jd4AKinF4HTbYcTIqRnDZzSimPEw92Y2fDIIATm5xlLoNFq2jk3M7F/qHlkZ68anWKXQ Mfsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=TndkcRbN4DiqLngEHqC/STfGW+IlOmDb0VR6dwY7O+I=; b=LF7si+l4TEgfR81w4NwtKPqz+TdFHQix9ivNBITTOOngv8QTzlg9e9p0TAmE/US8le NsnYqbI3j92sJXOO3owinGQ36TnncvR7ttjJAu6YXnQW9P/ZblTTMRuv2dfA6NznQ+Rx fHBmftxx/VQBtOdJJXtPF+ZqwPfzDOQ2JFjCr7+taFSuP+7uRe8xSvC9qmaYtKBZVnDh 4AhTO1NtvYfoKoCXIe67SPJ1lOA4rvjMERgrBh4j1dkfcFL3QEmkXwhaXRM5OWL8jqj2 fqmdBlmXYQgvSMjTqo5K0KXqjV9hgkXlamUylCHry5pxZtxNygGoP5TBDj9DgE28Vv3Z aWOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e187-v6si25878728pgc.127.2018.05.29.03.24.14; Tue, 29 May 2018 03:24:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933094AbeE2KYN (ORCPT + 30 others); Tue, 29 May 2018 06:24:13 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:36465 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932795AbeE2KYI (ORCPT ); Tue, 29 May 2018 06:24:08 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0MAYTC-1fUiGT1JzW-00BZC8; Tue, 29 May 2018 12:23:03 +0200 From: Arnd Bergmann To: Russell King , Florian Fainelli Cc: Arnd Bergmann , Marc Zyngier , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM; fix cpu_v7_bugs_init reference Date: Tue, 29 May 2018 12:22:06 +0200 Message-Id: <20180529102301.1145470-1-arnd@arndb.de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kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cpu_v7_bugs_init() function is referenced by the ARMv7 processor implementation, but is defined conditionally, leading to a link error when CONFIG_HARDEN_BRANCH_PREDICTOR is disabled: arch/arm/mm/proc-v7.o:(.init.data+0xc): undefined reference to `cpu_v7_bugs_init' arch/arm/mm/proc-v7.o:(.init.data+0x74): undefined reference to `cpu_v7_bugs_init' arch/arm/mm/proc-v7-bugs.o: In function `cpu_v7_ca8_ibe': proc-v7-bugs.c:(.text+0x14): undefined reference to `cpu_v7_bugs_init' arch/arm/mm/proc-v7-bugs.o: In function `cpu_v7_ca15_ibe': proc-v7-bugs.c:(.text+0x30): undefined reference to `cpu_v7_bugs_init' There is a '.weak' directive for this symbol, which was apparently intended to avoid the problem, but the file is lacking an actual global definition for the function, so it has no effect. This adds an empty function definition for it, which can now get used as the fallback. Fixes: 8d9267cedb9e ("ARM: spectre-v2: harden user aborts in kernel space") Signed-off-by: Arnd Bergmann --- arch/arm/mm/proc-v7.S | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 6fe52819e014..8f980e8b0867 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -547,6 +547,11 @@ __v7_setup_stack_ptr: .word PHYS_RELATIVE(__v7_setup_stack, .) ENDPROC(__v7_setup) + .weak cpu_v7_bugs_init +ENTRY(cpu_v7_bugs_init) + ret lr +ENDPROC(cpu_v7_bugs_init) + .bss .align 2 __v7_setup_stack: @@ -554,8 +559,6 @@ __v7_setup_stack: __INITDATA - .weak cpu_v7_bugs_init - @ define struct processor (see and proc-macros.S) define_processor_functions v7, dabort=v7_early_abort, pabort=v7_pabort, suspend=1, bugs=cpu_v7_bugs_init