From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536622935357740.5452027257121; Mon, 10 Sep 2018 16:42:15 -0700 (PDT) Received: from localhost ([::1]:54627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVos-0000JG-9k for importer@patchew.org; Mon, 10 Sep 2018 19:42:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjn-0003am-1H for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbR-0005Id-Vg for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:25 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:38029) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbR-0005HV-Mb for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:21 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AA12E21B54; Mon, 10 Sep 2018 19:28:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:20 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id CF678E408D; Mon, 10 Sep 2018 19:28:19 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=mbdZcntv6KazaS EHA4F8/aLiZvJ/t2LNJGcox3pNr+4=; b=qbff/++kPkGHP/5THd7zRWmIvi4WFL z2NsHtrSeEm2VK33+vwqQLvPApDiw9vFr3K1HbLDuBX81O+0IFPRFfE62Q8Sj0Nv /LND+2EnP4myzYmYphV3eY1Oik23h68dCV8AwTF3DnUSu58fbZH7Sptxxb2GNd/5 dRwUgAVf4my5c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=mbdZcntv6KazaSEHA4F8/aLiZvJ/t2LNJGcox3pNr+4=; b=KCcBZK45 w1s4CfWfZB3TvGDVXA7kwBDeRWIw9TMF2j0Ya6S/tbcM2oqlPcdeN2D+L06VMu+a R6TUSmquR0ARYKWYwyDJXLlFQpspj741C/mwopJvif4/JrwrhCHRKrgxWXO3idTP NZ5Q5bhJIFUVzZuYWuoVd/I2Vk50w5OYoDQVBslr2k86dkqMlv0Fdfk9eJeS9rnJ L/lpkpJwsCfdsQ5XdLZXTPMSrs/FvoMNb0DvNkFRzhZ6No8HFlwkPiDLP+6sJjEZ tJfCYc6evRC+kmHvSPiU8i8y4ghfvXIKJ2yx4dFhIYNoKoc2zPGrf86gl8E1W+kZ OIOccDs6eJVnTQ== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:41 -0400 Message-Id: <20180910232752.31565-2-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 01/12] cacheinfo: add i/d cache_linesize_log X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Emilio G. Cota --- include/qemu/osdep.h | 2 ++ util/cacheinfo.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index a91068df0e..a746a5e531 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -570,6 +570,8 @@ extern uintptr_t qemu_real_host_page_size; extern intptr_t qemu_real_host_page_mask; =20 extern int qemu_icache_linesize; +extern int qemu_icache_linesize_log; extern int qemu_dcache_linesize; +extern int qemu_dcache_linesize_log; =20 #endif diff --git a/util/cacheinfo.c b/util/cacheinfo.c index db5172d07c..57c7d58159 100644 --- a/util/cacheinfo.c +++ b/util/cacheinfo.c @@ -7,9 +7,12 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/host-utils.h" =20 int qemu_icache_linesize =3D 0; +int qemu_icache_linesize_log; int qemu_dcache_linesize =3D 0; +int qemu_dcache_linesize_log; =20 /* * Operating system specific detection mechanisms. @@ -173,5 +176,7 @@ static void __attribute__((constructor)) init_cache_inf= o(void) fallback_cache_info(&isize, &dsize); =20 qemu_icache_linesize =3D isize; + qemu_icache_linesize_log =3D 31 - clz32(isize); qemu_dcache_linesize =3D dsize; + qemu_dcache_linesize_log =3D 31 - clz32(dsize); } --=20 2.17.1 From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536622939630954.9233461429573; Mon, 10 Sep 2018 16:42:19 -0700 (PDT) Received: from localhost ([::1]:54628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVow-0000MA-J6 for importer@patchew.org; Mon, 10 Sep 2018 19:42:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjt-0003UC-6n for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbR-0005Ie-Vo for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:25 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:59675) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbR-0005HW-MP for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:21 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AB5CC21E0D; Mon, 10 Sep 2018 19:28:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:20 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 176FAE4682; Mon, 10 Sep 2018 19:28:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=3KQXkycV9Q+hxa ei3kzwo8q73IONVzUGcLsW7OmlfWQ=; b=BmAD5l0XlD/bjxfYL6zrevYK/OqS1P DaoRm4bKLE18JvnbQmqXZhLf762y36y3cK1FqCyyoDmkrH4iEtXqb7HhYvJAjLKD q5+ScbhjCMVA8ChY0Q2Z+385TdgOyhveZR7CfvO7uPnWguYEWUA5FAiKyOodBojU +ZiYwIEYwBOhI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=3KQXkycV9Q+hxaei3kzwo8q73IONVzUGcLsW7OmlfWQ=; b=ghhrv0WL yzz3hvYAxnj2KRxQ+sOii+IJJirZuANF2ysd7oKqoWSrCeBaeJ6aOlRk7hsj57pD jsEWWUztNqvCXWFShTF0o1C8la9LQ4xnvrHxXRcr9dThqbF0nrLc+qyB70P9DoK/ CD55x30Ng3bc6YKk3GyFzcVMy2arFj8kRzDB4Ey69N3Fe5tpVXfCeXvoyX1oMtmx dWsLSOZfdyHHL0DLlXKl6xhepWTGc0Pd0A7FVbq84mTMySt5KSuT7jlSaRakD21i 8ovktxiQYT2Q1HyD6jcoR0aY4FB7B2fwzr3vtF2zKqdsBu7DOQGSNQkU4XqljL9X THuju24ANbjT4w== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:42 -0400 Message-Id: <20180910232752.31565-3-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 02/12] util: add atomic64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This introduces read/set accessors for int64_t and uint64_t. Signed-off-by: Emilio G. Cota --- include/qemu/atomic.h | 34 ++++++++++++++++++ util/atomic64.c | 83 +++++++++++++++++++++++++++++++++++++++++++ util/cacheinfo.c | 3 ++ util/Makefile.objs | 1 + 4 files changed, 121 insertions(+) create mode 100644 util/atomic64.c diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 9ed39effd3..c34c2f78c4 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -450,4 +450,38 @@ _oldn; \ }) =20 +/* Abstractions to access atomically (i.e. "once") i64/u64 variables */ +#ifdef CONFIG_ATOMIC64 +static inline int64_t atomic_read_i64(const int64_t *ptr) +{ + /* use __nocheck because sizeof(void *) might be < sizeof(u64) */ + return atomic_read__nocheck(ptr); +} + +static inline uint64_t atomic_read_u64(const uint64_t *ptr) +{ + return atomic_read__nocheck(ptr); +} + +static inline void atomic_set_i64(int64_t *ptr, int64_t val) +{ + atomic_set__nocheck(ptr, val); +} + +static inline void atomic_set_u64(uint64_t *ptr, uint64_t val) +{ + atomic_set__nocheck(ptr, val); +} + +static inline void atomic64_init(void) +{ +} +#else /* !CONFIG_ATOMIC64 */ +int64_t atomic_read_i64(const int64_t *ptr); +uint64_t atomic_read_u64(const uint64_t *ptr); +void atomic_set_i64(int64_t *ptr, int64_t val); +void atomic_set_u64(uint64_t *ptr, uint64_t val); +void atomic64_init(void); +#endif /* !CONFIG_ATOMIC64 */ + #endif /* QEMU_ATOMIC_H */ diff --git a/util/atomic64.c b/util/atomic64.c new file mode 100644 index 0000000000..b198a6c9c8 --- /dev/null +++ b/util/atomic64.c @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2018, Emilio G. Cota + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "qemu/atomic.h" +#include "qemu/thread.h" + +#ifdef CONFIG_ATOMIC64 +#error This file must only be compiled if !CONFIG_ATOMIC64 +#endif + +/* + * When !CONFIG_ATOMIC64, we serialize both reads and writes with spinlock= s. + * We use an array of spinlocks, with padding computed at run-time based on + * the host's dcache line size. + * We point to the array with a void * to simplify the padding's computati= on. + * Each spinlock is located every lock_size bytes. + */ +static void *lock_array; +static size_t lock_size; + +/* + * Systems without CONFIG_ATOMIC64 are unlikely to have many cores, so we = use a + * small array of locks. + */ +#define NR_LOCKS 16 + +static QemuSpin *addr_to_lock(const void *addr) +{ + uintptr_t a =3D (uintptr_t)addr; + uintptr_t idx; + + idx =3D a >> qemu_dcache_linesize_log; + idx ^=3D (idx >> 8) ^ (idx >> 16); + idx &=3D NR_LOCKS - 1; + return lock_array + idx * lock_size; +} + +#define GEN_READ(name, type) \ + type name(const type *ptr) \ + { \ + QemuSpin *lock =3D addr_to_lock(ptr); \ + type ret; \ + \ + qemu_spin_lock(lock); \ + ret =3D *ptr; \ + qemu_spin_unlock(lock); \ + return ret; \ + } + +GEN_READ(atomic_read_i64, int64_t) +GEN_READ(atomic_read_u64, uint64_t) +#undef GEN_READ + +#define GEN_SET(name, type) \ + void name(type *ptr, type val) \ + { \ + QemuSpin *lock =3D addr_to_lock(ptr); \ + \ + qemu_spin_lock(lock); \ + *ptr =3D val; \ + qemu_spin_unlock(lock); \ + } + +GEN_SET(atomic_set_i64, int64_t) +GEN_SET(atomic_set_u64, uint64_t) +#undef GEN_SET + +void atomic64_init(void) +{ + int i; + + lock_size =3D ROUND_UP(sizeof(QemuSpin), qemu_dcache_linesize); + lock_array =3D qemu_memalign(qemu_dcache_linesize, lock_size * NR_LOCK= S); + for (i =3D 0; i < NR_LOCKS; i++) { + QemuSpin *lock =3D lock_array + i * lock_size; + + qemu_spin_init(lock); + } +} diff --git a/util/cacheinfo.c b/util/cacheinfo.c index 57c7d58159..6c6cbdb25d 100644 --- a/util/cacheinfo.c +++ b/util/cacheinfo.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include "qemu/host-utils.h" +#include "qemu/atomic.h" =20 int qemu_icache_linesize =3D 0; int qemu_icache_linesize_log; @@ -179,4 +180,6 @@ static void __attribute__((constructor)) init_cache_inf= o(void) qemu_icache_linesize_log =3D 31 - clz32(isize); qemu_dcache_linesize =3D dsize; qemu_dcache_linesize_log =3D 31 - clz32(dsize); + + atomic64_init(); } diff --git a/util/Makefile.objs b/util/Makefile.objs index 0e88899011..0820923c18 100644 --- a/util/Makefile.objs +++ b/util/Makefile.objs @@ -3,6 +3,7 @@ util-obj-y +=3D bufferiszero.o util-obj-y +=3D lockcnt.o util-obj-y +=3D aiocb.o async.o aio-wait.o thread-pool.o qemu-timer.o util-obj-y +=3D main-loop.o iohandler.o +util-obj-$(call lnot,$(CONFIG_ATOMIC64)) +=3D atomic64.o util-obj-$(CONFIG_POSIX) +=3D aio-posix.o util-obj-$(CONFIG_POSIX) +=3D compatfd.o util-obj-$(CONFIG_POSIX) +=3D event_notifier-posix.o --=20 2.17.1 From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536623121440405.6639961872048; Mon, 10 Sep 2018 16:45:21 -0700 (PDT) Received: from localhost ([::1]:54640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVrs-0004Fb-7S for importer@patchew.org; Mon, 10 Sep 2018 19:45:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjt-0003bp-7o for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbR-0005Io-W5 for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:25 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:39037) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbR-0005HY-MO for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:21 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id BBA7721E1C; Mon, 10 Sep 2018 19:28:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:20 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 57C60E4937; Mon, 10 Sep 2018 19:28:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=eDLkbIBb07flMi YHltLd7aPJ9J9hNogQKc+TRQIvSGM=; b=JCG7rHID+qtG3Gvf0NaOX/ZbCfYCcU qLx2D9AVbpK7DX2r+/GXd0pR02xJW1Y65yeobUZoC4lI3hpmla5AHNHrKUVS+Hu9 U+l3c0QCqkXHggN0bylSIpDc1XbVrgjzqnO8oxVU823Z36csTrlH96j9b9fZOJpX XfInMA6zx7PjM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=eDLkbIBb07flMiYHltLd7aPJ9J9hNogQKc+TRQIvSGM=; b=bTj5o133 1DBik46HAoZuvHNg3Ysn1ojp9FVQ+J1aQMBJetlDnQ+PaIAe0kr+PP+wDG2wnDXp 76UDA8NJd+4ZhEt+9P1Z2mkJQfzYulgsKP1e/1IanZLdh/oUSkPkKJYUsPtxxuMR B3qss7iW3Aihe6ZMWm6XoMIC+jrv+D5IfmruSxFIrj9eIQwLy8MS5iZLLjZvKlI3 Oe6/73vcVbb3rWZeROBVIg5clRueZNxU54wJE1kUqPiakbS8F3Ucb21P/TXBs67o Q8w34KeTpZ9G6SIAaoBD/DLXu70UK2gDGAUwb/Qi33G09cDjnz0gTH2Zdzpzeu5M /zTQxBHuRk7sEQ== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:43 -0400 Message-Id: <20180910232752.31565-4-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 03/12] tests: add atomic64-bench X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" - With CONFIG_ATOMIC64: $ tests/atomic64-bench -n 1 Throughput: 310.40 Mops/s - Without: $ tests/atomic64-bench -n 1 Throughput: 149.08 Mops/s Signed-off-by: Emilio G. Cota --- tests/atomic64-bench.c | 171 +++++++++++++++++++++++++++++++++++++++++ tests/Makefile.include | 3 +- 2 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 tests/atomic64-bench.c diff --git a/tests/atomic64-bench.c b/tests/atomic64-bench.c new file mode 100644 index 0000000000..71692560ed --- /dev/null +++ b/tests/atomic64-bench.c @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2018, Emilio G. Cota + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "qemu/thread.h" +#include "qemu/host-utils.h" +#include "qemu/processor.h" + +struct thread_info { + uint64_t r; + uint64_t accesses; +} QEMU_ALIGNED(64); + +struct count { + int64_t i64; +} QEMU_ALIGNED(64); + +static QemuThread *threads; +static struct thread_info *th_info; +static unsigned int n_threads =3D 1; +static unsigned int n_ready_threads; +static struct count *counts; +static unsigned int duration =3D 1; +static unsigned int range =3D 1024; +static bool test_start; +static bool test_stop; + +static const char commands_string[] =3D + " -d =3D duration in seconds\n" + " -n =3D number of threads\n" + " -r =3D range (will be rounded up to pow2)"; + +static void usage_complete(char *argv[]) +{ + fprintf(stderr, "Usage: %s [options]\n", argv[0]); + fprintf(stderr, "options:\n%s\n", commands_string); +} + +/* + * From: https://en.wikipedia.org/wiki/Xorshift + * This is faster than rand_r(), and gives us a wider range (RAND_MAX is o= nly + * guaranteed to be >=3D INT_MAX). + */ +static uint64_t xorshift64star(uint64_t x) +{ + x ^=3D x >> 12; /* a */ + x ^=3D x << 25; /* b */ + x ^=3D x >> 27; /* c */ + return x * UINT64_C(2685821657736338717); +} + +static void *thread_func(void *arg) +{ + struct thread_info *info =3D arg; + + atomic_inc(&n_ready_threads); + while (!atomic_read(&test_start)) { + cpu_relax(); + } + + while (!atomic_read(&test_stop)) { + unsigned int index; + + info->r =3D xorshift64star(info->r); + index =3D info->r & (range - 1); + atomic_read_i64(&counts[index].i64); + info->accesses++; + } + return NULL; +} + +static void run_test(void) +{ + unsigned int remaining; + unsigned int i; + + while (atomic_read(&n_ready_threads) !=3D n_threads) { + cpu_relax(); + } + atomic_set(&test_start, true); + do { + remaining =3D sleep(duration); + } while (remaining); + atomic_set(&test_stop, true); + + for (i =3D 0; i < n_threads; i++) { + qemu_thread_join(&threads[i]); + } +} + +static void create_threads(void) +{ + unsigned int i; + + threads =3D g_new(QemuThread, n_threads); + th_info =3D g_new(struct thread_info, n_threads); + counts =3D g_malloc0_n(range, sizeof(*counts)); + + for (i =3D 0; i < n_threads; i++) { + struct thread_info *info =3D &th_info[i]; + + info->r =3D (i + 1) ^ time(NULL); + info->accesses =3D 0; + qemu_thread_create(&threads[i], NULL, thread_func, info, + QEMU_THREAD_JOINABLE); + } +} + +static void pr_params(void) +{ + printf("Parameters:\n"); + printf(" # of threads: %u\n", n_threads); + printf(" duration: %u\n", duration); + printf(" ops' range: %u\n", range); +} + +static void pr_stats(void) +{ + unsigned long long val =3D 0; + double tx; + int i; + + for (i =3D 0; i < n_threads; i++) { + val +=3D th_info[i].accesses; + } + tx =3D val / duration / 1e6; + + printf("Results:\n"); + printf("Duration: %u s\n", duration); + printf(" Throughput: %.2f Mops/s\n", tx); + printf(" Throughput/thread: %.2f Mops/s/thread\n", tx / n_threads); +} + +static void parse_args(int argc, char *argv[]) +{ + int c; + + for (;;) { + c =3D getopt(argc, argv, "hd:n:r:"); + if (c < 0) { + break; + } + switch (c) { + case 'h': + usage_complete(argv); + exit(0); + case 'd': + duration =3D atoi(optarg); + break; + case 'n': + n_threads =3D atoi(optarg); + break; + case 'r': + range =3D pow2ceil(atoi(optarg)); + break; + } + } +} + +int main(int argc, char *argv[]) +{ + parse_args(argc, argv); + pr_params(); + create_threads(); + run_test(); + pr_stats(); + return 0; +} diff --git a/tests/Makefile.include b/tests/Makefile.include index 87c81d1dcc..b12b6a867a 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -601,7 +601,7 @@ test-obj-y =3D tests/check-qnum.o tests/check-qstring.o= tests/check-qdict.o \ tests/test-rcu-tailq.o \ tests/test-qdist.o tests/test-shift128.o \ tests/test-qht.o tests/qht-bench.o tests/test-qht-par.o \ - tests/atomic_add-bench.o + tests/atomic_add-bench.o tests/atomic64-bench.o =20 $(test-obj-y): QEMU_INCLUDES +=3D -Itests QEMU_CFLAGS +=3D -I$(SRC_PATH)/tests @@ -656,6 +656,7 @@ tests/test-qht-par$(EXESUF): tests/test-qht-par.o tests= /qht-bench$(EXESUF) $(tes tests/qht-bench$(EXESUF): tests/qht-bench.o $(test-util-obj-y) tests/test-bufferiszero$(EXESUF): tests/test-bufferiszero.o $(test-util-ob= j-y) tests/atomic_add-bench$(EXESUF): tests/atomic_add-bench.o $(test-util-obj-= y) +tests/atomic64-bench$(EXESUF): tests/atomic64-bench.o $(test-util-obj-y) =20 tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \ hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\ --=20 2.17.1 From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536623250738898.2523739377216; Mon, 10 Sep 2018 16:47:30 -0700 (PDT) Received: from localhost ([::1]:54659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVtx-0005r3-Nh for importer@patchew.org; Mon, 10 Sep 2018 19:47:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjm-0003X0-UC for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbS-0005Ix-0b for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:25 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:38513) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbR-0005Hp-PC for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:21 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 096A021DBB; Mon, 10 Sep 2018 19:28:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:21 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 96535E49D9; Mon, 10 Sep 2018 19:28:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=9Aw/BbIrwBwhyZ gpARUx7wuD1Okwr64mCWGenmkTTII=; b=v19Wu54s7bSkhg5DFK3Ul0+0Cigw3e q4iaHp5kpQmTT/jaI3oyGZvlv4dD3lsqzB0Zjj6AhLGuCJNxAJU3HsNuay5wqtKt 76szpeXOuKGLMReUzVc116nLNCv+eQVqzJUP1+k/0OJsvsZmBcqI5X4PIFPUCtQM 4GARrjyUEWdp0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=9Aw/BbIrwBwhyZgpARUx7wuD1Okwr64mCWGenmkTTII=; b=JkdmWh/B 2D1d7+wQokPWG5KuOEBQkFm+zdle0SYwVEmv+UYXS6ynhVcl1RlNelY6E7UN83fK Yn2dcgSip2dMXRA+muQwQN0IdfB3Mu4ZBubii7PCaWOJzN11schdNipi07ccLPE9 /C6lZxwI8uIB9pET9gVarQSZ2XJt+8gGbDKVEYqwwvbOvsj+0O7WK+diIazAMlep lG1bMRtxRloulAzJdPTX0rRHgMRe11GYqNMzjjHscl/rvHZ47aHX5CXb941kMr8c 6tasNFAYGAb8us32esfdBJkHQ1e/NYeAu8SXOsG2gPjMaMUTaTNDqWrjDTaVxEz7 dM98go8lXOX/mA== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:44 -0400 Message-Id: <20180910232752.31565-5-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 04/12] qsp: use atomic64 accessors X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With the seqlock, we either have to use atomics to remain within defined behaviour (and note that 64-bit atomics aren't always guaranteed to compile, irrespective of __nocheck), or drop the atomics and be in undefined behaviour territory. Fix it by dropping the seqlock and using atomic64 accessors. This will limit scalability when !CONFIG_ATOMIC64, but those machines (1) don't have many users and (2) are unlikely to have many cores. - With CONFIG_ATOMIC64: $ tests/atomic_add-bench -n 1 -m -p Throughput: 13.00 Mops/s - Forcing !CONFIG_ATOMIC64: $ tests/atomic_add-bench -n 1 -m -p Throughput: 10.89 Mops/s Signed-off-by: Emilio G. Cota --- util/qsp.c | 49 ++++++++----------------------------------------- 1 file changed, 8 insertions(+), 41 deletions(-) diff --git a/util/qsp.c b/util/qsp.c index b0c2575d10..c16af03f6a 100644 --- a/util/qsp.c +++ b/util/qsp.c @@ -84,13 +84,6 @@ struct QSPEntry { uint64_t n_acqs; uint64_t ns; unsigned int n_objs; /* count of coalesced objs; only used for reporti= ng */ -#ifndef CONFIG_ATOMIC64 - /* - * If we cannot update the counts atomically, then use a seqlock. - * We don't need an associated lock because the updates are thread-loc= al. - */ - QemuSeqLock sequence; -#endif }; typedef struct QSPEntry QSPEntry; =20 @@ -344,47 +337,16 @@ static QSPEntry *qsp_entry_get(const void *obj, const= char *file, int line, return qsp_entry_find(&qsp_ht, &orig, hash); } =20 -/* - * @from is in the global hash table; read it atomically if the host - * supports it, otherwise use the seqlock. - */ -static void qsp_entry_aggregate(QSPEntry *to, const QSPEntry *from) -{ -#ifdef CONFIG_ATOMIC64 - to->ns +=3D atomic_read__nocheck(&from->ns); - to->n_acqs +=3D atomic_read__nocheck(&from->n_acqs); -#else - unsigned int version; - uint64_t ns, n_acqs; - - do { - version =3D seqlock_read_begin(&from->sequence); - ns =3D atomic_read__nocheck(&from->ns); - n_acqs =3D atomic_read__nocheck(&from->n_acqs); - } while (seqlock_read_retry(&from->sequence, version)); - - to->ns +=3D ns; - to->n_acqs +=3D n_acqs; -#endif -} - /* * @e is in the global hash table; it is only written to by the current th= read, * so we write to it atomically (as in "write once") to prevent torn reads. - * If the host doesn't support u64 atomics, use the seqlock. */ static inline void do_qsp_entry_record(QSPEntry *e, int64_t delta, bool ac= q) { -#ifndef CONFIG_ATOMIC64 - seqlock_write_begin(&e->sequence); -#endif - atomic_set__nocheck(&e->ns, e->ns + delta); + atomic_set_u64(&e->ns, e->ns + delta); if (acq) { - atomic_set__nocheck(&e->n_acqs, e->n_acqs + 1); + atomic_set_u64(&e->n_acqs, e->n_acqs + 1); } -#ifndef CONFIG_ATOMIC64 - seqlock_write_end(&e->sequence); -#endif } =20 static inline void qsp_entry_record(QSPEntry *e, int64_t delta) @@ -550,7 +512,12 @@ static void qsp_aggregate(struct qht *global_ht, void = *p, uint32_t h, void *up) =20 hash =3D qsp_entry_no_thread_hash(e); agg =3D qsp_entry_find(ht, e, hash); - qsp_entry_aggregate(agg, e); + /* + * The entry is in the global hash table; read from it atomically (as = in + * "read once"). + */ + agg->ns +=3D atomic_read_u64(&e->ns); + agg->n_acqs +=3D atomic_read_u64(&e->n_acqs); } =20 static void qsp_iter_diff(struct qht *orig, void *p, uint32_t hash, void *= htp) --=20 2.17.1 From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536622777883710.207169979104; Mon, 10 Sep 2018 16:39:37 -0700 (PDT) Received: from localhost ([::1]:54608 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVmG-0006de-Ea for importer@patchew.org; Mon, 10 Sep 2018 19:39:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjo-0003al-CO for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbU-0005Kq-Ba for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:25 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:46757) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbU-0005IS-2A for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:24 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 38CCA20A9B; Mon, 10 Sep 2018 19:28:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:21 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id CC9DEE4682; Mon, 10 Sep 2018 19:28:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=ht1DynTiGJEqXT 3NJNAVt6hC3bhQSX4QQQ38HKT+Q4k=; b=D+WEukNi79R9ggbz9zSmX3+uQ5k7La p6GzR2LCy0MxXUiqeS2Tw04RFCSx7/uw9brzkKb1gwTX0frvUGcCn82dcYv8JnLO 7wn6bhLiMPv0Iu4Ud82/HR+Ef9siQQf+wFSgyYp8+/ub3jNBvxbofEN8vzNEVp07 SH+MH9uFay3kU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=ht1DynTiGJEqXT3NJNAVt6hC3bhQSX4QQQ38HKT+Q4k=; b=ARv1nB6/ 4TzHl1O3L8b9Bgrr7S3w1nqNDl6N7Z730NJmEj2rh4+gqrN8Yj7eUj/VQ1J91zmj G281wce92XJxeR037zrgND/OvFZ2kzl5ZpoGpUXAgzqknE37WMfdSpVPXvArL/Xw srm6GEaZJHfbZUzi7DQjWCj+tEalhmkGrM4XjqW+AwAge+IcHBu7n8Bjts69Gwsc C8A9+L4A8ryqeL3YLFIbwzKqOledRVPZ/y9yyjMpkAACEKWq9dghgDcreFf80Sck ImqEpwA+Rg2ItFn9VGtuuY2aN7p22gL1x6aqYKwU2AcjJaDElzXxjP9W8oV7LrM/ ptXRkF4Ltqnirg== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:45 -0400 Message-Id: <20180910232752.31565-6-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 05/12] test-rcu-list: access n_reclaims and n_nodes_removed with atomic64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" To avoid undefined behaviour. Note that these "atomics" are atomic in the "access once" sense. The variables are updated by a single thread at a time, so no "full" atomics are necessary. Signed-off-by: Emilio G. Cota --- tests/test-rcu-list.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c index 192bfbf02e..2e6f70bd59 100644 --- a/tests/test-rcu-list.c +++ b/tests/test-rcu-list.c @@ -33,8 +33,8 @@ static QemuMutex counts_mutex; static long long n_reads =3D 0LL; static long long n_updates =3D 0LL; -static long long n_reclaims =3D 0LL; -static long long n_nodes_removed =3D 0LL; +static int64_t n_reclaims; +static int64_t n_nodes_removed; static long long n_nodes =3D 0LL; static int g_test_in_charge =3D 0; =20 @@ -104,7 +104,7 @@ static void reclaim_list_el(struct rcu_head *prcu) struct list_element *el =3D container_of(prcu, struct list_element, rc= u); g_free(el); /* Accessed only from call_rcu thread. */ - n_reclaims++; + atomic_set_i64(&n_reclaims, n_reclaims + 1); } =20 #if TEST_LIST_TYPE =3D=3D 1 @@ -232,7 +232,7 @@ static void *rcu_q_updater(void *arg) qemu_mutex_lock(&counts_mutex); n_nodes +=3D n_nodes_local; n_updates +=3D n_updates_local; - n_nodes_removed +=3D n_removed_local; + atomic_set_i64(&n_nodes_removed, n_nodes_removed + n_removed_local); qemu_mutex_unlock(&counts_mutex); return NULL; } @@ -286,19 +286,21 @@ static void rcu_qtest(const char *test, int duration,= int nreaders) n_removed_local++; } qemu_mutex_lock(&counts_mutex); - n_nodes_removed +=3D n_removed_local; + atomic_set_i64(&n_nodes_removed, n_nodes_removed + n_removed_local); qemu_mutex_unlock(&counts_mutex); synchronize_rcu(); - while (n_nodes_removed > n_reclaims) { + while (atomic_read_i64(&n_nodes_removed) > atomic_read_i64(&n_reclaims= )) { g_usleep(100); synchronize_rcu(); } if (g_test_in_charge) { - g_assert_cmpint(n_nodes_removed, =3D=3D, n_reclaims); + g_assert_cmpint(atomic_read_i64(&n_nodes_removed), =3D=3D, + atomic_read_i64(&n_reclaims)); } else { printf("%s: %d readers; 1 updater; nodes read: " \ - "%lld, nodes removed: %lld; nodes reclaimed: %lld\n", - test, nthreadsrunning - 1, n_reads, n_nodes_removed, n_recl= aims); + "%lld, nodes removed: %"PRIi64"; nodes reclaimed: %"PRIi64"= \n", + test, nthreadsrunning - 1, n_reads, + atomic_read_i64(&n_nodes_removed), atomic_read_i64(&n_recla= ims)); exit(0); } } --=20 2.17.1 From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536623112966321.94735261649305; Mon, 10 Sep 2018 16:45:12 -0700 (PDT) Received: from localhost ([::1]:54638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVrf-00045N-HM for importer@patchew.org; Mon, 10 Sep 2018 19:45:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjm-0003QR-UP for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbU-0005Ka-0v for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:25 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:47235) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbT-0005IR-SM for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:23 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6BA6421B2D; Mon, 10 Sep 2018 19:28:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:21 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 0F059E4118; Mon, 10 Sep 2018 19:28:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=ghoLPFN5mamDWhrnCBrHXi+6Oa EYkHbOI+k01WDRZBE=; b=Jp7/CDvoqi1GI0iY6i9R8sHbBcP+B3025cqWnoZXYs 4s2vlgo8CoKeOorXMWGSBOIo3OYC6PNUt7dWbmFyF473Z4Jj+DjlWlyc90QOgC8g IYoEYWZY+LbB25KTw9FWVLDvaxwvyzkGzKEgg6HTPqbIsedVY92lQ63MrZJzcWtN 8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=ghoLPF N5mamDWhrnCBrHXi+6OaEYkHbOI+k01WDRZBE=; b=b/LzZ7ytG2KiZg6cddcMyp gEj7GRSMsjKoy5KDlQ4GiGHSXwFAqI/KQLG8kAWlhncZ2RBBPX4UjtTybRanKAAt sJjNR9WHR5pqjofgJg02l9ATq6jbz2LkwwkdRfELFvgvHOnYhOufhU1qH7ZS8aS5 LBqYMRjBydA0eJWMvWWMFBR+piG1ffRFN23wFaGalsu7z9OYxZ8fLqNXLz2rdOJS s+dexec4AVYfC/ybiepKCPS0XBGbxjez5GsIbXwpG4yUMRMv2G/GA8v2JByu5RqC dzNdIXeUJE/M9z86KFvL9pjhG30NfqUgwKDa/6UwM2DG9k2vs2pdut2cWHW/JQkA == X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:46 -0400 Message-Id: <20180910232752.31565-7-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 06/12] atomic: fix comment s/x64_64/x86_64/ X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson --- include/qemu/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index c34c2f78c4..f6993a8fb1 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -98,7 +98,7 @@ * We'd prefer not want to pull in everything else TCG related, so handle * those few cases by hand. * - * Note that x32 is fully detected with __x64_64__ + _ILP32, and that for + * Note that x32 is fully detected with __x86_64__ + _ILP32, and that for * Sparc we always force the use of sparcv9 in configure. */ #if defined(__x86_64__) || defined(__sparc__) --=20 2.17.1 From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536622776556357.57353262735376; Mon, 10 Sep 2018 16:39:36 -0700 (PDT) Received: from localhost ([::1]:54609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVmJ-0006h7-FE for importer@patchew.org; Mon, 10 Sep 2018 19:39:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjm-0003ak-Q2 for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbe-0005Sw-9P for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:38 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:44251) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbe-0005Ic-1o for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:34 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A511221E44; Mon, 10 Sep 2018 19:28:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:21 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 460FBE48AA; Mon, 10 Sep 2018 19:28:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=fEyUDatrEhVJoOHr+dkUvzZdYd KBiFInLL+tLj1LV3E=; b=TZgFMboE3eUtnZu8MowN1IMMz+PPNXm22neaCx30l9 d/bSzIGXI40ZK9uf7aFaOPRMi3PZTR7PdA4SVVjlNcXZxcYkCYIFnnmsHPRtd/Jy LIT1xUeeVY+vajzy/9f5XHY0O2+njsvCI8cgzx9p76uRlkKFx2HRVHt2JzF7UFRq c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=fEyUDa trEhVJoOHr+dkUvzZdYdKBiFInLL+tLj1LV3E=; b=S6+iJmBi6QhGBc03+U2BDX MnPwAaqDe9WXS7S6HC6NWZUBkYOV0z+5kxBBCWZPZA98N1YOFuqOPnPvSqtwoJMl VSNI9K/n2JOZME2IHbdGhRJoFCYyboH7f8/CXoSOPNT1tShwbvTyUOQIEBtYLRm8 xZ+BANM4QqM+lL1CQM5nd68XHHxNOMPrZ7PtTlw31M3I+DLKNuzt00GAuNTXKKCP JtUdsYYNZnpbWY0yCLS/Etyx8LHV3BDZQDbP2M9eK2gDpAXrfMEfMCLHlCFkBQ2B jr9R/cc0leGneHObFFlxiB34GDaTdmnz4rWEkvjQTC5dYoT7nzmGwXZ9Sr4CWq3w == X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:47 -0400 Message-Id: <20180910232752.31565-8-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 07/12] cpus: initialize timers_state.vm_clock_lock X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 We forgot to initialize the spinlock introduced in 94377115b2 ("cpus: protect TimerState writes with a spinlock", 2018-08-23). Fix it. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson --- cpus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cpus.c b/cpus.c index 8ee6e5db93..ebc13bac2d 100644 --- a/cpus.c +++ b/cpus.c @@ -823,6 +823,7 @@ int cpu_throttle_get_percentage(void) void cpu_ticks_init(void) { seqlock_init(&timers_state.vm_clock_seqlock); + qemu_spin_init(&timers_state.vm_clock_lock); vmstate_register(NULL, 0, &vmstate_timers, &timers_state); throttle_timer =3D timer_new_ns(QEMU_CLOCK_VIRTUAL_RT, cpu_throttle_timer_tick, NULL); --=20 2.17.1 From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536623258549676.2712466302481; Mon, 10 Sep 2018 16:47:38 -0700 (PDT) Received: from localhost ([::1]:54660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVu5-0005v6-KP for importer@patchew.org; Mon, 10 Sep 2018 19:47:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjt-0003am-Pj for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbU-0005LG-Gs for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:25 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:59691) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbU-0005Jn-91 for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:24 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E211F21E49; Mon, 10 Sep 2018 19:28:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:21 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 7D2DBE4682; Mon, 10 Sep 2018 19:28:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=/ffp4ZiuCckRU8 SRg875QwzsMYOQUPGyuDA5r4Cx8ik=; b=EP3dNsSCj98PyvglUKF8xw6RwuE+eS 6W6DdLd5JJz0hqFhepvsoJqfA8x5FyK+snfXrH71MYjS8ELYZDdgD4U9MOyqO84I TC+TFbSsfBaYOotcP2UWbeznoQS18hkvNWtdrduc99o0C9+8aiV5bxrQ5Rev7EMR Xrq3yfbUwPmDk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=/ffp4ZiuCckRU8SRg875QwzsMYOQUPGyuDA5r4Cx8ik=; b=ZtC4nke+ EXmP43KW4t+Qe0ezeqxbVpmBdJLynwiy6XXqLaDpcuv0pGfMJ7UoEzy6s5frc0J2 El2ernNI6Pn5T8ESsu3POsfOrUWhFSO84CPFiGGdHOR3BjXeqc9rw8kfz7MX79xC +sIhGEdDzQ0IuMtrricbDTxcukA0SogmQQuSvAc1UqqrnJoye7UH+yRAkNKrUrjM aijC0JED5WS8K7ST7fGBVLfeSKZqej3GeVF6hr7GS0v88kNt9Lsjg5jC1EtE81kU whui0lVeyVXZ5btWuK/cEWd8k6ZHS+FM5has/DLzg22ZXb3GBrLT9H9ylfIMsMPc ic02jHKHca7qWA== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:48 -0400 Message-Id: <20180910232752.31565-9-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 08/12] cpus: always call seqlock_write in cpu_update_icount X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Emilio G. Cota Tested-by: Emilio G. Cota --- cpus.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cpus.c b/cpus.c index ebc13bac2d..38dabb138d 100644 --- a/cpus.c +++ b/cpus.c @@ -250,16 +250,12 @@ void cpu_update_icount(CPUState *cpu) int64_t executed =3D cpu_get_icount_executed(cpu); cpu->icount_budget -=3D executed; =20 -#ifndef CONFIG_ATOMIC64 seqlock_write_lock(&timers_state.vm_clock_seqlock, &timers_state.vm_clock_lock); -#endif atomic_set__nocheck(&timers_state.qemu_icount, timers_state.qemu_icount + executed); -#ifndef CONFIG_ATOMIC64 seqlock_write_unlock(&timers_state.vm_clock_seqlock, &timers_state.vm_clock_lock); -#endif } =20 static int64_t cpu_get_icount_raw_locked(void) --=20 2.17.1 From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536622772955560.9546535035101; Mon, 10 Sep 2018 16:39:32 -0700 (PDT) Received: from localhost ([::1]:54607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVmC-0006a8-AI for importer@patchew.org; Mon, 10 Sep 2018 19:39:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjm-0003UC-RU for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbU-0005LM-Hw for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:26 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:60641) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbU-0005Jm-Ap for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:24 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0986F21F24; Mon, 10 Sep 2018 19:28:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:22 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id B388AE4118; Mon, 10 Sep 2018 19:28:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=9xzDGhQBfkMKzb 8d1gDRfx3VsuHO5J5jltQ782rTgbk=; b=Pwyf5NCsc3iTw8oGTbbJ4D22kGTgwE I3Y+3vzoXQ7DtQW/fpOinxteNBbYAketpAvu1HNEYSZZyqA1//iu+WeiUvw4+lIn NpuKVGrZzjZf0Idc9T2oOEo/rNyXD+m49+ZiG0b/ZafUMjhLJmhwDW2nnw+cYXPu G5iKG6ZwVoo+k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=9xzDGhQBfkMKzb8d1gDRfx3VsuHO5J5jltQ782rTgbk=; b=vaM6ieRd FvfGSRUEfAmTTYRfRELgg+86WpHvvjK+bhy4J3Wl/2C7LXjruwa6YIKTtaiEL6cC WYmUXMyqYKwbbLXsBPbOKQYq8dYmg6sViRtu3p4QOf0dnOsZjlJqFghDDjEZB+U7 gNUNW3ziL2rKc5rsci1ttA5A+KgtgzdvCwu8N3N1vtQXKp/fJYICMoCdXa9Rn41A mBUXNaGaVuixaQJk7w30ljbQgfL8cfFPzF365JlZnl+QGkWL2VWv/GC7C1aqqlbu Qeovv16DlDVoCzvcMjs4SxGtpBnhvQQJJg2Po0VDO4qKRz3YtjjCiT0qoEXhwcba kc7RwkFCaJGF9w== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:49 -0400 Message-Id: <20180910232752.31565-10-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 09/12] cpus: access .qemu_icount with atomic64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Emilio G. Cota --- cpus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpus.c b/cpus.c index 38dabb138d..f045416c94 100644 --- a/cpus.c +++ b/cpus.c @@ -252,8 +252,8 @@ void cpu_update_icount(CPUState *cpu) =20 seqlock_write_lock(&timers_state.vm_clock_seqlock, &timers_state.vm_clock_lock); - atomic_set__nocheck(&timers_state.qemu_icount, - timers_state.qemu_icount + executed); + atomic_set_i64(&timers_state.qemu_icount, + timers_state.qemu_icount + executed); seqlock_write_unlock(&timers_state.vm_clock_seqlock, &timers_state.vm_clock_lock); } @@ -270,8 +270,8 @@ static int64_t cpu_get_icount_raw_locked(void) /* Take into account what has run */ cpu_update_icount(cpu); } - /* The read is protected by the seqlock, so __nocheck is okay. */ - return atomic_read__nocheck(&timers_state.qemu_icount); + /* The read is protected by the seqlock, but needs atomic64 to avoid U= B */ + return atomic_read_i64(&timers_state.qemu_icount); } =20 static int64_t cpu_get_icount_locked(void) --=20 2.17.1 From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536623349553190.67636957758725; Mon, 10 Sep 2018 16:49:09 -0700 (PDT) Received: from localhost ([::1]:54667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVvY-0007Mm-Kk for importer@patchew.org; Mon, 10 Sep 2018 19:49:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjm-0003bp-Oc for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbe-0005Sq-8q for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:38 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:48465) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbe-0005Jv-1I for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:34 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D386421F37; Mon, 10 Sep 2018 19:28:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:22 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id EE15DE4621; Mon, 10 Sep 2018 19:28:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=p5ImRu4okqRx89 RVSW6rKLPHS/Gf9BufuM/yut5YFVQ=; b=sdsa7GfGS5gm1QUht9PUrUlkWzxIB2 5nTcyVXqmqQ6gUpi/+ViEhwXfLQSEIjTng8pq8zPiDs7ToJfQWm8IzPXVPkLI62y yCPt+saYFSebWK4a8d67J493IwdOwEnCqpExTTF71lopr2GeajW6CAle66yHBnIX 01ZxRGH7lNnY0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=p5ImRu4okqRx89RVSW6rKLPHS/Gf9BufuM/yut5YFVQ=; b=iaDjQJcr ZZvLMiJAtmCfXpoFYJ4Snu+UKDysAORzb9NARDRSITzDKiUoao6brKR1tykWWD/5 9mb2IIbB28jv2aBaHHve+j+AndTIWTJ3d8HsdOJodca1VnnD/tgzUfSWOrL6o99j rVYZ/Q5oXjyrQKU5cNxl4kLW95Ve3gj8QASOH7nc58we1jB8zl2HjApCY27OOkGw Bh0Adl3DtdwHgt6ORCbatPiIghQrOyC7ulq8n10C/Urt4u3UgQj2dXNSWyNiJ0zc b/bhCy42F4ws0qvxoL4kfNQN3w/e2ePLBHBA/4Ju6poGhAtLhA8F9WFNNVFnjFia YVXLa+uxawOdQw== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:50 -0400 Message-Id: <20180910232752.31565-11-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 10/12] cpus: access .qemu_icount_bias with atomic64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Emilio G. Cota --- cpus.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/cpus.c b/cpus.c index f045416c94..5a16a0186c 100644 --- a/cpus.c +++ b/cpus.c @@ -277,7 +277,8 @@ static int64_t cpu_get_icount_raw_locked(void) static int64_t cpu_get_icount_locked(void) { int64_t icount =3D cpu_get_icount_raw_locked(); - return atomic_read__nocheck(&timers_state.qemu_icount_bias) + cpu_icou= nt_to_ns(icount); + return atomic_read_i64(&timers_state.qemu_icount_bias) + + cpu_icount_to_ns(icount); } =20 int64_t cpu_get_icount_raw(void) @@ -450,9 +451,9 @@ static void icount_adjust(void) timers_state.icount_time_shift + 1); } last_delta =3D delta; - atomic_set__nocheck(&timers_state.qemu_icount_bias, - cur_icount - (timers_state.qemu_icount - << timers_state.icount_time_shift)); + atomic_set_i64(&timers_state.qemu_icount_bias, + cur_icount - (timers_state.qemu_icount + << timers_state.icount_time_shift)); seqlock_write_unlock(&timers_state.vm_clock_seqlock, &timers_state.vm_clock_lock); } @@ -512,8 +513,8 @@ static void icount_warp_rt(void) int64_t delta =3D clock - cur_icount; warp_delta =3D MIN(warp_delta, delta); } - atomic_set__nocheck(&timers_state.qemu_icount_bias, - timers_state.qemu_icount_bias + warp_delta); + atomic_set_i64(&timers_state.qemu_icount_bias, + timers_state.qemu_icount_bias + warp_delta); } timers_state.vm_clock_warp_start =3D -1; seqlock_write_unlock(&timers_state.vm_clock_seqlock, @@ -544,8 +545,8 @@ void qtest_clock_warp(int64_t dest) =20 seqlock_write_lock(&timers_state.vm_clock_seqlock, &timers_state.vm_clock_lock); - atomic_set__nocheck(&timers_state.qemu_icount_bias, - timers_state.qemu_icount_bias + warp); + atomic_set_i64(&timers_state.qemu_icount_bias, + timers_state.qemu_icount_bias + warp); seqlock_write_unlock(&timers_state.vm_clock_seqlock, &timers_state.vm_clock_lock); =20 @@ -616,8 +617,8 @@ void qemu_start_warp_timer(void) */ seqlock_write_lock(&timers_state.vm_clock_seqlock, &timers_state.vm_clock_lock); - atomic_set__nocheck(&timers_state.qemu_icount_bias, - timers_state.qemu_icount_bias + deadline); + atomic_set_i64(&timers_state.qemu_icount_bias, + timers_state.qemu_icount_bias + deadline); seqlock_write_unlock(&timers_state.vm_clock_seqlock, &timers_state.vm_clock_lock); qemu_clock_notify(QEMU_CLOCK_VIRTUAL); --=20 2.17.1 From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536622777887156.96152899771653; Mon, 10 Sep 2018 16:39:37 -0700 (PDT) Received: from localhost ([::1]:54606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVmA-0006YS-Dj for importer@patchew.org; Mon, 10 Sep 2018 19:39:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjm-0003Ws-TQ for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbU-0005Lb-LD for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:26 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:33061) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbU-0005Jo-G7 for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:24 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D389321F38; Mon, 10 Sep 2018 19:28:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:22 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 347DCE4508; Mon, 10 Sep 2018 19:28:22 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=bny7lcQQ0nw+vkJvSFTBDMGo8M PNtk2zAFfP5UPFBWM=; b=qe+ktvDzzVOD9uObjw2jmQ7kbqdMO+pSNgl89cyBDr G3XGvMcAVWlXcIuZb34yyLMpmbAD9QgEIiKT4cH3WZCVfa8yEUhqhxe0zwO4vIAM EXWP/N4s7z3Q0PyhB9lbyTe8vSfC/J3JajPgNayOfWJsGC1IyWZ+o6f8/RUSskvB E= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=bny7lc QQ0nw+vkJvSFTBDMGo8MPNtk2zAFfP5UPFBWM=; b=jgezP6FbFUH9jepj9M0e1L BRjZGvWhaC1x9z90/GGrBjsPxRFDMSToW8jpgJVY98KByCmzn8Drj0wMRfr58YR/ 6yePVyLoGJJGzItjgWmEa5Nn47ek7OCmNfBBe5Xz4hSSluo+R3NATNcQRBcnbnBT ftr7hPHkeZvqV38D4muAX0p3riAEfD30jA17YL8Q3+EzmaXmwztOdudKpBT0l3bj OH5qbHIecrJQVI3p1B+YdO5BeIqj3SXl/8usv1jAFQIkQgg/BxmRTw69yjfHdz/v KV9ys3C9LCh6TdhLsbTOlEUd2qH3m7W94m9a3g2Tgt0tyvwCxmPom1aTGQ/fJilg == X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:51 -0400 Message-Id: <20180910232752.31565-12-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 11/12] target/i386/translate: use thread-local storage in !user-mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Needed for MTTCG. Note that in user-mode, code generation is serialized by mmap_lock, so making these variables per-thread would just waste TLS space. Acked-by: Alex Benn=C3=A9e Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson --- target/i386/translate.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 1f9d1d9b24..9a6a72e205 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -71,26 +71,34 @@ =20 //#define MACRO_TEST 1 =20 +/* we need thread-local storage for mttcg */ +#ifdef CONFIG_USER_ONLY +#define I386_THREAD +#else +#define I386_THREAD __thread +#endif + /* global register indexes */ -static TCGv cpu_A0; -static TCGv cpu_cc_dst, cpu_cc_src, cpu_cc_src2, cpu_cc_srcT; +static TCGv cpu_cc_dst, cpu_cc_src, cpu_cc_src2; static TCGv_i32 cpu_cc_op; static TCGv cpu_regs[CPU_NB_REGS]; static TCGv cpu_seg_base[6]; static TCGv_i64 cpu_bndl[4]; static TCGv_i64 cpu_bndu[4]; /* local temps */ -static TCGv cpu_T0, cpu_T1; +static I386_THREAD TCGv cpu_cc_srcT; +static I386_THREAD TCGv cpu_A0; +static I386_THREAD TCGv cpu_T0, cpu_T1; /* local register indexes (only used inside old micro ops) */ -static TCGv cpu_tmp0, cpu_tmp4; -static TCGv_ptr cpu_ptr0, cpu_ptr1; -static TCGv_i32 cpu_tmp2_i32, cpu_tmp3_i32; -static TCGv_i64 cpu_tmp1_i64; +static I386_THREAD TCGv cpu_tmp0, cpu_tmp4; +static I386_THREAD TCGv_ptr cpu_ptr0, cpu_ptr1; +static I386_THREAD TCGv_i32 cpu_tmp2_i32, cpu_tmp3_i32; +static I386_THREAD TCGv_i64 cpu_tmp1_i64; =20 #include "exec/gen-icount.h" =20 #ifdef TARGET_X86_64 -static int x86_64_hregs; +static I386_THREAD int x86_64_hregs; #endif =20 typedef struct DisasContext { --=20 2.17.1 From nobody Wed Nov 5 18:24:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536622931318910.5787246783404; Mon, 10 Sep 2018 16:42:11 -0700 (PDT) Received: from localhost ([::1]:54626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVoo-0000FY-9l for importer@patchew.org; Mon, 10 Sep 2018 19:42:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzVjn-0003bg-0F for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:37:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzVbU-0005L2-CU for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:25 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42499) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fzVbU-0005Jx-56 for qemu-devel@nongnu.org; Mon, 10 Sep 2018 19:28:24 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D38E121F39; Mon, 10 Sep 2018 19:28:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 10 Sep 2018 19:28:22 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 6B736E48AA; Mon, 10 Sep 2018 19:28:22 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=05QLv0+1v3HcYd KuYIsoVNAKcu1bGK6qb7NhY0wagqA=; b=yrVGx0gHrpz5WLjV5DWaHpv1ttIhDq Kyu96tQ9tg6vYdndvSF1/LQI6J+2r/9ohsQ9pv0za/Ttwio6so7uNDagerQi56kI S//+ZYnaQrjYeboITHcKlN7Lmm250r5eVhzp/1ODIwAFO80g7q02tGZ7QR+S+XPf vs5bfGBx9k/Q0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=05QLv0+1v3HcYdKuYIsoVNAKcu1bGK6qb7NhY0wagqA=; b=u0/ikAI3 L605vlRyhD7CZ7NkbZ9hYPbLVosI0x3O60T6XCyJvvHX+qZ/Tg6lcqklGXjZlcyz JVN/RWjywqWHAe+NoG9+GJBpjlvG0BnpJnYL93hH+Hrw5yJrIwaVDlis1YP/ZXtO IVFs3zqklDg+ZjeeCFx1kp7mlbPL5G3iQBhJ0hsbBlXFUQpAaF34Q/bj+Tie3tl+ 20/iz4xQoQ+vm1hszY4zC9QxvtUqZnFMoDYpY7DkK/skrlKl2jQhRRNta15c7kyT 0hH9jcxZBJPvuyRiIvgAmAVjPkHXy2ZlbJ3NOzdfqVXxXuzk/1axQchbbCqNbs89 iH0abKlDgfGaoQ== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 10 Sep 2018 19:27:52 -0400 Message-Id: <20180910232752.31565-13-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910232752.31565-1-cota@braap.org> References: <20180910232752.31565-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 12/12] configure: enable mttcg for i386 and x86_64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Peter Crosthwaite , Murilo Opsfelder Araujo , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 58862d2ae8..f715252c9f 100755 --- a/configure +++ b/configure @@ -7025,12 +7025,14 @@ TARGET_ABI_DIR=3D"" =20 case "$target_name" in i386) + mttcg=3D"yes" gdb_xml_files=3D"i386-32bit.xml i386-32bit-core.xml i386-32bit-sse.xml" target_compiler=3D$cross_cc_i386 target_compiler_cflags=3D$cross_cc_ccflags_i386 ;; x86_64) TARGET_BASE_ARCH=3Di386 + mttcg=3D"yes" gdb_xml_files=3D"i386-64bit.xml i386-64bit-core.xml i386-64bit-sse.xml" target_compiler=3D$cross_cc_x86_64 ;; --=20 2.17.1