diff options
| -rw-r--r-- | arch/powerpc/kvm/book3s_interrupts.S | 7 | ||||
| -rw-r--r-- | arch/powerpc/kvm/booke_interrupts.S | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_interrupts.S b/arch/powerpc/kvm/book3s_interrupts.S index 0a8515a5c04..3e35383bdb2 100644 --- a/arch/powerpc/kvm/book3s_interrupts.S +++ b/arch/powerpc/kvm/book3s_interrupts.S | |||
| @@ -84,6 +84,10 @@ kvm_start_entry: | |||
| 84 | /* Save non-volatile registers (r14 - r31) */ | 84 | /* Save non-volatile registers (r14 - r31) */ |
| 85 | SAVE_NVGPRS(r1) | 85 | SAVE_NVGPRS(r1) |
| 86 | 86 | ||
| 87 | /* Save CR */ | ||
| 88 | mfcr r14 | ||
| 89 | stw r14, _CCR(r1) | ||
| 90 | |||
| 87 | /* Save LR */ | 91 | /* Save LR */ |
| 88 | PPC_STL r0, _LINK(r1) | 92 | PPC_STL r0, _LINK(r1) |
| 89 | 93 | ||
| @@ -165,6 +169,9 @@ kvm_exit_loop: | |||
| 165 | PPC_LL r4, _LINK(r1) | 169 | PPC_LL r4, _LINK(r1) |
| 166 | mtlr r4 | 170 | mtlr r4 |
| 167 | 171 | ||
| 172 | lwz r14, _CCR(r1) | ||
| 173 | mtcr r14 | ||
| 174 | |||
| 168 | /* Restore non-volatile host registers (r14 - r31) */ | 175 | /* Restore non-volatile host registers (r14 - r31) */ |
| 169 | REST_NVGPRS(r1) | 176 | REST_NVGPRS(r1) |
| 170 | 177 | ||
diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S index 10d8ef602e5..c8c4b878795 100644 --- a/arch/powerpc/kvm/booke_interrupts.S +++ b/arch/powerpc/kvm/booke_interrupts.S | |||
| @@ -34,7 +34,8 @@ | |||
| 34 | /* r2 is special: it holds 'current', and it made nonvolatile in the | 34 | /* r2 is special: it holds 'current', and it made nonvolatile in the |
| 35 | * kernel with the -ffixed-r2 gcc option. */ | 35 | * kernel with the -ffixed-r2 gcc option. */ |
| 36 | #define HOST_R2 12 | 36 | #define HOST_R2 12 |
| 37 | #define HOST_NV_GPRS 16 | 37 | #define HOST_CR 16 |
| 38 | #define HOST_NV_GPRS 20 | ||
| 38 | #define HOST_NV_GPR(n) (HOST_NV_GPRS + ((n - 14) * 4)) | 39 | #define HOST_NV_GPR(n) (HOST_NV_GPRS + ((n - 14) * 4)) |
| 39 | #define HOST_MIN_STACK_SIZE (HOST_NV_GPR(31) + 4) | 40 | #define HOST_MIN_STACK_SIZE (HOST_NV_GPR(31) + 4) |
| 40 | #define HOST_STACK_SIZE (((HOST_MIN_STACK_SIZE + 15) / 16) * 16) /* Align. */ | 41 | #define HOST_STACK_SIZE (((HOST_MIN_STACK_SIZE + 15) / 16) * 16) /* Align. */ |
| @@ -296,8 +297,10 @@ heavyweight_exit: | |||
| 296 | 297 | ||
| 297 | /* Return to kvm_vcpu_run(). */ | 298 | /* Return to kvm_vcpu_run(). */ |
| 298 | lwz r4, HOST_STACK_LR(r1) | 299 | lwz r4, HOST_STACK_LR(r1) |
| 300 | lwz r5, HOST_CR(r1) | ||
| 299 | addi r1, r1, HOST_STACK_SIZE | 301 | addi r1, r1, HOST_STACK_SIZE |
| 300 | mtlr r4 | 302 | mtlr r4 |
| 303 | mtcr r5 | ||
| 301 | /* r3 still contains the return code from kvmppc_handle_exit(). */ | 304 | /* r3 still contains the return code from kvmppc_handle_exit(). */ |
| 302 | blr | 305 | blr |
| 303 | 306 | ||
| @@ -314,6 +317,8 @@ _GLOBAL(__kvmppc_vcpu_run) | |||
| 314 | stw r3, HOST_RUN(r1) | 317 | stw r3, HOST_RUN(r1) |
| 315 | mflr r3 | 318 | mflr r3 |
| 316 | stw r3, HOST_STACK_LR(r1) | 319 | stw r3, HOST_STACK_LR(r1) |
| 320 | mfcr r5 | ||
| 321 | stw r5, HOST_CR(r1) | ||
| 317 | 322 | ||
| 318 | /* Save host non-volatile register state to stack. */ | 323 | /* Save host non-volatile register state to stack. */ |
| 319 | stw r14, HOST_NV_GPR(r14)(r1) | 324 | stw r14, HOST_NV_GPR(r14)(r1) |
