Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751584AbbHTJvz (ORCPT ); Thu, 20 Aug 2015 05:51:55 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:39912 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751031AbbHTJvy (ORCPT ); Thu, 20 Aug 2015 05:51:54 -0400 X-IronPort-AV: E=Sophos;i="5.15,714,1432598400"; d="scan'208";a="296245323" Message-ID: <55D5A337.7090704@citrix.com> Date: Thu, 20 Aug 2015 10:51:51 +0100 From: David Vrabel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Julien Grall , CC: , , , , "Ingo Molnar" , David Vrabel , "H. Peter Anvin" , Boris Ostrovsky , "Thomas Gleixner" , Subject: Re: [Xen-devel] [PATCH v3 04/20] xen/grant: Introduce helpers to split a page into grant References: <1438966019-19322-1-git-send-email-julien.grall@citrix.com> <1438966019-19322-5-git-send-email-julien.grall@citrix.com> In-Reply-To: <1438966019-19322-5-git-send-email-julien.grall@citrix.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1311 Lines: 34 On 07/08/15 17:46, Julien Grall wrote: > Currently, a grant is always based on the Xen page granularity (i.e > 4KB). When Linux is using a different page granularity, a single page > will be split between multiple grants. > > The new helpers will be in charge to split the Linux page into grants and > call a function given by the caller on each grant. > > Also provide an helper to count the number of grants within a given > contiguous region. > > Note that the x86/include/asm/xen/page.h is now including > xen/interface/grant_table.h rather than xen/grant_table.h. It's > necessary because xen/grant_table.h depends on asm/xen/page.h and will > break the compilation. Furthermore, only definition in > interface/grant_table.h was required. Reviewed-by: David Vrabel But... > +/* Helper to get to call fn only on the first "grant chunk" */ > +static inline void gnttab_one_grant(struct page *page, unsigned int offset, > + unsigned len, xen_grant_fn_t fn, > + void *data) ...call this gnttab_for_one_grant(). David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/