From: Julien Grall Subject: [RFC 1/2] xen/mm: Clarify the granularity for each Frame Number Date: Wed, 5 Aug 2015 12:28:52 +0100 Message-ID: <1438774133-1564-2-git-send-email-julien.grall@citrix.com> References: <1438774133-1564-1-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZMwtX-00019Z-5y for xen-devel@lists.xenproject.org; Wed, 05 Aug 2015 11:30:03 +0000 In-Reply-To: <1438774133-1564-1-git-send-email-julien.grall@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Wei.Liu2@citrix.com, ian.campbell@citrix.com, Stefano Stabellini , Tim Deegan , Ian Jackson , Julien Grall , stefano.stabellini@citrix.com, Jan Beulich , Andrew Cooper , Keir Fraser List-Id: xen-devel@lists.xenproject.org From: Stefano Stabellini ARM64 is able to support 64KB and 4KB page granularities. While the guest will support both granularities, Xen and hypercall interface will always be in 4KB. Signed-off-by: Stefano Stabellini Signed-off-by: Julien Grall --- Cc: Ian Campbell Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan Cc: Andrew Cooper I'm missing one term for Linux Frame Number but always in 4KB granularity. It's necessary in few places such as the balloon code where we need to map a Linux 4KB Frame Number into a Machine Frame Number. I was thinking to name it xen_pfn. --- xen/include/xen/mm.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 876d370..8dfd61a 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -15,16 +15,24 @@ * * mfn: Machine Frame Number * The values Xen puts into its own pagetables. This is the host physical - * memory address space with RAM, MMIO etc. + * memory address space with RAM, MMIO etc. Always 4KB granularity. * * gfn: Guest Frame Number - * The values a guest puts in its own pagetables. For an auto-translated - * guest (hardware assisted with 2nd stage translation, or shadowed), gfn != - * mfn. For a non-translated guest which is aware of Xen, gfn == mfn. + * The values a guest puts in its own pagetables, except for 64KB + * granularity. Gfns are always based on 4KB granularity, while actually + * the guest could use other granularities. For an auto-translated guest + * (hardware assisted with 2nd stage translation, or shadowed), gfn != mfn. + * For a non-translated guest which is aware of Xen, gfn == mfn. + * Hypercalls take gfns, not mfns, as parameters unless clearly specified + * otherwise. * * pfn: Pseudophysical Frame Number - * A linear idea of a guest physical address space. For an auto-translated - * guest, pfn == gfn while for a non-translated guest, pfn != gfn. + * A linear idea of a guest physical address space. Pfns are in guest + * granularity, which can be 64KB or 4KB. PV guests must only use 4KB + * granularity. For an auto-translated guest, pfn == gfn << shift, + * where the shift is the different between the Xen and Linux page + * granularity, while for a non-translated guest, pfn != gfn. Pfns are + * internal to the guest and are not passed to hypercalls. * * WARNING: Some of these terms have changed over time while others have been * used inconsistently, meaning that a lot of existing code does not match the -- 2.1.4