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

[Xen-changelog] [xen-unstable] [IA64] introduce XEN_EFI_RR6 and XEN_EFI_RR7



# HG changeset patch
# User Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1219658677 -32400
# Node ID 1d565c0429cb19e1f684c1025d4f2be15658a9b8
# Parent  6607624285b213f9bcb66636593facbc143e2c7c
[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>
---
 xen/arch/ia64/xen/ivt.S                    |   27 ++++++++++++++---------
 xen/include/asm-ia64/linux-xen/linux/efi.h |   33 +++++++++++++++++++++--------
 2 files changed, 40 insertions(+), 20 deletions(-)

diff -r 6607624285b2 -r 1d565c0429cb xen/arch/ia64/xen/ivt.S
--- a/xen/arch/ia64/xen/ivt.S   Mon Aug 25 19:04:37 2008 +0900
+++ b/xen/arch/ia64/xen/ivt.S   Mon Aug 25 19:04:37 2008 +0900
@@ -206,26 +206,31 @@ late_alt_dtlb_miss:
        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.or p8,p0=0x1c,r22        // 0xe...
-       ;;
-       cmp.eq.and p8,p0=r25,r23        // rr7 == XEN_EFI_RR
-       ;;
-       cmp.eq.or p8,p0=0x1e,r22        // 0xf...
+       cmp.eq p9,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.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 6607624285b2 -r 1d565c0429cb xen/include/asm-ia64/linux-xen/linux/efi.h
--- a/xen/include/asm-ia64/linux-xen/linux/efi.h        Mon Aug 25 19:04:37 
2008 +0900
+++ b/xen/include/asm-ia64/linux-xen/linux/efi.h        Mon Aug 25 19:04:37 
2008 +0900
@@ -439,7 +439,7 @@ struct efi_generic_dev_path {
  * 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 @@ struct efi_generic_dev_path {
  * 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 @@ struct efi_generic_dev_path {
 #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 @@ struct efi_generic_dev_path {
  */
 
 #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 @@ struct efi_generic_dev_path {
 #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 */

_______________________________________________
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®.