qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] vfio/igd: handle q35 machine type
Date: Tue, 08 Mar 2016 09:04:50 +0100	[thread overview]
Message-ID: <1457424290.22567.24.camel@redhat.com> (raw)
In-Reply-To: <20160307144151.5d17dfb4@t450s.home>

On Mo, 2016-03-07 at 14:41 -0700, Alex Williamson wrote:
> On Fri,  4 Mar 2016 09:41:53 +0100
> Gerd Hoffmann <kraxel@redhat.com> wrote:
> 
> > Basically skip the lpc quirks with -M q35.
> > Applies on top of the vfio-igd patch series by alex.
> > 
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> >  hw/vfio/pci-quirks.c | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
> > index 5828362..1757e3d 100644
> > --- a/hw/vfio/pci-quirks.c
> > +++ b/hw/vfio/pci-quirks.c
> > @@ -12,6 +12,7 @@
> >  
> >  #include "qemu/osdep.h"
> >  #include "hw/nvram/fw_cfg.h"
> > +#include "hw/i386/ich9.h"
> >  #include "pci.h"
> >  #include "trace.h"
> >  #include "qemu/range.h"
> > @@ -1410,6 +1411,7 @@ int vfio_pci_igd_lpc_init(VFIOPCIDevice *vdev,
> >                             struct vfio_region_info *region)
> >  {
> >      DeviceClass *dc = DEVICE_GET_CLASS(vdev);
> > +    PCIBus *bus;
> >      PCIDevice *lpc_bridge;
> >      int ret;
> >  
> > @@ -1423,6 +1425,19 @@ int vfio_pci_igd_lpc_init(VFIOPCIDevice *vdev,
> >  
> >      dc->hotpluggable = false;
> >  
> > +    bus = pci_device_root_bus(&vdev->pdev);
> > +    lpc_bridge = pci_find_device(bus, 0, PCI_DEVFN(0x1f, 0));
> > +    if (lpc_bridge) {
> > +        const char *type = object_get_typename(OBJECT(lpc_bridge));
> > +        if (strcmp(type, TYPE_ICH9_LPC_DEVICE) == 0) {
> > +            /*
> > +             * q35 lpc present, leave it as-is.
> > +             * linux kernel 4.5+ can deal with this.
> 
> What about anything older?  I assume we want to support current
> distributions.  Based on this patch it seems like we also want to test
> first if the lpc device is present, create it if not, then probably
> copy host data into it.  Thanks,

q35 already has a isa bridge @ 1f.0, and it's not a dummy device but
emulates the ich9 lpc.  Just overwriting the identity of that device
isn't a good idea I think.

cheers,
  Gerd

  reply	other threads:[~2016-03-08  8:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04  8:41 [Qemu-devel] [PATCH v2] vfio/igd: handle q35 machine type Gerd Hoffmann
2016-03-07 21:41 ` Alex Williamson
2016-03-08  8:04   ` Gerd Hoffmann [this message]
2016-03-08 15:15     ` Alex Williamson
2016-03-09  8:03       ` Gerd Hoffmann
2016-03-09 15:00         ` Gerd Hoffmann
2016-03-10  5:49           ` [Qemu-devel] [iGVT-g] " Tian, Kevin
2016-03-09 15:02         ` [Qemu-devel] " Gerd Hoffmann

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=1457424290.22567.24.camel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).