WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [Qemu-devel] [PATCH RFC V3 05/12] piix_pci: Introduces X

To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [Qemu-devel] [PATCH RFC V3 05/12] piix_pci: Introduces Xen specific call for irq.
From: Anthony PERARD <anthony@xxxxxxxxxx>
Date: Fri, 24 Sep 2010 14:42:39 +0100 (BST)
Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "qemu-devel@xxxxxxxxxx" <qemu-devel@xxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Fri, 24 Sep 2010 06:43:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100924051709.GE4701@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1284722107-28550-1-git-send-email-anthony.perard@xxxxxxxxxx> <1284722107-28550-6-git-send-email-anthony.perard@xxxxxxxxxx> <20100924051709.GE4701@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 1.10 (DEB 962 2008-03-14)
On Fri, 24 Sep 2010, Isaku Yamahata wrote:

> On Fri, Sep 17, 2010 at 12:15:00PM +0100, anthony.perard@xxxxxxxxxx wrote:
> > From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> >
> > This patch introduces Xen specific call in piix_pci.
> >
> > The specific part for Xen is in write_config, set_irq and get_pirq.
> >
> > Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> > ---
> >  hw/piix_pci.c |   10 +++++++++-
> >  hw/xen.h      |    6 ++++++
> >  xen-all.c     |   29 +++++++++++++++++++++++++++++
> >  xen-stub.c    |   13 +++++++++++++
> >  4 files changed, 57 insertions(+), 1 deletions(-)
> >
> > diff --git a/hw/piix_pci.c b/hw/piix_pci.c
> > index f152a0f..41a342f 100644
> > --- a/hw/piix_pci.c
> > +++ b/hw/piix_pci.c
> > @@ -142,6 +143,9 @@ static void i440fx_write_config(PCIDevice *dev,
> >  {
> >      PCII440FXState *d = DO_UPCAST(PCII440FXState, dev, dev);
> >
> > +    if (xen_enabled())
> > +        xen_piix_pci_write_config_client(address, val, len);
> > +
> >      /* XXX: implement SMRAM.D_LOCK */
> >      pci_default_write_config(dev, address, val, len);
> >      if (ranges_overlap(address, len, I440FX_PAM, I440FX_PAM_SIZE) ||
>
> Maybe I wasn't clear enough. This dynamic check can also be eliminated.
> Something like the following pseudo code.
>
> i440fx_init()
>       ...
>       if (xen_enabled) {
>               d = pci_create_simple(b, 0, "i440FX-xen");
>       } else }
>               d = pci_create_simple(b, 0, "i440FX");
>       }
>
>
> static PCIDeviceInfo i440fx_info[] = {
>     {
>         .qdev.name    = "i440FX",
>       ...
>         .config_write = i440fx_write_config,
>     },{
>         .qdev.name    = "i440FX-xen",
>       ...
>         .config_write = i440fx_write_config_xen,
>     },{
>
>
> i440fx_write_config_xen()
> {
>       xen_piix_pci_write_config_client();
>       i440fx_write_config()
> }

Ok, I will do that. Thanks for this sample of code.

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>