From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96C07C3DA78 for ; Tue, 17 Jan 2023 15:49:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHoD7-00058b-TG; Tue, 17 Jan 2023 10:49:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHoD6-000584-Fy for qemu-devel@nongnu.org; Tue, 17 Jan 2023 10:49:16 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHoD4-0008E3-VQ for qemu-devel@nongnu.org; Tue, 17 Jan 2023 10:49:16 -0500 Received: by mail-wr1-x42c.google.com with SMTP id k8so16543794wrc.9 for ; Tue, 17 Jan 2023 07:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=wtgtiMGdL8MCokKDSduZAucXj56m+cRypOPRh8YRrnw=; b=FXQzahNALV9CAYXDThWaL1LOunNYDpNt748KDZXQr4hle/dgRF4r0NImaH5XEaef1v yF/JZrdBLji4Z2Abej1iyJzyNbkMqrHl9zaNR5YePAH6ROZFS8QNtw0VAk//Q1uP5/7z zUpKfO6F+mnfKCQzAwlqVPIp/A+XnzJETDpZx9Ids4vH9hfuzLrOdStD3Zi3XxrxHkQt jQewM0bK6fGURoP7RbBZQCqeopxrxZB23ytyUZMn3bovJ+dT60vWmD8QRl9jyv1h3uuf WjMXe4JAMwr0fDGI2+iPSuvQprjImzFVSxh3PIXMyAO+U6kyxTreYiainXn3PKMU1gAF hNjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wtgtiMGdL8MCokKDSduZAucXj56m+cRypOPRh8YRrnw=; b=34yhoR/JyBgW7rxaZ4yhid2YULMUvNx/7c9o7I9vKqZuscoDcGl1YsdYUNJvHyK0D6 Y8QUBNFAXrXNnQJ8sQZ0JeSLZ8+di5ztYXRnkQGskZjnXHMch7prWNDnO0QU0japCJ1z mi/IaLE67S5bniMXSVTaTiSlo0i0iddoz/Bv1OJ+PkqoWFoKSVuO2pCgYbVRkFyzGFn6 vYCE3pzqKdYid+15iJdd0oFVQ8+1n0/g20muVXxqbbwMfnihgpgDpQUVxcbeAe0g3I4d H3PMwyMeCaG4kTlhTrVQ7w4UIkQJNGuspRzabrJ6d6t5VKob+rs79d2rMS/FTbSrROCg dMgw== X-Gm-Message-State: AFqh2kqEkKpnjr1L7ttEZ/z6QjkCdexh7QGQh28THzy31TuB1DU8jFoM +TBRAvR6LAKGYwxya/6v+WzVMg== X-Google-Smtp-Source: AMrXdXvM/EuKAfnp1FEC1W/Q+O8ussHRao8FbsjR6RSC2rOkjOnKlJiPtvVCG/7X56UozN+u0msJDw== X-Received: by 2002:adf:ed52:0:b0:242:8af9:b987 with SMTP id u18-20020adfed52000000b002428af9b987mr12963652wro.13.1673970553457; Tue, 17 Jan 2023 07:49:13 -0800 (PST) Received: from [192.168.30.216] ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id c13-20020adffb0d000000b00241fde8fe04sm28689822wrr.7.2023.01.17.07.49.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 17 Jan 2023 07:49:13 -0800 (PST) Message-ID: Date: Tue, 17 Jan 2023 16:49:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH 1/3] util/qemu-thread-posix: use TSA_NO_TSA to suppress clang TSA warnings Content-Language: en-US To: Emanuele Giuseppe Esposito , qemu-devel@nongnu.org Cc: Warner Losh , Kyle Evans , Kevin Wolf , Stefan Hajnoczi , Paolo Bonzini , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Thomas Huth , Richard Henderson References: <20230117135203.3049709-1-eesposit@redhat.com> <20230117135203.3049709-2-eesposit@redhat.com> <48125c54-b421-6ed6-5af9-b05b8b249fd1@linaro.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.097, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On 17/1/23 15:43, Emanuele Giuseppe Esposito wrote: > > > Am 17/01/2023 um 15:33 schrieb Philippe Mathieu-Daudé: >> On 17/1/23 14:52, Emanuele Giuseppe Esposito wrote: >>> QEMU does not compile when enabling clang's thread safety analysis >>> (TSA), >>> because some functions create wrappers for pthread mutexes but do >>> not use any TSA macro. Therefore the compiler fails. >>> >>> In order to make the compiler happy and avoid adding all the >>> necessary macros to all callers (lock functions should use >>> TSA_ACQUIRE, while unlock TSA_RELEASE, and this applies to all >>> users of pthread_mutex_lock/pthread_mutex_unlock), >>> simply use TSA_NO_TSA to supppress such warnings. >>> >>> Signed-off-by: Emanuele Giuseppe Esposito >>> --- >>>   include/qemu/thread.h    | 14 +++++++++----- >>>   util/qemu-thread-posix.c |  2 +- >>>   2 files changed, 10 insertions(+), 6 deletions(-) >>> >>> diff --git a/include/qemu/thread.h b/include/qemu/thread.h >>> index 7c6703bce3..81ec9fc144 100644 >>> --- a/include/qemu/thread.h >>> +++ b/include/qemu/thread.h >>> @@ -3,6 +3,7 @@ >>>     #include "qemu/processor.h" >>>   #include "qemu/atomic.h" >>> +#include "qemu/clang-tsa.h" >> >> Missing file?     ^^^^^^^^^^ >> > ? Forgot to pull latest changes? I see clang-tsa.h in master Oops sorry I forgot to reset a git-bisection, and indeed was based on a older base :\