From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:58684 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387404AbeKFUFW (ORCPT ); Tue, 6 Nov 2018 15:05:22 -0500 Date: Tue, 06 Nov 2018 10:40:33 +0000 Message-ID: <86y3a6ebfi.wl-marc.zyngier@arm.com> From: Marc Zyngier To: David Long Cc: stable@vger.kernel.org, Russell King - ARM Linux , Florian Fainelli , Tony Lindgren , Mark Rutland , Greg KH , Mark Brown Subject: Re: [PATCH 4.9 09/24] ARM: spectre-v2: add firmware based hardening In-Reply-To: <20181031135713.2873-10-dave.long@linaro.org> References: <20181031135713.2873-1-dave.long@linaro.org> <20181031135713.2873-10-dave.long@linaro.org> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: stable-owner@vger.kernel.org List-ID: On Wed, 31 Oct 2018 13:56:58 +0000, David Long wrote: > > From: Russell King > > Commit 10115105cb3aa17b5da1cb726ae8dd5f6854bd93 upstream. > > Add firmware based hardening for cores that require more complex > handling in firmware. > > Signed-off-by: Russell King > Boot-tested-by: Tony Lindgren > Reviewed-by: Tony Lindgren > Reviewed-by: Marc Zyngier > Signed-off-by: David A. Long > --- > arch/arm/mm/proc-v7-bugs.c | 60 ++++++++++++++++++++++++++++++++++++++ > arch/arm/mm/proc-v7.S | 21 +++++++++++++ > 2 files changed, 81 insertions(+) > [...] > diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S > index 2d2e5ae85816..8fde9edb4a48 100644 > --- a/arch/arm/mm/proc-v7.S > +++ b/arch/arm/mm/proc-v7.S > @@ -9,6 +9,7 @@ > * > * This is the "shell" of the ARMv7 processor support. > */ > +#include > #include > #include > #include > @@ -88,6 +89,26 @@ ENTRY(cpu_v7_dcache_clean_area) > ret lr > ENDPROC(cpu_v7_dcache_clean_area) > > +#ifdef CONFIG_ARM_PSCI > + .arch_extension sec > +ENTRY(cpu_v7_smc_switch_mm) > + stmfd sp!, {r0 - r3} > + movw r0, #:lower16:ARM_SMCCC_ARCH_WORKAROUND_1 > + movt r0, #:upper16:ARM_SMCCC_ARCH_WORKAROUND_1 > + smc #0 > + ldmfd sp!, {r0 - r3} > + b cpu_v7_switch_mm > +ENDPROC(cpu_v7_smc_switch_mm) > + .arch_extension virt > +ENTRY(cpu_v7_hvc_switch_mm) > + stmfd sp!, {r0 - r3} > + movw r0, #:lower16:ARM_SMCCC_ARCH_WORKAROUND_1 > + movt r0, #:upper16:ARM_SMCCC_ARCH_WORKAROUND_1 > + hvc #0 > + ldmfd sp!, {r0 - r3} > + b cpu_v7_switch_mm > +ENDPROC(cpu_v7_smc_switch_mm) As pointed out by Ard a while ago [1], this breaks Thumb-2 kernels. Please keep this series on hold until this is fixed in mainline and you can cherry-pick the corresponding patch. Thanks, M. [1] https://patchwork.kernel.org/patch/10475033/ -- Jazz is not dead, it just smell funny.