Re: [Intel-gfx] [PATCH RFC 0/3] MAP_POPULATE for device memory

2022-03-08 Thread Jarkko Sakkinen
On Sun, Mar 06, 2022 at 11:48:26PM -0800, Christoph Hellwig wrote: > On Sun, Mar 06, 2022 at 11:33:02AM +, Matthew Wilcox wrote: > > On Sun, Mar 06, 2022 at 07:32:04AM +0200, Jarkko Sakkinen wrote: > > > For device memory (aka VM_IO | VM_PFNMAP) MAP_POPULATE does nothing.

Re: [Intel-gfx] [PATCH RFC 0/3] MAP_POPULATE for device memory

2022-03-08 Thread Jarkko Sakkinen
On Mon, Mar 07, 2022 at 03:33:52PM +0100, David Hildenbrand wrote: > On 07.03.22 15:22, Jarkko Sakkinen wrote: > > On Mon, Mar 07, 2022 at 11:12:44AM +0100, David Hildenbrand wrote: > >> On 06.03.22 06:32, Jarkko Sakkinen wrote: > >>> For device memory (aka VM_IO

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

2022-03-08 Thread Jarkko Sakkinen
On Mon, Mar 07, 2022 at 02:37:48PM +, Matthew Wilcox wrote: > On Sun, Mar 06, 2022 at 03:41:54PM -0800, Dave Hansen wrote: > > In short: page faults stink. The core kernel has lots of ways of > > avoiding page faults like madvise(MADV_WILLNEED) or mmap(MAP_POPULATE). > > But, those only work

Re: [Intel-gfx] [PATCH RFC 0/3] MAP_POPULATE for device memory

2022-03-08 Thread Jarkko Sakkinen
On Mon, Mar 07, 2022 at 07:56:53AM -0800, Christoph Hellwig wrote: > On Mon, Mar 07, 2022 at 03:29:35PM +0200, Jarkko Sakkinen wrote: > > So what would you suggest to sort out the issue? I'm happy to go with > > ioctl if nothing else is acceptable. > > PLenty of dri

Re: [Intel-gfx] [PATCH RFC 0/3] MAP_POPULATE for device memory

2022-03-08 Thread Jarkko Sakkinen
On Mon, Mar 07, 2022 at 10:11:19PM +, David Laight wrote: > From: Christoph Hellwig > > Sent: 07 March 2022 15:57 > > > > On Mon, Mar 07, 2022 at 03:29:35PM +0200, Jarkko Sakkinen wrote: > > > So what would you suggest to sort out the issue? I'm happy to go

Re: [Intel-gfx] [PATCH RFC 1/3] mm: Add f_ops->populate()

2022-03-08 Thread Jarkko Sakkinen
On Sun, Mar 06, 2022 at 10:43:31PM +, Matthew Wilcox wrote: > On Sun, Mar 06, 2022 at 07:02:57PM +0200, Jarkko Sakkinen wrote: > > So can I conclude from this that in general having populate available for > > device memory is something horrid, or just the implementation path? &

Re: [Intel-gfx] [PATCH RFC 1/3] mm: Add f_ops->populate()

2022-03-08 Thread Jarkko Sakkinen
On Mon, Mar 07, 2022 at 03:16:57PM +0200, Jarkko Sakkinen wrote: > On Sun, Mar 06, 2022 at 10:43:31PM +, Matthew Wilcox wrote: > > On Sun, Mar 06, 2022 at 07:02:57PM +0200, Jarkko Sakkinen wrote: > > > So can I conclude from this that in general having populate availabl

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

2022-03-08 Thread Jarkko Sakkinen
On Mon, Mar 07, 2022 at 07:29:22AM -0800, Dave Hansen wrote: > On 3/7/22 03:27, Jarkko Sakkinen wrote: > > But e.g. in __mm_populate() anything with (VM_IO | VM_PFNMAP) gets > > filtered out and never reach that function. > > > > I don't know unorthodox that

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

2022-03-08 Thread Jarkko Sakkinen
On Sun, Mar 06, 2022 at 03:24:56PM -0800, Andrew Morton wrote: > On Sun, 6 Mar 2022 05:26:55 +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 &

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

2022-03-08 Thread Jarkko Sakkinen
On Sun, Mar 06, 2022 at 03:41:54PM -0800, Dave Hansen wrote: > On 3/6/22 15:24, Andrew Morton wrote: > > On Sun, 6 Mar 2022 05:26:55 +0200 Jarkko Sakkinen > > wrote: > > > >> Sometimes you might want to use MAP_POPULATE to ask a device driver to > >&g

Re: [Intel-gfx] [PATCH RFC 0/3] MAP_POPULATE for device memory

2022-03-08 Thread Jarkko Sakkinen
On Mon, Mar 07, 2022 at 11:12:44AM +0100, David Hildenbrand wrote: > On 06.03.22 06:32, Jarkko Sakkinen wrote: > > For device memory (aka VM_IO | VM_PFNMAP) MAP_POPULATE does nothing. Allow > > to use that for initializing the device memory by providing a new callback > > f_op

[Intel-gfx] [PATCH RFC 0/3] MAP_POPULATE for device memory

2022-03-07 Thread Jarkko Sakkinen
ess elegant and requires two syscalls (mmap + ioctl) per memory range, instead of just one (mmap). Jarkko Sakkinen (3): mm: Add f_ops->populate() x86/sgx: Export sgx_encl_page_alloc() x86/sgx: Implement EAUG population with MAP_POPULATE arch/mips/kernel/vdso.c| 2 +- ar

[Intel-gfx] [PATCH RFC 3/3] x86/sgx: Implement EAUG population with MAP_POPULATE

2022-03-07 Thread Jarkko Sakkinen
enclave with mmap() by populating pages with EAUG. Use f_ops->populate() callback to achieve this behaviour. Signed-off-by: Jarkko Sakkinen --- arch/x86/kernel/cpu/sgx/driver.c | 129 +++ 1 file changed, 129 insertions(+) diff --git a/arch/x86/kernel/cpu/sgx/driver.

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

2022-03-07 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

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

2022-03-07 Thread Jarkko Sakkinen
ops->mmap() and make it conditionally called inside call_mmap(). Update call sites accodingly. Signed-off-by: Jarkko Sakkinen --- arch/mips/kernel/vdso.c| 2 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- fs/coda/file.c | 2 +- fs/ove

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

2022-03-07 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: > >

[Intel-gfx] [PATCH RFC 2/3] x86/sgx: Export sgx_encl_page_alloc()

2022-03-07 Thread Jarkko Sakkinen
Move sgx_encl_page_alloc() to encl.c and export it so that it can be used in the implementation for MAP_POPULATE, which requires to allocate new enclave pages. Signed-off-by: Jarkko Sakkinen --- arch/x86/kernel/cpu/sgx/encl.c | 38 + arch/x86/kernel/cpu/sgx

[Intel-gfx] [PATCH RFC 1/3] mm: Add f_ops->populate()

2022-03-07 Thread Jarkko Sakkinen
ops->mmap() and make it conditionally called inside call_mmap(). Update call sites accodingly. --- Signed-off-by: Jarkko Sakkinen v3: - if (!ret && do_populate && file->f_op->populate) + if (!ret && do_populate && file->f_op->populate &a

Re: [Intel-gfx] [PATCH RFC 0/3] MAP_POPULATE for device memory

2022-03-07 Thread 'Jarkko Sakkinen'
On Sun, Mar 06, 2022 at 08:30:14AM +, David Laight wrote: > From: Jarkko Sakkinen > > Sent: 06 March 2022 05:32 > > > > For device memory (aka VM_IO | VM_PFNMAP) MAP_POPULATE does nothing. Allow > > to use that for initializing the device memory by providing a new c

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

2022-03-07 Thread Jarkko Sakkinen
ops->mmap() and make it conditionally called inside call_mmap(). Update call sites accodingly. Signed-off-by: Jarkko Sakkinen --- arch/mips/kernel/vdso.c| 2 +- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- fs/coda/file.c | 2 +- fs/ove

Re: [Intel-gfx] [PATCH RFC 1/3] mm: Add f_ops->populate()

2022-03-07 Thread Jarkko Sakkinen
On Sun, Mar 06, 2022 at 11:01:36AM +0100, Greg Kroah-Hartman wrote: > On Sun, Mar 06, 2022 at 07:32:05AM +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

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

2022-03-07 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: > >

Re: [Intel-gfx] [PATCH RFC 1/3] mm: Add f_ops->populate()

2022-03-07 Thread Jarkko Sakkinen
On Sun, Mar 06, 2022 at 07:03:00PM +0200, Jarkko Sakkinen wrote: > On Sun, Mar 06, 2022 at 11:01:36AM +0100, Greg Kroah-Hartman wrote: > > On Sun, Mar 06, 2022 at 07:32:05AM +0200, Jarkko Sakkinen wrote: > > > Sometimes you might want to use MAP_POPULATE to ask a device driver t

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

2022-03-07 Thread Jarkko Sakkinen
ops->mmap() and make it conditionally called inside call_mmap(). Update call sites accodingly. Signed-off-by: Jarkko Sakkinen --- v2: - if (!ret && do_populate) + if (!ret && do_populate && file->f_op->populate) (reported by Jan Harkes) --- arch/mips/k

Re: [Intel-gfx] [PATCH v3 3/4] tpm_tis: Disable interrupts if interrupt storm detected

2020-12-09 Thread Jarkko Sakkinen
On Mon, Dec 07, 2020 at 11:58:44AM -0800, James Bottomley wrote: > On Mon, 2020-12-07 at 15:28 -0400, Jason Gunthorpe wrote: > > On Sun, Dec 06, 2020 at 08:26:16PM +0100, Thomas Gleixner wrote: > > > Just as a side note. I was looking at tpm_tis_probe_irq_single() > > > and that function is leaking

Re: [Intel-gfx] [PATCH v3 2/4] drm/i915/pmu: Use kstat_irqs to get interrupt count

2020-12-09 Thread Jarkko Sakkinen
On Sun, Dec 06, 2020 at 10:33:09PM +0100, Thomas Gleixner wrote: > On Sun, Dec 06 2020 at 17:38, Thomas Gleixner wrote: > > On Fri, Dec 04 2020 at 18:43, Jerry Snitselaar wrote: > >> Now that kstat_irqs is exported, get rid of count_interrupts in > >> i915_pmu.c > > > > May I ask why this has been

Re: [Intel-gfx] [PATCH v3 3/4] tpm_tis: Disable interrupts if interrupt storm detected

2020-12-09 Thread Jarkko Sakkinen
On Mon, Dec 07, 2020 at 03:28:03PM -0400, Jason Gunthorpe wrote: > On Sun, Dec 06, 2020 at 08:26:16PM +0100, Thomas Gleixner wrote: > > Just as a side note. I was looking at tpm_tis_probe_irq_single() and > > that function is leaking the interrupt request if any of the checks > > afterwards fails,

Re: [Intel-gfx] [PATCH v3 1/4] irq: export kstat_irqs

2020-12-06 Thread Jarkko Sakkinen
by: kernel test robot I'm not sure if this makes much sense. > Cc: Thomas Gleixner > Cc: Jarkko Sakkinen > Cc: Jason Gunthorpe > Cc: Peter Huewe > Cc: James Bottomley > Cc: Matthew Garrett > Cc: Hans de Goede > Signed-off-by: Jerry Snitselaar /Jarkko ___

Re: [Intel-gfx] [PATCH v2 5/5] ACPI: Switch to use generic guid_t in acpi_evaluate_dsm()

2017-06-01 Thread Jarkko Sakkinen
conversion and it's safe to > get rid of it. > > Cc: Borislav Petkov > Cc: Dan Williams > Cc: Amir Goldstein > Cc: Jarkko Sakkinen > Reviewed-by: Jani Nikula > Acked-by: Jani Nikula > Cc: Ben Skeggs > Acked-by: Benjamin Tissoires > Acked-by: Joerg Roe