[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC v2 06/15] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts




> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: Tuesday, June 09, 2015 10:25 PM
> To: Wu, Feng
> Cc: andrew.cooper3@xxxxxxxxxx; george.dunlap@xxxxxxxxxxxxx; Tian, Kevin;
> Zhang, Yang Z; xen-devel@xxxxxxxxxxxxx; keir@xxxxxxx
> Subject: Re: [RFC v2 06/15] vt-d: Extend struct iremap_entry to support VT-d
> Posted-Interrupts
> 
> >>> On 08.05.15 at 11:07, <feng.wu@xxxxxxxxx> wrote:
> > --- a/xen/drivers/passthrough/vtd/iommu.h
> > +++ b/xen/drivers/passthrough/vtd/iommu.h
> > @@ -289,7 +289,7 @@ struct dma_pte {
> >  /* interrupt remap entry */
> >  struct iremap_entry {
> >    union {
> > -    u64 lo_val;
> > +    struct { u64 lo, hi; };
> >      struct {
> >          u64 p       : 1,
> >              fpd     : 1,
> > @@ -302,16 +302,28 @@ struct iremap_entry {
> >              vector  : 8,
> >              res_2   : 8,
> >              dst     : 32;
> > -    }lo;
> > -  };
> > -  union {
> > -    u64 hi_val;
> > +        u64 sid     : 16,
> > +            sq      : 2,
> > +            svt     : 2,
> > +            res_3   : 44;

For this, are we worth using u32 for this one?

        u32 sid: 16,
            sq: 2,
            svt: 2,
            res_3: 12;
        u32 res_4;


> > +    }remap;
> >      struct {
> > +        u64 p       : 1,
> > +            fpd     : 1,
> > +            res_1   : 6,
> > +            avail   : 4,
> > +            res_2   : 2,
> > +            urg     : 1,
> > +            im      : 1,
> > +            vector  : 8,
> > +            res_3   : 14,
> > +            pda_l   : 26;

Also this one?

        ...
                res_3: 8
        u32 res_4: 6,
            pda_l: 26;


> >          u64 sid     : 16,
> >              sq      : 2,
> >              svt     : 2,
> > -            res_1   : 44;

This one?

Thanks,
Feng

> > -    }hi;
> > +            res_4   : 12,
> > +            pda_h   : 32;
> > +    }post;
> >    };
> >  };
> 
> Same here - unless the VT-d maintainers disagree, I think using u32
> wherever possible would be preferable over using u64, as well as
> avoiding bitfields for members filling an entire word.
> 
> Also please fix the formatting (blanks between closing braces and field
> names).
> 
> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.