[PATCH v2] target/ppc: Register the 745's HID0 and HID1 once

Showta Ishizaki posted 1 patch 3 weeks, 2 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/179336730662.79983.8981663569075755166.745-hid-v2@snowrabbit.org
Maintainers: Chinmay Rath <rathc@linux.ibm.com>, Nicholas Piggin <npiggin@gmail.com>, Glenn Miles <milesg@linux.ibm.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>
target/ppc/cpu_init.c | 10 ----------
1 file changed, 10 deletions(-)
[PATCH v2] target/ppc: Register the 745's HID0 and HID1 once
Posted by Showta Ishizaki 3 weeks, 2 days ago
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: qemu-stable@nongnu.org
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Showta Ishizaki <zakinko@snowrabbit.org>
---
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