* [PATCH-for-11.0?] target/i386: Mandate monitor 'info lapic' take a vCPU ID argument
@ 2026-04-13 13:07 Philippe Mathieu-Daudé
2026-04-13 13:19 ` Daniel P. Berrangé
2026-04-13 13:59 ` Peter Maydell
0 siblings, 2 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-04-13 13:07 UTC (permalink / raw)
To: qemu-devel
Cc: devel, Pierrick Bouvier, Zhao Liu, Dr. David Alan Gilbert,
Markus Armbruster, Paolo Bonzini, Philippe Mathieu-Daudé
With SMP configurations, using the 'current vCPU' under the
monitor isn't recommended, as it changes during runtime. Better
to specify which vCPU we want to monitor by its index. Deprecate
the default of 'info lapic', mentioning an argument is expected,
so we can remove this unpredictable behavior one day.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
The other command with this unpredictable behavior is 'info tlb'
which we'll deal with differently, after the v11.0 release.
---
docs/about/deprecated.rst | 6 ++++++
target/i386/cpu-apic.c | 2 ++
hmp-commands-info.hx | 3 +--
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index a6d6a713265..a62da93259a 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -169,6 +169,12 @@ The ``stopcapture`` command is deprecated and will be removed in a future releas
The ``info capture`` command is deprecated and will be removed in a future release.
+``info lapic`` without ``apic-id`` argument (since 11.0)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+When no APIC ID is provided, ``info lapic`` defaults to the current vCPU.
+This behavior is now deprecated, the ID will be mandatory in a future release.
+
Host Architectures
------------------
diff --git a/target/i386/cpu-apic.c b/target/i386/cpu-apic.c
index eaa10ad2a3d..9ca569f62b8 100644
--- a/target/i386/cpu-apic.c
+++ b/target/i386/cpu-apic.c
@@ -97,6 +97,8 @@ void hmp_info_local_apic(Monitor *mon, const QDict *qdict)
cpu_synchronize_state(cs);
}
} else {
+ monitor_printf(mon, "Not specifying the local apic id is deprecated"
+ " (using the current CPU one)\n");
cs = mon_get_cpu(mon);
}
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index 74c741f80e2..e4206d329fc 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -118,8 +118,7 @@ ERST
.name = "lapic",
.args_type = "apic-id:i?",
.params = "[apic-id]",
- .help = "show local apic state (apic-id: local apic to read, default is which of current CPU)",
-
+ .help = "show local apic state (apic-id: local apic to read)",
.cmd = hmp_info_local_apic,
},
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH-for-11.0?] target/i386: Mandate monitor 'info lapic' take a vCPU ID argument
2026-04-13 13:07 [PATCH-for-11.0?] target/i386: Mandate monitor 'info lapic' take a vCPU ID argument Philippe Mathieu-Daudé
@ 2026-04-13 13:19 ` Daniel P. Berrangé
2026-04-13 22:09 ` Philippe Mathieu-Daudé
2026-04-13 13:59 ` Peter Maydell
1 sibling, 1 reply; 4+ messages in thread
From: Daniel P. Berrangé @ 2026-04-13 13:19 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, devel, Pierrick Bouvier, Zhao Liu,
Dr. David Alan Gilbert, Markus Armbruster, Paolo Bonzini
On Mon, Apr 13, 2026 at 03:07:48PM +0200, Philippe Mathieu-Daudé wrote:
> With SMP configurations, using the 'current vCPU' under the
> monitor isn't recommended, as it changes during runtime. Better
> to specify which vCPU we want to monitor by its index. Deprecate
> the default of 'info lapic', mentioning an argument is expected,
> so we can remove this unpredictable behavior one day.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> The other command with this unpredictable behavior is 'info tlb'
> which we'll deal with differently, after the v11.0 release.
Aren't there quite a few more commands that rely on the HMP
"current" vCPU concept besides these two ?
info registers comes to mind,
There are others whic call mon_get_cpu(), which are not
directly caring about a specific CPU, eg 'info mem',
'memory_dump'
Why the rush to get lapic deprecated in 11.0 but not the
otherrs ?
> ---
> docs/about/deprecated.rst | 6 ++++++
> target/i386/cpu-apic.c | 2 ++
> hmp-commands-info.hx | 3 +--
> 3 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
> index a6d6a713265..a62da93259a 100644
> --- a/docs/about/deprecated.rst
> +++ b/docs/about/deprecated.rst
> @@ -169,6 +169,12 @@ The ``stopcapture`` command is deprecated and will be removed in a future releas
>
> The ``info capture`` command is deprecated and will be removed in a future release.
>
> +``info lapic`` without ``apic-id`` argument (since 11.0)
> +''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> +
> +When no APIC ID is provided, ``info lapic`` defaults to the current vCPU.
> +This behavior is now deprecated, the ID will be mandatory in a future release.
> +
> Host Architectures
> ------------------
>
> diff --git a/target/i386/cpu-apic.c b/target/i386/cpu-apic.c
> index eaa10ad2a3d..9ca569f62b8 100644
> --- a/target/i386/cpu-apic.c
> +++ b/target/i386/cpu-apic.c
> @@ -97,6 +97,8 @@ void hmp_info_local_apic(Monitor *mon, const QDict *qdict)
> cpu_synchronize_state(cs);
> }
> } else {
> + monitor_printf(mon, "Not specifying the local apic id is deprecated"
> + " (using the current CPU one)\n");
> cs = mon_get_cpu(mon);
> }
>
> diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
> index 74c741f80e2..e4206d329fc 100644
> --- a/hmp-commands-info.hx
> +++ b/hmp-commands-info.hx
> @@ -118,8 +118,7 @@ ERST
> .name = "lapic",
> .args_type = "apic-id:i?",
> .params = "[apic-id]",
> - .help = "show local apic state (apic-id: local apic to read, default is which of current CPU)",
> -
> + .help = "show local apic state (apic-id: local apic to read)",
> .cmd = hmp_info_local_apic,
> },
> #endif
> --
> 2.53.0
>
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH-for-11.0?] target/i386: Mandate monitor 'info lapic' take a vCPU ID argument
2026-04-13 13:19 ` Daniel P. Berrangé
@ 2026-04-13 22:09 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-04-13 22:09 UTC (permalink / raw)
To: Daniel P. Berrangé
Cc: qemu-devel, devel, Pierrick Bouvier, Zhao Liu,
Dr. David Alan Gilbert, Markus Armbruster, Paolo Bonzini
On 13/4/26 15:19, Daniel P. Berrangé wrote:
> On Mon, Apr 13, 2026 at 03:07:48PM +0200, Philippe Mathieu-Daudé wrote:
>> With SMP configurations, using the 'current vCPU' under the
>> monitor isn't recommended, as it changes during runtime. Better
>> to specify which vCPU we want to monitor by its index. Deprecate
>> the default of 'info lapic', mentioning an argument is expected,
>> so we can remove this unpredictable behavior one day.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> The other command with this unpredictable behavior is 'info tlb'
>> which we'll deal with differently, after the v11.0 release.
>
> Aren't there quite a few more commands that rely on the HMP
> "current" vCPU concept besides these two ?
>
> info registers comes to mind,
>
> There are others whic call mon_get_cpu(), which are not
> directly caring about a specific CPU, eg 'info mem',
> 'memory_dump'
>
> Why the rush to get lapic deprecated in 11.0 but not the
> otherrs ?
Reading the "Arm OABI and NWFPE" deprecation patch triggered
"oh it is still possible to get deprecation message merged"
and I took that first patch of a bigger branch. Not a smart
move because no rush indeed.
>> ---
>> docs/about/deprecated.rst | 6 ++++++
>> target/i386/cpu-apic.c | 2 ++
>> hmp-commands-info.hx | 3 +--
>> 3 files changed, 9 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH-for-11.0?] target/i386: Mandate monitor 'info lapic' take a vCPU ID argument
2026-04-13 13:07 [PATCH-for-11.0?] target/i386: Mandate monitor 'info lapic' take a vCPU ID argument Philippe Mathieu-Daudé
2026-04-13 13:19 ` Daniel P. Berrangé
@ 2026-04-13 13:59 ` Peter Maydell
1 sibling, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2026-04-13 13:59 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, devel, Pierrick Bouvier, Zhao Liu,
Dr. David Alan Gilbert, Markus Armbruster, Paolo Bonzini
On Mon, 13 Apr 2026 at 14:08, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> With SMP configurations, using the 'current vCPU' under the
> monitor isn't recommended, as it changes during runtime. Better
> to specify which vCPU we want to monitor by its index. Deprecate
> the default of 'info lapic', mentioning an argument is expected,
> so we can remove this unpredictable behavior one day.
Is this really "unpredictable" ? This isn't the "current CPU" in
the sense of "whatever is currently running", it's the "current CPU"
in the sense of "whatever the user has set via the 'cpu' HMP command".
You can certainly argue that a UI where you set the CPU via one
command and then that's an implicit argument to various other
commands is not ideal, but it's not unpredictable. The
only time the CPU will change without user interaction is if
they have set the monitor's current-CPU to one that is hot-unplugged
(in which case it will reset to the first CPU), but the user is
also likely to be in control of hot-unplug events anyway.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-04-13 22:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-13 13:07 [PATCH-for-11.0?] target/i386: Mandate monitor 'info lapic' take a vCPU ID argument Philippe Mathieu-Daudé
2026-04-13 13:19 ` Daniel P. Berrangé
2026-04-13 22:09 ` Philippe Mathieu-Daudé
2026-04-13 13:59 ` Peter Maydell
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.