linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] arm64: pseudo-nmi: elide code when CONFIG_ARM64_PSEUDO_NMI=n
@ 2023-01-23 12:40 Mark Rutland
  2023-01-23 12:40 ` [PATCH 1/4] arm64: rename ARM64_HAS_SYSREG_GIC_CPUIF to ARM64_HAS_GIC_SYSREG_CPUIF Mark Rutland
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Mark Rutland @ 2023-01-23 12:40 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: broonie, catalin.marinas, mark.rutland, maz, will

This series addresses a couple of sub-optimal code generation issues with
arm64's pseudo-nmi support code:

* Even when CONFIG_ARM64_PSEUDO_NMI=n, we generate alternative code
  sequences and alt_instr entries which will never be used. This series
  reworks the irqflags code to use alternative branches (with an
  IS_ENABLED() check), which allows the alternatives to be elided when
  CONFIG_ARM64_PSEUDO_NMI=n.

* When PMHE is eanbled in HW, we must synchronize PMR updates using a
  DSB SY. We take pains to avoid this using a static key to skip the
  barrier when PMHE is not in use, but this results in unnecessarily
  branchy code. This series replaces the static key with an alternative,
  allowing the DSB SY to be relaxed to a NOP.

These changes make a defconfig kernel a little smaller, and does not
adversely affect the size of a CONFIG_ARM64_PSEUDO_NMI=y kernel. The
structural changes will also make it easier for a subsequent series to
rework the irqflag and daifflag management, addressing some
long-standing edge cases and preparing for ARMv8.8-A's FEAT_NMI.

I've tested this series under a QEM KVM VM on a ThunderX2 host, and a
QEMU TCG VM on an x86_64 host. I've tested with and without pseudo-NMI
support enabled, and with pseudo-NMI debug and lockdep enabled, using
perf record in system-wide mode.

Thanks,
Mark.

Mark Rutland (4):
  arm64: rename ARM64_HAS_SYSREG_GIC_CPUIF to ARM64_HAS_GIC_SYSREG_CPUIF
  arm64: rename ARM64_HAS_IRQ_PRIO_MASKING to ARM64_HAS_GIC_PRIO_MASKING
  arm64: add ARM64_HAS_GIC_PRIO_NO_PMHE cpucap
  arm64: irqflags: use alternative branches for pseudo-NMI logic

 arch/arm/include/asm/arch_gicv3.h   |   5 +
 arch/arm64/include/asm/arch_gicv3.h |   5 +
 arch/arm64/include/asm/barrier.h    |  11 +-
 arch/arm64/include/asm/cpufeature.h |   2 +-
 arch/arm64/include/asm/irqflags.h   | 183 +++++++++++++++++++---------
 arch/arm64/include/asm/ptrace.h     |   2 +-
 arch/arm64/kernel/cpufeature.c      |  26 +++-
 arch/arm64/kernel/entry.S           |  25 ++--
 arch/arm64/kernel/image-vars.h      |   2 -
 arch/arm64/tools/cpucaps            |   5 +-
 drivers/irqchip/irq-gic-v3.c        |  19 +--
 drivers/irqchip/irq-gic.c           |   2 +-
 12 files changed, 188 insertions(+), 99 deletions(-)

-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-01-24 12:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-23 12:40 [PATCH 0/4] arm64: pseudo-nmi: elide code when CONFIG_ARM64_PSEUDO_NMI=n Mark Rutland
2023-01-23 12:40 ` [PATCH 1/4] arm64: rename ARM64_HAS_SYSREG_GIC_CPUIF to ARM64_HAS_GIC_SYSREG_CPUIF Mark Rutland
2023-01-23 12:40 ` [PATCH 2/4] arm64: rename ARM64_HAS_IRQ_PRIO_MASKING to ARM64_HAS_GIC_PRIO_MASKING Mark Rutland
2023-01-23 12:40 ` [PATCH 3/4] arm64: add ARM64_HAS_GIC_PRIO_NO_PMHE cpucap Mark Rutland
2023-01-23 13:23   ` Marc Zyngier
2023-01-23 14:30     ` Mark Rutland
2023-01-24  9:31       ` Marc Zyngier
2023-01-24 12:44         ` Mark Rutland
2023-01-23 12:40 ` [PATCH 4/4] arm64: irqflags: use alternative branches for pseudo-NMI logic Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).