qemu: fix up load for msi-x
PATCH 2/2 qemu: fix up load for msi-x
In reply to a message not in the archiveAdd missing load of control vector in virtio
Signed-off-by Michael S. Tsirkin <[email protected]>
--- hw/virtio.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
hw/virtio.c +3 -0
@@ -665,6 +665,9 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f) vdev->config_len =qemu_get_be32 (f);qemu_get_buffer (f, vdev->config, vdev->config_len); +if (vdev->nvectors) +qemu_get_be16s (f, &vdev->config_vector); + num =qemu_get_be32 (f);for (i =0 ; i < num; i++) {
Signature · 1 line
1.6.2.2
PATCH 1/2 fix segfault in msix_save
In reply to a message not in the archiveThis fixes segfault reported by Kevin Wolf,
and simplifies the code in msix_save.
Reported-by Kevin Wolf <[email protected]>
Signed-off-by Michael S. Tsirkin <[email protected]>
--- hw/msix.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-)
hw/msix.c +7 -5
@@ -284,11 +284,13 @@ int msix_uninit(PCIDevice *dev)void msix_save (PCIDevice *dev,QEMUFile *f) { -unsigned nentries = (pci_get_word (dev->config +PCI_MSIX_FLAGS ) & -PCI_MSIX_FLAGS_QSIZE ) +1 ; -qemu_put_buffer (f, dev->msix_table_page, nentries *MSIX_ENTRY_SIZE ); -qemu_put_buffer (f, dev->msix_table_page +MSIX_PAGE_PENDING , - (nentries +7 ) /8 ); +unsigned n = dev->msix_entries_nr; + +if (!dev->cap_present &QEMU_PCI_CAP_MSIX ) +return ; + +qemu_put_buffer (f, dev->msix_table_page, n *MSIX_ENTRY_SIZE ); +qemu_put_buffer (f, dev->msix_table_page +MSIX_PAGE_PENDING , (n +7 ) /8 ); }/* Should be called after restoring the config space. */
Signature · 1 line
1.6.2.2
Re: [PATCH 1/2] fix segfault in msix_save
Quoted 5 lines · Michael S. Tsirkin
This fixes segfault reported by Kevin Wolf,
and simplifies the code inmsix_save.Reported-by Kevin Wolf <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>
For qemu-kvm, this supercedes e347f89a3d4773dfc22d8874c9906453d54768c7.
Signature · 1 line
MST
Re: [PATCH 1/2] fix segfault in msix_save
In reply to Michael S. TsirkinQuoted 5 lines · Michael S. Tsirkin
This fixes segfault reported by Kevin Wolf,
and simplifies the code inmsix_save.Reported-by Kevin Wolf <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>
I can confirm that this fixes the segfault for me.
Kevin