[PATCH v3 0/2] hw/nvme: HMP commands for inspecting emulated controllers

Mateusz Nowicki posted 2 patches 1 month, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260522102821.16766-1-mateusz.nowicki@posteo.net
Maintainers: "Dr. David Alan Gilbert" <dave@treblig.org>, Keith Busch <kbusch@kernel.org>, Klaus Jensen <its@irrelevant.dk>, Jesper Devantier <foss@defmacro.it>, "Philippe Mathieu-Daudé" <philmd@mailo.com>, Zhao Liu <zhao1.liu@intel.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
hmp-commands-info.hx |  28 +++++++++
hw/nvme/meson.build  |   2 +-
hw/nvme/monitor.c    | 139 +++++++++++++++++++++++++++++++++++++++++++
qapi/machine.json    |  34 +++++++++++
4 files changed, 202 insertions(+), 1 deletion(-)
create mode 100644 hw/nvme/monitor.c
[PATCH v3 0/2] hw/nvme: HMP commands for inspecting emulated controllers
Posted by Mateusz Nowicki 1 month, 3 weeks ago
Add two HMP commands for inspecting emulated NVMe controllers from
the QEMU monitor without attaching gdb to the QEMU process:

  - 'info nvme'        - per-controller summary (PCI, identify
                         fields, CC/CSTS/AQA, queue counts)
  - 'info nvme-queues' - per-queue listing of admin and I/O SQ/CQ
                         (size, head/tail, PRP1, doorbell offset,
                         phase tag)

Useful for verifying queue setup, doorbell rings, AERs held in the
admin SQ and similar driver/controller interaction details from a
running QEMU monitor.

Changes in v3:
  - Iterate on n->conf_ioqpairs instead of n->params.max_ioqpairs so
    the listing reflects what the guest driver actually sees,
    including SR-IOV VFs where conf_ioqpairs is the negotiated subset
    (not max).  Same fix in both patches.  (Klaus)

Changes in v2:
  - hw/nvme/meson.build: add the missing trailing newline (Markus).
  - Pick up Acked-by tags from Dr. David Alan Gilbert and Markus
    Armbruster on both patches.

v2: https://lore.kernel.org/qemu-devel/cover.1778694320.git.mateusz.nowicki@posteo.net/
v1: https://lore.kernel.org/qemu-devel/cover.1778409416.git.mateusz.nowicki@posteo.net/

Mateusz Nowicki (2):
  hw/nvme: add 'info nvme' HMP command
  hw/nvme: add 'info nvme-queues' HMP command

 hmp-commands-info.hx |  28 +++++++++
 hw/nvme/meson.build  |   2 +-
 hw/nvme/monitor.c    | 139 +++++++++++++++++++++++++++++++++++++++++++
 qapi/machine.json    |  34 +++++++++++
 4 files changed, 202 insertions(+), 1 deletion(-)
 create mode 100644 hw/nvme/monitor.c

-- 
2.53.0
Re: [PATCH v3 0/2] hw/nvme: HMP commands for inspecting emulated controllers
Posted by Klaus Jensen 3 weeks, 2 days ago
On May 22 10:29, Mateusz Nowicki wrote:
> Add two HMP commands for inspecting emulated NVMe controllers from
> the QEMU monitor without attaching gdb to the QEMU process:
> 
>   - 'info nvme'        - per-controller summary (PCI, identify
>                          fields, CC/CSTS/AQA, queue counts)
>   - 'info nvme-queues' - per-queue listing of admin and I/O SQ/CQ
>                          (size, head/tail, PRP1, doorbell offset,
>                          phase tag)
> 
> Useful for verifying queue setup, doorbell rings, AERs held in the
> admin SQ and similar driver/controller interaction details from a
> running QEMU monitor.
> 
> Changes in v3:
>   - Iterate on n->conf_ioqpairs instead of n->params.max_ioqpairs so
>     the listing reflects what the guest driver actually sees,
>     including SR-IOV VFs where conf_ioqpairs is the negotiated subset
>     (not max).  Same fix in both patches.  (Klaus)
> 
> Changes in v2:
>   - hw/nvme/meson.build: add the missing trailing newline (Markus).
>   - Pick up Acked-by tags from Dr. David Alan Gilbert and Markus
>     Armbruster on both patches.
> 
> v2: https://lore.kernel.org/qemu-devel/cover.1778694320.git.mateusz.nowicki@posteo.net/
> v1: https://lore.kernel.org/qemu-devel/cover.1778409416.git.mateusz.nowicki@posteo.net/
> 
> Mateusz Nowicki (2):
>   hw/nvme: add 'info nvme' HMP command
>   hw/nvme: add 'info nvme-queues' HMP command
> 
>  hmp-commands-info.hx |  28 +++++++++
>  hw/nvme/meson.build  |   2 +-
>  hw/nvme/monitor.c    | 139 +++++++++++++++++++++++++++++++++++++++++++
>  qapi/machine.json    |  34 +++++++++++
>  4 files changed, 202 insertions(+), 1 deletion(-)
>  create mode 100644 hw/nvme/monitor.c
> 
> -- 
> 2.53.0
> 
> 

Thanks, applied to nvme.next.

Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Re: [PATCH v3 0/2] hw/nvme: HMP commands for inspecting emulated controllers
Posted by Klaus Jensen 3 weeks, 1 day ago
On Jun 25 11:49, Klaus Jensen wrote:
> On May 22 10:29, Mateusz Nowicki wrote:
> > Add two HMP commands for inspecting emulated NVMe controllers from
> > the QEMU monitor without attaching gdb to the QEMU process:
> > 
> >   - 'info nvme'        - per-controller summary (PCI, identify
> >                          fields, CC/CSTS/AQA, queue counts)
> >   - 'info nvme-queues' - per-queue listing of admin and I/O SQ/CQ
> >                          (size, head/tail, PRP1, doorbell offset,
> >                          phase tag)
> > 
> > Useful for verifying queue setup, doorbell rings, AERs held in the
> > admin SQ and similar driver/controller interaction details from a
> > running QEMU monitor.
> > 
> > Changes in v3:
> >   - Iterate on n->conf_ioqpairs instead of n->params.max_ioqpairs so
> >     the listing reflects what the guest driver actually sees,
> >     including SR-IOV VFs where conf_ioqpairs is the negotiated subset
> >     (not max).  Same fix in both patches.  (Klaus)
> > 
> > Changes in v2:
> >   - hw/nvme/meson.build: add the missing trailing newline (Markus).
> >   - Pick up Acked-by tags from Dr. David Alan Gilbert and Markus
> >     Armbruster on both patches.
> > 
> > v2: https://lore.kernel.org/qemu-devel/cover.1778694320.git.mateusz.nowicki@posteo.net/
> > v1: https://lore.kernel.org/qemu-devel/cover.1778409416.git.mateusz.nowicki@posteo.net/
> > 
> > Mateusz Nowicki (2):
> >   hw/nvme: add 'info nvme' HMP command
> >   hw/nvme: add 'info nvme-queues' HMP command
> > 
> >  hmp-commands-info.hx |  28 +++++++++
> >  hw/nvme/meson.build  |   2 +-
> >  hw/nvme/monitor.c    | 139 +++++++++++++++++++++++++++++++++++++++++++
> >  qapi/machine.json    |  34 +++++++++++
> >  4 files changed, 202 insertions(+), 1 deletion(-)
> >  create mode 100644 hw/nvme/monitor.c
> > 
> > -- 
> > 2.53.0
> > 
> > 
> 
> Thanks, applied to nvme.next.
> 
> Reviewed-by: Klaus Jensen <k.jensen@samsung.com>

This seems to break CI, please take a look.

https://gitlab.com/birkelund/qemu/-/pipelines/2628581800


Thanks,
Klaus
Re: [PATCH v3 0/2] hw/nvme: HMP commands for inspecting emulated controllers
Posted by mateusz.nowicki@posteo.net 3 weeks, 1 day ago
Thanks for letting me know. NVMe HMP commands need to be behind 
CONFIG_NVME_PCI.
I'll generate v3.

Thanks!
Mateusz

On 26.06.2026 10:21, Klaus Jensen wrote:
> On Jun 25 11:49, Klaus Jensen wrote:
>> On May 22 10:29, Mateusz Nowicki wrote:
>> > Add two HMP commands for inspecting emulated NVMe controllers from
>> > the QEMU monitor without attaching gdb to the QEMU process:
>> >
>> >   - 'info nvme'        - per-controller summary (PCI, identify
>> >                          fields, CC/CSTS/AQA, queue counts)
>> >   - 'info nvme-queues' - per-queue listing of admin and I/O SQ/CQ
>> >                          (size, head/tail, PRP1, doorbell offset,
>> >                          phase tag)
>> >
>> > Useful for verifying queue setup, doorbell rings, AERs held in the
>> > admin SQ and similar driver/controller interaction details from a
>> > running QEMU monitor.
>> >
>> > Changes in v3:
>> >   - Iterate on n->conf_ioqpairs instead of n->params.max_ioqpairs so
>> >     the listing reflects what the guest driver actually sees,
>> >     including SR-IOV VFs where conf_ioqpairs is the negotiated subset
>> >     (not max).  Same fix in both patches.  (Klaus)
>> >
>> > Changes in v2:
>> >   - hw/nvme/meson.build: add the missing trailing newline (Markus).
>> >   - Pick up Acked-by tags from Dr. David Alan Gilbert and Markus
>> >     Armbruster on both patches.
>> >
>> > v2: https://lore.kernel.org/qemu-devel/cover.1778694320.git.mateusz.nowicki@posteo.net/
>> > v1: https://lore.kernel.org/qemu-devel/cover.1778409416.git.mateusz.nowicki@posteo.net/
>> >
>> > Mateusz Nowicki (2):
>> >   hw/nvme: add 'info nvme' HMP command
>> >   hw/nvme: add 'info nvme-queues' HMP command
>> >
>> >  hmp-commands-info.hx |  28 +++++++++
>> >  hw/nvme/meson.build  |   2 +-
>> >  hw/nvme/monitor.c    | 139 +++++++++++++++++++++++++++++++++++++++++++
>> >  qapi/machine.json    |  34 +++++++++++
>> >  4 files changed, 202 insertions(+), 1 deletion(-)
>> >  create mode 100644 hw/nvme/monitor.c
>> >
>> > --
>> > 2.53.0
>> >
>> >
>> 
>> Thanks, applied to nvme.next.
>> 
>> Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
> 
> This seems to break CI, please take a look.
> 
> https://gitlab.com/birkelund/qemu/-/pipelines/2628581800
> 
> 
> Thanks,
> Klaus
Re: [PATCH v3 0/2] hw/nvme: HMP commands for inspecting emulated controllers
Posted by Markus Armbruster 1 month, 2 weeks ago
Mateusz Nowicki <mateusz.nowicki@posteo.net> writes:

> Add two HMP commands for inspecting emulated NVMe controllers from
> the QEMU monitor without attaching gdb to the QEMU process:
>
>   - 'info nvme'        - per-controller summary (PCI, identify
>                          fields, CC/CSTS/AQA, queue counts)
>   - 'info nvme-queues' - per-queue listing of admin and I/O SQ/CQ
>                          (size, head/tail, PRP1, doorbell offset,
>                          phase tag)
>
> Useful for verifying queue setup, doorbell rings, AERs held in the
> admin SQ and similar driver/controller interaction details from a
> running QEMU monitor.

I can take this, but I'd like at least an Acked-by from an NVME
maintainer.