All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] mm, kvm: add guest_memfd support for uffd minor faults
@ 2025-11-25 18:38 Mike Rapoport
  2025-11-25 18:38 ` [PATCH v2 1/5] userfaultfd: move vma_can_userfault out of line Mike Rapoport
                   ` (4 more replies)
  0 siblings, 5 replies; 33+ messages in thread
From: Mike Rapoport @ 2025-11-25 18:38 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrea Arcangeli, Andrew Morton, Axel Rasmussen, Baolin Wang,
	David Hildenbrand, Hugh Dickins, James Houghton, Liam R. Howlett,
	Lorenzo Stoakes, Michal Hocko, Mike Rapoport, Nikita Kalyazin,
	Paolo Bonzini, Peter Xu, Sean Christopherson, Shuah Khan,
	Suren Baghdasaryan, Vlastimil Babka, linux-kernel, kvm,
	linux-kselftest

From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>

Hi,

These patches allow guest_memfd to notify userspace about minor page
faults using userfaultfd and let userspace to resolve these page faults
using UFFDIO_CONTINUE.

To allow UFFDIO_CONTINUE outside of the core mm I added a get_shmem_folio()
callback to vm_ops that allows an address space backing a VMA to return a
folio that exists in it's page cache (patch 2)

In order for guest_memfd to notify userspace about page faults, there is a
new VM_FAULT_UFFD_MINOR that a ->fault() handler can return to inform the
page fault handler that it needs to call handle_userfault() to complete the
fault (patch 3).
 
Patch 4 plumbs these new goodies into guest_memfd.

This series is the minimal change I've been able to come up with to allow
integration of guest_memfd with uffd and while refactoring uffd and making
mfill_atomic() flow more linear would have been a nice improvement, it's
way out of the scope of enabling uffd with guest_memfd.

v2 changes:
* rename ->get_shared_folio() to ->get_folio()
* hardwire VM_FAULF_UFFD_MINOR to 0 when CONFIG_USERFAULTFD=n

v1: https://patch.msgid.link/20251123102707.559422-1-rppt@kernel.org
* Introduce VM_FAULF_UFFD_MINOR to avoid exporting handle_userfault()
* Simplify vma_can_mfill_atomic()
* Rename get_pagecache_folio() to get_shared_folio() and use inode
  instead of vma as its argument

rfc: https://patch.msgid.link/20251117114631.2029447-1-rppt@kernel.org

Mike Rapoport (Microsoft) (4):
  userfaultfd: move vma_can_userfault out of line
  userfaultfd, shmem: use a VMA callback to handle UFFDIO_CONTINUE
  mm: introduce VM_FAULT_UFFD_MINOR fault reason
  guest_memfd: add support for userfaultfd minor mode

Nikita Kalyazin (1):
  KVM: selftests: test userfaultfd minor for guest_memfd

 include/linux/mm.h                            |   9 ++
 include/linux/mm_types.h                      |  10 +-
 include/linux/userfaultfd_k.h                 |  36 +-----
 mm/memory.c                                   |   2 +
 mm/shmem.c                                    |  20 +++-
 mm/userfaultfd.c                              |  80 +++++++++++---
 .../testing/selftests/kvm/guest_memfd_test.c  | 103 ++++++++++++++++++
 virt/kvm/guest_memfd.c                        |  28 +++++
 8 files changed, 236 insertions(+), 52 deletions(-)


base-commit: 6a23ae0a96a600d1d12557add110e0bb6e32730c
-- 
2.50.1


^ permalink raw reply	[flat|nested] 33+ messages in thread
* Re: [PATCH v2 3/5] mm: introduce VM_FAULT_UFFD_MINOR fault reason
@ 2025-11-26  4:24 kernel test robot
  0 siblings, 0 replies; 33+ messages in thread
From: kernel test robot @ 2025-11-26  4:24 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence bisect report"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20251125183840.2368510-4-rppt@kernel.org>
References: <20251125183840.2368510-4-rppt@kernel.org>
TO: Mike Rapoport <rppt@kernel.org>

Hi Mike,

kernel test robot noticed the following build errors:

[auto build test ERROR on 6a23ae0a96a600d1d12557add110e0bb6e32730c]

url:    https://github.com/intel-lab-lkp/linux/commits/Mike-Rapoport/userfaultfd-move-vma_can_userfault-out-of-line/20251126-024059
base:   6a23ae0a96a600d1d12557add110e0bb6e32730c
patch link:    https://lore.kernel.org/r/20251125183840.2368510-4-rppt%40kernel.org
patch subject: [PATCH v2 3/5] mm: introduce VM_FAULT_UFFD_MINOR fault reason
:::::: branch date: 10 hours ago
:::::: commit date: 10 hours ago
config: riscv-allnoconfig-bpf (https://download.01.org/0day-ci/archive/20251126/202511261233.RgfmIwhI-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251126/202511261233.RgfmIwhI-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202511261233.RgfmIwhI-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from ./include/trace/define_trace.h:132,
                    from ./include/trace/events/f2fs.h:2407,
                    from fs/f2fs/super.c:41:
   ./include/trace/events/f2fs.h: In function 'trace_raw_output_f2fs_mmap':
>> ./include/trace/stages/stage3_trace_output.h:70:37: error: expected expression before ',' token
      70 |                         { flag_array, { -1, NULL }};                    \
         |                                     ^
   ./include/trace/trace_events.h:219:34: note: in definition of macro 'DECLARE_EVENT_CLASS'
     219 |         trace_event_printf(iter, print);                                \
         |                                  ^~~~~
   ./include/trace/events/f2fs.h:1432:9: note: in expansion of macro 'TP_printk'
    1432 |         TP_printk("dev = (%d,%d), ino = %lu, index = %lu, flags: %s, ret: %s",
         |         ^~~~~~~~~
   ./include/trace/events/f2fs.h:1436:17: note: in expansion of macro '__print_flags'
    1436 |                 __print_flags(__entry->ret, "|", VM_FAULT_RESULT_TRACE))
         |                 ^~~~~~~~~~~~~


vim +70 ./include/trace/stages/stage3_trace_output.h

1bc191051dca28 include/trace/stages/stage3_defines.h Linus Torvalds          2022-03-23  65  
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google  2022-03-03  66) #undef __print_flags
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google  2022-03-03  67) #define __print_flags(flag, delim, flag_array...)			\
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google  2022-03-03  68) 	({								\
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google  2022-03-03  69) 		static const struct trace_print_flags __flags[] =	\
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google  2022-03-03 @70) 			{ flag_array, { -1, NULL }};			\
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google  2022-03-03  71) 		trace_print_flags_seq(p, delim, flag, __flags);	\
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google  2022-03-03  72) 	})
af6b9668e85ffd include/trace/stages/stage3_defines.h Steven Rostedt (Google  2022-03-03  73) 

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2025-11-30 11:05 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25 18:38 [PATCH v2 0/5] mm, kvm: add guest_memfd support for uffd minor faults Mike Rapoport
2025-11-25 18:38 ` [PATCH v2 1/5] userfaultfd: move vma_can_userfault out of line Mike Rapoport
2025-11-26 15:05   ` Liam R. Howlett
2025-11-25 18:38 ` [PATCH v2 2/5] userfaultfd, shmem: use a VMA callback to handle UFFDIO_CONTINUE Mike Rapoport
2025-11-26 10:21   ` David Hildenbrand (Red Hat)
2025-11-26 15:11   ` Liam R. Howlett
2025-11-25 18:38 ` [PATCH v2 3/5] mm: introduce VM_FAULT_UFFD_MINOR fault reason Mike Rapoport
2025-11-25 19:21   ` Peter Xu
2025-11-27 11:18     ` Mike Rapoport
2025-11-27 14:10       ` Peter Xu
2025-11-30 11:05         ` Mike Rapoport
2025-11-26 10:19   ` David Hildenbrand (Red Hat)
2025-11-26 12:47   ` kernel test robot
2025-11-26 15:19   ` Liam R. Howlett
2025-11-26 16:49   ` Nikita Kalyazin
2025-11-28  1:48   ` kernel test robot
2025-11-28  3:07   ` kernel test robot
2025-11-25 18:38 ` [PATCH v2 4/5] guest_memfd: add support for userfaultfd minor mode Mike Rapoport
2025-11-26 10:25   ` David Hildenbrand (Red Hat)
2025-11-26 15:22   ` Liam R. Howlett
2025-11-26 16:21   ` kernel test robot
2025-11-26 16:49   ` Nikita Kalyazin
2025-11-27 10:36     ` Mike Rapoport
2025-11-27 11:19       ` Nikita Kalyazin
2025-11-27 19:04         ` Mike Rapoport
2025-11-28 12:15           ` Nikita Kalyazin
2025-11-27 11:27       ` David Hildenbrand (Red Hat)
2025-11-28  3:27   ` kernel test robot
2025-11-25 18:38 ` [PATCH v2 5/5] KVM: selftests: test userfaultfd minor for guest_memfd Mike Rapoport
2025-11-26 15:23   ` Liam R. Howlett
2025-11-26 16:49   ` Nikita Kalyazin
2025-11-27 10:39     ` Mike Rapoport
  -- strict thread matches above, loose matches on Subject: below --
2025-11-26  4:24 [PATCH v2 3/5] mm: introduce VM_FAULT_UFFD_MINOR fault reason kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.