aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2008-11-18 05:19:50 -0500
committerTony Luck <tony.luck@intel.com>2008-11-20 16:41:20 -0500
commit93fe10b670a7a6a1dc9649c7860f452dc7bbbb9d (patch)
treee141f994b5040f34a2ec4d7b9666677bbab6cca4
parentd5964107763d7155e9bea658098a337507b3e928 (diff)
[IA64] ia64/pv_ops/pv_cpu_ops: fix _IA64_REG_IP case.
pv_cpu_ops.getreg(_IA64_REG_IP) returned constant. But the returned ip valued should be the one in the caller, not of the callee. This patch fixes that. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--arch/ia64/include/asm/intrinsics.h2
-rw-r--r--arch/ia64/include/asm/paravirt_privop.h13
-rw-r--r--arch/ia64/kernel/paravirt.c2
3 files changed, 15 insertions, 2 deletions
diff --git a/arch/ia64/include/asm/intrinsics.h b/arch/ia64/include/asm/intrinsics.h
index 47d686dba1eb..a3e44a5ed497 100644
--- a/arch/ia64/include/asm/intrinsics.h
+++ b/arch/ia64/include/asm/intrinsics.h
@@ -226,7 +226,7 @@ extern long ia64_cmpxchg_called_with_bad_pointer (void);
226/************************************************/ 226/************************************************/
227#define ia64_ssm IA64_INTRINSIC_MACRO(ssm) 227#define ia64_ssm IA64_INTRINSIC_MACRO(ssm)
228#define ia64_rsm IA64_INTRINSIC_MACRO(rsm) 228#define ia64_rsm IA64_INTRINSIC_MACRO(rsm)
229#define ia64_getreg IA64_INTRINSIC_API(getreg) 229#define ia64_getreg IA64_INTRINSIC_MACRO(getreg)
230#define ia64_setreg IA64_INTRINSIC_API(setreg) 230#define ia64_setreg IA64_INTRINSIC_API(setreg)
231#define ia64_set_rr IA64_INTRINSIC_API(set_rr) 231#define ia64_set_rr IA64_INTRINSIC_API(set_rr)
232#define ia64_get_rr IA64_INTRINSIC_API(get_rr) 232#define ia64_get_rr IA64_INTRINSIC_API(get_rr)
diff --git a/arch/ia64/include/asm/paravirt_privop.h b/arch/ia64/include/asm/paravirt_privop.h
index d577aac11835..0b597424fcfc 100644
--- a/arch/ia64/include/asm/paravirt_privop.h
+++ b/arch/ia64/include/asm/paravirt_privop.h
@@ -78,6 +78,19 @@ extern unsigned long ia64_native_getreg_func(int regnum);
78 ia64_native_rsm(mask); \ 78 ia64_native_rsm(mask); \
79 } while (0) 79 } while (0)
80 80
81/* returned ip value should be the one in the caller,
82 * not in __paravirt_getreg() */
83#define paravirt_getreg(reg) \
84 ({ \
85 unsigned long res; \
86 BUILD_BUG_ON(!__builtin_constant_p(reg)); \
87 if ((reg) == _IA64_REG_IP) \
88 res = ia64_native_getreg(_IA64_REG_IP); \
89 else \
90 res = pv_cpu_ops.getreg(reg); \
91 res; \
92 })
93
81/****************************************************************************** 94/******************************************************************************
82 * replacement of hand written assembly codes. 95 * replacement of hand written assembly codes.
83 */ 96 */
diff --git a/arch/ia64/kernel/paravirt.c b/arch/ia64/kernel/paravirt.c
index de35d8e8b7d2..9f14c16f6369 100644
--- a/arch/ia64/kernel/paravirt.c
+++ b/arch/ia64/kernel/paravirt.c
@@ -130,7 +130,7 @@ ia64_native_getreg_func(int regnum)
130 unsigned long res = -1; 130 unsigned long res = -1;
131 switch (regnum) { 131 switch (regnum) {
132 CASE_GET_REG(GP); 132 CASE_GET_REG(GP);
133 CASE_GET_REG(IP); 133 /*CASE_GET_REG(IP);*/ /* returned ip value shouldn't be constant */
134 CASE_GET_REG(PSR); 134 CASE_GET_REG(PSR);
135 CASE_GET_REG(TP); 135 CASE_GET_REG(TP);
136 CASE_GET_REG(SP); 136 CASE_GET_REG(SP);