lkml.org 
[lkml]   [2021]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH v3 7/8] vfio/type1: Add selective DMA faulting support
From
Date
On 2021/5/19 2:58, Alex Williamson wrote:
> On Fri, 9 Apr 2021 11:44:19 +0800
> Shenming Lu <lushenming@huawei.com> wrote:
>
>> Some devices only allow selective DMA faulting. Similar to the selective
>> dirty page tracking, the vendor driver can call vfio_pin_pages() to
>> indicate the non-faultable scope, we add a new struct vfio_range to
>> record it, then when the IOPF handler receives any page request out
>> of the scope, we can directly return with an invalid response.
>
> Seems like this highlights a deficiency in the design, that the user
> can't specify mappings as iopf enabled or disabled. Also, if the
> vendor driver has pinned pages within the range, shouldn't that prevent
> them from faulting in the first place? Why do we need yet more
> tracking structures? Pages pinned by the vendor driver need to count
> against the user's locked memory limits regardless of iopf. Thanks,

Currently we only have a vfio_pfn struct to track the external pinned pages
(single page granularity), so I add a vfio_range struct for efficient lookup.

Yeah, by this patch, for the non-pinned scope, we can directly return INVALID,
but for the pinned(non-faultable) scope, tracking the pinned range doesn't seem
to help more...

Thanks,
Shenming

>
> Alex
>
> .
>

\
 
 \ /
  Last update: 2021-05-21 08:42    [W:0.710 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site