[PATCH 2/7] parisc: perf: add an RDR table for PCX-W2 (PA-8700)

From: Matt Turner

Date: Fri Nov 27 2026 - 00:03:10 EST


PCX-W2 uses the PCX-W RDR table, but several of its RDRs have different
widths. The C3650/C3700/C3750/J6700/J6750 PDC firmware (from HP-UX
11.11 patch PHSS_29342) describes RDR11, RDR27 and RDR30 as 32 bits,
RDR12 and RDR13 as 704 bits, and RDR22 and RDR23 as 210 bits.

The RDR22 and RDR23 widths matter: perf_write_image() writes both, and
perf_rdr_read_ubuf() realigns what it shifts out by the RDR width, so
with 194 bits the data comes back misaligned. perf_bitmasks_piranha
already describes RDR22 and RDR23 as 210 bits.

Add perf_rdr_tbl_piranha with the firmware's widths and use it on
PCX-W2.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Matt Turner <mattst88@xxxxxxxxx>
---
arch/parisc/kernel/perf.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)

diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index 8f9ae67270bd..2494f16bb8fd 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -139,6 +139,45 @@ static const struct rdr_tbl_ent perf_rdr_tbl_W[] = {
{ 16, 1, 0 }, /* RDR 31 */
};

+/*
+ * RDR register descriptions for PCX-W2 (PA-8700). RDR11, RDR12, RDR13,
+ * RDR22, RDR23, RDR27 and RDR30 differ from PCX-W.
+ */
+static const struct rdr_tbl_ent perf_rdr_tbl_piranha[] = {
+ { 19, 1, 8 }, /* RDR 0 */
+ { 32, 1, 16 }, /* RDR 1 */
+ { 20, 1, 0 }, /* RDR 2 */
+ { 0, 0, 0 }, /* RDR 3 */
+ { 344, 6, 0 }, /* RDR 4 */
+ { 176, 3, 0 }, /* RDR 5 */
+ { 336, 6, 0 }, /* RDR 6 */
+ { 0, 0, 0 }, /* RDR 7 */
+ { 0, 0, 0 }, /* RDR 8 */
+ { 0, 0, 0 }, /* RDR 9 */
+ { 28, 1, 0 }, /* RDR 10 */
+ { 32, 1, 0 }, /* RDR 11 */
+ { 704, 11, 0 }, /* RDR 12 */
+ { 704, 11, 0 }, /* RDR 13 */
+ { 32, 1, 0 }, /* RDR 14 */
+ { 128, 2, 0 }, /* RDR 15 */
+ { 1494, 24, 0 }, /* RDR 16 */
+ { 18, 1, 0 }, /* RDR 17 */
+ { 4, 1, 0 }, /* RDR 18 */
+ { 0, 0, 0 }, /* RDR 19 */
+ { 158, 3, 24 }, /* RDR 20 */
+ { 158, 3, 24 }, /* RDR 21 */
+ { 210, 4, 48 }, /* RDR 22 */
+ { 210, 4, 48 }, /* RDR 23 */
+ { 71, 2, 0 }, /* RDR 24 */
+ { 71, 2, 0 }, /* RDR 25 */
+ { 28, 1, 0 }, /* RDR 26 */
+ { 32, 1, 0 }, /* RDR 27 */
+ { 88, 2, 0 }, /* RDR 28 */
+ { 32, 1, 0 }, /* RDR 29 */
+ { 32, 1, 0 }, /* RDR 30 */
+ { 16, 1, 0 }, /* RDR 31 */
+};
+
/*
* A non-zero write_control in the above tables is a byte offset into
* this array.
@@ -174,6 +213,7 @@ static const uint64_t perf_bitmasks_piranha[] = {
};

static const uint64_t *bitmask_array; /* array of bitmasks to use */
+static const struct rdr_tbl_ent *perf_rdr_tbl_cuda __ro_after_init;

/******************************************************************************
* Function Prototypes
@@ -499,6 +539,9 @@ static int __init perf_init(void)
boot_cpu_data.cpu_type == mako ||
boot_cpu_data.cpu_type == mako2) {
perf_processor_interface = CUDA_INTF;
+ perf_rdr_tbl_cuda = perf_rdr_tbl_W;
+ if (boot_cpu_data.cpu_type == pcxw2)
+ perf_rdr_tbl_cuda = perf_rdr_tbl_piranha;
if (boot_cpu_data.cpu_type == pcxw2 ||
boot_cpu_data.cpu_type == mako ||
boot_cpu_data.cpu_type == mako2)
@@ -643,7 +686,7 @@ static const struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num)
if (perf_processor_interface == ONYX_INTF) {
return &perf_rdr_tbl_U[rdr_num];
} else {
- return &perf_rdr_tbl_W[rdr_num];
+ return &perf_rdr_tbl_cuda[rdr_num];
}
}


--
2.56.1