On Tue, Jan 03, 2023 at 08:34:57AM -0800, Fenghua Yu wrote: > From: Dave Jiang <dave.jiang@xxxxxxxxx> > > Export access_remote_vm() symbol for driver usage. The idxd driver would > like to use it to write the user's completion record that the hardware > device is not able to write to due to user page fault. > > Tested-by: Tony Zhu <tony.zhu@xxxxxxxxx> > Signed-off-by: Dave Jiang <dave.jiang@xxxxxxxxx> > Co-developed-by: Fenghua Yu <fenghua.yu@xxxxxxxxx> > Signed-off-by: Fenghua Yu <fenghua.yu@xxxxxxxxx> > Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > Cc: linux-mm@xxxxxxxxx > --- > mm/memory.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/memory.c b/mm/memory.c > index aad226daf41b..caae4deff987 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -5579,6 +5579,7 @@ int access_remote_vm(struct mm_struct *mm, unsigned long addr, > { > return __access_remote_vm(mm, addr, buf, len, gup_flags); > } > +EXPORT_SYMBOL_GPL(access_remote_vm); > > /* > * Access another process' address space. > -- > 2.32.0 > Can you explain what use case you have for exporting this? Currently this is only used by procfs. Additionally, it relies on a reference count being held on the mm which seems a little risky exposing to a driver. Is there a reason you can't use access_process_vm() which is exported and additionally handles the refrencing?