diff options
| -rw-r--r-- | arch/powerpc/kvm/book3s_emulate.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_emulate.c b/arch/powerpc/kvm/book3s_emulate.c index c9924475368f..3f295269af37 100644 --- a/arch/powerpc/kvm/book3s_emulate.c +++ b/arch/powerpc/kvm/book3s_emulate.c | |||
| @@ -94,8 +94,25 @@ int kvmppc_core_emulate_op_pr(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
| 94 | int rs = get_rs(inst); | 94 | int rs = get_rs(inst); |
| 95 | int ra = get_ra(inst); | 95 | int ra = get_ra(inst); |
| 96 | int rb = get_rb(inst); | 96 | int rb = get_rb(inst); |
| 97 | u32 inst_sc = 0x44000002; | ||
| 97 | 98 | ||
| 98 | switch (get_op(inst)) { | 99 | switch (get_op(inst)) { |
| 100 | case 0: | ||
| 101 | emulated = EMULATE_FAIL; | ||
| 102 | if ((kvmppc_get_msr(vcpu) & MSR_LE) && | ||
| 103 | (inst == swab32(inst_sc))) { | ||
| 104 | /* | ||
| 105 | * This is the byte reversed syscall instruction of our | ||
| 106 | * hypercall handler. Early versions of LE Linux didn't | ||
| 107 | * swap the instructions correctly and ended up in | ||
| 108 | * illegal instructions. | ||
| 109 | * Just always fail hypercalls on these broken systems. | ||
| 110 | */ | ||
| 111 | kvmppc_set_gpr(vcpu, 3, EV_UNIMPLEMENTED); | ||
| 112 | kvmppc_set_pc(vcpu, kvmppc_get_pc(vcpu) + 4); | ||
| 113 | emulated = EMULATE_DONE; | ||
| 114 | } | ||
| 115 | break; | ||
| 99 | case 19: | 116 | case 19: |
| 100 | switch (get_xop(inst)) { | 117 | switch (get_xop(inst)) { |
| 101 | case OP_19_XOP_RFID: | 118 | case OP_19_XOP_RFID: |
