From mboxrd@z Thu Jan 1 00:00:00 1970 From: julien.grall@citrix.com (Julien Grall) Date: Tue, 19 May 2015 15:18:24 +0100 Subject: [Xen-devel] [RFC 12/23] xen: Extend page_to_mfn to take an offset in the page In-Reply-To: <555B4167.7050506@citrix.com> References: <1431622863-28575-1-git-send-email-julien.grall@citrix.com> <1431622863-28575-13-git-send-email-julien.grall@citrix.com> <555B4167.7050506@citrix.com> Message-ID: <555B4630.8050304@citrix.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi David, On 19/05/15 14:57, David Vrabel wrote: > On 14/05/15 18:00, Julien Grall wrote: >> With 64KB page granularity support in Linux, a page will be split accross >> multiple MFN (Xen is using 4KB page granularity). Thoses MFNs may not be >> contiguous. >> >> With the offset in the page, the helper will be able to know which MFN >> the driver needs to retrieve. > > I think a gnttab_grant_foreign_access_ref()-like helper that takes a > page would be better. > > You will probably want this helper able to return/fill a set of refs for > 64 KiB pages. I will see what I can do. Although, I think this patch is still valid to avoid wrong usage with 64KB page granularity by the caller. The developer may think that MFN are contiguous which is not always true. Regards, -- Julien Grall From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964895AbbESOVa (ORCPT ); Tue, 19 May 2015 10:21:30 -0400 Received: from smtp.citrix.com ([66.165.176.89]:7284 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933082AbbESOV2 (ORCPT ); Tue, 19 May 2015 10:21:28 -0400 X-IronPort-AV: E=Sophos;i="5.13,458,1427760000"; d="scan'208";a="264030789" Message-ID: <555B4630.8050304@citrix.com> Date: Tue, 19 May 2015 15:18:24 +0100 From: Julien Grall User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: David Vrabel , Julien Grall , CC: , , , , , Boris Ostrovsky , Subject: Re: [Xen-devel] [RFC 12/23] xen: Extend page_to_mfn to take an offset in the page References: <1431622863-28575-1-git-send-email-julien.grall@citrix.com> <1431622863-28575-13-git-send-email-julien.grall@citrix.com> <555B4167.7050506@citrix.com> In-Reply-To: <555B4167.7050506@citrix.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, On 19/05/15 14:57, David Vrabel wrote: > On 14/05/15 18:00, Julien Grall wrote: >> With 64KB page granularity support in Linux, a page will be split accross >> multiple MFN (Xen is using 4KB page granularity). Thoses MFNs may not be >> contiguous. >> >> With the offset in the page, the helper will be able to know which MFN >> the driver needs to retrieve. > > I think a gnttab_grant_foreign_access_ref()-like helper that takes a > page would be better. > > You will probably want this helper able to return/fill a set of refs for > 64 KiB pages. I will see what I can do. Although, I think this patch is still valid to avoid wrong usage with 64KB page granularity by the caller. The developer may think that MFN are contiguous which is not always true. Regards, -- Julien Grall