From patchwork Wed Aug 14 17:11:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 13763746 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 D512F1B9B28 for ; Wed, 14 Aug 2024 17:12:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723655527; cv=none; b=EOH7TrjW06fg1RXw1m7NLIMCDJUiIrEwGtI0xaP2lCOAgUmW8Jv1jEKLYqwS+PTSozyKGGitcm995CteQ2e0t3aOq33gkVgHQQFGDWPDOMV897aRbAgrtLxzURbk38gLDRt95CHQZb59y4Eky5WjazQEa+2w1kgjPgdw/Ob3Nhg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723655527; c=relaxed/simple; bh=Qcb0rwKUAFr4eHH0sEce7cid3hsAqYC+Nbx1b1LMV/s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=tXY77RJSBPJRTh2g7uwXO/hBkVjQsEq9aiFetvJPBbf0SAO7HWdfUK3jj6rpKVv9/t10AfkKemPBmwUkr9MJhConJg48eyXZ20mh4jbPHyD4yRStmhVRGAIj5easAxafJ9TtF0Zt52TAWNBxvCEz06HmAA9YYsHCIO7NU845q9k= 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=fbKKhoP1; arc=none smtp.client-ip=209.85.214.172 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="fbKKhoP1" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-201ee6b084bso630335ad.2 for ; Wed, 14 Aug 2024 10:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723655525; x=1724260325; 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=CvLg/jdd02raDyPuokVKWkE8Jw8u8gKV/oNxvgJVSos=; b=fbKKhoP1DtDtZ+q1Z3oCM+ZIWfF1KB3oTbJEYkw5TlPy7xILgsnK5o/rai6EkgpcJV ovbZMwDnLG8N6WD197TQrb3WIT1HexxzZLs2HZ5aY8orWmidRUMSiCOjLB0HYhdPfZa8 U3l5CuS9FF/RFy2Nu8Btp88ywEyNAoDKWamibcyU2sqbRYBDQ76ZOuNQPB+lRmvHxVKj Ak69QNY5OKxCYT68zhNE2eRSG63F0RSq+nTulupPbi73R/GGhQkDnpbtwcZUVVcbfnG6 E1LtFXCNQvE4GugAxxcznnxlwFyOC3UMJUa9YXeXfcAIoquCknTm/TzZeiM7CwHqS/LB b2Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723655525; x=1724260325; 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=CvLg/jdd02raDyPuokVKWkE8Jw8u8gKV/oNxvgJVSos=; b=p5mghPGJxthedqqCkT/KEnSMA2I4ScmTWqQOG8Cs7BsmBaxrsyX7KcL/QhhT4C1xST 6CMAhCc3AU+T1PS7tctBPD8xn/NojFhhAlnlQhqW75SHCpUWCSvBIxgb35cA/CmgwJF7 mVAEY4OuF9tpFaY/shSrB/7KJDVbpJhj7FlK5l77qqS8qhIx70ZSNBrSWzbiQvcZeBGM nUODUJ7OnS7u9RAqCYAVIQEh85lldkR6lV18JqY9DHSCpgQubTga5ThiUK9EbpLXdidv WtGOMbpAC3SHuZmm4U85efIHbQ5J6nMlDpm1mP6Y0D/kKEyOYmiqkIIMcV7zHWfpiOPm nijA== X-Forwarded-Encrypted: i=1; AJvYcCWSrE8HM9el7D/NkG6UcF7gb+IAwI1KXk3oCjMlRZUoVrv3RB3f/P6LEzGfLkypixZdJZ5tvPmeQIuMDXYSlk8VGAup X-Gm-Message-State: AOJu0YyAiIGAi5VZCoMZlaqWzOUbYS054OiGU7ilO6vEJMR0lMzLfOAB sSi1ZHP84+NVS46Phj21OVQAbmj3CFcgLBjSzo1EiqnQ3TRmo41Q7XTpZAz9hqwHqPnDZ8op28f khuw= X-Google-Smtp-Source: AGHT+IHGIxdu9HiDMdLgXFhSMaVLm1Yyxs1pb8uJgHbAk971dPiwaG4MNBvPtBe9hZnJ8+Wx2Z9WhA== X-Received: by 2002:a17:903:2449:b0:1f6:e4ab:a1f4 with SMTP id d9443c01a7336-201d638d83cmr44171455ad.12.1723655525122; Wed, 14 Aug 2024 10:12:05 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::b861]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201cd1c8783sm31813895ad.245.2024.08.14.10.12.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 10:12:04 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Marcelo Tosatti , kvm@vger.kernel.org, Wainer dos Santos Moschetta , Thomas Huth , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich , qemu-s390x@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Richard Henderson , =?utf-8?q?Daniel_P=2E_Ber?= =?utf-8?q?rang=C3=A9?= , Pierrick Bouvier Subject: [PATCH 1/4] meson: hide tsan related warnings Date: Wed, 14 Aug 2024 10:11:49 -0700 Message-Id: <20240814171152.575634-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814171152.575634-1-pierrick.bouvier@linaro.org> References: <20240814171152.575634-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); }) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- meson.build | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c2a050b8443..899660ef020 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 17:11:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 13763747 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 6F3171BBBCD for ; Wed, 14 Aug 2024 17:12:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723655528; cv=none; b=M1Vo6nWx3fuO3asyLUFm2NhZSIRdN6V8jkiMYPh9Bnfov9R1tqgDOFGjCqBYtFpZ/6MuuTkW90ZwK8Po3V8Ql5C4VCuvw7uXpiUYMsTJeem3jeA9QtDqVhL/DDtt3QejO5Zcqvnt1tAbei8Nm6eoCx8gdsOoGIz1PpqZChNx1Ro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723655528; c=relaxed/simple; bh=hT5qG+TrOMm+Kj1E+B54mE+KRv2ZFH0KeUlk/ny15Oo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=pk2cgS/trIApdfMEwr678Y26ZB1iLb+vQIKcHOFdJypJH+US3wB+TdV7CXPd+nNYFfmO8BZth06PEl0P3+5Z6BraIJLEftiWK8tWyXrTML60MVh3vtUsHt6E+Ovs+NWZrQHTQ7UnwsBoUeQeqfdMzTPM0dhKsmRhoA0XdgPjk5E= 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=gNMf/F4P; arc=none smtp.client-ip=209.85.214.180 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="gNMf/F4P" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-201df0b2df4so842475ad.0 for ; Wed, 14 Aug 2024 10:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723655527; x=1724260327; 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=C8jtLk0rS0EhtRCVLy6d5dSWwHGsq2dL7mHB8O5U19E=; b=gNMf/F4Pg57oKYu/y9IlSa3uROlajIBU9eXn6Rdyp/g6LdaqPNjXMKN6KO0c3+8qZW eXu+pGqLIRfNh3eJR3YtNB1oHxZG8DnIQWwOoOUKjrADAm0lDxL/tm+Xh9bV2iNkhioI 6ssLnn4eQzY56NwGl2XSiczhffO2JV54m4TbCTM+6cR0GQbqupuvpHVu7I2A+NvhwoZz 3TZNg6gsVy9RokrDmp6wYfrwvl+u+Fw2u6xVV7cg8aY4mOok9E9aREnF5KSYhSR9nqWZ HtTehZDpDASyOgmW+NDzgvrQ41sPDykN388fshA+JPOyoxk7fcltr32CcPaa67wEF0Nh w9xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723655527; x=1724260327; 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=C8jtLk0rS0EhtRCVLy6d5dSWwHGsq2dL7mHB8O5U19E=; b=XiPeY9WZpD8AUglc/mBXwi6+KnapKwjpqnv+yDbfIQ28P5ublZCImlfR3snienuaeh gapCeDYh09dTa7/yjgeBi1bsENcDt1waXLa7VEia15YfmxKogT9N36/PYD052t6VXkT8 FM67rbvRdqr1Np/1hfFnaH/gRNIgbeGHj3PAtGGPkWmQXbbbdflZD0cPPf/qigIJgboH SvzoxohX+1d5low9kxDbVwtc2+Yq3a/mHJaaubnNexqurUM5mFaHhQetHDRdv6t8qzmK vRmaiIAZcjgg0UZp8Q8Pqt5mdT7kbU+zlq0ujW06OW/1v4RniuCftjKCBjjySkBOmWaZ AlGg== X-Forwarded-Encrypted: i=1; AJvYcCW65EvYQi4EThA0tFh0oEZO6MiCBqpnLBO+cm2GmVB5kodf0uo3r2+rC7gpR5qTD7KKl/EkqrMxIoABqDtP2zN/E8BV X-Gm-Message-State: AOJu0Yy79xxH9uJkh8K+idR28m282ZCjIWNiRE/w3041fqH7OiD5LOUa 66+RfLRv7T/Vs9RE1ff/t1sxnSyqDTqAcjSCQZNqtyicfaEjkRlN+WA2GlJfkow= X-Google-Smtp-Source: AGHT+IERRzizD6WdFAWCfPZg6Om1n+JiPPLwp3B/FbS7ZNeztWagWFiwUGTp5QjIt2c2704zR89fkw== X-Received: by 2002:a17:902:b68b:b0:201:cdfb:2919 with SMTP id d9443c01a7336-201d638d821mr32538115ad.8.1723655526725; Wed, 14 Aug 2024 10:12:06 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::b861]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201cd1c8783sm31813895ad.245.2024.08.14.10.12.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 10:12:06 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Marcelo Tosatti , kvm@vger.kernel.org, Wainer dos Santos Moschetta , Thomas Huth , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich , qemu-s390x@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Richard Henderson , =?utf-8?q?Daniel_P=2E_Ber?= =?utf-8?q?rang=C3=A9?= , Pierrick Bouvier Subject: [PATCH 2/4] target/i386: fix build warning (gcc-12 -fsanitize=thread) Date: Wed, 14 Aug 2024 10:11:50 -0700 Message-Id: <20240814171152.575634-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814171152.575634-1-pierrick.bouvier@linaro.org> References: <20240814171152.575634-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 | } --- 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 17:11:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 13763748 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 7FD3C1BC06C for ; Wed, 14 Aug 2024 17:12:08 +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=1723655529; cv=none; b=lw51Y1wJHxHwx4FagElG5lp3SjP9FRCQb3kB1H635kkdMO7jRdALB/p9DAUsbs+OcmhFUREjwtN6LemUlRcjcNlVkBVmagPJy3RnE/D/5jpWSpudbEwOdG5Kh1J5LjWQ9k4xEEBkUEEEt5LKc38crQ7GRr8o+EL0bW9OI4XH6fY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723655529; c=relaxed/simple; bh=+od6ycfk1qfJFtCux5yak7pCzPljuMC6b0hSdafOhWY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=FknxSZFHprWh5mqFlC8ECc0xcFwPhXgipN9QRUvdRvflK4JqDaKlckMI9mA2uLtU/DyRm3MWglei2hVhla1/51v1K9O/W6H9/3h5SDyntiYlADMEv14uZum53r8vKGvpPt57aKAHJpoyuXuI5+0BQUV8iBW938J9U4/RdwDlU5U= 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=buKTCz2H; 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="buKTCz2H" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1fd70ba6a15so770205ad.0 for ; Wed, 14 Aug 2024 10:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723655528; x=1724260328; 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=d7PkrlYQr/V3YMS3es97SiZgcfp3AW/tKZmcfuYfGEw=; b=buKTCz2HeRfcFlaXlcDCBA61LrMhVw05ABq8g1ZmTSD94dGc6sG3L02RMXUII09Ao8 WIibTC8TvgfdDJHycVA4CFUYnCQrLS46SfJ852Ucp8H63Z7Fc0xMi3r0K6wTdn2Bb4CQ s9dusRsw4YVCOqDD99bUdc64H9KoGOHTm9nOuEroOICfX0GMqoev3JHa5g+eE+V2a2+2 KoDzz0E7JUsc5836InoqiGKUPSJ7epDtf07C5nvPrUKjAq2xZVQWxwVtg7sdNKky/f4n /PwyP/UXFbHUI3bSc/vqdFeaG/mfY+Qje2TjGR+huZB3O7PKMkZEhdWQvGs68T9+mPW9 Q/Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723655528; x=1724260328; 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=d7PkrlYQr/V3YMS3es97SiZgcfp3AW/tKZmcfuYfGEw=; b=gvr6GIagvIxpNQw9VxAt7gi/tsC1Jwne/Dw2dNj74O+UqhtRMsye+WoRzJVxbfk3/g o+0OQF6gJO6u8WOwX5CesL87ciOnqx9+QVFnvQFC/+aaSFJp1VQEY39/AHPFrAKq9SG/ DWOOv6j0IOn35g0gGmmijtGoih0BI9L+WZO3bHCSRPHm7vR2o1N4vTfz4PpeEM7jNDMw 96yBzv2g3RRqwdWbyC1kQevCSgxTBrJkrWzqJE+D3X7nmn/QU+vgcj+xHK5GQ/GsISWI JmQd8jgqBaEkYh6wKEsf6BOUvIkKybpmDrbnG7hxcUhou7MP8Thw9tCjpJSvSAclrL6B r4xQ== X-Forwarded-Encrypted: i=1; AJvYcCW6gKzrl347hwaU5rSVgtNoKvhR0SO/OClYeDkAzT58cix5fHZVALUJwsGJToy1QbkQSHwNAbju9hN5V+JLQFnSBT3S X-Gm-Message-State: AOJu0YwufU9Bw55NHaAxzRYX4AFkyE26kenbKNvx/daLv7JZFV2AqLdb Y58jHsmch/B0Iyvqi599mntZVLie61xP5oGcPRX52IPXEEuJXFoWPB+TkEhKAd0= X-Google-Smtp-Source: AGHT+IH1edYhLET7/RIFW48bFtTCY7hghNR+eEBNjSEPgKc65lUBwapnO/P1culqyBP8m+YCz6d0NQ== X-Received: by 2002:a17:902:d2c4:b0:1fb:7b96:8467 with SMTP id d9443c01a7336-201d651f85emr34242465ad.63.1723655527854; Wed, 14 Aug 2024 10:12:07 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::b861]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201cd1c8783sm31813895ad.245.2024.08.14.10.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 10:12:07 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Marcelo Tosatti , kvm@vger.kernel.org, Wainer dos Santos Moschetta , Thomas Huth , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich , qemu-s390x@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Richard Henderson , =?utf-8?q?Daniel_P=2E_Ber?= =?utf-8?q?rang=C3=A9?= , Pierrick Bouvier Subject: [PATCH 3/4] target/s390x: fix build warning (gcc-12 -fsanitize=thread) Date: Wed, 14 Aug 2024 10:11:51 -0700 Message-Id: <20240814171152.575634-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814171152.575634-1-pierrick.bouvier@linaro.org> References: <20240814171152.575634-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 | } --- 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 17:11:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 13763749 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 BF4951BBBDB for ; Wed, 14 Aug 2024 17:12:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723655531; cv=none; b=l3+YRFenDdIZRvZAPZ6xILMa/a0e6ZQwFe8fX9UxjH34m/uSI3ZbFjjITUNOvd4udNv5bOqPiqVCsj1dVadmUAWauEiXK0kdCAR74tXRfTsPH+tmwaZmDZX8xlckVMniUT8aXWD+cO93WRbsvDJeQlSHsW8Wh0/0ILA6EVbf1Pw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723655531; c=relaxed/simple; bh=Xy/vYvbIia42LSGQ8AdmhRp7Ex9zDATHON2Ep8y2hqA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ddyYMP/ZrZGtZUao28BTsi00Rh+BKyfj9LCVbS5fZ0ak0sIsiiQfdVNWR43y4xjsPJ29V7rRMbpROU/FINS/LRLp0pNOJT20DjuJX/ckX1U8NQ84u8ikSnD8o2wDpcLb6vJAsZPO+J5yKjpHNsX9JCx3nLJ6ahKRkyUIN8Btm7I= 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=RbPXRaxP; arc=none smtp.client-ip=209.85.214.182 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="RbPXRaxP" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1fc60c3ead4so885005ad.0 for ; Wed, 14 Aug 2024 10:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723655529; x=1724260329; 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=cUn79WU14zqlH0c8ZH40FfQUSvZAWtp5MDwWi4t6xwQ=; b=RbPXRaxPW1W6JdcZxhrtDztvwfAsLb3ih+nZR3xY0vl5HycaU3lUjXZjtUbRwiCgdm OA6zodjGQOIR1U715RETEIvLg50UHObYfUQUI0pzh/asG364NVVYMH9YOHqAUN/ZdmxQ rCyRwsMqYDxYbCQWO7bFQ76Q36II8n9+nCm8iWWHngtdClR1y5thvbZzHn4C04LoHUX9 UQsjMN8C1ExxI4QvQV68wrG3oEnmcVXJJh/d28sGHOPTbU+Mk6pZJTwwiIAyPYFXGUwp 9QRdlnfiYLMGncBtyXMEgjoc4eLZYOmvILjRn9Mvt27fTtLmQk6UHghekO8/LLnSvSoH 2Ttw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723655529; x=1724260329; 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=cUn79WU14zqlH0c8ZH40FfQUSvZAWtp5MDwWi4t6xwQ=; b=rJ6nvhKfA1pyvJejetJE6yPOgFlVyYoUiFjShNIuzQN6tVuPWSmPYW7iBrCuTo01YV bavWUCeJ3gbW0g3GYsQd3toDEL2yj0ORInhjxDaDr7w/tQYX3xJjpIPIuC8+ieL8/vRB UST6oOcE3BDe6qkxvc12i51ElkI0dUFTwXn6QWEtImjTXU9wv7t9B9xymhmwpS3NriZq 2NQ7UhItIdgCrQohf1HJpuC+x8NsIMk2/VEUepUwDSUYCaFraZdeUON/QiFXc5D/L662 8y/x45oCHlCLbJNmiyvCHndHFatCxQAze+5MNBmS5QachciFsyEerS3yYuCXjfCi5Tfc Z6aw== X-Forwarded-Encrypted: i=1; AJvYcCUgSRT0SYOsEZEEQ5dZWl83ksh89dRIu3snTxfPFphHGUg8uIafIj5f82qSf1M7gi2b7VkNsWlSha5l/EsIVBui0F6i X-Gm-Message-State: AOJu0YwYUsVVPfdxGc5l5iF+D3lzamiM8zlaSMYFXLde/qRzTEmog8tz 2cdSAR/Tv8p7H2rAiXon430lX29SO1MihSmq7GCz6uJPePhTy2bEyIx6GBF1AjI= X-Google-Smtp-Source: AGHT+IF+qUN2vveY66Ij/WyYMf+GIVFkloNhj3V93djFOJp9OQYrH4QfFyL2zD6FZH+F77yZjz45FQ== X-Received: by 2002:a17:903:11c8:b0:1ff:49c:1562 with SMTP id d9443c01a7336-201d64d8afcmr37992915ad.56.1723655528927; Wed, 14 Aug 2024 10:12:08 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::b861]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201cd1c8783sm31813895ad.245.2024.08.14.10.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 10:12:08 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Marcelo Tosatti , kvm@vger.kernel.org, Wainer dos Santos Moschetta , Thomas Huth , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich , qemu-s390x@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Beraldo Leal , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Richard Henderson , =?utf-8?q?Daniel_P=2E_Ber?= =?utf-8?q?rang=C3=A9?= , Pierrick Bouvier Subject: [PATCH 4/4] docs/devel: update tsan build documentation Date: Wed, 14 Aug 2024 10:11:52 -0700 Message-Id: <20240814171152.575634-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814171152.575634-1-pierrick.bouvier@linaro.org> References: <20240814171152.575634-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. --- 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.