All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/14] ARM Spectre variant 2 fixes
@ 2018-05-16 10:59 ` Russell King - ARM Linux
  0 siblings, 0 replies; 62+ messages in thread
From: Russell King - ARM Linux @ 2018-05-16 10:59 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Marc Zyngier, Florian Fainelli, kvmarm, Christoffer Dall

This series addresses the Spectre variant 2 issues on ARM Cortex and
Broadcom Brahma B15 CPUs.  Due to the complexity of the bug, it is not
possible to verify that this series fixes any of the bugs, since it
has not been able to reproduce these exact scenarios using test
programs.

I believe that this covers the entire extent of the Spectre variant 2
issues, with the exception of Cortex A53 and Cortex A72 processors as
these require a substantially more complex solution (except where the
workaround is implemented in PSCI firmware.)

Spectre variant 1 is not covered by this series.

The patch series is based partly on Marc Zyngier's work from February -
two of the KVM patches are from Marc's work.

The main differences are:
- Inclusion of more processors as per current ARM Ltd security update
  documentation.
- Extension of "bugs" infrastructure to detect Cortex A8 and Cortex A15
  CPUs missing out on the IBE bit being set on (re-)entry to the kernel
  through all paths.
- Handle all suspect userspace-touching-kernelspace aborts irrespective
  of mapping type.

The first patch will trivially conflict with the Broadcom Brahma
updates already in arm-soc - it has been necessary to independently
add the ID definitions for the B15 CPU.

Having worked through this series, I'm of the opinion that the
define_processor_functions macro in proc-v7 are probably  more hassle
than they're worth - here, we don't need the global equivalent symbols,
because we never refer to them from the kernel code for any V7
processor (MULTI_CPU is always defined.)

This series is currently in my "spectre" branch (along with some
Spectre variant 1 patches.)

Please carefully review.

 arch/arm/include/asm/bugs.h        |   6 +-
 arch/arm/include/asm/cp15.h        |   3 +
 arch/arm/include/asm/cputype.h     |   5 ++
 arch/arm/include/asm/kvm_asm.h     |   2 -
 arch/arm/include/asm/kvm_host.h    |  14 +++-
 arch/arm/include/asm/kvm_mmu.h     |  23 +++++-
 arch/arm/include/asm/proc-fns.h    |   4 +
 arch/arm/include/asm/system_misc.h |   8 ++
 arch/arm/kernel/Makefile           |   1 +
 arch/arm/kernel/bugs.c             |  18 +++++
 arch/arm/kernel/smp.c              |   4 +
 arch/arm/kernel/suspend.c          |   2 +
 arch/arm/kvm/hyp/hyp-entry.S       | 108 ++++++++++++++++++++++++-
 arch/arm/mm/Kconfig                |  23 ++++++
 arch/arm/mm/Makefile               |   2 +-
 arch/arm/mm/fault.c                |   3 +
 arch/arm/mm/proc-macros.S          |   3 +-
 arch/arm/mm/proc-v7-2level.S       |   6 --
 arch/arm/mm/proc-v7-bugs.c         | 130 ++++++++++++++++++++++++++++++
 arch/arm/mm/proc-v7.S              | 158 +++++++++++++++++++++++++++++--------
 20 files changed, 471 insertions(+), 52 deletions(-)

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 62+ messages in thread
* [PATCH v2 00/14] ARM Spectre variant 2 fixes
@ 2018-05-21 11:42 Russell King - ARM Linux
  2018-05-21 11:45   ` Russell King
  0 siblings, 1 reply; 62+ messages in thread
From: Russell King - ARM Linux @ 2018-05-21 11:42 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Marc Zyngier, Florian Fainelli, kvmarm, Christoffer Dall

This is the second posting - the original cover note is below.  Comments
from previous series addresesd:
- Drop R7 and R8 changes.
- Remove "PSCI" from the hypervisor version of the workaround.

 arch/arm/include/asm/bugs.h        |   6 +-
 arch/arm/include/asm/cp15.h        |   3 +
 arch/arm/include/asm/cputype.h     |   5 ++
 arch/arm/include/asm/kvm_asm.h     |   2 -
 arch/arm/include/asm/kvm_host.h    |  14 +++-
 arch/arm/include/asm/kvm_mmu.h     |  23 +++++-
 arch/arm/include/asm/proc-fns.h    |   4 +
 arch/arm/include/asm/system_misc.h |   8 ++
 arch/arm/kernel/Makefile           |   1 +
 arch/arm/kernel/bugs.c             |  18 +++++
 arch/arm/kernel/smp.c              |   4 +
 arch/arm/kernel/suspend.c          |   2 +
 arch/arm/kvm/hyp/hyp-entry.S       | 108 +++++++++++++++++++++++++-
 arch/arm/mm/Kconfig                |  23 ++++++
 arch/arm/mm/Makefile               |   2 +-
 arch/arm/mm/fault.c                |   3 +
 arch/arm/mm/proc-macros.S          |   3 +-
 arch/arm/mm/proc-v7-2level.S       |   6 --
 arch/arm/mm/proc-v7-bugs.c         | 130 +++++++++++++++++++++++++++++++
 arch/arm/mm/proc-v7.S              | 154 +++++++++++++++++++++++++++++--------
 20 files changed, 469 insertions(+), 50 deletions(-)
 create mode 100644 arch/arm/kernel/bugs.c
 create mode 100644 arch/arm/mm/proc-v7-bugs.c

On Wed, May 16, 2018 at 11:59:49AM +0100, Russell King - ARM Linux wrote:
> This series addresses the Spectre variant 2 issues on ARM Cortex and
> Broadcom Brahma B15 CPUs.  Due to the complexity of the bug, it is not
> possible to verify that this series fixes any of the bugs, since it
> has not been able to reproduce these exact scenarios using test
> programs.
> 
> I believe that this covers the entire extent of the Spectre variant 2
> issues, with the exception of Cortex A53 and Cortex A72 processors as
> these require a substantially more complex solution (except where the
> workaround is implemented in PSCI firmware.)
> 
> Spectre variant 1 is not covered by this series.
> 
> The patch series is based partly on Marc Zyngier's work from February -
> two of the KVM patches are from Marc's work.
> 
> The main differences are:
> - Inclusion of more processors as per current ARM Ltd security update
>   documentation.
> - Extension of "bugs" infrastructure to detect Cortex A8 and Cortex A15
>   CPUs missing out on the IBE bit being set on (re-)entry to the kernel
>   through all paths.
> - Handle all suspect userspace-touching-kernelspace aborts irrespective
>   of mapping type.
> 
> The first patch will trivially conflict with the Broadcom Brahma
> updates already in arm-soc - it has been necessary to independently
> add the ID definitions for the B15 CPU.
> 
> Having worked through this series, I'm of the opinion that the
> define_processor_functions macro in proc-v7 are probably  more hassle
> than they're worth - here, we don't need the global equivalent symbols,
> because we never refer to them from the kernel code for any V7
> processor (MULTI_CPU is always defined.)
> 
> This series is currently in my "spectre" branch (along with some
> Spectre variant 1 patches.)
> 
> Please carefully review.
> 
>  arch/arm/include/asm/bugs.h        |   6 +-
>  arch/arm/include/asm/cp15.h        |   3 +
>  arch/arm/include/asm/cputype.h     |   5 ++
>  arch/arm/include/asm/kvm_asm.h     |   2 -
>  arch/arm/include/asm/kvm_host.h    |  14 +++-
>  arch/arm/include/asm/kvm_mmu.h     |  23 +++++-
>  arch/arm/include/asm/proc-fns.h    |   4 +
>  arch/arm/include/asm/system_misc.h |   8 ++
>  arch/arm/kernel/Makefile           |   1 +
>  arch/arm/kernel/bugs.c             |  18 +++++
>  arch/arm/kernel/smp.c              |   4 +
>  arch/arm/kernel/suspend.c          |   2 +
>  arch/arm/kvm/hyp/hyp-entry.S       | 108 ++++++++++++++++++++++++-
>  arch/arm/mm/Kconfig                |  23 ++++++
>  arch/arm/mm/Makefile               |   2 +-
>  arch/arm/mm/fault.c                |   3 +
>  arch/arm/mm/proc-macros.S          |   3 +-
>  arch/arm/mm/proc-v7-2level.S       |   6 --
>  arch/arm/mm/proc-v7-bugs.c         | 130 ++++++++++++++++++++++++++++++
>  arch/arm/mm/proc-v7.S              | 158 +++++++++++++++++++++++++++++--------
>  20 files changed, 471 insertions(+), 52 deletions(-)
> 
> -- 
> RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
> FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
> According to speedtest.net: 8.21Mbps down 510kbps up
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2018-05-22 10:55 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16 10:59 [PATCH 0/14] ARM Spectre variant 2 fixes Russell King - ARM Linux
2018-05-16 10:59 ` Russell King - ARM Linux
2018-05-16 11:00 ` [PATCH 01/14] ARM: add CPU part numbers for Cortex A73, A75 and Brahma B15 Russell King
2018-05-16 11:00   ` Russell King
2018-05-16 16:19   ` Florian Fainelli
2018-05-16 16:19     ` Florian Fainelli
2018-05-16 11:00 ` [PATCH 02/14] ARM: bugs: prepare processor bug infrastructure Russell King
2018-05-16 11:00   ` Russell King
2018-05-16 16:21   ` Florian Fainelli
2018-05-16 16:21     ` Florian Fainelli
2018-05-16 11:00 ` [PATCH 03/14] ARM: bugs: hook processor bug checking into SMP and suspend paths Russell King
2018-05-16 11:00   ` Russell King
2018-05-16 16:23   ` Florian Fainelli
2018-05-16 16:23     ` Florian Fainelli
2018-05-19 10:13     ` Russell King - ARM Linux
2018-05-19 10:13       ` Russell King - ARM Linux
2018-05-16 11:00 ` [PATCH 04/14] ARM: bugs: add support for per-processor bug checking Russell King
2018-05-16 11:00   ` Russell King
2018-05-16 16:23   ` Florian Fainelli
2018-05-16 16:23     ` Florian Fainelli
2018-05-16 11:01 ` [PATCH 05/14] ARM: spectre: add Kconfig symbol for CPUs vulnerable to Spectre Russell King
2018-05-16 11:01   ` Russell King
2018-05-16 16:24   ` Florian Fainelli
2018-05-16 16:24     ` Florian Fainelli
2018-05-16 11:01 ` [PATCH 06/14] ARM: spectre-v2: harden branch predictor on context switches Russell King
2018-05-16 11:01   ` Russell King
2018-05-16 11:33   ` Vladimir Murzin
2018-05-16 11:33     ` Vladimir Murzin
2018-05-16 11:01 ` [PATCH 07/14] ARM: spectre-v2: add Cortex A8 and A15 validation of the IBE bit Russell King
2018-05-16 11:01   ` Russell King
2018-05-16 16:33   ` Florian Fainelli
2018-05-16 16:33     ` Florian Fainelli
2018-05-16 16:34   ` Florian Fainelli
2018-05-16 16:34     ` Florian Fainelli
2018-05-22 10:38   ` Geert Uytterhoeven
2018-05-22 10:38     ` Geert Uytterhoeven
2018-05-22 10:55     ` Russell King - ARM Linux
2018-05-22 10:55       ` Russell King - ARM Linux
2018-05-16 11:01 ` [PATCH 08/14] ARM: spectre-v2: harden user aborts in kernel space Russell King
2018-05-16 11:01   ` Russell King
2018-05-16 16:35   ` Florian Fainelli
2018-05-16 16:35     ` Florian Fainelli
2018-05-16 11:01 ` [PATCH 09/14] ARM: spectre-v2: add PSCI based hardening Russell King
2018-05-16 11:01   ` Russell King
2018-05-16 17:01   ` Marc Zyngier
2018-05-16 17:01     ` Marc Zyngier
2018-05-16 11:01 ` [PATCH 10/14] ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17 Russell King
2018-05-16 11:01   ` Russell King
2018-05-16 11:01 ` [PATCH 11/14] ARM: KVM: invalidate icache on guest exit for Cortex-A15 Russell King
2018-05-16 11:01   ` Russell King
2018-05-16 11:01 ` [PATCH 12/14] ARM: spectre-v2: KVM: invalidate icache on guest exit for Brahma B15 Russell King
2018-05-16 11:01   ` Russell King
2018-05-16 16:27   ` Florian Fainelli
2018-05-16 16:27     ` Florian Fainelli
2018-05-16 11:01 ` [PATCH 13/14] ARM: KVM: Add SMCCC_ARCH_WORKAROUND_1 fast handling Russell King
2018-05-16 11:01   ` Russell King
2018-05-16 11:01 ` [PATCH 14/14] ARM: KVM: report support for SMCCC_ARCH_WORKAROUND_1 Russell King
2018-05-16 11:01   ` Russell King
2018-05-21 11:42 [PATCH v2 00/14] ARM Spectre variant 2 fixes Russell King - ARM Linux
2018-05-21 11:45 ` [PATCH 12/14] ARM: spectre-v2: KVM: invalidate icache on guest exit for Brahma B15 Russell King
2018-05-21 11:45   ` Russell King
2018-05-22  3:22   ` Florian Fainelli
2018-05-22  3:22     ` Florian Fainelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.