From patchwork Thu Feb 14 14:49:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 158409 Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1462425jaa; Thu, 14 Feb 2019 06:49:53 -0800 (PST) X-Received: by 2002:ac8:26b9:: with SMTP id 54mr3356724qto.301.1550155793822; Thu, 14 Feb 2019 06:49:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550155793; cv=none; d=google.com; s=arc-20160816; b=vYQ3txrmEthljumP24vD4WqNlvCcBpllI2+mBrtZwxMWi8hRZvqH/tZbrI0LCTrcg6 N0s6mRJ8Rz3QSPZ0pGNW3y8wLlY9LzMfkzJEEHv1nSW1de116aJ7rHut3qR6oyyUmCau vsnNOg9MOt0Bx0Gq6JcheuUyNYJh8oezY/AodM9zB/fqlTiZX+KN1kr7Q5M+VCASxsWp BR1Jxme5vxKJ4/vvNfLcdF8zaN9xWnc0C1VQRaPPOSbiKup9VddEpK2o/qKtSKoEnVUE gO1elW0jJiz1UIgx+9YIh3I2c9I667k6ZLfd9c69HmJPcpSuknc+mNFZiXQV/7ESro+c NlGA== 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=OZ3w/jmfXs2wPitKzfdSFG0201b2pR2doaOOTk38mKc=; b=UIsSq4nh+OsWO2Ma5FBdwaEon5/gXvLHgPVP9XY0WU+tfspGTZtxx/wpPqyUbhUU9O I8XOZyecLHk5JQz6LHwhhDnmvEjK1dQ1iLmiWgMN1l9sM36JidRKtr720zApU5FtxTIQ qIG74haKskLe8wkPSIFsX2x+PFTtMUaXLiIkJE3gsiNkRt4rbds2K64gOkBylE5/mXv0 sqVYTdKhdgf0f6PJbzfTGIEWJV/5hvOfhXvFjkn41tO7nY/7jipqYwzvT2lWI4q38DRn YWryTculRNo43h9cziu5OBb+G4b+mp478PNQE50g2OBgSxAPkQGjV4ayB5Ztr3w7Yi5d LGFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XpWeH7lS; 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 a9sor3205931qtj.40.2019.02.14.06.49.53 for (Google Transport Security); Thu, 14 Feb 2019 06:49:53 -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=XpWeH7lS; 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=OZ3w/jmfXs2wPitKzfdSFG0201b2pR2doaOOTk38mKc=; b=XpWeH7lS5H+3J1QFhvbSoyLLqklA1vROnnRDJ+ITFcNghqk16goR7jMGIqnWxYUYDq dWz3W6p4SH88in/qqqxTriIULi9n42o5qOcDnM0/MAVT/EXCOdqrYcqBZpsXhrhqoK5R i8HjtnTeuHQL/s4D8tihJJ/oJvH7Hy9o8c7KJIRhFXMhvAcAP5tfgPbWMevhTFoNN5TL 1s+rpeBTOh0uJvabSCOQ3BSUtJliKCOFkip48o10bT0wH7ZeVDxZ1gAG3Llv2ysWPtVB Dd1bfJkaJBuha5Q/GT/vUG+UMxbKebFjaRpWr1nH8dXYO633/6rgeqb+AlFOW1YFKJy3 Cpng== 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=OZ3w/jmfXs2wPitKzfdSFG0201b2pR2doaOOTk38mKc=; b=oVuhH4exhGCZJXryonPtUa7V/UAdtL/n7mMXf5yMcYkQkZgc6Cww0PSwtNYR0qMgsB GbzKS7Zp+1foYxz3lSr0Qhm1gBVSzHRGkYQ2RyVHBlE5bFSTbawmRc5tnVh5DGBvGG+Y 8OJWvJqMFT+24i4tkiLhsKQJggSFfix2I1n+99AqPJN3EbHYV1OSVcqDf7lMJ3akcWUD yOX8Kl05bNSdbwzrltx3nOvq89SSqj2GYyjKAUTHaa1ixMW+GyUqO+MtNZrcyMNtVF0n qZwm9ExcN5seoHbuhSZMdrlL4p2tIfIzjqgVGfQNpvlscHWc6OSEUxTb4XDczM1andFH uLQg== X-Gm-Message-State: AHQUAuakJvI4Tg48PLD9mCdkRGXbV8gKpBd+nLtoGfftxpqpDddQdN6J ZoczTjm1wuRS4bV5OU8iWfDPoccXPSitSQ== X-Google-Smtp-Source: AHgI3IYDvHYEt1JOmFbHDHNBdaYonXbEGuQH4Yfe08E2etAt8PWdzu/HrFH+WXBCCyJrBbjKfP2gyA== X-Received: by 2002:ac8:1413:: with SMTP id k19mr786554qtj.134.1550155793586; Thu, 14 Feb 2019 06:49:53 -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 k66sm1498919qkc.25.2019.02.14.06.49.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 06:49:53 -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.9 15/16] ARM: ensure that processor vtables is not lost after boot Date: Thu, 14 Feb 2019 09:49:29 -0500 Message-Id: <20190214144930.27539-16-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190214144930.27539-1-dave.long@linaro.org> References: <20190214144930.27539-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 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