powerpc: Emulation support for load/store instructions on LE emulate_step() uses a number of underlying kernel functions that were initially not enabled for LE. This has been rectified since. So, fix emulate_step() for LE for the corresponding instructions. Cc: stable@vger.kernel.org # v3.18+ Reported-by: Anton Blanchard Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman --- sstep.c.org 2017-03-23 03:07:11.889762757 -0400 +++ sstep.c 2017-03-23 03:04:51.234888474 -0400 @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -1799,8 +1800,7 @@ goto instr_done; case LARX: - if (regs->msr & MSR_LE) - return 0; + if (op.ea & (size - 1)) break; /* can't handle misaligned */ err = -EFAULT; @@ -1824,8 +1824,7 @@ goto ldst_done; case STCX: - if (regs->msr & MSR_LE) - return 0; + if (op.ea & (size - 1)) break; /* can't handle misaligned */ err = -EFAULT; @@ -1851,8 +1850,7 @@ goto ldst_done; case LOAD: - if (regs->msr & MSR_LE) - return 0; + err = read_mem(®s->gpr[op.reg], op.ea, size, regs); if (!err) { if (op.type & SIGNEXT) @@ -1864,8 +1862,7 @@ #ifdef CONFIG_PPC_FPU case LOAD_FP: - if (regs->msr & MSR_LE) - return 0; + if (size == 4) err = do_fp_load(op.reg, do_lfs, op.ea, size, regs); else @@ -1874,15 +1871,13 @@ #endif #ifdef CONFIG_ALTIVEC case LOAD_VMX: - if (regs->msr & MSR_LE) - return 0; + err = do_vec_load(op.reg, do_lvx, op.ea & ~0xfUL, regs); goto ldst_done; #endif #ifdef CONFIG_VSX case LOAD_VSX: - if (regs->msr & MSR_LE) - return 0; + err = do_vsx_load(op.reg, do_lxvd2x, op.ea, regs); goto ldst_done; #endif @@ -1905,8 +1900,7 @@ goto instr_done; case STORE: - if (regs->msr & MSR_LE) - return 0; + if ((op.type & UPDATE) && size == sizeof(long) && op.reg == 1 && op.update_reg == 1 && !(regs->msr & MSR_PR) && @@ -1919,8 +1913,7 @@ #ifdef CONFIG_PPC_FPU case STORE_FP: - if (regs->msr & MSR_LE) - return 0; + if (size == 4) err = do_fp_store(op.reg, do_stfs, op.ea, size, regs); else @@ -1929,15 +1922,13 @@ #endif #ifdef CONFIG_ALTIVEC case STORE_VMX: - if (regs->msr & MSR_LE) - return 0; + err = do_vec_store(op.reg, do_stvx, op.ea & ~0xfUL, regs); goto ldst_done; #endif #ifdef CONFIG_VSX case STORE_VSX: - if (regs->msr & MSR_LE) - return 0; + err = do_vsx_store(op.reg, do_stxvd2x, op.ea, regs); goto ldst_done; #endif