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 2/2][RFC] set rr0 to rr4 hyperprivop: Linux side

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH 2/2][RFC] set rr0 to rr4 hyperprivop: Linux side
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Mon, 30 Jul 2007 14:59:47 +0900
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Sun, 29 Jul 2007 22:57:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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.4.2.1i
# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1185766635 -32400
# Node ID 179c1791ce821355dc0c9593ce3d58a5188f215a
# Parent  4512b3ccff7de305e21a2ee29ea5a54453f40d04
introduce ia64_set_rr0_to_rr4() and paravirtualize it to eliminate
hyperprivop overhead.
PATCHNAME: ia64_set_rr0_to_rr4

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

diff -r 4512b3ccff7d -r 179c1791ce82 include/asm-ia64/intrinsics.h
--- a/include/asm-ia64/intrinsics.h     Mon Jul 30 12:32:04 2007 +0900
+++ b/include/asm-ia64/intrinsics.h     Mon Jul 30 12:37:15 2007 +0900
@@ -17,6 +17,15 @@
 #else
 # include <asm/gcc_intrin.h>
 #endif
+
+#define __ia64_set_rr0_to_rr4(val0, val1, val2, val3, val4)    \
+do {                                                           \
+       __ia64_set_rr(0x0000000000000000UL, (val0));            \
+       __ia64_set_rr(0x2000000000000000UL, (val1));            \
+       __ia64_set_rr(0x4000000000000000UL, (val2));            \
+       __ia64_set_rr(0x6000000000000000UL, (val3));            \
+       __ia64_set_rr(0x8000000000000000UL, (val4));            \
+} while (0)
 
 /*
  * Force an unresolved reference if someone tries to use
diff -r 4512b3ccff7d -r 179c1791ce82 include/asm-ia64/mmu_context.h
--- a/include/asm-ia64/mmu_context.h    Mon Jul 30 12:32:04 2007 +0900
+++ b/include/asm-ia64/mmu_context.h    Mon Jul 30 12:37:15 2007 +0900
@@ -151,11 +151,7 @@ reload_context (nv_mm_context_t context)
 #  endif
 #endif
 
-       ia64_set_rr(0x0000000000000000UL, rr0);
-       ia64_set_rr(0x2000000000000000UL, rr1);
-       ia64_set_rr(0x4000000000000000UL, rr2);
-       ia64_set_rr(0x6000000000000000UL, rr3);
-       ia64_set_rr(0x8000000000000000UL, rr4);
+       ia64_set_rr0_to_rr4(rr0, rr1, rr2, rr3, rr4);
        ia64_srlz_i();                  /* srlz.i implies srlz.d */
 }
 
diff -r 4512b3ccff7d -r 179c1791ce82 include/asm-ia64/privop.h
--- a/include/asm-ia64/privop.h Mon Jul 30 12:32:04 2007 +0900
+++ b/include/asm-ia64/privop.h Mon Jul 30 12:37:15 2007 +0900
@@ -54,6 +54,7 @@
 #define ia64_ret_from_clone            __ia64_ret_from_clone
 #define ia64_switch_to                 __ia64_switch_to
 #define ia64_pal_call_static           __ia64_pal_call_static
+#define ia64_set_rr0_to_rr4            __ia64_set_rr0_to_rr4
 
 #endif /* !IA64_PARAVIRTUALIZED */
 
diff -r 4512b3ccff7d -r 179c1791ce82 include/asm-ia64/xen/privop.h
--- a/include/asm-ia64/xen/privop.h     Mon Jul 30 12:32:04 2007 +0900
+++ b/include/asm-ia64/xen/privop.h     Mon Jul 30 12:37:15 2007 +0900
@@ -375,6 +375,21 @@ xen_set_rr(unsigned long index, unsigned
 }
 
 static inline void
+xen_set_rr0_to_rr4(unsigned long val0, unsigned long val1,
+                  unsigned long val2, unsigned long val3, unsigned long val4)
+{
+       register __u64 __val0 asm ("r8") = val0;
+       register __u64 __val1 asm ("r9") = val1;
+       register __u64 __val2 asm ("r10") = val2;
+       register __u64 __val3 asm ("r11") = val3;
+       register __u64 __val4 asm ("r14") = val4;
+       asm volatile ("break %0" ::
+                     "i"(HYPERPRIVOP_SET_RR0_TO_RR4),
+                     "r"(__val0), "r"(__val1),
+                     "r"(__val2), "r"(__val3), "r"(__val4));
+}
+
+static inline void
 xen_set_kr(unsigned long index, unsigned long val)
 {
        register __u64 __index asm ("r8") = index;
@@ -479,6 +494,16 @@ do {                                                       
                \
                ia64_intri_res = __ia64_get_rr((index));                \
        ia64_intri_res;                                                 \
 })
+
+#define ia64_set_rr0_to_rr4(val0, val1, val2, val3, val4)              \
+do {                                                                   \
+       if (is_running_on_xen())                                        \
+               xen_set_rr0_to_rr4((val0), (val1), (val2),              \
+                                  (val3), (val4));                     \
+       else                                                            \
+               __ia64_set_rr0_to_rr4((val0), (val1), (val2),           \
+                                     (val3), (val4));                  \
+} while (0)
 
 #define ia64_getreg                    xen_ia64_getreg
 #define ia64_setreg                    xen_ia64_setreg
diff -r 4512b3ccff7d -r 179c1791ce82 include/xen/interface/arch-ia64.h
--- a/include/xen/interface/arch-ia64.h Mon Jul 30 12:32:04 2007 +0900
+++ b/include/xen/interface/arch-ia64.h Mon Jul 30 12:37:15 2007 +0900
@@ -544,7 +544,8 @@ struct xen_ia64_boot_param {
 #define HYPERPRIVOP_SET_EFLAG          (HYPERPRIVOP_START + 0x16)
 #define HYPERPRIVOP_RSM_BE             (HYPERPRIVOP_START + 0x17)
 #define HYPERPRIVOP_GET_PSR            (HYPERPRIVOP_START + 0x18)
-#define HYPERPRIVOP_MAX                        (0x19)
+#define HYPERPRIVOP_SET_RR0_TO_RR4             (HYPERPRIVOP_START + 0x19)
+#define HYPERPRIVOP_MAX                        (0x1a)
 
 /* Fast and light hypercalls.  */
 #define __HYPERVISOR_ia64_fast_eoi     __HYPERVISOR_arch_1

Attachment: 161_179c1791ce82_ia64_set_rr0_to_rr4.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 2/2][RFC] set rr0 to rr4 hyperprivop: Linux side, Isaku Yamahata <=