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=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 AD8F2C43381 for ; Mon, 18 Feb 2019 14:29:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D6CE2081B for ; Mon, 18 Feb 2019 14:29:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550500153; bh=QNYYuJC2exa2iU/W+1XNmZ2p7TyA5H5dT5QvOD1Cz2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=WBeCCmMk1G8j23v0aAwVveW8W01SuCQ9sLNIOWem8CO4q98wubLRBpiWhUzlP7Uf+ K6gGgh7ijaFf2ryKav8bL5Sv1+WHVkzXaY/jdKUa0so21DEmu+my/98QdtFLm0Ml4J jRmVMoi4TJGRnzdSBVvXBVat/OYI/QPv4ekjjxZk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388642AbfBRN7n (ORCPT ); Mon, 18 Feb 2019 08:59:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:40640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388623AbfBRN7j (ORCPT ); Mon, 18 Feb 2019 08:59:39 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 6A1E72070D; Mon, 18 Feb 2019 13:59:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498378; bh=QNYYuJC2exa2iU/W+1XNmZ2p7TyA5H5dT5QvOD1Cz2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y498Ycne+jN2TaUsaG47zZiZIC47b4/lPcjYMPwj8JX9DwDEsyVpZB01SYIn0u6S6 uBP1paMHDZ1sr9B5l3wWyxnJxbw/MUIHhSctvUeZkOweJ/Ljg69whzd5denDsVDjQk kUnQ+6ppm0AgYOzNDORaOvoYxppB3UVCftYo09Ac= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Krzysztof Kozlowski , Russell King , "David A. Long" , Julien Thierry , Sasha Levin Subject: [PATCH 4.9 18/58] ARM: ensure that processor vtables is not lost after boot Date: Mon, 18 Feb 2019 14:43:39 +0100 Message-Id: <20190218133509.954006167@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133508.567416115@linuxfoundation.org> References: <20190218133508.567416115@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ 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 --- arch/arm/mm/proc-macros.S | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S index 7d9176c4a21d..7be1d7921342 100644 --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S @@ -275,6 +275,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) @@ -310,6 +317,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 -- 2.19.1