From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C991FA372C for ; Fri, 8 Nov 2019 18:55:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E270E222CB for ; Fri, 8 Nov 2019 18:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573239324; bh=j3r/n5l6RYREqpwfXTDzpr2BYB8iYzHItBpD0Po+7WA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MwoFkCC4VGupW22oYPN4Vx0dif6yDN03+xtLrmtcabZ88qLCEW5/j/q9Buy+mjvol qtT+Dqt8hiqw40vvPKXSI7ATC5QAA//SPeDGYQ/WHviIwmBkjLTaMB0LiuGjsxz5jQ PM59TBEzOazLe18CETQI5FaeWJe89TBxHy5tWHbI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731569AbfKHSzS (ORCPT ); Fri, 8 Nov 2019 13:55:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:52542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733294AbfKHSzQ (ORCPT ); Fri, 8 Nov 2019 13:55:16 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5C24A222C5; Fri, 8 Nov 2019 18:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573239315; bh=j3r/n5l6RYREqpwfXTDzpr2BYB8iYzHItBpD0Po+7WA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=InPUAoJ08lgozGcxxQI3jTFSpowOc15WHC1j8ieJWvftlq0IP+B/C2b96vULBzYPv P27iERlN7B50BJQXUcrrM2O/kDLUFPtJXOBTEpbVgOENKtT3wPJ8mr5a3jeBucBOxp 6AFBSxQSgwbBopqMRbKl8BdJeidqkqAC70iyn49I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , "linus.walleij@linaro.org, rmk+kernel@armlinux.org.uk, Ard Biesheuvel" , Marek Szyprowski , Krzysztof Kozlowski , Russell King , "David A. Long" , Julien Thierry , Sasha Levin , Ard Biesheuvel Subject: [PATCH 4.4 72/75] ARM: ensure that processor vtables is not lost after boot Date: Fri, 8 Nov 2019 19:50:29 +0100 Message-Id: <20191108174812.646613145@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191108174708.135680837@linuxfoundation.org> References: <20191108174708.135680837@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Russell King Commit 3a4d0c2172bcf15b7a3d9d498b2b355f9864286b upstream. Marek Szyprowski reported problems with CPU hotplug in current kernels. This was tracked down to the processor vtables being located in an init section, and therefore discarded after kernel boot, despite being required after boot to properly initialise the non-boot CPUs. Arrange for these tables to end up in .rodata when required. Reported-by: Marek Szyprowski Tested-by: Krzysztof Kozlowski Fixes: 383fb3ee8024 ("ARM: spectre-v2: per-CPU vtables to work around big.Little systems") Signed-off-by: Russell King Signed-off-by: David A. Long Reviewed-by: Julien Thierry Signed-off-by: Sasha Levin Signed-off-by: Ard Biesheuvel Signed-off-by: Greg Kroah-Hartman --- arch/arm/mm/proc-macros.S | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S @@ -259,6 +259,13 @@ .endm .macro define_processor_functions name:req, dabort:req, pabort:req, nommu=0, suspend=0, bugs=0 +/* + * If we are building for big.Little with branch predictor hardening, + * we need the processor function tables to remain available after boot. + */ +#if 1 // defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR) + .section ".rodata" +#endif .type \name\()_processor_functions, #object .align 2 ENTRY(\name\()_processor_functions) @@ -294,6 +301,9 @@ ENTRY(\name\()_processor_functions) .endif .size \name\()_processor_functions, . - \name\()_processor_functions +#if 1 // defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR) + .previous +#endif .endm .macro define_cache_functions name:req