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

Re: [Xen-devel] [v3 09/15] vt-d: Extend struct iremap_entry to support VT-d Posted-Interrupts



>>> On 24.06.15 at 07:18, <feng.wu@xxxxxxxxx> wrote:
> --- a/xen/drivers/passthrough/vtd/iommu.h
> +++ b/xen/drivers/passthrough/vtd/iommu.h
> @@ -289,29 +289,43 @@ struct dma_pte {
>  /* interrupt remap entry */
>  struct iremap_entry {
>    union {
> -    u64 lo_val;
> +    struct { u64 lo, hi; };
>      struct {
> -        u64 p       : 1,
> +        u16 p       : 1,
>              fpd     : 1,
>              dm      : 1,
>              rh      : 1,
>              tm      : 1,
>              dlm     : 3,
>              avail   : 4,
> -            res_1   : 4,
> -            vector  : 8,
> -            res_2   : 8,
> -            dst     : 32;
> -    }lo;
> -  };
> -  union {
> -    u64 hi_val;
> +            res_1   : 4;
> +        u8  vector;
> +        u8  res_2;
> +        u32 dst;
> +        u16 sid;
> +        u16 sq      : 2,
> +            svt     : 2,
> +            res_3   : 12;
> +        u32 res_4   : 32;
> +    } remap;
>      struct {
> -        u64 sid     : 16,
> -            sq      : 2,
> +        u16 p       : 1,
> +            fpd     : 1,
> +            res_1   : 6,
> +            avail   : 4,
> +            res_2   : 2,
> +            urg     : 1,
> +            im      : 1;
> +        u8  vector;
> +        u8  res_3;
> +        u32 res_4   : 6,
> +            pda_l   : 26;
> +        u16 sid;
> +        u16 sq      : 2,
>              svt     : 2,
> -            res_1   : 44;
> -    }hi;
> +            res_5   : 12;
> +        u32 pda_h;
> +    } post;
>    };
>  };

Considering that various of the fields are identical between the two
formats I wonder whether that shouldn't be presented in the layout
here: sid, svt, sq, vector could all be a single structure field, with
other parts becoming sub-unions. Or would that cause problems
elsewhere?

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®.