[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v3 1/9] mm: Introduce new vm_insert_range API
- To: Robin Murphy <robin.murphy@xxxxxxx>
- From: Matthew Wilcox <willy@xxxxxxxxxxxxx>
- Date: Fri, 7 Dec 2018 09:11:16 -0800
- Cc: mhocko@xxxxxxxx, heiko@xxxxxxxxx, peterz@xxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, linux1394-devel@xxxxxxxxxxxxxxxxxxxxx, m.szyprowski@xxxxxxxxxxx, sfr@xxxxxxxxxxxxxxxx, oleksandr_andrushchenko@xxxxxxxx, joro@xxxxxxxxxx, linux@xxxxxxxxxxxxxxx, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, airlied@xxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-rockchip@xxxxxxxxxxxxxxxxxxx, treding@xxxxxxxxxx, linux-media@xxxxxxxxxxxxxxx, keescook@xxxxxxxxxxxx, pawel@xxxxxxxxxx, riel@xxxxxxxxxxx, rppt@xxxxxxxxxxxxxxxxxx, boris.ostrovsky@xxxxxxxxxx, mchehab@xxxxxxxxxx, iamjoonsoo.kim@xxxxxxx, vbabka@xxxxxxx, jgross@xxxxxxxx, hjc@xxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxx, kyungmin.park@xxxxxxxxxxx, stefanr@xxxxxxxxxxxxxxxxx, Souptick Joarder <jrdr.linux@xxxxxxxxx>, akpm@xxxxxxxxxxxxxxxxxxxx, kirill.shutemov@xxxxxxxxxxxxxxx
- Delivery-date: Fri, 07 Dec 2018 17:12:29 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri, Dec 07, 2018 at 03:34:56PM +0000, Robin Murphy wrote:
> > +int vm_insert_range(struct vm_area_struct *vma, unsigned long addr,
> > + struct page **pages, unsigned long page_count)
> > +{
> > + unsigned long uaddr = addr;
> > + int ret = 0, i;
>
> Some of the sites being replaced were effectively ensuring that vma and
> pages were mutually compatible as an initial condition - would it be worth
> adding something here for robustness, e.g.:
>
> + if (page_count != vma_pages(vma))
> + return -ENXIO;
I think we want to allow this to be used to populate part of a VMA.
So perhaps:
if (page_count > vma_pages(vma))
return -ENXIO;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|