Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp96377imj; Thu, 14 Feb 2019 16:08:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IaBn8K9AlrnowExNL/azVLz3fzXzyflS6CR9drSkqJGwu/NL0mRgWNjJxyKM53QwkiPRdMi X-Received: by 2002:a17:902:bc88:: with SMTP id bb8mr7185615plb.12.1550189299107; Thu, 14 Feb 2019 16:08:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550189299; cv=none; d=google.com; s=arc-20160816; b=Ji4aRFS5bocA1Kmx5ujFWnNGehbhqlTB1ezWiV98sk1Q6d072pP9gFnUBQALGBgg6+ 8y1mxKpfMUAzAEziiNWHi+WKeVnXUFyQTQf7gKmuy70YUSYwlc2Q7UrH8YgXw/gAQgkp Y+WhiHiPGtazInQRvcae+2xJpwwM8Lp8RdDyqv1+tOxlCNnYh4CuZ/UB5bsLaNZtx5in aZuV++TU3BmiVUFrEvx63DQ23/xEL4rP/oqTbHN4RiXDbh4B5Fcj0ng2U6Hh43x7W7kc tPl/qMtd47SAfB4Had2c+u0eotX7CtDxqsPhU9xZi51wX/bzi5o8+EB1ZslY5uznfKOs 0aqg== 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=OZ3w/jmfXs2wPitKzfdSFG0201b2pR2doaOOTk38mKc=; b=orogEHpooH5VjGhZvSNAD6kouyAIQJ3+s7foTqYWUXym8fnSTcY9u1cx8Jf2FZ3JEc p8xNWGwBs9GFUm16jo+4UxIqeuiK5PeY8ZCR14KT+T/tNZAMHXpCnx6dDXwigtjZwfKr CHOZRwMU8v02A8/Si2p79Qyhg9hBhUtDDr+XFOjqCCrX07kQMSMOzoexJZYfajGj54ev qU8kGgrxgnzrXbr0m6bLqQK903J7jVGr3vjOjXMVIzHd9xR/nZpGvvRdAALGlOWAzDKz RFykzaqRM3/jmladxIx9vhdU6ANo3/sBY8zO9gYkKk00VTX7gOx1v1jODo2EgYa9Nu5N X6dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XpWeH7lS; 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 f12si3658636pgq.105.2019.02.14.16.08.03; Thu, 14 Feb 2019 16:08:19 -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=XpWeH7lS; 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 S2439365AbfBNOt6 (ORCPT + 99 others); Thu, 14 Feb 2019 09:49:58 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:44879 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407275AbfBNOty (ORCPT ); Thu, 14 Feb 2019 09:49:54 -0500 Received: by mail-qt1-f195.google.com with SMTP id n32so7046480qte.11 for ; Thu, 14 Feb 2019 06:49:54 -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=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=DhpA5wxDXvo69mc3+jIit51cgiQpINs55y928hQvZo3MT6VCs4WQRhiYNHbySgCFp4 Fd8xvyJRLJxHQQEU5HX5MkrH1a7mO1Em0WDtKMA3x4DPVriDROYRvk6nsGJ1zASbOj69 zV95BbEQX/YAWv6+Dx74/Pbmnim/mkJCYVMDo0PuFI291a1UvfwoHQ9Ulc46nBU5KrgS 672yt4I996UaysqITQw+oESj2rPsUz3kQC1ONCgT8QLCaavMTogFGlCmexUEFWyOhZan ENrv1I/nb5nVAzw00YALKIz0jw+VKBpA+MkhFv28cFnVu3MozVS57gQ2luREm0ECkgGX EBzw== X-Gm-Message-State: AHQUAubiVbB9v79+DPDFAVx2fQ2mmIZNc7QOSTBbRWUcj/nd5o/4EoZr LWFGNbyAF+TPO5gJ/LUlWyJhfA== X-Received: by 2002:ac8:1413:: with SMTP id k19mr786554qtj.134.1550155793586; Thu, 14 Feb 2019 06:49:53 -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 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> 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 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 -- 2.17.1