All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] pae: build fix
@ 2005-06-22 14:00 Gerd Knorr
  2005-06-22 14:51 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Gerd Knorr @ 2005-06-22 14:00 UTC (permalink / raw)
  To: xen-devel

  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

Index: xen/include/asm-x86/page.h
===================================================================
--- xen.orig/include/asm-x86/page.h	2005-06-20 12:45:29.000000000 +0200
+++ xen/include/asm-x86/page.h	2005-06-20 16:32:34.000000000 +0200
@@ -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__

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] pae: build fix
  2005-06-22 14:00 [patch] pae: build fix Gerd Knorr
@ 2005-06-22 14:51 ` Keir Fraser
  0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2005-06-22 14:51 UTC (permalink / raw)
  To: Gerd Knorr; +Cc: xen-devel


On 22 Jun 2005, at 15:00, Gerd Knorr wrote:

> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-06-22 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-22 14:00 [patch] pae: build fix Gerd Knorr
2005-06-22 14:51 ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.