All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Chen, Tiejun" <tiejun.chen@intel.com>
Cc: pbonzini@redhat.com, xen-devel@lists.xensource.com,
	qemu-devel@nongnu.org, stefano.stabellini@eu.citrix.com
Subject: Re: [Qemu-devel] [v2][PATCH 2/5] hw:pci-host:piix: split i440fx_init
Date: Thu, 31 Jul 2014 17:47:24 +0200	[thread overview]
Message-ID: <20140731154724.GC3898@redhat.com> (raw)
In-Reply-To: <53DA324D.7060000@intel.com>

On Thu, Jul 31, 2014 at 08:10:53PM +0800, Chen, Tiejun wrote:
> On 2014/7/31 18:12, Chen, Tiejun wrote:
> >On 2014/7/31 17:53, Michael S. Tsirkin wrote:
> >>On Thu, Jul 31, 2014 at 05:26:41PM +0800, Chen, Tiejun wrote:
> >>>On 2014/7/31 17:10, Michael S. Tsirkin wrote:
> >>>>On Thu, Jul 31, 2014 at 02:31:36PM +0800, Tiejun Chen wrote:
> >>>>>We'd like to split i440fx_init and then we can share something
> >>>>>with other stuff.
> >>>>>
> >>>>>Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
> >>>>
> >>>>I think this is too much work for very little benefit.
> >>>>Just pass const char *type to i440fx_init.
> >>>
> >>>You know we will introduce that faked PCIe device represented that PCH
> >>>later,
> >>
> >>Later when? On top of this patch series? Would like to see it all
> >>before applying this ...
> >
> >I will send this with other IGD stuff after this series is fine to you
> >since its just creating a simple PCIe device.
> >
> >I think you should know this whole story since as you guys discussed we
> >don't fix that PCH at 1f.0. So it may be like this,
> >
> >static int create_pseudo_pch_isa_bridge(PCIBus *bus, XenHostPCIDevice
> >*hdev)
> >{
> >
> >     struct PCIDevice *dev;
> >
> >     char rid;
> >
> >     /* We havt to use a simple PCI device to fake this ISA bridge
> >      * to avoid making some confusion to BIOS and ACPI.
> >      */
> >     dev = pci_create(bus, -1, "pseudo-intel-pch-isa-bridge");
> >
> >     qdev_init_nofail(&dev->qdev);
> >     pci_config_set_vendor_id(dev->config, XEN_SUBSYSTEM_ID));
> >                         ^
> >                 I don't remember this exactly.
> >     pci_config_set_device_id(dev->config, hdev->device_id);
> >
> >     return 0;
> >}
> >
> >>
> >>>so how to distinguish them? Are you saying I should check the type
> >>>like this?
> >>>
> >>>if(Xen-Type)
> >>>{}
> >>>else
> >>>{}
> >>>
> >>
> >>No! Put the code in init function for the respective class,
> >>pass type as an argument:
> >
> >If you mean we don't introduce any "if/else", I still don't understand
> >how to insert such that function above, could you show this exactly?
> >
> 
> I think I can do this inside that into
> xen_igd_passthrough_pc_machine_pci_bus_init(). There, we can just follow
> pci_bus = i440fx_init() since create_pseudo_pch_isa_bridge() just needs
> pci_bus as a parameter.
> 
> Thanks
> Tiejun

Do it in xen_igd_i440fx_class_init: constructor for your class.
This device is not hot-pluggable right?
If so I would prefer not to make this xen specific.
Instead, find the device and tweak the id when you
initialize the card.

-- 
MST

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Chen, Tiejun" <tiejun.chen@intel.com>
Cc: pbonzini@redhat.com, xen-devel@lists.xensource.com,
	qemu-devel@nongnu.org, stefano.stabellini@eu.citrix.com
Subject: Re: [v2][PATCH 2/5] hw:pci-host:piix: split i440fx_init
Date: Thu, 31 Jul 2014 17:47:24 +0200	[thread overview]
Message-ID: <20140731154724.GC3898@redhat.com> (raw)
In-Reply-To: <53DA324D.7060000@intel.com>

On Thu, Jul 31, 2014 at 08:10:53PM +0800, Chen, Tiejun wrote:
> On 2014/7/31 18:12, Chen, Tiejun wrote:
> >On 2014/7/31 17:53, Michael S. Tsirkin wrote:
> >>On Thu, Jul 31, 2014 at 05:26:41PM +0800, Chen, Tiejun wrote:
> >>>On 2014/7/31 17:10, Michael S. Tsirkin wrote:
> >>>>On Thu, Jul 31, 2014 at 02:31:36PM +0800, Tiejun Chen wrote:
> >>>>>We'd like to split i440fx_init and then we can share something
> >>>>>with other stuff.
> >>>>>
> >>>>>Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
> >>>>
> >>>>I think this is too much work for very little benefit.
> >>>>Just pass const char *type to i440fx_init.
> >>>
> >>>You know we will introduce that faked PCIe device represented that PCH
> >>>later,
> >>
> >>Later when? On top of this patch series? Would like to see it all
> >>before applying this ...
> >
> >I will send this with other IGD stuff after this series is fine to you
> >since its just creating a simple PCIe device.
> >
> >I think you should know this whole story since as you guys discussed we
> >don't fix that PCH at 1f.0. So it may be like this,
> >
> >static int create_pseudo_pch_isa_bridge(PCIBus *bus, XenHostPCIDevice
> >*hdev)
> >{
> >
> >     struct PCIDevice *dev;
> >
> >     char rid;
> >
> >     /* We havt to use a simple PCI device to fake this ISA bridge
> >      * to avoid making some confusion to BIOS and ACPI.
> >      */
> >     dev = pci_create(bus, -1, "pseudo-intel-pch-isa-bridge");
> >
> >     qdev_init_nofail(&dev->qdev);
> >     pci_config_set_vendor_id(dev->config, XEN_SUBSYSTEM_ID));
> >                         ^
> >                 I don't remember this exactly.
> >     pci_config_set_device_id(dev->config, hdev->device_id);
> >
> >     return 0;
> >}
> >
> >>
> >>>so how to distinguish them? Are you saying I should check the type
> >>>like this?
> >>>
> >>>if(Xen-Type)
> >>>{}
> >>>else
> >>>{}
> >>>
> >>
> >>No! Put the code in init function for the respective class,
> >>pass type as an argument:
> >
> >If you mean we don't introduce any "if/else", I still don't understand
> >how to insert such that function above, could you show this exactly?
> >
> 
> I think I can do this inside that into
> xen_igd_passthrough_pc_machine_pci_bus_init(). There, we can just follow
> pci_bus = i440fx_init() since create_pseudo_pch_isa_bridge() just needs
> pci_bus as a parameter.
> 
> Thanks
> Tiejun

Do it in xen_igd_i440fx_class_init: constructor for your class.
This device is not hot-pluggable right?
If so I would prefer not to make this xen specific.
Instead, find the device and tweak the id when you
initialize the card.

-- 
MST

  reply	other threads:[~2014-07-31 15:47 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31  6:31 [Qemu-devel] [v2][PATCH 0/5] xen: introduce new machine for IGD passthrough Tiejun Chen
2014-07-31  6:31 ` Tiejun Chen
2014-07-31  6:31 ` [Qemu-devel] [v2][PATCH 1/5] hw:i386:pc_piix: split pc_init1() Tiejun Chen
2014-07-31  6:31   ` Tiejun Chen
2014-07-31  6:31 ` [Qemu-devel] [v2][PATCH 2/5] hw:pci-host:piix: split i440fx_init Tiejun Chen
2014-07-31  6:31   ` Tiejun Chen
2014-07-31  9:10   ` [Qemu-devel] " Michael S. Tsirkin
2014-07-31  9:10     ` Michael S. Tsirkin
2014-07-31  9:26     ` [Qemu-devel] " Chen, Tiejun
2014-07-31  9:26       ` Chen, Tiejun
2014-07-31  9:53       ` [Qemu-devel] " Michael S. Tsirkin
2014-07-31  9:53         ` Michael S. Tsirkin
2014-07-31 10:12         ` [Qemu-devel] " Chen, Tiejun
2014-07-31 10:12           ` Chen, Tiejun
2014-07-31 12:10           ` [Qemu-devel] " Chen, Tiejun
2014-07-31 12:10             ` Chen, Tiejun
2014-07-31 15:47             ` Michael S. Tsirkin [this message]
2014-07-31 15:47               ` Michael S. Tsirkin
2014-08-01  2:40               ` [Qemu-devel] " Chen, Tiejun
2014-08-01  2:40                 ` Chen, Tiejun
2014-07-31 15:44           ` [Qemu-devel] " Michael S. Tsirkin
2014-07-31 15:44             ` Michael S. Tsirkin
2014-08-01  2:35             ` [Qemu-devel] " Chen, Tiejun
2014-08-01  2:35               ` Chen, Tiejun
2014-08-04  7:11         ` [Qemu-devel] " Chen, Tiejun
2014-08-04  7:11           ` Chen, Tiejun
2014-07-31  6:31 ` [Qemu-devel] [v2][PATCH 3/5] xen:hw:pci-host:piix: create host bridge to passthrough Tiejun Chen
2014-07-31  6:31   ` Tiejun Chen
2014-07-31  6:31 ` [Qemu-devel] [v2][PATCH 4/5] xen:hw:pci-host:piix: introduce xen_igd_passthrough_i440fx_init Tiejun Chen
2014-07-31  6:31   ` Tiejun Chen
2014-07-31  6:31 ` [Qemu-devel] [v2][PATCH 5/5] xen:hw:i386:pc_piix: introduce new machine for IGD passthrough Tiejun Chen
2014-07-31  6:31   ` Tiejun Chen
2014-07-31  8:58 ` [Qemu-devel] [v2][PATCH 0/5] xen: " Michael S. Tsirkin
2014-07-31  8:58   ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140731154724.GC3898@redhat.com \
    --to=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tiejun.chen@intel.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.