aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-22 22:42:42 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-22 22:42:42 -0400
commit7f52a3afc4c02db75b3953fcbbb980abc86873a2 (patch)
tree7c771c73ee3cfa0bd3d8a9433462919da377ffa2 /arch
parent4edc5db83f574dfcc8be35b7b96760ded543b360 (diff)
parent4f5fa2fb1259f506d20e8af447117ec3ec426a53 (diff)
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: [POWERPC] Bypass hcall stats until cpu features have run [POWERPC] Avoid hypervisor statistics calculation in real mode [POWERPC] Fix atomicity of TIF update in flush_thread()
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/process.c9
-rw-r--r--arch/powerpc/platforms/pseries/hvCall.S41
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c2
-rw-r--r--arch/powerpc/platforms/pseries/plpar_wrappers.h16
4 files changed, 64 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index f3d4dd580dd6..e53b2988d1bf 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -465,8 +465,13 @@ void flush_thread(void)
465#ifdef CONFIG_PPC64 465#ifdef CONFIG_PPC64
466 struct thread_info *t = current_thread_info(); 466 struct thread_info *t = current_thread_info();
467 467
468 if (t->flags & _TIF_ABI_PENDING) 468 if (test_ti_thread_flag(t, TIF_ABI_PENDING)) {
469 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); 469 clear_ti_thread_flag(t, TIF_ABI_PENDING);
470 if (test_ti_thread_flag(t, TIF_32BIT))
471 clear_ti_thread_flag(t, TIF_32BIT);
472 else
473 set_ti_thread_flag(t, TIF_32BIT);
474 }
470#endif 475#endif
471 476
472 discard_lazy_cpu_state(); 477 discard_lazy_cpu_state();
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index 5c7e38789897..c1427b3634ec 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -30,9 +30,14 @@ END_FTR_SECTION_IFSET(CPU_FTR_PURR);
30 30
31/* 31/*
32 * postcall is performed immediately before function return which 32 * postcall is performed immediately before function return which
33 * allows liberal use of volatile registers. 33 * allows liberal use of volatile registers. We branch around this
34 * in early init (eg when populating the MMU hashtable) by using an
35 * unconditional cpu feature.
34 */ 36 */
35#define HCALL_INST_POSTCALL \ 37#define HCALL_INST_POSTCALL \
38BEGIN_FTR_SECTION; \
39 b 1f; \
40END_FTR_SECTION(0, 1); \
36 ld r4,STK_PARM(r3)(r1); /* validate opcode */ \ 41 ld r4,STK_PARM(r3)(r1); /* validate opcode */ \
37 cmpldi cr7,r4,MAX_HCALL_OPCODE; \ 42 cmpldi cr7,r4,MAX_HCALL_OPCODE; \
38 bgt- cr7,1f; \ 43 bgt- cr7,1f; \
@@ -123,6 +128,40 @@ _GLOBAL(plpar_hcall)
123 128
124 blr /* return r3 = status */ 129 blr /* return r3 = status */
125 130
131/*
132 * plpar_hcall_raw can be called in real mode. kexec/kdump need some
133 * hypervisor calls to be executed in real mode. So plpar_hcall_raw
134 * does not access the per cpu hypervisor call statistics variables,
135 * since these variables may not be present in the RMO region.
136 */
137_GLOBAL(plpar_hcall_raw)
138 HMT_MEDIUM
139
140 mfcr r0
141 stw r0,8(r1)
142
143 std r4,STK_PARM(r4)(r1) /* Save ret buffer */
144
145 mr r4,r5
146 mr r5,r6
147 mr r6,r7
148 mr r7,r8
149 mr r8,r9
150 mr r9,r10
151
152 HVSC /* invoke the hypervisor */
153
154 ld r12,STK_PARM(r4)(r1)
155 std r4, 0(r12)
156 std r5, 8(r12)
157 std r6, 16(r12)
158 std r7, 24(r12)
159
160 lwz r0,8(r1)
161 mtcrf 0xff,r0
162
163 blr /* return r3 = status */
164
126_GLOBAL(plpar_hcall9) 165_GLOBAL(plpar_hcall9)
127 HMT_MEDIUM 166 HMT_MEDIUM
128 167
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 7496005566ef..843ee9643211 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -378,7 +378,7 @@ static void pSeries_lpar_hptab_clear(void)
378 378
379 /* TODO: Use bulk call */ 379 /* TODO: Use bulk call */
380 for (i = 0; i < hpte_count; i++) 380 for (i = 0; i < hpte_count; i++)
381 plpar_pte_remove(0, i, 0, &dummy1, &dummy2); 381 plpar_pte_remove_raw(0, i, 0, &dummy1, &dummy2);
382} 382}
383 383
384/* 384/*
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h
index 3eb7b294d92f..2e4d10c9eea8 100644
--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -78,6 +78,22 @@ static inline long plpar_pte_remove(unsigned long flags, unsigned long ptex,
78 return rc; 78 return rc;
79} 79}
80 80
81/* plpar_pte_remove_raw can be called in real mode. It calls plpar_hcall_raw */
82static inline long plpar_pte_remove_raw(unsigned long flags, unsigned long ptex,
83 unsigned long avpn, unsigned long *old_pteh_ret,
84 unsigned long *old_ptel_ret)
85{
86 long rc;
87 unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
88
89 rc = plpar_hcall_raw(H_REMOVE, retbuf, flags, ptex, avpn);
90
91 *old_pteh_ret = retbuf[0];
92 *old_ptel_ret = retbuf[1];
93
94 return rc;
95}
96
81static inline long plpar_pte_read(unsigned long flags, unsigned long ptex, 97static inline long plpar_pte_read(unsigned long flags, unsigned long ptex,
82 unsigned long *old_pteh_ret, unsigned long *old_ptel_ret) 98 unsigned long *old_pteh_ret, unsigned long *old_ptel_ret)
83{ 99{