All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/20] arm64: Rework cpu capabilities handling
@ 2018-01-31 18:27 ` Suzuki K Poulose
  0 siblings, 0 replies; 156+ messages in thread
From: Suzuki K Poulose @ 2018-01-31 18:27 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, ard.biesheuvel, will.deacon, mark.rutland,
	marc.zyngier, catalin.marinas, ckadabi, dave.martin, jnair,
	Suzuki K Poulose

This series reworks the arm64 CPU capabilities handling (which
manages the system features and errata). The current infrastructure
doesn't allow fine control for handling different features or errata.
There is one rule for features and another rule for errata.

* Features are checked only once, after all the boot time CPUs are
  activated. Any new CPU that is brought up is prevented from booting
  if it misses a feature already established. If the new CPU has a
  feature not enabled already, it is allowed to boot.

* Errata checks are performed on all the CPUs and any new CPU is
  OK to miss the capability. However if a late CPU requires a work around,
  then we fail the CPU.

  This doesn't always apply to some features. e.g, KPTI is a security
  feature which should be applied when at least one CPU needs it. So,
  the tests should be performed on all the booting CPUs individually.
  Also, if a CPU that needs this security feature is brought up later,
  when the system has not enabled it, the CPU can boot making the system
  insecure. Another exception is the hardware DBM for page tables. The
  kernel can safely run with a mix of CPUs that have the feature turned
  on and off. This again causes problem when a new CPU is brought up
  which may not have the feature, which is killed.

  Also there are other features like, GICV3 system register access,
  which now need to be enabled very early based on the boot CPU to
  allow the use of Priority handling to implement NMI.

This calls for finer level of control per capability and the series
implements the same by defining how to deal with a conflict of a
given capability on a CPU with that of the system level state. It
also consolidates the handling of features and errata into generic
helpers. The table of features and errata are left as they are to
allow easier look up for a given type.

The series also gets rid of duplicate entries for a single capability
by introducing a wrapper entry which takes care of managing a list
of entries with distinct matches/enable pair.

We also cleans up the MIDR range handling and cleans up some of the
errata checks where the entries were duplicated for checking different
CPU models. Finally it also implements a work around for Arm Cortex-A55
erratum 1024718 based on the new infrastructure.

Changes since V1
 - Pickup almost all suggestions by Dave.
 - Rename flags for handling conflicts
 - Rename the "enable" call back to cpu_enable
 - Update prototype for cpu_enable to void.
 - Handle capabilities with multiple table entries, simplifying the
   core logic.
 - Add capabilities based on Boot CPU.
 - Change the type for BP Hardening to accept late CPUs.
 - More usersfor midr_range list.
 - More commentary in the code.
 - Flip type of Software prefetching capability to Weak from Strict.


Dave Martin (1):
  arm64: capabilities: Update prototype for enable call back

Suzuki K Poulose (19):
  arm64: capabilities: Move errata work around check on boot CPU
  arm64: capabilities: Move errata processing code
  arm64: capabilities: Prepare for fine grained capabilities
  arm64: capabilities: Add flags to handle the conflicts on late CPU
  arm64: capabilities: Unify the verification
  arm64: capabilities: Filter the entries based on a given mask
  arm64: capabilities: Group handling of features and errata
  arm64: capabilities: Introduce weak features based on local CPU
  arm64: capabilities: Restrict KPTI detection to boot-time CPUs
  arm64: capabilities: Add support for features enabled early
  arm64: capabilities: Change scope of VHE to Boot CPU feature
  arm64: capabilities: Clean up midr range helpers
  arm64: Add helpers for checking CPU MIDR against a range
  arm64: capabilities: Add support for checks based on a list of MIDRs
  arm64: Handle shared capability entries
  arm64: bp hardening: Allow late CPUs to enable work around
  arm64: Add MIDR encoding for Arm Cortex-A55 and Cortex-A35
  arm64: Delay enabling hardware DBM feature
  arm64: Add work around for Arm Cortex-A55 Erratum 1024718

 Documentation/arm64/silicon-errata.txt |   1 +
 arch/arm64/Kconfig                     |  14 ++
 arch/arm64/include/asm/cpucaps.h       |   3 +-
 arch/arm64/include/asm/cpufeature.h    | 237 +++++++++++++++++++++--
 arch/arm64/include/asm/cputype.h       |  42 +++++
 arch/arm64/include/asm/fpsimd.h        |   4 +-
 arch/arm64/include/asm/processor.h     |   7 +-
 arch/arm64/include/asm/virt.h          |   6 -
 arch/arm64/kernel/cpu_errata.c         | 284 +++++++++++++++-------------
 arch/arm64/kernel/cpufeature.c         | 333 +++++++++++++++++++++++++--------
 arch/arm64/kernel/fpsimd.c             |   5 +-
 arch/arm64/kernel/smp.c                |  44 -----
 arch/arm64/kernel/traps.c              |   4 +-
 arch/arm64/mm/fault.c                  |   3 +-
 arch/arm64/mm/proc.S                   |   9 +-
 15 files changed, 702 insertions(+), 294 deletions(-)

-- 
2.14.3

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

end of thread, other threads:[~2018-02-09 14:21 UTC | newest]

Thread overview: 156+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 18:27 [PATCH v2 00/20] arm64: Rework cpu capabilities handling Suzuki K Poulose
2018-01-31 18:27 ` Suzuki K Poulose
2018-01-31 18:27 ` [PATCH v2 01/20] arm64: capabilities: Update prototype for enable call back Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:37   ` Dave Martin
2018-02-07 10:37     ` Dave Martin
2018-02-07 11:23   ` Robin Murphy
2018-02-07 11:23     ` Robin Murphy
2018-01-31 18:27 ` [PATCH v2 02/20] arm64: capabilities: Move errata work around check on boot CPU Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:37   ` Dave Martin
2018-02-07 10:37     ` Dave Martin
2018-02-07 14:47     ` Suzuki K Poulose
2018-02-07 14:47       ` Suzuki K Poulose
2018-01-31 18:27 ` [PATCH v2 03/20] arm64: capabilities: Move errata processing code Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:37   ` Dave Martin
2018-02-07 10:37     ` Dave Martin
2018-01-31 18:27 ` [PATCH v2 04/20] arm64: capabilities: Prepare for fine grained capabilities Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:37   ` Dave Martin
2018-02-07 10:37     ` Dave Martin
2018-02-07 15:16     ` Suzuki K Poulose
2018-02-07 15:16       ` Suzuki K Poulose
2018-02-07 15:39       ` Dave Martin
2018-02-07 15:39         ` Dave Martin
2018-01-31 18:27 ` [PATCH v2 05/20] arm64: capabilities: Add flags to handle the conflicts on late CPU Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:38   ` Dave Martin
2018-02-07 10:38     ` Dave Martin
2018-02-07 11:31     ` Robin Murphy
2018-02-07 11:31       ` Robin Murphy
2018-02-07 16:53       ` Suzuki K Poulose
2018-02-07 16:53         ` Suzuki K Poulose
2018-01-31 18:27 ` [PATCH v2 06/20] arm64: capabilities: Unify the verification Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:38   ` Dave Martin
2018-02-07 10:38     ` Dave Martin
2018-02-07 16:56     ` Suzuki K Poulose
2018-02-07 16:56       ` Suzuki K Poulose
2018-01-31 18:27 ` [PATCH v2 07/20] arm64: capabilities: Filter the entries based on a given mask Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:38   ` Dave Martin
2018-02-07 10:38     ` Dave Martin
2018-02-07 17:01     ` Suzuki K Poulose
2018-02-07 17:01       ` Suzuki K Poulose
2018-01-31 18:27 ` [PATCH v2 08/20] arm64: capabilities: Group handling of features and errata Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:38   ` Dave Martin
2018-02-07 10:38     ` Dave Martin
2018-02-08 12:10     ` Suzuki K Poulose
2018-02-08 12:10       ` Suzuki K Poulose
2018-02-08 12:12       ` [PATCH 1/2] arm64: capabilities: Allow flexibility in scope Suzuki K Poulose
2018-02-08 12:12         ` Suzuki K Poulose
2018-02-08 12:12         ` [PATCH 2/2] arm64: capabilities: Group handling of features and errata workarounds Suzuki K Poulose
2018-02-08 12:12           ` Suzuki K Poulose
2018-02-08 16:10         ` [PATCH 1/2] arm64: capabilities: Allow flexibility in scope Dave Martin
2018-02-08 16:10           ` Dave Martin
2018-02-08 16:31           ` Suzuki K Poulose
2018-02-08 16:31             ` Suzuki K Poulose
2018-02-08 17:32             ` Dave Martin
2018-02-08 17:32               ` Dave Martin
2018-02-09 12:16               ` Suzuki K Poulose
2018-02-09 12:16                 ` Suzuki K Poulose
2018-02-09 12:16                 ` [PATCH 1/4] arm64: capabilities: Prepare for grouping features and errata work arounds Suzuki K Poulose
2018-02-09 12:16                   ` Suzuki K Poulose
2018-02-09 12:16                 ` [PATCH 2/4] arm64: capabilities: Split the processing of " Suzuki K Poulose
2018-02-09 12:16                   ` Suzuki K Poulose
2018-02-09 12:16                 ` [PATCH 3/4] arm64: capabilities: Allow features based on local CPU scope Suzuki K Poulose
2018-02-09 12:16                   ` Suzuki K Poulose
2018-02-09 12:16                 ` [PATCH 4/4] arm64: capabilities: Group handling of features and errata workarounds Suzuki K Poulose
2018-02-09 12:16                   ` Suzuki K Poulose
2018-02-09 12:19                   ` Suzuki K Poulose
2018-02-09 12:19                     ` Suzuki K Poulose
2018-02-09 14:21                 ` [PATCH 1/2] arm64: capabilities: Allow flexibility in scope Dave Martin
2018-02-09 14:21                   ` Dave Martin
2018-01-31 18:27 ` [PATCH v2 09/20] arm64: capabilities: Introduce weak features based on local CPU Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:38   ` Dave Martin
2018-02-07 10:38     ` Dave Martin
2018-01-31 18:27 ` [PATCH v2 10/20] arm64: capabilities: Restrict KPTI detection to boot-time CPUs Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:38   ` Dave Martin
2018-02-07 10:38     ` Dave Martin
2018-02-07 18:15     ` Suzuki K Poulose
2018-02-07 18:15       ` Suzuki K Poulose
2018-02-08 11:05       ` Dave Martin
2018-02-08 11:05         ` Dave Martin
2018-01-31 18:27 ` [PATCH v2 11/20] arm64: capabilities: Add support for features enabled early Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:38   ` Dave Martin
2018-02-07 10:38     ` Dave Martin
2018-02-07 18:34     ` Suzuki K Poulose
2018-02-07 18:34       ` Suzuki K Poulose
2018-02-08 11:35       ` Dave Martin
2018-02-08 11:35         ` Dave Martin
2018-02-08 11:43         ` Suzuki K Poulose
2018-02-08 11:43           ` Suzuki K Poulose
2018-01-31 18:27 ` [PATCH v2 12/20] arm64: capabilities: Change scope of VHE to Boot CPU feature Suzuki K Poulose
2018-01-31 18:27   ` Suzuki K Poulose
2018-02-07 10:39   ` Dave Martin
2018-02-07 10:39     ` Dave Martin
2018-01-31 18:28 ` [PATCH v2 13/20] arm64: capabilities: Clean up midr range helpers Suzuki K Poulose
2018-01-31 18:28   ` Suzuki K Poulose
2018-02-07 10:39   ` Dave Martin
2018-02-07 10:39     ` Dave Martin
2018-01-31 18:28 ` [PATCH v2 14/20] arm64: Add helpers for checking CPU MIDR against a range Suzuki K Poulose
2018-01-31 18:28   ` Suzuki K Poulose
2018-02-07 10:39   ` Dave Martin
2018-02-07 10:39     ` Dave Martin
2018-01-31 18:28 ` [PATCH v2 15/20] arm64: capabilities: Add support for checks based on a list of MIDRs Suzuki K Poulose
2018-01-31 18:28   ` Suzuki K Poulose
2018-02-07 10:39   ` Dave Martin
2018-02-07 10:39     ` Dave Martin
2018-01-31 18:28 ` [PATCH v2 16/20] arm64: Handle shared capability entries Suzuki K Poulose
2018-01-31 18:28   ` Suzuki K Poulose
2018-02-07 10:39   ` Dave Martin
2018-02-07 10:39     ` Dave Martin
2018-02-08 10:53     ` Suzuki K Poulose
2018-02-08 10:53       ` Suzuki K Poulose
2018-02-08 12:01       ` Dave Martin
2018-02-08 12:01         ` Dave Martin
2018-02-08 12:32         ` Robin Murphy
2018-02-08 12:32           ` Robin Murphy
2018-02-09 10:05           ` Dave Martin
2018-02-09 10:05             ` Dave Martin
2018-02-08 12:04   ` Dave Martin
2018-02-08 12:04     ` Dave Martin
2018-02-08 12:05     ` Suzuki K Poulose
2018-02-08 12:05       ` Suzuki K Poulose
2018-01-31 18:28 ` [PATCH v2 17/20] arm64: bp hardening: Allow late CPUs to enable work around Suzuki K Poulose
2018-01-31 18:28   ` Suzuki K Poulose
2018-02-07 10:39   ` Dave Martin
2018-02-07 10:39     ` Dave Martin
2018-02-08 12:19     ` Suzuki K Poulose
2018-02-08 12:19       ` Suzuki K Poulose
2018-02-08 12:26       ` Marc Zyngier
2018-02-08 12:26         ` Marc Zyngier
2018-02-08 16:58         ` Suzuki K Poulose
2018-02-08 16:58           ` Suzuki K Poulose
2018-02-08 17:59           ` Suzuki K Poulose
2018-02-08 17:59             ` Suzuki K Poulose
2018-02-08 17:59             ` Suzuki K Poulose
2018-02-08 17:59               ` Suzuki K Poulose
2018-01-31 18:28 ` [PATCH v2 18/20] arm64: Add MIDR encoding for Arm Cortex-A55 and Cortex-A35 Suzuki K Poulose
2018-01-31 18:28   ` Suzuki K Poulose
2018-02-07 10:39   ` Dave Martin
2018-02-07 10:39     ` Dave Martin
2018-01-31 18:28 ` [PATCH v2 19/20] arm64: Delay enabling hardware DBM feature Suzuki K Poulose
2018-01-31 18:28   ` Suzuki K Poulose
2018-02-07 10:40   ` Dave Martin
2018-02-07 10:40     ` Dave Martin
2018-01-31 18:28 ` [PATCH v2 20/20] arm64: Add work around for Arm Cortex-A55 Erratum 1024718 Suzuki K Poulose
2018-01-31 18:28   ` Suzuki K Poulose
2018-02-07 10:40   ` Dave Martin
2018-02-07 10:40     ` Dave Martin

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.