[PATCH 0/5] arm64: Get rid of CnP

Marc Zyngier maz at kernel.org
Thu Jun 1 07:24:24 PDT 2023


FEAT_TTCNP (née ARMv8.2-TTCNP, "Translation table Common not private
translations", commonly known as CnP) was an attempt at allowing the
sharing of TLBs in a SMT implementation. This was an interesting idea,
but it never really went anywhere:

- There is only one implementation from ARM (Cortex-A65) that could
  (conditional) be capable of using it, but this thing has never been
  seen in the wild (shout if you have one!)

- There is one implementation from NVIDIA (Carmel) that has a
  messed-up TLB invalidation "feature" that prevents the use of CnP

- The only other SMT implementation (Cavium-TX2) predates CnP, so it
  doesn't implement it

- All the modern CPUs (which are not SMT) advertise CnP (it is
  mandatory from ARMv8.2), but of course don't implement anything

- And then we all discovered what Side Channel attacks were...

CnP also makes reasoning about TLBs harder, as it blurs the idea that
a CPU only has private TLBs. Now another CPU (thread) can hit in your
TLBs in weird ways, and sequencing the enabling of CnP requires some
fragile coordination.

So farewell, CnP. It is very unlikely we'll miss you.

This series removes most traces of CnP, only keeping some basic
definitions for documentation purpose. It doesn't amount to much code,
but it feels like we're better off without it.

Marc Zyngier (5):
  arm64: Remove CnP detection
  arm64: Drop NVIDIA Carmel CnP workaround
  arm64: Drop support for CnP
  KVM: arm64: Remove CnP usage
  arm64: Remove CONFIG_ARM64_CNP

 Documentation/arm64/silicon-errata.rst |  2 --
 arch/arm64/Kconfig                     | 24 ------------------
 arch/arm64/include/asm/cpufeature.h    |  6 -----
 arch/arm64/include/asm/kvm_mmu.h       |  3 +--
 arch/arm64/include/asm/mmu_context.h   | 14 +----------
 arch/arm64/kernel/cpu_errata.c         |  8 ------
 arch/arm64/kernel/cpufeature.c         | 34 --------------------------
 arch/arm64/kernel/mte.c                | 12 ---------
 arch/arm64/kernel/suspend.c            |  4 ---
 arch/arm64/kvm/hyp/nvhe/hyp-init.S     |  6 -----
 arch/arm64/mm/context.c                |  7 ------
 arch/arm64/tools/cpucaps               |  2 --
 12 files changed, 2 insertions(+), 120 deletions(-)

-- 
2.39.2




More information about the linux-arm-kernel mailing list