diff options
Diffstat (limited to 'arch/powerpc/kvm/book3s_rmhandlers.S')
-rw-r--r-- | arch/powerpc/kvm/book3s_rmhandlers.S | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/arch/powerpc/kvm/book3s_rmhandlers.S b/arch/powerpc/kvm/book3s_rmhandlers.S index 506d5c316c96..2b9c9088d00e 100644 --- a/arch/powerpc/kvm/book3s_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_rmhandlers.S | |||
@@ -202,8 +202,25 @@ _GLOBAL(kvmppc_rmcall) | |||
202 | 202 | ||
203 | #if defined(CONFIG_PPC_BOOK3S_32) | 203 | #if defined(CONFIG_PPC_BOOK3S_32) |
204 | #define STACK_LR INT_FRAME_SIZE+4 | 204 | #define STACK_LR INT_FRAME_SIZE+4 |
205 | |||
206 | /* load_up_xxx have to run with MSR_DR=0 on Book3S_32 */ | ||
207 | #define MSR_EXT_START \ | ||
208 | PPC_STL r20, _NIP(r1); \ | ||
209 | mfmsr r20; \ | ||
210 | LOAD_REG_IMMEDIATE(r3, MSR_DR|MSR_EE); \ | ||
211 | andc r3,r20,r3; /* Disable DR,EE */ \ | ||
212 | mtmsr r3; \ | ||
213 | sync | ||
214 | |||
215 | #define MSR_EXT_END \ | ||
216 | mtmsr r20; /* Enable DR,EE */ \ | ||
217 | sync; \ | ||
218 | PPC_LL r20, _NIP(r1) | ||
219 | |||
205 | #elif defined(CONFIG_PPC_BOOK3S_64) | 220 | #elif defined(CONFIG_PPC_BOOK3S_64) |
206 | #define STACK_LR _LINK | 221 | #define STACK_LR _LINK |
222 | #define MSR_EXT_START | ||
223 | #define MSR_EXT_END | ||
207 | #endif | 224 | #endif |
208 | 225 | ||
209 | /* | 226 | /* |
@@ -215,19 +232,12 @@ _GLOBAL(kvmppc_load_up_ ## what); \ | |||
215 | PPC_STLU r1, -INT_FRAME_SIZE(r1); \ | 232 | PPC_STLU r1, -INT_FRAME_SIZE(r1); \ |
216 | mflr r3; \ | 233 | mflr r3; \ |
217 | PPC_STL r3, STACK_LR(r1); \ | 234 | PPC_STL r3, STACK_LR(r1); \ |
218 | PPC_STL r20, _NIP(r1); \ | 235 | MSR_EXT_START; \ |
219 | mfmsr r20; \ | ||
220 | LOAD_REG_IMMEDIATE(r3, MSR_DR|MSR_EE); \ | ||
221 | andc r3,r20,r3; /* Disable DR,EE */ \ | ||
222 | mtmsr r3; \ | ||
223 | sync; \ | ||
224 | \ | 236 | \ |
225 | bl FUNC(load_up_ ## what); \ | 237 | bl FUNC(load_up_ ## what); \ |
226 | \ | 238 | \ |
227 | mtmsr r20; /* Enable DR,EE */ \ | 239 | MSR_EXT_END; \ |
228 | sync; \ | ||
229 | PPC_LL r3, STACK_LR(r1); \ | 240 | PPC_LL r3, STACK_LR(r1); \ |
230 | PPC_LL r20, _NIP(r1); \ | ||
231 | mtlr r3; \ | 241 | mtlr r3; \ |
232 | addi r1, r1, INT_FRAME_SIZE; \ | 242 | addi r1, r1, INT_FRAME_SIZE; \ |
233 | blr | 243 | blr |
@@ -242,10 +252,10 @@ define_load_up(vsx) | |||
242 | 252 | ||
243 | .global kvmppc_trampoline_lowmem | 253 | .global kvmppc_trampoline_lowmem |
244 | kvmppc_trampoline_lowmem: | 254 | kvmppc_trampoline_lowmem: |
245 | .long kvmppc_handler_lowmem_trampoline - CONFIG_KERNEL_START | 255 | PPC_LONG kvmppc_handler_lowmem_trampoline - CONFIG_KERNEL_START |
246 | 256 | ||
247 | .global kvmppc_trampoline_enter | 257 | .global kvmppc_trampoline_enter |
248 | kvmppc_trampoline_enter: | 258 | kvmppc_trampoline_enter: |
249 | .long kvmppc_handler_trampoline_enter - CONFIG_KERNEL_START | 259 | PPC_LONG kvmppc_handler_trampoline_enter - CONFIG_KERNEL_START |
250 | 260 | ||
251 | #include "book3s_segment.S" | 261 | #include "book3s_segment.S" |