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

Re: [Xen-devel] [PATCH 1 of 4] xen: interrupt remapping in HVM guests

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1 of 4] xen: interrupt remapping in HVM guests
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Mon, 30 Aug 2010 13:40:10 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Mon, 30 Aug 2010 05:42:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4C7BBD210200007800012D3E@xxxxxxxxxxxxxxxxxx>
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: <alpine.DEB.2.00.1008301154290.2545@kaball-desktop> <1283167504-7787-1-git-send-email-stefano.stabellini@xxxxxxxxxxxxx> <4C7BBD210200007800012D3E@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
On Mon, 30 Aug 2010, Jan Beulich wrote:
> >>> On 30.08.10 at 13:25, <stefano.stabellini@xxxxxxxxxxxxx> wrote:
> > --- a/xen/arch/x86/domain.c Tue Aug 17 19:32:37 2010 +0100
> > +++ b/xen/arch/x86/domain.c Fri Aug 20 16:47:36 2010 +0100
> > @@ -490,6 +490,16 @@ int arch_domain_create(struct domain *d,
> >              if ( !IO_APIC_IRQ(i) )
> >                  d->arch.irq_pirq[i] = d->arch.pirq_irq[i] = i;
> >  
> > +        d->arch.pirq_emuirq = xmalloc_array(int, d->nr_pirqs);
> > +        d->arch.emuirq_pirq = xmalloc_array(int, nr_irqs);
> > +        if ( !d->arch.pirq_emuirq || !d->arch.emuirq_pirq )
> > +            goto fail;
> > +        memset(d->arch.pirq_emuirq, IRQ_UNBOUND,
> > +               d->nr_pirqs * sizeof(*d->arch.pirq_emuirq));
> > +        memset(d->arch.emuirq_pirq, IRQ_UNBOUND,
> > +               d->nr_pirqs * sizeof(*d->arch.emuirq_pirq));
> > +
> > +
> >          if ( (rc = iommu_domain_init(d)) != 0 )
> >              goto fail;
> >  
> 
> Shouldn't this be done for HVM domains only, and should you free
> these arrays both in the error path of that function and in e.g.
> arch_domain_destroy()?

Yes, you are right about that, I'll fix and resend.

> 
> Additionally, shouldn't you add a build time check making sure
> that IRQ_UNBOUND is actually suitable for initialization via
> memset() (or alternatively use a loop)?
> 
 
something like typeof?

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