From patchwork Wed Feb 13 21:32:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 158267 Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp561092jaa; Wed, 13 Feb 2019 13:32:48 -0800 (PST) X-Received: by 2002:a0c:d4ab:: with SMTP id u40mr265313qvh.30.1550093567943; Wed, 13 Feb 2019 13:32:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550093567; cv=none; d=google.com; s=arc-20160816; b=iV58QI7cqulKIG03VcWzVRT5u72wgif4loosvwrVJSuS3747JdwEZ6XLOOa8NOZ5++ wAXr84BqoSX0qjyx7IVGBSLQLDhis7nOg5XYt8N2CIS+1T/R6c6bo+jaTOiT8UVtsJQw dOWxAN15/nf8yC3BsLJ/b0lOCu7yiNSS5GVUon/Ogms9wh6sSyM9Fx4gTr7jy1cnHdSu qyy+1b5pOMpUQUaeHSuqWd82oIRypmZ7gaUvincEpNTe0agTaBXv6mHBAY66Entdw8CX yr0L3qINRxfxnQwPxXk0xwyFem5OfNGDVuVV1osR/F+UGJZnBmLke0WjT852paE9PI66 oVzQ== 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=dSDmFaGNhCoJ6xgfOovoG8pTwv3C76OTiTqwG0mEbU1lX2sLVsHtj078vBixSSKL7l T+SOeyORXDFslue4HxvgatdkCQKE4O+udFbJPd1jfbujl7XMbc5n8D9Uh95/mL12qoq6 N9JOlBZaDZDswmR7+O71vrKUPkZzKXtgIpWv/pqgyX4X0gP7fMfkIGwPKQUF5eOKQjp0 rYGYEbvBsY/tzqhZ5+b8I1ZLJfug6h6eyQVoiTxzoRf9qr61pWCLrd/Rifej+PcuK5zP sYR2SygwTWoMHrj/aTROz0FcNxHInDiW3GxLwI5lM2SCIclfur2VGgv/71F0rk0NoP+c 9NFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AA4ASCp2; 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 q8sor506906qve.61.2019.02.13.13.32.47 for (Google Transport Security); Wed, 13 Feb 2019 13:32:47 -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=AA4ASCp2; 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=AA4ASCp2mELKr3pko0Uf9JXxx6WuXxEkZtSYvfWe5+vswKI88GBJZLXygbMTr5fjVQ EGRU3Wf7YEt2bEOeP1Ec4scUcgv4TRBQtVF/vh6SP04SLUGKLnmpmjvM0JYsgE6vZV4J +RS1qwK0+UoBpvRt1EK53hEu4R+TT3N4DUSmTMhzWl+ql/v98Mc1J/Am/Ef7LYYE4AJ0 91c6Vue80g9PSD6s7zvtX9sqVlrPuIOLqJNFsN6e+WgF0iBOKXQHCGg9Td6Ea3fmWRaT 50q+aR4sM4R6x0ciV6+61Jq+WUNxLiuX3rrpMhjkE/wvSOvzl4FQZj7enqKkUN9Pevjm gzCg== 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=SmgFKTwyoNWdQ7VS3cLEM1UPl2942DZDqCUUr3EBFyChUTdl67Wh175GoqbCxlVMF2 plOfAdc63B4aFVjEZK4Ogm5+195r67wVQEIMDEE7RhN9UuW2McIuOAubIcHuK/pEAjZm UTfok/8x6f7mdllFMVTow4qVGvYdIYcj0hZNpdhu3o72WF2SJm9Bz9MLCLeSibtSh8uq +13lJrqSgChIRJY8SgXNclFXAPUjYAuTckx/ziL5FBVbqvmGze/WbFsYOihSmXnJPgEA FvdmsEYWDAA44NvFIK0jsiICEvK2JKarpx2J4yvSZWwAzOVv4e6ir8btEOTF1DUgxQZl E6GQ== X-Gm-Message-State: AHQUAuabTwwmXEUe2KteZkArxOAC9gg3ELpiXGN/Cog7d1fu50XnG/xD wJSvVWzH0tcuSCpSEwc+FxbbyZSv X-Google-Smtp-Source: AHgI3IY/femxih2p2G073ZpOVUi64ABe1+DQ/mhgjBNHd5Uoxbg7pDbglRMHPTNGP3fYNDBhVMMfDA== X-Received: by 2002:a0c:86bd:: with SMTP id 58mr237102qvf.162.1550093567665; Wed, 13 Feb 2019 13:32:47 -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 8sm382675qtr.7.2019.02.13.13.32.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 13:32:47 -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.19 16/17] ARM: ensure that processor vtables is not lost after boot Date: Wed, 13 Feb 2019 16:32:22 -0500 Message-Id: <20190213213223.916-17-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213213223.916-1-dave.long@linaro.org> References: <20190213213223.916-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