Re: [PATCH v2 02/16] iommu: Implement IOMMU Live update FLB callbacks
From: Pranjal Shrivastava
Date: Mon May 18 2026 - 11:15:12 EST
On Mon, May 18, 2026 at 04:10:01PM +0200, Pratyush Yadav wrote:
> On Mon, May 18 2026, 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.
>
> I had the same question and Jason told me otherwise:
> https://lore.kernel.org/linux-mm/20250909155044.GN789684@xxxxxxxxxx/
>
> I took him at his word and didn't really look much deeper. I use them
> for memfd preservation as well. See struct memfd_luo_folio_ser in
> include/linux/kho/abi/memfd.h.
Ah I see.. I guess I agree if x86 has it.. Arm should too.. I'll try to
check this.
Thanks
Praan