From: Jeremy Fitzhardinge Date: Wed, 30 Jan 2008 12:32:59 +0000 (+0100) Subject: x86/pgtable: explain constant sign extension problem X-Git-Tag: v2.6.25-rc1~1143^2~347 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f29192320f22f1617d50a9c790862603eeef64e6;p=pandora-kernel.git x86/pgtable: explain constant sign extension problem When the _PAGE_FOO constants are defined as (1ul << _PAGE_BIT_FOO), they become unsigned longs. In 32-bit PAE mode, these end up being implicitly cast to 64-bit types when used to manipulate a pte, and because they're unsigned the top 32-bits are 0, destroying the upper bits of the pte. When _PAGE_FOO constants are given a signed integer type, the cast to 64-bits will sign-extend so that the upper bits are all ones, preserving the upper pte bits in manipulations. Explain this in a prominent place. Signed-off-by: Jeremy Fitzhardinge Cc: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- Reading git-diff-tree failed