From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai1CP-0000be-M3 for qemu-devel@nongnu.org; Mon, 21 Mar 2016 10:52:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ai1CK-000253-Ib for qemu-devel@nongnu.org; Mon, 21 Mar 2016 10:52:53 -0400 Received: from ignoranthack.me ([199.102.79.106]:51445 helo=mail.ignoranthack.me) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai1CK-00024z-De for qemu-devel@nongnu.org; Mon, 21 Mar 2016 10:52:48 -0400 References: <56EEF805.8040008@freebsd.org> <87vb4grya5.fsf@linaro.org> From: Sean Bruno Message-ID: <56F00ABC.9030700@freebsd.org> Date: Mon, 21 Mar 2016 07:52:44 -0700 MIME-Version: 1.0 In-Reply-To: <87vb4grya5.fsf@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [FreeBSD] Host build i386 failing to build aarch64 targets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , Peter Maydell Cc: Paolo Bonzini , QEMU Developers -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 03/21/16 02:11, Alex Benn=C3=A9e wrote: >=20 > Peter Maydell writes: >=20 >> On 20 March 2016 at 19:20, Sean Bruno >> wrote: >>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 >>>=20 >>> aarch64 targets are now failing to build on i386 hosts due to >>> missing __atomic_load_8() calls since this commit: >>>=20 >>> https://github.com/qemu/qemu/commit/a0aa44b488b3601415d55041e4619aef5= f3a4ba8#diff-c143d686899ae51d7b927d9c682e12fd >>> >>> >>>=20 I'm unsure if Linux is disabling aarch64 targets for i386 hosts or if >>> this commit works "just fine" on Linux hosts right now, as it >>> doesn't work with clang or gcc. >>=20 >> I think it just works on most Linux 32-bit architectures because=20 >> the compiler support can inline a suitable atomic op (there is >> one case where it doesn't, which I think is PPC32). >>=20 >> In any case, we mustn't use atomics on types larger than the host >> pointer type, because it's not portable enough. Paolo or Alex, >> can you have a look at this? >=20 > I'll get a BSD up and running and check. What is triggering the=20 > __atomic_load_8 though? >=20 >>=20 Specifically, its the atomic_read of vm_clock_warp_start in cpus.c: 114 /***********************************************************/ 115 /* guest cycle counter */ 116 117 /* Protected by TimersState seqlock */ 118 119 static bool icount_sleep =3D true; 120 static int64_t vm_clock_warp_start =3D -1; 121 /* Conversion factor from emulated instructions to virtual clock ticks. */ 122 static int icount_time_shift; .... 339 static void icount_warp_rt(void) 340 { 341 /* The icount_warp_timer is rescheduled soon after vm_clock_warp_start 342 * changes from -1 to another value, so the race here is okay. 343 */ 344 if (atomic_read(&vm_clock_warp_start) =3D=3D -1) { 345 return; 346 } 347 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJW8Aq6XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRCQUFENDYzMkU3MTIxREU4RDIwOTk3REQx MjAxRUZDQTFFNzI3RTY0AAoJEBIB78oecn5kktIH+QHD8muIYbAPzJcBMIFv9zIR tv1OhxHgrWgmxnfzxeXwNkG5JkIrFKkJd6HoA4we+qrQu2Fi9ZCxz/cmFryNzXuT CQPGcEaKQvAVT9623UVtJkvKv1lFzpclX6wQKkAN1GtnoaoXmOntCoPQFR2/cha3 0YeLM/26nlKr6kcWbX5a5hplKnsPA7IY0lohWGp/qziZKuFQ7GWsM6IkyLoXRn+T T8Qw7NM40/iIvqYd7NfQlDlGa1GZo8mvsRvvF1C6YEkAmU9TkX0LfgGuIpiYmvYb gHEJ6JcXRQhGQXWkGu3Znw4JzckjfPrg0/SMIsk4kMVNXunJ89Il4xT8wtFXFYw=3D =3DLehi -----END PGP SIGNATURE-----