From patchwork Wed Aug 14 22:41:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 13764237 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E206B144D1A for ; Wed, 14 Aug 2024 22:41:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723675300; cv=none; b=g/UPQoQKUUHoTmxbN4Q5wol3pueUwyoyeZctGHBtizV99MVMGnqhbYHv6KbvYdDWPwTYx4dJ9hsGu7hLIB6bfO1JJi4U1eyyIyyz7slBv1aDd+Z1hP7Z+DXYfJwPXdp9zMOtnhMdIw9JrUoXuqUXsnGOtFEgx1gGKEC+LPmaOGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723675300; c=relaxed/simple; bh=2aKgGCeRNvlVjTeVgK1GayG6XFPtka9uNDkIqd+wzmw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=aVlGdGOaTfNh0uHDhKtXnrA1yIMMaYjJi3QukIoBe7nxzUL/0aAa2jYKEXOiykjFnqLQOAE09MxD+PUa8ANqu0g2OdzOpjjFcISHc9IW1GRvOhLnlOanWwup7XfqfQcPKayweU+j00WH9IZU8Co5iG/DBo4KnCFPx7Eh6LdW5Jc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=myu9rKTY; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="myu9rKTY" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1fd69e44596so2492285ad.1 for ; Wed, 14 Aug 2024 15:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723675297; x=1724280097; darn=vger.kernel.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=BA0vIbfMo/Ez2DzL8kYXbRUniB5/Y+edtyx+BnopKwA=; b=myu9rKTYd0vVhS7mchgjb5cAss/lV5/afEDBQgk+pe8XFAUqGtvL+/hSNJO3XauW3c XSfbX+eS88fAeq47K5lrHO/nCMWTDkRHKUmMvQVUggcg8l5HLS+tdc6UFqmI4KH8hL6w bcJx50S8UKZnSwPIuyQq9W7P1lQfMCfPTlyUyCnm3RUhUucecHNt6IZ2sEjluUrrv66Q 91b62clFfYXtdnZmUT14f9icAb8kfPZNUY/yORpW2jKhOmfbRZwgPB6eW8/zXpphr7Po QB4TYjPfKT7s2WryrPfY9s07xR6t9CWbzSf3FRJr3QT683XiYseqsIVhkPFUDpl8x6UE moiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723675297; x=1724280097; 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=BA0vIbfMo/Ez2DzL8kYXbRUniB5/Y+edtyx+BnopKwA=; b=gbsqnyigwCMSrYLIuUzRrUzvRqHEXdH9Rj2jlHWJ7IBSrO7OODmQQs8CNBiH8FMbes 4xcPTVhDqyDX0wCXrsP4VCUqAuGkT8fVksAoERF4nGpOa7R/R8Ggcz2oZG9+t7tdasaf nxU39//4mprowrkxTGw2+WH9J3+7BPeiM3ERUJp5kgDvNKNtEWNJbTF+fp93DQnpjENM SmdvF5NmtylP5u20XJDK/7bpAe4ZeEbHjq0vMEse/QjGHuV6tu554S5HlsvtQMeeMh6p uM3i7NQBZx3DaJUCfJq9eOTLNdaCRNnkswbYjIHqdXEz8lAhUpug3qZ5mj0rFtrF2uId oCCw== X-Forwarded-Encrypted: i=1; AJvYcCUi/P9fEE67QHTKWgzie3WB37r3Qr5C2C2An/HxY1D1stZuUy0eSQwr8CgvaQcmp1yeCFaZYEdnKdHYbLuZP7wJ+QXS X-Gm-Message-State: AOJu0YwE1J7AkMyAYKaLDmp4d6XaHPQbrqZxRoJWVAoq78TiEx090c/W 3OKUs8cTiIq5x7Ac4bf1crgkINV/alJ/JGPchNABZhdXWMZxn0MAdU5X3lv/RdU= X-Google-Smtp-Source: AGHT+IHLOMuA2xNQUnJ7j4Sv3gvsivnE3ZDnjeWx9uHlBTc7JPSjJLnmaTR7KYUm/tE1ewGigV07vg== X-Received: by 2002:a17:902:e807:b0:1f9:e2c0:d962 with SMTP id d9443c01a7336-201ee519f73mr13281165ad.31.1723675297099; Wed, 14 Aug 2024 15:41:37 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00:5b09:8db7:b002:cf61]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201f03b2874sm1225595ad.308.2024.08.14.15.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 15:41:36 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Beraldo Leal , David Hildenbrand , Thomas Huth , Marcelo Tosatti , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , kvm@vger.kernel.org, Wainer dos Santos Moschetta , qemu-s390x@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Ilya Leoshkevich , Pierrick Bouvier Subject: [PATCH v2 1/4] meson: hide tsan related warnings Date: Wed, 14 Aug 2024 15:41:29 -0700 Message-Id: <20240814224132.897098-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814224132.897098-1-pierrick.bouvier@linaro.org> References: <20240814224132.897098-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 81ecd4bae7c..52e5aa95cc0 100644 --- a/meson.build +++ b/meson.build @@ -499,7 +499,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 Wed Aug 14 22:41:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 13764236 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0585614B08E for ; Wed, 14 Aug 2024 22:41:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723675300; cv=none; b=iniL7WnkDivx1BQn3T1dsDQyBIK7Fr1t/0qziluHhhLl25gdOfFhGCzvQZsvlkXkc5cgQQXA3XA5c3sst6tPSwS0k4xZ6RkUDAWuGW/rdciTymz4O8lrYSefZcXlycAdADvNLuRoKjSP/3ljOgTXQXf5FTlvDoocUQo4YcwHnSI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723675300; c=relaxed/simple; bh=VEOWyN+y5Vy4QgY9/GPHx/njJikrmq525E7VBVdGZy4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=HiZSgLY33eLNpoJS8k1+ld4s3Y5uWT8SE7NwA/8l3I/6Qwi6mf8YPIs3CLxc8PHnf5ayDhylRG+wNhgqc64v2suHN11xyfM3wrvjAl34OSl1XHEGZANS3kwx9as6YB0+OF5+ZEvOjCFro+eTU9Dc251i/wqj6h6Jz4dig13OYn4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=boBzll+X; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="boBzll+X" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1fd65aaac27so9959315ad.1 for ; Wed, 14 Aug 2024 15:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723675298; x=1724280098; darn=vger.kernel.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=lkpyTpSOlqu0+QkwYEsdEX4Fr7KToSSmbcU9XazMmXA=; b=boBzll+XjcnkJrXJmWL3cNYsq5Vh/KId1Hou0sAc4cY9WSru9UggRTscouiC0T35dl NllvkgQD4Bj+jZffIuu5tnR7uIPzXvzU06xcgDz4WcaszLiyH2OjL1jtOlL9b0gJ/S3d ka+uulZcQklN1t/YBcPqDL8dcilR6hlLUIn5iC3e7MI14PWM+C+RTa+UPyWUa/loSzfI CN/FRemsXWjz8iUH6JZODOGFc9gx26DqyCONh+4B0T3dWkGnUQufFEbNi2IXo/V1uKtg xIW+Y1cmjsvGFws26QWbktfbs1xn1gGELT+rbLSUKKxZEcw9iMbFansEiuia9x42mTSj 2nFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723675298; x=1724280098; 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=lkpyTpSOlqu0+QkwYEsdEX4Fr7KToSSmbcU9XazMmXA=; b=XKZbkX1Ry6rDAB/iKcsMx/8xlgZ++Plx04+CE7l0YFwKLX9/+U2LJTbmp2Dv0EQrXZ j0Jeqdcdp3PgzzKg6QBK2q4/T64WHrWVIuxsA0enlDFMfoF4irsEnU4fOYAgSowcyBNT RLEzsgUYRa88jl6W8Z7ZdPGn1Wcf9GAxXMrL928mFyLKPy7bHulAxXgEyXgo3ZDesu2N P42WwGnYcYRJnOYyTmnzkwSA51zf+/AXWHPMR+vOQFDLQIuw6fOFRCNLYedZEcEY9XfP f+cnroBUqmoQ9JnSRJDRnH/nhtdn3l91nLcQk+BlWXLpjNYpRJO+CVfc4pwGQutnb9n+ +HVg== X-Forwarded-Encrypted: i=1; AJvYcCVWB7VRA8CfnodxE3+Udq62iPVei2AH+yLdR9nalUr3sXsJienti1Ed39o6ViR0j8If9C/2m9LvisZqFoDGEZVRrCH/ X-Gm-Message-State: AOJu0YzcEmjiQ90Gx7IMb0NUo76r57su7B7g+0xwPueIEs6GTJGiaa5F 3tmsbHtXDQZDavoft6HpGSQ7gaCwpRHvnJ+rCuFYIM5RSGMoLgdlyHRnWONQv7M= X-Google-Smtp-Source: AGHT+IGkesrW/K1rSLk7UrsKDf2/qUa/M6f0mBcupHt3koifZY7D+XvsN9EVSwi1JJN5HwVBtak53g== X-Received: by 2002:a17:903:41ca:b0:1fd:a412:5df2 with SMTP id d9443c01a7336-201ee515b17mr15782565ad.29.1723675298210; Wed, 14 Aug 2024 15:41:38 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00:5b09:8db7:b002:cf61]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201f03b2874sm1225595ad.308.2024.08.14.15.41.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 15:41:37 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Beraldo Leal , David Hildenbrand , Thomas Huth , Marcelo Tosatti , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , kvm@vger.kernel.org, Wainer dos Santos Moschetta , qemu-s390x@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Ilya Leoshkevich , Pierrick Bouvier Subject: [PATCH v2 2/4] target/i386: fix build warning (gcc-12 -fsanitize=thread) Date: Wed, 14 Aug 2024 15:41:30 -0700 Message-Id: <20240814224132.897098-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814224132.897098-1-pierrick.bouvier@linaro.org> References: <20240814224132.897098-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 | } Signed-off-by: Pierrick Bouvier Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé --- 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 31f149c9902..ddec27edd5b 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 Wed Aug 14 22:41:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 13764238 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 375E9143888 for ; Wed, 14 Aug 2024 22:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723675302; cv=none; b=I8XP5FAww40Aq75A7Imj7SrA+/wEpbU/WLWVSy2kipS/a48l9OEWRcylub4qhZDrFecTrDfZIAXgd8bD60vSdciGiNEv7vH4e5LldrEybY0bJew+9AErGLaD7PvdyMZE7QdIrPlQ0Y+dOxKmwfvFJSCLgCy2odO7/0ld7wrFF0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723675302; c=relaxed/simple; bh=gnvdMFmWfB+UmpzunGQ1TsPmjggL3z4dlVNsJFDOfFM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=OhRFhGe4+kQOTxUuWyFLE5k9QtaIlQ1mAVxdM0Sg0Pycc+woA1IpboeaRVBlcYPdi2hzim8Jq2wk6ye5zwUuOK4l2vWxTtbX2V4JZcikviS6dBeRnjOll8IjKkvo2UYOLWfsX2Dnkf8sJgOjfiDN9aDDXHvCUz4UJJT/LrTMykI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=RktEHB9x; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RktEHB9x" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1fd640a6454so4214065ad.3 for ; Wed, 14 Aug 2024 15:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723675299; x=1724280099; darn=vger.kernel.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=ix2f5gCzV/CdkxjLWnI0M17lOMP/hB/dGS/GHu24vmM=; b=RktEHB9xxHFTGdkEgKCn/o0z0kx1F9IwPz0acMG1Bu5ZvUvKMtnGST048vwpw7+axl WszrXI9J1SeLpvmUH+S1N68IuE+8T1Djdaa9LVYqOCSDAXwqvm9EraH+dv+XHch6X17u xj4uZjmgDZuUQINxzABzg0PNmr64pCs3HRcajHhupu16d1mmxjtePJ6PWmvuARtNPzO2 TdtHR2Joq5SSkaJsFud6+QdzhKdcHSj7AaWJgkno2HiqMoN8wg0413hk1FYdFOU/zyMh d9OFYyp76BilYjhgaJDraJmuJjJOFnKXuN1y0RDwGpmS+y4PM+R/akm8LtaXj4d5pl1o W1Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723675299; x=1724280099; 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=ix2f5gCzV/CdkxjLWnI0M17lOMP/hB/dGS/GHu24vmM=; b=BJ6oxidb0xzAo61NS9tQdIFh06NoZv2af5kS/ZJZT+C9n5+Ye3b6uePbQMaV0TtZzN OGnDwdwFoiWF8smcm8hs89VmWZpOek5s+Uhcn0TxwJQulAE21yXD3B1YRo06NnQEyakz 5MHp5L+eV0ETjnxSZyrOhkxSEnGEC/bW8KsNQ0DjmzNF2rwn0aPD1bj2r7KfkWVxpleu GCIVe2mdvgfof9yJrLQ7PIQG2gUImoxF9vxcUoy+4msV0cSnAnd1aJzc1LT7LgGwPjqE A6E1lEugtQyOzeMW56UoQmIfrgGCHBgJi5T0WpVhhuvh3M2QMcY+Wes02SXh3UuwCruN qtEw== X-Forwarded-Encrypted: i=1; AJvYcCXFcaHEIFHYsLSeiwB9D/ZFU1mAYaZJQaBk/Fsh1t6pJwCZGVikP7YJKnkgx/aXpR764zT/GpGW9hY99yybXFztU1TT X-Gm-Message-State: AOJu0YxOaLUsYMiXcbhMBkXSaQdms0I0OAW5YiqSWbJ4J0Wr+OOURnKs in2x7OAJVB6eKKi6MBvEo8BC1TAcKyqiGtvWaBqF/481s7ViOKb49iQ66Ru5QaU= X-Google-Smtp-Source: AGHT+IEcu9RodvL06jYwIW+MbnMmHphUULHzOODkrJsSEEKFjCAGokM2BML2UnWqSdowzt0TfjMKog== X-Received: by 2002:a17:902:d508:b0:201:e792:d6ff with SMTP id d9443c01a7336-201e792d9f9mr31346215ad.10.1723675299512; Wed, 14 Aug 2024 15:41:39 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00:5b09:8db7:b002:cf61]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201f03b2874sm1225595ad.308.2024.08.14.15.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 15:41:39 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Beraldo Leal , David Hildenbrand , Thomas Huth , Marcelo Tosatti , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , kvm@vger.kernel.org, Wainer dos Santos Moschetta , qemu-s390x@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Ilya Leoshkevich , Pierrick Bouvier Subject: [PATCH v2 3/4] target/s390x: fix build warning (gcc-12 -fsanitize=thread) Date: Wed, 14 Aug 2024 15:41:31 -0700 Message-Id: <20240814224132.897098-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814224132.897098-1-pierrick.bouvier@linaro.org> References: <20240814224132.897098-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Found on debian stable. ../target/s390x/tcg/translate.c: In function ‘get_mem_index’: ../target/s390x/tcg/translate.c:398:1: error: control reaches end of non-void function [-Werror=return-type] 398 | } Signed-off-by: Pierrick Bouvier Acked-by: Ilya Leoshkevich --- target/s390x/tcg/translate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index c81e035dea4..bcfff40b255 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -392,7 +392,6 @@ static int get_mem_index(DisasContext *s) return MMU_HOME_IDX; default: g_assert_not_reached(); - break; } #endif } From patchwork Wed Aug 14 22:41:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 13764239 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8033114D457 for ; Wed, 14 Aug 2024 22:41:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723675303; cv=none; b=XgWZk7eiUU+RwDJNnJSj8o+H+jabG6R4chg/L7FMWBxSlztbVCzvVuBc4V7jIOVUYdQlS/09K1E5U63XxUnUPfK/3IXQA9uQzFAX6StMN/hYrqATrbU+UAFgDxm7m646RL9+HyX0tCEwPl2ZGoK0NLVE5DpTNrNeBtVHCHf/h6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723675303; c=relaxed/simple; bh=ykIn1kLLxwvSuVLDjaHFIirswR/aRePw/kLRAtdkwpU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iP9lSrnTTANlIkxLTFqtuPLrE11sIOkKANuXXAT4BP8FKZ27ynxrx58yhdMRzv5vaQ7jGUqW4u2PU6e/UhgrcNNfG/oYt4ZisL2RyydRLmCEQd5jBis6zFHRUFq+0TH4dHFH+IFfpFLNjXKXnj0xhKwdwl0lSgleghTKi3k8ewE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=bIQNjZ4u; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bIQNjZ4u" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-201d6ac1426so3093065ad.1 for ; Wed, 14 Aug 2024 15:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723675301; x=1724280101; darn=vger.kernel.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=zJho7r2KSIGZArJtcY0/tQGk0chbARupwvgFA11PnCQ=; b=bIQNjZ4u9VeqZ1paJO+/rSI1LTHX6ZwjaHYEWkiR8Z030ySU3VzkuQ+8Xov/UZk4oy b0DrIIK4rX6hzYg49MeYTaMsCkI1QPQpZHedmukThZbuhAa/paOxssoIqD7J3xVHttS8 epAw2R6ykRo1mIFGA660ssNZo54Mj2r077QGxkbzzUd+oTMw7UuOx2SXvgB00DkRAoKl aaWi4jm92mC08aRhKtdpjgLcowyiwXcIhjkY/3L4A9VTNjNFfgk6ysupEx6fHjMf/c/Z 96uBKeyHUfSa7fYgoxsRiRik/PixHOfwM1tFHlbc8qBiPxFg8Uu9lWL0utA6fQgH8GI1 qUvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723675301; x=1724280101; 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=zJho7r2KSIGZArJtcY0/tQGk0chbARupwvgFA11PnCQ=; b=EDp0maPrWO4a7p8StXTnFsspUOrCDbVXge/H9/DO13IIVCFeaAUXGKu0JVDVFLvydW Gr8STeGTA8vhKaMFXcXnv5cYW3onTBYQnyYemkcWoEFwzsTD++c5kC5zFPaTCuF31z5W EkDVk4WDvu4xdM5PVSUDzP8Ki9EBmwnfS8g9Jy408/6qVUOXFXTRywmfmASgZAxRHIZg 7SHCtVsp2MtAhzeqtFTkqbkuhgyY6nfsL+5MIEur/bY5xOUT/3Rc+egpmEkkDjuU3MXx EKTp0nQgIsQptaUBEwg+X2MrztQOr87bgU0ypqLala6i1J/dalyqvB0BB8pR1mIBG0xA Bw2g== X-Forwarded-Encrypted: i=1; AJvYcCXpk+kgIyyznArIUQXPHfpPEpVfYYCwBlajCmSiQdYurfz79cWvE+lURiw+EoFQfFntgNJtbKLoVr0bPeHSI3X+B7u5 X-Gm-Message-State: AOJu0YwPHDGnw5mu8NjXl/5xbTFPKaa1i9P2K7TdKCPmPxanfLTcenB2 XhS+Bg6jxPKdOlztGjpcHtrgFsonZTyou9wDAdmoDXNWQw3GkjzFuT5K/335CVs= X-Google-Smtp-Source: AGHT+IHfpUHmltRgG/gVjytdo0w2YyJNJqcCukrC0Pgjx2S3EMn+ubfqhC4bAxsC2vTGIUfXWKdtyQ== X-Received: by 2002:a17:903:11c8:b0:1ff:49c:1562 with SMTP id d9443c01a7336-201d64d8afcmr48133095ad.56.1723675300659; Wed, 14 Aug 2024 15:41:40 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00:5b09:8db7:b002:cf61]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201f03b2874sm1225595ad.308.2024.08.14.15.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 15:41:40 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Beraldo Leal , David Hildenbrand , Thomas Huth , Marcelo Tosatti , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , kvm@vger.kernel.org, Wainer dos Santos Moschetta , qemu-s390x@nongnu.org, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Ilya Leoshkevich , Pierrick Bouvier Subject: [PATCH v2 4/4] docs/devel: update tsan build documentation Date: Wed, 14 Aug 2024 15:41:32 -0700 Message-Id: <20240814224132.897098-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814224132.897098-1-pierrick.bouvier@linaro.org> References: <20240814224132.897098-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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.rst | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index af73d3d64fb..f10cfc3f786 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.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.