Hi CLEMENT,

> > It still raises the size to 8 bytes but saves spare space, like:
> >
> > typedef struct MemTxAttrs {
> >      unsigned int secure:1;
> >      unsigned int space:2;
> >      unsigned int user:1;
> >      unsigned int memory:1;
> >      unsigned int requester_id:16;
> >      unsigned int pid:8;
> >      bool unspecified;
> >      uint8_t _reserved1;
> >      uint16_t _reserved2;
> > } MemTxAttrs;
> 
> Don't you think this will be an issue as some devices will need to
> support more than 256 PID/PASID? The PCIe spec allows using up to 20 bits.
>

Maybe we can have the layout of MeymTxAttrs like this:

typedef struct MemTxAttrs {
    unsigned int pid:20;
    uint16_t requester_id:16;
    uint8_t secure:1;
    uint8_t space:2;
    uint8_t user:1;
    uint8_t memory:1;
    bool unspecified;
} MemTxAttrs;

I think a finer granularity division could solve this issue. And
there're still some spare spaces :-).

Thanks,
Zhao


Reply via email to