Re: [PATCH v3 2/3] shared memory: Define PCI capability

From
Dr. David Alan Gilbert <>
Date
2019-03-07T18:25:02+00:00
ID
20190307182457.GM2811@work-vm
Thread
Re: [PATCH v3 2/3] shared memory: Define PCI capability
* Stefan Hajnoczi () wrote:
> On Mon, Mar 04, 2019 at 01:25:30PM +0000, Dr. David Alan Gilbert (git) wrote:
> > +\begin{lstlisting}
> > +struct virtio_pci_shm_cap {
> > +        struct virtio_pci_cap cap;
> > +        u32 offset_hi;
> > +        u32 length_hi;
> > +        u8  id;
> > +};
> > +\end{lstlisting}
> 
> Are there any alignment requirements for PCI capability structures?

The PCI spec says 'Each capability must be DWORD aligned. '

> This struct ends with a u8, which might be a problem if 32-bit or 64-bit
> alignemnt is required by something.

It doesn't seem to be unusual, for example the MSI capability structure
seems to be 10 or 14 bytes even with the DWORD alignement restriction
for the start of it.


> Otherwise:
> 
> Reviewed-by: Stefan Hajnoczi <>

Thanks,

Dave


--
Dr. David Alan Gilbert /  / Manchester, UK