Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1182426imj; Thu, 14 Feb 2019 02:33:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IZb+5TdB/c2P5YPpSS82IcYW49r1feevHHs2uAbzxSb6AL0SgUr0SgWWPzeJKQAc6uyVlkA X-Received: by 2002:a63:515d:: with SMTP id r29mr3014980pgl.350.1550140427914; Thu, 14 Feb 2019 02:33:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550140427; cv=none; d=google.com; s=arc-20160816; b=BXXlgOCbu6eNKvFRMa87FKCM0BCe+wxt2qznI95b0AxZnJzm2hPz3laYTFnSICuyzf IEvsABaVQtmjRaAWjOA0zWNwT9yiWFXFIeMrrJXD4/zwTwSeT876gWfT/t2OZQfi18bc RL8gE3322R6uN6uY2Joz+yj2K8fPWiA1phmI7NhyTj/CpAhsp/nrzVFDdfcFwbBUr0pF RisHmAvnGerXnzgzWuDbXPMiSkx8/0YsDA75B/v/kfre7sebA30CQb312BMLE6FUXCA2 xZXJQ5+WGWaJFki8I9m9h9rBkRhNyfx61EMDslAFcKWjGXUWUzMIiHWIf+A72u9Imdou IxEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=JWWM0xAWumO0p3bY/5x9HLgVZOQ3s148CYkAGBmj6Ho=; b=bosuSTau6XwsfDyWzBAxREvJxfaTQ9nvFDDDWcHJSnijivHUUHG5z6Fn5LpGBErM02 JwNg4hn80JxVYjuuetarBpRmqZh+3yOxz8GTJHBG7rvYK0RQLm8rkVbLy7RR6OMFd+Rk HH7XmXr9cWhA0USKRx3zFjcT0Ui0nIcRaFpzvVtVHU6PofOXpKd0RLDhV4zfwR0mRXL0 C8ZzuzvL7z6m19HurIwLgHsoz5V7V/Xbd/f83/CMzDWDpaJMKYOxbTD8rw1Cs+o3Np6r wVLLxRtqAcVf5QyAtwZyP40N39p8lSyERY2SuIybQRHECrBdnKIZB8cvGW3Q0Zvd24In 84tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bT3kHfdd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t86si2121475pfa.145.2019.02.14.02.33.30; Thu, 14 Feb 2019 02:33:47 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=bT3kHfdd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405000AbfBNCK5 (ORCPT + 99 others); Wed, 13 Feb 2019 21:10:57 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:35516 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404352AbfBNCKr (ORCPT ); Wed, 13 Feb 2019 21:10:47 -0500 Received: by mail-qt1-f194.google.com with SMTP id p48so5213199qtk.2 for ; Wed, 13 Feb 2019 18:10:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JWWM0xAWumO0p3bY/5x9HLgVZOQ3s148CYkAGBmj6Ho=; b=bT3kHfddWoHjrWDizCUVqCfJci9GhpLD5WdiKcPx9Y6Xh6xad5lgywK8s1mOg27y02 QotBuVnRS4fym+imfJ/3aIv9jA1z+WiYfT0k6Kw3FM0N16aQ1WlpQt0oIGr8fuo5ULh4 K2/4vkB77v7jLnFQj4sxAanlpa5QVZ5Ih2NCq5hOXpODH61LocWaDRHRurs00Kf3RR8S aZxMGLJgD8OjczBDYplKPCfkAe0fsCSFNLV3MFfiY9+hjg+AxUNeDM0jZuj3QZD2vPm6 Gh/P0w6VNVUH8s4ppUgnkZuKFSvLX66fiSdol/3PFrwvTeCyXB5aTTrjMmuwM/WOd8lu 5elQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JWWM0xAWumO0p3bY/5x9HLgVZOQ3s148CYkAGBmj6Ho=; b=b3P29SrtIhNM6Sa8IvVN0RWofH/zZ6M8Lf4KX6QwVtXcLnNSxKgGw853cvi8nl7d0i 2J1DIzOiR2pXE+cDMcf/CZGndHJvPFEzikD7Cpp/c4UdVDKbAHrVL8q20CkfFxtTftYg dEYsd8PtVY1HRrBgm+SxZX2DcZUgsdtxiYx5I7WjrcbRDn3swCBXpnsplFhdcrj0zfGm tXKUlvdjwfJ+Lpi2UkL1gu04zlH9NfGBCAas/aAWwlN78BVv5J7hG0/JyoyxP9fPYbot hhD2OLeVVKV4omub7OyEw2Ux5ZH9+Nm6VsWmEkRFzV/uZe6R2TSgcrthw+eYHa+yAnOd +w8g== X-Gm-Message-State: AHQUAuYrLAQoTraiUZgglMy9grYAjnAt4kBOqWyY0d/Yj1cC6IwCWNC9 qeXV8x1iIpWd3GYj8CM0hDfIcZ7NmEA= X-Received: by 2002:ac8:814:: with SMTP id u20mr1011078qth.313.1550110246693; Wed, 13 Feb 2019 18:10:46 -0800 (PST) Received: from localhost.localdomain (pool-72-71-243-63.cncdnh.fast00.myfairpoint.net. [72.71.243.63]) by smtp.googlemail.com with ESMTPSA id d63sm1091575qka.22.2019.02.13.18.10.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 18:10:46 -0800 (PST) From: David Long To: stable@vger.kernel.org, Russell King - ARM Linux , Florian Fainelli , Julien Thierry , Tony Lindgren , Marc Zyngier , Greg KH , Mark Rutland Cc: Will Deacon , Mark Brown , linux-kernel@vger.kernel.org Subject: [PATCH 4.14 V2 16/17] ARM: ensure that processor vtables is not lost after boot Date: Wed, 13 Feb 2019 21:10:21 -0500 Message-Id: <20190214021022.5313-17-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190214021022.5313-1-dave.long@linaro.org> References: <20190214021022.5313-1-dave.long@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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 81d0efb055c6..19516fbc2c55 100644 --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S @@ -274,6 +274,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) @@ -309,6 +316,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.17.1