Received: from eggs.gnu.org ([2001:4830:134:3::10]:46888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgxDC-0006Ok-9i for qemu-devel@nongnu.org; Mon, 05 Sep 2016 12:57:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgxD8-0000XP-3r for qemu-devel@nongnu.org; Mon, 05 Sep 2016 12:57:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgxD7-0000X7-VM for qemu-devel@nongnu.org; Mon, 05 Sep 2016 12:57:30 -0400 References: <1472725227-10374-1-git-send-email-pbonzini@redhat.com> <1472725227-10374-13-git-send-email-pbonzini@redhat.com> <87oa42z7v1.fsf@linaro.org> From: Paolo Bonzini Message-ID: <4855d797-0820-a3b6-941e-0e738d2fbba5@redhat.com> Date: Mon, 5 Sep 2016 18:57:25 +0200 MIME-Version: 1.0 In-Reply-To: <87oa42z7v1.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 12/12] cpus-common: lock-free fast path for cpu_exec_start/end List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= Cc: qemu-devel@nongnu.org, Sergey Fedorov , Sergey Fedorov , "Emilio G. Cota" On 05/09/2016 17:25, Alex Benn=C3=A9e wrote: >> diff --git a/docs/tcg-exclusive.promela b/docs/tcg-exclusive.promela >> new file mode 100644 >> index 0000000..293b530 >> --- /dev/null >> +++ b/docs/tcg-exclusive.promela >> @@ -0,0 +1,224 @@ >> +/* >> + * This model describes the implementation of exclusive sections in >> + * cpus-common.c (start_exclusive, end_exclusive, cpu_exec_start, >> + * cpu_exec_end). >=20 > \o/ nice to have a model ;-) Yeah, in my tree actually I have a couple optimizations that patch both cpus-common.c and the model. >> + * >> + * Author: Paolo Bonzini >> + * >> + * This file is in the public domain. If you really want a license, >> + * the WTFPL will do. >> + * >> + * To verify it: >> + * spin -a docs/event.promela >=20 > wrong docs name >=20 >> + * ./a.out -a >=20 > Which version of spin did you run? I grabbed the latest src release > (http://spinroot.com/spin/Src/src645.tar.gz) and had to manually build > the output: >=20 > ~/src/spin/Src6.4.5/spin -a docs/tcg-exclusive.promela > gcc pan.c > ../a.out Yes, that's how you use it. You'd better use -O2, too. >> + * >> + * Tunable processor macros: N_CPUS, N_EXCLUSIVE, N_CYCLES, USE_MUTEX= , >> + * TEST_EXPENSIVE. >> + */ >=20 > How do you pass these? I tried: >=20 > ~/src/spin/Src6.4.5/spin -a docs/tcg-exclusive.promela -DN_CPUS=3D4 This should work... Maybe put -D before the file name. Paolo