From patchwork Thu Feb 14 02:10:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 158289 Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp793932jaa; Wed, 13 Feb 2019 18:10:47 -0800 (PST) X-Received: by 2002:a0c:d947:: with SMTP id t7mr1036972qvj.49.1550110246953; Wed, 13 Feb 2019 18:10:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550110246; cv=none; d=google.com; s=arc-20160816; b=g9eXfG2RJWBAxtJP0yhMiR7tsxK8Mlb+637yhrXPk8MrSnpSzowWtktBWMWd2Pu1WO 8n+RhJpoGclow+PSi7uE5hNbH+2hCyN7rk9mnx07th6erXj5+7igBTI0RbXN1iVGyivX a2yNnQN3KoBour4mcEl+ANnU3V3X2wpJ3sLXlqcabf7IajDF25GqnHddpNMFf0G/dRPQ /5RwJiCmvCI2iMBXViotNdxxBsCLO9KrVw2dF5GIPOqzQJDfSzc2U+83J6h1VbRpwtBu 6mS4PCv5H/mIjZanhymGvFpf0tDjpXeXPz1L/8Tj+JXCDLeJqpc8QraxhffhewShCMDN dRXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JWWM0xAWumO0p3bY/5x9HLgVZOQ3s148CYkAGBmj6Ho=; b=jLDDMh8mbtyjFJlS9fZ6SY8AbHHHwpMNEiboomCNhu8miQjTDRHHH4stsAcZjJjErp 3ps69+saFvRYfmkJ9Zc2+GqeC6gNsiDjmjECkToyoFTL3sZED+QqZ4Usz9rdx1JJNqIu kJ0YlSFRCoLOvv7W5vHG5jFcMiNkIDbZu+rszOVLa3t0elHWmXbU5Ko3G8oVBLwKmBEd UPQc0zeu05NL0OnPvY1TQIfPBcmJdnjiEXlSlPkZeFZrfkxUDSqOaK7ojeBDYS3SLbiv 2fXoeIaiYkrI9WHxNcjI5rZTS7fYz3qLddVDFYnoBHimWxeTnsKKMZEeMk3z/0uNuq10 i25Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bT3kHfdd; spf=pass (google.com: domain of dave.long@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=dave.long@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id t17sor1282076qtn.22.2019.02.13.18.10.46 for (Google Transport Security); Wed, 13 Feb 2019 18:10:46 -0800 (PST) Received-SPF: pass (google.com: domain of dave.long@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bT3kHfdd; spf=pass (google.com: domain of dave.long@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=dave.long@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=JB2gk2CedPJadQMqskOmLrFYGYPGa2mcX5ruUm8qlZdmCK7YfEzIHJDhB6azStIxsr 6MuYWnrqGjeBRiXCrbvS1/FMkyLDGJZx8K6NCLZEDgGTnbkSgqUO5Wxoi+6tayZYYaeW ucT+8cPMOKvVwf/ynaZ1Vx5JEitVIw5qxLLIMi0cM42QZrfMWQHnJajEqMtSrQfTC/8t Kps3qisWno3D+iF6yilbVfR1gG/sAAM64f+ZuQTo9OsMbSTbPW3KGWABYiPAhSANGIlR o/q7kcxvaBj43/n0870XzWLp2M/+8O4WCtLHsDlAk7Mk/hyRgngtzOEjQINEArayRZt0 RmjQ== X-Gm-Message-State: AHQUAuYngIyYPuc/LbGcpv3F/3e8y7Q90yP9p7A0QFhTB0FY9BSImb9w ObO9YKCdeHAszBBGWLqAI5Wt07Gf X-Google-Smtp-Source: AHgI3IazptIldckFE+JpS4X8VLBIbLvw497vjBxkeyWoq09DUgmSPtkMKbQh84Uxc//yagtB+DHsxA== X-Received: by 2002:ac8:814:: with SMTP id u20mr1011078qth.313.1550110246693; Wed, 13 Feb 2019 18:10:46 -0800 (PST) Return-Path: 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> 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(+) -- 2.17.1 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