The e500mc and e5500 implement only PID0, but inherit the default of
three PID registers. This incorrectly exposes PID1 and PID2 through
register_BookE206_sprs().

Set nb_pids to one in their shared initialization, matching
MMUCFG[NPIDS] and the e500mc Core Reference Manual, revision 3, section
2.16.4, and e5500RM revision 4, section 2.16.4.

Signed-off-by: Bin Meng <[email protected]>

---

Changes in v3:
- New

 target/ppc/cpu_init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 72a46d72fd..8cbdd36df4 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -2868,6 +2868,7 @@ static void init_proc_e500(CPUPPCState *env, int version)
         mmucfg = MMUCFG_MAVN_V1 | MMUCFG_NTLBS(2) |
                  MMUCFG_NPIDS(1) | MMUCFG_PIDSIZE(8) |
                  MMUCFG_RASIZE(36) | MMUCFG_LPIDSIZE(6);
+        env->nb_pids = 1;
         tlbncfg[0] = register_tlbncfg(4, 1, 1, 0, 512);
         tlbncfg[1] = register_tlbncfg(64, 1, 12, TLBnCFG_AVAIL | 
TLBnCFG_IPROT, 64);
         break;
-- 
2.53.0


Reply via email to