From nobody Tue Feb 10 06:07:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1651613606; cv=none; d=zohomail.com; s=zohoarc; b=ZFZKEZjPgySDNDHMPAHn9r/4uQjjXi6OAST+HeI4rM3VpCKeLrGgHd/pSv7ruj/6cLiLTkTiC64hl84yRIxRecqw2IZyEO/FqqaOEdP4kAYGbiiS94VYFpGEsd3qs0iRjvOtd9FmeosBHkQFPoWVxXDTa9Fnw5NpKOplyMfqw60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651613606; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fuga4LugH825TIlXqNJy7BbClfzwgBYhIYx2V+44kGA=; b=AD8Qu4G9RrWMuRtcOoPS2kC3UbkVgs2ICkrgXBDaAR1EB7/7d+cidMtwmuy3B8RoWgzvbkfEHfwXQ0uyZTfZR+i7WvStsIW8Z6kdfwIzIiNBXxNpVj9te8CG5WcZGS57slUY2oRhT6/+/s8lwt+qkiVD12xNNQQhxA+/tJgizto= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1651613606403899.0828625499076; Tue, 3 May 2022 14:33:26 -0700 (PDT) Received: from localhost ([::1]:55982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nm096-0001Vc-Rg for importer@patchew.org; Tue, 03 May 2022 17:33:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlyyT-0006rG-LQ for qemu-devel@nongnu.org; Tue, 03 May 2022 16:18:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:37414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlyyR-0003hp-GW for qemu-devel@nongnu.org; Tue, 03 May 2022 16:18:20 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-547-bHfKp7GzPGOBCr1DKKkDKw-1; Tue, 03 May 2022 10:50:06 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D59C61CE6082; Tue, 3 May 2022 13:13:07 +0000 (UTC) Received: from localhost (unknown [10.39.208.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 869BD7774; Tue, 3 May 2022 13:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651609098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fuga4LugH825TIlXqNJy7BbClfzwgBYhIYx2V+44kGA=; b=KjrKUIbQ1CaV0vsDkzAvObByN+FP269ppr13ZdQtikPegt/ODbngHzKjBq8xBlgzyy2C70 Lg7iF3jiyL9/juFdwaA7jJ+E0nVAtnBpPrbA6uZgF+mmfclcKujMpUYo2xf0RsDStMboJE 0Z2ww55b9gkzoRdW/0LCTbwPkYWz4UM= X-MC-Unique: bHfKp7GzPGOBCr1DKKkDKw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Peter Maydell , Richard Henderson , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 01/23] Use QEMU_SANITIZE_THREAD Date: Tue, 3 May 2022 17:12:34 +0400 Message-Id: <20220503131256.187238-2-marcandre.lureau@redhat.com> In-Reply-To: <20220503131256.187238-1-marcandre.lureau@redhat.com> References: <20220503131256.187238-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1651613608388100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Richard Henderson --- include/qemu/atomic.h | 8 +++++--- subprojects/libvhost-user/include/compiler.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) create mode 120000 subprojects/libvhost-user/include/compiler.h diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 112a29910bea..7e8fc8e7cde2 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -15,6 +15,8 @@ #ifndef QEMU_ATOMIC_H #define QEMU_ATOMIC_H =20 +#include "compiler.h" + /* Compiler barrier */ #define barrier() ({ asm volatile("" ::: "memory"); (void)0; }) =20 @@ -81,7 +83,7 @@ * no processors except Alpha need a barrier here. Leave it in if * using Thread Sanitizer to avoid warnings, otherwise optimize it away. */ -#if defined(__SANITIZE_THREAD__) +#ifdef QEMU_SANITIZE_THREAD #define smp_read_barrier_depends() ({ barrier(); __atomic_thread_fence(_= _ATOMIC_CONSUME); }) #elif defined(__alpha__) #define smp_read_barrier_depends() asm volatile("mb":::"memory") @@ -146,7 +148,7 @@ /* See above: most compilers currently treat consume and acquire the * same, but this slows down qatomic_rcu_read unnecessarily. */ -#ifdef __SANITIZE_THREAD__ +#ifdef QEMU_SANITIZE_THREAD #define qatomic_rcu_read__nocheck(ptr, valptr) \ __atomic_load(ptr, valptr, __ATOMIC_CONSUME); #else @@ -254,7 +256,7 @@ #define qatomic_mb_read(ptr) \ qatomic_load_acquire(ptr) =20 -#if !defined(__SANITIZE_THREAD__) && \ +#if !defined(QEMU_SANITIZE_THREAD) && \ (defined(__i386__) || defined(__x86_64__) || defined(__s390x__)) /* This is more efficient than a store plus a fence. */ # define qatomic_mb_set(ptr, i) ((void)qatomic_xchg(ptr, i)) diff --git a/subprojects/libvhost-user/include/compiler.h b/subprojects/lib= vhost-user/include/compiler.h new file mode 120000 index 000000000000..de7b70697cd2 --- /dev/null +++ b/subprojects/libvhost-user/include/compiler.h @@ -0,0 +1 @@ +../../../include/qemu/compiler.h \ No newline at end of file --=20 2.36.0.44.g0f828332d5ac