* [PATCH-for-11.1 v6 1/6] target/sparc/monitor: Dump all registers as 32-bit
2026-03-20 9:10 [PATCH-for-11.1 v6 0/6] monitor/hmp: Reduce target-specific definitions Philippe Mathieu-Daudé
@ 2026-03-20 9:10 ` Philippe Mathieu-Daudé
2026-03-20 21:44 ` Pierrick Bouvier
2026-03-24 12:49 ` Markus Armbruster
2026-03-20 9:10 ` [PATCH-for-11.1 v6 2/6] monitor: Remove MonitorDef::type field and MD_TLONG / MD_I32 Philippe Mathieu-Daudé
` (4 subsequent siblings)
5 siblings, 2 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-03-20 9:10 UTC (permalink / raw)
To: qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Pierrick Bouvier, Artyom Tarasenko, Dr. David Alan Gilbert,
Richard Henderson, Markus Armbruster, Philippe Mathieu-Daudé
All these SPARC64 registers are 32-bit since their introduction
in commit 3475187dd81 ("sparc64 merge"), see target/sparc/cpu.h:
511 #if defined(TARGET_SPARC64)
...
515 uint32_t asi;
516 uint32_t pstate;
...
519 uint32_t cansave, canrestore, otherwin, wstate, cleanwin;
Set MonitorDef::type to MD_I32 to dump them as 32-bit.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/sparc/monitor.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c
index a60671a60a4..e9300ded4ad 100644
--- a/target/sparc/monitor.c
+++ b/target/sparc/monitor.c
@@ -41,13 +41,13 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)
const MonitorDef monitor_defs[] = {
#ifdef TARGET_SPARC64
- { "asi", offsetof(CPUSPARCState, asi) },
- { "pstate", offsetof(CPUSPARCState, pstate) },
- { "cansave", offsetof(CPUSPARCState, cansave) },
- { "canrestore", offsetof(CPUSPARCState, canrestore) },
- { "otherwin", offsetof(CPUSPARCState, otherwin) },
- { "wstate", offsetof(CPUSPARCState, wstate) },
- { "cleanwin", offsetof(CPUSPARCState, cleanwin) },
+ { "asi", offsetof(CPUSPARCState, asi), NULL, MD_I32 },
+ { "pstate", offsetof(CPUSPARCState, pstate), NULL, MD_I32 },
+ { "cansave", offsetof(CPUSPARCState, cansave), NULL, MD_I32 },
+ { "canrestore", offsetof(CPUSPARCState, canrestore), NULL, MD_I32 },
+ { "otherwin", offsetof(CPUSPARCState, otherwin), NULL, MD_I32 },
+ { "wstate", offsetof(CPUSPARCState, wstate), NULL, MD_I32 },
+ { "cleanwin", offsetof(CPUSPARCState, cleanwin), NULL, MD_I32 },
#endif
{ NULL },
};
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 1/6] target/sparc/monitor: Dump all registers as 32-bit
2026-03-20 9:10 ` [PATCH-for-11.1 v6 1/6] target/sparc/monitor: Dump all registers as 32-bit Philippe Mathieu-Daudé
@ 2026-03-20 21:44 ` Pierrick Bouvier
2026-03-24 12:49 ` Markus Armbruster
1 sibling, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2026-03-20 21:44 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Artyom Tarasenko, Dr. David Alan Gilbert, Richard Henderson,
Markus Armbruster
On 3/20/26 2:10 AM, Philippe Mathieu-Daudé wrote:
> All these SPARC64 registers are 32-bit since their introduction
> in commit 3475187dd81 ("sparc64 merge"), see target/sparc/cpu.h:
>
> 511 #if defined(TARGET_SPARC64)
> ...
> 515 uint32_t asi;
> 516 uint32_t pstate;
> ...
> 519 uint32_t cansave, canrestore, otherwin, wstate, cleanwin;
>
> Set MonitorDef::type to MD_I32 to dump them as 32-bit.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> target/sparc/monitor.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 1/6] target/sparc/monitor: Dump all registers as 32-bit
2026-03-20 9:10 ` [PATCH-for-11.1 v6 1/6] target/sparc/monitor: Dump all registers as 32-bit Philippe Mathieu-Daudé
2026-03-20 21:44 ` Pierrick Bouvier
@ 2026-03-24 12:49 ` Markus Armbruster
1 sibling, 0 replies; 21+ messages in thread
From: Markus Armbruster @ 2026-03-24 12:49 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Daniel Henrique Barboza, Paolo Bonzini,
Mark Cave-Ayland, Pierrick Bouvier, Artyom Tarasenko,
Dr. David Alan Gilbert, Richard Henderson
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> All these SPARC64 registers are 32-bit since their introduction
> in commit 3475187dd81 ("sparc64 merge"), see target/sparc/cpu.h:
>
> 511 #if defined(TARGET_SPARC64)
> ...
> 515 uint32_t asi;
> 516 uint32_t pstate;
> ...
> 519 uint32_t cansave, canrestore, otherwin, wstate, cleanwin;
>
> Set MonitorDef::type to MD_I32 to dump them as 32-bit.
What are they dumped as before this patch?
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> target/sparc/monitor.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c
> index a60671a60a4..e9300ded4ad 100644
> --- a/target/sparc/monitor.c
> +++ b/target/sparc/monitor.c
> @@ -41,13 +41,13 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)
>
> const MonitorDef monitor_defs[] = {
> #ifdef TARGET_SPARC64
> - { "asi", offsetof(CPUSPARCState, asi) },
> - { "pstate", offsetof(CPUSPARCState, pstate) },
> - { "cansave", offsetof(CPUSPARCState, cansave) },
> - { "canrestore", offsetof(CPUSPARCState, canrestore) },
> - { "otherwin", offsetof(CPUSPARCState, otherwin) },
> - { "wstate", offsetof(CPUSPARCState, wstate) },
> - { "cleanwin", offsetof(CPUSPARCState, cleanwin) },
> + { "asi", offsetof(CPUSPARCState, asi), NULL, MD_I32 },
> + { "pstate", offsetof(CPUSPARCState, pstate), NULL, MD_I32 },
> + { "cansave", offsetof(CPUSPARCState, cansave), NULL, MD_I32 },
> + { "canrestore", offsetof(CPUSPARCState, canrestore), NULL, MD_I32 },
> + { "otherwin", offsetof(CPUSPARCState, otherwin), NULL, MD_I32 },
> + { "wstate", offsetof(CPUSPARCState, wstate), NULL, MD_I32 },
> + { "cleanwin", offsetof(CPUSPARCState, cleanwin), NULL, MD_I32 },
> #endif
> { NULL },
> };
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH-for-11.1 v6 2/6] monitor: Remove MonitorDef::type field and MD_TLONG / MD_I32
2026-03-20 9:10 [PATCH-for-11.1 v6 0/6] monitor/hmp: Reduce target-specific definitions Philippe Mathieu-Daudé
2026-03-20 9:10 ` [PATCH-for-11.1 v6 1/6] target/sparc/monitor: Dump all registers as 32-bit Philippe Mathieu-Daudé
@ 2026-03-20 9:10 ` Philippe Mathieu-Daudé
2026-03-20 21:44 ` Pierrick Bouvier
2026-03-20 9:10 ` [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type Philippe Mathieu-Daudé
` (3 subsequent siblings)
5 siblings, 1 reply; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-03-20 9:10 UTC (permalink / raw)
To: qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Pierrick Bouvier, Artyom Tarasenko, Dr. David Alan Gilbert,
Richard Henderson, Markus Armbruster, Philippe Mathieu-Daudé,
Zhao Liu, Laurent Vivier
None of the few targets still using MonitorDef use MD_TLONG,
they either use MD_I32 or the %get_value handler. Remove the
MonitorDef::type and its definitions altogether: simply check
for the %get_value handler, if NULL then consider 32-bit.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/monitor/hmp-target.h | 4 ----
monitor/hmp-target.c | 12 +-----------
target/i386/monitor.c | 2 +-
target/m68k/monitor.c | 24 ++++++++++++------------
target/sparc/monitor.c | 14 +++++++-------
5 files changed, 21 insertions(+), 35 deletions(-)
diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h
index 5167d17d41d..56322ceddd4 100644
--- a/include/monitor/hmp-target.h
+++ b/include/monitor/hmp-target.h
@@ -34,13 +34,9 @@ struct MonitorDef {
int offset;
target_long (*get_value)(Monitor *mon, const struct MonitorDef *md,
int val);
- int type;
};
#endif
-#define MD_TLONG 0
-#define MD_I32 1
-
const MonitorDef *target_monitor_defs(void);
int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval);
diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c
index 420969bd6eb..3f019ae2a28 100644
--- a/monitor/hmp-target.c
+++ b/monitor/hmp-target.c
@@ -82,17 +82,7 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
} else {
CPUArchState *env = mon_get_cpu_env(mon);
ptr = (uint8_t *)env + md->offset;
- switch(md->type) {
- case MD_I32:
- *pval = *(int32_t *)ptr;
- break;
- case MD_TLONG:
- *pval = *(target_long *)ptr;
- break;
- default:
- *pval = 0;
- break;
- }
+ *pval = *(int32_t *)ptr;
}
return 0;
}
diff --git a/target/i386/monitor.c b/target/i386/monitor.c
index 446428602ef..977f65fe16c 100644
--- a/target/i386/monitor.c
+++ b/target/i386/monitor.c
@@ -602,7 +602,7 @@ static target_long monitor_get_pc(Monitor *mon, const struct MonitorDef *md,
const MonitorDef monitor_defs[] = {
#define SEG(name, seg) \
- { name ".limit", offsetof(CPUX86State, segs[seg].limit), NULL, MD_I32 },
+ { name ".limit", offsetof(CPUX86State, segs[seg].limit) },
SEG("cs", R_CS)
SEG("ds", R_DS)
SEG("es", R_ES)
diff --git a/target/m68k/monitor.c b/target/m68k/monitor.c
index 08ced037b47..94bb12833af 100644
--- a/target/m68k/monitor.c
+++ b/target/m68k/monitor.c
@@ -24,18 +24,18 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)
}
static const MonitorDef monitor_defs[] = {
- { "ssp", offsetof(CPUM68KState, sp[0]), NULL, MD_I32 },
- { "usp", offsetof(CPUM68KState, sp[1]), NULL, MD_I32 },
- { "isp", offsetof(CPUM68KState, sp[2]), NULL, MD_I32 },
- { "sfc", offsetof(CPUM68KState, sfc), NULL, MD_I32 },
- { "dfc", offsetof(CPUM68KState, dfc), NULL, MD_I32 },
- { "urp", offsetof(CPUM68KState, mmu.urp), NULL, MD_I32 },
- { "srp", offsetof(CPUM68KState, mmu.srp), NULL, MD_I32 },
- { "dttr0", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR0]), NULL, MD_I32 },
- { "dttr1", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR1]), NULL, MD_I32 },
- { "ittr0", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR0]), NULL, MD_I32 },
- { "ittr1", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR1]), NULL, MD_I32 },
- { "mmusr", offsetof(CPUM68KState, mmu.mmusr), NULL, MD_I32 },
+ { "ssp", offsetof(CPUM68KState, sp[0]) },
+ { "usp", offsetof(CPUM68KState, sp[1]) },
+ { "isp", offsetof(CPUM68KState, sp[2]) },
+ { "sfc", offsetof(CPUM68KState, sfc) },
+ { "dfc", offsetof(CPUM68KState, dfc) },
+ { "urp", offsetof(CPUM68KState, mmu.urp) },
+ { "srp", offsetof(CPUM68KState, mmu.srp) },
+ { "dttr0", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR0]) },
+ { "dttr1", offsetof(CPUM68KState, mmu.ttr[M68K_DTTR1]) },
+ { "ittr0", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR0]) },
+ { "ittr1", offsetof(CPUM68KState, mmu.ttr[M68K_ITTR1]) },
+ { "mmusr", offsetof(CPUM68KState, mmu.mmusr) },
{ NULL },
};
diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c
index e9300ded4ad..a60671a60a4 100644
--- a/target/sparc/monitor.c
+++ b/target/sparc/monitor.c
@@ -41,13 +41,13 @@ void hmp_info_tlb(Monitor *mon, const QDict *qdict)
const MonitorDef monitor_defs[] = {
#ifdef TARGET_SPARC64
- { "asi", offsetof(CPUSPARCState, asi), NULL, MD_I32 },
- { "pstate", offsetof(CPUSPARCState, pstate), NULL, MD_I32 },
- { "cansave", offsetof(CPUSPARCState, cansave), NULL, MD_I32 },
- { "canrestore", offsetof(CPUSPARCState, canrestore), NULL, MD_I32 },
- { "otherwin", offsetof(CPUSPARCState, otherwin), NULL, MD_I32 },
- { "wstate", offsetof(CPUSPARCState, wstate), NULL, MD_I32 },
- { "cleanwin", offsetof(CPUSPARCState, cleanwin), NULL, MD_I32 },
+ { "asi", offsetof(CPUSPARCState, asi) },
+ { "pstate", offsetof(CPUSPARCState, pstate) },
+ { "cansave", offsetof(CPUSPARCState, cansave) },
+ { "canrestore", offsetof(CPUSPARCState, canrestore) },
+ { "otherwin", offsetof(CPUSPARCState, otherwin) },
+ { "wstate", offsetof(CPUSPARCState, wstate) },
+ { "cleanwin", offsetof(CPUSPARCState, cleanwin) },
#endif
{ NULL },
};
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 2/6] monitor: Remove MonitorDef::type field and MD_TLONG / MD_I32
2026-03-20 9:10 ` [PATCH-for-11.1 v6 2/6] monitor: Remove MonitorDef::type field and MD_TLONG / MD_I32 Philippe Mathieu-Daudé
@ 2026-03-20 21:44 ` Pierrick Bouvier
0 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2026-03-20 21:44 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Artyom Tarasenko, Dr. David Alan Gilbert, Richard Henderson,
Markus Armbruster, Zhao Liu, Laurent Vivier
On 3/20/26 2:10 AM, Philippe Mathieu-Daudé wrote:
> None of the few targets still using MonitorDef use MD_TLONG,
> they either use MD_I32 or the %get_value handler. Remove the
> MonitorDef::type and its definitions altogether: simply check
> for the %get_value handler, if NULL then consider 32-bit.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/monitor/hmp-target.h | 4 ----
> monitor/hmp-target.c | 12 +-----------
> target/i386/monitor.c | 2 +-
> target/m68k/monitor.c | 24 ++++++++++++------------
> target/sparc/monitor.c | 14 +++++++-------
> 5 files changed, 21 insertions(+), 35 deletions(-)
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type
2026-03-20 9:10 [PATCH-for-11.1 v6 0/6] monitor/hmp: Reduce target-specific definitions Philippe Mathieu-Daudé
2026-03-20 9:10 ` [PATCH-for-11.1 v6 1/6] target/sparc/monitor: Dump all registers as 32-bit Philippe Mathieu-Daudé
2026-03-20 9:10 ` [PATCH-for-11.1 v6 2/6] monitor: Remove MonitorDef::type field and MD_TLONG / MD_I32 Philippe Mathieu-Daudé
@ 2026-03-20 9:10 ` Philippe Mathieu-Daudé
2026-03-20 21:45 ` Pierrick Bouvier
2026-03-24 12:56 ` Markus Armbruster
2026-03-20 9:10 ` [PATCH-for-11.1 v6 4/6] monitor: Remove last target_long use in get_monitor_def() Philippe Mathieu-Daudé
` (2 subsequent siblings)
5 siblings, 2 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-03-20 9:10 UTC (permalink / raw)
To: qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Pierrick Bouvier, Artyom Tarasenko, Dr. David Alan Gilbert,
Richard Henderson, Markus Armbruster, Philippe Mathieu-Daudé,
Zhao Liu
Simplify MonitorDef::get_value() handler by having it always
return a int64_t type. Truncate to 32-bit in the single caller.
Note, this handler is only implemented once for the x86 targets.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/monitor/hmp-target.h | 6 +-----
monitor/hmp-target.c | 5 ++++-
target/i386/monitor.c | 4 ++--
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h
index 56322ceddd4..6364c94edf8 100644
--- a/include/monitor/hmp-target.h
+++ b/include/monitor/hmp-target.h
@@ -27,15 +27,11 @@
typedef struct MonitorDef MonitorDef;
-#ifdef COMPILING_PER_TARGET
-#include "cpu.h"
struct MonitorDef {
const char *name;
int offset;
- target_long (*get_value)(Monitor *mon, const struct MonitorDef *md,
- int val);
+ int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int offset);
};
-#endif
const MonitorDef *target_monitor_defs(void);
int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval);
diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c
index 3f019ae2a28..155caedd784 100644
--- a/monitor/hmp-target.c
+++ b/monitor/hmp-target.c
@@ -23,6 +23,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/target-info.h"
#include "monitor-internal.h"
#include "monitor/qdev.h"
#include "net/slirp.h"
@@ -33,6 +34,7 @@
#include "qapi/qapi-commands-control.h"
#include "qapi/qapi-commands-misc.h"
#include "qapi/qapi-commands-machine.h"
+#include "exec/target_long.h"
#if defined(TARGET_S390X)
#include "hw/s390x/storage-keys.h"
@@ -78,7 +80,8 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
for(; md->name != NULL; md++) {
if (hmp_compare_cmd(name, md->name)) {
if (md->get_value) {
- *pval = md->get_value(mon, md, md->offset);
+ int64_t val = md->get_value(mon, md, md->offset);
+ *pval = target_long_bits() == 32 ? (int32_t)val : val;
} else {
CPUArchState *env = mon_get_cpu_env(mon);
ptr = (uint8_t *)env + md->offset;
diff --git a/target/i386/monitor.c b/target/i386/monitor.c
index 977f65fe16c..b128334e571 100644
--- a/target/i386/monitor.c
+++ b/target/i386/monitor.c
@@ -593,8 +593,8 @@ void hmp_mce(Monitor *mon, const QDict *qdict)
}
}
-static target_long monitor_get_pc(Monitor *mon, const struct MonitorDef *md,
- int val)
+static int64_t monitor_get_pc(Monitor *mon, const struct MonitorDef *md,
+ int offset)
{
CPUArchState *env = mon_get_cpu_env(mon);
return env->eip + env->segs[R_CS].base;
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type
2026-03-20 9:10 ` [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type Philippe Mathieu-Daudé
@ 2026-03-20 21:45 ` Pierrick Bouvier
2026-03-24 12:56 ` Markus Armbruster
1 sibling, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2026-03-20 21:45 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Artyom Tarasenko, Dr. David Alan Gilbert, Richard Henderson,
Markus Armbruster, Zhao Liu
On 3/20/26 2:10 AM, Philippe Mathieu-Daudé wrote:
> Simplify MonitorDef::get_value() handler by having it always
> return a int64_t type. Truncate to 32-bit in the single caller.
>
> Note, this handler is only implemented once for the x86 targets.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/monitor/hmp-target.h | 6 +-----
> monitor/hmp-target.c | 5 ++++-
> target/i386/monitor.c | 4 ++--
> 3 files changed, 7 insertions(+), 8 deletions(-)
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type
2026-03-20 9:10 ` [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type Philippe Mathieu-Daudé
2026-03-20 21:45 ` Pierrick Bouvier
@ 2026-03-24 12:56 ` Markus Armbruster
2026-03-24 13:24 ` Peter Maydell
1 sibling, 1 reply; 21+ messages in thread
From: Markus Armbruster @ 2026-03-24 12:56 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Daniel Henrique Barboza, Paolo Bonzini,
Mark Cave-Ayland, Pierrick Bouvier, Artyom Tarasenko,
Dr. David Alan Gilbert, Richard Henderson, Zhao Liu
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> Simplify MonitorDef::get_value() handler by having it always
> return a int64_t type. Truncate to 32-bit in the single caller.
>
> Note, this handler is only implemented once for the x86 targets.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/monitor/hmp-target.h | 6 +-----
> monitor/hmp-target.c | 5 ++++-
> target/i386/monitor.c | 4 ++--
> 3 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h
> index 56322ceddd4..6364c94edf8 100644
> --- a/include/monitor/hmp-target.h
> +++ b/include/monitor/hmp-target.h
> @@ -27,15 +27,11 @@
>
> typedef struct MonitorDef MonitorDef;
>
> -#ifdef COMPILING_PER_TARGET
> -#include "cpu.h"
> struct MonitorDef {
> const char *name;
> int offset;
> - target_long (*get_value)(Monitor *mon, const struct MonitorDef *md,
> - int val);
> + int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int offset);
> };
> -#endif
>
> const MonitorDef *target_monitor_defs(void);
> int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval);
> diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c
> index 3f019ae2a28..155caedd784 100644
> --- a/monitor/hmp-target.c
> +++ b/monitor/hmp-target.c
> @@ -23,6 +23,7 @@
> */
>
> #include "qemu/osdep.h"
> +#include "qemu/target-info.h"
> #include "monitor-internal.h"
> #include "monitor/qdev.h"
> #include "net/slirp.h"
> @@ -33,6 +34,7 @@
> #include "qapi/qapi-commands-control.h"
> #include "qapi/qapi-commands-misc.h"
> #include "qapi/qapi-commands-machine.h"
> +#include "exec/target_long.h"
>
> #if defined(TARGET_S390X)
> #include "hw/s390x/storage-keys.h"
> @@ -78,7 +80,8 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
> for(; md->name != NULL; md++) {
> if (hmp_compare_cmd(name, md->name)) {
> if (md->get_value) {
> - *pval = md->get_value(mon, md, md->offset);
> + int64_t val = md->get_value(mon, md, md->offset);
> + *pval = target_long_bits() == 32 ? (int32_t)val : val;
This assumes target_long_bits() returns either 32 or 64, doesn't it?
Is this true today?
Will it remain true?
Could we use something like
val & ((1 << target_long_bits()) - 1)
to truncate to target_long_bits() bits?
> } else {
> CPUArchState *env = mon_get_cpu_env(mon);
> ptr = (uint8_t *)env + md->offset;
> diff --git a/target/i386/monitor.c b/target/i386/monitor.c
> index 977f65fe16c..b128334e571 100644
> --- a/target/i386/monitor.c
> +++ b/target/i386/monitor.c
> @@ -593,8 +593,8 @@ void hmp_mce(Monitor *mon, const QDict *qdict)
> }
> }
>
> -static target_long monitor_get_pc(Monitor *mon, const struct MonitorDef *md,
> - int val)
> +static int64_t monitor_get_pc(Monitor *mon, const struct MonitorDef *md,
> + int offset)
> {
> CPUArchState *env = mon_get_cpu_env(mon);
> return env->eip + env->segs[R_CS].base;
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type
2026-03-24 12:56 ` Markus Armbruster
@ 2026-03-24 13:24 ` Peter Maydell
2026-03-24 14:42 ` Markus Armbruster
0 siblings, 1 reply; 21+ messages in thread
From: Peter Maydell @ 2026-03-24 13:24 UTC (permalink / raw)
To: Markus Armbruster
Cc: Philippe Mathieu-Daudé, qemu-devel, Daniel Henrique Barboza,
Paolo Bonzini, Mark Cave-Ayland, Pierrick Bouvier,
Artyom Tarasenko, Dr. David Alan Gilbert, Richard Henderson,
Zhao Liu
On Tue, 24 Mar 2026 at 12:57, Markus Armbruster <armbru@redhat.com> wrote:
>
> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>
> > Simplify MonitorDef::get_value() handler by having it always
> > return a int64_t type. Truncate to 32-bit in the single caller.
> >
> > Note, this handler is only implemented once for the x86 targets.
> > @@ -78,7 +80,8 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
> > for(; md->name != NULL; md++) {
> > if (hmp_compare_cmd(name, md->name)) {
> > if (md->get_value) {
> > - *pval = md->get_value(mon, md, md->offset);
> > + int64_t val = md->get_value(mon, md, md->offset);
> > + *pval = target_long_bits() == 32 ? (int32_t)val : val;
>
> This assumes target_long_bits() returns either 32 or 64, doesn't it?
>
> Is this true today?
It's certainly true today, and we insist on that: exec/target_long.h
handles TARGET_LONG_SIZE being 4 or 8 and will #error on anything else.
What other values do you expect it could have ?
> Will it remain true?
>
> Could we use something like
>
> val & ((1 << target_long_bits()) - 1)
>
> to truncate to target_long_bits() bits?
This is UB for the case where target_long_bits returns 64,
and isn't what the code currently does because it zero
extends rather than sign extending.
If we wanted to programmatically sign extend from
target_long_bits() to the int64_t, that would be
*pval = sextract64(val, 0, target_long_bits());
(Whether sign extension is what we actually want for your
average register is questionable, but it's what the code
does now both for the get_value functions and also for the
generic cases handled by the switch on md->type.)
Incidentally, we currently behave differently here for
qemu-system-i386 and qemu-system-x86_64:
$ ./build/all/qemu-system-x86_64 -S -monitor stdio -display none
QEMU 10.2.50 monitor - type 'help' for more information
(qemu) print $pc
0xfffffff0
(qemu) q
$ ./build/all/qemu-system-i386 -S -monitor stdio -display none
QEMU 10.2.50 monitor - type 'help' for more information
(qemu) print $pc
0xfffffffffffffff0
For qemu-system-x86_64 we have a 64-bit target_long, so
the unsigned addition of env->eip and env->segs[R_CS].base
in monitor_get_pc() is done at 64 bits, and that width is
then carried through get_monitor_def() and to the caller.
For qemu-system-i386 we have a 32-bit target_long, so
we do an unsigned 32-bit addition in monitor_get_pc(),
return a signed 32-bit result, and then sign extend that
to 64 bits in get_monitor_def().
thanks
-- PMM
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type
2026-03-24 13:24 ` Peter Maydell
@ 2026-03-24 14:42 ` Markus Armbruster
2026-03-24 18:34 ` Pierrick Bouvier
0 siblings, 1 reply; 21+ messages in thread
From: Markus Armbruster @ 2026-03-24 14:42 UTC (permalink / raw)
To: Peter Maydell
Cc: Philippe Mathieu-Daudé, qemu-devel, Daniel Henrique Barboza,
Paolo Bonzini, Mark Cave-Ayland, Pierrick Bouvier,
Artyom Tarasenko, Dr. David Alan Gilbert, Richard Henderson,
Zhao Liu
Peter Maydell <peter.maydell@linaro.org> writes:
> On Tue, 24 Mar 2026 at 12:57, Markus Armbruster <armbru@redhat.com> wrote:
>>
>> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>>
>> > Simplify MonitorDef::get_value() handler by having it always
>> > return a int64_t type. Truncate to 32-bit in the single caller.
>> >
>> > Note, this handler is only implemented once for the x86 targets.
>
>> > @@ -78,7 +80,8 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
>> > for(; md->name != NULL; md++) {
>> > if (hmp_compare_cmd(name, md->name)) {
>> > if (md->get_value) {
>> > - *pval = md->get_value(mon, md, md->offset);
>> > + int64_t val = md->get_value(mon, md, md->offset);
>> > + *pval = target_long_bits() == 32 ? (int32_t)val : val;
>>
>> This assumes target_long_bits() returns either 32 or 64, doesn't it?
>>
>> Is this true today?
>
> It's certainly true today, and we insist on that: exec/target_long.h
> handles TARGET_LONG_SIZE being 4 or 8 and will #error on anything else.
Good.
> What other values do you expect it could have ?
There might be a need for 128 in the future. Not an easy change to
make.
>> Will it remain true?
>>
>> Could we use something like
>>
>> val & ((1 << target_long_bits()) - 1)
>>
>> to truncate to target_long_bits() bits?
>
> This is UB for the case where target_long_bits returns 64,
> and isn't what the code currently does because it zero
> extends rather than sign extending.
I signalled my cavalier neglect for these details by writing "something
like" ;)
> If we wanted to programmatically sign extend from
> target_long_bits() to the int64_t, that would be
>
> *pval = sextract64(val, 0, target_long_bits());
>
> (Whether sign extension is what we actually want for your
> average register is questionable, but it's what the code
> does now both for the get_value functions and also for the
> generic cases handled by the switch on md->type.)
>
> Incidentally, we currently behave differently here for
> qemu-system-i386 and qemu-system-x86_64:
>
> $ ./build/all/qemu-system-x86_64 -S -monitor stdio -display none
> QEMU 10.2.50 monitor - type 'help' for more information
> (qemu) print $pc
> 0xfffffff0
> (qemu) q
> $ ./build/all/qemu-system-i386 -S -monitor stdio -display none
> QEMU 10.2.50 monitor - type 'help' for more information
> (qemu) print $pc
> 0xfffffffffffffff0
>
> For qemu-system-x86_64 we have a 64-bit target_long, so
> the unsigned addition of env->eip and env->segs[R_CS].base
> in monitor_get_pc() is done at 64 bits, and that width is
> then carried through get_monitor_def() and to the caller.
> For qemu-system-i386 we have a 32-bit target_long, so
> we do an unsigned 32-bit addition in monitor_get_pc(),
> return a signed 32-bit result, and then sign extend that
> to 64 bits in get_monitor_def().
I'm carefully retracing my steps out of this swamp.
Thanks!
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type
2026-03-24 14:42 ` Markus Armbruster
@ 2026-03-24 18:34 ` Pierrick Bouvier
2026-03-25 5:51 ` Markus Armbruster
0 siblings, 1 reply; 21+ messages in thread
From: Pierrick Bouvier @ 2026-03-24 18:34 UTC (permalink / raw)
To: Markus Armbruster, Peter Maydell
Cc: Philippe Mathieu-Daudé, qemu-devel, Daniel Henrique Barboza,
Paolo Bonzini, Mark Cave-Ayland, Artyom Tarasenko,
Dr. David Alan Gilbert, Richard Henderson, Zhao Liu
On 3/24/26 7:42 AM, Markus Armbruster wrote:
> Peter Maydell <peter.maydell@linaro.org> writes:
>
>> On Tue, 24 Mar 2026 at 12:57, Markus Armbruster <armbru@redhat.com> wrote:
>>>
>>> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>>>
>>>> Simplify MonitorDef::get_value() handler by having it always
>>>> return a int64_t type. Truncate to 32-bit in the single caller.
>>>>
>>>> Note, this handler is only implemented once for the x86 targets.
>>
>>>> @@ -78,7 +80,8 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
>>>> for(; md->name != NULL; md++) {
>>>> if (hmp_compare_cmd(name, md->name)) {
>>>> if (md->get_value) {
>>>> - *pval = md->get_value(mon, md, md->offset);
>>>> + int64_t val = md->get_value(mon, md, md->offset);
>>>> + *pval = target_long_bits() == 32 ? (int32_t)val : val;
>>>
>>> This assumes target_long_bits() returns either 32 or 64, doesn't it?
>>>
>>> Is this true today?
>>
>> It's certainly true today, and we insist on that: exec/target_long.h
>> handles TARGET_LONG_SIZE being 4 or 8 and will #error on anything else.
>
> Good.
>
>> What other values do you expect it could have ?
>
> There might be a need for 128 in the future. Not an easy change to
> make.
>
The day this will happen, there will be more places to fix than the
current patch, as it's assumed everywhere else that target_long_bits or
TARGET_LONG_BITS is 32 or 64 only. So I would not worry too much about
it at the moment.
>>> Will it remain true?
>>>
>>> Could we use something like
>>>
>>> val & ((1 << target_long_bits()) - 1)
>>>
>>> to truncate to target_long_bits() bits?
>>
>> This is UB for the case where target_long_bits returns 64,
>> and isn't what the code currently does because it zero
>> extends rather than sign extending.
>
> I signalled my cavalier neglect for these details by writing "something
> like" ;)
>
>> If we wanted to programmatically sign extend from
>> target_long_bits() to the int64_t, that would be
>>
>> *pval = sextract64(val, 0, target_long_bits());
>>
>> (Whether sign extension is what we actually want for your
>> average register is questionable, but it's what the code
>> does now both for the get_value functions and also for the
>> generic cases handled by the switch on md->type.)
>>
>> Incidentally, we currently behave differently here for
>> qemu-system-i386 and qemu-system-x86_64:
>>
>> $ ./build/all/qemu-system-x86_64 -S -monitor stdio -display none
>> QEMU 10.2.50 monitor - type 'help' for more information
>> (qemu) print $pc
>> 0xfffffff0
>> (qemu) q
>> $ ./build/all/qemu-system-i386 -S -monitor stdio -display none
>> QEMU 10.2.50 monitor - type 'help' for more information
>> (qemu) print $pc
>> 0xfffffffffffffff0
>>
>> For qemu-system-x86_64 we have a 64-bit target_long, so
>> the unsigned addition of env->eip and env->segs[R_CS].base
>> in monitor_get_pc() is done at 64 bits, and that width is
>> then carried through get_monitor_def() and to the caller.
>> For qemu-system-i386 we have a 32-bit target_long, so
>> we do an unsigned 32-bit addition in monitor_get_pc(),
>> return a signed 32-bit result, and then sign extend that
>> to 64 bits in get_monitor_def().
>
> I'm carefully retracing my steps out of this swamp.
>
> Thanks!
>
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type
2026-03-24 18:34 ` Pierrick Bouvier
@ 2026-03-25 5:51 ` Markus Armbruster
2026-03-25 17:37 ` Pierrick Bouvier
0 siblings, 1 reply; 21+ messages in thread
From: Markus Armbruster @ 2026-03-25 5:51 UTC (permalink / raw)
To: Pierrick Bouvier
Cc: Peter Maydell, Philippe Mathieu-Daudé, qemu-devel,
Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Artyom Tarasenko, Dr. David Alan Gilbert, Richard Henderson,
Zhao Liu
Pierrick Bouvier <pierrick.bouvier@linaro.org> writes:
> On 3/24/26 7:42 AM, Markus Armbruster wrote:
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>
>>> On Tue, 24 Mar 2026 at 12:57, Markus Armbruster <armbru@redhat.com> wrote:
>>>>
>>>> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>>>>
>>>>> Simplify MonitorDef::get_value() handler by having it always
>>>>> return a int64_t type. Truncate to 32-bit in the single caller.
>>>>>
>>>>> Note, this handler is only implemented once for the x86 targets.
>>>
>>>>> @@ -78,7 +80,8 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
>>>>> for(; md->name != NULL; md++) {
>>>>> if (hmp_compare_cmd(name, md->name)) {
>>>>> if (md->get_value) {
>>>>> - *pval = md->get_value(mon, md, md->offset);
>>>>> + int64_t val = md->get_value(mon, md, md->offset);
>>>>> + *pval = target_long_bits() == 32 ? (int32_t)val : val;
>>>>
>>>> This assumes target_long_bits() returns either 32 or 64, doesn't it?
>>>>
>>>> Is this true today?
>>>
>>> It's certainly true today, and we insist on that: exec/target_long.h
>>> handles TARGET_LONG_SIZE being 4 or 8 and will #error on anything else.
>>
>> Good.
>>
>>> What other values do you expect it could have ?
>>
>> There might be a need for 128 in the future. Not an easy change to
>> make.
>>
>
> The day this will happen, there will be more places to fix than the
> current patch, as it's assumed everywhere else that target_long_bits or
> TARGET_LONG_BITS is 32 or 64 only. So I would not worry too much about
> it at the moment.
Yes, not an easy change to make.
I guess my comment came out of a feeling of unease about
target_long_bits() == 32 ? [32 bit code] : [64 bit code]
I feel there's a bit of friction between abstract requirements and the
concrete software interface. In the abstract, we need to ask a yes/no
question here. The concrete interface provides a function that returns
32/64, which works, but isn't obvious from the type. I guess it's
obvious enough for anybody working in this area of the code.
If truncating to the target's actual width is common, consider providing
function for that.
Feel free to ignore me :)
[...]
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type
2026-03-25 5:51 ` Markus Armbruster
@ 2026-03-25 17:37 ` Pierrick Bouvier
0 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2026-03-25 17:37 UTC (permalink / raw)
To: Markus Armbruster
Cc: Peter Maydell, Philippe Mathieu-Daudé, qemu-devel,
Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Artyom Tarasenko, Dr. David Alan Gilbert, Richard Henderson,
Zhao Liu
On 3/24/26 10:51 PM, Markus Armbruster wrote:
> Pierrick Bouvier <pierrick.bouvier@linaro.org> writes:
>
>> On 3/24/26 7:42 AM, Markus Armbruster wrote:
>>> Peter Maydell <peter.maydell@linaro.org> writes:
>>>
>>>> On Tue, 24 Mar 2026 at 12:57, Markus Armbruster <armbru@redhat.com> wrote:
>>>>>
>>>>> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>>>>>
>>>>>> Simplify MonitorDef::get_value() handler by having it always
>>>>>> return a int64_t type. Truncate to 32-bit in the single caller.
>>>>>>
>>>>>> Note, this handler is only implemented once for the x86 targets.
>>>>
>>>>>> @@ -78,7 +80,8 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
>>>>>> for(; md->name != NULL; md++) {
>>>>>> if (hmp_compare_cmd(name, md->name)) {
>>>>>> if (md->get_value) {
>>>>>> - *pval = md->get_value(mon, md, md->offset);
>>>>>> + int64_t val = md->get_value(mon, md, md->offset);
>>>>>> + *pval = target_long_bits() == 32 ? (int32_t)val : val;
>>>>>
>>>>> This assumes target_long_bits() returns either 32 or 64, doesn't it?
>>>>>
>>>>> Is this true today?
>>>>
>>>> It's certainly true today, and we insist on that: exec/target_long.h
>>>> handles TARGET_LONG_SIZE being 4 or 8 and will #error on anything else.
>>>
>>> Good.
>>>
>>>> What other values do you expect it could have ?
>>>
>>> There might be a need for 128 in the future. Not an easy change to
>>> make.
>>>
>>
>> The day this will happen, there will be more places to fix than the
>> current patch, as it's assumed everywhere else that target_long_bits or
>> TARGET_LONG_BITS is 32 or 64 only. So I would not worry too much about
>> it at the moment.
>
> Yes, not an easy change to make.
>
> I guess my comment came out of a feeling of unease about
>
> target_long_bits() == 32 ? [32 bit code] : [64 bit code]
>
> I feel there's a bit of friction between abstract requirements and the
> concrete software interface. In the abstract, we need to ask a yes/no
> question here. The concrete interface provides a function that returns
> 32/64, which works, but isn't obvious from the type. I guess it's
> obvious enough for anybody working in this area of the code.
>
> If truncating to the target's actual width is common, consider providing
> function for that.
>
I think the initial reason for this to be written this way was to allow
arithmetic expressions (and masks) with this value directly, instead of
having ternary expression everywhere:
TARGET_IS_64_BITS ? _ : _
> Feel free to ignore me :)
>
> [...]
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH-for-11.1 v6 4/6] monitor: Remove last target_long use in get_monitor_def()
2026-03-20 9:10 [PATCH-for-11.1 v6 0/6] monitor/hmp: Reduce target-specific definitions Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2026-03-20 9:10 ` [PATCH-for-11.1 v6 3/6] monitor: Have MonitorDef::get_value() always return int64_t type Philippe Mathieu-Daudé
@ 2026-03-20 9:10 ` Philippe Mathieu-Daudé
2026-03-20 21:45 ` Pierrick Bouvier
2026-03-20 21:51 ` Pierrick Bouvier
2026-03-20 9:10 ` [PATCH-for-11.1 v6 5/6] monitor: Reduce target-specific methods further Philippe Mathieu-Daudé
2026-03-20 9:10 ` [PATCH-for-11.1 v6 6/6] monitor: Remove 'monitor/hmp-target.h' header Philippe Mathieu-Daudé
5 siblings, 2 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-03-20 9:10 UTC (permalink / raw)
To: qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Pierrick Bouvier, Artyom Tarasenko, Dr. David Alan Gilbert,
Richard Henderson, Markus Armbruster, Philippe Mathieu-Daudé
Truncate manually, removing the need of target-specific
code in get_monitor_def().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
monitor/hmp-target.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c
index 155caedd784..5e9f1b0db5b 100644
--- a/monitor/hmp-target.c
+++ b/monitor/hmp-target.c
@@ -34,7 +34,6 @@
#include "qapi/qapi-commands-control.h"
#include "qapi/qapi-commands-misc.h"
#include "qapi/qapi-commands-machine.h"
-#include "exec/target_long.h"
#if defined(TARGET_S390X)
#include "hw/s390x/storage-keys.h"
@@ -93,7 +92,7 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
ret = target_get_monitor_def(cs, name, &tmp);
if (!ret) {
- *pval = (target_long) tmp;
+ *pval = target_long_bits() == 32 ? (int32_t)tmp : tmp;
}
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 4/6] monitor: Remove last target_long use in get_monitor_def()
2026-03-20 9:10 ` [PATCH-for-11.1 v6 4/6] monitor: Remove last target_long use in get_monitor_def() Philippe Mathieu-Daudé
@ 2026-03-20 21:45 ` Pierrick Bouvier
2026-03-20 21:51 ` Pierrick Bouvier
1 sibling, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2026-03-20 21:45 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Artyom Tarasenko, Dr. David Alan Gilbert, Richard Henderson,
Markus Armbruster
On 3/20/26 2:10 AM, Philippe Mathieu-Daudé wrote:
> Truncate manually, removing the need of target-specific
> code in get_monitor_def().
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> monitor/hmp-target.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH-for-11.1 v6 4/6] monitor: Remove last target_long use in get_monitor_def()
2026-03-20 9:10 ` [PATCH-for-11.1 v6 4/6] monitor: Remove last target_long use in get_monitor_def() Philippe Mathieu-Daudé
2026-03-20 21:45 ` Pierrick Bouvier
@ 2026-03-20 21:51 ` Pierrick Bouvier
1 sibling, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2026-03-20 21:51 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Artyom Tarasenko, Dr. David Alan Gilbert, Richard Henderson,
Markus Armbruster
On 3/20/26 2:10 AM, Philippe Mathieu-Daudé wrote:
> Truncate manually, removing the need of target-specific
> code in get_monitor_def().
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> monitor/hmp-target.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c
> index 155caedd784..5e9f1b0db5b 100644
> --- a/monitor/hmp-target.c
> +++ b/monitor/hmp-target.c
> @@ -34,7 +34,6 @@
> #include "qapi/qapi-commands-control.h"
> #include "qapi/qapi-commands-misc.h"
> #include "qapi/qapi-commands-machine.h"
> -#include "exec/target_long.h"
>
> #if defined(TARGET_S390X)
> #include "hw/s390x/storage-keys.h"
> @@ -93,7 +92,7 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
>
> ret = target_get_monitor_def(cs, name, &tmp);
> if (!ret) {
> - *pval = (target_long) tmp;
> + *pval = target_long_bits() == 32 ? (int32_t)tmp : tmp;
> }
>
> return ret;
Looking a second time at it, I don't think you need it. Same in previous
commit.
Since pval is a pointer to a (signed) int64, sign will be extended from
32 bit value automatically. So either, it's a positive value, and will
be treated as it is. Or it's a negative value, and all upper bits will
be set to 1.
So the casting in int32_t has no effect, since it will be extended again
automatically.
Regards,
Pierrick
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH-for-11.1 v6 5/6] monitor: Reduce target-specific methods further
2026-03-20 9:10 [PATCH-for-11.1 v6 0/6] monitor/hmp: Reduce target-specific definitions Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2026-03-20 9:10 ` [PATCH-for-11.1 v6 4/6] monitor: Remove last target_long use in get_monitor_def() Philippe Mathieu-Daudé
@ 2026-03-20 9:10 ` Philippe Mathieu-Daudé
2026-03-20 21:52 ` Pierrick Bouvier
2026-03-20 9:10 ` [PATCH-for-11.1 v6 6/6] monitor: Remove 'monitor/hmp-target.h' header Philippe Mathieu-Daudé
5 siblings, 1 reply; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-03-20 9:10 UTC (permalink / raw)
To: qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Pierrick Bouvier, Artyom Tarasenko, Dr. David Alan Gilbert,
Richard Henderson, Markus Armbruster, Philippe Mathieu-Daudé
get_monitor_def() doesn't use any target-specific declaration
anymore, move it to hmp.c to compile it once.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
---
monitor/monitor-internal.h | 1 -
monitor/hmp-target.c | 39 -------------------------------------
monitor/hmp.c | 40 ++++++++++++++++++++++++++++++++++++++
3 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h
index feca111ae31..3ecd394ecf6 100644
--- a/monitor/monitor-internal.h
+++ b/monitor/monitor-internal.h
@@ -181,7 +181,6 @@ void monitor_data_destroy_qmp(MonitorQMP *mon);
void coroutine_fn monitor_qmp_dispatcher_co(void *data);
void qmp_dispatcher_co_wake(void);
-int get_monitor_def(Monitor *mon, int64_t *pval, const char *name);
void handle_hmp_command(MonitorHMP *mon, const char *cmdline);
int hmp_compare_cmd(const char *name, const char *list);
diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c
index 5e9f1b0db5b..a3306b69c93 100644
--- a/monitor/hmp-target.c
+++ b/monitor/hmp-target.c
@@ -23,7 +23,6 @@
*/
#include "qemu/osdep.h"
-#include "qemu/target-info.h"
#include "monitor-internal.h"
#include "monitor/qdev.h"
#include "net/slirp.h"
@@ -60,44 +59,6 @@ HMPCommand *hmp_cmds_for_target(bool info_command)
return info_command ? hmp_info_cmds : hmp_cmds;
}
-/*
- * Set @pval to the value in the register identified by @name.
- * return 0 if OK, -1 if not found
- */
-int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
-{
- const MonitorDef *md = target_monitor_defs();
- CPUState *cs = mon_get_cpu(mon);
- void *ptr;
- uint64_t tmp = 0;
- int ret;
-
- if (cs == NULL || md == NULL) {
- return -1;
- }
-
- for(; md->name != NULL; md++) {
- if (hmp_compare_cmd(name, md->name)) {
- if (md->get_value) {
- int64_t val = md->get_value(mon, md, md->offset);
- *pval = target_long_bits() == 32 ? (int32_t)val : val;
- } else {
- CPUArchState *env = mon_get_cpu_env(mon);
- ptr = (uint8_t *)env + md->offset;
- *pval = *(int32_t *)ptr;
- }
- return 0;
- }
- }
-
- ret = target_get_monitor_def(cs, name, &tmp);
- if (!ret) {
- *pval = target_long_bits() == 32 ? (int32_t)tmp : tmp;
- }
-
- return ret;
-}
-
static int
compare_mon_cmd(const void *a, const void *b)
{
diff --git a/monitor/hmp.c b/monitor/hmp.c
index 0e5913fabb1..1d645090667 100644
--- a/monitor/hmp.c
+++ b/monitor/hmp.c
@@ -355,6 +355,8 @@ static bool gdb_get_register(Monitor *mon, int64_t *pval, const char *name)
static const char *pch;
static sigjmp_buf expr_env;
+static int get_monitor_def(Monitor *mon, int64_t *pval, const char *name);
+
static G_NORETURN G_GNUC_PRINTF(2, 3)
void expr_error(Monitor *mon, const char *fmt, ...)
{
@@ -1595,3 +1597,41 @@ void monitor_register_hmp_info_hrt(const char *name,
}
g_assert_not_reached();
}
+
+/*
+ * Set @pval to the value in the register identified by @name.
+ * return 0 if OK, -1 if not found
+ */
+int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)
+{
+ const MonitorDef *md = target_monitor_defs();
+ CPUState *cs = mon_get_cpu(mon);
+ void *ptr;
+ uint64_t tmp = 0;
+ int ret;
+
+ if (cs == NULL || md == NULL) {
+ return -1;
+ }
+
+ for(; md->name != NULL; md++) {
+ if (hmp_compare_cmd(name, md->name)) {
+ if (md->get_value) {
+ int64_t val = md->get_value(mon, md, md->offset);
+ *pval = target_long_bits() == 32 ? (int32_t)val : val;
+ } else {
+ CPUArchState *env = mon_get_cpu_env(mon);
+ ptr = (uint8_t *)env + md->offset;
+ *pval = *(int32_t *)ptr;
+ }
+ return 0;
+ }
+ }
+
+ ret = target_get_monitor_def(cs, name, &tmp);
+ if (!ret) {
+ *pval = target_long_bits() == 32 ? (int32_t)tmp : tmp;
+ }
+
+ return ret;
+}
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 5/6] monitor: Reduce target-specific methods further
2026-03-20 9:10 ` [PATCH-for-11.1 v6 5/6] monitor: Reduce target-specific methods further Philippe Mathieu-Daudé
@ 2026-03-20 21:52 ` Pierrick Bouvier
0 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2026-03-20 21:52 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Artyom Tarasenko, Dr. David Alan Gilbert, Richard Henderson,
Markus Armbruster
On 3/20/26 2:10 AM, Philippe Mathieu-Daudé wrote:
> get_monitor_def() doesn't use any target-specific declaration
> anymore, move it to hmp.c to compile it once.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
> ---
> monitor/monitor-internal.h | 1 -
> monitor/hmp-target.c | 39 -------------------------------------
> monitor/hmp.c | 40 ++++++++++++++++++++++++++++++++++++++
> 3 files changed, 40 insertions(+), 40 deletions(-)
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH-for-11.1 v6 6/6] monitor: Remove 'monitor/hmp-target.h' header
2026-03-20 9:10 [PATCH-for-11.1 v6 0/6] monitor/hmp: Reduce target-specific definitions Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2026-03-20 9:10 ` [PATCH-for-11.1 v6 5/6] monitor: Reduce target-specific methods further Philippe Mathieu-Daudé
@ 2026-03-20 9:10 ` Philippe Mathieu-Daudé
2026-03-20 21:52 ` Pierrick Bouvier
5 siblings, 1 reply; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-03-20 9:10 UTC (permalink / raw)
To: qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Pierrick Bouvier, Artyom Tarasenko, Dr. David Alan Gilbert,
Richard Henderson, Markus Armbruster, Philippe Mathieu-Daudé,
Michael S. Tsirkin, Marcel Apfelbaum, Zhao Liu, Marcelo Tosatti,
Laurent Vivier, Nicholas Piggin, Chinmay Rath, Glenn Miles,
Palmer Dabbelt, Alistair Francis, Weiwei Li, Liu Zhiwei,
Yoshinori Sato, Max Filippov, kvm, qemu-ppc, qemu-riscv
The "monitor/hmp-target.h" header doesn't contain any
target-specific declarations anymore. Merge it with
"monitor/hmp.h", its target-agnostic counterpart.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
---
MAINTAINERS | 2 +-
include/monitor/hmp-target.h | 42 -----------------------------------
include/monitor/hmp.h | 12 ++++++++++
hw/i386/sgx-stub.c | 1 -
hw/i386/sgx.c | 1 -
monitor/hmp-cmds.c | 1 -
monitor/hmp-target.c | 1 -
monitor/hmp.c | 1 -
stubs/target-monitor-defs.c | 2 +-
target/i386/cpu-apic.c | 1 -
target/i386/monitor.c | 1 -
target/i386/sev-system-stub.c | 1 -
target/i386/sev.c | 1 -
target/m68k/monitor.c | 1 -
target/ppc/monitor.c | 2 --
target/riscv/monitor.c | 1 -
target/sh4/monitor.c | 1 -
target/sparc/monitor.c | 1 -
target/xtensa/monitor.c | 1 -
19 files changed, 14 insertions(+), 60 deletions(-)
delete mode 100644 include/monitor/hmp-target.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 97f2759138d..d4b4aca60a7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3407,7 +3407,7 @@ F: monitor/monitor.c
F: monitor/hmp*
F: hmp.h
F: hmp-commands*.hx
-F: include/monitor/hmp-target.h
+F: include/monitor/hmp.h
F: tests/qtest/test-hmp.c
F: include/qemu/qemu-print.h
F: util/qemu-print.c
diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h
deleted file mode 100644
index 6364c94edf8..00000000000
--- a/include/monitor/hmp-target.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * QEMU monitor
- *
- * Copyright (c) 2003-2004 Fabrice Bellard
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef MONITOR_HMP_TARGET_H
-#define MONITOR_HMP_TARGET_H
-
-typedef struct MonitorDef MonitorDef;
-
-struct MonitorDef {
- const char *name;
- int offset;
- int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int offset);
-};
-
-const MonitorDef *target_monitor_defs(void);
-int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval);
-
-CPUArchState *mon_get_cpu_env(Monitor *mon);
-CPUState *mon_get_cpu(Monitor *mon);
-
-#endif /* MONITOR_HMP_TARGET_H */
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index e222bea60cd..26571d35e84 100644
--- a/include/monitor/hmp.h
+++ b/include/monitor/hmp.h
@@ -17,6 +17,18 @@
#include "qemu/readline.h"
#include "qapi/qapi-types-common.h"
+typedef struct MonitorDef {
+ const char *name;
+ int offset;
+ int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int offset);
+} MonitorDef;
+
+const MonitorDef *target_monitor_defs(void);
+int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval);
+
+CPUArchState *mon_get_cpu_env(Monitor *mon);
+CPUState *mon_get_cpu(Monitor *mon);
+
bool hmp_handle_error(Monitor *mon, Error *err);
void hmp_help_cmd(Monitor *mon, const char *name);
strList *hmp_split_at_comma(const char *str);
diff --git a/hw/i386/sgx-stub.c b/hw/i386/sgx-stub.c
index 1dd8d9afbfa..6e82773a86d 100644
--- a/hw/i386/sgx-stub.c
+++ b/hw/i386/sgx-stub.c
@@ -1,7 +1,6 @@
#include "qemu/osdep.h"
#include "monitor/monitor.h"
#include "monitor/hmp.h"
-#include "monitor/hmp-target.h"
#include "hw/i386/pc.h"
#include "hw/i386/sgx-epc.h"
#include "qapi/qapi-commands-misc-i386.h"
diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c
index 5e792e8e6e9..7e4c509f5a4 100644
--- a/hw/i386/sgx.c
+++ b/hw/i386/sgx.c
@@ -17,7 +17,6 @@
#include "monitor/qdev.h"
#include "monitor/monitor.h"
#include "monitor/hmp.h"
-#include "monitor/hmp-target.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qapi/qapi-commands-misc-i386.h"
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index bad034937a9..a85c5243a40 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -22,7 +22,6 @@
#include "monitor/hmp.h"
#include "qemu/help_option.h"
#include "monitor/hmp.h"
-#include "monitor/hmp-target.h"
#include "monitor/monitor-internal.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-control.h"
diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c
index a3306b69c93..2574c5d8b4b 100644
--- a/monitor/hmp-target.c
+++ b/monitor/hmp-target.c
@@ -27,7 +27,6 @@
#include "monitor/qdev.h"
#include "net/slirp.h"
#include "system/device_tree.h"
-#include "monitor/hmp-target.h"
#include "monitor/hmp.h"
#include "block/block-hmp-cmds.h"
#include "qapi/qapi-commands-control.h"
diff --git a/monitor/hmp.c b/monitor/hmp.c
index 1d645090667..c63da13e310 100644
--- a/monitor/hmp.c
+++ b/monitor/hmp.c
@@ -27,7 +27,6 @@
#include "hw/core/qdev.h"
#include "monitor-internal.h"
#include "monitor/hmp.h"
-#include "monitor/hmp-target.h"
#include "qobject/qdict.h"
#include "qobject/qnum.h"
#include "qemu/bswap.h"
diff --git a/stubs/target-monitor-defs.c b/stubs/target-monitor-defs.c
index 35a0a342772..0dd4cdb34f6 100644
--- a/stubs/target-monitor-defs.c
+++ b/stubs/target-monitor-defs.c
@@ -1,5 +1,5 @@
#include "qemu/osdep.h"
-#include "monitor/hmp-target.h"
+#include "monitor/hmp.h"
const MonitorDef *target_monitor_defs(void)
{
diff --git a/target/i386/cpu-apic.c b/target/i386/cpu-apic.c
index eaa10ad2a3d..5599a4675c5 100644
--- a/target/i386/cpu-apic.c
+++ b/target/i386/cpu-apic.c
@@ -11,7 +11,6 @@
#include "qapi/error.h"
#include "monitor/monitor.h"
#include "monitor/hmp.h"
-#include "monitor/hmp-target.h"
#include "system/hw_accel.h"
#include "system/kvm.h"
#include "system/xen.h"
diff --git a/target/i386/monitor.c b/target/i386/monitor.c
index b128334e571..ddc666d3451 100644
--- a/target/i386/monitor.c
+++ b/target/i386/monitor.c
@@ -25,7 +25,6 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "monitor/monitor.h"
-#include "monitor/hmp-target.h"
#include "monitor/hmp.h"
#include "qobject/qdict.h"
#include "qapi/error.h"
diff --git a/target/i386/sev-system-stub.c b/target/i386/sev-system-stub.c
index fb84aee94d2..f799a338d60 100644
--- a/target/i386/sev-system-stub.c
+++ b/target/i386/sev-system-stub.c
@@ -14,7 +14,6 @@
#include "qemu/osdep.h"
#include "monitor/monitor.h"
#include "monitor/hmp.h"
-#include "monitor/hmp-target.h"
#include "qapi/error.h"
#include "sev.h"
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 9dde972c118..97e745f27c4 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -39,7 +39,6 @@
#include "qom/object.h"
#include "monitor/monitor.h"
#include "monitor/hmp.h"
-#include "monitor/hmp-target.h"
#include "qapi/qapi-commands-misc-i386.h"
#include "confidential-guest.h"
#include "hw/i386/pc.h"
diff --git a/target/m68k/monitor.c b/target/m68k/monitor.c
index 94bb12833af..be7411edca6 100644
--- a/target/m68k/monitor.c
+++ b/target/m68k/monitor.c
@@ -8,7 +8,6 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "monitor/hmp.h"
-#include "monitor/hmp-target.h"
#include "monitor/monitor.h"
void hmp_info_tlb(Monitor *mon, const QDict *qdict)
diff --git a/target/ppc/monitor.c b/target/ppc/monitor.c
index 776a76602ea..7c88e0e2bda 100644
--- a/target/ppc/monitor.c
+++ b/target/ppc/monitor.c
@@ -7,9 +7,7 @@
*/
#include "qemu/osdep.h"
-#include "qemu/ctype.h"
#include "monitor/monitor.h"
-#include "monitor/hmp-target.h"
#include "monitor/hmp.h"
#include "cpu.h"
diff --git a/target/riscv/monitor.c b/target/riscv/monitor.c
index a9d31114442..3f206b9fca5 100644
--- a/target/riscv/monitor.c
+++ b/target/riscv/monitor.c
@@ -25,7 +25,6 @@
#include "cpu_bits.h"
#include "monitor/monitor.h"
#include "monitor/hmp.h"
-#include "monitor/hmp-target.h"
#include "system/memory.h"
#ifdef TARGET_RISCV64
diff --git a/target/sh4/monitor.c b/target/sh4/monitor.c
index 2da6a5426eb..50324d3600c 100644
--- a/target/sh4/monitor.c
+++ b/target/sh4/monitor.c
@@ -24,7 +24,6 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "monitor/monitor.h"
-#include "monitor/hmp-target.h"
#include "monitor/hmp.h"
static void print_tlb(Monitor *mon, int idx, tlb_t *tlb)
diff --git a/target/sparc/monitor.c b/target/sparc/monitor.c
index a60671a60a4..99abddbf1e0 100644
--- a/target/sparc/monitor.c
+++ b/target/sparc/monitor.c
@@ -24,7 +24,6 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "monitor/monitor.h"
-#include "monitor/hmp-target.h"
#include "monitor/hmp.h"
diff --git a/target/xtensa/monitor.c b/target/xtensa/monitor.c
index fbf60d55530..2af84934f83 100644
--- a/target/xtensa/monitor.c
+++ b/target/xtensa/monitor.c
@@ -24,7 +24,6 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "monitor/monitor.h"
-#include "monitor/hmp-target.h"
#include "monitor/hmp.h"
void hmp_info_tlb(Monitor *mon, const QDict *qdict)
--
2.53.0
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH-for-11.1 v6 6/6] monitor: Remove 'monitor/hmp-target.h' header
2026-03-20 9:10 ` [PATCH-for-11.1 v6 6/6] monitor: Remove 'monitor/hmp-target.h' header Philippe Mathieu-Daudé
@ 2026-03-20 21:52 ` Pierrick Bouvier
0 siblings, 0 replies; 21+ messages in thread
From: Pierrick Bouvier @ 2026-03-20 21:52 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Daniel Henrique Barboza, Paolo Bonzini, Mark Cave-Ayland,
Artyom Tarasenko, Dr. David Alan Gilbert, Richard Henderson,
Markus Armbruster, Michael S. Tsirkin, Marcel Apfelbaum, Zhao Liu,
Marcelo Tosatti, Laurent Vivier, Nicholas Piggin, Chinmay Rath,
Glenn Miles, Palmer Dabbelt, Alistair Francis, Weiwei Li,
Liu Zhiwei, Yoshinori Sato, Max Filippov, kvm, qemu-ppc,
qemu-riscv
On 3/20/26 2:10 AM, Philippe Mathieu-Daudé wrote:
> The "monitor/hmp-target.h" header doesn't contain any
> target-specific declarations anymore. Merge it with
> "monitor/hmp.h", its target-agnostic counterpart.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
> ---
> MAINTAINERS | 2 +-
> include/monitor/hmp-target.h | 42 -----------------------------------
> include/monitor/hmp.h | 12 ++++++++++
> hw/i386/sgx-stub.c | 1 -
> hw/i386/sgx.c | 1 -
> monitor/hmp-cmds.c | 1 -
> monitor/hmp-target.c | 1 -
> monitor/hmp.c | 1 -
> stubs/target-monitor-defs.c | 2 +-
> target/i386/cpu-apic.c | 1 -
> target/i386/monitor.c | 1 -
> target/i386/sev-system-stub.c | 1 -
> target/i386/sev.c | 1 -
> target/m68k/monitor.c | 1 -
> target/ppc/monitor.c | 2 --
> target/riscv/monitor.c | 1 -
> target/sh4/monitor.c | 1 -
> target/sparc/monitor.c | 1 -
> target/xtensa/monitor.c | 1 -
> 19 files changed, 14 insertions(+), 60 deletions(-)
> delete mode 100644 include/monitor/hmp-target.h
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 21+ messages in thread