twx-linux/Documentation
Anshuman Khandual ae344bcb0d arm64: Handle BRBE booting requirements
To use the Branch Record Buffer Extension (BRBE), some configuration is
necessary at EL3 and EL2. This patch documents the requirements and adds
the initial EL2 setup code, which largely consists of configuring the
fine-grained traps and initializing a couple of BRBE control registers.

Before this patch, __init_el2_fgt() would initialize HDFGRTR_EL2 and
HDFGWTR_EL2 with the same value, relying on the read/write trap controls
for a register occupying the same bit position in either register. The
'nBRBIDR' trap control only exists in bit 59 of HDFGRTR_EL2, while bit
59 of HDFGWTR_EL2 is RES0, and so this assumption no longer holds.

To handle HDFGRTR_EL2 and HDFGWTR_EL2 having (slightly) different bit
layouts, __init_el2_fgt() is changed to accumulate the HDFGRTR_EL2 and
HDFGWTR_EL2 control bits separately. While making this change the
open-coded value (1 << 62) is replaced with
HDFG{R,W}TR_EL2_nPMSNEVFR_EL1_MASK.

The BRBCR_EL1 and BRBCR_EL2 registers are unusual and require special
initialisation: even though they are subject to E2H renaming, both have
an effect regardless of HCR_EL2.TGE, even when running at EL2. So we
must initialize BRBCR_EL2 in case we run in nVHE mode. This is handled
in __init_el2_brbe() with a comment to explain the situation.

Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>
Reviewed-by: Leo Yan <leo.yan@arm.com>
Tested-by: James Clark <james.clark@linaro.org>
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
[Mark: rewrite commit message, fix typo in comment]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Co-developed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
tested-by: Adam Young <admiyo@os.amperecomputing.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20250611-arm-brbe-v19-v23-2-e7775563036e@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2025-07-08 16:11:27 +01:00
..
ABI Char/Misc/IIO pull request for 6.16-rc1 2025-06-06 11:50:47 -07:00
accel
accounting
admin-guide USB/Thunderbolt changes for 6.16-rc1 2025-06-06 12:45:35 -07:00
arch arm64: Handle BRBE booting requirements 2025-07-08 16:11:27 +01:00
block Documentation: ublk: document UBLK_F_PER_IO_DAEMON 2025-05-31 14:38:57 -06:00
bpf
cdrom
core-api Kbuild updates for v6.16 2025-06-07 10:05:35 -07:00
cpu-freq
crypto
dev-tools
devicetree RISC-V Patches for the 6.16 Merge Window, Part 1 2025-06-06 18:05:18 -07:00
doc-guide
driver-api Char/Misc/IIO pull request for 6.16-rc1 2025-06-06 11:50:47 -07:00
edac cxl/edac: Add CXL memory device soft PPR control feature 2025-05-23 13:25:06 -07:00
fault-injection
fb fbdev: sstfb.rst: Fix spelling mistake 2025-05-31 10:24:02 +02:00
features LoongArch: Enable ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS 2025-05-30 21:45:42 +08:00
filesystems fourteen smb3 client fixes, most smbdirect related 2025-06-08 10:20:21 -07:00
firmware_class
firmware-guide
fpga
gpu drm fixes for 6.16-rc1 2025-06-06 08:09:56 -07:00
hid
hwmon hwmon updates for v6.16 2025-06-03 09:11:26 -07:00
i2c
iio
images
infiniband
input Input: amijoy - make headings compliant w/ guidelines in documentation 2025-05-30 15:34:38 -07:00
isdn
kbuild Kbuild updates for v6.16 2025-06-07 10:05:35 -07:00
kernel-hacking
leds LEDs for v6.16 2025-06-03 12:10:31 -07:00
litmus-tests
livepatch
locking
maintainer
mhi
misc-devices
mm Docs/damon: update titles and brief introductions to explain DAMOS 2025-05-22 14:55:38 -07:00
netlabel
netlink netlink: specs: rt-link: decode ip6gre 2025-06-05 12:50:10 +02:00
networking - The 11 patch series "Add folio_mk_pte()" from Matthew Wilcox 2025-05-31 15:44:16 -07:00
nvdimm
nvme
PCI Merge branch 'pci/misc' 2025-06-04 10:50:45 -05:00
pcmcia
peci
power
process - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
RCU
rust Documentation: rust: testing: add docs on the new KUnit #[test] tests 2025-05-27 20:09:59 +02:00
scheduler sched_ext: Changes for v6.16 2025-05-27 21:12:50 -07:00
scsi
security
sound
sphinx
sphinx-static
spi
staging rpmsg updates for v6.16 2025-06-02 11:06:44 -07:00
sunrpc/xdr
target
tee
timers
tools
trace Char/Misc/IIO pull request for 6.16-rc1 2025-06-06 11:50:47 -07:00
translations Kbuild updates for v6.16 2025-06-07 10:05:35 -07:00
usb
userspace-api LoongArch changes for v6.16 2025-06-07 09:56:18 -07:00
virt Notable changes: 2025-06-05 11:45:33 -07:00
w1
watchdog
wmi
.gitignore
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py
docutils.conf
index.rst
Kconfig
Makefile
memory-barriers.txt
SubmittingPatches
subsystem-apis.rst