lkml.org 
[lkml]   [2020]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 3/3] vfio-pci: Invalidate mmaps and block MMIO access on disabled memory
On Mon, May 25, 2020 at 09:26:07AM -0300, Jason Gunthorpe wrote:
> On Sat, May 23, 2020 at 07:52:57PM -0400, Peter Xu wrote:
>
> > For what I understand now, IMHO we should still need all those handlings of
> > FAULT_FLAG_RETRY_NOWAIT like in the initial version. E.g., IIUC KVM gup will
> > try with FOLL_NOWAIT when async is allowed, before the complete slow path. I'm
> > not sure what would be the side effect of that if fault() blocked it. E.g.,
> > the caller could be in an atomic context.
>
> AFAICT FAULT_FLAG_RETRY_NOWAIT only impacts what happens when
> VM_FAULT_RETRY is returned, which this doesn't do?

Yes, that's why I think we should still properly return VM_FAULT_RETRY if
needed.. because IMHO it is still possible that the caller calls with
FAULT_FLAG_RETRY_NOWAIT.

My understanding is that FAULT_FLAG_RETRY_NOWAIT majorly means:

- We cannot release the mmap_sem, and,
- We cannot sleep

But we're allowed to return VM_FAULT_RETRY if any of the above is necessary.

Thanks,

--
Peter Xu

\
 
 \ /
  Last update: 2020-05-25 16:28    [W:0.064 / U:1.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site