init_proc_745(), which the 755 shares, calls register_7xx_sprs() and
then register_745_sprs().  Since HID0 and HID1 moved into
register_7xx_sprs(), both functions register them the same way, and
_spr_register() asserts that no SPR is registered twice, so the 745 and
the 755 cannot be created at all:

  $ qemu-system-ppc -M none -cpu 745
  Assertion failed: (spr->name == NULL), function _spr_register,
  file helper_regs.c, line 419.

Leave the two to register_7xx_sprs().

Fixes: 0301b39c78c8 ("target/ppc: cpu_init: Deduplicate 7xx SPR registration")
Cc: [email protected]
Reviewed-by: Fabiano Rosas <[email protected]>
Signed-off-by: Showta Ishizaki <[email protected]>
---
v2: Drop the comment saying where HID0 and HID1 are registered; keep
    the existing "Hardware implementation registers" line (BALATON Zoltan)

 target/ppc/cpu_init.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 7f3036d903e..b12ac630a6c 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -87,16 +87,6 @@ static void register_745_sprs(CPUPPCState *env)
                  0x00000000);
 
     /* Hardware implementation registers */
-    spr_register(env, SPR_HID0, "HID0",
-                 SPR_NOACCESS, SPR_NOACCESS,
-                 &spr_read_generic, &spr_write_generic,
-                 0x00000000);
-
-    spr_register(env, SPR_HID1, "HID1",
-                 SPR_NOACCESS, SPR_NOACCESS,
-                 &spr_read_generic, &spr_write_generic,
-                 0x00000000);
-
     spr_register(env, SPR_HID2, "HID2",
                  SPR_NOACCESS, SPR_NOACCESS,
                  &spr_read_generic, &spr_write_generic,

base-commit: 9703b6cf418d2ce72fae8d00e511135ce0bfda43

Reply via email to