[PATCH RFC] mm: Add f_ops->populate()

2022-03-07 Thread Jarkko Sakkinen
Sometimes you might want to use MAP_POPULATE to ask a device driver to initialize the device memory in some specific manner. SGX driver can use this to request more memory by issuing ENCLS[EAUG] x86 opcode for each page in the address range. Add f_ops->populate() with the same parameters as

Re: [PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Matthew Wilcox
On Sun, Mar 06, 2022 at 06:25:52AM +0200, Jarkko Sakkinen wrote: > > Are you deliberately avoiding the question? I'm not asking about > > implementation. I'm asking about the semantics of MAP_POPULATE with > > your driver. > > No. I just noticed a bug in the guard from your comment that I

Re: [PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Jarkko Sakkinen
On Sun, Mar 06, 2022 at 04:19:26AM +, Matthew Wilcox wrote: > On Sun, Mar 06, 2022 at 06:11:21AM +0200, Jarkko Sakkinen wrote: > > On Sun, Mar 06, 2022 at 03:52:12AM +, Matthew Wilcox wrote: > > > On Sun, Mar 06, 2022 at 05:21:11AM +0200, Jarkko Sakkinen wrote: > > > > On Sun, Mar 06, 2022

Re: [PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Matthew Wilcox
On Sun, Mar 06, 2022 at 06:11:21AM +0200, Jarkko Sakkinen wrote: > On Sun, Mar 06, 2022 at 03:52:12AM +, Matthew Wilcox wrote: > > On Sun, Mar 06, 2022 at 05:21:11AM +0200, Jarkko Sakkinen wrote: > > > On Sun, Mar 06, 2022 at 02:57:55AM +, Matthew Wilcox wrote: > > > > On Sun, Mar 06, 2022

Re: [PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Jarkko Sakkinen
On Sun, Mar 06, 2022 at 03:52:12AM +, Matthew Wilcox wrote: > On Sun, Mar 06, 2022 at 05:21:11AM +0200, Jarkko Sakkinen wrote: > > On Sun, Mar 06, 2022 at 02:57:55AM +, Matthew Wilcox wrote: > > > On Sun, Mar 06, 2022 at 04:15:33AM +0200, Jarkko Sakkinen wrote: > > > > Sometimes you might

Re: [PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Matthew Wilcox
On Sun, Mar 06, 2022 at 05:21:11AM +0200, Jarkko Sakkinen wrote: > On Sun, Mar 06, 2022 at 02:57:55AM +, Matthew Wilcox wrote: > > On Sun, Mar 06, 2022 at 04:15:33AM +0200, Jarkko Sakkinen wrote: > > > Sometimes you might want to use MAP_POPULATE to ask a device driver to > > > initialize the

Re: [PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Jarkko Sakkinen
On Sun, Mar 06, 2022 at 02:57:55AM +, Matthew Wilcox wrote: > On Sun, Mar 06, 2022 at 04:15:33AM +0200, Jarkko Sakkinen wrote: > > Sometimes you might want to use MAP_POPULATE to ask a device driver to > > initialize the device memory in some specific manner. SGX driver can use > > this to

Re: [PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Matthew Wilcox
On Sun, Mar 06, 2022 at 04:15:33AM +0200, Jarkko Sakkinen wrote: > Sometimes you might want to use MAP_POPULATE to ask a device driver to > initialize the device memory in some specific manner. SGX driver can use > this to request more memory by issuing ENCLS[EAUG] x86 opcode for each > page in

[PATCH RFC] mm: Add f_ops->populate()

2022-03-05 Thread Jarkko Sakkinen
Sometimes you might want to use MAP_POPULATE to ask a device driver to initialize the device memory in some specific manner. SGX driver can use this to request more memory by issuing ENCLS[EAUG] x86 opcode for each page in the address range. Add f_ops->populate() with the same parameters as