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/
Home Products Support Community News


Re: [Xen-devel] asm/page.h inconsistencies?

To: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] asm/page.h inconsistencies?
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Fri, 6 Jan 2006 14:07:18 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 06 Jan 2006 14:07:29 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <43BE7EBF.76F0.0078.0@xxxxxxxxxx>
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>
References: <43BE7EBF.76F0.0078.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

On 6 Jan 2006, at 13:29, Jan Beulich wrote:

Could anyone explain the non-symmetric implementation of
__pte/__pmd/__pud/__pgd compared to pte_val/pmd_val/pud_val/pgd_val on
x86-64? On i386, the "... & 1" is consistently used across all of these,
but on x86-64 only the __pte/pte_val pair does so.

We only ever test '& 1' in pte_val(). In higher-level *_val functions we need not limit the test to bit 0 (because an unused page directory entry is always 0 in Linux) and also we *cannot* limit the test to bit 0 (at least for pmd_val()) because Xen will silently temporarily remove _PAGE_PRESENT from page directory entries as part of the writable-pagetable implementation.

It is certainly arguable that the __pgd/__pud/__pmd macros should do the same test as the corresponding *_val function, for symmetry, but neither xen/i386 nor xen/x86_64 is symmetric right now (at least in xen-unstable.hg).

 -- Keir

Xen-devel mailing list

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