Skip to content

qemu:pci-assign: try to pci-assign.c

Tiejun Chen qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1hw/pci-assign: split pci-assign.chw/i386/kvm/pci-assign.c include/hw/pci/pci_assign.h+207 -1676 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/1] qemu:pci-assign: try to pci-assign.c

As you know I'm working on supporting IGD passthrough.

Here we need load VGABIOS to work out IGD case. Obviously something may be duplicated to kvm codes, we should unify some codes but looks its not easy to finish that in short time. So as Michael suggestion, at least we'd better split assigned_dev_load_option_rom to reuse on both kvm and xen.

I don't finish all IGD stuff patches but here I'd like to post some related codes to show how to use assigned_dev_load_option_rom() lately.

+static int get_vgabios(XenPCIPassthroughState *s, void *ptr,
+ XenHostPCIDevice *dev)
+{
+ int size = 0;
+
+ size = dev_load_option_rom(&s->dev, OBJECT(dev), ptr, dev->domain,
+ dev->bus, dev->dev, dev->func);
+
+ return size;
+}
+
+int xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev) +{

+    void *bios = NULL;
+    int bios_size = 0;
+    int rc = 0;

+
+ if (!is_vga_passthrough(dev)) {
+ return rc;
+ }
+
+ bios_size = get_vgabios(s, bios, dev);
+ if (!bios || !bios_size) {

+        XEN_PT_ERR(NULL, "VGA: getting VBIOS!\n");
+        rc = -1;
+        goto out;

+ }
...

----------------------------------------------------------------
Tiejun Chen (1):
hw/pci-assign: split pci-assign.c

 hw/i386/kvm/pci-assign.c    | 170 +++--------------------------------------------------------------------------------------------------------------------------------------
 include/hw/pci/pci_assign.h | 204 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 207 insertions(+), 167 deletions(-)
 create mode 100644 include/hw/pci/pci_assign.h

Thanks
Tiejun