[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] make virt_to_maddr() to support both cached/uncached identity mapped area.



# HG changeset patch
# User Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1224225183 -32400
# Node ID 7db30bf36b0ef5ea95237cef2a4533e4c87b3317
# Parent  5450b008afcec7a5184a0124aab3be639933aec8
[IA64] make virt_to_maddr() to support both cached/uncached identity mapped 
area.

The significant 8 bits of va are used by Xen,
such as 0xf2 is used as uncache mapping.

In function ioports_permit_access,
 mach_start = mmio_start | __pa(space->mmio_base);
Mach_start gets wrong physical address.

Signed-off-by: Anthony Xu <anthony.xu@xxxxxxxxx>
---
 xen/include/asm-ia64/linux-xen/asm/pgtable.h |    3 +++
 xen/include/asm-ia64/xenpage.h               |   10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff -r 5450b008afce -r 7db30bf36b0e 
xen/include/asm-ia64/linux-xen/asm/pgtable.h
--- a/xen/include/asm-ia64/linux-xen/asm/pgtable.h      Thu Oct 16 11:33:05 
2008 +0900
+++ b/xen/include/asm-ia64/linux-xen/asm/pgtable.h      Fri Oct 17 15:33:03 
2008 +0900
@@ -20,12 +20,15 @@
 #include <asm/system.h>
 #include <asm/types.h>
 #ifdef XEN
+#include <asm/xenpage.h>
 #ifndef __ASSEMBLY__
 #include <xen/sched.h> /* needed for mm_struct (via asm/domain.h) */
 #endif
 #endif
 
+#ifndef XEN
 #define IA64_MAX_PHYS_BITS     50      /* max. number of physical address bits 
(architected) */
+#endif
 
 /*
  * First, define the various bits in a PTE.  Note that the PTE format
diff -r 5450b008afce -r 7db30bf36b0e xen/include/asm-ia64/xenpage.h
--- a/xen/include/asm-ia64/xenpage.h    Thu Oct 16 11:33:05 2008 +0900
+++ b/xen/include/asm-ia64/xenpage.h    Fri Oct 17 15:33:03 2008 +0900
@@ -1,5 +1,8 @@
 #ifndef _ASM_IA64_XENPAGE_H
 #define _ASM_IA64_XENPAGE_H
+
+/* moved from xen/include/asm-ia64/linux-xen/asm/pgtable.h to compile */
+#define IA64_MAX_PHYS_BITS     50      /* max. number of physical address bits 
(architected) */
 
 #ifndef __ASSEMBLY__
 #undef mfn_valid
@@ -23,7 +26,12 @@ static inline unsigned long __virt_to_ma
        if (va - KERNEL_START < xenheap_size)
                return xen_pstart + (va - KERNEL_START);
        else
-               return (va & ((1UL << 60) - 1));
+               /* 
+                * Because the significant 8 bits of VA are used by Xen,
+                * and xen uses cached/uncached identity mapping.
+                * IA64_MAX_PHYS_BITS can't be larger than 56
+                */
+               return (va & ((1UL << IA64_MAX_PHYS_BITS) - 1));
 }
 
 #define virt_to_maddr(va)      (__virt_to_maddr((unsigned long)va))

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.