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

[Xen-changelog] [linux-2.6.18-xen] [IA64] Set rr0 to rr4 hyperprivop



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1185983094 21600
# Node ID a1682dc021bc16eec86f09b6d9a389c19497423b
# Parent  6e0d898e9dad897b29db1c08be2b8b64c929d779
[IA64] Set rr0 to rr4 hyperprivop

Introduce ia64_set_rr0_to_rr4() and paravirtualize it to eliminate
hyperprivop overhead.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 include/asm-ia64/intrinsics.h     |    9 +++++++++
 include/asm-ia64/mmu_context.h    |    6 +-----
 include/asm-ia64/privop.h         |    1 +
 include/asm-ia64/xen/privop.h     |   25 +++++++++++++++++++++++++
 include/xen/interface/arch-ia64.h |    3 ++-
 5 files changed, 38 insertions(+), 6 deletions(-)

diff -r 6e0d898e9dad -r a1682dc021bc include/asm-ia64/intrinsics.h
--- a/include/asm-ia64/intrinsics.h     Mon Jul 30 11:46:14 2007 -0600
+++ b/include/asm-ia64/intrinsics.h     Wed Aug 01 09:44:54 2007 -0600
@@ -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 6e0d898e9dad -r a1682dc021bc include/asm-ia64/mmu_context.h
--- a/include/asm-ia64/mmu_context.h    Mon Jul 30 11:46:14 2007 -0600
+++ b/include/asm-ia64/mmu_context.h    Wed Aug 01 09:44:54 2007 -0600
@@ -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 6e0d898e9dad -r a1682dc021bc include/asm-ia64/privop.h
--- a/include/asm-ia64/privop.h Mon Jul 30 11:46:14 2007 -0600
+++ b/include/asm-ia64/privop.h Wed Aug 01 09:44:54 2007 -0600
@@ -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 6e0d898e9dad -r a1682dc021bc include/asm-ia64/xen/privop.h
--- a/include/asm-ia64/xen/privop.h     Mon Jul 30 11:46:14 2007 -0600
+++ b/include/asm-ia64/xen/privop.h     Wed Aug 01 09:44:54 2007 -0600
@@ -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 6e0d898e9dad -r a1682dc021bc include/xen/interface/arch-ia64.h
--- a/include/xen/interface/arch-ia64.h Mon Jul 30 11:46:14 2007 -0600
+++ b/include/xen/interface/arch-ia64.h Wed Aug 01 09:44:54 2007 -0600
@@ -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

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