Skip to contentSkip to conversation

target/mips: Remove I6500 CPU definition

RFC PATCH In review Philippe Mathieu-Daudé 3 participants 15 messages Feb 9, 2024 – Feb 13, 2024

lore
Share & tools
lore
#0 lore raw

cover target/mips: Remove I6500 CPU definition

Alternative to:
https://lore.kernel.org/qemu-devel/[email protected]/
If the I6500 can not be tested or its support is incomplete, there is no point in wasting energy maintaining it.

Philippe Mathieu-Daudé (11):
target/mips: Remove helpers accessing SAAR registers hw/misc/mips: Reduce itc_reconfigure() scope target/mips: Remove MIPSITUState::itu field target/mips: Remove CPUMIPSState::saarp field hw/misc/mips_itu: Remove MIPSITUState::cpu0 field hw/misc/mips_itu: Remove MIPSITUState::saar field target/mips: Remove CPUMIPSState::CP0_SAAR[2] field target/mips: Remove helpers accessing SAARI register target/mips: Remove CPUMIPSState::CP0_SAARI field target/mips: Remove the unused DisasContext::saar field target/mips: Remove I6500 CPU definition

 docs/about/removed-features.rst     |  5 +++
 include/hw/misc/mips_itu.h          |  6 ---
 target/mips/cpu.h                   |  4 --
 target/mips/tcg/translate.h         |  1 -
 target/mips/tcg/sysemu_helper.h.inc |  6 ---
 hw/mips/cps.c                       |  3 --
 hw/misc/mips_itu.c                  | 35 ++--------------
 target/mips/sysemu/machine.c        |  4 +-
 target/mips/tcg/sysemu/cp0_helper.c | 63 -----------------------------
 target/mips/tcg/translate.c         | 62 ----------------------------
 tests/qtest/machine-none-test.c     |  2 +-
 target/mips/cpu-defs.c.inc          | 40 ------------------
 12 files changed, 12 insertions(+), 219 deletions(-)
Signature · 1 line
2.41.0
#1 lore raw

RFC PATCH 1/11 target/mips: Remove helpers accessing SAAR registers

DisasContext::saar boolean is never set, so this code is not reachable. Remove it.

---
 target/mips/tcg/sysemu_helper.h.inc |  5 ---
 target/mips/tcg/sysemu/cp0_helper.c | 55 -----------------------------
 target/mips/tcg/translate.c         | 42 ----------------------
 3 files changed, 102 deletions(-)
target/mips/tcg/sysemu_helper.h.inc +0 -5
index f163af1eac..78f7272208 100644
@@ -31,8 +31,6 @@ DEF_HELPER_1(mftc0_tcschedule, tl, env)
 DEF_HELPER_1(mfc0_tcschefback, tl, env)
 DEF_HELPER_1(mftc0_tcschefback, tl, env)
 DEF_HELPER_1(mfc0_count, tl, env)
-DEF_HELPER_1(mfc0_saar, tl, env)
-DEF_HELPER_1(mfhc0_saar, tl, env)
 DEF_HELPER_1(mftc0_entryhi, tl, env)
 DEF_HELPER_1(mftc0_status, tl, env)
 DEF_HELPER_1(mftc0_cause, tl, env)
@@ -57,7 +55,6 @@ DEF_HELPER_1(dmfc0_lladdr, tl, env)
 DEF_HELPER_1(dmfc0_maar, tl, env)
 DEF_HELPER_2(dmfc0_watchlo, tl, env, i32)
 DEF_HELPER_2(dmfc0_watchhi, tl, env, i32)
-DEF_HELPER_1(dmfc0_saar, tl, env)
 #endif /* TARGET_MIPS64 */
 
 DEF_HELPER_2(mtc0_index, void, env, tl)
@@ -104,8 +101,6 @@ DEF_HELPER_2(mtc0_hwrena, void, env, tl)
 DEF_HELPER_2(mtc0_pwctl, void, env, tl)
 DEF_HELPER_2(mtc0_count, void, env, tl)
 DEF_HELPER_2(mtc0_saari, void, env, tl)
-DEF_HELPER_2(mtc0_saar, void, env, tl)
-DEF_HELPER_2(mthc0_saar, void, env, tl)
 DEF_HELPER_2(mtc0_entryhi, void, env, tl)
 DEF_HELPER_2(mttc0_entryhi, void, env, tl)
 DEF_HELPER_2(mtc0_compare, void, env, tl)
target/mips/tcg/sysemu/cp0_helper.c +0 -55

73 lines not on this page · raw message

target/mips/tcg/translate.c +0 -42

78 lines not on this page · raw message

Signature · 1 line
2.41.0
#2 lore raw

RFC PATCH 2/11 hw/misc/mips: Reduce itc_reconfigure() scope

In reply to Philippe Mathieu-Daudé

Previous commit removed the MT*C0(SAAR) helpers which were the only calls to itc_reconfigure() out of hw/, we can reduce its scope and declare it statically.

---
 include/hw/misc/mips_itu.h | 2 --
 hw/misc/mips_itu.c         | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
include/hw/misc/mips_itu.h +0 -2
index 5caed6cc36..3a7330ac07 100644
@@ -79,6 +79,4 @@ struct MIPSITUState {
 /* Get ITC Configuration Tag memory region. */
 MemoryRegion *mips_itu_get_tag_region(MIPSITUState *itu);
 
-void itc_reconfigure(struct MIPSITUState *tag);
-
 #endif /* MIPS_ITU_H */
hw/misc/mips_itu.c +1 -1
index 37aea0e737..db1220f8e0 100644
@@ -86,7 +86,7 @@ static uint64_t itc_tag_read(void *opaque, hwaddr addr, unsigned size)
     return tag->ITCAddressMap[index];
 }
 
-void itc_reconfigure(MIPSITUState *tag)
+static void itc_reconfigure(MIPSITUState *tag)
 {
     uint64_t *am = &tag->ITCAddressMap[0];
     MemoryRegion *mr = &tag->storage_io;
Signature · 1 line
2.41.0
#3 lore raw

RFC PATCH 3/11 target/mips: Remove MIPSITUState::itu field

In reply to Philippe Mathieu-Daudé

Previous commits removed the MT*C0(SAAR) helpers which were using CPUMIPSState::itu, we can now remove it too.

---
 target/mips/cpu.h | 1 -
 hw/mips/cps.c     | 1 -
 2 files changed, 2 deletions(-)
target/mips/cpu.h +0 -1
index ef26fe03c7..6ec2ff4b97 100644
@@ -1184,7 +1184,6 @@ typedef struct CPUArchState {
 #if !defined(CONFIG_USER_ONLY)
     CPUMIPSTLBContext *tlb;
     void *irq[8];
-    struct MIPSITUState *itu;
     MemoryRegion *itc_tag; /* ITC Configuration Tags */
 
     /* Loongson IOCSR memory */
hw/mips/cps.c +0 -1
index 4f12e23ab5..988ceaa0b9 100644
@@ -96,7 +96,6 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
             itu_present = true;
             /* Attach ITC Tag to the VP */
             env->itc_tag = mips_itu_get_tag_region(&s->itu);
-            env->itu = &s->itu;
         }
         qemu_register_reset(main_cpu_reset, cpu);
     }
Signature · 1 line
2.41.0
#4 lore raw

RFC PATCH 4/11 target/mips: Remove CPUMIPSState::saarp field

In reply to Philippe Mathieu-Daudé

This field is never set, so remove the unreachable code.

---
 target/mips/cpu.h  | 1 -
 hw/misc/mips_itu.c | 6 ------
 2 files changed, 7 deletions(-)
target/mips/cpu.h +0 -1
index 6ec2ff4b97..3b93591f7e 100644
@@ -1174,7 +1174,6 @@ typedef struct CPUArchState {
     uint32_t CP0_Status_rw_bitmask; /* Read/write bits in CP0_Status */
     uint32_t CP0_TCStatus_rw_bitmask; /* Read/write bits in CP0_TCStatus */
     uint64_t insn_flags; /* Supported instruction set */
-    int saarp;
 
     /* Fields up to this point are cleared by a CPU reset */
     struct {} end_reset_fields;
hw/misc/mips_itu.c +0 -6
index db1220f8e0..d259a88d22 100644
@@ -516,7 +516,6 @@ static void mips_itu_init(Object *obj)
 static void mips_itu_realize(DeviceState *dev, Error **errp)
 {
     MIPSITUState *s = MIPS_ITU(dev);
-    CPUMIPSState *env;
 
     if (s->num_fifo > ITC_FIFO_NUM_MAX) {
         error_setg(errp, "Exceed maximum number of FIFO cells: %d",
@@ -533,11 +532,6 @@ static void mips_itu_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    env = &MIPS_CPU(s->cpu0)->env;
-    if (env->saarp) {
-        s->saar = env->CP0_SAAR;
-    }
-
     s->cell = g_new(ITCStorageCell, get_num_cells(s));
 }
 
Signature · 1 line
2.41.0
#5 lore raw

RFC PATCH 5/11 hw/misc/mips_itu: Remove MIPSITUState::cpu0 field

In reply to Philippe Mathieu-Daudé

Since previous commit the MIPSITUState::cpu0 field is not used anymore. Remove it.

---
 include/hw/misc/mips_itu.h | 1 -
 hw/mips/cps.c              | 2 --
 hw/misc/mips_itu.c         | 5 -----
 3 files changed, 8 deletions(-)
include/hw/misc/mips_itu.h +0 -1
index 3a7330ac07..de7400c1fe 100644
@@ -73,7 +73,6 @@ struct MIPSITUState {
 
     /* SAAR */
     uint64_t *saar;
-    ArchCPU *cpu0;
 };
 
 /* Get ITC Configuration Tag memory region. */
hw/mips/cps.c +0 -2
index 988ceaa0b9..07b73b0a1f 100644
@@ -103,8 +103,6 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
     /* Inter-Thread Communication Unit */
     if (itu_present) {
         object_initialize_child(OBJECT(dev), "itu", &s->itu, TYPE_MIPS_ITU);
-        object_property_set_link(OBJECT(&s->itu), "cpu[0]",
-                                 OBJECT(first_cpu), &error_abort);
         object_property_set_uint(OBJECT(&s->itu), "num-fifo", 16,
                                 &error_abort);
         object_property_set_uint(OBJECT(&s->itu), "num-semaphores", 16,
hw/misc/mips_itu.c +0 -5
index d259a88d22..9705efeafe 100644
@@ -527,10 +527,6 @@ static void mips_itu_realize(DeviceState *dev, Error **errp)
                    s->num_semaphores);
         return;
     }
-    if (!s->cpu0) {
-        error_setg(errp, "Missing 'cpu[0]' property");
-        return;
-    }
 
     s->cell = g_new(ITCStorageCell, get_num_cells(s));
 }
@@ -558,7 +554,6 @@ static Property mips_itu_properties[] = {
                       ITC_FIFO_NUM_MAX),
     DEFINE_PROP_UINT32("num-semaphores", MIPSITUState, num_semaphores,
                       ITC_SEMAPH_NUM_MAX),
-    DEFINE_PROP_LINK("cpu[0]", MIPSITUState, cpu0, TYPE_MIPS_CPU, ArchCPU *),
     DEFINE_PROP_END_OF_LIST(),
 };
 
Signature · 1 line
2.41.0
#6 lore raw

RFC PATCH 6/11 hw/misc/mips_itu: Remove MIPSITUState::saar field

In reply to Philippe Mathieu-Daudé

This field is not set. Remove it along with the dead code it was guarding.

---
 include/hw/misc/mips_itu.h |  3 ---
 hw/misc/mips_itu.c         | 22 +++-------------------
 2 files changed, 3 insertions(+), 22 deletions(-)
include/hw/misc/mips_itu.h +0 -3
index de7400c1fe..27c9a1090d 100644
@@ -70,9 +70,6 @@ struct MIPSITUState {
 
     /* ITU Control Register */
     uint64_t icr0;
-
-    /* SAAR */
-    uint64_t *saar;
 };
 
 /* Get ITC Configuration Tag memory region. */
hw/misc/mips_itu.c +3 -19
index 9705efeafe..f8acfb3ee2 100644
@@ -94,12 +94,6 @@ static void itc_reconfigure(MIPSITUState *tag)
     uint64_t size = (1 * KiB) + (am[1] & ITC_AM1_ADDR_MASK_MASK);
     bool is_enabled = (am[0] & ITC_AM0_EN_MASK) != 0;
 
-    if (tag->saar) {
-        address = (tag->saar[0] & 0xFFFFFFFFE000ULL) << 4;
-        size = 1ULL << ((tag->saar[0] >> 1) & 0x1f);
-        is_enabled = tag->saar[0] & 1;
-    }
-
     memory_region_transaction_begin();
     if (!(size & (size - 1))) {
         memory_region_set_size(mr, size);
@@ -158,12 +152,7 @@ static inline ITCView get_itc_view(hwaddr addr)
 static inline int get_cell_stride_shift(const MIPSITUState *s)
 {
     /* Minimum interval (for EntryGain = 0) is 128 B */
-    if (s->saar) {
-        return 7 + ((s->icr0 >> ITC_ICR0_BLK_GRAIN) &
-                    ITC_ICR0_BLK_GRAIN_MASK);
-    } else {
-        return 7 + (s->ITCAddressMap[1] & ITC_AM1_ENTRY_GRAIN_MASK);
-    }
+    return 7 + (s->ITCAddressMap[1] & ITC_AM1_ENTRY_GRAIN_MASK);
 }
 
 static inline ITCStorageCell *get_cell(MIPSITUState *s,
@@ -535,15 +524,10 @@ static void mips_itu_reset(DeviceState *dev)
 {
     MIPSITUState *s = MIPS_ITU(dev);
 
-    if (s->saar) {
-        s->saar[0] = 0x11 << 1;
-        s->icr0 = get_num_cells(s) << ITC_ICR0_CELL_NUM;
-    } else {
-        s->ITCAddressMap[0] = 0;
-        s->ITCAddressMap[1] =
+    s->ITCAddressMap[0] = 0;
+    s->ITCAddressMap[1] =
             ((ITC_STORAGE_ADDRSPACE_SZ - 1) & ITC_AM1_ADDR_MASK_MASK) |
             (get_num_cells(s) << ITC_AM1_NUMENTRIES_OFS);
-    }
     itc_reconfigure(s);
 
     itc_reset_cells(s);
Signature · 1 line
2.41.0
#7 lore raw

RFC PATCH 7/11 target/mips: Remove CPUMIPSState::CP0_SAAR[2] field

In reply to Philippe Mathieu-Daudé

Remove the unused CP0_SAAR[2] registers.

---
 target/mips/cpu.h            | 1 -
 target/mips/sysemu/machine.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
target/mips/cpu.h +0 -1
index 3b93591f7e..e621196ae1 100644
@@ -749,7 +749,6 @@ typedef struct CPUArchState {
     int32_t CP0_Count;
     uint32_t CP0_SAARI;
 #define CP0SAARI_TARGET 0    /*  5..0  */
-    uint64_t CP0_SAAR[2];
 #define CP0SAAR_BASE    12   /* 43..12 */
 #define CP0SAAR_SIZE    1    /*  5..1  */
 #define CP0SAAR_EN      0
target/mips/sysemu/machine.c +1 -1
index 218f4c3a67..6d1299a89e 100644
@@ -282,7 +282,7 @@ const VMStateDescription vmstate_mips_cpu = {
         VMSTATE_UINT32(env.CP0_BadInstrX, MIPSCPU),
         VMSTATE_INT32(env.CP0_Count, MIPSCPU),
         VMSTATE_UINT32(env.CP0_SAARI, MIPSCPU),
-        VMSTATE_UINT64_ARRAY(env.CP0_SAAR, MIPSCPU, 2),
+        VMSTATE_UNUSED(2 * sizeof(uint64_t)), /* was CP0_SAAR[2] */
         VMSTATE_UINTTL(env.CP0_EntryHi, MIPSCPU),
         VMSTATE_INT32(env.CP0_Compare, MIPSCPU),
         VMSTATE_INT32(env.CP0_Status, MIPSCPU),
Signature · 1 line
2.41.0
#8 lore raw

RFC PATCH 8/11 target/mips: Remove helpers accessing SAARI register

In reply to Philippe Mathieu-Daudé

DisasContext::saar boolean is never set, so this code is not reachable. Remove it.

---
 target/mips/tcg/sysemu_helper.h.inc |  1 -
 target/mips/tcg/sysemu/cp0_helper.c |  8 --------
 target/mips/tcg/translate.c         | 20 --------------------
 3 files changed, 29 deletions(-)
target/mips/tcg/sysemu_helper.h.inc +0 -1
index 78f7272208..1861d538de 100644
@@ -100,7 +100,6 @@ DEF_HELPER_2(mtc0_srsconf4, void, env, tl)
 DEF_HELPER_2(mtc0_hwrena, void, env, tl)
 DEF_HELPER_2(mtc0_pwctl, void, env, tl)
 DEF_HELPER_2(mtc0_count, void, env, tl)
-DEF_HELPER_2(mtc0_saari, void, env, tl)
 DEF_HELPER_2(mtc0_entryhi, void, env, tl)
 DEF_HELPER_2(mttc0_entryhi, void, env, tl)
 DEF_HELPER_2(mtc0_compare, void, env, tl)
target/mips/tcg/sysemu/cp0_helper.c +0 -8
index f8883a3515..ded6c78e9a 100644
@@ -1077,14 +1077,6 @@ void helper_mtc0_count(CPUMIPSState *env, target_ulong arg1)
     cpu_mips_store_count(env, arg1);
 }
 
-void helper_mtc0_saari(CPUMIPSState *env, target_ulong arg1)
-{
-    uint32_t target = arg1 & 0x3f;
-    if (target <= 1) {
-        env->CP0_SAARI = target;
-    }
-}
-
 void helper_mtc0_entryhi(CPUMIPSState *env, target_ulong arg1)
 {
     target_ulong old, val, mask;
target/mips/tcg/translate.c +0 -20
index 173b19a090..3ba2101647 100644
@@ -5653,11 +5653,6 @@ static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
             ctx->base.is_jmp = DISAS_EXIT;
             register_name = "Count";
             break;
-        case CP0_REG09__SAARI:
-            CP0_CHECK(ctx->saar);
-            gen_mfc0_load32(arg, offsetof(CPUMIPSState, CP0_SAARI));
-            register_name = "SAARI";
-            break;
         default:
             goto cp0_unimplemented;
         }
@@ -6374,11 +6369,6 @@ static void gen_mtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
             gen_helper_mtc0_count(tcg_env, arg);
             register_name = "Count";
             break;
-        case CP0_REG09__SAARI:
-            CP0_CHECK(ctx->saar);
-            gen_helper_mtc0_saari(tcg_env, arg);
-            register_name = "SAARI";
-            break;
         default:
             goto cp0_unimplemented;
         }
@@ -7143,11 +7133,6 @@ static void gen_dmfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
             ctx->base.is_jmp = DISAS_EXIT;
             register_name = "Count";
             break;
-        case CP0_REG09__SAARI:
-            CP0_CHECK(ctx->saar);
-            gen_mfc0_load32(arg, offsetof(CPUMIPSState, CP0_SAARI));
-            register_name = "SAARI";
-            break;
         default:
             goto cp0_unimplemented;
         }
@@ -7850,11 +7835,6 @@ static void gen_dmtc0(DisasContext *ctx, TCGv arg, int reg, int sel)
             gen_helper_mtc0_count(tcg_env, arg);
             register_name = "Count";
             break;
-        case CP0_REG09__SAARI:
-            CP0_CHECK(ctx->saar);
-            gen_helper_mtc0_saari(tcg_env, arg);
-            register_name = "SAARI";
-            break;
         default:
             goto cp0_unimplemented;
         }
Signature · 1 line
2.41.0
#9 lore raw

RFC PATCH 9/11 target/mips: Remove CPUMIPSState::CP0_SAARI field

In reply to Philippe Mathieu-Daudé

Remove the unused CP0_SAARI register.

---
 target/mips/cpu.h            | 1 -
 target/mips/sysemu/machine.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
target/mips/cpu.h +0 -1
index e621196ae1..c65e5fa162 100644
@@ -747,7 +747,6 @@ typedef struct CPUArchState {
  * CP0 Register 9
  */
     int32_t CP0_Count;
-    uint32_t CP0_SAARI;
 #define CP0SAARI_TARGET 0    /*  5..0  */
 #define CP0SAAR_BASE    12   /* 43..12 */
 #define CP0SAAR_SIZE    1    /*  5..1  */
target/mips/sysemu/machine.c +1 -1
index 6d1299a89e..213fd637fc 100644
@@ -281,7 +281,7 @@ const VMStateDescription vmstate_mips_cpu = {
         VMSTATE_UINT32(env.CP0_BadInstrP, MIPSCPU),
         VMSTATE_UINT32(env.CP0_BadInstrX, MIPSCPU),
         VMSTATE_INT32(env.CP0_Count, MIPSCPU),
-        VMSTATE_UINT32(env.CP0_SAARI, MIPSCPU),
+        VMSTATE_UNUSED(sizeof(uint32_t)), /* was CP0_SAARI */
         VMSTATE_UNUSED(2 * sizeof(uint64_t)), /* was CP0_SAAR[2] */
         VMSTATE_UINTTL(env.CP0_EntryHi, MIPSCPU),
         VMSTATE_INT32(env.CP0_Compare, MIPSCPU),
Signature · 1 line
2.41.0
#10 lore raw

RFC PATCH 10/11 target/mips: Remove the unused DisasContext::saar field

In reply to Philippe Mathieu-Daudé

DisasContext::saar is not used, remove it.

---
 target/mips/tcg/translate.h | 1 -
 1 file changed, 1 deletion(-)
target/mips/tcg/translate.h +0 -1
index 93a78b8121..2b6646b339 100644
@@ -49,7 +49,6 @@ typedef struct DisasContext {
     bool mrp;
     bool nan2008;
     bool abs2008;
-    bool saar;
     bool mi;
     int gi;
 } DisasContext;
Signature · 1 line
2.41.0
#11 lore raw

RFC PATCH 11/11 target/mips: Remove I6500 CPU definition

In reply to Philippe Mathieu-Daudé

I6500 support is incomplete as it lacks SAAR (Special Address Access Register) and DSPRAM (Data Scratch Pad RAM) features.

---
 docs/about/removed-features.rst |  5 +++++
 tests/qtest/machine-none-test.c |  2 +-
 target/mips/cpu-defs.c.inc      | 40 ---------------------------------
 3 files changed, 6 insertions(+), 41 deletions(-)
docs/about/removed-features.rst +5 -0
index 54081a6c19..d61b4c92dd 100644
@@ -727,6 +727,11 @@ x86 ``Icelake-Client`` CPU (removed in 7.1)
 There isn't ever Icelake Client CPU, it is some wrong and imaginary one.
 Use ``Icelake-Server`` instead.
 
+MIPS I6500 CPU (removed in 9.0)
+'''''''''''''''''''''''''''''''
+
+The I6500 support was never fully contributed.
+
 System accelerators
 -------------------
 
tests/qtest/machine-none-test.c +1 -1
index 31cc0bfb01..b653a0dd5c 100644
@@ -37,7 +37,7 @@ static struct arch2cpu cpus_map[] = {
     { "mips", "4Kc" },
     { "mipsel", "I7200" },
     { "mips64", "20Kc" },
-    { "mips64el", "I6500" },
+    { "mips64el", "I6400" },
     { "nios2", "FIXME" },
     { "or1k", "or1200" },
     { "ppc", "604" },
target/mips/cpu-defs.c.inc +0 -40
index fbf787d8ce..ce2c01cbfa 100644
@@ -778,46 +778,6 @@ const mips_def_t mips_defs[] =
         .insn_flags = CPU_MIPS64R6,
         .mmu_type = MMU_TYPE_R4000,
     },
-    {
-        .name = "I6500",
-        .CP0_PRid = 0x1B000,
-        .CP0_Config0 = MIPS_CONFIG0 | (0x2 << CP0C0_AR) | (0x2 << CP0C0_AT) |
-                       (MMU_TYPE_R4000 << CP0C0_MT),
-        .CP0_Config1 = MIPS_CONFIG1 | (1 << CP0C1_FP) | (15 << CP0C1_MMU) |
-                       (2 << CP0C1_IS) | (5 << CP0C1_IL) | (3 << CP0C1_IA) |
-                       (2 << CP0C1_DS) | (5 << CP0C1_DL) | (3 << CP0C1_DA) |
-                       (0 << CP0C1_PC) | (1 << CP0C1_WR) | (1 << CP0C1_EP),
-        .CP0_Config2 = MIPS_CONFIG2,
-        .CP0_Config3 = MIPS_CONFIG3 | (1U << CP0C3_M) |
-                       (1 << CP0C3_CMGCR) | (1 << CP0C3_MSAP) |
-                       (1 << CP0C3_BP) | (1 << CP0C3_BI) | (1 << CP0C3_ULRI) |
-                       (1 << CP0C3_RXI) | (1 << CP0C3_LPA) | (1 << CP0C3_VInt),
-        .CP0_Config4 = MIPS_CONFIG4 | (1U << CP0C4_M) | (3 << CP0C4_IE) |
-                       (1 << CP0C4_AE) | (0xfc << CP0C4_KScrExist),
-        .CP0_Config5 = MIPS_CONFIG5 | (1 << CP0C5_XNP) | (1 << CP0C5_VP) |
-                       (1 << CP0C5_LLB) | (1 << CP0C5_MRP) | (3 << CP0C5_GI),
-        .CP0_Config5_rw_bitmask = (1 << CP0C5_MSAEn) | (1 << CP0C5_SBRI) |
-                                  (1 << CP0C5_FRE) | (1 << CP0C5_UFE),
-        .CP0_LLAddr_rw_bitmask = 0,
-        .CP0_LLAddr_shift = 0,
-        .SYNCI_Step = 64,
-        .CCRes = 2,
-        .CP0_Status_rw_bitmask = 0x30D8FFFF,
-        .CP0_PageGrain = (1 << CP0PG_IEC) | (1 << CP0PG_XIE) |
-                         (1U << CP0PG_RIE),
-        .CP0_PageGrain_rw_bitmask = (1 << CP0PG_ELPA),
-        .CP0_EBaseWG_rw_bitmask = (1 << CP0EBase_WG),
-        .CP1_fcr0 = (1 << FCR0_FREP) | (1 << FCR0_HAS2008) | (1 << FCR0_F64) |
-                    (1 << FCR0_L) | (1 << FCR0_W) | (1 << FCR0_D) |
-                    (1 << FCR0_S) | (0x03 << FCR0_PRID) | (0x0 << FCR0_REV),
-        .CP1_fcr31 = (1 << FCR31_ABS2008) | (1 << FCR31_NAN2008),
-        .CP1_fcr31_rw_bitmask = 0x0103FFFF,
-        .MSAIR = 0x03 << MSAIR_ProcID,
-        .SEGBITS = 48,
-        .PABITS = 48,
-        .insn_flags = CPU_MIPS64R6,
-        .mmu_type = MMU_TYPE_R4000,
-    },
     {
         .name = "Loongson-2E",
         .CP0_PRid = 0x6302,
Signature · 1 line
2.41.0
#12 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 4 lines · Philippe Mathieu-Daudé

Alternative to:
https://lore.kernel.org/qemu-devel/[email protected]/
If the I6500 can not be tested or its support is incomplete, there is no point in wasting energy maintaining it.

Actually all SAAR and ITU stuff are optional for I6500 in real world so it's fine to just leave I6500 defined without SAAR support.

The main difference between I6400 and I6500 is multi-cluster support, I do have some patch for bringing proper multi-cluster support to QEMU, but it can't work with boston due to address space limitations.

Should I give mips-virt stuff another go?

Thanks
- Jiaxun

Quoted 28 lines

Philippe Mathieu-Daudé (11):
target/mips: Remove helpers accessing SAAR registers hw/misc/mips: Reduce itc_reconfigure() scope target/mips: Remove MIPSITUState::itu field target/mips: Remove CPUMIPSState::saarp field hw/misc/mips_itu: Remove MIPSITUState::cpu0 field hw/misc/mips_itu: Remove MIPSITUState::saar field target/mips: Remove CPUMIPSState::CP0_SAAR[2] field target/mips: Remove helpers accessing SAARI register target/mips: Remove CPUMIPSState::CP0_SAARI field target/mips: Remove the unused DisasContext::saar field target/mips: Remove I6500 CPU definition

  docs/about/removed-features.rst     |  5 +++
  include/hw/misc/mips_itu.h          |  6 ---
  target/mips/cpu.h                   |  4 --
  target/mips/tcg/translate.h         |  1 -
  target/mips/tcg/sysemu_helper.h.inc |  6 ---
  hw/mips/cps.c                       |  3 --
  hw/misc/mips_itu.c                  | 35 ++--------------
  target/mips/sysemu/machine.c        |  4 +-
  target/mips/tcg/sysemu/cp0_helper.c | 63 -----------------------------
  target/mips/tcg/translate.c         | 62 ----------------------------
  tests/qtest/machine-none-test.c     |  2 +-
  target/mips/cpu-defs.c.inc          | 40 ------------------
  12 files changed, 12 insertions(+), 219 deletions(-)
Signature · 2 lines
---
Jiaxun Yang
Reviewed-by on the v1 series
#13 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 4 lines · Philippe Mathieu-Daudé

Philippe Mathieu-Daudé (11):
target/mips: Remove helpers accessing SAAR registers hw/misc/mips: Reduce itc_reconfigure() scope target/mips: Remove MIPSITUState::itu field

Quoted 8 lines

target/mips: Remove CPUMIPSState::saarp field hw/misc/mips_itu: Remove MIPSITUState::cpu0 field hw/misc/mips_itu: Remove MIPSITUState::saar field target/mips: Remove CPUMIPSState::CP0_SAAR[2] field target/mips: Remove helpers accessing SAARI register target/mips: Remove CPUMIPSState::CP0_SAARI field target/mips: Remove the unused DisasContext::saar field target/mips: Remove I6500 CPU definition

r~

#14 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 5 lines · Philippe Mathieu-Daudé

Alternative to:
https://lore.kernel.org/qemu-devel/[email protected]/
If the I6500 can not be tested or its support is incomplete, there is no point in wasting energy maintaining it.

Quoted 11 lines

Philippe Mathieu-Daudé (11):
target/mips: Remove helpers accessing SAAR registers hw/misc/mips: Reduce itc_reconfigure() scope target/mips: Remove MIPSITUState::itu field target/mips: Remove CPUMIPSState::saarp field hw/misc/mips_itu: Remove MIPSITUState::cpu0 field hw/misc/mips_itu: Remove MIPSITUState::saar field target/mips: Remove CPUMIPSState::CP0_SAAR[2] field target/mips: Remove helpers accessing SAARI register target/mips: Remove CPUMIPSState::CP0_SAARI field target/mips: Remove the unused DisasContext::saar field

Patches 1-10 queued (without removing the I6500 CPU).