From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anSuq-0001Gv-0e for qemu-devel@nongnu.org; Tue, 05 Apr 2016 11:29:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anSuk-00064W-Gm for qemu-devel@nongnu.org; Tue, 05 Apr 2016 11:29:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anSuk-000649-6u for qemu-devel@nongnu.org; Tue, 05 Apr 2016 11:29:10 -0400 References: <1459834253-8291-1-git-send-email-cota@braap.org> <1459834253-8291-3-git-send-email-cota@braap.org> <87shz0tdr3.fsf@fimbulvetr.bsc.es> From: Paolo Bonzini Message-ID: <5703D9C1.2090307@redhat.com> Date: Tue, 5 Apr 2016 17:29:05 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 02/10] compiler.h: add QEMU_CACHELINE + QEMU_ALIGN() + QEMU_CACHELINE_ALIGNED List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , "Emilio G. Cota" , QEMU Developers , MTTCG Devel , Peter Crosthwaite , Sergey Fedorov , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Richard Henderson On 05/04/2016 14:58, Peter Maydell wrote: >> > >> > You should make this a value taken from configure. In linux you coul= d use >> > something like: >> > >> > getconf LEVEL1_DCACHE_LINESIZE >> > >> > Or an equivalent program using sysconf(3) if getconf is not present. > The cache line size at compile time is not necessarily the cache > line size at runtime... But the size of data structures cannot change at run-time. A bigger worry is cross-compilation. Linux has these defaults: Alpha 32 or 64 ARM configurable, 64 for ARMv7 AArch64 128 PPC 128 s390 256 x86 configurable, default 64 which should be easy to copy in QEMU too. Paolo