Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933423AbbLHKXb (ORCPT ); Tue, 8 Dec 2015 05:23:31 -0500 Received: from eu-smtp-delivery-143.mimecast.com ([146.101.78.143]:60079 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933286AbbLHKX0 convert rfc822-to-8bit (ORCPT ); Tue, 8 Dec 2015 05:23:26 -0500 Message-ID: <5666AF7D.5000703@arm.com> Date: Tue, 08 Dec 2015 10:22:53 +0000 From: Vladimir Murzin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Shengjiu Wang , "linux@arm.linux.org.uk" , "ard.biesheuvel@linaro.org" , "nico@linaro.org" CC: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH V2] ARM: SWP emulation: Restore original *data when failed References: <726a7ce88982fba5df84e4d22b083e39b57a6bc6.1444900732.git.shengjiu.wang@freescale.com> In-Reply-To: <726a7ce88982fba5df84e4d22b083e39b57a6bc6.1444900732.git.shengjiu.wang@freescale.com> X-OriginalArrivalTime: 08 Dec 2015 10:23:01.0021 (UTC) FILETIME=[6A6964D0:01D131A2] X-MC-Unique: cr1uOiEGRUu9312aTQO4Qg-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1553 Lines: 44 On 15/10/15 10:30, Shengjiu Wang wrote: > __user_swpX_asm maybe failed in first STREX operation, emulate_swpX > will try again, but the *data has been changed in first time. which > causes the result is wrong. > This patch is to fix this issue. When STREX succeed, change the *data. > if it fail, *data is not changed. > > Signed-off-by: Shengjiu Wang > --- > arch/arm/kernel/swp_emulate.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c > index 5b26e7e..c3fe769d 100644 > --- a/arch/arm/kernel/swp_emulate.c > +++ b/arch/arm/kernel/swp_emulate.c > @@ -36,10 +36,10 @@ > */ > #define __user_swpX_asm(data, addr, res, temp, B) \ > __asm__ __volatile__( \ > - " mov %2, %1\n" \ > - "0: ldrex"B" %1, [%3]\n" \ > - "1: strex"B" %0, %2, [%3]\n" \ > + "0: ldrex"B" %2, [%3]\n" \ > + "1: strex"B" %0, %1, [%3]\n" \ > " cmp %0, #0\n" \ > + " moveq %1, %2\n" \ > " movne %0, %4\n" \ > "2:\n" \ > " .section .text.fixup,\"ax\"\n" \ > I wonder what is status of this patch? I see that arm64 counterpart has landed in mainline, but I didn't manage to track down this one - is it because it never been submitted to patch system? Thanks Vladimir -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/