[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Xen-devel] [v4][PATCH 2/5] xen, gfx passthrough: creat
From: |
Konrad Rzeszutek Wilk |
Subject: |
Re: [Qemu-devel] [Xen-devel] [v4][PATCH 2/5] xen, gfx passthrough: create intel isa bridge |
Date: |
Fri, 30 May 2014 12:13:34 -0400 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, May 30, 2014 at 04:59:26PM +0800, Tiejun Chen wrote:
> ISA bridge is needed since Intel gfx drive will probe it instead
> of Dev31:Fun0 to make graphics device passthrough work easy for VMM, that
> only need to expose ISA bridge to let driver know the real hardware
> underneath.
>
> The original patch is from Allen Kay address@hidden
>
> Signed-off-by: Yang Zhang <address@hidden>
> Signed-off-by: Tiejun Chen <address@hidden>
> Cc: Allen Kay <address@hidden>
Reviewed-by: Konrad Rzeszutek Wilk <address@hidden>
> ---
> v4:
>
> * Remove some unnecessary "return" in void foo().
>
> v3:
>
> * Fix some typos.
> * Improve some return paths.
>
> v2:
>
> * Nothing is changed.
>
> hw/xen/xen_pt_graphics.c | 59
> ++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 59 insertions(+)
>
> diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
> index 461e526..236b13a 100644
> --- a/hw/xen/xen_pt_graphics.c
> +++ b/hw/xen/xen_pt_graphics.c
> @@ -230,3 +230,62 @@ out:
> g_free(bios);
> return rc;
> }
> +
> +static uint32_t isa_bridge_read_config(PCIDevice *d, uint32_t addr, int len)
> +{
> + return pci_default_read_config(d, addr, len);
> +}
> +
> +static void isa_bridge_write_config(PCIDevice *d, uint32_t addr, uint32_t v,
> + int len)
> +{
> + pci_default_write_config(d, addr, v, len);
> +}
> +
> +static void isa_bridge_class_init(ObjectClass *klass, void *data)
> +{
> + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
> +
> + k->config_read = isa_bridge_read_config;
> + k->config_write = isa_bridge_write_config;
> +};
> +
> +typedef struct {
> + PCIDevice dev;
> +} ISABridgeState;
> +
> +static TypeInfo isa_bridge_info = {
> + .name = "intel-pch-isa-bridge",
> + .parent = TYPE_PCI_DEVICE,
> + .instance_size = sizeof(ISABridgeState),
> + .class_init = isa_bridge_class_init,
> +};
> +
> +static void xen_pt_graphics_register_types(void)
> +{
> + type_register_static(&isa_bridge_info);
> +}
> +
> +type_init(xen_pt_graphics_register_types)
> +
> +static int create_pch_isa_bridge(PCIBus *bus, XenHostPCIDevice *hdev)
> +{
> + struct PCIDevice *dev;
> +
> + char rid;
> +
> + dev = pci_create(bus, PCI_DEVFN(0x1f, 0), "intel-pch-isa-bridge");
> +
> + qdev_init_nofail(&dev->qdev);
> +
> + pci_config_set_vendor_id(dev->config, hdev->vendor_id);
> + pci_config_set_device_id(dev->config, hdev->device_id);
> +
> + xen_host_pci_get_block(hdev, PCI_REVISION_ID, (uint8_t *)&rid, 1);
> +
> + pci_config_set_revision(dev->config, rid);
> + pci_config_set_class(dev->config, PCI_CLASS_BRIDGE_ISA);
> +
> + XEN_PT_LOG(dev, "Intel PCH ISA bridge created.\n");
> + return 0;
> +}
> --
> 1.9.1
>
>
> _______________________________________________
> Xen-devel mailing list
> address@hidden
> http://lists.xen.org/xen-devel
- [Qemu-devel] [v4][PATCH 0/5] xen: add Intel IGD passthrough support, Tiejun Chen, 2014/05/30
- [Qemu-devel] [v4][PATCH 1/5] xen, gfx passthrough: basic graphics passthrough support, Tiejun Chen, 2014/05/30
- [Qemu-devel] [v4][PATCH 3/5] xen, gfx passthrough: support Intel IGD passthrough with VT-D, Tiejun Chen, 2014/05/30
- [Qemu-devel] [v4][PATCH 2/5] xen, gfx passthrough: create intel isa bridge, Tiejun Chen, 2014/05/30
- Re: [Qemu-devel] [Xen-devel] [v4][PATCH 2/5] xen, gfx passthrough: create intel isa bridge,
Konrad Rzeszutek Wilk <=
- [Qemu-devel] [v4][PATCH 4/5] xen, gfx passthrough: create host bridge to passthrough, Tiejun Chen, 2014/05/30
- [Qemu-devel] [v4][PATCH 5/5] xen, gfx passthrough: add opregion mapping, Tiejun Chen, 2014/05/30