lkml.org 
[lkml]   [2008]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: bisected boot regression post 2.6.25-rc3.. please revert
Date
>> hm. I suspect some gcc related difference related to the handling of 
>> this masking:
>> pmd_val(x) & ~(PAGE_MASK | _PAGE_USER | _PAGE_PSE | _PAGE_NX)
>> versus:
>> pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)
>> perhaps it will work if you change it to:
>> pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER & ~_PAGE_PSE & ~_PAGE_NX)
>> ?
>> in any case, the commit has to be reverted as it clearly isnt a NOP
>> on your box as it was intended to be. (it should only have made a
>> difference in a rare hugetlbfs case)
>
> interesting observation: if I turn the macros into inlines... the
> difference goes away.

include/asm-x86/pgtable.h has

#define _PAGE_BIT_PSE 7

#define _PAGE_PSE (_AC(1, L)<<_PAGE_BIT_PSE)

and

#define _PAGE_BIT_NX 63

#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
#define _PAGE_NX (_AC(1, ULL) << _PAGE_BIT_NX)

so (on 32-bit) ~_PAGE_PSE is ~0x80L is 0xffffff7f, which when cast to
64-bit is 0x00000000ffffff7f, so in

(~PAGE_MASK & ~_PAGE_USER & ~_PAGE_PSE & ~_PAGE_NX)

all the high bits are lost, while the original

~(PAGE_MASK | _PAGE_USER | _PAGE_PSE | _PAGE_NX)

works as intended, since the bit inversion is done on a 64-bit number.


Maybe all those pagetable bit definitions should use 64-bit (ULL or a
cast),
as it is now some dangerous detail is hidden behind the macros. Using
inline
functions for simple constants seems like overkill to me, but would
also work
of course.


Segher



\
 
 \ /
  Last update: 2008-03-03 22:17    [W:0.111 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site