WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] misleading names in xen memory management code

To: "Li, Xin B" <xin.b.li@xxxxxxxxx>, "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] misleading names in xen memory management code
From: "Ian Pratt" <m+Ian.Pratt@xxxxxxxxxxxx>
Date: Sat, 29 Oct 2005 03:25:48 +0100
Delivery-date: Sat, 29 Oct 2005 02:22:56 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcXcLO8xmuQY6DAYQpmS7aG4WO2Z4gAAngFw
Thread-topic: [Xen-devel] misleading names in xen memory management code
 > Keir, I think we have some misleading names in xen memory management
> code:
> 1) #define page_to_pfn(_page)  ((unsigned long)((_page) - 
> frame_table)) Actually, it should be page_to_mfn.
> 
> 2) #define l1e_from_pfn(pfn, flags)   \
>     ((l1_pgentry_t) { ((intpte_t)(pfn) << PAGE_SHIFT) |
> put_pte_flags(flags) })
> Seems l1e_from_mfn(mfn, flags) is much more clear.
> 
> Am I right?

Yep, these are functions from the very early days of Xen, before the
terminology was properly developed. They could usefully be renamed.

While doing this, it would be well worth paying attention to uses of
page_to_pfn to check that the value returned is never shifted left
PAGE_SHIFT without appropriate casting (for PAE).


Ian

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>