Re: [PATCH 1/5] alpha/perf: pass PERFMON_CMD_LOGGING_ALL to the logging options call

From: Matt Turner

Date: Thu Oct 29 2026 - 23:58:35 EST


On Thu, Oct 29, 2026 at 1:38 PM Magnus Lindholm <linmag7@xxxxxxxxx> wrote:
> The Alpha Architecture Reference Manual, Table E-18 (page E-24),
> describes bit 0 as:
>
> "set = log all processes"
> "clear = log only selected processes"
>
> That appears opposite to the changelog's description of zero as
> "count all processes". Is the manual incorrect for the PALcode
> implementation we use?

Yes, the manual has it backwards. I disassembled the wrperfmon handler
in the UNIX PALcode from the ES47 firmware (V7.3) and from the latest
ES40 firmware, and the code is the same in both. Function 3 clears
I_CTL[SPCE] and sets it again unless bit 0 of a1 is set:

hw_mfpr t3, I_CTL
mov 1, t4 # SPCE is I_CTL bit 0
andnot t3, t4, t3
cmovlbs a1, zero, t4
or t3, t4, t3
hw_mtpr t3, I_CTL

The 21264 HRM calls SPCE "System Performance Counting Enable", so 0
counts all processes. The per-process enable is PCTX[PPCE], which
PALcode loads from the PME bit in the PCB. Linux never sets that bit,
so if 0 meant "selected processes only" we would never have counted
anything.

I'll add a paragraph about this to the commit message in v2.