Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3736954pxb; Mon, 30 Aug 2021 09:27:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUmTczIuY66SG2tCHa+VOEWj1uOo6kN+g5t+tTwv7g5QbR0BjIcnZIqllTc6pQHVNmfjVi X-Received: by 2002:a17:906:4541:: with SMTP id s1mr26375078ejq.378.1630340865299; Mon, 30 Aug 2021 09:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630340865; cv=none; d=google.com; s=arc-20160816; b=BpQOC4t1P0T34ox+h7BOYpK3viKng1/dxQR9pKKz7S5QzNndQBiY2S6cgeq1xXnZe+ 4RmKlx3UVKETG0imqLYBdkHQDI7e9ZGInW6/C6TR/nVxstYq0zVnZOwxf4OnyPc1ldxV +B8zCbznp2nELTpMpzytL0L3yU8JqUq/Ocvhv6P7etPJdKRbkyxaIxQIm8xYKZ5I6gOK AHf+OzDIXC06BqTIaNt1uVoVFXXwTn/LHKbrhzbl/Jv9vrPZCxIf01bFFpM3rBUBH/+1 ox7Ut+CuI8aSzTDexp8nEtrHiyDm4MnnDm2/uRT2nqbxgDaURj4ZPGWODE50xI9fD6fI HD+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=V9KPj1l200pe8lvrcwheafYz+NbTIXwaozb+aPY+BSE=; b=DHcu1jhaEHUN9weezT31Cic1XODfQDOzrK/RrdOeuE7HsJQpwfiiy+aMjBh629ztla LrY1HYlVDcmYD46A3VKb7ARTPaCB+r2nbYp6Wlo4qND5d8xxRRcCDzIbXEVgh7FPZwPk CSL48bS4B0Il7Dse0tLUMiZU3kkc5u7qjZMe0A6ZI7CTArO4hdodpY9ZUkHwxC/7w2Ze VB3hervTzTQPa7bogcPvFNHqdw3SnS91+QAgq/ClHdlppWrIBor5w6oiMAN0LZkbxInO ZpGk5V+ia92XIpAonsja4zJJsp8FoPO8dVwvEDZ6dLbBdxaxkRu429ZVq5R8N9LqN9x3 xaag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mengyan1223.wang header.s=mail header.b="Fqrh/qF+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mengyan1223.wang Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t12si19426622edc.333.2021.08.30.09.27.21; Mon, 30 Aug 2021 09:27:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mengyan1223.wang header.s=mail header.b="Fqrh/qF+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mengyan1223.wang Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237747AbhH3Q0a (ORCPT + 99 others); Mon, 30 Aug 2021 12:26:30 -0400 Received: from mengyan1223.wang ([89.208.246.23]:36108 "EHLO mengyan1223.wang" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237734AbhH3Q03 (ORCPT ); Mon, 30 Aug 2021 12:26:29 -0400 Received: from [IPv6:240e:35a:10e9:a200:dc73:854d:832e:2] (unknown [IPv6:240e:35a:10e9:a200:dc73:854d:832e:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id D7E0C65B15; Mon, 30 Aug 2021 12:25:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mengyan1223.wang; s=mail; t=1630340735; bh=V9KPj1l200pe8lvrcwheafYz+NbTIXwaozb+aPY+BSE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Fqrh/qF+X3n/+zQXnNn+7tjXVNEFnrUVO1Qflwd0i5G2GH4A2jkbApWcQhTi+VyG5 qO4I5sItnmPNSC1PKnv1t57DqNF071cp1MWSVeHlfne6Q97uIcgDnHcGLkb6Zl/q50 XO3Z+GxVdMZrjCvcHoIEaaO3YglzsegxQ6EeXAoo0yyxVMAkyhxNG8WynqxnbokiHh 5f4qkXuDvSppBg1rK0OXBblglXkUO65JvJ+AuGEHZQH5Xc1iqwnpqXgclzFPfi4fqo jVJiigqJbpjm2hBX4XKFSOPl/NCmrrghSVxBAj4pPAkq2u/hag1b8PBfvlKdjOA3sM eZtBEnUkSGxEg== Message-ID: <40948c12746cbef5d5c2262d69a157f9b609845b.camel@mengyan1223.wang> Subject: Re: [PATCH] mips: remove reference to "newer Loongson-3" From: Xi Ruoyao To: Jiaxun Yang , linux-mips@vger.kernel.org Cc: Thomas Bogendoerfer , linux-kernel@vger.kernel.org, Huacai Chen Date: Tue, 31 Aug 2021 00:25:17 +0800 In-Reply-To: <1d49da11-51d5-e148-cb02-9bd0ee57fae6@flygoat.com> References: <0b7c9431efb12c2d957fcc53ec8f0743725d61b3.camel@mengyan1223.wang> <086f60d6ef4395db5da7ee22c4f352d5c901d396.camel@mengyan1223.wang> <1d49da11-51d5-e148-cb02-9bd0ee57fae6@flygoat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2021-08-31 at 00:14 +0800, Jiaxun Yang wrote: > > > 在 2021/8/30 下午8:28, Xi Ruoyao 写道: > > On Mon, 2021-08-30 at 10:32 +0800, Jiaxun Yang wrote: > > > 在 2021/8/29 20:49, Xi Ruoyao 写道: > > > > Newest Loongson-3 processors have moved to use LoongArch > > > > architecture. > > > > Sadly, the LL/SC issue is still existing on both latest > > > > Loongson-3 > > > > processors using MIPS64 (Loongson-3A4000) and LoongArch > > > > (Loongson-3A5000). > > > LLSC is fixed on Loongson-3A4000 as per CPUCFG report. > > If I don't enable LL/SC fix, GCC libgomp tests fail on both 3A4000 > > and > > 3A5000 (using github.com/loongson/gcc for the latter) with "invalid > > access to 0x00000049" or "0x00000005".  This is a race condition: it > > does not happen at all with OMP_NUM_THREADS=1, happens with about > > 10% > > possibility with OMP_NUM_THREADS=2, and about 90% possibility with > > OMP_NUM_THREAD=4 (on 3A5000, on 3A4000 the possibility is lower). > Apologize for the false report, yes, you are right. I had checked with > Loongson guys > and they confirmed that the workaround still needs to be applied to > latest 3A4000 > processors, including 3A4000 for MIPS and 3A5000 for LoongArch. > > Though, the reason behind the workaround varies with the evaluation of > their uArch, > for GS464V based core, barrier is required as the uArch design allows > regular load > to be reordered after an atomic linked load, and that would break > assumption of compiler > atomic constraints. > For GS464E, barrier is required to flush the Store Fill Buffer and > land > all the cachelines > to L1 cache, otherwise a linked load to a cacheline located at SFB may > cause deadlock. > > For original GS464, barrier is required to deal with some kind of > pipeline hazard to > ensure store condition won't be shorted to success. This explains the different (mis)behavior of LL/SC on those uarchs. I remember the original report of LL/SC issue said it can cause a deadlock on earlier model of 3As, but I didn't observed any deadlock on 3A4000. (That's I why didn't tried the workaround immediately after spotting libgomp failure, but debugged the code from 00:00 AM to 04:00 :( ) Thanks for your detailed explanation! > Patch LGTM. The config symbol looks ambiguous and I'd agree with your > idea of renaming. > > Thanks, > > - Jiaxun > > Or these are two different erratas and I misunderstand them as the > > same one? So basically this is true :). They just happen to share one workaround. -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University