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: 10434885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 22C2E602BF for ; Tue, 29 May 2018 10:24:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 132B5285F1 for ; Tue, 29 May 2018 10:24:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 071A8286AC; Tue, 29 May 2018 10:24:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 77AB7286A7 for ; Tue, 29 May 2018 10:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject: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=UKR9AlpLxoZ+Ol7KksMUP3Rz2+YQIEJPKy4nkzTUtzg=; b=bmy 20Uim5u2oKpaddXL4Q+v4IkY3mmRxvsNdrb5DwZOhQkfm21EJ9TbV0mO8CKnIA71AqgNN1gzS09du O4ODXk2TFu6CBEisym6O2KTo89uYuL5iSxWO/Zgzobkk6EfpRVhgpMAWFOMlWJ+k0YWDkFuu+UHSL teakLjLq2dXJxRz7jEQauBX8HCKgkZFuUv0aupx5HgtcVwFrnt/tHVEmKjCgIiXZz3NfVcNtGx+Ps x4z/rfIUYVywCVd55ho4IxTeQRvWx3YyDrvDQ4GyyhL32q8uPbmGbKBRn8XMvUdOa3KGpsDXWYlQj uywYRwQo97D5+xPpJiVFCi95FiUV7Yg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNbnY-0002Cj-N7; Tue, 29 May 2018 10:24:12 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNbmh-0001t5-FY for linux-arm-kernel@lists.infradead.org; Tue, 29 May 2018 10:24:07 +0000 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 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> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:sQ05aA8uDa34ftydlMSGCCMSG40chUwIG64WaMY3WiQs+aUesIl UjwZ9kvUg3t1NMjlPM2882p+lFYZZt1wIkn8yI12Nbjw6XMf0MW4DwG8NNzM+aws/ru+0JM pDVvdWKAeE6aJ1b0b9WxNcaF4Hjtj+IolgkRXx9barA6sZZiQURrtoeFm1PA0CsOY7nZv+Q h1Ar4p4v+fEtZzPKCtwmw== X-UI-Out-Filterresults: notjunk:1; V01:K0:L+CRUun6P2Y=:g0jRetSJrAXsosd35fu/nK dGeK1Z8hY6d7J+ES9I3JcCeIbr+J7TrtdVKoSNByKFC01sNq1JGLf8KxiLW47fPiZ1o9DRhh4 3/RCHohlvVLDYKeU0VJxMOPIQ58cM6sBAZH75UvQ0+SunUGIsR6+Zp9YUCAZ3mnCLAA1o4yZU 6VbqayrbysB/lxEQhruJR9aYu3pLRpLssGGuRakMtabirC18z6z4RNzoxJnwdq9p54gzDEIGX olQNgYws5p5j/A+8mzrjDB2D9Lb7yp7OoBJu1xFyoj3KV9hmEx/eM3E8DSxV3b8XnmVmeeO+u jh8yw3qTK0okUC2dGwF4/NDgRNHGWAoZsd9FDoiqGi+adeaH++DImWKWNozQFwJ3TfQ7Rjumw W5LSGCCqsash1LlsL1hqtH55qBn22Jo9/4KfTXYlPHRlt+mf8zHs6YbDr6tQP2/v29Y16wyNC k7i4QKT5o47Uf1fwJmydFQJZ9Tmj0l+7X1RsbA/w9YwV6GTzvUV1ab98zI4fVL8Z49+W9QYFq 08Rf07xcb6fKb4xcwV0IxzF0SIGwLGSrj8MTH1bUJeqdWZFZ0uxH9EErAiSZoWqNpj1bu7LwO azG/WW/ZhSIE1rUWN2C0bEjbQzJU5DdthBfGSEK26dsvHqto5kdF3Y5jk9MfKXsIk2nYfPj67 gwQ4kb1bYEP5LH8wBAjEL2nEZHV68fNCfF/XWo7s6c8JhAN4GD0j0x7FNURGLsB8enuI= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180529_032319_861239_C034846D X-CRM114-Status: GOOD ( 13.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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