pae: build fix
PATCH 1/1 pae: build fix
Hi,
The patch below is needed to make pae-enabled xen build. Not sure why the intpte_t cast was added and whenever it is a good idea to remove it. Problem is that PAGE_MASK is used to page-align both physical and virtual addresses, and the cast causes build failures for the virtual address case.
Comments?
Gerd
include/asm-x86/page.h +2 -1
@@ -7,7 +7,8 @@#else #define PAGE_SIZE (1 << PAGE_SHIFT)#endif -#define PAGE_MASK (~(intpte_t)(PAGE_SIZE-1)) +//#define PAGE_MASK (~(intpte_t)(PAGE_SIZE-1)) +#define PAGE_MASK (~(PAGE_SIZE-1))#define PAGE_FLAG_MASK (~0U)#ifndef __ASSEMBLY__
Quoted 5 lines · Gerd Knorr
The patch below is needed to make pae-enabled xen build. Not sure why the
intpte_tcast was added and whenever it is a good idea to remove it. Problem is thatPAGE_MASKis used to page-align both physical and virtual addresses, and the cast causes build failures for the virtual address case.
I added the cast to ensure the mask was 64 bits wide, so that large physical addresses wouldn't get truncated to 32 bits when the mask is applied. I've fixed it to get the same effect a different way -- it's okay to have a narrower-type mask as long as it is signed (so it gets sign-extended if it has to be widened to 64 bits).
-- Keir