From patchwork Tue Sep 10 17:40:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 827039 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp431466wrc; Tue, 10 Sep 2024 10:42:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWVXILC6BWvWFgsgU1ZCQIPsMTXuCflFePogXwyhxpt3QEsX5gDy+luUU6eVD8ehcgASlQt0g==@linaro.org X-Google-Smtp-Source: AGHT+IEsT0cTWOl6jUC3bMBBbepT0xhMoolt3+3XfTYfGa8Zcesk5QW6p2uLczStQ07j0UI5Txes X-Received: by 2002:a05:620a:244a:b0:7a9:bd11:38d with SMTP id af79cd13be357-7a9bd110478mr944961285a.27.1725990144235; Tue, 10 Sep 2024 10:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725990144; cv=none; d=google.com; s=arc-20240605; b=BBuiBR8Jvz9qs513BoJPZZ3iuHvxWRe+/VLNqyAD6ZDBr/RJcO+FurDjGE53LdF9q+ vQIA/Cvk5Zxv4x3l6YB57uOF9KuMK1oiqdHK/bfGUgLUYX3LBHhs6YKrvLSpgqpVxACy IImbqUYXXAkRiDClEPeopXUlITnaho1cIv1vR6I+Un29ozzXmBWR7MY8z3qtEkHhHTWW kwWGaO3mthu/KlqllvFuCvBGWTSwQ5wodx+UauIjrCoevpyAH0/VKc4sLF5cUmIzXr2+ yEGWMZ1LmI0xPiL9ZD9Jlr3OjEqFJK/0TAVDnaDft6yuZLv+KNCPkgegA5w9kY2Cd5wy aL0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5Z1RdXPVj5atb8+PpKq/fmgLYxIn7PDouvny9pPcuV8=; fh=niU+Agd4Wp70L8xrJ0/IO4BQaJkQAaRxdsfKZE6Qk1g=; b=HP49Rl5Ag2xlFmsdvTo+Hi4JprTW3TQfw746NlKRnXsroJ+RBTujB//y6Bsof9DAxC +316DN2P62hcpaG9OvpXiEQkw2GUwewMm4EvBLhAiAW63Qy3xV1PKrGP3roVxv4hMaK7 P/yd9O3nG2VV0c8M8bqtjid0EkVhJjLYKbBDhLlPcqjzjL4iYOeTy+eZ+URIlSPlkyfE 4bqXVyHGNxzVm9z3ytCHQfkEh8IOc5QDU8ElTDP/4tyIbTXPeHDnUEHDYFgDVok74qge k7X5AzK5aCYMFyAjKFGExZN1bszNzMzbH+iVwcs+qD9f7Q7Bi/uT2S+NnE6oVywN9sjW 19hQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KQU66zSz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a9a79c4fa1si828007685a.71.2024.09.10.10.42.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 10:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KQU66zSz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so4qr-0002wf-Ho; Tue, 10 Sep 2024 13:40:29 -0400 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 1so4qo-0002bN-Tw for qemu-devel@nongnu.org; Tue, 10 Sep 2024 13:40:27 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1so4qm-0004sb-OK for qemu-devel@nongnu.org; Tue, 10 Sep 2024 13:40:26 -0400 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2d8f06c2459so3791173a91.0 for ; Tue, 10 Sep 2024 10:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725990023; x=1726594823; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5Z1RdXPVj5atb8+PpKq/fmgLYxIn7PDouvny9pPcuV8=; b=KQU66zSz8WY+kPtomntX64bsSCZNxiUZ9vyp8nOClT/mC6AISHAfZHqs8+CcOuGV4/ Za92ZhRjMYNnB5xZbn7yp1ssqk+8c+aVyDRhhPL3elcv2M/Xlg3vEGSUSRtMMP7+Za6v RedqQxDg0ZYqsJKAq3qLr5PB1Q8++30fUiT+tvUtqh291fT8drIP3+02r73brZFEJsF5 OuC/31zZK2n4AYEYzwp8NgZRkNDs2EO9oW6fX95Qx8IybsaljEUEiP7dGxabHLjCUjL8 X7iGt9gTxOzcWndhHzweIJN6ApLtLtKXa+ELdyBFcUTlO9N0ZYavTnEAiyxuQ7PR+FsD c+9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990023; x=1726594823; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5Z1RdXPVj5atb8+PpKq/fmgLYxIn7PDouvny9pPcuV8=; b=XGBAeL0foZhzPFZMlOT2En90B4myjXFl3xHug2p2qMFVl3675uEgD4qJUMDd6NHPIz Mp/i+q6WULPxwgholl4OCm4IMIiJHpcpGZWZcKXjXf4EODXgGkwUXwM5KbwUm0PZHQpH w/uFt8TMYQi5D8m45qhB+uQlwY0mmIqs2HUVd4UE6wWi2SPYBb/54CVu2nBOuGCaQkGL Yjv8XyZGUOt5nIfNrb4VkNjyHy1afKJu4N142yhB8peE506/ne/wbvG7oC6b6+QYAaUh 2aNcEXVz902i4xxtnRN+MDHJ+qeIX03gSWTv+m+ds9Jw7ujwXP8pz2KsV9IZVfgjrrbX hiWg== X-Gm-Message-State: AOJu0YzswMM0OOWWlRrPYPJ2HVcjPIc7k7iDlm1HEDKxFvNPqP0BNx+9 j0mMMb+1yoCC0BtLDLMMubRNwValgO73OsEkJahRbwb+cv3qZbQ8QNKxNLWDUYEeP5XxwuGmtDR Bz4m2bg== X-Received: by 2002:a17:90a:3f8b:b0:2d8:ee39:47d with SMTP id 98e67ed59e1d1-2dad4efe336mr14872686a91.2.1725990022993; Tue, 10 Sep 2024 10:40:22 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::9633]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2db04966d3asm6682751a91.38.2024.09.10.10.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:40:22 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Richard Henderson , Paolo Bonzini , Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Thomas Huth , Marcelo Tosatti , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , qemu-s390x@nongnu.org, Beraldo Leal , Pierrick Bouvier Subject: [PATCH v3 1/3] meson: hide tsan related warnings Date: Tue, 10 Sep 2024 10:40:11 -0700 Message-Id: <20240910174013.1433331-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240910174013.1433331-1-pierrick.bouvier@linaro.org> References: <20240910174013.1433331-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org When building with gcc-12 -fsanitize=thread, gcc reports some constructions not supported with tsan. Found on debian stable. qemu/include/qemu/atomic.h:36:52: error: ‘atomic_thread_fence’ is not supported with ‘-fsanitize=thread’ [-Werror=tsan] 36 | #define smp_mb() ({ barrier(); __atomic_thread_fence(__ATOMIC_SEQ_CST); }) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Pierrick Bouvier --- meson.build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index fbda17c987e..8a587bd52cc 100644 --- a/meson.build +++ b/meson.build @@ -504,7 +504,15 @@ if get_option('tsan') prefix: '#include ') error('Cannot enable TSAN due to missing fiber annotation interface') endif - qemu_cflags = ['-fsanitize=thread'] + qemu_cflags + tsan_warn_suppress = [] + # gcc (>=11) will report constructions not supported by tsan: + # "error: ‘atomic_thread_fence’ is not supported with ‘-fsanitize=thread’" + # https://gcc.gnu.org/gcc-11/changes.html + # However, clang does not support this warning and this triggers an error. + if cc.has_argument('-Wno-tsan') + tsan_warn_suppress = ['-Wno-tsan'] + endif + qemu_cflags = ['-fsanitize=thread'] + tsan_warn_suppress + qemu_cflags qemu_ldflags = ['-fsanitize=thread'] + qemu_ldflags endif From patchwork Tue Sep 10 17:40:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 827035 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp430771wrc; Tue, 10 Sep 2024 10:40:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXM++YJvKTU76OzPFWpXOIKoMgBLy4gNuCc0uk8bxgapqz9hbk79AAe1EMDg8bl4O6nZ9m5RQ==@linaro.org X-Google-Smtp-Source: AGHT+IEokwMHCI/cVbjDl1u7sYxP1PlNGar17DlwEmBEgTUzG0IxsY1VZC71yI0IPN69PlJblirb X-Received: by 2002:a05:6902:228d:b0:e13:c56e:1366 with SMTP id 3f1490d57ef6-e1d34a29d2cmr16145569276.49.1725990043899; Tue, 10 Sep 2024 10:40:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725990043; cv=none; d=google.com; s=arc-20240605; b=ameuiIyKvt05bWnJ5f9+qC2XLr/vMB9MNknRoHAh/icfsXaezxFk1ArkZM9TwNd9ga AMziLzlv1lsRou8I3VOpA1IDUmBEGuzC0HzlXLXkEQRPt4z6EngtrzHxQK+TR3i5tDbv CqwO7sxSzikTHWLXOD25CzhG2B7ZkEEf+T97abG0IPavbg0r8Uttyim6iSJNzFKnc1Du ZnjLmiU5zmRaixiP8Dg9ll4yZdB+hqkyyEPxaH8cBo4e524OgklmHULsW08f/TimCzE8 CQaKgt8HYyRIfEaj0jBG6lyo5SXzneVUOKe/fi1fpPxg2yF3bVg8b+KHaKxB0fdmKxLH nL3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PxK/kUedWi76nv9Z4j6eZ6ETsIVX17z0F3roB87C/Q0=; fh=niU+Agd4Wp70L8xrJ0/IO4BQaJkQAaRxdsfKZE6Qk1g=; b=jmfSr+HmooeLqx+BxN5qF+QPt94esFMVHMKpKJjBStkJP1ARD+6FPQWo2YrDA4u1u3 1zunwuvXLmzzA16z8XnY2/r4ZFaG/iYFa7EmlKCAXaxi081lDs6vG6ALc366ICHlPwGR N2FnyIq3qTKPwTYPSG1cTfl4002e3+xsioKdUG6oZ7g8DeuTOYe72/rYpQovtjUdD4lY S3tnltzKwwmjNm4VrGdFXaM7zYmFJpOOuhT39ZTSmAkqIpZo3XQKzHyYJdu1sMUEv8+X L93wNiSdqlo4lUsWKnzoLIuJIShFaBkgV/LfWZAigeGgTPMD1ajKCpzJCC7EnwyfLdqx kp7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sFSVBUQY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45822e7f7b9si82987191cf.204.2024.09.10.10.40.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 10:40:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sFSVBUQY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so4qt-0003DK-3X; Tue, 10 Sep 2024 13:40:31 -0400 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 1so4qp-0002h9-Vb for qemu-devel@nongnu.org; Tue, 10 Sep 2024 13:40:28 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1so4qn-0004sq-R6 for qemu-devel@nongnu.org; Tue, 10 Sep 2024 13:40:27 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2d88c0f8e79so4562967a91.3 for ; Tue, 10 Sep 2024 10:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725990024; x=1726594824; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PxK/kUedWi76nv9Z4j6eZ6ETsIVX17z0F3roB87C/Q0=; b=sFSVBUQY5xCEoltEOz8AJzF+cm7OG1v+pU6x0db57yT9SfjpvXndcpCnzg3ih+yP/J 4Du32UtzUcFa+JiLm4rGsxUPxnABM+VXGa6SLyz//CSeUiadp5l2MPMhn+3niXqTMGsm Y1OjGeCY8gyVegIIMCZt6m3Y4Vvioln7h6fT3KZvurMdudKR6db4K3brcgwERgxE9rUh BwBTd9MEF5xLDjUFFJ8TmQflOdVxYiXSyapq2nAugQzT6wlcWHzsff9z1W/X35P5ACsh 08zrcpjrIHWtW4IT3SHtr1k8la4/+hNjvcfa/Q4MdvLV0XrONevNsFROnsa7IzUa+Cc8 MYhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990024; x=1726594824; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PxK/kUedWi76nv9Z4j6eZ6ETsIVX17z0F3roB87C/Q0=; b=QIX7HMA/Mk/X6ODFiWiD6rfRkMOm5LUXntX0zYiq+uD7rnV9wmc+W+fOKEqEcKqVCB HZJQeUGbyYvkXdEJI0eOdqmjZZfpRePvlg7Ui2Q2jzZOUXZLPu3NVExqF4iHIS9ZJ57W ojuIkbAYIwqYVzq2qW1hcT3Tpy/B7cHkF2wAPiRsIGZw1v9mL7ZGH2jvUQbVOhox29DS XqFjacBmisEAHwbxSYxvj4JCtRSAaMWGnKnEVL61ETtkDTupr+r0xsw5hCrf1EuyqluM oe0lWSCOR+jAoytJBbxaInzaz3RsVegoX5nH8jJwHyfbd/IbGtwtxPzvMvkmhxKiVkhb /fkg== X-Gm-Message-State: AOJu0Yy4uqPAmxPG8oPSp8gMQ2xO+K3zYrDqkkW2iD6ANnNs3qULZ5pI 706S08SK7TS3etl3Y7VUD5suvM/+sOhFDPUbDCZgSGdEGSUkTKMXGSpzE9F86GJm3bd4RLvlbC9 s0VvWEg== X-Received: by 2002:a17:90b:3c43:b0:2da:5156:1253 with SMTP id 98e67ed59e1d1-2dad50141cbmr5998023a91.21.1725990024249; Tue, 10 Sep 2024 10:40:24 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::9633]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2db04966d3asm6682751a91.38.2024.09.10.10.40.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:40:23 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Richard Henderson , Paolo Bonzini , Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Thomas Huth , Marcelo Tosatti , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , qemu-s390x@nongnu.org, Beraldo Leal , Pierrick Bouvier Subject: [PATCH v3 2/3] target/i386: fix build warning (gcc-12 -fsanitize=thread) Date: Tue, 10 Sep 2024 10:40:12 -0700 Message-Id: <20240910174013.1433331-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240910174013.1433331-1-pierrick.bouvier@linaro.org> References: <20240910174013.1433331-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1034.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Found on debian stable. ../target/i386/kvm/kvm.c: In function ‘kvm_handle_rdmsr’: ../target/i386/kvm/kvm.c:5345:1: error: control reaches end of non-void function [-Werror=return-type] 5345 | } | ^ ../target/i386/kvm/kvm.c: In function ‘kvm_handle_wrmsr’: ../target/i386/kvm/kvm.c:5364:1: error: control reaches end of non-void function [-Werror=return-type] 5364 | } Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- target/i386/kvm/kvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 2fa88ef1e37..308b0e1cb37 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -5770,7 +5770,7 @@ static int kvm_handle_rdmsr(X86CPU *cpu, struct kvm_run *run) } } - assert(false); + g_assert_not_reached(); } static int kvm_handle_wrmsr(X86CPU *cpu, struct kvm_run *run) @@ -5789,7 +5789,7 @@ static int kvm_handle_wrmsr(X86CPU *cpu, struct kvm_run *run) } } - assert(false); + g_assert_not_reached(); } static bool has_sgx_provisioning; From patchwork Tue Sep 10 17:40:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 827037 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp431178wrc; Tue, 10 Sep 2024 10:41:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVZDEeCqeUQfewSqQcajISxfYm7ksbZjZfXle7iuwz6hp3woBWe9J/8SwIoIo3Cfol0+iSZMg==@linaro.org X-Google-Smtp-Source: AGHT+IHo2Gyu/O79vN5t+Lqc+riEBpHSqKYMMO1WoZNd7ftkTlLANqFH0jDREJxXKK5+OS6Z1xpr X-Received: by 2002:a05:6358:591c:b0:1b8:226a:2622 with SMTP id e5c5f4694b2df-1ba4916d9bdmr44474255d.21.1725990102356; Tue, 10 Sep 2024 10:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725990102; cv=none; d=google.com; s=arc-20240605; b=h/JhMHdgHyV/hfaqXRQwXGjllq/boaaBBfu+ZcgLNcNN9AD9aYKSVZRYgA/6jgpz/o MnFoXIckc9JmOkT8zZTT0yZ4S4Ee+6I7R9gZPgaCQ3hidBe3t6XRJ3isFoq7VTjKr4KR iUfdc0BwOaptv+mOLwIwjEdiLkjZfMA3Me0HirAEb+hkzrE1AXOEvtYMIgNVXPCQ9DM/ ValB9xLlLzygVpbVEhCIJqj7aKFI1aAmuhM+JspqreJyeAJAXjD/lkj6XdBOdPm+krpa yYQ+tYD08vLkYnSXQ+b22i0ipXB+LSlMvmuGwmb+M3WMCy1LYjIfceanjijJMREHz3NC c1Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IlCj2ixhxM/epvOBESU4I3HZLS9l35ap6tDyuxDs4dc=; fh=niU+Agd4Wp70L8xrJ0/IO4BQaJkQAaRxdsfKZE6Qk1g=; b=C4lLh6XZab1PQ9Lakd8uLvRNw03eUgPXKGsHd5TgxCJKPBr1JmraPQiyywnxts/PwD 6y73SyPUVSorVR4Wzph2uIYq0N1I2a6IRsVwlhJygyARfBkq7FGSo4aihEsFtUHj+Krh QrNUXpDjUK1+CO/0C+fz6udmq9MEusB4wcyoMYrUhIeq3aZeKc8eP2Vedba6UlyjSkOA JnaA7az6YHcb76A/2BqYDwMYETVrXiJRhCgmelUewij3PJVJ48tZ90Hx2R5dVd4IALpG xVIhWW5jXAYR7ptl1aa4sbRZ8kzhWuVg7347veoYltilPLQpmUln8mFvWuo6mhfKXNfF InyA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JS5RIiPt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a9a79c4c77si821840385a.116.2024.09.10.10.41.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 10:41:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JS5RIiPt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so4qu-0003Oa-VC; Tue, 10 Sep 2024 13:40:33 -0400 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 1so4qr-0002sI-26 for qemu-devel@nongnu.org; Tue, 10 Sep 2024 13:40:29 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1so4qo-0004tI-Sw for qemu-devel@nongnu.org; Tue, 10 Sep 2024 13:40:28 -0400 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-7ae3d7222d4so850186a12.3 for ; Tue, 10 Sep 2024 10:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725990025; x=1726594825; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IlCj2ixhxM/epvOBESU4I3HZLS9l35ap6tDyuxDs4dc=; b=JS5RIiPtYSDrEPH0Dl9bI4J1B5atixhhrbPxalBWNa09lKoJi1ddI2MYe+Dbsow+oU Jj1feojV+NBhUPYQDEdzFUQfFenPjiOUeQxIRorSVJFcI/gVS7ryK0l7H2eV2ZFyHiwF EfKjz7F02xBN2dsQQ8CFH0jdCbtCEP/FjsuyZbs9EK2uBLDYQ50E7899VPiZJECwtLO/ 1auWxYk0fNHRh5vYfCcc/EhXPkxChJY5HIuOTKmQyd/Xj/h2ngTmUqmojwBnHy4nC4Bf Cdl5mrwrFCScKsHrimvR9tl9eOt4d7RF5VI8OavXJA+gfuhmxOabGF8o/LaUs7Xd30mb Nkyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990025; x=1726594825; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IlCj2ixhxM/epvOBESU4I3HZLS9l35ap6tDyuxDs4dc=; b=ONyUtFpcuaRLh5TY0+7+nRCyQtm7fZ/6B93mog7MT56ptV5Bvs8zSGT90oC4/q31KQ /6M/kYglfsHbZ5A06g6Wiq2xQcBqZWpOu3EMLS/pXMry/2rFZ0+TBGOIrHEvVWI9j8WC CM/vvwF2Jk6kWuILVuTMsZ5jxeMbASzaUc57YRVokbjhp+o0/58IOBXcAgZ/kz25/BFD rbnRtqJN5p7APyq6pR0XOWE2CP4oIhiMz9m8H17ENmzWIGPt3VMtAIDm6ZVF+LeVJQqw agTaEsOYZcEvfR+Lkb5wti6Rv0aKIUtWaFDNRrLGIUbuSsZreZUR1kjMJXfP91ollN64 9Lkg== X-Gm-Message-State: AOJu0YylW8MkIMY+Cf33EuHkXzXBg77kw/vCENEA0RxBqVx7pViIC98l n2ilJnNyZtwByR1hWbJnik8X8Aa66AwQ8iGf1JYGgjOfK6K42SVLO/tStE3dgDfH1m9a0sRoXQn nWN+gOA== X-Received: by 2002:a17:90a:4d81:b0:2d8:5b9f:75ab with SMTP id 98e67ed59e1d1-2db830582dfmr361931a91.29.1725990025406; Tue, 10 Sep 2024 10:40:25 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::9633]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2db04966d3asm6682751a91.38.2024.09.10.10.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:40:25 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Richard Henderson , Paolo Bonzini , Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Thomas Huth , Marcelo Tosatti , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , qemu-s390x@nongnu.org, Beraldo Leal , Pierrick Bouvier Subject: [PATCH v3 3/3] docs/devel: update tsan build documentation Date: Tue, 10 Sep 2024 10:40:13 -0700 Message-Id: <20240910174013.1433331-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240910174013.1433331-1-pierrick.bouvier@linaro.org> References: <20240910174013.1433331-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pg1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Mention it's now possible to build with gcc, instead of clang, and explain how to build a sanitized glib version. Signed-off-by: Pierrick Bouvier --- docs/devel/testing/main.rst | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/devel/testing/main.rst b/docs/devel/testing/main.rst index e9921a4b10a..2e57390d990 100644 --- a/docs/devel/testing/main.rst +++ b/docs/devel/testing/main.rst @@ -634,20 +634,38 @@ Building and Testing with TSan It is possible to build and test with TSan, with a few additional steps. These steps are normally done automatically in the docker. -There is a one time patch needed in clang-9 or clang-10 at this time: +TSan is supported for clang and gcc. +One particularity of sanitizers is that all the code, including shared objects +dependencies, should be built with it. +In the case of TSan, any synchronization primitive from glib (GMutex for +instance) will not be recognized, and will lead to false positives. + +To build a tsan version of glib: .. code:: - sed -i 's/^const/static const/g' \ - /usr/lib/llvm-10/lib/clang/10.0.0/include/sanitizer/tsan_interface.h + $ git clone --depth=1 --branch=2.81.0 https://github.com/GNOME/glib.git + $ cd glib + $ CFLAGS="-O2 -g -fsanitize=thread" meson build + $ ninja -C build To configure the build for TSan: .. code:: - ../configure --enable-tsan --cc=clang-10 --cxx=clang++-10 \ + ../configure --enable-tsan \ --disable-werror --extra-cflags="-O0" +When executing qemu, don't forget to point to tsan glib: + +.. code:: + + $ glib_dir=/path/to/glib + $ export LD_LIBRARY_PATH=$glib_dir/build/gio:$glib_dir/build/glib:$glib_dir/build/gmodule:$glib_dir/build/gobject:$glib_dir/build/gthread + # check correct version is used + $ ldd build/qemu-x86_64 | grep glib + $ qemu-system-x86_64 ... + The runtime behavior of TSAN is controlled by the TSAN_OPTIONS environment variable.