qemu: target library, use it in msix
PATCH 1/1 qemu: target library, use it in msix
This creates target.c, which builds per-target, and makes it possible for devices to become target-independent. Use it in msix, reverting part of 5e520a7d500ec2569d22d80f9ef4272a34cb3c80, as we no longer have to pass target page around.
--- Makefile.target | 3 +++ hw/msix.c | 51 ++++++++++++++++++++++++++------------------------- hw/msix.h | 5 ++--- hw/pci.h | 6 ------ hw/virtio-pci.c | 3 +-- 5 files changed, 32 insertions(+), 36 deletions(-)
Makefile.target +3 -0
@@ -55,6 +55,9 @@ libobj-$(CONFIG_S390_DIS) += s390-dis.o libobj-$(CONFIG_SH4_DIS) += sh4-dis.o libobj-$(CONFIG_SPARC_DIS) += sparc-dis.o +# Target library: makes devices target-independent +libobj-y += target.o + # libqemu libqemu.a: $(libobj-y)
hw/msix.c +26 -25
135 lines not on this page · raw message
hw/msix.h +2 -3
@@ -3,9 +3,8 @@#include "qemu-common.h" -int msix_init (struct PCIDevice *dev,unsigned short nentries, -unsigned bar_nr,unsigned bar_size, -target_phys_addr_t page_size); +int msix_init (PCIDevice *pdev,unsigned short nentries, +unsigned bar_nr,unsigned bar_size);void msix_write_config (PCIDevice *pci_dev,uint32_t address,uint32_t val,int len);
hw/pci.h +0 -6
@@ -214,12 +214,6 @@ struct PCIDevice {uint32_t msix_bar_size;/* Version id needed for VMState */ int32_t version_id; -/* How much space does an MSIX table need. */ -/* The spec requires giving the table structure -* a 4K aligned region all by itself. Align it to -* target pages so that drivers can do passthrough -* on the rest of the region. */ -target_phys_addr_t msix_page_size; }; PCIDevice *pci_register_device(PCIBus *bus, const char *name,
hw/virtio-pci.c +1 -2
@@ -410,8 +410,7 @@ static void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev, config[0x3d ] =1 ; -if (vdev->nvectors && !msix_init (&proxy->pci_dev, vdev->nvectors,1 ,0 , -TARGET_PAGE_SIZE )) { +if (vdev->nvectors && !msix_init (&proxy->pci_dev, vdev->nvectors,1 ,0 )) { pci_register_bar(&proxy->pci_dev, 1, msix_bar_size(&proxy->pci_dev), PCI_ADDRESS_SPACE_MEM,
Signature · 1 line
1.6.5.rc2
Quoted 5 lines · Michael S. Tsirkin
This creates
target.c, which builds per-target, and makes it possible for devices to become target-independent. Use it in msix, reverting part of5e520a7d500ec2569d22d80f9ef4272a34cb3c80, as we no longer have to pass target page around.
Quoted 8 lines
Signed-off-by Michael S. Tsirkin <[email protected]>---
Makefile.target | 3 +++
hw/msix.c | 51 ++++++++++++++++++++++++++-------------------------hw/msix.h| 5 ++---
hw/pci.h | 6 ------
hw/virtio-pci.c | 3 +--5 files changed, 32 insertions(+), 36 deletions(-)
Forgot to add target.[ch]?
Quoted 15 lines · Blue Swirl
Quoted 5 lines · Michael S. Tsirkin
This creates
target.c, which builds per-target, and makes it possible for devices to become target-independent. Use it in msix, reverting part of5e520a7d500ec2569d22d80f9ef4272a34cb3c80, as we no longer have to pass target page around.Quoted 8 lines
Signed-off-by Michael S. Tsirkin <[email protected]>---
Makefile.target | 3 +++
hw/msix.c | 51 ++++++++++++++++++++++++++-------------------------hw/msix.h| 5 ++---
hw/pci.h | 6 ------
hw/virtio-pci.c | 3 +--5 files changed, 32 insertions(+), 36 deletions(-)
Quoted 1 line
Forgot to add target.[ch]?
Yep. fixed and reposted.