Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2473359imj; Mon, 18 Feb 2019 06:38:06 -0800 (PST) X-Google-Smtp-Source: AHgI3IZJQFH8BjZf/fAbIoyijHNybJEmp7ViY4v1MEoHjMP8tyJj1UgZnVFK8hMoJ0L+dt48WYG1 X-Received: by 2002:a62:48c1:: with SMTP id q62mr21137589pfi.113.1550500686714; Mon, 18 Feb 2019 06:38:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550500686; cv=none; d=google.com; s=arc-20160816; b=SybxcPTmfOe7Qvgx/jl3h2KhE509KE3mGifHRkTEQTfDP9GoxjgO5cxKLxQrrpfTEa C74lb92tP6Wiu+LGXjnO+rmyyoEgygKjGx4PJ+4qPw0A0j6jWIk5nm8djGc/hdLz8CWi Ro15kmBE41b9gLqjOvhpZDvVwDuEgyk0Ikzob0Nir63cP+m0InFrY5ar5DTxdLjpBwU3 4MaNpY9ryEWxnVdObY5Hxm9JMojCH4saoaKS0NhKP7LP4PKfAm4DtTLMd9NQD3sQmHHB VAaY8nV78cv+2l1Fe4hVngBvPTzkpDVIzLa9NBMKxpFaZGPI4nZVA5i+976/KzqE0/pD i4mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YSQu1+sU+dEkQ3iMZmefSErkox1srNvsrm1F8tUUPeY=; b=ljxATTZYOJNN22CMrc9ahHI+AUw25L0G+fElOVVk4L5kfXScUb1KSeKkJY2bhBb0vx SegS53lsaM8cgYyeLNUhLptxq7qpaN/6UHq+CJxMlPGaeLpQ7rZr0TvJrhocF3X8PC1c OT8hQRAAjaFml+eWKN2k6jJwV/OpzXEZ18i9UQBWhMndQH+9hXAupNkGEjKMgOkU9SkH 2tmlrdCbN4v0bZG/RmJj46A3yVdyNtP1D4jODbNIYyMp2bwdOFI01FYrPIK6M7MpY0Ep MTMd324NvHXT1u2BIR1Tke/mYnAZU/MYfz3X4rDbt0fMRoC5oH14g+pdmJ+/z8R+iObd OSEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UjRjyjS7; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k125si13149638pfc.21.2019.02.18.06.37.50; Mon, 18 Feb 2019 06:38:06 -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=@kernel.org header.s=default header.b=UjRjyjS7; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732762AbfBRNyy (ORCPT + 99 others); Mon, 18 Feb 2019 08:54:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:34862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732824AbfBRNyw (ORCPT ); Mon, 18 Feb 2019 08:54:52 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BCECA2077B; Mon, 18 Feb 2019 13:54:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498092; bh=JBOJIClizgTZVqCoCokb6Urat2Z80g161ju1aROiPzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UjRjyjS7XhYF+fp9w0x1HegAh4wHLEG6fMk0aPTRAKqtMpynZ7OUXh6gfkOdo2Fj0 Ux23+NXAC/2K3ip3TiAL8wFcGfTKJcmT8pWfZGrLx1UiHYdpteX8zK5aktVWaI4mpA 9GVA5I4PxQ4e9MVbqpD2wiKG3wl66prsZXzAP2/U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Krzysztof Kozlowski , Russell King , "David A. Long" , Julien Thierry , Sasha Levin Subject: [PATCH 4.14 20/62] ARM: ensure that processor vtables is not lost after boot Date: Mon, 18 Feb 2019 14:43:26 +0100 Message-Id: <20190218133507.630511226@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133505.801423074@linuxfoundation.org> References: <20190218133505.801423074@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Reviewed-by: Julien Thierry Tested-by: Julien Thierry Signed-off-by: Sasha Levin --- 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 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 -- 2.19.1