[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [v3][PATCH 1/5] xen, gfx passthrough: basic graphics passthrough support
> -----Original Message----- > From: Konrad Rzeszutek Wilk [mailto:konrad.wilk@xxxxxxxxxx] > Sent: Tuesday, May 27, 2014 10:55 PM > To: Chen, Tiejun > Cc: anthony.perard@xxxxxxxxxx; stefano.stabellini@xxxxxxxxxxxxx; > mst@xxxxxxxxxx; Kelly.Zytaruk@xxxxxxx; peter.maydell@xxxxxxxxxx; > xen-devel@xxxxxxxxxxxxxxxxxxx; Kay, Allen M; qemu-devel@xxxxxxxxxx; > anthony@xxxxxxxxxxxxx; Zhang, Yang Z > Subject: Re: [Xen-devel] [v3][PATCH 1/5] xen, gfx passthrough: basic graphics > passthrough support > > On Mon, May 26, 2014 at 05:43:05PM +0800, Tiejun Chen wrote: > > basic gfx passthrough support: > > - add a vga type for gfx passthrough > > - retrieve VGA bios from sysfs, then load it to guest 0xC0000 > > s/guest/guest at/ Fixed. > > - register/unregister legacy VGA I/O ports and MMIOs for passthroughed > > gfx > > s/passthrouged gfx/passthrough GFX/ Fixed. > > > > The original patch is from Weidong Han <weidong.han@xxxxxxxxx> > > > > Signed-off-by: Yang Zhang <yang.z.zhang@xxxxxxxxx> > > Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx> > > Cc: Weidong Han <weidong.han@xxxxxxxxx> > > --- > > v3: > > > > * Fix some typos. > > * Add more comments to make that readable. > > * Improve some return paths. > > > > v2: > > > > * retrieve VGA bios from sysfs properly. > > * redefine some function name. > > > > hw/xen/Makefile.objs | 2 +- > > hw/xen/xen-host-pci-device.c | 5 + > > hw/xen/xen-host-pci-device.h | 1 + > > hw/xen/xen_pt.c | 10 ++ > > hw/xen/xen_pt.h | 4 + > > hw/xen/xen_pt_graphics.c | 232 > +++++++++++++++++++++++++++++++++++++++++++ > > qemu-options.hx | 9 ++ > > vl.c | 11 +- > > 8 files changed, 272 insertions(+), 2 deletions(-) create mode > > 100644 hw/xen/xen_pt_graphics.c > > > > diff --git a/hw/xen/Makefile.objs b/hw/xen/Makefile.objs index > > a0ca0aa..77b7dae 100644 > > --- a/hw/xen/Makefile.objs > > +++ b/hw/xen/Makefile.objs > > @@ -2,4 +2,4 @@ > > common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o > > > > obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o > > -obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o > > xen_pt_msi.o > > +obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o > > +xen_pt_msi.o xen_pt_graphics.o > > diff --git a/hw/xen/xen-host-pci-device.c > > b/hw/xen/xen-host-pci-device.c index 743b37b..a54b7de 100644 > > --- a/hw/xen/xen-host-pci-device.c > > +++ b/hw/xen/xen-host-pci-device.c > > @@ -376,6 +376,11 @@ int xen_host_pci_device_get(XenHostPCIDevice *d, > uint16_t domain, > > goto error; > > } > > d->irq = v; > > + rc = xen_host_pci_get_hex_value(d, "class", &v); > > + if (rc) { > > + goto error; > > + } > > + d->class_code = v; > > d->is_virtfn = xen_host_pci_dev_is_virtfn(d); > > > > return 0; > > diff --git a/hw/xen/xen-host-pci-device.h > > b/hw/xen/xen-host-pci-device.h index c2486f0..f1e1c30 100644 > > --- a/hw/xen/xen-host-pci-device.h > > +++ b/hw/xen/xen-host-pci-device.h > > @@ -25,6 +25,7 @@ typedef struct XenHostPCIDevice { > > > > uint16_t vendor_id; > > uint16_t device_id; > > + uint32_t class_code; > > int irq; > > > > XenHostPCIIORegion io_regions[PCI_NUM_REGIONS - 1]; diff --git > > a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index be4220b..a0113ea 100644 > > --- a/hw/xen/xen_pt.c > > +++ b/hw/xen/xen_pt.c > > @@ -450,6 +450,7 @@ static int > xen_pt_register_regions(XenPCIPassthroughState *s) > > d->rom.size, d->rom.base_addr); > > } > > > > + xen_pt_register_vga_regions(d); > > return 0; > > } > > > > @@ -470,6 +471,8 @@ static void > xen_pt_unregister_regions(XenPCIPassthroughState *s) > > if (d->rom.base_addr && d->rom.size) { > > memory_region_destroy(&s->rom); > > } > > + > > + xen_pt_unregister_vga_regions(d); > > } > > > > /* region mapping */ > > @@ -693,6 +696,13 @@ static int xen_pt_initfn(PCIDevice *d) > > /* Handle real device's MMIO/PIO BARs */ > > xen_pt_register_regions(s); > > > > + /* Setup VGA bios for passthroughed gfx */ > > Ditto > Fixed. > > + if (xen_pt_setup_vga(&s->real_device) < 0) { > > + XEN_PT_ERR(d, "Setup VGA BIOS of passthroughed gfx > > + failed!\n"); > > Ditto > Fixed. Thanks Tiejun _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |