From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WELWw-0003v7-45 for qemu-devel@nongnu.org; Fri, 14 Feb 2014 11:22:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WELWp-0007YT-EK for qemu-devel@nongnu.org; Fri, 14 Feb 2014 11:22:22 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49150 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WELWp-0007YM-7s for qemu-devel@nongnu.org; Fri, 14 Feb 2014 11:22:15 -0500 Message-ID: <52FE42B3.7080200@suse.de> Date: Fri, 14 Feb 2014 17:22:11 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1392394012-8661-1-git-send-email-sebastian.huber@embedded-brains.de> In-Reply-To: <1392394012-8661-1-git-send-email-sebastian.huber@embedded-brains.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4] target-sparc: Add and use CPU_FEATURE_CASA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sebastian Huber , qemu-devel@nongnu.org Cc: blauwirbel@gmail.com, Fabien Chouteau Am 14.02.2014 17:06, schrieb Sebastian Huber: > The LEON3 processor has support for the CASA instruction which is > normally only available for SPARC V9 processors. Binutils 2.24 > and GCC 4.9 will support this instruction for LEON3. GCC uses it to > generate C11 atomic operations. >=20 > The CAS synthetic instruction uses an ASI of 0x80. If TARGET_SPARC64 i= s > not defined use a supervisor data load/store for an ASI of 0x80 in > helper_ld_asi()/helper_st_asi(). The supervisor data load/store was > choosen according to the LEON3 documentation. >=20 > The ASI 0x80 is defined in the SPARC V9 manual, Table 12=E2=80=94Addres= s Space > Identifiers (ASIs). Here we have: 0x80, ASI_PRIMARY, Unrestricted > access, Primary address space. >=20 > Tested with the following program: >=20 > #include > #include >=20 > void test(void) > { > atomic_int a; > int e; > _Bool b; >=20 > atomic_store(&a, 1); > e =3D 1; > b =3D atomic_compare_exchange_strong(&a, &e, 2); > assert(b); > assert(atomic_load(&a) =3D=3D 2); >=20 > atomic_store(&a, 3); > e =3D 4; > b =3D atomic_compare_exchange_strong(&a, &e, 5); > assert(!b); > assert(atomic_load(&a) =3D=3D 3); > } >=20 > Tested also on a NGMP board with a LEON4 processor. >=20 > v4: Fix coding style. >=20 > Signed-off-by: Sebastian Huber > Reviewed-by: Fabien Chouteau Reviewed-by: Andreas F=C3=A4rber but please put change logs below --- next time. No v5 needed for that, committer can fix. Also in my theory your Signed-off-by should be last when you submit a patch, in particular when you apply changes on top of what a reviewer has reviewed. Thanks, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg