Return-Path: Received: from mail-qt1-f195.google.com ([209.85.160.195]:42400 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387685AbeKGBqU (ORCPT ); Tue, 6 Nov 2018 20:46:20 -0500 Received: by mail-qt1-f195.google.com with SMTP id z20-v6so3228468qti.9 for ; Tue, 06 Nov 2018 08:20:23 -0800 (PST) Subject: Re: [PATCH 4.9 09/24] ARM: spectre-v2: add firmware based hardening To: Marc Zyngier Cc: stable@vger.kernel.org, Russell King - ARM Linux , Florian Fainelli , Tony Lindgren , Mark Rutland , Greg KH , Mark Brown References: <20181031135713.2873-1-dave.long@linaro.org> <20181031135713.2873-10-dave.long@linaro.org> <86y3a6ebfi.wl-marc.zyngier@arm.com> From: David Long Message-ID: Date: Tue, 6 Nov 2018 11:20:19 -0500 MIME-Version: 1.0 In-Reply-To: <86y3a6ebfi.wl-marc.zyngier@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On 11/6/18 5:40 AM, Marc Zyngier wrote: > 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/ > Note that it looks like this problem is now in v4.14 stable too. -dl