dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] MAP_POPULATE for device memory
@ 2022-03-06  5:32 Jarkko Sakkinen
  2022-03-06  5:32 ` [PATCH RFC 1/3] mm: Add f_ops->populate() Jarkko Sakkinen
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Jarkko Sakkinen @ 2022-03-06  5:32 UTC (permalink / raw)
  To: linux-mm
  Cc: Michal Hocko, zhangyiru, Daniel Vetter, Dave Hansen, dri-devel,
	Chris Wilson, Jason Ekstrand, Alexander Mikhalitsyn,
	Florian Fainelli, linux-unionfs, codalist, Matthew Auld,
	Vasily Averin, Thomas Hellström, intel-gfx, linux-mips,
	Shakeel Butt, Reinette Chatre, linux-sgx, Thomas Bogendoerfer,
	Nathaniel McCallum, Greg Kroah-Hartman, Tvrtko Ursulin,
	linux-kernel, Jarkko Sakkinen, linux-fsdevel, Andrew Morton,
	Alexey Gladkov

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_ops->populate() for the purpose.

SGX patches are provided to show the callback in context.

An obvious alternative is a ioctl but it is less 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 +-
 arch/x86/kernel/cpu/sgx/driver.c           | 129 +++++++++++++++++++++
 arch/x86/kernel/cpu/sgx/encl.c             |  38 ++++++
 arch/x86/kernel/cpu/sgx/encl.h             |   3 +
 arch/x86/kernel/cpu/sgx/ioctl.c            |  38 ------
 drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c |   2 +-
 fs/coda/file.c                             |   2 +-
 fs/overlayfs/file.c                        |   2 +-
 include/linux/fs.h                         |  12 +-
 include/linux/mm.h                         |   2 +-
 ipc/shm.c                                  |   2 +-
 mm/mmap.c                                  |  10 +-
 mm/nommu.c                                 |   4 +-
 13 files changed, 193 insertions(+), 53 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-03-08 10:11 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-06  5:32 [PATCH RFC 0/3] MAP_POPULATE for device memory Jarkko Sakkinen
2022-03-06  5:32 ` [PATCH RFC 1/3] mm: Add f_ops->populate() Jarkko Sakkinen
2022-03-06 10:01   ` Greg Kroah-Hartman
2022-03-06 17:02     ` Jarkko Sakkinen
2022-03-06 17:03       ` Jarkko Sakkinen
2022-03-06 22:43       ` Matthew Wilcox
2022-03-07 13:16         ` Jarkko Sakkinen
2022-03-07 13:26           ` Jarkko Sakkinen
2022-03-06  5:32 ` [PATCH RFC 2/3] x86/sgx: Export sgx_encl_page_alloc() Jarkko Sakkinen
2022-03-06  5:32 ` [PATCH RFC 3/3] x86/sgx: Implement EAUG population with MAP_POPULATE Jarkko Sakkinen
2022-03-06  8:30 ` [PATCH RFC 0/3] MAP_POPULATE for device memory David Laight
2022-03-06 16:52   ` 'Jarkko Sakkinen'
2022-03-06 11:33 ` Matthew Wilcox
     [not found]   ` <YiW4yurDXSifTYUt@infradead.org>
2022-03-07 13:29     ` Jarkko Sakkinen
     [not found]       ` <YiYrRWMp1akXY8Vb@infradead.org>
2022-03-07 15:58         ` Jarkko Sakkinen
2022-03-07 22:11         ` David Laight
2022-03-08 10:10           ` Jarkko Sakkinen
2022-03-07 10:12 ` David Hildenbrand
2022-03-07 14:22   ` Jarkko Sakkinen
2022-03-07 14:33     ` David Hildenbrand
2022-03-07 15:49       ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox