Re: [PATCH v2 02/16] iommu: Implement IOMMU Live update FLB callbacks

From: Jason Gunthorpe

Date: Sat May 23 2026 - 09:30:16 EST


On Mon, May 18, 2026 at 11:52:34AM +0000, Pranjal Shrivastava wrote:
> On Fri, May 01, 2026 at 09:45:19PM +0000, David Matlack wrote:
>
> [...]
>
> > > +
> > > +/**
> > > + * struct iommu_hdr_ser - Common header for all serialized IOMMU objects
> > > + * @ref_count: Reference count for the object
> > > + * @deleted: Flag indicating if the object is deleted
> > > + * @incoming: Flag indicating if the object was preserved in previous kernel
> > > + */
> > > +struct iommu_hdr_ser {
> > > + u32 ref_count;
> > > + u32 deleted:1;
> > > + u32 incoming:1;
> >
> > Are C bitfields safe to use in Live Update ABI?
> >
>
> AFAIU, they aren't. The C standard does not dictate how bitfields are
> packed into their underlying types (e.g., whether they are packed MSB to
> LSB or vice-versa), making them highly dependent on the compiler and arch
> endianness.

Bitfield are defined in the SYSV UNIX ELF ABIs, they are stable for
kexec, but variable across arches how they lay out in memory.

Jason