Skip to contentSkip to conversation

pae: build fix

PATCH In review Gerd Knorr 2 participants 2 messages Jun 22, 2005

lore
Share & tools
lore

Gerd Knorr

author
#0 lore raw

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
Index: xen/include/asm-x86/page.h
===================================================================
@@ -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__
#1 lore raw
Quoted 5 lines · Gerd Knorr

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.

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