[PATCH v1] arm64/boot: Disable trapping of PMZR_EL0 writes to EL2
Fuad Tabba
fuad.tabba at linux.dev
Tue Sep 22 14:09:37 PDT 2026
Hi Oliver,
On Tue, 22 Sep 2026 20:47:58 +0100, Oliver Upton <oupton at kernel.org> wrote:
[...]
> We can trim 3 instructions from this by using the read-trap bits as the
> starting point for the write-trap bits, like below. It also makes clear
> the point that most of our trap bits are symmetrical for read and write.
I did consider that, and went the other way for two reasons.
The read side has three bits with no write-side counterpart
(nPMSSDATA, nSPMDEVAFF_EL1, nSPMID), so copying x0 into x2 writes ones
into three RES0 bits of HDFGWTR2_EL2. Harmless today, but it's this
bug in reverse: the first revision that defines one of those positions
in the write register turns the copy into a silent behaviour change.
Building each mask from its own register's names can't do that.
It also matches __init_el2_fgt, which already keeps x0 and x2 apart
for HDFGRTR_EL2 and HDFGWTR_EL2. And even in that form the copy would
have to sit just before the msr_s, after the SPE block, or
nPMSDSFR_EL1 only lands in x0.
Cheers,
/fuad
More information about the linux-arm-kernel
mailing list