Commit 0a11e8455f ("core: Implement hashst and hashchk
instructions", 2025-01-23) expanded the SPR selector used in
loadstore1 from 3 to 4 bits because the addition of the hash key SPR
took the number of SPRs to be addressed from 8 to 9. In the process,
PTCR and PIDR moved from 0/1 to 8/9, but the assignment of sprsel from
dbg_spr_addr in the loadstore1_2 process wasn't updated to reflect
this. As it happened, the hash key SPRs were subsequently moved into
the SPR RAM, reducing the number of SPRs in loadstore1 back to 8.
Also, the SPR select bit sent to the MMU never depended on dbg_spr_addr,
meaning that reading PTCR and PIDR via the debug interface would have
randomly supplied one or the other.
To fix this, revert the part of commit 0a11e8455f which expanded
the sprsel fields and variables, reducing them back to 3 bits and
restoring PTCR/PIDR to the 0/1 encodings. Also make the SPR read
address sent to the MMU come from dbg_spr_addr when we are not
executing an mfspr in loadstore1. With this, PTCR and PIDR can be
read correctly via the debug interface.
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>