From: Keir Fraser Subject: Re: asm/page.h inconsistencies? Date: Fri, 6 Jan 2006 14:07:18 +0000 Message-ID: References: <43BE7EBF.76F0.0078.0@novell.com> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <43BE7EBF.76F0.0078.0@novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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