From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751454AbdBXJwh (ORCPT ); Fri, 24 Feb 2017 04:52:37 -0500 Received: from mail.southpole.se ([37.247.8.11]:58831 "EHLO mail.southpole.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbdBXJvt (ORCPT ); Fri, 24 Feb 2017 04:51:49 -0500 X-Assp-Version: 2.5.5(16366) on assp.southpole.se X-Assp-ID: assp.southpole.se 28753-01408 X-Assp-Session: 7FBF21654B00 (mail 1) X-Assp-Client-SSL: yes X-Assp-Server-TLS: yes Subject: Re: [PATCH v4 20/24] openrisc: entry: Fix delay slot detection To: Stafford Horne , Stefan Kristiansson References: <34caff307ead3a1b67a7226507082ace94e22875.1487910170.git.shorne@gmail.com> Cc: linux@roeck-us.net, openrisc@lists.librecores.org, linux-kernel@vger.kernel.org From: Jonas Bonn Message-ID: <188dcb34-4e8e-7636-e31d-2ae451dac2ff@southpole.se> Date: Fri, 24 Feb 2017 10:32:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <34caff307ead3a1b67a7226507082ace94e22875.1487910170.git.shorne@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/24/2017 05:32 AM, Stafford Horne wrote: > Use execption SR stored in pt_regs for detection, the current SR is not > correct as the handler is running after return from exception. > > Also, The code that checks for a delay slot uses a flag bitmask and then > wants to check if the result is not zero. The test it implemented was > wrong. > > Correct it by changing the test to check result against non zero. This wants to be two patches as you are changing two different things. /Joans > > Signed-off-by: Stafford Horne > --- > arch/openrisc/kernel/entry.S | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S > index daae2a4..bc65008 100644 > --- a/arch/openrisc/kernel/entry.S > +++ b/arch/openrisc/kernel/entry.S > @@ -258,9 +258,9 @@ EXCEPTION_ENTRY(_data_page_fault_handler) > > #else > > - l.mfspr r6,r0,SPR_SR // SR > + l.lwz r6,PT_SR(r3) // SR > l.andi r6,r6,SPR_SR_DSX // check for delay slot exception > - l.sfeqi r6,0x1 // exception happened in delay slot > + l.sfne r6,r0 // exception happened in delay slot > l.bnf 7f > l.lwz r6,PT_PC(r3) // address of an offending insn >