diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries/hvCall.S')
-rw-r--r-- | arch/powerpc/platforms/pseries/hvCall.S | 41 |
1 files changed, 40 insertions, 1 deletions
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 \ |
38 | BEGIN_FTR_SECTION; \ | ||
39 | b 1f; \ | ||
40 | END_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 | ||