All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Cleanup/fix virt_to_maddr
@ 2007-01-24  9:06 Christoph Egger
  2007-01-24 10:48 ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Egger @ 2007-01-24  9:06 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]



Hi!

Where virt_to_maddr() or __pa() is used, paddr_t is mostly expected rather
unsigned long. This may fix random issues in PAE mode.

Christoph

[-- Attachment #2: xen_paddr.diff --]
[-- Type: text/x-diff, Size: 663 bytes --]

diff -r bea505a69722 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Tue Jan 23 15:58:05 2007 +0000
+++ b/xen/include/asm-x86/page.h	Wed Jan 24 09:32:26 2007 +0100
@@ -222,7 +222,7 @@ typedef struct { u64 pfn; } pagetable_t;
 
 /* Convert between Xen-heap virtual addresses and machine addresses. */
 #define PAGE_OFFSET         ((unsigned long)__PAGE_OFFSET)
-#define virt_to_maddr(va)   ((unsigned long)(va)-PAGE_OFFSET)
+#define virt_to_maddr(va)   ((paddr_t)(va)-PAGE_OFFSET)
 #define maddr_to_virt(ma)   ((void *)((unsigned long)(ma)+PAGE_OFFSET))
 /* Shorthand versions of the above functions. */
 #define __pa(x)             (virt_to_maddr(x))

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

* Re: [PATCH] Cleanup/fix virt_to_maddr
  2007-01-24  9:06 [PATCH] Cleanup/fix virt_to_maddr Christoph Egger
@ 2007-01-24 10:48 ` Keir Fraser
  2007-01-24 11:01   ` Christoph Egger
  0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2007-01-24 10:48 UTC (permalink / raw)
  To: Christoph Egger, xen-devel




On 24/1/07 09:06, "Christoph Egger" <Christoph.Egger@amd.com> wrote:

> Where virt_to_maddr() or __pa() is used, paddr_t is mostly expected rather
> unsigned long. This may fix random issues in PAE mode.

They're only used on Xen heap virtual addresses whose physical addresses are
always below 64MB. So there should be no issues in returning a ulong.

 -- Keir

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

* Re: [PATCH] Cleanup/fix virt_to_maddr
  2007-01-24 10:48 ` Keir Fraser
@ 2007-01-24 11:01   ` Christoph Egger
  2007-01-24 11:06     ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Egger @ 2007-01-24 11:01 UTC (permalink / raw)
  To: xen-devel; +Cc: Keir Fraser

On Wednesday 24 January 2007 11:48, Keir Fraser wrote:
> On 24/1/07 09:06, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
> > Where virt_to_maddr() or __pa() is used, paddr_t is mostly expected
> > rather unsigned long. This may fix random issues in PAE mode.
>
> They're only used on Xen heap virtual addresses whose physical addresses
> are always below 64MB. So there should be no issues in returning a ulong.

Oh, I see. So it's absolutely not used for domains (which I assumed)?

Christoph

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

* Re: [PATCH] Cleanup/fix virt_to_maddr
  2007-01-24 11:01   ` Christoph Egger
@ 2007-01-24 11:06     ` Keir Fraser
  0 siblings, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2007-01-24 11:06 UTC (permalink / raw)
  To: Christoph Egger, xen-devel




On 24/1/07 11:01, "Christoph Egger" <Christoph.Egger@amd.com> wrote:

>> They're only used on Xen heap virtual addresses whose physical addresses
>> are always below 64MB. So there should be no issues in returning a ulong.
> 
> Oh, I see. So it's absolutely not used for domains (which I assumed)?

No, all it does is a simple arithmetic transformation (subtracting
PAGE_OFFSET) which is only valid for non-guest pages on x86_32. It can be
used for any page on x86_64, but there we have paddr_t==ulong.

 -- Keir

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

end of thread, other threads:[~2007-01-24 11:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-24  9:06 [PATCH] Cleanup/fix virt_to_maddr Christoph Egger
2007-01-24 10:48 ` Keir Fraser
2007-01-24 11:01   ` Christoph Egger
2007-01-24 11:06     ` 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.