From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eddie.linux-mips.org ([148.251.95.138]:56288 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752059AbdFVNmr (ORCPT ); Thu, 22 Jun 2017 09:42:47 -0400 Received: from localhost.localdomain ([127.0.0.1]:58346 "EHLO linux-mips.org" rhost-flags-OK-OK-OK-FAIL) by eddie.linux-mips.org with ESMTP id S23991672AbdFVNmpG7pBq (ORCPT ); Thu, 22 Jun 2017 15:42:45 +0200 Date: Thu, 22 Jun 2017 14:50:24 +0200 From: Ralf Baechle To: James Hogan Cc: Huacai Chen , John Crispin , "Steven J . Hill" , linux-mips@linux-mips.org, Fuxin Zhang , Zhangjin Wu , stable@vger.kernel.org Subject: Re: [PATCH] MIPS: Fix a long-standing mistake in mips_atomic_set() Message-ID: <20170622125024.GB9002@linux-mips.org> References: <1498128345-6827-1-git-send-email-chenhc@lemote.com> <20170622123159.GA31455@jhogan-linux.le.imgtec.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170622123159.GA31455@jhogan-linux.le.imgtec.org> Sender: stable-owner@vger.kernel.org List-ID: On Thu, Jun 22, 2017 at 01:31:59PM +0100, James Hogan wrote: > Hi Huacai, > > On Thu, Jun 22, 2017 at 06:45:45PM +0800, Huacai Chen wrote: > > This mistake comes from the commit f1e39a4a616cd99 ("MIPS: Rewrite > > sysmips(MIPS_ATOMIC_SET, ...) in C with inline assembler"). In the > > common case 'bnez' should be 'beqz' (as same as older kernels before > > 2.6.32), otherwise this syscall may cause an endless loop. > > > > Cc: stable@vger.kernel.org > > Signed-off-by: Huacai Chen > > Thats a coincidence. 8 years its been broken and I submitted an > identical patch only a few weeks ago, along with some other related > fixes: > > https://patchwork.linux-mips.org/project/linux-mips/list/?series=313&state=* I take it as a proof that everybody is using LL/SC (or the LL/SC emulation) these days and sysmips(MIPS_ATOMIC_SET) finally has been obsoleted and is only useful for stoneage binary compatibility. Which is really good. Unless people are using silly hacks such as $k0/$k1 being overwriten by exception handlers ... Ralf