Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-04-05 Thread Christian Brauner
On Mon, Mar 17, 2025 at 01:59:05PM -0300, Jason Gunthorpe wrote: > On Sun, Mar 09, 2025 at 01:03:31PM +0100, Christian Brauner wrote: > > > So either that work is done right from the start or that stashing files > > goes out the window and instead that KHO part is implemented in a way > > where du

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-04-05 Thread Jason Gunthorpe
On Wed, Mar 19, 2025 at 01:35:31PM +, Pratyush Yadav wrote: > On Tue, Mar 18 2025, Jason Gunthorpe wrote: > > > On Tue, Mar 18, 2025 at 11:02:31PM +, Pratyush Yadav wrote: > > > >> I suppose we can serialize all FDs when the box is sealed and get rid of > >> the struct file. If kexec fails

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-31 Thread Jason Gunthorpe
On Wed, Mar 26, 2025 at 10:40:29PM +, Pratyush Yadav wrote: > Ideally, kho_preserve_folio() should be similar to freeing the folio, > except that it doesn't go to buddy for re-allocation. In that case, > re-using those pages should not be a problem as long as the driver made > sure the page was

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-26 Thread Pratyush Yadav
On Thu, Mar 20 2025, Jason Gunthorpe wrote: > On Wed, Mar 19, 2025 at 01:35:31PM +, Pratyush Yadav wrote: >> On Tue, Mar 18 2025, Jason Gunthorpe wrote: >> >> > On Tue, Mar 18, 2025 at 11:02:31PM +, Pratyush Yadav wrote: >> > >> >> I suppose we can serialize all FDs when the box is sealed

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-19 Thread Pratyush Yadav
On Tue, Mar 18 2025, Jason Gunthorpe wrote: > On Tue, Mar 18, 2025 at 11:02:31PM +, Pratyush Yadav wrote: > >> I suppose we can serialize all FDs when the box is sealed and get rid of >> the struct file. If kexec fails, userspace can unseal the box, and FDs >> will be deserialized into a new s

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-18 Thread Jason Gunthorpe
On Tue, Mar 18, 2025 at 11:02:31PM +, Pratyush Yadav wrote: > I suppose we can serialize all FDs when the box is sealed and get rid of > the struct file. If kexec fails, userspace can unseal the box, and FDs > will be deserialized into a new struct file. This way, the behaviour > from userspac

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-18 Thread Pratyush Yadav
On Tue, Mar 18 2025, Jason Gunthorpe wrote: > On Tue, Mar 18, 2025 at 03:25:25PM +0100, Christian Brauner wrote: > >> > It is not really a stash, it is not keeping files, it is hardwired to >> >> Right now as written it is keeping references to files in these fdboxes >> and thus functioning both

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-18 Thread Jason Gunthorpe
On Tue, Mar 18, 2025 at 03:25:25PM +0100, Christian Brauner wrote: > > It is not really a stash, it is not keeping files, it is hardwired to > > Right now as written it is keeping references to files in these fdboxes > and thus functioning both as a crippled high-privileged fdstore and a > serial

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-17 Thread Jason Gunthorpe
On Sun, Mar 09, 2025 at 01:03:31PM +0100, Christian Brauner wrote: > So either that work is done right from the start or that stashing files > goes out the window and instead that KHO part is implemented in a way > where during a KHO dump relevant userspace is notified that they must > now seriali

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-17 Thread Jason Gunthorpe
On Sat, Mar 08, 2025 at 12:09:53PM +0100, Christian Brauner wrote: > On Fri, Mar 07, 2025 at 11:14:17AM -0400, Jason Gunthorpe wrote: > > On Fri, Mar 07, 2025 at 10:31:39AM +0100, Christian Brauner wrote: > > > On Fri, Mar 07, 2025 at 12:57:35AM +, Pratyush Yadav wrote: > > > > The File Descrip

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-09 Thread Christian Brauner
On Sat, Mar 08, 2025 at 12:10:12AM +, Pratyush Yadav wrote: > Hi Christian, > > Thanks for the review! No worries, I'm not trying to be polemic. It's just that this whole proposed concept is pretty lightweight in terms of thinking about possible implications. > > This use-case is covered wit

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-08 Thread Christian Brauner
On Fri, Mar 07, 2025 at 11:14:17AM -0400, Jason Gunthorpe wrote: > On Fri, Mar 07, 2025 at 10:31:39AM +0100, Christian Brauner wrote: > > On Fri, Mar 07, 2025 at 12:57:35AM +, Pratyush Yadav wrote: > > > The File Descriptor Box (FDBox) is a mechanism for userspace to name > > > file descriptors

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-07 Thread Pratyush Yadav
Hi Christian, Thanks for the review! On Fri, Mar 07 2025, Christian Brauner wrote: > On Fri, Mar 07, 2025 at 12:57:35AM +, Pratyush Yadav wrote: >> The File Descriptor Box (FDBox) is a mechanism for userspace to name >> file descriptors and give them over to the kernel to hold. They can >> l

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-07 Thread Christian Brauner
On Fri, Mar 07, 2025 at 10:31:39AM +0100, Christian Brauner wrote: > On Fri, Mar 07, 2025 at 12:57:35AM +, Pratyush Yadav wrote: > > The File Descriptor Box (FDBox) is a mechanism for userspace to name > > file descriptors and give them over to the kernel to hold. They can > > later be retrieve

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-07 Thread Christian Brauner
On Fri, Mar 07, 2025 at 12:57:35AM +, Pratyush Yadav wrote: > The File Descriptor Box (FDBox) is a mechanism for userspace to name > file descriptors and give them over to the kernel to hold. They can > later be retrieved by passing in the same name. > > The primary purpose of FDBox is to be u

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-07 Thread Jason Gunthorpe
On Fri, Mar 07, 2025 at 10:31:39AM +0100, Christian Brauner wrote: > On Fri, Mar 07, 2025 at 12:57:35AM +, Pratyush Yadav wrote: > > The File Descriptor Box (FDBox) is a mechanism for userspace to name > > file descriptors and give them over to the kernel to hold. They can > > later be retrieve

Re: [RFC PATCH 1/5] misc: introduce FDBox

2025-03-06 Thread Greg Kroah-Hartman
One quick review note: On Fri, Mar 07, 2025 at 12:57:35AM +, Pratyush Yadav wrote: > +/** > + * struct fdbox - A box of FDs. > + * @name: Name of the box. Must be unique. > + * @rwsem: Used to ensure exclusive access to the box during SEAL/UNSEAL > + * operations. > + * @dev: Backing d