mbox series

[RESEND,v2,0/3] To add HMP interface to dump PCI MSI-X table/PBA

Message ID 20210712235812.19725-1-dongli.zhang@oracle.com (mailing list archive)
Headers show
Series To add HMP interface to dump PCI MSI-X table/PBA | expand

Message

Dongli Zhang July 12, 2021, 11:58 p.m. UTC
I have just rebased the v2 patchset on top of most recent qemu to resend.

This patch is to introduce the new HMP command to dump the MSI-X table/PBA.

Here is the RFC v1:

https://lists.gnu.org/archive/html/qemu-devel/2021-04/msg04673.html

The idea was inspired by below discussion:

https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg09020.html


(qemu) info msix -d /machine/peripheral/vscsi0
Msg L.Addr Msg U.Addr Msg Data   Vect Ctrl
0xfee00000 0x00000000 0x00004041 0x00000000
0xfee00000 0x00000000 0x00004051 0x00000000
0xfee00000 0x00000000 0x00004061 0x00000000
0xfee00000 0x00000000 0x00004071 0x00000000
0xfee01000 0x00000000 0x000040b1 0x00000000
0xfee02000 0x00000000 0x000040c1 0x00000000
0xfee03000 0x00000000 0x000040d1 0x00000000

MSI-X PBA
0 0 0 0 0 0 0

virtio pci vector info:
config: 0
queue 0: 1
queue 1: 2
queue 2: 3
queue 3: 4
queue 4: 5
queue 5: 6


Changed since RFC v1:
  - Add heading to MSI-X table (suggested by David Alan Gilbert)
  - Add device specific interface, e.g., to dump virtio-pci queue-to-vector
    mapping (Suggested By Jason)


 hmp-commands-info.hx       | 14 +++++++++
 hw/pci/msix.c              | 63 +++++++++++++++++++++++++++++++++++++++++
 hw/virtio/virtio-pci.c     | 22 ++++++++++++++
 hw/virtio/virtio.c         | 10 +++++++
 include/hw/pci/msix.h      |  2 ++
 include/hw/pci/pci.h       |  3 ++
 include/hw/virtio/virtio.h |  2 ++
 include/monitor/hmp.h      |  1 +
 softmmu/qdev-monitor.c     | 36 +++++++++++++++++++++++
 9 files changed, 153 insertions(+)

Thank you very much!

Dongli Zhang

Comments

Michael S. Tsirkin July 13, 2021, 8:59 p.m. UTC | #1
On Mon, Jul 12, 2021 at 04:58:09PM -0700, Dongli Zhang wrote:
> I have just rebased the v2 patchset on top of most recent qemu to resend.
> 
> This patch is to introduce the new HMP command to dump the MSI-X table/PBA.
> 
> Here is the RFC v1:
> 
> https://lists.gnu.org/archive/html/qemu-devel/2021-04/msg04673.html
> 
> The idea was inspired by below discussion:
> 
> https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg09020.html

Fails build for microblaze:

/scm/qemu/build/../softmmu/qdev-monitor.c:1030: undefined reference to `msix_dump_info'
collect2: error: ld returned 1 exit status
[2525/8445] Compiling C object libqemu-microblaze-softmmu.fa.p/meson-generated_.._qapi_qapi-visit-misc-target.c.o

> 
> (qemu) info msix -d /machine/peripheral/vscsi0
> Msg L.Addr Msg U.Addr Msg Data   Vect Ctrl
> 0xfee00000 0x00000000 0x00004041 0x00000000
> 0xfee00000 0x00000000 0x00004051 0x00000000
> 0xfee00000 0x00000000 0x00004061 0x00000000
> 0xfee00000 0x00000000 0x00004071 0x00000000
> 0xfee01000 0x00000000 0x000040b1 0x00000000
> 0xfee02000 0x00000000 0x000040c1 0x00000000
> 0xfee03000 0x00000000 0x000040d1 0x00000000
> 
> MSI-X PBA
> 0 0 0 0 0 0 0
> 
> virtio pci vector info:
> config: 0
> queue 0: 1
> queue 1: 2
> queue 2: 3
> queue 3: 4
> queue 4: 5
> queue 5: 6
> 
> 
> Changed since RFC v1:
>   - Add heading to MSI-X table (suggested by David Alan Gilbert)
>   - Add device specific interface, e.g., to dump virtio-pci queue-to-vector
>     mapping (Suggested By Jason)
> 
> 
>  hmp-commands-info.hx       | 14 +++++++++
>  hw/pci/msix.c              | 63 +++++++++++++++++++++++++++++++++++++++++
>  hw/virtio/virtio-pci.c     | 22 ++++++++++++++
>  hw/virtio/virtio.c         | 10 +++++++
>  include/hw/pci/msix.h      |  2 ++
>  include/hw/pci/pci.h       |  3 ++
>  include/hw/virtio/virtio.h |  2 ++
>  include/monitor/hmp.h      |  1 +
>  softmmu/qdev-monitor.c     | 36 +++++++++++++++++++++++
>  9 files changed, 153 insertions(+)
> 
> Thank you very much!
> 
> Dongli Zhang
>
Dongli Zhang July 13, 2021, 10:30 p.m. UTC | #2
On 7/13/21 1:59 PM, Michael S. Tsirkin wrote:
> On Mon, Jul 12, 2021 at 04:58:09PM -0700, Dongli Zhang wrote:
>> I have just rebased the v2 patchset on top of most recent qemu to resend.
>>
>> This patch is to introduce the new HMP command to dump the MSI-X table/PBA.
>>
>> Here is the RFC v1:
>>
>> https://urldefense.com/v3/__https://lists.gnu.org/archive/html/qemu-devel/2021-04/msg04673.html__;!!ACWV5N9M2RV99hQ!a_4RXoxWC3ppSNDk4TFH5-UjOMa9DsHfWF3x814Yf6urzW3rxZrwhWCU2zTFVDD57lE$ 
>>
>> The idea was inspired by below discussion:
>>
>> https://urldefense.com/v3/__https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg09020.html__;!!ACWV5N9M2RV99hQ!a_4RXoxWC3ppSNDk4TFH5-UjOMa9DsHfWF3x814Yf6urzW3rxZrwhWCU2zTFAnnr09M$ 
> 
> Fails build for microblaze:
> 
> /scm/qemu/build/../softmmu/qdev-monitor.c:1030: undefined reference to `msix_dump_info'
> collect2: error: ld returned 1 exit status
> [2525/8445] Compiling C object libqemu-microblaze-softmmu.fa.p/meson-generated_.._qapi_qapi-visit-misc-target.c.o
> 

I am so sorry for the build error. I will add below to the hw/pci/pci-stub.c.

void msix_dump_info(Monitor *mon, PCIDevice *dev, Error **errp)
{
    monitor_printf(mon, "PCI devices not supported\n");
}

I will send out v3.


I should test for all arch instead of only x86_64-softmmu in the future.

Thank you very much!

Dongli Zhang