From patchwork Thu Jan 10 17:51:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 155261 Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2176410jaa; Thu, 10 Jan 2019 09:52:16 -0800 (PST) X-Received: by 2002:ac8:3f5c:: with SMTP id w28mr10589912qtk.151.1547142736879; Thu, 10 Jan 2019 09:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547142736; cv=none; d=google.com; s=arc-20160816; b=Ke0zUH757DwTw8dPbxNFw6K8Qcy647QJDQ3/q8kQ2foHSApxvmBlWXPRv+XazH9t1M 7u5giUjdmXim77U/nnp03Wy8pMusYzl12MUxLMkQ+XE5DqjS1znQd2U6M7PykJf1OQ+h hI45bLMjmgJRr/iF+cuDCM6ckaxxftSSyIRHwhvW7VoBBikEYtieznqrhqq9GklLCYqc M4COP1za06etC0iGzmonsCnyG6jZfJWCYVVIlzXBOgpqzkgxmHsffR6j4L3dyJ+1DMVl VZaqg8VVnjjyaGkFlYfGvOW+rKFkakuaLdf4ezVUurcAFr9WOzAPXsrhWUkb5bU1kPu1 BYmg== 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=DSlpPwdymaPcVoIYjYD+RfzGt6TFZ1O7+hNpXWq6ZzCL85nYMMrk5JYxLI7YAQYVTL fcFUOpnm895n/i5Ho4jiAsVWmWaaKvTSNPf7t2PZ6Gh9dCSJa+/eaHDPoa3bNMwvlg2i Tifh9LWZ82vaSQ0PuKUUlXegEA1YKLoRkcWEqaC1Bo17un8XAXX/ICmxJRKMBh8wdD2e y2nLQhUjVxmgorGWvh6yoXCSIBPisS4XVUhCrSVDyU0YqPTXelfjX0NyLeRN5qi3KTwt ldXqLadHZlZQH6Ouxab5VeuDDdeDULo+E4U8wrd+CK8ak/La48uD9CNYZqyIcrr+qJkt OcTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e5zAqn8F; 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 x20sor67083262qvj.36.2019.01.10.09.52.16 for (Google Transport Security); Thu, 10 Jan 2019 09:52:16 -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=e5zAqn8F; 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=e5zAqn8FwHcZKg1LC1tVPV7fhNt8tU9+cfuLDFrOAMll/bqWLEQPC+EuqBm8MbKYAh brJNsri0/RUkvWVnD9XM7y7dbAcUZaWX0ra2H7spljiB9wfhK3ZtcuN+npFaSGPpnFm/ 39hgPcUCnsaE6I3Re5kLsGWyhAaV8oxHO3cUY= 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=iJqlruzv9CycjncwgHDJxOemJ3VRQpF5eHBci6gxB9nu0AckQCnQZKcZ6gsjHtMMTQ 4hllfD+dv/tzqYnHkp/Th5gP7aEO/6LWWdEsprN4LaTEj4Vh9rSCT6zAJCh6bjSzPTYo cmD8mSTt57/kmQx9lMh9MwCLK0KvgNHOCFjvXDcFrTtNe1Ago13npQ9P5UynMeR8Izqv GFB35K1LetpkyvEr2LBRjd+4niU6GsFYrrktSxeAMp/oXWHfSNPPBNMqZ5C2CCfs13JA NCyDz6Ls78QE67ASbZSOtygDDk51+Ul+JtUXecAZUBfwUgZOl3SylLOYJIKXdrg13q83 ioBw== X-Gm-Message-State: AJcUukeYVLusJyvUV2mDgySo0QUwj6dvgW84ED6n6oMC9TD9DoXJob+1 IpS6pGaBPOeFiC5Cr/ip9ADThf8d X-Google-Smtp-Source: ALg8bN4hh5B70vBsTCbjL+oql5kQs5nTITZCmCYMvH6f8f/CBktsDKHEyLPKE0j/KdhZn3rAelGr3g== X-Received: by 2002:ad4:4391:: with SMTP id s17mr10830663qvr.32.1547142736635; Thu, 10 Jan 2019 09:52:16 -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 b8sm41815904qka.79.2019.01.10.09.52.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 09:52:15 -0800 (PST) From: David Long To: stable@vger.kernel.org, Russell King - ARM Linux , Florian Fainelli , Julien Thierry , Tony Lindgren , Marc Zyngier , Mark Rutland Cc: Greg KH , Mark Brown Subject: [PATCH 4.14 16/17] ARM: ensure that processor vtables is not lost after boot Date: Thu, 10 Jan 2019 12:51:49 -0500 Message-Id: <20190110175150.5239-17-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190110175150.5239-1-dave.long@linaro.org> References: <20190110175150.5239-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