All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU
@ 2021-05-31 14:56 Bruno Larsen (billionai)
  2021-05-31 14:56 ` [PATCH v3 1/4] hw/core/cpu: removed cpu_dump_statistics function Bruno Larsen (billionai)
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Bruno Larsen (billionai) @ 2021-05-31 14:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: farosas, richard.henderson, luis.pires, lucas.araujo,
	fernando.valle, qemu-ppc, matheus.ferst, david

These 2 defines are being obsoleted as we move to decodetree, so they
were removed.

Also, upon further inspection, qemu already doesn't build with them
enabled, and probably hasn't for a while, and no one complained, so I
don't think they were actually being used.

Based-on: dgibson's ppc-for-6.1 tree

Changelog for v3:
 * Re-added patch that removed cpu_dump_statistics from hw/core/cpu
 * added HMP documentation patch to this series

Changelog for v2:
 * removed patches that were already applied
 * also removed PPC_DUMP_CPU functinality

Bruno Larsen (billionai) (4):
  hw/core/cpu: removed cpu_dump_statistics function
  HMP: added info cpustats to removed_features.rst
  target/ppc: removed GEN_OPCODE decision tree
  target/ppc: removed all mentions to PPC_DUMP_CPU

 docs/system/removed-features.rst |   5 +
 hw/core/cpu-common.c             |   9 --
 include/hw/core/cpu.h            |  12 --
 target/ppc/cpu_init.c            | 205 -------------------------------
 target/ppc/internal.h            |   2 -
 target/ppc/translate.c           | 184 ---------------------------
 6 files changed, 5 insertions(+), 412 deletions(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 1/4] hw/core/cpu: removed cpu_dump_statistics function
  2021-05-31 14:56 [PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU Bruno Larsen (billionai)
@ 2021-05-31 14:56 ` Bruno Larsen (billionai)
  2021-05-31 14:56 ` [PATCH v3 2/4] HMP: added info cpustats to removed_features.rst Bruno Larsen (billionai)
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Bruno Larsen (billionai) @ 2021-05-31 14:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, farosas, richard.henderson, luis.pires,
	lucas.araujo, fernando.valle, qemu-ppc, matheus.ferst,
	David Gibson

No more architectures set the pointer to dump_statistics, so there's no
point in keeping it, or the related cpu_dump_statistics function.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
Message-Id: <20210526202104.127910-6-bruno.larsen@eldorado.org.br>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/core/cpu-common.c  |  9 ---------
 include/hw/core/cpu.h | 12 ------------
 2 files changed, 21 deletions(-)

diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index 9530e266ec..e2f5a64604 100644
--- a/hw/core/cpu-common.c
+++ b/hw/core/cpu-common.c
@@ -109,15 +109,6 @@ void cpu_dump_state(CPUState *cpu, FILE *f, int flags)
     }
 }
 
-void cpu_dump_statistics(CPUState *cpu, int flags)
-{
-    CPUClass *cc = CPU_GET_CLASS(cpu);
-
-    if (cc->dump_statistics) {
-        cc->dump_statistics(cpu, flags);
-    }
-}
-
 void cpu_reset(CPUState *cpu)
 {
     device_cold_reset(DEVICE(cpu));
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 044f668a6e..6b3bd3a1d4 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -92,7 +92,6 @@ struct SysemuCPUOps;
  * @has_work: Callback for checking if there is work to do.
  * @memory_rw_debug: Callback for GDB memory access.
  * @dump_state: Callback for dumping state.
- * @dump_statistics: Callback for dumping statistics.
  * @get_arch_id: Callback for getting architecture-dependent CPU ID.
  * @set_pc: Callback for setting the Program Counter register. This
  *       should have the semantics used by the target architecture when
@@ -134,7 +133,6 @@ struct CPUClass {
     int (*memory_rw_debug)(CPUState *cpu, vaddr addr,
                            uint8_t *buf, int len, bool is_write);
     void (*dump_state)(CPUState *cpu, FILE *, int flags);
-    void (*dump_statistics)(CPUState *cpu, int flags);
     int64_t (*get_arch_id)(CPUState *cpu);
     void (*set_pc)(CPUState *cpu, vaddr value);
     int (*gdb_read_register)(CPUState *cpu, GByteArray *buf, int reg);
@@ -534,16 +532,6 @@ enum CPUDumpFlags {
  */
 void cpu_dump_state(CPUState *cpu, FILE *f, int flags);
 
-/**
- * cpu_dump_statistics:
- * @cpu: The CPU whose state is to be dumped.
- * @flags: Flags what to dump.
- *
- * Dump CPU statistics to the current monitor if we have one, else to
- * stdout.
- */
-void cpu_dump_statistics(CPUState *cpu, int flags);
-
 #ifndef CONFIG_USER_ONLY
 /**
  * cpu_get_phys_page_attrs_debug:
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 2/4] HMP: added info cpustats to removed_features.rst
  2021-05-31 14:56 [PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU Bruno Larsen (billionai)
  2021-05-31 14:56 ` [PATCH v3 1/4] hw/core/cpu: removed cpu_dump_statistics function Bruno Larsen (billionai)
@ 2021-05-31 14:56 ` Bruno Larsen (billionai)
  2021-05-31 17:52   ` Bruno Piazera Larsen
  2021-05-31 14:56 ` [PATCH v3 3/4] target/ppc: removed GEN_OPCODE decision tree Bruno Larsen (billionai)
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Bruno Larsen (billionai) @ 2021-05-31 14:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: farosas, richard.henderson, luis.pires, lucas.araujo,
	fernando.valle, qemu-ppc, matheus.ferst, david

Documented the removal of the HMP command info cpustats

Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
---
 docs/system/removed-features.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
index 5a462ac568..2feae41089 100644
--- a/docs/system/removed-features.rst
+++ b/docs/system/removed-features.rst
@@ -249,6 +249,11 @@ Use ``migrate-set-parameters`` and ``info migrate-parameters`` instead.
 
 Use ``migrate-set-parameters`` instead.
 
+``info cpustats`` (removed in 6.1)
+'''''''''''''''''''''''''''''
+
+This command didn't produce any output already. Removed with no replacement.
+
 Guest Emulator ISAs
 -------------------
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 3/4] target/ppc: removed GEN_OPCODE decision tree
  2021-05-31 14:56 [PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU Bruno Larsen (billionai)
  2021-05-31 14:56 ` [PATCH v3 1/4] hw/core/cpu: removed cpu_dump_statistics function Bruno Larsen (billionai)
  2021-05-31 14:56 ` [PATCH v3 2/4] HMP: added info cpustats to removed_features.rst Bruno Larsen (billionai)
@ 2021-05-31 14:56 ` Bruno Larsen (billionai)
  2021-05-31 17:42   ` Luis Fernando Fujita Pires
  2021-05-31 14:56 ` [PATCH v3 4/4] target/ppc: removed all mentions to PPC_DUMP_CPU Bruno Larsen (billionai)
  2021-06-01  2:47 ` [PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU David Gibson
  4 siblings, 1 reply; 10+ messages in thread
From: Bruno Larsen (billionai) @ 2021-05-31 14:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: farosas, richard.henderson, luis.pires, Greg Kurz, lucas.araujo,
	fernando.valle, qemu-ppc, matheus.ferst, david

since both, PPC_DO_STATISTICS and PPC_DUMP_CPU, are obsoleted as
target/ppc moves to decodetree, we can remove this ifdef based decision
tree, and only have what is now the standard option for the macro.

Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
---
 target/ppc/translate.c | 79 ------------------------------------------
 1 file changed, 79 deletions(-)

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 5c56e33c3c..4b66563998 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -1341,7 +1341,6 @@ typedef struct opcode_t {
 /*****************************************************************************/
 /* PowerPC instructions table                                                */
 
-#if defined(DO_PPC_STATISTICS)
 #define GEN_OPCODE(name, op1, op2, op3, invl, _typ, _typ2)                    \
 {                                                                             \
     .opc1 = op1,                                                              \
@@ -1353,7 +1352,6 @@ typedef struct opcode_t {
         .type = _typ,                                                         \
         .type2 = _typ2,                                                       \
         .handler = &gen_##name,                                               \
-        .oname = stringify(name),                                             \
     },                                                                        \
     .oname = stringify(name),                                                 \
 }
@@ -1369,7 +1367,6 @@ typedef struct opcode_t {
         .type = _typ,                                                         \
         .type2 = _typ2,                                                       \
         .handler = &gen_##name,                                               \
-        .oname = stringify(name),                                             \
     },                                                                        \
     .oname = stringify(name),                                                 \
 }
@@ -1384,7 +1381,6 @@ typedef struct opcode_t {
         .type = _typ,                                                         \
         .type2 = _typ2,                                                       \
         .handler = &gen_##name,                                               \
-        .oname = onam,                                                        \
     },                                                                        \
     .oname = onam,                                                            \
 }
@@ -1399,7 +1395,6 @@ typedef struct opcode_t {
         .type = _typ,                                                         \
         .type2 = _typ2,                                                       \
         .handler = &gen_##name,                                               \
-        .oname = stringify(name),                                             \
     },                                                                        \
     .oname = stringify(name),                                                 \
 }
@@ -1414,83 +1409,9 @@ typedef struct opcode_t {
         .type = _typ,                                                         \
         .type2 = _typ2,                                                       \
         .handler = &gen_##name,                                               \
-        .oname = onam,                                                        \
     },                                                                        \
     .oname = onam,                                                            \
 }
-#else
-#define GEN_OPCODE(name, op1, op2, op3, invl, _typ, _typ2)                    \
-{                                                                             \
-    .opc1 = op1,                                                              \
-    .opc2 = op2,                                                              \
-    .opc3 = op3,                                                              \
-    .opc4 = 0xff,                                                             \
-    .handler = {                                                              \
-        .inval1  = invl,                                                      \
-        .type = _typ,                                                         \
-        .type2 = _typ2,                                                       \
-        .handler = &gen_##name,                                               \
-    },                                                                        \
-    .oname = stringify(name),                                                 \
-}
-#define GEN_OPCODE_DUAL(name, op1, op2, op3, invl1, invl2, _typ, _typ2)       \
-{                                                                             \
-    .opc1 = op1,                                                              \
-    .opc2 = op2,                                                              \
-    .opc3 = op3,                                                              \
-    .opc4 = 0xff,                                                             \
-    .handler = {                                                              \
-        .inval1  = invl1,                                                     \
-        .inval2  = invl2,                                                     \
-        .type = _typ,                                                         \
-        .type2 = _typ2,                                                       \
-        .handler = &gen_##name,                                               \
-    },                                                                        \
-    .oname = stringify(name),                                                 \
-}
-#define GEN_OPCODE2(name, onam, op1, op2, op3, invl, _typ, _typ2)             \
-{                                                                             \
-    .opc1 = op1,                                                              \
-    .opc2 = op2,                                                              \
-    .opc3 = op3,                                                              \
-    .opc4 = 0xff,                                                             \
-    .handler = {                                                              \
-        .inval1  = invl,                                                      \
-        .type = _typ,                                                         \
-        .type2 = _typ2,                                                       \
-        .handler = &gen_##name,                                               \
-    },                                                                        \
-    .oname = onam,                                                            \
-}
-#define GEN_OPCODE3(name, op1, op2, op3, op4, invl, _typ, _typ2)              \
-{                                                                             \
-    .opc1 = op1,                                                              \
-    .opc2 = op2,                                                              \
-    .opc3 = op3,                                                              \
-    .opc4 = op4,                                                              \
-    .handler = {                                                              \
-        .inval1  = invl,                                                      \
-        .type = _typ,                                                         \
-        .type2 = _typ2,                                                       \
-        .handler = &gen_##name,                                               \
-    },                                                                        \
-    .oname = stringify(name),                                                 \
-}
-#define GEN_OPCODE4(name, onam, op1, op2, op3, op4, invl, _typ, _typ2)        \
-{                                                                             \
-    .opc1 = op1,                                                              \
-    .opc2 = op2,                                                              \
-    .opc3 = op3,                                                              \
-    .opc4 = op4,                                                              \
-    .handler = {                                                              \
-        .inval1  = invl,                                                      \
-        .type = _typ,                                                         \
-        .type2 = _typ2,                                                       \
-        .handler = &gen_##name,                                               \
-    },                                                                        \
-    .oname = onam,                                                            \
-}
-#endif
 
 /* Invalid instruction */
 static void gen_invalid(DisasContext *ctx)
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 4/4] target/ppc: removed all mentions to PPC_DUMP_CPU
  2021-05-31 14:56 [PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU Bruno Larsen (billionai)
                   ` (2 preceding siblings ...)
  2021-05-31 14:56 ` [PATCH v3 3/4] target/ppc: removed GEN_OPCODE decision tree Bruno Larsen (billionai)
@ 2021-05-31 14:56 ` Bruno Larsen (billionai)
  2021-05-31 17:46   ` Luis Fernando Fujita Pires
  2021-06-01  2:47 ` [PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU David Gibson
  4 siblings, 1 reply; 10+ messages in thread
From: Bruno Larsen (billionai) @ 2021-05-31 14:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: farosas, richard.henderson, luis.pires, Greg Kurz, lucas.araujo,
	fernando.valle, qemu-ppc, matheus.ferst, david

This feature will no longer be useful as ppc moves to using decotree for
TCG. And building with it enabled is no longer possible, due to changes
in opc_handler_t. Since the last commit that mentions it happened in
2014, I think it is safe to remove it.

Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
---
 target/ppc/cpu_init.c  | 205 -----------------------------------------
 target/ppc/internal.h  |   2 -
 target/ppc/translate.c | 105 ---------------------
 3 files changed, 312 deletions(-)

diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 74a397ad6c..d0411e7302 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -8541,45 +8541,6 @@ static void init_ppc_proc(PowerPCCPU *cpu)
     }
 }
 
-#if defined(PPC_DUMP_CPU)
-static void dump_ppc_sprs(CPUPPCState *env)
-{
-    ppc_spr_t *spr;
-#if !defined(CONFIG_USER_ONLY)
-    uint32_t sr, sw;
-#endif
-    uint32_t ur, uw;
-    int i, j, n;
-
-    printf("Special purpose registers:\n");
-    for (i = 0; i < 32; i++) {
-        for (j = 0; j < 32; j++) {
-            n = (i << 5) | j;
-            spr = &env->spr_cb[n];
-            uw = spr->uea_write != NULL && spr->uea_write != SPR_NOACCESS;
-            ur = spr->uea_read != NULL && spr->uea_read != SPR_NOACCESS;
-#if !defined(CONFIG_USER_ONLY)
-            sw = spr->oea_write != NULL && spr->oea_write != SPR_NOACCESS;
-            sr = spr->oea_read != NULL && spr->oea_read != SPR_NOACCESS;
-            if (sw || sr || uw || ur) {
-                printf("SPR: %4d (%03x) %-8s s%c%c u%c%c\n",
-                       (i << 5) | j, (i << 5) | j, spr->name,
-                       sw ? 'w' : '-', sr ? 'r' : '-',
-                       uw ? 'w' : '-', ur ? 'r' : '-');
-            }
-#else
-            if (uw || ur) {
-                printf("SPR: %4d (%03x) %-8s u%c%c\n",
-                       (i << 5) | j, (i << 5) | j, spr->name,
-                       uw ? 'w' : '-', ur ? 'r' : '-');
-            }
-#endif
-        }
-    }
-    fflush(stdout);
-    fflush(stderr);
-}
-#endif
 
 static void ppc_cpu_realize(DeviceState *dev, Error **errp)
 {
@@ -8616,172 +8577,6 @@ static void ppc_cpu_realize(DeviceState *dev, Error **errp)
 
     pcc->parent_realize(dev, errp);
 
-#if defined(PPC_DUMP_CPU)
-    {
-        CPUPPCState *env = &cpu->env;
-        const char *mmu_model, *excp_model, *bus_model;
-        switch (env->mmu_model) {
-        case POWERPC_MMU_32B:
-            mmu_model = "PowerPC 32";
-            break;
-        case POWERPC_MMU_SOFT_6xx:
-            mmu_model = "PowerPC 6xx/7xx with software driven TLBs";
-            break;
-        case POWERPC_MMU_SOFT_74xx:
-            mmu_model = "PowerPC 74xx with software driven TLBs";
-            break;
-        case POWERPC_MMU_SOFT_4xx:
-            mmu_model = "PowerPC 4xx with software driven TLBs";
-            break;
-        case POWERPC_MMU_SOFT_4xx_Z:
-            mmu_model = "PowerPC 4xx with software driven TLBs "
-                "and zones protections";
-            break;
-        case POWERPC_MMU_REAL:
-            mmu_model = "PowerPC real mode only";
-            break;
-        case POWERPC_MMU_MPC8xx:
-            mmu_model = "PowerPC MPC8xx";
-            break;
-        case POWERPC_MMU_BOOKE:
-            mmu_model = "PowerPC BookE";
-            break;
-        case POWERPC_MMU_BOOKE206:
-            mmu_model = "PowerPC BookE 2.06";
-            break;
-        case POWERPC_MMU_601:
-            mmu_model = "PowerPC 601";
-            break;
-#if defined(TARGET_PPC64)
-        case POWERPC_MMU_64B:
-            mmu_model = "PowerPC 64";
-            break;
-#endif
-        default:
-            mmu_model = "Unknown or invalid";
-            break;
-        }
-        switch (env->excp_model) {
-        case POWERPC_EXCP_STD:
-            excp_model = "PowerPC";
-            break;
-        case POWERPC_EXCP_40x:
-            excp_model = "PowerPC 40x";
-            break;
-        case POWERPC_EXCP_601:
-            excp_model = "PowerPC 601";
-            break;
-        case POWERPC_EXCP_602:
-            excp_model = "PowerPC 602";
-            break;
-        case POWERPC_EXCP_603:
-            excp_model = "PowerPC 603";
-            break;
-        case POWERPC_EXCP_603E:
-            excp_model = "PowerPC 603e";
-            break;
-        case POWERPC_EXCP_604:
-            excp_model = "PowerPC 604";
-            break;
-        case POWERPC_EXCP_7x0:
-            excp_model = "PowerPC 740/750";
-            break;
-        case POWERPC_EXCP_7x5:
-            excp_model = "PowerPC 745/755";
-            break;
-        case POWERPC_EXCP_74xx:
-            excp_model = "PowerPC 74xx";
-            break;
-        case POWERPC_EXCP_BOOKE:
-            excp_model = "PowerPC BookE";
-            break;
-#if defined(TARGET_PPC64)
-        case POWERPC_EXCP_970:
-            excp_model = "PowerPC 970";
-            break;
-#endif
-        default:
-            excp_model = "Unknown or invalid";
-            break;
-        }
-        switch (env->bus_model) {
-        case PPC_FLAGS_INPUT_6xx:
-            bus_model = "PowerPC 6xx";
-            break;
-        case PPC_FLAGS_INPUT_BookE:
-            bus_model = "PowerPC BookE";
-            break;
-        case PPC_FLAGS_INPUT_405:
-            bus_model = "PowerPC 405";
-            break;
-        case PPC_FLAGS_INPUT_401:
-            bus_model = "PowerPC 401/403";
-            break;
-        case PPC_FLAGS_INPUT_RCPU:
-            bus_model = "RCPU / MPC8xx";
-            break;
-#if defined(TARGET_PPC64)
-        case PPC_FLAGS_INPUT_970:
-            bus_model = "PowerPC 970";
-            break;
-#endif
-        default:
-            bus_model = "Unknown or invalid";
-            break;
-        }
-        printf("PowerPC %-12s : PVR %08x MSR %016" PRIx64 "\n"
-               "    MMU model        : %s\n",
-               object_class_get_name(OBJECT_CLASS(pcc)),
-               pcc->pvr, pcc->msr_mask, mmu_model);
-#if !defined(CONFIG_USER_ONLY)
-        if (env->tlb.tlb6) {
-            printf("                       %d %s TLB in %d ways\n",
-                   env->nb_tlb, env->id_tlbs ? "splitted" : "merged",
-                   env->nb_ways);
-        }
-#endif
-        printf("    Exceptions model : %s\n"
-               "    Bus model        : %s\n",
-               excp_model, bus_model);
-        printf("    MSR features     :\n");
-        if (env->flags & POWERPC_FLAG_SPE) {
-            printf("                        signal processing engine enable"
-                   "\n");
-        } else if (env->flags & POWERPC_FLAG_VRE) {
-            printf("                        vector processor enable\n");
-        }
-        if (env->flags & POWERPC_FLAG_TGPR) {
-            printf("                        temporary GPRs\n");
-        } else if (env->flags & POWERPC_FLAG_CE) {
-            printf("                        critical input enable\n");
-        }
-        if (env->flags & POWERPC_FLAG_SE) {
-            printf("                        single-step trace mode\n");
-        } else if (env->flags & POWERPC_FLAG_DWE) {
-            printf("                        debug wait enable\n");
-        } else if (env->flags & POWERPC_FLAG_UBLE) {
-            printf("                        user BTB lock enable\n");
-        }
-        if (env->flags & POWERPC_FLAG_BE) {
-            printf("                        branch-step trace mode\n");
-        } else if (env->flags & POWERPC_FLAG_DE) {
-            printf("                        debug interrupt enable\n");
-        }
-        if (env->flags & POWERPC_FLAG_PX) {
-            printf("                        inclusive protection\n");
-        } else if (env->flags & POWERPC_FLAG_PMM) {
-            printf("                        performance monitor mark\n");
-        }
-        if (env->flags == POWERPC_FLAG_NONE) {
-            printf("                        none\n");
-        }
-        printf("    Time-base/decrementer clock source: %s\n",
-               env->flags & POWERPC_FLAG_RTC_CLK ? "RTC clock" : "bus clock");
-        dump_ppc_insns(env);
-        dump_ppc_sprs(env);
-        fflush(stdout);
-    }
-#endif
     return;
 
 unrealize:
diff --git a/target/ppc/internal.h b/target/ppc/internal.h
index 2b4b06eb76..f1fd3c8d04 100644
--- a/target/ppc/internal.h
+++ b/target/ppc/internal.h
@@ -218,8 +218,6 @@ void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
 
 /* translate.c */
 
-/* #define PPC_DUMP_CPU */
-
 int ppc_fixup_cpu(PowerPCCPU *cpu);
 void create_ppc_opcodes(PowerPCCPU *cpu, Error **errp);
 void destroy_ppc_opcodes(PowerPCCPU *cpu);
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 4b66563998..e16a2721e2 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -216,9 +216,6 @@ struct opc_handler_t {
     uint64_t type2;
     /* handler */
     void (*handler)(DisasContext *ctx);
-#if defined(PPC_DUMP_CPU)
-    const char *oname;
-#endif
 };
 
 /* SPR load/store helpers */
@@ -8463,10 +8460,6 @@ static int register_direct_insn(opc_handler_t **ppc_opcodes,
     if (insert_in_table(ppc_opcodes, idx, handler) < 0) {
         printf("*** ERROR: opcode %02x already assigned in main "
                "opcode table\n", idx);
-#if defined(PPC_DUMP_CPU)
-        printf("           Registered handler '%s' - new handler '%s'\n",
-               ppc_opcodes[idx]->oname, handler->oname);
-#endif
         return -1;
     }
 
@@ -8487,10 +8480,6 @@ static int register_ind_in_table(opc_handler_t **table,
         if (!is_indirect_opcode(table[idx1])) {
             printf("*** ERROR: idx %02x already assigned to a direct "
                    "opcode\n", idx1);
-#if defined(PPC_DUMP_CPU)
-            printf("           Registered handler '%s' - new handler '%s'\n",
-                   ind_table(table[idx1])[idx2]->oname, handler->oname);
-#endif
             return -1;
         }
     }
@@ -8498,10 +8487,6 @@ static int register_ind_in_table(opc_handler_t **table,
         insert_in_table(ind_table(table[idx1]), idx2, handler) < 0) {
         printf("*** ERROR: opcode %02x already assigned in "
                "opcode table %02x\n", idx2, idx1);
-#if defined(PPC_DUMP_CPU)
-        printf("           Registered handler '%s' - new handler '%s'\n",
-               ind_table(table[idx1])[idx2]->oname, handler->oname);
-#endif
         return -1;
     }
 
@@ -8683,96 +8668,6 @@ void destroy_ppc_opcodes(PowerPCCPU *cpu)
     }
 }
 
-#if defined(PPC_DUMP_CPU)
-static void dump_ppc_insns(CPUPPCState *env)
-{
-    opc_handler_t **table, *handler;
-    const char *p, *q;
-    uint8_t opc1, opc2, opc3, opc4;
-
-    printf("Instructions set:\n");
-    /* opc1 is 6 bits long */
-    for (opc1 = 0x00; opc1 < PPC_CPU_OPCODES_LEN; opc1++) {
-        table = env->opcodes;
-        handler = table[opc1];
-        if (is_indirect_opcode(handler)) {
-            /* opc2 is 5 bits long */
-            for (opc2 = 0; opc2 < PPC_CPU_INDIRECT_OPCODES_LEN; opc2++) {
-                table = env->opcodes;
-                handler = env->opcodes[opc1];
-                table = ind_table(handler);
-                handler = table[opc2];
-                if (is_indirect_opcode(handler)) {
-                    table = ind_table(handler);
-                    /* opc3 is 5 bits long */
-                    for (opc3 = 0; opc3 < PPC_CPU_INDIRECT_OPCODES_LEN;
-                            opc3++) {
-                        handler = table[opc3];
-                        if (is_indirect_opcode(handler)) {
-                            table = ind_table(handler);
-                            /* opc4 is 5 bits long */
-                            for (opc4 = 0; opc4 < PPC_CPU_INDIRECT_OPCODES_LEN;
-                                 opc4++) {
-                                handler = table[opc4];
-                                if (handler->handler != &gen_invalid) {
-                                    printf("INSN: %02x %02x %02x %02x -- "
-                                           "(%02d %04d %02d) : %s\n",
-                                           opc1, opc2, opc3, opc4,
-                                           opc1, (opc3 << 5) | opc2, opc4,
-                                           handler->oname);
-                                }
-                            }
-                        } else {
-                            if (handler->handler != &gen_invalid) {
-                                /* Special hack to properly dump SPE insns */
-                                p = strchr(handler->oname, '_');
-                                if (p == NULL) {
-                                    printf("INSN: %02x %02x %02x (%02d %04d) : "
-                                           "%s\n",
-                                           opc1, opc2, opc3, opc1,
-                                           (opc3 << 5) | opc2,
-                                           handler->oname);
-                                } else {
-                                    q = "speundef";
-                                    if ((p - handler->oname) != strlen(q)
-                                        || (memcmp(handler->oname, q, strlen(q))
-                                            != 0)) {
-                                        /* First instruction */
-                                        printf("INSN: %02x %02x %02x"
-                                               "(%02d %04d) : %.*s\n",
-                                               opc1, opc2 << 1, opc3, opc1,
-                                               (opc3 << 6) | (opc2 << 1),
-                                               (int)(p - handler->oname),
-                                               handler->oname);
-                                    }
-                                    if (strcmp(p + 1, q) != 0) {
-                                        /* Second instruction */
-                                        printf("INSN: %02x %02x %02x "
-                                               "(%02d %04d) : %s\n", opc1,
-                                               (opc2 << 1) | 1, opc3, opc1,
-                                               (opc3 << 6) | (opc2 << 1) | 1,
-                                               p + 1);
-                                    }
-                                }
-                            }
-                        }
-                    }
-                } else {
-                    if (handler->handler != &gen_invalid) {
-                        printf("INSN: %02x %02x -- (%02d %04d) : %s\n",
-                               opc1, opc2, opc1, opc2, handler->oname);
-                    }
-                }
-            }
-        } else {
-            if (handler->handler != &gen_invalid) {
-                printf("INSN: %02x -- -- (%02d ----) : %s\n",
-                       opc1, opc1, handler->oname);
-            }
-        }
-    }
-}
-#endif
 int ppc_fixup_cpu(PowerPCCPU *cpu)
 {
     CPUPPCState *env = &cpu->env;
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* RE: [PATCH v3 3/4] target/ppc: removed GEN_OPCODE decision tree
  2021-05-31 14:56 ` [PATCH v3 3/4] target/ppc: removed GEN_OPCODE decision tree Bruno Larsen (billionai)
@ 2021-05-31 17:42   ` Luis Fernando Fujita Pires
  0 siblings, 0 replies; 10+ messages in thread
From: Luis Fernando Fujita Pires @ 2021-05-31 17:42 UTC (permalink / raw)
  To: Bruno Piazera Larsen, qemu-devel
  Cc: farosas, richard.henderson, Greg Kurz,
	Lucas Mateus Martins Araujo e Castro, Fernando Eckhardt Valle,
	qemu-ppc, Matheus Kowalczuk Ferst, david

From: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
>      .opc1 = op1,                                                              \
> @@ -1353,7 +1352,6 @@ typedef struct opcode_t {
>          .type = _typ,                                                         \
>          .type2 = _typ2,                                                       \
>          .handler = &gen_##name,                                               \
> -        .oname = stringify(name),                                             \
>      },                                                                        \
>      .oname = stringify(name),                                                 \
>  }

I guess you could remove oname from opcode_t too, now that it's not being used anywhere.

--
Luis Pires
Instituto de Pesquisas ELDORADO 
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH v3 4/4] target/ppc: removed all mentions to PPC_DUMP_CPU
  2021-05-31 14:56 ` [PATCH v3 4/4] target/ppc: removed all mentions to PPC_DUMP_CPU Bruno Larsen (billionai)
@ 2021-05-31 17:46   ` Luis Fernando Fujita Pires
  2021-06-01  2:47     ` david
  0 siblings, 1 reply; 10+ messages in thread
From: Luis Fernando Fujita Pires @ 2021-05-31 17:46 UTC (permalink / raw)
  To: Bruno Piazera Larsen, qemu-devel
  Cc: farosas, richard.henderson, Greg Kurz,
	Lucas Mateus Martins Araujo e Castro, Fernando Eckhardt Valle,
	qemu-ppc, Matheus Kowalczuk Ferst, david

From: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
> This feature will no longer be useful as ppc moves to using decotree for TCG.
> And building with it enabled is no longer possible, due to changes in
> opc_handler_t. Since the last commit that mentions it happened in 2014, I think
> it is safe to remove it.
> 
> Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
> ---
>  target/ppc/cpu_init.c  | 205 -----------------------------------------
>  target/ppc/internal.h  |   2 -
>  target/ppc/translate.c | 105 ---------------------
>  3 files changed, 312 deletions(-)

I believe you lost Richard's review for this one. In addition to approving it, he also noted the a typo in the commit message ("decotree" -> "decodetree").

Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>

--
Luis Pires
Instituto de Pesquisas ELDORADO 
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 2/4] HMP: added info cpustats to removed_features.rst
  2021-05-31 14:56 ` [PATCH v3 2/4] HMP: added info cpustats to removed_features.rst Bruno Larsen (billionai)
@ 2021-05-31 17:52   ` Bruno Piazera Larsen
  0 siblings, 0 replies; 10+ messages in thread
From: Bruno Piazera Larsen @ 2021-05-31 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: farosas, richard.henderson, luis.pires, lucas.araujo,
	fernando.valle, qemu-ppc, matheus.ferst, david

[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]


On 31/05/2021 11:56, Bruno Larsen (billionai) wrote:
> Documented the removal of the HMP command info cpustats
>
> Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>

Oops, I seem to have dropped a few tags:

Reviewed-by: Luis Pires<luis.pires@eldorado.org.br>
Reviewed-by: Lucas Mateus<lucas.araujo@eldorado.org.br>
Reviewed-by: Greg Kurz<groug@kaod.org>

> ---
>   docs/system/removed-features.rst | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
> index 5a462ac568..2feae41089 100644
> --- a/docs/system/removed-features.rst
> +++ b/docs/system/removed-features.rst
> @@ -249,6 +249,11 @@ Use ``migrate-set-parameters`` and ``info migrate-parameters`` instead.
>   
>   Use ``migrate-set-parameters`` instead.
>   
> +``info cpustats`` (removed in 6.1)
> +'''''''''''''''''''''''''''''
> +
> +This command didn't produce any output already. Removed with no replacement.
> +
>   Guest Emulator ISAs
>   -------------------
>   
-- 
Bruno Piazera Larsen
Instituto de Pesquisas ELDORADO 
<https://www.eldorado.org.br/?utm_campaign=assinatura_de_e-mail&utm_medium=email&utm_source=RD+Station>
Departamento Computação Embarcada
Analista de Software Trainee
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>

[-- Attachment #2: Type: text/html, Size: 2324 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 4/4] target/ppc: removed all mentions to PPC_DUMP_CPU
  2021-05-31 17:46   ` Luis Fernando Fujita Pires
@ 2021-06-01  2:47     ` david
  0 siblings, 0 replies; 10+ messages in thread
From: david @ 2021-06-01  2:47 UTC (permalink / raw)
  To: Luis Fernando Fujita Pires
  Cc: farosas, richard.henderson, qemu-devel, Greg Kurz,
	Lucas Mateus Martins Araujo e Castro, Fernando Eckhardt Valle,
	qemu-ppc, Matheus Kowalczuk Ferst

[-- Attachment #1: Type: text/plain, Size: 1222 bytes --]

On Mon, May 31, 2021 at 05:46:07PM +0000, Luis Fernando Fujita Pires wrote:
> From: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
> > This feature will no longer be useful as ppc moves to using decotree for TCG.
> > And building with it enabled is no longer possible, due to changes in
> > opc_handler_t. Since the last commit that mentions it happened in 2014, I think
> > it is safe to remove it.
> > 
> > Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
> > ---
> >  target/ppc/cpu_init.c  | 205 -----------------------------------------
> >  target/ppc/internal.h  |   2 -
> >  target/ppc/translate.c | 105 ---------------------
> >  3 files changed, 312 deletions(-)
> 
> I believe you lost Richard's review for this one. In addition to approving it, he also noted the a typo in the commit message ("decotree" -> "decodetree").

I folded in the typo fix and Richard's R-b for this patch and the
previous one.

> Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU
  2021-05-31 14:56 [PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU Bruno Larsen (billionai)
                   ` (3 preceding siblings ...)
  2021-05-31 14:56 ` [PATCH v3 4/4] target/ppc: removed all mentions to PPC_DUMP_CPU Bruno Larsen (billionai)
@ 2021-06-01  2:47 ` David Gibson
  4 siblings, 0 replies; 10+ messages in thread
From: David Gibson @ 2021-06-01  2:47 UTC (permalink / raw)
  To: Bruno Larsen (billionai)
  Cc: farosas, richard.henderson, qemu-devel, lucas.araujo,
	fernando.valle, qemu-ppc, matheus.ferst, luis.pires

[-- Attachment #1: Type: text/plain, Size: 1542 bytes --]

On Mon, May 31, 2021 at 11:56:25AM -0300, Bruno Larsen (billionai) wrote:
> These 2 defines are being obsoleted as we move to decodetree, so they
> were removed.
> 
> Also, upon further inspection, qemu already doesn't build with them
> enabled, and probably hasn't for a while, and no one complained, so I
> don't think they were actually being used.
> 
> Based-on: dgibson's ppc-for-6.1 tree

Applied to ppc-for-6.1, thanks.

> 
> Changelog for v3:
>  * Re-added patch that removed cpu_dump_statistics from hw/core/cpu
>  * added HMP documentation patch to this series
> 
> Changelog for v2:
>  * removed patches that were already applied
>  * also removed PPC_DUMP_CPU functinality
> 
> Bruno Larsen (billionai) (4):
>   hw/core/cpu: removed cpu_dump_statistics function
>   HMP: added info cpustats to removed_features.rst
>   target/ppc: removed GEN_OPCODE decision tree
>   target/ppc: removed all mentions to PPC_DUMP_CPU
> 
>  docs/system/removed-features.rst |   5 +
>  hw/core/cpu-common.c             |   9 --
>  include/hw/core/cpu.h            |  12 --
>  target/ppc/cpu_init.c            | 205 -------------------------------
>  target/ppc/internal.h            |   2 -
>  target/ppc/translate.c           | 184 ---------------------------
>  6 files changed, 5 insertions(+), 412 deletions(-)
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-06-01  3:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31 14:56 [PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU Bruno Larsen (billionai)
2021-05-31 14:56 ` [PATCH v3 1/4] hw/core/cpu: removed cpu_dump_statistics function Bruno Larsen (billionai)
2021-05-31 14:56 ` [PATCH v3 2/4] HMP: added info cpustats to removed_features.rst Bruno Larsen (billionai)
2021-05-31 17:52   ` Bruno Piazera Larsen
2021-05-31 14:56 ` [PATCH v3 3/4] target/ppc: removed GEN_OPCODE decision tree Bruno Larsen (billionai)
2021-05-31 17:42   ` Luis Fernando Fujita Pires
2021-05-31 14:56 ` [PATCH v3 4/4] target/ppc: removed all mentions to PPC_DUMP_CPU Bruno Larsen (billionai)
2021-05-31 17:46   ` Luis Fernando Fujita Pires
2021-06-01  2:47     ` david
2021-06-01  2:47 ` [PATCH v3 0/4] target/ppc: Remove DO_PPC_STATISTICS and PPC_DUMP_CPU David Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.