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é <[email protected]>
> ---
> 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 :|