WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH] introduce XEN_EFI_RR6 and XEN_EFI_RR7

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] introduce XEN_EFI_RR6 and XEN_EFI_RR7
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Wed, 20 Aug 2008 15:39:07 +0900
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Tue, 19 Aug 2008 23:35:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
[IA64] introduce XEN_EFI_RR6 and XEN_EFI_RR7

for firmware rr6 is used for uncacned region
and rr7 is used for cachable region.
So rid must be different.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 20216b358f38 xen/arch/ia64/xen/ivt.S
--- a/xen/arch/ia64/xen/ivt.S   Wed Aug 13 15:59:21 2008 +0900
+++ b/xen/arch/ia64/xen/ivt.S   Wed Aug 13 17:07:12 2008 +0900
@@ -206,26 +206,31 @@
        cmp.eq p8,p0=((VIRT_FRAME_TABLE_ADDR>>56)&0xff)-0x100,r22
 (p8)   br.cond.sptk frametable_miss ;;
 #endif
-       // If it is not a Xen address, handle it via page_fault.
-       //    !( ((r22 == 0x18 || r22 == 0x1c) && rr7 == XEN_EFI_RR) ||
-       //       r22 == 0x1e )
-       // Note that rr7 == XEN_EFI_RR implies rr6 == XEN_EFI_RR
+       //    !( (r22 == 0x18 && rr6 == XEN_EFI_RR6) ||
+       //       (r22 == 0x1c && rr7 == XEN_EFI_RR7) ||
+       //       r22 == 0x1e)
+
        extr.u r22=r16,59,5
        ;;
        dep r20=0,r20,IA64_ITIR_KEY,IA64_ITIR_KEY_LEN   // clear the key
+       movl r24=6 << 61
        movl r23=7 << 61
        ;;
+       mov r24=rr[r24]
        mov r23=rr[r23]
        ;;
-       mov r25=XEN_EFI_RR
+       movl r26=XEN_EFI_RR6
+       movl r25=XEN_EFI_RR7
+
        cmp.eq p8,p0=0x18,r22           // 0xc...
+       cmp.eq p9,p0=0x1c,r22           // 0xe...
        ;;
-       cmp.eq.or p8,p0=0x1c,r22        // 0xe...
+       cmp.eq.and p8,p0=r26,r24        // rr6 == XEN_EFI_RR6
+       cmp.eq.and p9,p0=r25,r23        // rr7 == XEN_EFI_RR7
        ;;
-       cmp.eq.and p8,p0=r25,r23        // rr7 == XEN_EFI_RR
-       ;;
-       cmp.eq.or p8,p0=0x1e,r22        // 0xf...
+       cmp.eq.or p9,p0=0x1e,r22        // 0xf...
 (p8)   br.cond.spnt alt_dtlb_miss_identity_map
+(p9)   br.cond.spnt alt_dtlb_miss_identity_map
        br.cond.spnt page_fault
        ;;
 alt_dtlb_miss_identity_map:
diff -r 20216b358f38 xen/include/asm-ia64/linux-xen/linux/efi.h
--- a/xen/include/asm-ia64/linux-xen/linux/efi.h        Wed Aug 13 15:59:21 
2008 +0900
+++ b/xen/include/asm-ia64/linux-xen/linux/efi.h        Wed Aug 13 17:07:12 
2008 +0900
@@ -439,7 +439,7 @@
  * e: bits 3-N:  IA64_REGION_ID_KERNEL (1)
  * f: bits N-53: reserved (0)
  *
- * + Only 0 is used as we only need one RID. Its not really important
+ * + Only 6 and 7 are used as we only need two RIDs. Its not really important
  *   what this number is, so long as its between 0 and 7.
  *
  * The nice thing about this is that we are only using 4 bits of RID
@@ -464,7 +464,7 @@
  * E: bits N-53: reserved (0)
  */
 
-/* rr7 (and rr6) may already be set to XEN_EFI_RR, which
+/* rr7 (and rr6) may already be set to XEN_EFI_RR7 (and XEN_EFI_RR6), which
  * would indicate a nested EFI, SAL or PAL call, such
  * as from an MCA. This may have occured during a call
  * to set_one_rr_efi(). To be safe, repin everything anyway.
@@ -473,8 +473,8 @@
 #define XEN_EFI_RR_ENTER(rr6, rr7) do {                        \
        rr6 = ia64_get_rr(6UL << 61);                   \
        rr7 = ia64_get_rr(7UL << 61);                   \
-       set_one_rr_efi(6UL << 61, XEN_EFI_RR);          \
-       set_one_rr_efi(7UL << 61, XEN_EFI_RR);          \
+       set_one_rr_efi(6UL << 61, XEN_EFI_RR6);         \
+       set_one_rr_efi(7UL << 61, XEN_EFI_RR7);         \
        efi_map_pal_code();                             \
 } while (0)
 
@@ -485,7 +485,7 @@
  */
 
 #define XEN_EFI_RR_LEAVE(rr6, rr7) do {                        \
-       if (rr7 != XEN_EFI_RR) {                        \
+       if (rr7 != XEN_EFI_RR7) {                       \
                efi_unmap_pal_code();                   \
                set_one_rr_efi_restore(6UL << 61, rr6); \
                set_one_rr_efi_restore(7UL << 61, rr7); \
@@ -507,10 +507,25 @@
 #ifdef XEN
 #include <asm/mmu_context.h> /* For IA64_REGION_ID_EFI and ia64_rid() */
 #include <asm/pgtable.h>     /* IA64_GRANULE_SHIFT */
-#define XEN_EFI_REGION_NO __IA64_UL_CONST(0)
-#define XEN_EFI_RR ((ia64_rid(XEN_IA64_REGION_ID_EFI,                  \
-                             XEN_EFI_REGION_NO) << 8) |                \
-                   (IA64_GRANULE_SHIFT << 2))
+
+/* macro version of vmMangleRID() */
+#define XEN_EFI_VM_MANGLE_RRVAL(rrval)         \
+       ((((rrval) & 0xff000000) >> 16) |       \
+        ((rrval) & 0x00ff0000) |               \
+        (((rrval) & 0x0000ff00) << 16 ) |      \
+        ((rrval) & 0x000000ff))
+
+#define XEN_EFI_REGION6 __IA64_UL_CONST(6)
+#define XEN_EFI_REGION7 __IA64_UL_CONST(7)
+#define _XEN_EFI_RR6 ((ia64_rid(XEN_IA64_REGION_ID_EFI,                        
\
+                               XEN_EFI_REGION6) << 8) |                \
+                     (IA64_GRANULE_SHIFT << 2))
+#define _XEN_EFI_RR7 ((ia64_rid(XEN_IA64_REGION_ID_EFI,                        
\
+                               XEN_EFI_REGION7) << 8) |                \
+                     (IA64_GRANULE_SHIFT << 2))
+#define XEN_EFI_RR6 XEN_EFI_VM_MANGLE_RRVAL(_XEN_EFI_RR6)
+#define XEN_EFI_RR7 XEN_EFI_VM_MANGLE_RRVAL(_XEN_EFI_RR7)
+
 #endif /* XEN */
 
 #endif /* _LINUX_EFI_H */

Attachment: update-xen-efi-rr.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH] introduce XEN_EFI_RR6 and XEN_EFI_RR7, Isaku Yamahata <=