RE: [PATCH 01/14] iommu: Implement IOMMU LU FLB callbacks
From: Tian, Kevin
Date: Mon Apr 13 2026 - 02:44:50 EST
> From: Jason Gunthorpe <jgg@xxxxxxxx>
> Sent: Friday, April 10, 2026 9:52 PM
>
> On Wed, Mar 11, 2026 at 09:07:00PM +0000, Pranjal Shrivastava wrote:
> > > + if (!obj)
> > > + return -ENOMEM;
> > > +
> > > + mutex_init(&obj->lock);
> > > + BUG_ON(!kho_restore_folio(argp->data));
> >
> > The use of BUG_ON in new code is heavily discouraged [1].
> > If KHO can't restore the folio for whatever reason, we can be treat it
> > as a corruption of the handover data. I believe crashing the kernel for
> > it would be an overkill?
>
> There should not be any new BUG_ON's added at least they need some
> better wrapper function or design so they are not in end-users like
> this.
>
> But these cases need to fail by preventing the kernel from leaving the
> initial safe boot memory space (ie it is going to crash anyhow). If we
> can't recover things then we can't guarentee memory is not being
> scribbled on and we can't use it.
>
sounds in a constrained context similar to kdump...