Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757474AbcKBVEh (ORCPT ); Wed, 2 Nov 2016 17:04:37 -0400 Received: from hr2.samba.org ([144.76.82.148]:57392 "EHLO hr2.samba.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752710AbcKBVEg (ORCPT ); Wed, 2 Nov 2016 17:04:36 -0400 Date: Thu, 3 Nov 2016 08:04:12 +1100 From: Anton Blanchard To: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, mpe@ellerman.id.au, duwe@lst.de, ast@kernel.org, viro@zeniv.linux.org.uk, chris@distroguy.com, oss@buserror.net, paul.gortmaker@windriver.com, oohall@gmail.com, aneesh.kumar@linux.vnet.ibm.com, lsorense@csclub.uwaterloo.ca, bauerman@linux.vnet.ibm.com, paulus@samba.org, naveen.n.rao@linux.vnet.ibm.com Subject: Re: [PATCH 1/3] powerpc: Emulation support for load/store instructions on LE Message-ID: <20161103080412.68240cda@kryten> In-Reply-To: <1478076783-2872-2-git-send-email-ravi.bangoria@linux.vnet.ibm.com> References: <1478076783-2872-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com> <1478076783-2872-2-git-send-email-ravi.bangoria@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3225 Lines: 106 Hi Ravi, > 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. Thanks. Should this be queued up for stable? Anton > Reported-by: Anton Blanchard > Signed-off-by: Ravi Bangoria > --- > arch/powerpc/lib/sstep.c | 20 -------------------- > 1 file changed, 20 deletions(-) > > diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c > index 3362299..6ca3b90 100644 > --- a/arch/powerpc/lib/sstep.c > +++ b/arch/powerpc/lib/sstep.c > @@ -1807,8 +1807,6 @@ int __kprobes emulate_step(struct pt_regs > *regs, unsigned int instr) goto instr_done; > > case LARX: > - if (regs->msr & MSR_LE) > - return 0; > if (op.ea & (size - 1)) > break; /* can't handle > misaligned */ err = -EFAULT; > @@ -1832,8 +1830,6 @@ int __kprobes emulate_step(struct pt_regs > *regs, unsigned int instr) goto ldst_done; > > case STCX: > - if (regs->msr & MSR_LE) > - return 0; > if (op.ea & (size - 1)) > break; /* can't handle > misaligned */ err = -EFAULT; > @@ -1859,8 +1855,6 @@ int __kprobes emulate_step(struct pt_regs > *regs, unsigned int instr) 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) > @@ -1872,8 +1866,6 @@ int __kprobes emulate_step(struct pt_regs > *regs, unsigned int instr) > #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 > @@ -1882,15 +1874,11 @@ int __kprobes emulate_step(struct pt_regs > *regs, unsigned int instr) #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 > @@ -1913,8 +1901,6 @@ int __kprobes emulate_step(struct pt_regs > *regs, unsigned int instr) 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) && > @@ -1927,8 +1913,6 @@ int __kprobes emulate_step(struct pt_regs > *regs, unsigned int instr) > #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 > @@ -1937,15 +1921,11 @@ int __kprobes emulate_step(struct pt_regs > *regs, unsigned int instr) #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