From patchwork Tue Jun 16 12:53:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188025 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3623132ilo; Tue, 16 Jun 2020 05:55:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwttlh2AECbzEgWf6J6aED9gGSZRcVuejDYRtR0j9v9JdEP9PbXKz8uYL6IuC7QnRKcwWvn X-Received: by 2002:a25:c606:: with SMTP id k6mr3781521ybf.10.1592312154125; Tue, 16 Jun 2020 05:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312154; cv=none; d=google.com; s=arc-20160816; b=VM6Q2HQ54iMsR2cPgkMTv+qsjRxHTLhUsquUmFkAyCuD7trJJ1aS2ggqpMJqE8Qg/V Zth31RyTWEqX/FIudwv+uJzC7aKGzSDhoWaQlpteVMWy4FYeFiBKqV2HKIjfTkTXInpM WVEwSMkbt4LibIPJeAxxxT24AsbSIglv4Fnprv7kfR03FTpyB799EIU33iuzBrwnbkam 59Ho22wooelh54cAhqKa/dshlp+zywidVWhSNjZ8x6LSnEXz8D0q9SphRnYv4u2ZEBKp CK50JdcsxBfm1V2sZ1tHdXADlyTfevDDho5a4NM6HJz2haOmiTpfXF7EtpCYixW2/4JP 55vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=tgJUqLwLoRtLSvW9q3TioA1yOeOJ7FhmCuMS43Wyg4s=; b=x+K1jvcsuBhWdfzJGJ5+TShA1Nr4h/DSJiOcRy+vu/3cW4PTLOt9izo3+Q5UFzpjPF s79IW+uGPzxl6SbLyfJZBjNd4AVfPLFc7+raNGgKUhejoszkEZI8ddC3tIC0BUBO8paz XVZH3/2ne4Beaio2qk5EY9+bMpQx65oW9NFzcMY35h1SGPr+EtU9uC5T6Pl22fHy3aYC giELG5LgtSWajNAmiSxO8nzsVJnOVfJs9lNSmApLQXdSM3wSb3gol8mEgrLBAgQQTDQK EugEzyBVNpl6va+3RYZYmmuqPphNp8rkBeEnP5SD4xMmKWT9Zzz5ex4HhIsERtH7+I3J j8cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EnPQ4J2+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p127si16826130ybc.191.2020.06.16.05.55.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 05:55:54 -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=fail header.i=@linaro.org header.s=google header.b=EnPQ4J2+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlB85-00074D-JL for patch@linaro.org; Tue, 16 Jun 2020 08:55:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB5q-0003hb-FA for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:34 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:43224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5n-00005K-Gc for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:34 -0400 Received: by mail-wr1-x434.google.com with SMTP id l10so20620758wrr.10 for ; Tue, 16 Jun 2020 05:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tgJUqLwLoRtLSvW9q3TioA1yOeOJ7FhmCuMS43Wyg4s=; b=EnPQ4J2+lnyyvNj1f+14SsQ0f/ityTfa4vJzMCYOgTjEhVZ7/8RGJ5+Px/sDYjfAU9 srZv2mmQgci15AP1YNuy6YZ6gRgk6N0eOunMS5NmzBWXK5HC3EgNJNCbatQHxybXWubt 5nalAoNfFQj2FJcnLs3CX2PHXEb3uVxdmhS9GDrlfTbKnNyFVXyzn+RFz5lRxNfGwnzr Y67Z8KUxR4IQ3Q9GbGQDZaV3a5Mjyw/dYi96viEaGWQIN/TAvYRqHwyzH2CP6/T82nH4 X9n6zNrqRaZzGV1B2cOnBuTtiqEUmr11sPIviPgFRbjoYPO6RYnM6breXp8RZxlqpvNF 3ioA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tgJUqLwLoRtLSvW9q3TioA1yOeOJ7FhmCuMS43Wyg4s=; b=JBPB/ESaNEAOl5iYhfbbM+m90juqJchfqLt9Wd6aHijK6HQ6ezzC84O9vH1ZOHZm5/ Yk48FNa1kZ04mH3pY1nn4ysnlPPPJ8MtYpookTH77An5rxvyhiujcKWxHtlM3PdaHl8/ E+YtiHHu/EHBHOI4T54m4zkOiSUE2tnZ0dkaORdeBmrDY8nAgOt1hTxUCmu9v2Q82X5I o24KKH4RRDykpvBl9GrZj1P6w/FEc1YBJdAgOpm2saakm6gmUMQbwNZa5yz6YYdWkd2U ADwJQgLO0OsNsh6S3bIfMe2wnC+xWLVYgn9ILq/aC+vk6j8ke1CSiA+FdE6GSaTwx9NG cgGQ== X-Gm-Message-State: AOAM531H2hhJ8wC0IMDzis6fttRfnbOrYisYzM9znd+e0DEz5c9uV8w5 Z8mlkmoEIffDqDepg79Q6Gw2cA== X-Received: by 2002:a5d:4f0d:: with SMTP id c13mr3096823wru.357.1592312007082; Tue, 16 Jun 2020 05:53:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z206sm3833256wmg.30.2020.06.16.05.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5C8C11FF87; Tue, 16 Jun 2020 13:53:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 01/21] tests/docker: bump fedora to 32 Date: Tue, 16 Jun 2020 13:53:04 +0100 Message-Id: <20200616125324.19045-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We should be keeping this up to date as Fedora goes out of support quite quickly. Signed-off-by: Alex Bennée Message-Id: <20200612190237.30436-2-alex.bennee@linaro.org> -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index 92b6e11c8a8..798ddd2c3e0 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -1,4 +1,4 @@ -FROM fedora:30 +FROM fedora:32 # Please keep this list sorted alphabetically ENV PACKAGES \ From patchwork Tue Jun 16 12:53:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188028 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3624338ilo; Tue, 16 Jun 2020 05:57:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+M+zanct4XvQldpDDd4I1SzfAlnOxnkvbTC01+1q73XQO0dcHRi2fQQwR86fFg+/l+PMW X-Received: by 2002:a25:60c5:: with SMTP id u188mr3849808ybb.268.1592312263503; Tue, 16 Jun 2020 05:57:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312263; cv=none; d=google.com; s=arc-20160816; b=htqNBGtacuX8X86KAA8LSPmLyAe31s89Zee4s1ZexxJHGc6lQKeW9HTHfaBlsKha2V sDml61D1t8PLa5Zn0jzfsuUoBKVITKLOzW+aei8P/TTsTYN9F0dMwKW4YdzkrNAuuuK/ 9+oEL88JX2M3nI9U0+8GufFaZuSpD2sifTh3D0w69eTTiA2wrD9z7ex0OwFX4pCczkIR Q2UO/zl1em7lRUgq47o2GRm9FJQWtZQM66iqaoOhGaw7r88RwM3XlvQJq0yG5hgVJt7l uyx9c8avT88oemR3q3dY2gbG8vifYie76J7jdbIAofDtQ9U+UKf9CUTgK2QjpLNJGds4 O+Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=3KvyAfRcofuRLNj4oNNcFUoLgTecr2giSski/lyf7H4=; b=tlO7GuuSzb7NTWrIv5KcC84+W3uqrsWVkvj2lQzau7QaTUWlbplK8gEEn3NKCe1alz t1RfttO2cvv4sskI7yckDvrp7QXa0KKvc0P8seAhEtmjPrlbN2NpvMStMaHQUF9Uz9aR VYh2PWUEkdv5g9xb/geOQRSQfgib+Gc2+D4lH6n8UAyXeeofOslyisDcJ5X1hzAotUfV TP+fvoBDB7LHlKpjbJz3qmITee0pD8hsmyYbuFlkjyvEwH1bx+KBzmUvurGQxD+YDotL E0I44wufvU+BsvXgFJeGG4AGEA47Hd5te0ao4OvP7s4eKxyR7MqB0gAjKvWz8/Jlrd1e IejQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=W1M6nEko; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a5si15837661ybg.97.2020.06.16.05.57.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 05:57: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=fail header.i=@linaro.org header.s=google header.b=W1M6nEko; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlB9q-0002MT-UV for patch@linaro.org; Tue, 16 Jun 2020 08:57:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB5q-0003iQ-T7 for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:34 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:43215) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5n-00005P-Gc for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:34 -0400 Received: by mail-wr1-x42a.google.com with SMTP id l10so20620815wrr.10 for ; Tue, 16 Jun 2020 05:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3KvyAfRcofuRLNj4oNNcFUoLgTecr2giSski/lyf7H4=; b=W1M6nEkohGCl+xddylcn+tl9y4BEJHcjxXoa0yR20DlLrb5Q1YzHKThse8T2QvbXgM dCxmbJqpDAKOru58olIg1cRlow6Bf/Kt4Jdb/90DkAN5XGvQ+UrsUt5CTy9hPaGbcgoJ A7KsuYeyPy4mrFJxMroM5Bp1XhspWaKu9Xz5iXWfRF9C13dH4nBIuqSdZjBrhJsgHC9y AypSo75qxWJE042//oc5L7U8cq34WVm/vM6kE27S8Y58VqVfomsD3TxkbJFGOHXYFkeZ HyYah1QT+XzLjlfGLELBwUxNNL3c5vREcTbDKtfZjtNjVKrz/qJc8heiwrZq7bKNKWmY /0Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3KvyAfRcofuRLNj4oNNcFUoLgTecr2giSski/lyf7H4=; b=K0V6/aAE/vzbzI3MBFFqt5SY6u4fz5xlqcZdR1MVZkOgMTrc8gZYWYTG/hT98m3EAK ChIf7Bt+8hbiHrw4DJCUMm6u9QTKkdohITNreBzBSx4H0yKBQ/gAPBkpY7NFB7cHxyhx kGNndjsw3QQY6YA3PkPnNNtfTRsuXQ8foswjiEmdOSAhOSirLBKFVfB8qZCXwvfLup55 JrUTxOIcKlPVsbYTBMl/tr9c06Ksq5uxlUYob08gO1G9ZdFRHE31KCXUQxItvHQkm7vz uCKShN1OQsk2r/BdwwBV6kqRgCkAR53BBhBvshsO/pAX8kZ2GWG6Tr4jlZmx258L1JKD 2wYg== X-Gm-Message-State: AOAM530yk2UeynfsSeavtaSsp2eYbyb+lhrCmbjiOYYUKPsex0zlldiV R5tuh/YXTU0M9dRbH6AKPp5fEw== X-Received: by 2002:adf:ed51:: with SMTP id u17mr2735068wro.285.1592312008273; Tue, 16 Jun 2020 05:53:28 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p16sm31603816wru.27.2020.06.16.05.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 75A7E1FF8C; Tue, 16 Jun 2020 13:53:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 02/21] Makefile: dtc: update, build the libfdt target Date: Tue, 16 Jun 2020 13:53:05 +0100 Message-Id: <20200616125324.19045-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana dtc submodule update, now call the libfdt target from the new dtc Makefile, which has been changed to not require bison, flex, etc. This removes warnings during the build. scripts/ symlink and tests directory creation are not necessary, and neither is calling the clean rule explicitly. Signed-off-by: Claudio Fontana Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20200518160319.18861-2-cfontana@suse.de> Message-Id: <20200612190237.30436-3-alex.bennee@linaro.org> -- 2.20.1 diff --git a/configure b/configure index 89867a17208..8a9f544b0b7 100755 --- a/configure +++ b/configure @@ -4312,7 +4312,6 @@ EOF mkdir -p dtc if [ "$pwd_is_source_path" != "y" ] ; then symlink "$source_path/dtc/Makefile" "dtc/Makefile" - symlink "$source_path/dtc/scripts" "dtc/scripts" fi fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt" fdt_ldflags="-L\$(BUILD_DIR)/dtc/libfdt" diff --git a/Makefile b/Makefile index ed0ed93b2d6..895410fbf9c 100644 --- a/Makefile +++ b/Makefile @@ -526,13 +526,14 @@ $(SOFTMMU_FUZZ_RULES): $(edk2-decompressed) $(TARGET_DIRS_RULES): $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),) -DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt +# LIBFDT_lib="": avoid breaking existing trees with objects requiring -fPIC +DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_lib="" DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS) -DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt +DTC_CPPFLAGS=-I$(SRC_PATH)/dtc/libfdt .PHONY: dtc/all -dtc/all: .git-submodule-status dtc/libfdt dtc/tests - $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,) +dtc/all: .git-submodule-status dtc/libfdt + $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt,) dtc/%: .git-submodule-status @mkdir -p $@ @@ -820,7 +821,6 @@ distclean: clean rm -rf $$d || exit 1 ; \ done rm -Rf .sdk - if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi KEYMAPS=da en-gb et fr fr-ch is lt no pt-br sv \ ar de en-us fi fr-be hr it lv nl pl ru th \ diff --git a/dtc b/dtc index 88f18909db7..85e5d839847 160000 --- a/dtc +++ b/dtc @@ -1 +1 @@ -Subproject commit 88f18909db731a627456f26d779445f84e449536 +Subproject commit 85e5d839847af54efab170f2b1331b2a6421e647 From patchwork Tue Jun 16 12:53:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188020 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3622310ilo; Tue, 16 Jun 2020 05:54:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsTd5KSHDRgzkFYekqrAW61Qzn1lk1809BMsBi2FcmDYdA8FRUS/Xfu8I2KNvKhHZ4pUZH X-Received: by 2002:a5b:9c1:: with SMTP id y1mr3557658ybq.62.1592312067860; Tue, 16 Jun 2020 05:54:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312067; cv=none; d=google.com; s=arc-20160816; b=EnsQovcCcmZ8x5zTHqh3TitYj4Pj4WY1uE/Uy43PXx9J/Jl7jW+n9KFfoWoh7DQwKr rAon+0IY45rlmNyWoGYX8b3mBCkNPmCa3mNbdexRYFGJ3sZrLT2lSHVXpGjeEv1dFE7U Ohe8n8iMQ5g3Z/cZSMxbKHUoNc1l65ydSAXTLc6SeRRxo8dk/sVCZsiQK3377P/R7ZBx 32m9CezgXCf/yWw5QtQM5O8/tga5t8B/OW8tkSecET3SWOTwxOv+s3Eurak1D30KuE/+ CHhl6FBfTidDe5JMkd/IBM/ay1sLK/ynLwvir3trQUwr+ZK4zVQd5w7Os6VK3cepWzzK zMBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=yu7So6FOt3zgC+swdRyT2svHaq8QqhchApYzxWsdT8M=; b=lxwadaBIhADClZzQ+WkVRnzshF3Ta05tN1DvwqeWEbaQQWCo21lrhm2+m3qqGidejI 9YF+qvC9Xh249b+0DW62hLjjuh2vGEOm/kW1s0LPfgtLIMqYZOUrj2QtewtOGnY7DS98 kvn00K3GkSNBgCjJI0KqdDuZwxWpMWmRj3bkkEPE19Erkc1tRJG395d3PEQOnt1suK8P PujhXwbHJL7gbr+B/aCPIGXb7RzAbdJBzOOEnk/u5ih4WVSkXti9t96l/mDRGLYjfZHS hbH8kdQOEC0u9PyQCdXpivX9zgwqgpn0PCKiT3UmLH7NWBJ/ZWNdhRSYWVZag0Klq7Ay fnwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wcLnPqJB; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6si16507703ybu.119.2020.06.16.05.54.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 05:54:27 -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=fail header.i=@linaro.org header.s=google header.b=wcLnPqJB; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlB6h-0003hX-9m for patch@linaro.org; Tue, 16 Jun 2020 08:54:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB5p-0003hK-Ab for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:33 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:55099) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5n-00005Z-Gg for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:32 -0400 Received: by mail-wm1-x334.google.com with SMTP id g10so2765023wmh.4 for ; Tue, 16 Jun 2020 05:53:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yu7So6FOt3zgC+swdRyT2svHaq8QqhchApYzxWsdT8M=; b=wcLnPqJB4I64Ln13dgD4TtZnO32YG0nVQe4f8OUei2MwjSWiyl2FMPUa/vWJU2G+81 WTEAoWL4hJNAQKm9WWjbEzpPTZUXA+5qpjcTvcY1dg4BaL7oUSWmmobBSTLOVOMuhKjo VlKhhdtsCQzp2QnUoRUr+A978gbg66arA/frEJSMBcImLoxvEI6iFpptkFW3jrB94LQ2 1vEiET1i/j2rOwk0EvbJTM26SzRgbw68jT+AuJJfTuQPmMbmtAVypsp6voL2RZMOEYg6 D/oLbaQtATYd0XCEgfhHPQ8Jbx7VSJkL/lugTwWVbzYe+OYae8SY3YNIYQGViXElr15z gAAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yu7So6FOt3zgC+swdRyT2svHaq8QqhchApYzxWsdT8M=; b=rb+ST5s5CurQ9XZr/0TBVSayGT7HifV90jJb2BhjPFXQc3Hy3OJ04lDbeFNrloUrOI rKlDagFox0H49XAVw+OsTgc7DeCgd9bg7KGT35SSFnzZ+4qR7rGufVI20SgHDsVg5zJa Vnrig4aNYqwnwi4lttHYDOVER8aJ97nd8iBkPB819de5UY1e1Lk/hmjbV7kNn2aUCEi9 f3Q7IkeatY+Ud/TD6IkM0sxlnsNR7jaa5HdqHYyH0XfssBiOBmHhAO+jj9gBXw6bwxHT 1zacErtQ4gPw52t306ZmQu1lvLGG6S4zo6GC2jqBZ8OWIx4qrOEeWM3WrDybO47Ix9ia F+7Q== X-Gm-Message-State: AOAM532av4NxL/xpxEj1w9brlCweUk7Bo0XDJ6sHyYEkMIop6CoKJPze UBH5s3Cm1lN/fRTSTnH7JmPR4Q== X-Received: by 2002:a1c:4d11:: with SMTP id o17mr2996924wmh.37.1592312009551; Tue, 16 Jun 2020 05:53:29 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j4sm4193024wma.7.2020.06.16.05.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:27 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8C62B1FF8F; Tue, 16 Jun 2020 13:53:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 03/21] Makefile: remove old compatibility gunks Date: Tue, 16 Jun 2020 13:53:06 +0100 Message-Id: <20200616125324.19045-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org, Claudio Fontana Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana Signed-off-by: Claudio Fontana Reviewed-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20200518160319.18861-3-cfontana@suse.de> Message-Id: <20200612190237.30436-4-alex.bennee@linaro.org> -- 2.20.1 diff --git a/Makefile b/Makefile index 895410fbf9c..48f23aa9786 100644 --- a/Makefile +++ b/Makefile @@ -562,12 +562,6 @@ slirp/all: .git-submodule-status CC="$(CC)" AR="$(AR)" LD="$(LD)" RANLIB="$(RANLIB)" \ CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)") -# Compatibility gunk to keep make working across the rename of targets -# for recursion, to be removed some time after 4.1. -subdir-dtc: dtc/all -subdir-capstone: capstone/all -subdir-slirp: slirp/all - $(filter %/all, $(TARGET_DIRS_RULES)): libqemuutil.a $(common-obj-y) \ $(qom-obj-y) From patchwork Tue Jun 16 12:53:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188022 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3622352ilo; Tue, 16 Jun 2020 05:54:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtTZWEkebbwDQg4zkLqjPoxOYmEfCFF0mK1LA7iueQ/9PVd2y+sxUq+FVmDDoeT3bS00c/ X-Received: by 2002:a25:b98e:: with SMTP id r14mr4120168ybg.20.1592312073344; Tue, 16 Jun 2020 05:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312073; cv=none; d=google.com; s=arc-20160816; b=oQgnD3XJDHNwKkTLP0Cu4g12HW19OMws/bzRkn35Xke+UdT5vRhkWgkbCYePwqLKo3 ISOYuisyPAOvnaYfouxogv8JrabQWuj2HW2I/G/c2yC8yWHWFcI42T3GeFg/cKvhz34q yqNPlDkyPzkNuTI2Z7oSucfV20dzRHTSV+gH7FMBI4rUdg7uo2JlOu/ncTmdWxNNU10u O3/sTzgvUGnFS+fq1Jl0R/pX5Ta4YzPgDFa5QEPA6isCeMGak1tid0vt1fP6bmUtbkwC CAYgbBOuQOZQCG4faLAliUj8yfFiJEJSDcVQqmS1bziSrA//0CldBfwnPLGLMYJbECxk MMXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=sGemBWBm0fmeh7RoAKYkj/g+ANckYM+dEWn/3fEQMoQ=; b=lHSOkSA3ORSnP5vxN6oX5O/rvbCls8lHHoweEtT/oo8lqBxdu7ik3wAFXWZPoyib8t DnbpkwTDrgHILglW9osy3WK4DoWcbzU8LjIszVVBvKxFAHHE26gwbpdm4+YMFWsCIjpy 28akFVqfKswXyxdFWdfNh/0i4eLi21uliXWFVQ65P96cHFr15UptWdG99rqhF9oaxnLa uJ4ROzkTZDz9KRDK30D6Br/IIxqtIur7FXmj8ZW4ISqbMhPFnZ4nzNKlX6/Dj0X1aeIj paeC1AkMJ3xZN4NPi22sdIrkoBQRimqlmQsnmu04sgz/YcjVSp7xCwmlA+csCbfJKqEh v7lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FcKuDdtU; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q12si15561417ybk.171.2020.06.16.05.54.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 05:54:33 -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=fail header.i=@linaro.org header.s=google header.b=FcKuDdtU; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlB6m-0003qZ-OO for patch@linaro.org; Tue, 16 Jun 2020 08:54:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB5t-0003mW-10 for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:37 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:35114) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5p-00005n-HY for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:36 -0400 Received: by mail-wr1-x435.google.com with SMTP id x14so20663712wrp.2 for ; Tue, 16 Jun 2020 05:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sGemBWBm0fmeh7RoAKYkj/g+ANckYM+dEWn/3fEQMoQ=; b=FcKuDdtUG21wDcXYkdvQ/6KjeDYpifphMhtGCI2Kpn8mN8Kp2j2IPsLhCfP6Opfzoh lqXlqewUxUMrF54LyBRfjsZu6SqpinVQr/qHZEztyCf7dqo5JAb6JuYzAn3W+ITfHIfK cNpEZy8BlU/h2ZZpzccQkdWoW1QD5JgYjfYRg2ExBS1pNDnrVnsDQGcemD7Trhlz3C6i reKHkN17Ij0JfJeW3cchtBLI99/BrxnFkw3sFKwrN06lUs4PXcOHo9bjbmXDKdt9ZYb8 LKC+ax2+GFOQAby9dUPJfzNd8SYrzfOLeCiga5UN1dsgZ0NdeI37TRxa3SB9EqjAW66a NYxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sGemBWBm0fmeh7RoAKYkj/g+ANckYM+dEWn/3fEQMoQ=; b=ZKp5lf0UXie/ctF0X+zccpuKWvgrLWI4H/ihlByi/n4sXAfT7h+YnXbFiZybDxXiFc noUxqwCRgy1RLTh/9r7pPfiomUCkh94MQftwyPfMlyxXRTcNOO/q9dLSoS4feAaFtrQw VZDQGY4srG621W6OlAX6k1ySXfUCd3njwpgSfzVQuss89k0V3NWvFUDI80CKfflW87PD vB0FFzjqCEKP3nB0MCh5DpHHK7mv8B45YOk3VdU0rkHmrMKnLXWkCBXKfhNlASD67ONl TaWTiRPDbxtuckVyEAJZZuGT/bWHoMyOw1qVs4+E3D3zt8s/ynor+Z2pALo/QSsJ0FnH vy5g== X-Gm-Message-State: AOAM533Eyl/zTI6E/RVBu0RkodERxle2JqMmBf1WkwMvrm33jxyJAVQB wSpfWchyGXsCpwYScE94do2glA== X-Received: by 2002:adf:9304:: with SMTP id 4mr3073914wro.280.1592312012004; Tue, 16 Jun 2020 05:53:32 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f185sm4001403wmf.43.2020.06.16.05.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A5E391FF90; Tue, 16 Jun 2020 13:53:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 04/21] configure: add --enable-tsan flag + fiber annotations for coroutine-ucontext Date: Tue, 16 Jun 2020 13:53:07 +0100 Message-Id: <20200616125324.19045-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Robert Foley , qemu-devel@nongnu.org, "Emilio G . Cota" , Stefan Hajnoczi , Lingfeng Yang , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Lingfeng Yang We tried running QEMU under tsan in 2016, but tsan's lack of support for longjmp-based fibers was a blocker: https://groups.google.com/forum/#!topic/thread-sanitizer/se0YuzfWazw Fortunately, thread sanitizer gained fiber support in early 2019: https://reviews.llvm.org/D54889 This patch brings tsan support upstream by importing the patch that annotated QEMU's coroutines as tsan fibers in Android's QEMU fork: https://android-review.googlesource.com/c/platform/external/qemu/+/844675 Tested with '--enable-tsan --cc=clang-9 --cxx=clang++-9 --disable-werror' configure flags. Signed-off-by: Lingfeng Yang Signed-off-by: Emilio G. Cota [cota: minor modifications + configure changes] Signed-off-by: Robert Foley [RF: configure changes, coroutine fix + minor modifications] Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-2-robert.foley@linaro.org> Message-Id: <20200612190237.30436-5-alex.bennee@linaro.org> -- 2.20.1 diff --git a/configure b/configure index 8a9f544b0b7..b01b5e3bed0 100755 --- a/configure +++ b/configure @@ -395,6 +395,7 @@ gprof="no" debug_tcg="no" debug="no" sanitizers="no" +tsan="no" fortify_source="" strip_opt="yes" tcg_interpreter="no" @@ -1152,6 +1153,10 @@ for opt do ;; --disable-sanitizers) sanitizers="no" ;; + --enable-tsan) tsan="yes" + ;; + --disable-tsan) tsan="no" + ;; --enable-sparse) sparse="yes" ;; --disable-sparse) sparse="no" @@ -1764,6 +1769,7 @@ Advanced options (experts only): --with-pkgversion=VERS use specified string as sub-version of the package --enable-debug enable common debug build options --enable-sanitizers enable default sanitizers + --enable-tsan enable thread sanitizer --disable-strip disable stripping binaries --disable-werror disable compilation abort on warning --disable-stack-protector disable compiler-provided stack protection @@ -6220,6 +6226,30 @@ if test "$fuzzing" = "yes" ; then fi fi +# Thread sanitizer is, for now, much noisier than the other sanitizers; +# keep it separate until that is not the case. +if test "$tsan" = "yes" && test "$sanitizers" = "yes"; then + error_exit "TSAN is not supported with other sanitiziers." +fi +have_tsan=no +have_tsan_iface_fiber=no +if test "$tsan" = "yes" ; then + write_c_skeleton + if compile_prog "$CPU_CFLAGS -Werror -fsanitize=thread" "" ; then + have_tsan=yes + fi + cat > $TMPC << EOF +#include +int main(void) { + __tsan_create_fiber(0); + return 0; +} +EOF + if compile_prog "$CPU_CFLAGS -Werror -fsanitize=thread" "" ; then + have_tsan_iface_fiber=yes + fi +fi + ########################################## # check for libpmem @@ -6377,6 +6407,16 @@ if test "$have_asan" = "yes"; then "Without code annotation, the report may be inferior." fi fi +if test "$have_tsan" = "yes" ; then + if test "$have_tsan_iface_fiber" = "yes" ; then + QEMU_CFLAGS="-fsanitize=thread $QEMU_CFLAGS" + QEMU_LDFLAGS="-fsanitize=thread $QEMU_LDFLAGS" + else + error_exit "Cannot enable TSAN due to missing fiber annotation interface." + fi +elif test "$tsan" = "yes" ; then + error_exit "Cannot enable TSAN due to missing sanitize thread interface." +fi if test "$have_ubsan" = "yes"; then QEMU_CFLAGS="-fsanitize=undefined $QEMU_CFLAGS" QEMU_LDFLAGS="-fsanitize=undefined $QEMU_LDFLAGS" @@ -6412,7 +6452,8 @@ if test "$werror" = "yes"; then QEMU_CFLAGS="-Werror $QEMU_CFLAGS" fi -if test "$solaris" = "no" ; then +# Exclude --warn-common with TSan to suppress warnings from the TSan libraries. +if test "$solaris" = "no" && test "$tsan" = "no"; then if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then QEMU_LDFLAGS="-Wl,--warn-common $QEMU_LDFLAGS" fi @@ -7476,6 +7517,10 @@ if test "$have_asan_iface_fiber" = "yes" ; then echo "CONFIG_ASAN_IFACE_FIBER=y" >> $config_host_mak fi +if test "$have_tsan" = "yes" && test "$have_tsan_iface_fiber" = "yes" ; then + echo "CONFIG_TSAN=y" >> $config_host_mak +fi + if test "$has_environ" = "yes" ; then echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak fi diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c index bd593e61bc0..613f4c118e4 100644 --- a/util/coroutine-ucontext.c +++ b/util/coroutine-ucontext.c @@ -37,12 +37,19 @@ #endif #endif +#ifdef CONFIG_TSAN +#include +#endif + typedef struct { Coroutine base; void *stack; size_t stack_size; sigjmp_buf env; + void *tsan_co_fiber; + void *tsan_caller_fiber; + #ifdef CONFIG_VALGRIND_H unsigned int valgrind_stack_id; #endif @@ -65,7 +72,18 @@ union cc_arg { int i[2]; }; -static void finish_switch_fiber(void *fake_stack_save) +/* QEMU_ALWAYS_INLINE only does so if __OPTIMIZE__, so we cannot use it. */ +static inline __attribute__((always_inline)) +void on_new_fiber(CoroutineUContext *co) +{ +#ifdef CONFIG_TSAN + co->tsan_co_fiber = __tsan_create_fiber(0); /* flags: sync on switch */ + co->tsan_caller_fiber = __tsan_get_current_fiber(); +#endif +} + +static inline __attribute__((always_inline)) +void finish_switch_fiber(void *fake_stack_save) { #ifdef CONFIG_ASAN const void *bottom_old; @@ -78,13 +96,30 @@ static void finish_switch_fiber(void *fake_stack_save) leader.stack_size = size_old; } #endif +#ifdef CONFIG_TSAN + if (fake_stack_save) { + __tsan_release(fake_stack_save); + __tsan_switch_to_fiber(fake_stack_save, 0); /* 0=synchronize */ + } +#endif } -static void start_switch_fiber(void **fake_stack_save, - const void *bottom, size_t size) +static inline __attribute__((always_inline)) void start_switch_fiber( + CoroutineAction action, void **fake_stack_save, + const void *bottom, size_t size, void *new_fiber) { #ifdef CONFIG_ASAN - __sanitizer_start_switch_fiber(fake_stack_save, bottom, size); + __sanitizer_start_switch_fiber( + action == COROUTINE_TERMINATE ? NULL : fake_stack_save, + bottom, size); +#endif +#ifdef CONFIG_TSAN + void *curr_fiber = + __tsan_get_current_fiber(); + __tsan_acquire(curr_fiber); + + *fake_stack_save = curr_fiber; + __tsan_switch_to_fiber(new_fiber, 0); /* 0=synchronize */ #endif } @@ -104,8 +139,12 @@ static void coroutine_trampoline(int i0, int i1) /* Initialize longjmp environment and switch back the caller */ if (!sigsetjmp(self->env, 0)) { - start_switch_fiber(&fake_stack_save, - leader.stack, leader.stack_size); + start_switch_fiber( + COROUTINE_YIELD, + &fake_stack_save, + leader.stack, + leader.stack_size, + self->tsan_caller_fiber); siglongjmp(*(sigjmp_buf *)co->entry_arg, 1); } @@ -154,12 +193,16 @@ Coroutine *qemu_coroutine_new(void) arg.p = co; + on_new_fiber(co); makecontext(&uc, (void (*)(void))coroutine_trampoline, 2, arg.i[0], arg.i[1]); /* swapcontext() in, siglongjmp() back out */ if (!sigsetjmp(old_env, 0)) { - start_switch_fiber(&fake_stack_save, co->stack, co->stack_size); + start_switch_fiber( + COROUTINE_YIELD, + &fake_stack_save, + co->stack, co->stack_size, co->tsan_co_fiber); swapcontext(&old_uc, &uc); } @@ -216,8 +259,8 @@ qemu_coroutine_switch(Coroutine *from_, Coroutine *to_, ret = sigsetjmp(from->env, 0); if (ret == 0) { - start_switch_fiber(action == COROUTINE_TERMINATE ? - NULL : &fake_stack_save, to->stack, to->stack_size); + start_switch_fiber(action, &fake_stack_save, + to->stack, to->stack_size, to->tsan_co_fiber); siglongjmp(to->env, action); } @@ -231,6 +274,11 @@ Coroutine *qemu_coroutine_self(void) if (!current) { current = &leader.base; } +#ifdef CONFIG_TSAN + if (!leader.tsan_co_fiber) { + leader.tsan_co_fiber = __tsan_get_current_fiber(); + } +#endif return current; } From patchwork Tue Jun 16 12:53:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188023 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3622905ilo; Tue, 16 Jun 2020 05:55:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9vZ9kzTJi0GVAE05CXFXWJvGISuiFFm4Igs1hqoy5MNaaiF4Uj1Es1gorlZ2ZaK5xyzRT X-Received: by 2002:a25:da92:: with SMTP id n140mr4000857ybf.313.1592312129248; Tue, 16 Jun 2020 05:55:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312129; cv=none; d=google.com; s=arc-20160816; b=QYXoHriXkbhTz2Y7KLQWv9B89Zp298Eqa4m8YUx7hsaFt7TjT0dQHYIgoPFIb9NG0q sgAyVw9w+32hfmx3mlSzCWT8qdl+KT12ejeCnhZrXY6y1L15m6pKBWKwiqaODclGUeOf ct4HQvaOpdxmlOvHz2O/LGsrXVilMJm72PhxlyW3YtxweU5ZZDGY8ADuNEwUb4cHkQuS uywEXLSRI0Z//i/cZSY+zOQ3Xkb0brrmkP1d56ujMXELifjXXjcX0acxU6PgWpj6X252 ECFN+KIpI5i8HooJrte6/4kdpTjz8P0TfpQYd3ANARt2t3TlwmD5l/ddR57BnGssMeDd 8I0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=I/tP7FlfNorVb50ogwJDlb1Wfq6uclDPBsfOKYTX7pc=; b=R+iZzQE94tz8ClDPy6opY9vp78mISizAjPqmtIWAHZHY+CRBFr6WrWeZl+SLWSafOw m4ea1jh+UN8PGropn58km/ZyNIlmsUy872maUJ7o50tcyHh18VTqX/PJ/I1r4iNsYqFt KSbqkMaD/7w+IgKF61SUvvyc1KpJ8hKoZ/Xn04LSQvgAMN72pkm0UmOwydtrgPtUQczf iNHvLRfdJ+dnv0lVbtu5k3MfkpUBxkdTMqlpHdAM4ItUUUcjk7HOUBsxNngI7xKc9US2 yX8KJn1IMySaMuEc/xUnStq55DoPCUprZgtXZP+AlD4BYoEZQBp4ReBEJHEMUsMYvbf6 rq3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QpqUtaAT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o2si6483628ybq.107.2020.06.16.05.55.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 05:55:29 -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=fail header.i=@linaro.org header.s=google header.b=QpqUtaAT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlB7g-00074a-Ke for patch@linaro.org; Tue, 16 Jun 2020 08:55:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB5s-0003lS-GT for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:36 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:46661) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5q-000063-IM for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:36 -0400 Received: by mail-wr1-x430.google.com with SMTP id x6so20613013wrm.13 for ; Tue, 16 Jun 2020 05:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I/tP7FlfNorVb50ogwJDlb1Wfq6uclDPBsfOKYTX7pc=; b=QpqUtaAT5ybNKBjCAcATGQrLWb4FLyyUvmEovuC0BnvgVrDlRzJxsz7+/w+Qvq/6xO 0pJiqthVLFwdXjSMSuGPxzmE4CHaeTChB/OEG9sVez4NpTS4VJVRcIj7yviQ/Zc1okAf eYrY/ZLRC9u+IhcvN7CxffMnNB0FagyDyc4EOHe/kM3QDFiq/TJLgA5JaeBizz1ziGJb JKaCPgvPzY3n3/U64+utEwtGpBThDxd/bByselowCxq+nq7H/Lm/0dGh9V7wCTIxW+Aj IoP2Xr/fmKIRHmwbjv7za54oVTXcyay80TSn8TdEw9hkfiHEFVkXnQJ8w39hSWAF3LDG xpbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I/tP7FlfNorVb50ogwJDlb1Wfq6uclDPBsfOKYTX7pc=; b=i8Hd6jgrLp+XWlDmn5rPBsAFX0Hvgr40Xm68ssKFDuDQOuCsRdwK7fiPKy5DYyKtta KIQd2o3u6EawRxEmoZYxLGrlj+S4rxCQPw64Ic3hHJqUkVR7OLvuRXuIKlYyN3IlDb8S yiJQj7tbAqbUmVQvu1CPBGdjborAKuRFbCU0Vr5MdtdNBrsz9BsS4dsE/TWsXOTbMjNH ZaxLeo3lyUdqegJFfFW/FwZnIPH5kxH0wsC++toPNM6Pu+0fFhatLVjHmZv05krBiTUQ qUKaHsOUJWpC8BrwQM+rN75fmkFZmokqriCStTSafByJw8/n4NRTN52ECOV8rUtC5PO1 xS6w== X-Gm-Message-State: AOAM5318cFohbNmqNCPvGV2JioJamc5AeajGlQbEhzgPDjEjtCL+na3C HY2H0p/bNzdivXL41fsckug4UQ== X-Received: by 2002:adf:f207:: with SMTP id p7mr2980297wro.206.1592312013077; Tue, 16 Jun 2020 05:53:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g18sm3944235wme.17.2020.06.16.05.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C0B691FF91; Tue, 16 Jun 2020 13:53:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 05/21] cpu: convert queued work to a QSIMPLEQ Date: Tue, 16 Jun 2020 13:53:08 +0100 Message-Id: <20200616125324.19045-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Foley , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , Richard Henderson , qemu-devel@nongnu.org, Eduardo Habkost , "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" We convert queued work to a QSIMPLEQ, instead of open-coding it. While at it, make sure that all accesses to the list are performed while holding the list's lock. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-3-robert.foley@linaro.org> Message-Id: <20200612190237.30436-6-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 497600c49ef..b3f4b793182 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -331,8 +331,8 @@ struct qemu_work_item; * @opaque: User data. * @mem_io_pc: Host Program Counter at which the memory was accessed. * @kvm_fd: vCPU file descriptor for KVM. - * @work_mutex: Lock to prevent multiple access to queued_work_*. - * @queued_work_first: First asynchronous work pending. + * @work_mutex: Lock to prevent multiple access to @work_list. + * @work_list: List of pending asynchronous work. * @trace_dstate_delayed: Delayed changes to trace_dstate (includes all changes * to @trace_dstate). * @trace_dstate: Dynamic tracing state of events for this vCPU (bitmask). @@ -376,7 +376,7 @@ struct CPUState { sigjmp_buf jmp_env; QemuMutex work_mutex; - struct qemu_work_item *queued_work_first, *queued_work_last; + QSIMPLEQ_HEAD(, qemu_work_item) work_list; CPUAddressSpace *cpu_ases; int num_ases; diff --git a/cpus-common.c b/cpus-common.c index 70a9d12981a..8f5512b3d78 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -97,7 +97,7 @@ void cpu_list_remove(CPUState *cpu) } struct qemu_work_item { - struct qemu_work_item *next; + QSIMPLEQ_ENTRY(qemu_work_item) node; run_on_cpu_func func; run_on_cpu_data data; bool free, exclusive, done; @@ -106,13 +106,7 @@ struct qemu_work_item { static void queue_work_on_cpu(CPUState *cpu, struct qemu_work_item *wi) { qemu_mutex_lock(&cpu->work_mutex); - if (cpu->queued_work_first == NULL) { - cpu->queued_work_first = wi; - } else { - cpu->queued_work_last->next = wi; - } - cpu->queued_work_last = wi; - wi->next = NULL; + QSIMPLEQ_INSERT_TAIL(&cpu->work_list, wi, node); wi->done = false; qemu_mutex_unlock(&cpu->work_mutex); @@ -306,17 +300,14 @@ void process_queued_cpu_work(CPUState *cpu) { struct qemu_work_item *wi; - if (cpu->queued_work_first == NULL) { + qemu_mutex_lock(&cpu->work_mutex); + if (QSIMPLEQ_EMPTY(&cpu->work_list)) { + qemu_mutex_unlock(&cpu->work_mutex); return; } - - qemu_mutex_lock(&cpu->work_mutex); - while (cpu->queued_work_first != NULL) { - wi = cpu->queued_work_first; - cpu->queued_work_first = wi->next; - if (!cpu->queued_work_first) { - cpu->queued_work_last = NULL; - } + while (!QSIMPLEQ_EMPTY(&cpu->work_list)) { + wi = QSIMPLEQ_FIRST(&cpu->work_list); + QSIMPLEQ_REMOVE_HEAD(&cpu->work_list, node); qemu_mutex_unlock(&cpu->work_mutex); if (wi->exclusive) { /* Running work items outside the BQL avoids the following deadlock: diff --git a/cpus.c b/cpus.c index 34fc2038084..7317ae06b9e 100644 --- a/cpus.c +++ b/cpus.c @@ -97,9 +97,19 @@ bool cpu_is_stopped(CPUState *cpu) return cpu->stopped || !runstate_is_running(); } +static inline bool cpu_work_list_empty(CPUState *cpu) +{ + bool ret; + + qemu_mutex_lock(&cpu->work_mutex); + ret = QSIMPLEQ_EMPTY(&cpu->work_list); + qemu_mutex_unlock(&cpu->work_mutex); + return ret; +} + static bool cpu_thread_is_idle(CPUState *cpu) { - if (cpu->stop || cpu->queued_work_first) { + if (cpu->stop || !cpu_work_list_empty(cpu)) { return false; } if (cpu_is_stopped(cpu)) { @@ -1518,7 +1528,7 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) cpu = first_cpu; } - while (cpu && !cpu->queued_work_first && !cpu->exit_request) { + while (cpu && cpu_work_list_empty(cpu) && !cpu->exit_request) { atomic_mb_set(&tcg_current_rr_cpu, cpu); current_cpu = cpu; diff --git a/hw/core/cpu.c b/hw/core/cpu.c index f31ec48ee61..80d51c24dd2 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -370,6 +370,7 @@ static void cpu_common_initfn(Object *obj) cpu->nr_threads = 1; qemu_mutex_init(&cpu->work_mutex); + QSIMPLEQ_INIT(&cpu->work_list); QTAILQ_INIT(&cpu->breakpoints); QTAILQ_INIT(&cpu->watchpoints); From patchwork Tue Jun 16 12:53:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188021 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3622343ilo; Tue, 16 Jun 2020 05:54:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3y1lucKxtljaMZWd4aJrHJZK93YJSHaDqvIrvBanCv7U3e7DD6KIqxXpy9/brWB/OWMGi X-Received: by 2002:a25:cd87:: with SMTP id d129mr3717228ybf.395.1592312071807; Tue, 16 Jun 2020 05:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312071; cv=none; d=google.com; s=arc-20160816; b=TSKyWIshg375z9P2RcNYq9Dfxpjhe/RLpjQ29eVX2USwLTMD1bX3Excq+mvnAAxbY/ /7cgeD96DWGw7xGflF7GuyVv1eLNDieqTtPVw+IPGBM+wFs91sYNHf45PxbxL5t/7Eih 9EK2RNQ23znneixlPpLi7i3yxmfQTBSJcYSzwsCp0wT/iNjxs/up1LETSKZuNPV4I17h K4jGZlohshQfgvdOT/eB0FW8RvG51HPxZQE831SWEt3s2GsFOxz/HAqGTCFqK2IIUrnW MK+QLKhAA6mXdoXiVTWAm5TX/9nvPm018SfU5o4+p3nggR4gitphQ6cshR18w507lt+R 6v5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=+NpXtT7RiBsbFomL5lDB9mC735VtH4XYz1tP+UOZeEo=; b=x2+GZjk0hBok4p+dihHzwu9/VlXCi/NIIMflOWtJOdhodLR3CIkXT3oxy5AYwtGcVM 8B/sX89G5JrKuttfpdhTOjWVkT1y+yB9KiIb+yA85e+omx9sMrtPCbV/rBkTny2RpF3i OOVo7UOu6ZLVy8VEWzlN97lasi5a+5Q0YPS1MNhNOog6HTC+t6rvz/v0+u3d3/gyLiD5 1vRoBOH2tUZ6l5VagJn6t2djx7FurgpI1U+4RQEvJ75/NHB7EiV85yMYLJ6GjgiTPZJe 9PdsCdyibt2DyUpBgw8p9X5SCKJHnygmWHwl5BykU+A0acNsNpmytOCOxgkGmmmCCKyF 8mCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ogf2Kzz2; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l70si16742791ybl.11.2020.06.16.05.54.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 05:54:31 -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=fail header.i=@linaro.org header.s=google header.b=Ogf2Kzz2; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlB6l-0003nL-7H for patch@linaro.org; Tue, 16 Jun 2020 08:54:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB5q-0003hw-MI for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:34 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:38374) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5o-00005g-Bn for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:34 -0400 Received: by mail-wm1-x32a.google.com with SMTP id f185so2938567wmf.3 for ; Tue, 16 Jun 2020 05:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+NpXtT7RiBsbFomL5lDB9mC735VtH4XYz1tP+UOZeEo=; b=Ogf2Kzz2ENtZakGpVXq9A6GzWuoCyEALK8Kw9iXxyAVFz7Zsapk7OvdtUYJ1wq0z1k QemkMybZQhDdpaxhGuS7Weqp4uhFOQxjBFXHgIRz6CVc4ElC0P35FZSb2f/QQE6QINbm BXVuV6fDb7qPqUNFXrjyt568OV0sAO9Md4Uz9QQ9I/rtCdF1DAfVuMCX/mvr2QygPkdM aiyT0IpUC0pZ/DZBj+sjGCO5HcEG75u5QNvAyxFFXM4a/wkh7nJGUlTNwMMCCPDRXmQl hk3iNUqfha5Si8OA8DiEkykbeiuIJJEkBg6udalSmga/CSjCvkGma2ETz64LAD9uxRGM 5/AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+NpXtT7RiBsbFomL5lDB9mC735VtH4XYz1tP+UOZeEo=; b=CvD81f0LQJ3aEsQaL4cPMrdYlkp43oeCMN4JHD27mLayUbISjTQ9WnmKAhmJklhuPP ls9+xY2GbzPVEQn9ek+4gRuUmaWtZnkAEpJmhwqsXL2ro90YEfGtKuDV0+B5Yo+mLYLo d0Lju0FpLNO4ie3esjCRpSn1R14x7EC1vFs79Ydu1KCDtz5AeohNZJx3RhjzUKZISea9 5xvSAJajhCcYLQzGLGIeQE0C/rvZXmnp2tnZvzKSsOmMINfCitHMg/wN4r9279F1CzTR 5k9vubImvJ4CUdZ1VzfGiu1AXR9SlxKENuL8P3UFYnAxMUWJN5SjM0T9612X1EX/SZvM Tcig== X-Gm-Message-State: AOAM532B785zamy3Ye3hpNPhHLFfBGPrcn7WwotHJph/jGHJ6oRskkd/ d8R8MwH0dJft91TPwXQIoCb/AvgaGwc= X-Received: by 2002:a7b:cf06:: with SMTP id l6mr3071539wmg.63.1592312010929; Tue, 16 Jun 2020 05:53:30 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n7sm29697418wrx.82.2020.06.16.05.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:28 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D534E1FF92; Tue, 16 Jun 2020 13:53:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 06/21] thread: add qemu_spin_destroy Date: Tue, 16 Jun 2020 13:53:09 +0100 Message-Id: <20200616125324.19045-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" It will be used for TSAN annotations. Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-4-robert.foley@linaro.org> Message-Id: <20200612190237.30436-7-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/qemu/thread.h b/include/qemu/thread.h index 06c058fb58b..9479facdcc5 100644 --- a/include/qemu/thread.h +++ b/include/qemu/thread.h @@ -215,6 +215,9 @@ static inline void qemu_spin_init(QemuSpin *spin) __sync_lock_release(&spin->value); } +static inline void qemu_spin_destroy(QemuSpin *spin) +{ } + static inline void qemu_spin_lock(QemuSpin *spin) { while (unlikely(__sync_lock_test_and_set(&spin->value, true))) { From patchwork Tue Jun 16 12:53:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188029 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3624347ilo; Tue, 16 Jun 2020 05:57:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMxzq3tHqMw5SgpsaY28Jglb3+Zz74QESh5IHfupx+KU0ZMxk/CZ00KO3QaLKDMH2voVTX X-Received: by 2002:a25:8403:: with SMTP id u3mr4018183ybk.276.1592312264123; Tue, 16 Jun 2020 05:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312264; cv=none; d=google.com; s=arc-20160816; b=z950Up3KOnJqp1OhbYxlaMwVX75gvJAbOeLAvlQb3Dw3z6KEmJDaFd1t9W63rmQ1GN ++6/6Pp30Qg+uj3LKViwI6xXr3gAhYqsiFLlzfgLRQkPZ00fQl4Yft8ME1wjE8HE+VNx jhW2u8djOmOvnfBNbcs17CL0/cP55ku3wdcGG+u6QraBcQAeiNT/shYlT/sf5pG+Clwp MBDAEmQbra10uQdGRnGVgPbIKuUn4HsqiXXkujyEYKpbLZZCo585njSv2KmQPL+Jxsuu sLdpTANP5lchhKt+mgTz9E0sdq3KJUtE+euaz8Gl24K2RSsnt9LM3g9quDljQMXJ8A93 un0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=exFtdpeiE/YU2NIFtj2aRDoc3cKhGjW3auP7rUrwYDs=; b=bSHl3zdx3ChpPLMz+yKrq+M7/6tDJq2O2MaHSWv8qhi3dZqN55Pvm5EhKZTsHRADh0 o0BiJMVmjiXeefoA68p2OP5X7tDi2Ux25H7e19g2ZHKC31K2N0z9CuLK2vQn58JhvUk1 HwLXr8MaajlfqB6SqHDAeUXhwr/VjsFewS5XiyNOZo0AuOT1iv0tEZVvI0pi6i1/gqeM ImgREPLKGOYeSxKwxCQgas8GG4S4Ox7y2VKAogJ4X6ASxIfLQwGd9Y6cfiiWuuoCim0K J78JKVgFOs8nkbR2CyRye0q2xmmcw/v3hyy1ASgGupV0QWAYaZ9lXyssShkkZa6cKLhd kg1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Pr0eH5Ko; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l143si16110936ybf.155.2020.06.16.05.57.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 05:57:44 -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=fail header.i=@linaro.org header.s=google header.b=Pr0eH5Ko; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlB9r-0002PA-H7 for patch@linaro.org; Tue, 16 Jun 2020 08:57:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB5t-0003nf-LW for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:37 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:37731) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5r-00006S-T4 for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:37 -0400 Received: by mail-wr1-x42e.google.com with SMTP id x13so20638092wrv.4 for ; Tue, 16 Jun 2020 05:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=exFtdpeiE/YU2NIFtj2aRDoc3cKhGjW3auP7rUrwYDs=; b=Pr0eH5Ko6K0UxbL2ea5LQKMJoe5pTYseSfudKNNX6qSsA9Zq9U0DaYl64Qc/9SxSn0 4eVQvPva1CLCO/hk6EqjQti4I0p1RgV6tPe7fRbSsKvmtBXkmrcXuf4pL69asuaXCdj3 4m+OuwVPZVMKlBYDBDvrUcpy3CusRxgKr1zB7n+fzSB04rhMCcmRtboqcSuBJyJxh/+3 i/YfsAVtz8vG4iC/D6L9Gjh2h0983BKfdQGn29X1YrKcyGSFWiSmzPr/Inmf2ioTpcEi O+IzXTgzVKjfyk2A1zwH3InkSNuxj/yVIL0QHQde44nW/LuF3oejJGfei88WMcF//5VY YH/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=exFtdpeiE/YU2NIFtj2aRDoc3cKhGjW3auP7rUrwYDs=; b=PaUlOih15y2+bB63tsZUFiVjCHFDet1SN7JY6oPTSGOsGLdhDVpqea5Z2b3v/7GCx+ eWQmcbCa7JUUg+oFYNaRHAaQ5aheSaTC/L89jSufIS8yeCmet7V1uMJ0VjzULM6YlP9j KPOcfu8D0n54WoA3SiqJpokU/k+ULXh2QG3KOpn5TAoEeWaICKAhJ1fT08KHQZ+u+CHb +OPtFvHgqpuo3qKF8427VNh40ICWmvlIXPe1dsYTbj7mhAlf3FP3uFnmgHG9R8gUSsFM Ut6BxSzjKsocTIkUjMn04m81bSNVwfNfptTjP2LseArkUBOHUNCP/eTuQSwao5NWLg8i dkMA== X-Gm-Message-State: AOAM533MFLoPqqqfDE0SijuIOpeacclmYJ95IXFtvy3M+r+6FHK4STEZ +a5aHPjFAayPwMpdYAZ+/cJf2d2yqvI= X-Received: by 2002:a5d:4701:: with SMTP id y1mr2914014wrq.310.1592312014401; Tue, 16 Jun 2020 05:53:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r14sm789732wrx.42.2020.06.16.05.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F04281FF93; Tue, 16 Jun 2020 13:53:24 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 07/21] cputlb: destroy CPUTLB with tlb_destroy Date: Tue, 16 Jun 2020 13:53:10 +0100 Message-Id: <20200616125324.19045-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Foley , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" I was after adding qemu_spin_destroy calls, but while at it I noticed that we are leaking some memory. Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-5-robert.foley@linaro.org> Message-Id: <20200612190237.30436-8-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 8792bea07ab..3cf88272df9 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -124,6 +124,11 @@ void cpu_address_space_init(CPUState *cpu, int asidx, * @cpu: CPU whose TLB should be initialized */ void tlb_init(CPUState *cpu); +/** + * tlb_destroy - destroy a CPU's TLB + * @cpu: CPU whose TLB should be destroyed + */ +void tlb_destroy(CPUState *cpu); /** * tlb_flush_page: * @cpu: CPU whose TLB should be flushed @@ -284,6 +289,9 @@ void tlb_set_page(CPUState *cpu, target_ulong vaddr, static inline void tlb_init(CPUState *cpu) { } +static inline void tlb_destroy(CPUState *cpu) +{ +} static inline void tlb_flush_page(CPUState *cpu, target_ulong addr) { } diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index eb2cf9de5e6..1e815357c70 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -270,6 +270,21 @@ void tlb_init(CPUState *cpu) } } +void tlb_destroy(CPUState *cpu) +{ + CPUArchState *env = cpu->env_ptr; + int i; + + qemu_spin_destroy(&env_tlb(env)->c.lock); + for (i = 0; i < NB_MMU_MODES; i++) { + CPUTLBDesc *desc = &env_tlb(env)->d[i]; + CPUTLBDescFast *fast = &env_tlb(env)->f[i]; + + g_free(fast->table); + g_free(desc->iotlb); + } +} + /* flush_all_helper: run fn across all cpus * * If the wait flag is set then the src cpu's helper will be queued as diff --git a/exec.c b/exec.c index 9c8f558590d..d6712fba7eb 100644 --- a/exec.c +++ b/exec.c @@ -892,6 +892,7 @@ void cpu_exec_unrealizefn(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); + tlb_destroy(cpu); cpu_list_remove(cpu); if (cc->vmsd != NULL) { From patchwork Tue Jun 16 12:53:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188032 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3626081ilo; Tue, 16 Jun 2020 06:00:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1lrHwXC1bsyzBz7rU0SO/PVa60iegRkpkudUHSvi4Rb9W5SZIkGu3pcL+vREkN2JMxjfY X-Received: by 2002:a25:cac6:: with SMTP id a189mr4102835ybg.238.1592312432111; Tue, 16 Jun 2020 06:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312432; cv=none; d=google.com; s=arc-20160816; b=vEdZ/OBqWt2f3kMFCwTEc0bl63VSBDdZPaj/UxwJRTIjcAToiXR+i3pCb5iAYn3m/F jZQv8s4RiG3Z28RH/NYnq8NMLMFPCAF0lSsHIXMGJmfdkpQuNG4XaQinQdGsyIUt94pZ hx/cWPHVGSxM09CfYsRsbnftIculov2/TIzYHdO3pmW25AsbLVju1QNtaF+NcExiYsl3 XKJbsKoU8Wj03uY0kut0Oz+ZUo1Kx+gDkQ5MYw2Isx7zvdNgyYiObcdTxfcGzqAMjqZI vpTWWNPeX38uiDgtw3kbqK1+afZyfQReGO7QcT8Di+d6s9RIE11NfpQBmcgA0IwQ4ruC p3/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=mRZQZj1Q9wEv2vot0r2LSgKuWpAPT3iQugKUo+0zSQY=; b=yXg1zSwaHIuREaWCFBoM//kDRD/e1+g5Wi4pVUW4KVDHgNti36jLRCzWjDwVJY5j3J frQTVa9Q63ynGqd9Uvg7Aqq3vtBKDa3iJHW2i925Z6jBQb2jVGCr9wpZVNTDjbWiq7K1 Atadjr18rUAp4HA1/bSGXQta8KgWyAWOlHN8wAQOAG+J569M1TO7tiLSduxcxnhpimtF AreK5o13E0pGluoEmBay0/VD2jInnLkdfQouRdTdyE03KIloJ0MmmtFaZ7//YKm+wspR +cQWDsG5FqSz4QHxBKfY+xcY9DZisKeKQ9Iz1ZP5VM+0y8tP5e0YiNShDXLu31Z8qkH4 88/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IC8IaV2f; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x2si16154919ybq.24.2020.06.16.06.00.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 06:00:32 -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=fail header.i=@linaro.org header.s=google header.b=IC8IaV2f; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:32772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBCZ-0006m8-I1 for patch@linaro.org; Tue, 16 Jun 2020 09:00:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB5u-0003pX-MJ for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:38 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:37377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5s-00006d-VB for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:38 -0400 Received: by mail-wm1-x335.google.com with SMTP id y20so2949710wmi.2 for ; Tue, 16 Jun 2020 05:53:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mRZQZj1Q9wEv2vot0r2LSgKuWpAPT3iQugKUo+0zSQY=; b=IC8IaV2fZgPwI979TOJquet7moYMCnsWS/l1sIEVkaU5vov5UlKaA4L/+YM4+SX3Rv 1voPe2wP1QZwVRvy4Jz2PJFTDZ0417il9CJkjRx8LImMe5zqJoSfMLpqJqY6Hhlfz6LD qCGeksL61nvBiZ9OhrEXIEm3t85Kl2ncAAg5xC151dR3mQJcJfeRlUeAHbGG1aIQbeED gNNLl21tFlgohpzI5aPswbc6pOK4OlD+EcBrkMBzkfUvooVSJxJ2iIXMcuJibMa4aQaZ 1hvYRHHxkNPSummoWc+eWPxh39+HK7chqCLIKmzG+eKHay8R2NZAVe96baaas+6I8L0z QjBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mRZQZj1Q9wEv2vot0r2LSgKuWpAPT3iQugKUo+0zSQY=; b=b45kr5cA7JGzOi7EiN262y5dSPdQ9Fi08xzx6KWy7vP9vO9X4h7wbes0LSqLewOzqT L6UDKr52DMTda1P5PrNKtPGhc9ZYIt2fuYficFa9Lx+4xMGz12WjPz/F0pvq3Hl2SE5w sDvc4TZ+FQaj8Ywr66e4HleQtEb1cZ91IuCf2pT/b93HVDK6EKnM4h+5f0Sslb37x2a/ sy2Jxv44mv4RhUldy/tJRTfvE5TzzJKp+QEHPXQZTR4w6li3vQ7LllRedJrbI1V64L2y VK3yxXJD30Q/DlsEtlnLLV0zeRJxmlmzu/Pq/qoQjArCjw30qodljFbrxvHeWZFgEGJt bYEw== X-Gm-Message-State: AOAM5312Zvtdj8qFRSa6udvf2WpSsD9PxJXuDlkwaoG9tr4OAZb2hUBN xKSfOlZLqw05V+1Uv3OcGqvEcg== X-Received: by 2002:a1c:2044:: with SMTP id g65mr3420851wmg.16.1592312015594; Tue, 16 Jun 2020 05:53:35 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b8sm29907419wrs.36.2020.06.16.05.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 11D5F1FF96; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 08/21] qht: call qemu_spin_destroy for head buckets Date: Tue, 16 Jun 2020 13:53:11 +0100 Message-Id: <20200616125324.19045-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley Reviewed-by: Alex Bennée [AJB: add implied cota s-o-b c.f. github.com/cota/qemu/tree/tsan @ 1bd1209] Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-6-robert.foley@linaro.org> Message-Id: <20200612190237.30436-9-alex.bennee@linaro.org> -- 2.20.1 diff --git a/util/qht.c b/util/qht.c index aa51be3c52f..67e5d5b9163 100644 --- a/util/qht.c +++ b/util/qht.c @@ -348,6 +348,7 @@ static inline void qht_chain_destroy(const struct qht_bucket *head) struct qht_bucket *curr = head->next; struct qht_bucket *prev; + qemu_spin_destroy(&head->lock); while (curr) { prev = curr; curr = curr->next; From patchwork Tue Jun 16 12:53:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188035 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3629305ilo; Tue, 16 Jun 2020 06:03:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyji/ShxvYUSkJlxpXg+4HSWChdlnJMfQUyHtESpNoGQVqscAPvgiL+W3jdVn0XdLNA2Aii X-Received: by 2002:a25:cac7:: with SMTP id a190mr3769200ybg.223.1592312608835; Tue, 16 Jun 2020 06:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312608; cv=none; d=google.com; s=arc-20160816; b=u8BuPCGmylzQYaTaKf6Qx2CxS/KfFN6k+HpIlAPVB/SKUTLc/GM34+9lJt/MOTrIM3 pcI7/QfC0DHHLj9pj4bM2hOIJVvyCplDPzMvscPCjEjDD5IqlZnCeqGmU1WUIm8/KEzu Xq0id9krcBt+HRjxg/RxKppWybrJ46slcFwQnjN79g8AP7aOsarstBmkFwYRTNGqVbPB UIZJqqllb1InfEF+yXdcSUpjxT+tvbPsBIwy27lNLh/Mcf0oRygUmeoMLi4caMFXPhcg FoqyheCHw5WMSHYfG8K6+211rppB99oAC1itIpQj2L3GvHYQLnLBoX6r0qydUHLe9SHj I+4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=DDqujmTFkc0hOk773xfYMxHUbbRUPYjfJgT7cT/D+7s=; b=Yj7of3oPJgfSmL18u3Mrzhl0a0xyGAFJ4GCwHDbcC3u9pWHN9sHE1LTw3dMCxUs0Eg w4U/kp0vHStREcZiPTtEyhYRJTzatdHWhBJzAyopoZxFkUJ5BSow4Bkact+fq5GAs03x 6m7SMrwt3U2mU6EPCjyR2NVYdiTApLxIuqsOp1DMykMhF28gtsaxHvGlzC0utgjLcYV8 jKpV9iwDttEgjnhKDRS3W7oeL4Gcy55kM7N/7XU9b6EaSxE75QZIUpCBnZSNbACnAoIH RSTPIf2/DX2vVpRNR0q0nqG4c3bl+0/fwpiGwwe7OrqkOqY1uOnV5LDD7C0Ft4SGkbzh u2+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fKDDZLyY; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o23si15715094yba.275.2020.06.16.06.03.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 06:03:28 -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=fail header.i=@linaro.org header.s=google header.b=fKDDZLyY; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBFQ-0001EE-5k for patch@linaro.org; Tue, 16 Jun 2020 09:03:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB5z-0003tP-V3 for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:43 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:55102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5u-000077-Ne for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:43 -0400 Received: by mail-wm1-x336.google.com with SMTP id g10so2765383wmh.4 for ; Tue, 16 Jun 2020 05:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DDqujmTFkc0hOk773xfYMxHUbbRUPYjfJgT7cT/D+7s=; b=fKDDZLyYz+a+7jYa/Djhx0KtFycmF4BMWV6b4BqGwNBMVJ+XT6j1ffIzs2MVFQpLxo oZ7KYPIYx0Bb/nh34ff9F5SjmQjBWsp9MYo//xnjF0RNjylM1brMj202dXJT6i4wmWRq JbRYdAlmqggJMrRX7e7MMwiaoG3Tgo4Q671xl5QxoAQUYyaJgDH6seXbxWRRdT26Qs+f t4izw0v16B2O8LBjo+dKPavn1r8HplnGCyRuelUTNT562VHSJugaO/Yo1CxS6uFyArkV jUkKSanPCnL+GMkcepuFMh2pE4X1t6KTq91p5f/GV841JSmYW67ulY61v57Oq097A6c5 MKUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DDqujmTFkc0hOk773xfYMxHUbbRUPYjfJgT7cT/D+7s=; b=X22CHrhCYIviaxbxT0ejdJpJkK1MbaBNgTm4216qYgpc59ZvX7mkoDqxLU5HmTNtJX O40FOGSRgWRljT5QutCEqs+vU7uZWWPqHxFoACM1XuKZOoTf76O/nrm6SqK0qN4zKFeJ QGNa1V8QLgG6LUmR55EJjQkhBOHHFBlnm9+mOlijhne4MrYtzsJmp4ExK1oIAIQHpalw sxrE8VZ9mL2LMv0ILnPPfTmY1HIQHsDRZqXrphpR+mEdSvl5BRX6kqPKw1Oc5OnNemVr H2Yk2CyMPTpCp8TYkLoiHcrMGuuzxaobCfGATRieXm8TW7HHFGz4ibwPaaztFZMweSh+ GzNw== X-Gm-Message-State: AOAM532k98Odeha5wYg2Z0w99uzn9UQwF42KeHVQtabMd6W8mepQDhlq Np9F5LOtHlL33QtpJkCWE74Mvw== X-Received: by 2002:a1c:6a13:: with SMTP id f19mr3244341wmc.142.1592312017344; Tue, 16 Jun 2020 05:53:37 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v7sm29033256wro.76.2020.06.16.05.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2C1AB1FF98; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 09/21] tcg: call qemu_spin_destroy for tb->jmp_lock Date: Tue, 16 Jun 2020 13:53:12 +0100 Message-Id: <20200616125324.19045-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Foley , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley Signed-off-by: Alex Bennée [RF: minor changes + remove tb_destroy_func] Message-Id: <20200609200738.445-7-robert.foley@linaro.org> Message-Id: <20200612190237.30436-10-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 380014ed805..e63450a8936 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -819,6 +819,7 @@ void tcg_pool_reset(TCGContext *s); TranslationBlock *tcg_tb_alloc(TCGContext *s); void tcg_region_init(void); +void tb_destroy(TranslationBlock *tb); void tcg_region_reset_all(void); size_t tcg_code_size(void); diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 42ce1dfcff7..c937210e217 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -384,6 +384,11 @@ static int cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, return 0; } +void tb_destroy(TranslationBlock *tb) +{ + qemu_spin_destroy(&tb->jmp_lock); +} + bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc, bool will_exit) { TranslationBlock *tb; @@ -413,6 +418,7 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc, bool will_exit) /* one-shot translation, invalidate it immediately */ tb_phys_invalidate(tb, -1); tcg_tb_remove(tb); + tb_destroy(tb); } r = true; } @@ -1886,6 +1892,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, orig_aligned -= ROUND_UP(sizeof(*tb), qemu_icache_linesize); atomic_set(&tcg_ctx->code_gen_ptr, (void *)orig_aligned); + tb_destroy(tb); return existing_tb; } tcg_tb_insert(tb); @@ -2235,6 +2242,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr) tb_phys_invalidate(tb->orig_tb, -1); } tcg_tb_remove(tb); + tb_destroy(tb); } /* TODO: If env->pc != tb->pc (i.e. the faulting instruction was not diff --git a/tcg/tcg.c b/tcg/tcg.c index 1aa6cb47f29..1362bc61017 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -502,6 +502,14 @@ size_t tcg_nb_tbs(void) return nb_tbs; } +static gboolean tcg_region_tree_traverse(gpointer k, gpointer v, gpointer data) +{ + TranslationBlock *tb = v; + + tb_destroy(tb); + return FALSE; +} + static void tcg_region_tree_reset_all(void) { size_t i; @@ -510,6 +518,7 @@ static void tcg_region_tree_reset_all(void) for (i = 0; i < region.n; i++) { struct tcg_region_tree *rt = region_trees + i * tree_size; + g_tree_foreach(rt->tree, tcg_region_tree_traverse, NULL); /* Increment the refcount first so that destroy acts as a reset */ g_tree_ref(rt->tree); g_tree_destroy(rt->tree); From patchwork Tue Jun 16 12:53:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188024 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3622950ilo; Tue, 16 Jun 2020 05:55:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywmG4aLJdcwP4MJp1u4p7acY3ftXrUOSry3brzyGX13qWPzQaMnZXa1yYDmfT2SjH6oCc7 X-Received: by 2002:a25:770b:: with SMTP id s11mr3822009ybc.157.1592312132364; Tue, 16 Jun 2020 05:55:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312132; cv=none; d=google.com; s=arc-20160816; b=Zsk6LZZq/BsJItZkoU0+yIcGh1XGaJTK6M5mmfMkLFr+9v1BQi1pH6e4f0GbLZ4BLu yIP8q4Pk/tBAImuWh4UxmiJ4OiAxfXCvCzKfh1N6VbM3Nepp6ppFzgsLFK4RF3KV8JLd jitc4c4UDzivJJjTTJ8khgWF343IQHd0b6wvwyqFSzZdUO3nnjFAPl39r37AapKEpPWo aVGTno5f9LjhDnzYgg0Q9kdsCA9B/fDMU4LiidyLdMRHtxB5uDhZhGFC9FVqvEgg0SQg 3EXW9vG9yWV7Umna1qStrwZMQqCZckeNjwDQAfMLn54zwuVCPXJeCiDQYpZqVJyuvKNn A8pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=+YQiH3+sIht8+/pPMXJHUeuWld2thZ6YfsosCzHZ13w=; b=Exy3MHUZK+09D21x7ZE0PmUJBIUSBzGke4Nlt+WRnnSr1HdgbwhGJYS6gB7Lj4z0Zc gavI05BHBTjV2SJT4mbwo1Zvpiz7Dr1NzTOjmtCj+few9vFoIGaiMs3UU/3HoDIhcatx K0i3aXbTX2FPWh02MaBGBi/qBkb3COTLiZPoFchG8/pUgG6Bj7HGj4Uy4qmzwo7ZRXNO 5v1qWB4KbDRajQn6iLv+ZIqNGxeQbFgJwaKJQ8uGg3STTaWbaRMxasSZFqo1/SmAwlwr WMuoLVkgrESb30hKE/1IM1199CwfQw+2Z/isSYhmsB2zH/ksTiJNiidM9Am34nPxtx0Z OSnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E0iaV65j; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e127si16991078ybf.458.2020.06.16.05.55.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 05:55:32 -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=fail header.i=@linaro.org header.s=google header.b=E0iaV65j; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlB7j-0007Dy-R2 for patch@linaro.org; Tue, 16 Jun 2020 08:55:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB64-00044F-9Y for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:48 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:32895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5z-00007a-Bu for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:47 -0400 Received: by mail-wm1-x342.google.com with SMTP id j198so2220101wmj.0 for ; Tue, 16 Jun 2020 05:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+YQiH3+sIht8+/pPMXJHUeuWld2thZ6YfsosCzHZ13w=; b=E0iaV65j3PDxpXdycp93g5RIJVNflbqEOJOryeuGUKSC+x3lZ4fECeagRx3Td4Axoe 9PirnoupbB4MX7X2c3bKf59q8y31vbeFlsPyUysc+f/YCFE1FYtMLGRrYRtGbY+6s37A 1xXIxKdCZMgaVf+xbqQWYhA/H0u5bnQybujJz2binnbVvhoUdZp6SKSjBkLV0BC+U9Be 3ILW2KMeJaIJ3CKnPm16kiwdyLJWr2UWd52YrwReOffWx7kgdq6gmSZymDtoXDcNEbT3 Wg6DanRKREnwrirN6Xdtrln2Mi5+yu1DtvCb7xHoS9EWoFqwzS6oke5Kb8Z61ZTuCeUJ LYYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+YQiH3+sIht8+/pPMXJHUeuWld2thZ6YfsosCzHZ13w=; b=lJedWDVgnHjFVwcL30ZzS0e5d+HDdgEm8+LzQgG7lMB+oAQVg2eAfFoqXbZcwQ9pu0 lSJIXnQlNRLKHkC3qeAN1xvYeh1URUsiNLfzVAGITQuSRBl64V76qiTLTFyjb52W2dpL 14/lLQ8zmXS3bkDLrjWBsF7gYjH+xkiZc8Otgjwqn9FXRagVJsB6A5/n7UrM5GrFT532 ZAYFeje1EPcOP1Lm7YjSFifK6n20V5ffh6aCFOgc4VHI1DSj3ACpDMpNNnkdWA5Sewln fSoILzc268UIMISUEcPuQrKa4mxBW3MNPUPq4ObMW6RhhWeT5SNieKPZGrkNn8VjV5cD YX3w== X-Gm-Message-State: AOAM533Vf4Woizmp1WEprfnjzlosInut5GW6hvWN2RnNx+UzUiZsb9XZ S48sWkz6oul+ryFdhpcb2X5xJA== X-Received: by 2002:a7b:c944:: with SMTP id i4mr3093352wml.22.1592312018553; Tue, 16 Jun 2020 05:53:38 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o9sm3767881wmh.37.2020.06.16.05.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 406791FF99; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 10/21] translate-all: call qemu_spin_destroy for PageDesc Date: Tue, 16 Jun 2020 13:53:13 +0100 Message-Id: <20200616125324.19045-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Foley , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" The radix tree is append-only, but we can fail to insert a PageDesc if the insertion races with another thread. Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-8-robert.foley@linaro.org> Message-Id: <20200612190237.30436-11-alex.bennee@linaro.org> -- 2.20.1 diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index c937210e217..c3d37058a17 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -547,6 +547,15 @@ static PageDesc *page_find_alloc(tb_page_addr_t index, int alloc) #endif existing = atomic_cmpxchg(lp, NULL, pd); if (unlikely(existing)) { +#ifndef CONFIG_USER_ONLY + { + int i; + + for (i = 0; i < V_L2_SIZE; i++) { + qemu_spin_destroy(&pd[i].lock); + } + } +#endif g_free(pd); pd = existing; } From patchwork Tue Jun 16 12:53:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188027 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3624025ilo; Tue, 16 Jun 2020 05:57:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQDmuhcqEczWA/SzOqaW6jlDsF/ydPXsNSen4QttdP9MAp8yXZt40518L6hYSERUmZFdte X-Received: by 2002:a25:d755:: with SMTP id o82mr3629575ybg.166.1592312234700; Tue, 16 Jun 2020 05:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312234; cv=none; d=google.com; s=arc-20160816; b=ih/2kGc4iwqL+dOqGzaBQ0PGa+SFbb3vv0qtMuR4H3TFBQCK8W8hZpgwD2JVRqPvgs z6JtOvGZO/cuWTwhTA8qKQqkXuTzAkZBUzPd5TY+gOS+yJHB9RneG/LMrJkOL9i5U8tH 0wA5lBQhq47Qid6CR6NkNcxCeDxqinh4PESrBs+31wCICCCmx75ReTOwroHVTBZiKvU/ umEIikBMtRqpFG1KRLiS7qWMdQorTnOBENSN3o/r/62RDyg+Zeioqjmthm45W2U7w26V WGlKA0lZN3zJTYI0WpmyOvWEJrm5vP5TDys1xaLOdUHvlaqQ7puBa2afzVbG+zTqls4F Mp7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=MxmxIyQX9ayQ5hPd4gIq4mQ/EgZcZo3pK+5EExUMVzw=; b=UykqHN2roSNCZvCbYbdp7PG/v8cyPybmeo3yjHf3T4B44Rqj8hFah7CQiaB/QL3YK4 GHS9uocC8AD3NkVIXXqQah2yLXpdo6c4D7hu/ikgB5sX1wyp53e94wZlimvJH70ZA314 VboivJFQm7mI0CevfbtuiHFw/CHCp0FiHBFmmULFDRWQwK+yvga9FCR3Qw3HEnkoSQaO ccAVGuRkAFVuK7pI9AXfUwewG0tqQvkSHdpcflf4pIF5nK944eDlH8UAUCz8K+wdrkpC 4/ynhN8vLlBhMlV8shcsM8VyNCuJSZAEz/Mi4O413vsqzFHD4ccjxQ+srSc6q9HyOuuc xnmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bqu6kKxH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s2si15087900ybe.216.2020.06.16.05.57.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 05:57:14 -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=fail header.i=@linaro.org header.s=google header.b=bqu6kKxH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlB9O-0002Xn-5J for patch@linaro.org; Tue, 16 Jun 2020 08:57:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB67-0004Al-3o for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:51 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:35613) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB64-000097-Qp for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:50 -0400 Received: by mail-wm1-x334.google.com with SMTP id q25so2965880wmj.0 for ; Tue, 16 Jun 2020 05:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MxmxIyQX9ayQ5hPd4gIq4mQ/EgZcZo3pK+5EExUMVzw=; b=bqu6kKxHrJ796bfx8IEmNKueau3ph1STuTkpj/lW9/cKdjP/XE4wrt/L3EGnkCHU2E 373bmjmFM6uByLN7UYNlGCUvF+xE0FAyTwDJPH1/yUqTT+EucetiKKRZwbf87sYqfeco 0D6KeHffSgtmAAZvvvfF1HqggApNwcbAvd+n6aBTrj0c4YcYD5eu93udoTmFkndqBmmv 1hJq0vpgVaS5tXSXHSwIneHa3lBEbs2aiDRQPA6XwY8H3YO6VL5qCKL1+zW4VGmU3aLn hywP/dNWA+gnw2qJBv6FE/vw0AO3xiha0ggZQTrpGjW41Vai2OeoWCVSBPHYsUo0aA11 JrPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MxmxIyQX9ayQ5hPd4gIq4mQ/EgZcZo3pK+5EExUMVzw=; b=ibpzV7Tlz+ZoXfohxKahki+G2L8wOPjYp7Y1pibFvqC3WJjLxSanPaiV1HEXlOTYIF L8btR7Sqsvtckm501IK7CkfoFtoFGB0GqKN4S8BIxV37RACg//I61sp6VQuCB9rpv4Vy b/HN1zfTmP9OrvKaNdrXtre2B2qN0ntVqsGSXB7mkcrANfNpZb1xl+TXwt4AKhl0mbzu 3nlyPeSd0W2uex03VeTwioS6Pml115oJX2v3hDsnVpvTp9A44xeGJeDGVDP/EkzejuTx 7m4203alfr102BnmxNwlfyU7ugLZ/8/viZkHAwSAd9YP05XTwZDRIjFGVKSMfJhgRbRY fpSw== X-Gm-Message-State: AOAM530hDZ8w1C9YIULlq1GTit+Yr2PwRWI1Jkhe4bEBlJQO/dOOWQOK uRGrI2vaMU7I8Zt/pfhMqLMitg== X-Received: by 2002:a1c:154:: with SMTP id 81mr3039193wmb.23.1592312023173; Tue, 16 Jun 2020 05:53:43 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r2sm30080373wrg.68.2020.06.16.05.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 551241FF9A; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 11/21] thread: add tsan annotations to QemuSpin Date: Tue, 16 Jun 2020 13:53:14 +0100 Message-Id: <20200616125324.19045-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-9-robert.foley@linaro.org> Message-Id: <20200612190237.30436-12-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/qemu/thread.h b/include/qemu/thread.h index 9479facdcc5..4baf4d17157 100644 --- a/include/qemu/thread.h +++ b/include/qemu/thread.h @@ -206,6 +206,10 @@ void qemu_thread_atexit_add(struct Notifier *notifier); */ void qemu_thread_atexit_remove(struct Notifier *notifier); +#ifdef CONFIG_TSAN +#include +#endif + struct QemuSpin { int value; }; @@ -213,23 +217,46 @@ struct QemuSpin { static inline void qemu_spin_init(QemuSpin *spin) { __sync_lock_release(&spin->value); +#ifdef CONFIG_TSAN + __tsan_mutex_create(spin, __tsan_mutex_not_static); +#endif } -static inline void qemu_spin_destroy(QemuSpin *spin) -{ } +/* const parameter because the only purpose here is the TSAN annotation */ +static inline void qemu_spin_destroy(const QemuSpin *spin) +{ +#ifdef CONFIG_TSAN + __tsan_mutex_destroy((void *)spin, __tsan_mutex_not_static); +#endif +} static inline void qemu_spin_lock(QemuSpin *spin) { +#ifdef CONFIG_TSAN + __tsan_mutex_pre_lock(spin, 0); +#endif while (unlikely(__sync_lock_test_and_set(&spin->value, true))) { while (atomic_read(&spin->value)) { cpu_relax(); } } +#ifdef CONFIG_TSAN + __tsan_mutex_post_lock(spin, 0, 0); +#endif } static inline bool qemu_spin_trylock(QemuSpin *spin) { - return __sync_lock_test_and_set(&spin->value, true); +#ifdef CONFIG_TSAN + __tsan_mutex_pre_lock(spin, __tsan_mutex_try_lock); +#endif + bool busy = __sync_lock_test_and_set(&spin->value, true); +#ifdef CONFIG_TSAN + unsigned flags = __tsan_mutex_try_lock; + flags |= busy ? __tsan_mutex_try_lock_failed : 0; + __tsan_mutex_post_lock(spin, flags, 0); +#endif + return busy; } static inline bool qemu_spin_locked(QemuSpin *spin) @@ -239,7 +266,13 @@ static inline bool qemu_spin_locked(QemuSpin *spin) static inline void qemu_spin_unlock(QemuSpin *spin) { +#ifdef CONFIG_TSAN + __tsan_mutex_pre_unlock(spin, 0); +#endif __sync_lock_release(&spin->value); +#ifdef CONFIG_TSAN + __tsan_mutex_post_unlock(spin, 0); +#endif } struct QemuLockCnt { From patchwork Tue Jun 16 12:53:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188026 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3623228ilo; Tue, 16 Jun 2020 05:56:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgU1nvZhV1BbTPP52iyEApgRAhUj7RrtkWRg66Kg/adxl5JMejBo7io4W3gVIoUIB6rGDU X-Received: by 2002:a25:c5cf:: with SMTP id v198mr3841094ybe.6.1592312162006; Tue, 16 Jun 2020 05:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312162; cv=none; d=google.com; s=arc-20160816; b=mQ5s6VA/yxCgsaxQr2UEGoXaFW+7BDvS2IjQwqlZ/3rvRXIBFEfkaGj8kFqROLID+M pzZTxWm6WTFY3ociy3JtzatpkQqM4Lsflt+k3VHHxFmq9KEj0emFqvZQ2J5YTzSd5y52 DcKjFndw80RX+Em+3s1b/zJjgEuKZwbhBJ2Xuax8zOo3b0WpYwc1o0M68AfFVny3cisk 9R7O+K28GJQHzOq2+FiIFlsJqXQI1gtzpjaysQ7hGk0CPzT6EB8A1QMc2z0xYLx9f4XP ubAmkacwT51wFxHhjn84VvsBNUl1Y91v7iC8p3zO6G+C3kNDoWyjofghVRPlWA/JbwsC t3kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=ZF8nxDPqGAQcmXJyYMzLfCh6Ot6ocL6keiAmFZKEKrQ=; b=yZGkwOnbdXQrcvAvU+dr//u8SghMemNI3hw0ypEcieinX5iXMtHERcOm8RFHNd5nBY Lj2fAxulub6b8wLT9bYhuEPyKt/FVXMhtCT87vR6GTE15GAK7ZivsQhSMRsqP/i2nB3q CtNI3uC6N7TCObbwYT1Br4ycEbPOreofqnPFwYEMOi9PdQT1rvtAGouzObvRtZH932nk LBSubwTwT3ezvbvN4zrTLyA/A7gsCC2UWbsammUlamfY3hUlz45ESsrcy92wuBi/PrOH FpJjbhC8WhN2+jRA6NFgN+iSAI0uW9nmBkw0er5h4BQaY4Xpkl0W3G0Xv5BZRsG4H9g3 gIug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="XnFG/5kS"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h130si15396932ybc.75.2020.06.16.05.56.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 05:56:01 -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=fail header.i=@linaro.org header.s=google header.b="XnFG/5kS"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlB8D-0007Jt-Db for patch@linaro.org; Tue, 16 Jun 2020 08:56:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB63-000429-FM for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:47 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:53968) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5z-00007y-94 for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:47 -0400 Received: by mail-wm1-x343.google.com with SMTP id l26so2767484wme.3 for ; Tue, 16 Jun 2020 05:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZF8nxDPqGAQcmXJyYMzLfCh6Ot6ocL6keiAmFZKEKrQ=; b=XnFG/5kS2jOT+ORzax8hMcbXon+QR21ofSPedpmG2httOH3W3JaVlM4lzK96re8zeE O7na63RDhm4NIpn8BNzwuYu0orfZHlRx/6B+B95VrQDqfR9h2aOW2vee6WDnGBjkew8I PL9HjjZQpkXQ23Hzqw9Zs+/Or/Iiw9gaJplNJ2rzw0rtdHCEIajBlziRWeZa9N9Ll7tq M7tZulP62p+5RZF1KcVZnkI1IB385gUnadh4e5PS3ikl1fJLQC2ObzC3Tpczajdo599S p50znbL8G9kYraOUWTqa2d01uvgaXWfS0BdTzrJi4ivVwPbXJ1J60sw9nQMQP/Rnk0pO QHHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZF8nxDPqGAQcmXJyYMzLfCh6Ot6ocL6keiAmFZKEKrQ=; b=SzYaPut3gJWSOVKFZ5kQaF2sTJgWzoSBYEQqmpKLPj2B91FCy+rumOi4uO5254IFQX w/0MvfBtnbnXWIjn0WQtZL/XJMJratQ9FTzOyT0IN+tr0i5CxWloDQIRCIKEow3aAFbT s87A4Rr1AS4uHB+LxL/mwhq9QU058Dlh1rQS+UwBdl4aeoJi7yCKJ8UfHuIKzVKmJgfK P3obB2mfUlG2ggsoYp24BDSGlk8WdEHKbMLXPGu5p901OQ5SlengcySoLiBGWQYlmQgn ani7SgXKrCz+h5lgoBOItTUimJ2BfsN7ndCCg6hDkY+cNB3LafzOK/7cVKLo7eXFfPg3 EHBA== X-Gm-Message-State: AOAM530nwsSB50zOd5vJF541l+58sSDVZtCDZHjXySjq2llC1XbAE8TB AejnRdedLOnozAkIdhfvuredPw== X-Received: by 2002:a7b:c08e:: with SMTP id r14mr3292193wmh.78.1592312020795; Tue, 16 Jun 2020 05:53:40 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u12sm29164698wrq.90.2020.06.16.05.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6F39E1FF9B; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 12/21] tests/docker: Added docker build support for TSan. Date: Tue, 16 Jun 2020 13:53:15 +0100 Message-Id: <20200616125324.19045-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Added a new docker for ubuntu 20.04. This docker has support for Thread Sanitizer including one patch we need in one of the header files. https://github.com/llvm/llvm-project/commit/a72dc86cd This command will build with tsan enabled: make docker-test-tsan-ubuntu2004 V=1 Also added the TSAN suppresion file to disable certain cases of TSAN warnings. Cc: Fam Zheng Cc: Philippe Mathieu-Daudé Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-10-robert.foley@linaro.org> Message-Id: <20200612190237.30436-13-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker new file mode 100644 index 00000000000..6050ce7e8a8 --- /dev/null +++ b/tests/docker/dockerfiles/ubuntu2004.docker @@ -0,0 +1,65 @@ +FROM ubuntu:20.04 +ENV PACKAGES flex bison \ + ccache \ + clang-10\ + gcc \ + gettext \ + git \ + glusterfs-common \ + libaio-dev \ + libattr1-dev \ + libbrlapi-dev \ + libbz2-dev \ + libcacard-dev \ + libcap-ng-dev \ + libcurl4-gnutls-dev \ + libdrm-dev \ + libepoxy-dev \ + libfdt-dev \ + libgbm-dev \ + libgtk-3-dev \ + libibverbs-dev \ + libiscsi-dev \ + libjemalloc-dev \ + libjpeg-turbo8-dev \ + liblzo2-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libnfs-dev \ + libnss3-dev \ + libnuma-dev \ + libpixman-1-dev \ + librados-dev \ + librbd-dev \ + librdmacm-dev \ + libsasl2-dev \ + libsdl2-dev \ + libseccomp-dev \ + libsnappy-dev \ + libspice-protocol-dev \ + libspice-server-dev \ + libssh-dev \ + libusb-1.0-0-dev \ + libusbredirhost-dev \ + libvdeplug-dev \ + libvte-2.91-dev \ + libxen-dev \ + libzstd-dev \ + make \ + python3-yaml \ + python3-sphinx \ + sparse \ + texinfo \ + xfslibs-dev\ + vim +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES +RUN dpkg -l $PACKAGES | sort > /packages.txt +ENV FEATURES clang tsan pyyaml sdl2 + +# https://bugs.launchpad.net/qemu/+bug/1838763 +ENV QEMU_CONFIGURE_OPTS --disable-libssh + +# Apply patch https://reviews.llvm.org/D75820 +# This is required for TSan in clang-10 to compile with QEMU. +RUN sed -i 's/^const/static const/g' /usr/lib/llvm-10/lib/clang/10.0.0/include/sanitizer/tsan_interface.h diff --git a/tests/docker/test-tsan b/tests/docker/test-tsan new file mode 100755 index 00000000000..eb40ac45b7a --- /dev/null +++ b/tests/docker/test-tsan @@ -0,0 +1,44 @@ +#!/bin/bash -e +# +# This test will use TSan as part of a build and a make check. +# +# Copyright (c) 2020 Linaro +# Copyright (c) 2016 Red Hat Inc. +# +# Authors: +# Robert Foley +# Originally based on test-quick from Fam Zheng +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or (at your option) any later version. See the COPYING file in +# the top-level directory. + +. common.rc + +setup_tsan() +{ + requires clang tsan + tsan_log_dir="/tmp/qemu-test/build/tsan" + mkdir -p $tsan_log_dir > /dev/null || true + EXTRA_CONFIGURE_OPTS="${EXTRA_CONFIGURE_OPTS} --enable-tsan \ + --cc=clang-10 --cxx=clang++-10 \ + --disable-werror --extra-cflags=-O0" + # detect deadlocks is false currently simply because + # TSan crashes immediately with deadlock detector enabled. + # We have maxed out the history size to get the best chance of finding + # warnings during testing. + # Note, to get TSan to fail on warning, use exitcode=66 below. + tsan_opts="suppressions=/tmp/qemu-test/src/tests/tsan/suppressions.tsan\ + detect_deadlocks=false history_size=7\ + halt_on_error=0 exitcode=0 verbose=5\ + log_path=$tsan_log_dir/tsan_warning" + export TSAN_OPTIONS="$tsan_opts" +} + +cd "$BUILD_DIR" + +TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \ +setup_tsan +build_qemu +check_qemu +install_qemu diff --git a/tests/tsan/blacklist.tsan b/tests/tsan/blacklist.tsan new file mode 100644 index 00000000000..75e444f5dc6 --- /dev/null +++ b/tests/tsan/blacklist.tsan @@ -0,0 +1,10 @@ +# This is an example blacklist. +# To enable use of the blacklist add this to configure: +# "--extra-cflags=-fsanitize-blacklist=/tests/tsan/blacklist.tsan" +# The eventual goal would be to fix these warnings. + +# TSan is not happy about setting/getting of dirty bits, +# for example, cpu_physical_memory_set_dirty_range, +# and cpu_physical_memory_get_dirty. +src:bitops.c +src:bitmap.c diff --git a/tests/tsan/suppressions.tsan b/tests/tsan/suppressions.tsan new file mode 100644 index 00000000000..73414b9ebd9 --- /dev/null +++ b/tests/tsan/suppressions.tsan @@ -0,0 +1,14 @@ +# This is the set of runtime suppressions of TSan warnings. +# The goal would be to have here only items we do not +# plan to fix, and to explain why for each item. + +# TSan reports a double lock on RECURSIVE mutexes. +# Since the recursive lock is intentional, we choose to ignore it. +mutex:aio_context_acquire +mutex:pthread_mutex_lock + +# TSan reports a race betwen pthread_mutex_init() and +# pthread_mutex_lock(). Since this is outside of QEMU, +# we choose to ignore it. +race:pthread_mutex_init +race:pthread_mutex_lock From patchwork Tue Jun 16 12:53:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188038 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3631084ilo; Tue, 16 Jun 2020 06:05:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAhQuiTDZL8w2sirhYTiKWKAUSGtTNr4lxuV2lsJwQBLp2gI9dF5WGLgPHyF9HZ19H2FLt X-Received: by 2002:a25:cbd8:: with SMTP id b207mr4266688ybg.63.1592312716276; Tue, 16 Jun 2020 06:05:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312716; cv=none; d=google.com; s=arc-20160816; b=pg3TsheRDF8V7J06WoJwX2mlaemGnVhxZtpqYl1tQCzjgaqhtYQutH0T0FkrC5XLGS zUO6mMUeRBCEBkvOamCW939UpWdfiNYXXSVX/+S7GWmsTRn7hqIMmzH3F0MFtui8vJ6p aYltUyyF+tN9NDUfWtvYO+Hx21CxniokowA9LW4KseByx0ZUPEr2zNch4VwPMsDBC5pS iuUgzGKRPMxr19EDKbEIlGS7K+Alw0/M5mCFySe6O2E/xDG4GfjSl6wkhllQqtQQJFoO KY5i32MPktENuIK7LkK5JDF+N1QFteD80s1JeLTS4lKOPVNEXfPXo1XVzsIm/kc9UVSg Ww1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=Itxyoaw44xcsG2G02PfO8bbyKkEnWDH8+KPdnp0/sa4=; b=oE0sHa72a1JOfE5y8H35zuSqEoiLskaz5pnTT+svuaSZj1SmeNMhRn+10MFyFCYpPo heWaupEYkHp5Fvp08Uv8mpJhu772YwW/NxAlfPnGj+NPB27p9FQANLSp9Tuu0WGBznTS 6A4QNpnZnnAQeuCwtIndBX2xkZzW4AjamUtnoViPyBBii9k3BZBq3KddpLOoOREysK9V 9Dxvnl5D73B9mh6myYr6Gq7udppNiNjZHhS755X8HmIDGfBjUK5D7n5btEo1JSN+OILy yU/eS8YM7d3t0ueG7tZvqmVLBTqFvcdxtQ5N9Dj2PsoIROMrvaB1yGsFm+MtPPDAy6pk aFzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="PE1I/Yjn"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q6si16622780ybc.212.2020.06.16.06.05.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 06:05:16 -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=fail header.i=@linaro.org header.s=google header.b="PE1I/Yjn"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBH9-0004Mj-Ng for patch@linaro.org; Tue, 16 Jun 2020 09:05:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB61-0003xn-Pa for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:45 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:36399) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5z-00007t-9e for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:45 -0400 Received: by mail-wr1-x42e.google.com with SMTP id q11so20672592wrp.3 for ; Tue, 16 Jun 2020 05:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Itxyoaw44xcsG2G02PfO8bbyKkEnWDH8+KPdnp0/sa4=; b=PE1I/Yjn8jvd9/hwuoXdDg8B1L696DIf7cbWY7BlnuTWDAfL4RdNhosFTgLC4SrRJP 0hwFVTQHxdBuy9XbTRJIrb3LGiY2rIIcqjdXm8Ke+UK6XyRxZkWFRZpi7yapXWossMKz LUdGcz1oNh03+Em4qEfauixVbwVoeipxnoIGdAWLb1W3VpUuUG3TUGQkbBYFPa96GmV1 BW1Br0lPteODGxJlGxD7ZPf0M+uqMfbPHr/2wrg6xzVlI0LMEbPWqjGtz8QDu5BRkxja o6umSNpJE5FFP0UYIkKYUvpxnLzDTs9D2SyuZUwnKNlAAD30yq4RyhvUnvsJ5ShsxyQC 6/jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Itxyoaw44xcsG2G02PfO8bbyKkEnWDH8+KPdnp0/sa4=; b=AkSZjkECizN6Pk+nS/8ZEOzQITxjVjgCy723XzCbYh8Xif/ra/cWPgXL8725WZTSJB R+UyEzZE70h9bLJ8oKzVEx7jUMwcbKGbo0P9vKZ98xfjfbjwl8miACyO9BxfrlcwSpJ3 vReeuArF5oyPHZExiSN4ZQFdRFchzEpZt292OE6bxEZl/f0bgKw54Tptjt45jVMgKoL/ 0xDvUsp2ZZLP53l1N8fFq0nonCBDtnfS9D/AXeRIGr2jCcJjrGPFpZ9L2iXDExvIubi4 OZuIqRh7AWGg2peoOBbu7qG3eLqOW44TIXUUPAc62F/n2XVWSfjEgK5x6gU3Y8ifPg15 BzdQ== X-Gm-Message-State: AOAM530KamxT/NsUD4rf/wwD5x4GW2AzVMU6CifRaqjiiZnXANdguLFF 5koIGGpd+xRJkL0hKD090gSKgw== X-Received: by 2002:adf:e58c:: with SMTP id l12mr2969692wrm.34.1592312019758; Tue, 16 Jun 2020 05:53:39 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v66sm4123611wme.13.2020.06.16.05.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 855311FF9C; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 13/21] include/qemu: Added tsan.h for annotations. Date: Tue, 16 Jun 2020 13:53:16 +0100 Message-Id: <20200616125324.19045-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Emilio G . Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley These annotations will allow us to give tsan additional hints. For example, we can inform tsan about reads/writes to ignore to silence certain classes of warnings. We can also annotate threads so that the proper thread naming shows up in tsan warning results. Signed-off-by: Robert Foley Reviewed-by: Emilio G. Cota Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-11-robert.foley@linaro.org> Message-Id: <20200612190237.30436-14-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/qemu/tsan.h b/include/qemu/tsan.h new file mode 100644 index 00000000000..09cc665f91d --- /dev/null +++ b/include/qemu/tsan.h @@ -0,0 +1,71 @@ +#ifndef QEMU_TSAN_H +#define QEMU_TSAN_H +/* + * tsan.h + * + * This file defines macros used to give ThreadSanitizer + * additional information to help suppress warnings. + * This is necessary since TSan does not provide a header file + * for these annotations. The standard way to include these + * is via the below macros. + * + * Annotation examples can be found here: + * https://github.com/llvm/llvm-project/tree/master/compiler-rt/test/tsan + * annotate_happens_before.cpp or ignore_race.cpp are good places to start. + * + * The full set of annotations can be found here in tsan_interface_ann.cpp. + * https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/ + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifdef CONFIG_TSAN +/* + * Informs TSan of a happens before/after relationship. + */ +#define QEMU_TSAN_ANNOTATE_HAPPENS_BEFORE(addr) \ + AnnotateHappensBefore(__FILE__, __LINE__, (void *)(addr)) +#define QEMU_TSAN_ANNOTATE_HAPPENS_AFTER(addr) \ + AnnotateHappensAfter(__FILE__, __LINE__, (void *)(addr)) +/* + * Gives TSan more information about thread names it can report the + * name of the thread in the warning report. + */ +#define QEMU_TSAN_ANNOTATE_THREAD_NAME(name) \ + AnnotateThreadName(__FILE__, __LINE__, (void *)(name)) +/* + * Allows defining a region of code on which TSan will not record memory READS. + * This has the effect of disabling race detection for this section of code. + */ +#define QEMU_TSAN_ANNOTATE_IGNORE_READS_BEGIN() \ + AnnotateIgnoreReadsBegin(__FILE__, __LINE__) +#define QEMU_TSAN_ANNOTATE_IGNORE_READS_END() \ + AnnotateIgnoreReadsEnd(__FILE__, __LINE__) +/* + * Allows defining a region of code on which TSan will not record memory + * WRITES. This has the effect of disabling race detection for this + * section of code. + */ +#define QEMU_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN() \ + AnnotateIgnoreWritesBegin(__FILE__, __LINE__) +#define QEMU_TSAN_ANNOTATE_IGNORE_WRITES_END() \ + AnnotateIgnoreWritesEnd(__FILE__, __LINE__) +#else +#define QEMU_TSAN_ANNOTATE_HAPPENS_BEFORE(addr) +#define QEMU_TSAN_ANNOTATE_HAPPENS_AFTER(addr) +#define QEMU_TSAN_ANNOTATE_THREAD_NAME(name) +#define QEMU_TSAN_ANNOTATE_IGNORE_READS_BEGIN() +#define QEMU_TSAN_ANNOTATE_IGNORE_READS_END() +#define QEMU_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN() +#define QEMU_TSAN_ANNOTATE_IGNORE_WRITES_END() +#endif + +void AnnotateHappensBefore(const char *f, int l, void *addr); +void AnnotateHappensAfter(const char *f, int l, void *addr); +void AnnotateThreadName(const char *f, int l, char *name); +void AnnotateIgnoreReadsBegin(const char *f, int l); +void AnnotateIgnoreReadsEnd(const char *f, int l); +void AnnotateIgnoreWritesBegin(const char *f, int l); +void AnnotateIgnoreWritesEnd(const char *f, int l); +#endif From patchwork Tue Jun 16 12:53:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188031 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3625886ilo; Tue, 16 Jun 2020 06:00:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXbKXz1QZGPNhGmI9l4TIxjETqXhb88zBPBAjaufzh33VGY23nElqPFmqjtBvW7J34Lem0 X-Received: by 2002:a25:be11:: with SMTP id h17mr3842866ybk.179.1592312418324; Tue, 16 Jun 2020 06:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312418; cv=none; d=google.com; s=arc-20160816; b=eutJsUNrcZSxicU0ofq09US+qv7S6PWgsAVZMLaj6QvM/UpAyIXV+Rz8Q2RkX18Fsz qH++sSBkaK21AFTxImVjQhd8jjIwlGZ+Diahc94bfmZec6YjY328+XqpKpthiFzHHGwy ovk7j+HO8vtljsz5AZdo4IuRGl2wtcQ9vNZUPZPbc55qb8ouBLr2ZhxArwzk7JgXzca0 Cwfkz2O2Za4SXM4OPFDg8fSnCgbR8McvfDIj5LdjrYy2IYO6yLH/ISfs8NtaTM2QzD+O FpFmmho0Z8oDLLXwBdPap6AWGunynzE+gH/ZzSnqsiYuuINoKlvTb36Y+SEIbgBnilgE PpQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=J/tbW+i3GK+A8UpzokTnJFqdsmmwLI1SX+zoA10BfeE=; b=ItEBV9kMF5N1v27hjcrcFySQ9mMWMX4ZrugI3I744qCgsmZD2HqXnfL5Xh25cePiWE zaRSPinvQYL0d+N7YlDErSTm4PtZtMlyFLtOLuI2aK13TtlrRXIIwlQ1K4gCKDiFmlg+ Qz/hFUcywBY5M3kBVYt/hZ5zLvjbFyuuX84BEeog0uu+/t2zAnWGFW0SzPJExri5BgmK 2xUn7RFb1SN0A8XMSkObWVOD5xldbcRP6/MCtucnvhwIyChkoFfUoch7Vb9Sqpw3u34e JiAZE/UVXlBpRAgFoJhxRY7Jj6H3JLO1m0OBi6sJdLAbmVBoLDSZxQ95BCJblm7oi5cM YOVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ytg0oS0j; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n66si17042649yba.117.2020.06.16.06.00.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 06:00:18 -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=fail header.i=@linaro.org header.s=google header.b=Ytg0oS0j; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBCK-0005lo-Lc for patch@linaro.org; Tue, 16 Jun 2020 09:00:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB63-000415-11 for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:47 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:53048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB5z-000087-Ej for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:46 -0400 Received: by mail-wm1-x333.google.com with SMTP id r9so2774621wmh.2 for ; Tue, 16 Jun 2020 05:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J/tbW+i3GK+A8UpzokTnJFqdsmmwLI1SX+zoA10BfeE=; b=Ytg0oS0jVZvQeJb8RGmc6eZGzcOBOA6kX1hsaLi4wA7sQv1mxiVj3OOFVGCqV4nlBR suTZfR/LL1M5Mgzs7ZkP7n8zTjAgoZi3DW2hTbrBIYfOozl4pbFiB69K38bGcLfUSOGt dWoe0q0f12B+zp/vxlxTHBKTseuzkaKj6oj6QyDszOYctKuKLmOWec6plxsHZksNYYdf j0qHrdoTVI8x+0Cxw9OHu7hDzX5S7usscE4a5O7Bgw7JHCeqqooSQczYrsSZmJKxC0oy VoiYtM8FSZyXT3Vt8w+uJnVIPyN1Ab8Z/bzosxjokfCM7TvdKN2soLnYb+8DCKtl6tb7 hQow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J/tbW+i3GK+A8UpzokTnJFqdsmmwLI1SX+zoA10BfeE=; b=Y7L0gERqRq6t0oa/EFFbyKeBGWSxb1hVx+QDwVuGOLZJ/N7lw9JyC98icgdmkQ99cK UU1hP5NYMvP5ab9wxp6z8MtGIQbiEbzHx6CC8bedyJWljWdmccU7402t4nUKEohA5azB 5nxBttsSvlUjfum+4I80aJ+OpPfSPOnL6tQpoEToXylNihHazsD2Bc7A2Jf+b9/vO2/D OE0nzwVjooR4p4Q7NONn6Ab6NVWzFvMcloUodf6+frGo3K3saL0aR4Pr8NYXvRUhbkcO dN4fyY5q1rCjcJwBrMzLrLJhwTq2Mftlnh4upZ9Vev+/qNvVeRqk28cs8xgSQeoZ1gfh bD7w== X-Gm-Message-State: AOAM532pDKYFqu8iOgii/2xIFxi/wYdNEAVCxwI22TlbSY2HKyAuqoBI 36wi989AYKzmaR4WxGJd3kdpOQ== X-Received: by 2002:a05:600c:218b:: with SMTP id e11mr3130276wme.162.1592312021986; Tue, 16 Jun 2020 05:53:41 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c16sm29501139wrx.4.2020.06.16.05.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 99D511FF9D; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 14/21] util: Added tsan annotate for thread name. Date: Tue, 16 Jun 2020 13:53:17 +0100 Message-Id: <20200616125324.19045-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , "Emilio G . Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley This allows us to see the name of the thread in tsan warning reports such as this: Thread T7 'CPU 1/TCG' (tid=24317, running) created by main thread at: Signed-off-by: Robert Foley Reviewed-by: Emilio G. Cota Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-12-robert.foley@linaro.org> Message-Id: <20200612190237.30436-15-alex.bennee@linaro.org> -- 2.20.1 diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 838980aaa55..b4c2359272a 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -15,6 +15,7 @@ #include "qemu/atomic.h" #include "qemu/notify.h" #include "qemu-thread-common.h" +#include "qemu/tsan.h" static bool name_threads; @@ -513,6 +514,7 @@ static void *qemu_thread_start(void *args) # endif } #endif + QEMU_TSAN_ANNOTATE_THREAD_NAME(qemu_thread_args->name); g_free(qemu_thread_args->name); g_free(qemu_thread_args); pthread_cleanup_push(qemu_thread_atexit_notify, NULL); From patchwork Tue Jun 16 12:53:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188036 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3630143ilo; Tue, 16 Jun 2020 06:04:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvvZaC+mkMVxnc+I/kEAdlkHylRsPG8k3JdX/j9mlg44H/KasxmVP1GsSRyuUIoAmmY38U X-Received: by 2002:aed:2ca5:: with SMTP id g34mr21706124qtd.13.1592312655666; Tue, 16 Jun 2020 06:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312655; cv=none; d=google.com; s=arc-20160816; b=htkVDE3u4e12XGZhxG4w/lUS82xo713i6vEE9FAP5yL+it3E7S7YK/d6iSBLnFxY5S qjyKHxLxMOaFBQIlrQJ8FC9HUBykytjXGGSApebynmb2tSHRBLIPO86C00pDsgEPao1Q EGADCjOiLi90T8zconwmmGwjDlHypSP95S3RjDEYvlYCIPfbTCQ/TPVPV3yWik4LJU+6 UEuZ/yLjy6ROOJX5gN01D6ZOuQgEZ3WRsOFMspNMyoEJK3XX6DVoKCICE/SI1MHlRyfD rtjABqndbq8eO/eCRdrtQqNgvzvCdj34FxJWZEzjmL9LqplEJMLu88ur/e2PN8LncxNX XCcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=1xJcLKKf4A1w+f4XuWFSl147HgeADv1qlqWle+NmUxo=; b=i7L2wSb2NXSR1Cqcwbx8exeX9+EiEI+6H/IviuHlioEq5a/7SECQDHCDFi2q03jSx1 HtC74twP1Uc5PrwtIJoVuGBQPaANYK8xp8YMAs1OzMsBB1TZ/aVFWsJJte8VvVSzCy2A /ZI3OCgamYfvE2/kkEK9XxlpA5LkklMue3qhQK0fk+scsRn8Fd1dSzC5C2TX1yrG7M5Z u58WX8Dxy0rZlmyPDEHC9o2LKqxaCr7xpElAa/sTYNaVy/IMSBM/xZIyouq+NyY2GBeI n92YYiInY5q0PNIRiS8sthfe0xeRgfvkSl1XUJ4LkBIlkmlHYJObbk0jU9xmyqMc8dnR 9AYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sJtqT0pu; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p6si10391347qta.119.2020.06.16.06.04.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 06:04:15 -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=fail header.i=@linaro.org header.s=google header.b=sJtqT0pu; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBGB-0002a4-0l for patch@linaro.org; Tue, 16 Jun 2020 09:04:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlBDc-00083b-4G for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:36 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:51694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlBDa-0001bl-3E for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:35 -0400 Received: by mail-wm1-x32a.google.com with SMTP id b82so2809156wmb.1 for ; Tue, 16 Jun 2020 06:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1xJcLKKf4A1w+f4XuWFSl147HgeADv1qlqWle+NmUxo=; b=sJtqT0puhEWoszXMqX9aeptZkemZ8XLl/+Cx29hrq4TqhIcJVLNe7pKkqfJNpAb7yB 1SE/uJtLHueCJfCdOdgyupGVaIYdazyk3Uvyjm1sJzzkSa9kvXvGfvz4JwlVjSZkugZ6 S2AEjqwzPD6imJv5ondgxKenQWAGm5vV0WJw0uYv/zfKX/MkaHzyhLtKP8UK6H7yh3GE 6sofrLMR9t1PM2j3gQ3+u2r4Vizb+u7UDL9i7QjLuYWxYDWNogzC8hiUNEBSG6yGZJYf qdy66BjrXbIIWuac7tAegNfnL39qKHmAh9APRMHLVcH0Jqudu9tI0J0SNYuv9T3LOF0Y onuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1xJcLKKf4A1w+f4XuWFSl147HgeADv1qlqWle+NmUxo=; b=N2rXNzP4RK22ZGY41tdyn94MGQEBovZsRDYngo2SfnBYurV3u97WCZSepVlDLWtBEq LPSWMCC7d+iH0coMArefrBwNJBOEvk8POdCwRa4A9JdtVB9Rkq+NfN0zWPFRwyAs/xWg bFEAkE9cU4F/RmIxRVCbcXjOh22h5DoNdbfR719CqDpg7uM7aGvH4zd8mdaDijY63ZnY jOY8VFqTmYRic5Xw6Y2iKSDE15g5LohXdxikNNvAob+uTF3pig9LK2tSiVN89vbEVVgM cgPAfG/Jq1TSxU4y8VXMIxskILW3VVTJmwRekvZPWViguG67MGQMSIuhD0JkfUKRG3hA E5Ug== X-Gm-Message-State: AOAM531mu+ZAgLSsspjkF825AH747E9lAWdrus5ZVLAnoiqLoW5QR/v3 8FvA140VFKyq/E56oHPWv9TlKw== X-Received: by 2002:a1c:9613:: with SMTP id y19mr3035700wmd.135.1592312492438; Tue, 16 Jun 2020 06:01:32 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 185sm3870497wmz.22.2020.06.16.06.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 06:01:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AF3A41FF9E; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 15/21] docs: Added details on TSan to testing.rst Date: Tue, 16 Jun 2020 13:53:18 +0100 Message-Id: <20200616125324.19045-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Emilio G . Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Adds TSan details to testing.rst. This includes background and reference details on TSan, and details on how to build and test with TSan both with and without docker. Signed-off-by: Robert Foley Reviewed-by: Emilio G. Cota Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-13-robert.foley@linaro.org> Message-Id: <20200612190237.30436-16-alex.bennee@linaro.org> -- 2.20.1 diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 770a987ea42..c1ff24370bf 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -397,6 +397,113 @@ list is in the ``make docker`` help text. The frequently used ones are: * ``DEBUG=1``: enables debug. See the previous "Debugging a Docker test failure" section. +Thread Sanitizer +================ + +Thread Sanitizer (TSan) is a tool which can detect data races. QEMU supports +building and testing with this tool. + +For more information on TSan: + +https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual + +Thread Sanitizer in Docker +--------------------------- +TSan is currently supported in the ubuntu2004 docker. + +The test-tsan test will build using TSan and then run make check. + +.. code:: + + make docker-test-tsan@ubuntu2004 + +TSan warnings under docker are placed in files located at build/tsan/. + +We recommend using DEBUG=1 to allow launching the test from inside the docker, +and to allow review of the warnings generated by TSan. + +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: + +.. code:: + + sed -i 's/^const/static const/g' \ + /usr/lib/llvm-10/lib/clang/10.0.0/include/sanitizer/tsan_interface.h + +To configure the build for TSan: + +.. code:: + + ../configure --enable-tsan --cc=clang-10 --cxx=clang++-10 \ + --disable-werror --extra-cflags="-O0" + +The runtime behavior of TSAN is controlled by the TSAN_OPTIONS environment +variable. + +More information on the TSAN_OPTIONS can be found here: + +https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags + +For example: + +.. code:: + + export TSAN_OPTIONS=suppressions=/tests/tsan/suppressions.tsan \ + detect_deadlocks=false history_size=7 exitcode=0 \ + log_path=/tsan/tsan_warning + +The above exitcode=0 has TSan continue without error if any warnings are found. +This allows for running the test and then checking the warnings afterwards. +If you want TSan to stop and exit with error on warnings, use exitcode=66. + +TSan Suppressions +----------------- +Keep in mind that for any data race warning, although there might be a data race +detected by TSan, there might be no actual bug here. TSan provides several +different mechanisms for suppressing warnings. In general it is recommended +to fix the code if possible to eliminate the data race rather than suppress +the warning. + +A few important files for suppressing warnings are: + +tests/tsan/suppressions.tsan - Has TSan warnings we wish to suppress at runtime. +The comment on each supression will typically indicate why we are +suppressing it. More information on the file format can be found here: + +https://github.com/google/sanitizers/wiki/ThreadSanitizerSuppressions + +tests/tsan/blacklist.tsan - Has TSan warnings we wish to disable +at compile time for test or debug. +Add flags to configure to enable: + +"--extra-cflags=-fsanitize-blacklist=/tests/tsan/blacklist.tsan" + +More information on the file format can be found here under "Blacklist Format": + +https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags + +TSan Annotations +---------------- +include/qemu/tsan.h defines annotations. See this file for more descriptions +of the annotations themselves. Annotations can be used to suppress +TSan warnings or give TSan more information so that it can detect proper +relationships between accesses of data. + +Annotation examples can be found here: + +https://github.com/llvm/llvm-project/tree/master/compiler-rt/test/tsan/ + +Good files to start with are: annotate_happens_before.cpp and ignore_race.cpp + +The full set of annotations can be found here: + +https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/tsan/rtl/tsan_interface_ann.cpp + VM testing ========== From patchwork Tue Jun 16 12:53:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188033 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3628174ilo; Tue, 16 Jun 2020 06:02:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGU5zbSyl+ijvICfq1OgVncJjd6i585kqKC9UKpx0Aw6XvU/FeP+wa/gRcfB6qkSZpSa2f X-Received: by 2002:a0c:f447:: with SMTP id h7mr2126678qvm.198.1592312545530; Tue, 16 Jun 2020 06:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312545; cv=none; d=google.com; s=arc-20160816; b=xoK9T1DfnpdBZA2nukovnjPJsh2JBXA1pufRKxB6CbETD1g7MuI0QQQeSRk3xPTcgy DIEoaZrug7aL9YmEWK7BLbP2uylAn7PcbU8CijuqHa+QXacsSTx4wqA7wG3l9/5QBbAs bvaOVquyqkVbMqovUMYdy+90zlC2k9nt+lUXZefKphVMqkmowKgNmDgBf1TJilm8M4mW dqZNLmAkWVsLTeKE6o/XZveQ/4QbM1MoVYjOKMSGz6PZqJvbWr5IjPvOSJuvV/0v+D+L vNLIwUL5qSKtTnEpeTmCM3j3BFG18I9AwKNtkwWKHCcgyhWvMTQm6uBPoDJHYFLZv28R LwKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=9XedwggDKQfNxmposMH4fQX7sPemUGNkbKr4QfRYHA4=; b=LUE4KylazdubFnBrE7taM1ImjpMPO76j83yXliAB7tf552WA+QEwgmNEMyADjOc2xF iHo/7Xd5kmk9X6EcC3/vOnGTPgY4Ct1Vh+ValJTGog1hnlNR/VFRMurLgUNhnsqcm9a7 4Yi7Kao9S7HQ8OFOHVYQ0k+z3V/BypQZSDgG4G4HGSY+D6ilPIAkRts9PGjQ1kgO6IZ1 V1Ek4W0Ak3rmBEBPNZTvpD7NZp4RVRA/mftgUXq1KOJMyruzxc9amhLPq4H5buYTb4mt +pEX2P1VX3y409m8adHNcOwtnEp7KH6crPYD22dKUZVR7ScpX3N7USIRz/AVZhhN3l+g 9TWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eweEZtO0; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v43si10318868qtb.94.2020.06.16.06.02.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 06:02:25 -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=fail header.i=@linaro.org header.s=google header.b=eweEZtO0; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBEO-0008W1-RI for patch@linaro.org; Tue, 16 Jun 2020 09:02:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlBDe-00086y-SK for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:38 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:33334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlBDb-0001bz-2L for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:38 -0400 Received: by mail-wm1-x329.google.com with SMTP id j198so2234863wmj.0 for ; Tue, 16 Jun 2020 06:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9XedwggDKQfNxmposMH4fQX7sPemUGNkbKr4QfRYHA4=; b=eweEZtO0xq6/T9zZ37JJQtqmHqA782Mz/gdbopt5aSKTcoQfaH9qKG1C4STBtkXyv2 v0agyMGjQG2PmTAZ8XdT3Us8uC09UDICZutn0EOO4V1yOK0LjvcZhorP2iCVKgufJoFv D+Lb38hcLOfgVGVHVVEZ0MsoBmqfmdC+svM6Rj3a4/gajKX4EpqkxGoWh7BEP87vE5AR oo6wEqkE3CRN7Q/0km1+Y4fDz8t1TI8JpiElABn/1zDqrF5O0r+misE0orspX9MTRG/2 Y5soAzHYaJPH5ntGDv90eqV3sW06TPw19dYYOm3ShFBXGW8ANNBCZCvh4QG5jEXH6wbt bcNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9XedwggDKQfNxmposMH4fQX7sPemUGNkbKr4QfRYHA4=; b=kBT350a+/I9mmgHpUlhy7ElZTtQMc+Ho2vTzjVoAN4lMuV9pQdyB5SL7akxtpFsC/I E2T7pfyfnijxJlcrvrlo6JrBOQY9MAZN08k8hmnlnsy3SN0sR95HsTbqXlGJWcnZnUVs OojGK4tIHFF8bVdlU7Dfy0vXaUEDFAqTKnppbYnmbjB5WhFXXtvy1p58eOTlszVHiT4Z 6G0KusFcn3n260A9rbVVCqUdRbC/tgl8I+iHBvrfXaoib8SVPA618+jhmvGwTd8jU/eY OqXuWPTtcKlrQnNYTViV+CDdTc1DWLL8ktjC5v2qd5jRgSrhMBiBD43+gqC+xRtN9vbw KBvw== X-Gm-Message-State: AOAM532nyteGCjBT6wsTXKMSA6Cf16kfanCCX7SMkznPgaqECmATbxuJ n74OELXM5RyVk5MgNlwz6JC3Vg== X-Received: by 2002:a7b:cd94:: with SMTP id y20mr3035370wmj.87.1592312493522; Tue, 16 Jun 2020 06:01:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 185sm3870503wmz.22.2020.06.16.06.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 06:01:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C82E31FF9F; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 16/21] tests: Disable select tests under TSan, which hit TSan issue. Date: Tue, 16 Jun 2020 13:53:19 +0100 Message-Id: <20200616125324.19045-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , Robert Foley , qemu-devel@nongnu.org, "Emilio G . Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Disable a few tests under CONFIG_TSAN, which run into a known TSan issue that results in a hang. https://github.com/google/sanitizers/issues/1116 The disabled tests under TSan include all the qtests as well as the test-char, test-qga, and test-qdev-global-props. Signed-off-by: Robert Foley Reviewed-by: Emilio G. Cota Signed-off-by: Alex Bennée Message-Id: <20200609200738.445-14-robert.foley@linaro.org> Message-Id: <20200612190237.30436-17-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/Makefile.include b/tests/Makefile.include index 5607c7290d8..3f4448a20bc 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -55,7 +55,6 @@ SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \ check-unit-y += tests/check-qdict$(EXESUF) check-unit-y += tests/check-block-qdict$(EXESUF) -check-unit-$(CONFIG_SOFTMMU) += tests/test-char$(EXESUF) check-unit-y += tests/check-qnum$(EXESUF) check-unit-y += tests/check-qstring$(EXESUF) check-unit-y += tests/check-qlist$(EXESUF) @@ -108,7 +107,6 @@ check-unit-y += tests/test-qht$(EXESUF) check-unit-y += tests/test-qht-par$(EXESUF) check-unit-y += tests/test-bitops$(EXESUF) check-unit-y += tests/test-bitcnt$(EXESUF) -check-unit-$(CONFIG_SOFTMMU) += tests/test-qdev-global-props$(EXESUF) check-unit-y += tests/check-qom-interface$(EXESUF) check-unit-y += tests/check-qom-proplist$(EXESUF) check-unit-y += tests/test-qemu-opts$(EXESUF) @@ -123,9 +121,16 @@ check-speed-$(CONFIG_BLOCK) += tests/benchmark-crypto-cipher$(EXESUF) check-unit-$(CONFIG_BLOCK) += tests/test-crypto-secret$(EXESUF) check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tlscredsx509$(EXESUF) check-unit-$(call land,$(CONFIG_BLOCK),$(CONFIG_GNUTLS)) += tests/test-crypto-tlssession$(EXESUF) +ifndef CONFIG_TSAN +# Some tests: test-char, test-qdev-global-props, and test-qga, +# are not runnable under TSan due to a known issue. +# https://github.com/google/sanitizers/issues/1116 +check-unit-$(CONFIG_SOFTMMU) += tests/test-char$(EXESUF) +check-unit-$(CONFIG_SOFTMMU) += tests/test-qdev-global-props$(EXESUF) ifneq (,$(findstring qemu-ga,$(TOOLS))) check-unit-$(call land,$(CONFIG_LINUX),$(CONFIG_VIRTIO_SERIAL)) += tests/test-qga$(EXESUF) endif +endif check-unit-$(CONFIG_SOFTMMU) += tests/test-timed-average$(EXESUF) check-unit-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_INOTIFY1)) += tests/test-util-filemonitor$(EXESUF) check-unit-$(CONFIG_SOFTMMU) += tests/test-util-sockets$(EXESUF) diff --git a/tests/qtest/Makefile.include b/tests/qtest/Makefile.include index 5023fa413d1..98af2c2d933 100644 --- a/tests/qtest/Makefile.include +++ b/tests/qtest/Makefile.include @@ -314,12 +314,15 @@ tests/qtest/tpm-tis-device-test$(EXESUF): tests/qtest/tpm-tis-device-test.o test # QTest rules TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS))) +QTEST_TARGETS = +# The qtests are not runnable (yet) under TSan due to a known issue. +# https://github.com/google/sanitizers/issues/1116 +ifndef CONFIG_TSAN ifeq ($(CONFIG_POSIX),y) QTEST_TARGETS = $(TARGETS) check-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y:%=tests/qtest/%$(EXESUF))) check-qtest-y += $(check-qtest-generic-y:%=tests/qtest/%$(EXESUF)) -else -QTEST_TARGETS = +endif endif qtest-obj-y = tests/qtest/libqtest.o $(test-util-obj-y) From patchwork Tue Jun 16 12:53:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188040 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3634244ilo; Tue, 16 Jun 2020 06:08:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy86qJ9fAzJXvSzvXvSNOkSxOxbDdtnv5JzwA8N2HaRup517mhgNhrZuxFn2HAEq9c+jO21 X-Received: by 2002:a25:d354:: with SMTP id e81mr4411159ybf.398.1592312892771; Tue, 16 Jun 2020 06:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312892; cv=none; d=google.com; s=arc-20160816; b=YU0yDeDHtscSHerWxz6B9/16EV9y49RaUgNf8VXcYr/TdOQwqTuJzBm/KT2o0wYu8y qi9mTj9t/zKz8Y8V8VYkZ6S7JFTg72NfdRnRjXFDo2d8M1KJLT66cKBEkxOKiMHRlYNB V9jPPpFS4MWhTlKGohZqFVFl9Kr0UsMu281frKGcxEZPeKoG7qHTT2G8r0/k2KEAgJLA 5vHbjODSgwecuAL1kpq9OghkHBkl8pt1F9ufUUyRrOgjQR76PGGE5tUf9HuoV9SMtlpj S7mTedk4+LkQSptFt0phLVxSDCZ82t1F/yQt+Y0uUuUMotDv5VRlBvcBzX0Rt05y7Ww8 ygmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=pebc1rvm4QpzZR21Sv9G/9W/4CetnSIYeIw8sTyXjd8=; b=xcb39CyW556cJFLsuzlRqYheoEh5wrBnJ6xGbCswm+LQ8hzw1r5XVDLD42BnEOeZd+ ucqSaE5IJmICYC1slWS8a1PZkCPINiOE/ubydT0k+K6JmK4cyTdV2/rRbaRLw7PFYkeg Wo5UnBQ/Kw12muh481V9fdTTgX71SepDsvOTpXKTa7yClM3+VplX2+3uGffvyiIau87e Z3gfk6aF62NVEFeY0U9diPILqrSH1UBLrjlIKFz7GFQtXspKv0CKKtDIlzvDipOWKGeV AtecNXsuvblU0l8MK5JszA42XxSBmVxywzsnb/a3Rnr1O3y1UWEeu8SE19J6H/AFQGFe y5ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JoztH67s; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l124si13343363ybb.154.2020.06.16.06.08.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 06:08:12 -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=fail header.i=@linaro.org header.s=google header.b=JoztH67s; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBK0-0000H1-4Q for patch@linaro.org; Tue, 16 Jun 2020 09:08:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlBDf-00087N-43 for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:39 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:39453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlBDY-0001bV-LH for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:38 -0400 Received: by mail-wm1-x332.google.com with SMTP id t194so2967128wmt.4 for ; Tue, 16 Jun 2020 06:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pebc1rvm4QpzZR21Sv9G/9W/4CetnSIYeIw8sTyXjd8=; b=JoztH67sruTVc+HlvaSpbiEdM3QOY1QEOIbOzLuOGoGZjtmNo3NxXsxHyfjO6gAOil baxzFGq1/juM7hTJdGMWS6Qi94yos46TYFZyuoIvkYu2pR0C48wrEmsdW+j69VyyZ1vv +33AIhV+frDAXOZHMuHUiH6x91ZUNTNj7XWF59vUEp8xJQlkL1LPgPtuHOkI1H+VptGf 8iOIy8JWQglQ3hO0Sd0wYVmCJmLLWY8x45TvfX6aATXWmc3A1+lI9ScFwpgud84zC15c bdRZ/jhTEW2yVcs5o/8AIY6iKipqN2gaB20+uuYz7oJ4mtu+10jbXZJRUMbaxD5MxddT 9liQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pebc1rvm4QpzZR21Sv9G/9W/4CetnSIYeIw8sTyXjd8=; b=kxN779+6/j0DkWug/Aa8qgD/tLRx2J2qw35sO4iSeyKgGmmTeCchj5/eUhKnV5gLpU sT+/qD975bPu3onmzeZsr1jNzZI9LScZC3kyvxVNuHqmGXZ6x0hKnwUWiAtovP6eA1K5 +uo0zI4ETInsqx74UEmQUYwmce6oC6Oe7KUUJcorVlrKheIWTlt4ZtLzOxCWss7jRc1w XzcSm7YZYXcRqXAzcKNjLpFQc25CXwuGy160HldoLWvdvmw0e8W3pbXJAljqm4mPwCdP Fkmy68VDdgJN2LRrZdEVW52vI6byvqeMqDQX5PWhT+m8FBoi4FaXGyG4wNr5aT06xEhE IboA== X-Gm-Message-State: AOAM532cKaVmVfWHyb08Vw3Fniauk2TBZJ7Ar5U5I0MAJi9Crzhm0ZXp ZdBOq9OFzbddyDLS2ayDlBdqlA== X-Received: by 2002:a7b:c852:: with SMTP id c18mr3246107wml.77.1592312491268; Tue, 16 Jun 2020 06:01:31 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 23sm4003300wmo.18.2020.06.16.06.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 06:01:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DDC9F1FFA5; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 17/21] Revert ".shippable: temporaily disable some cross builds" Date: Tue, 16 Jun 2020 13:53:20 +0100 Message-Id: <20200616125324.19045-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This reverts commit 12d43b5ae916809aad9ccf8aa2a0a06260527340. Signed-off-by: Alex Bennée Message-Id: <20200612190237.30436-18-alex.bennee@linaro.org> -- 2.20.1 diff --git a/.shippable.yml b/.shippable.yml index 10cf219bff4..2cce7b56890 100644 --- a/.shippable.yml +++ b/.shippable.yml @@ -5,8 +5,8 @@ env: global: - LC_ALL=C matrix: - # - IMAGE=debian-amd64 - # TARGET_LIST=x86_64-softmmu,x86_64-linux-user + - IMAGE=debian-amd64 + TARGET_LIST=x86_64-softmmu,x86_64-linux-user - IMAGE=debian-win32-cross TARGET_LIST=arm-softmmu,i386-softmmu,lm32-softmmu - IMAGE=debian-win64-cross @@ -19,10 +19,10 @@ env: TARGET_LIST=aarch64-softmmu,aarch64-linux-user - IMAGE=debian-s390x-cross TARGET_LIST=s390x-softmmu,s390x-linux-user - # - IMAGE=debian-mips-cross - # TARGET_LIST=mips-softmmu,mipsel-linux-user - # - IMAGE=debian-mips64el-cross - # TARGET_LIST=mips64el-softmmu,mips64el-linux-user + - IMAGE=debian-mips-cross + TARGET_LIST=mips-softmmu,mipsel-linux-user + - IMAGE=debian-mips64el-cross + TARGET_LIST=mips64el-softmmu,mips64el-linux-user - IMAGE=debian-ppc64el-cross TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user build: From patchwork Tue Jun 16 12:53:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188039 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3632659ilo; Tue, 16 Jun 2020 06:06:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTmcuhmEJ0i806ScI5lzFu0YeOPx2B56GnXIi6zQyhUDm4MfyXbW4l2juRPyahZx90xR6L X-Received: by 2002:a25:2e48:: with SMTP id b8mr4176214ybn.521.1592312806020; Tue, 16 Jun 2020 06:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312806; cv=none; d=google.com; s=arc-20160816; b=UvXWJ09QB5xypFNo4Eia79olkCk2LH5FrCn0GBBfKBEH65+A4OZU3fIN025tv6dkpE 0M0KG6ARTnPeu8iIC0Fw3hmsEVIFQIpglbvZpm0gJppNwErmQPgLMEaLhg64AmAEMTdP pJyoWjB3VbEZzaoG29ldmjm95JrBmQhnIRkWx0hRL8qeZT9jgaqP1RE7r34ctApeRMgO 1wQWkUOsa3Acy1fZOtj4xd32JlHz4SrchHehe5KonLIvC4tjtdP2w3UUz+q9aHvAZFBU 67vhvFpmiegk3Bn4RQ39tqViUstluAP3q98W3ey9L2/2PGvbHd6i6Rl/UDq6cYfp4Lnu 8a9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=e785/2ytWUq6m1CZckPntnQd1feVAR6FA8r2SV7OZRA=; b=B95zn+gg46UofzRE/ReRQymCwRU16tEhQr1JYU59AqiWWOQNhj01K3AlG0nuLz2egG eV5oiLvPYdxHfQM7r4MX0j3qzFdW9jPrsiQ4hqCxB+HAxH+kusjvixU7tOGFMJF++k4a 4ZDiSwRo++Af5XRfruHMFUbP8r97AON18/S5m273WrAF/Yeq/Zcj/NMCcqNTy7b2a1Cs YZObbAGYdqZI+2LKpSGl0oYEk6fCgvwnT5dtPYFt9QrHUnlP1BlgE+4FbDC3/SmRI0iE 5pENEjYZSVSNVVqWKtdKbFFVc19Ze6YIRjZptEoG3qVAP3Esz7l4BjZhdjb7zG5tlv01 59Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Izno5A/E"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d38si17839501ybe.81.2020.06.16.06.06.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 06:06:46 -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=fail header.i=@linaro.org header.s=google header.b="Izno5A/E"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBIb-00073K-H3 for patch@linaro.org; Tue, 16 Jun 2020 09:06:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlBDd-00085p-L0 for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:37 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:35185) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlBDb-0001c6-Rd for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:37 -0400 Received: by mail-wr1-x42e.google.com with SMTP id x14so20692459wrp.2 for ; Tue, 16 Jun 2020 06:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e785/2ytWUq6m1CZckPntnQd1feVAR6FA8r2SV7OZRA=; b=Izno5A/Ej21+Rl8NmYILa60fUa4RjKNZXiFn7pemj+0ybzwSooDDlzHswfzkcskusY 4RYs6SMBLKESM0cGgi4eMoZZcy+ezw3Ze2PE2ehw8NOrO1uYaq/bE5LTi8M426IJvgHW uxwZt+5s0FwOERHufttuga4jucdrAVGmzFnEVoOdzzGvxWdGTuEAizXMkw4XdxmCCYg9 dKe/rvmdoeoD20is3FJtXdVRs5hHUZNc5wdYLrRVYEym3nXkia3ILrHA0ypLzjt+RT5A iUhL0k5yaO9iD6f6TcvgmelK3yfpdXwOSVU79NP6nSIk4U75wskdh/Qb18szzaha4g+g EP0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e785/2ytWUq6m1CZckPntnQd1feVAR6FA8r2SV7OZRA=; b=H7BVQ31sUH5+uPIBOQUKlv3hDdh7vPi9glYozplEiEz8KMUU/GTM2z1EhcqlvjN506 5NygWMCgoIIP6MHuq50DA8dtc21+lo4PQYgdgm6stCK5f1hVlv4gh3gMplTnthGWAlhK /tM+JGdj3KvRIVHl5TqVm0RGXT0mpjIkYsKgE1lvmkzIGs8Mj8WGFsDqOwnpy9GDt5X0 Ya8Q6ciag4ItofyJLm2HAjd1Qd2ULktKgxdSVVtpWqIjpuQAoRISK5nifZNyk+KpEIhk S+H5woBg5n11Qd1NJy7moskRDyPTdY6ccwHP1QKpbC8+APF0sJjM/6F0yS0wTZq45qks JBKA== X-Gm-Message-State: AOAM533wNDzUei9ED7IZO6lpxSaxPcdd/fBQNO4FlSMbhLfNkzYHPJ1w H0oxAFKHXX9ldxSeYDxyGPk7lA== X-Received: by 2002:adf:ab08:: with SMTP id q8mr2892324wrc.216.1592312494465; Tue, 16 Jun 2020 06:01:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u9sm4165844wme.16.2020.06.16.06.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 06:01:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F2CC01FF7E; Tue, 16 Jun 2020 13:53:25 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 18/21] cirrus.yml: serialise make check Date: Tue, 16 Jun 2020 13:53:21 +0100 Message-Id: <20200616125324.19045-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ed Maste , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Li-Wen Hsu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We do this on our other platforms to make it easier to see what has broken. Signed-off-by: Alex Bennée Reviewed-by: Li-Wen Hsu Message-Id: <20200612190237.30436-19-alex.bennee@linaro.org> -- 2.20.1 diff --git a/.cirrus.yml b/.cirrus.yml index ce7850a320e..69342ae031b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -14,7 +14,7 @@ freebsd_12_task: - cd build - ../configure || { cat config.log; exit 1; } - gmake -j8 - - gmake -j8 V=1 check + - gmake V=1 check macos_task: osx_instance: @@ -26,7 +26,7 @@ macos_task: - cd build - ../configure --python=/usr/local/bin/python3 || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - - gmake check -j$(sysctl -n hw.ncpu) + - gmake check macos_xcode_task: osx_instance: @@ -39,4 +39,4 @@ macos_xcode_task: - cd build - ../configure --cc=clang || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - - gmake check -j$(sysctl -n hw.ncpu) + - gmake check From patchwork Tue Jun 16 12:53:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188034 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3628428ilo; Tue, 16 Jun 2020 06:02:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyJPsvvB7RPn2opPpdkQyKqN12hqNVxIZzXyx605Y8icn7WW9c4I16mOWlo50mxnFj8ZPi X-Received: by 2002:a25:b992:: with SMTP id r18mr3950599ybg.283.1592312560941; Tue, 16 Jun 2020 06:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312560; cv=none; d=google.com; s=arc-20160816; b=W9+7cqhULrVeNz4gyOV1RYtusRtK+s8y5z97tbIBDpY4WNQ2XzFKbitk83yJVA14Kk W+JK7krm5aOi1HBDs1ZyKj1dGh7rHdi0z/BWtYFij0qktuKGJffLHfnJSlFAKq7w51Zp m6tdUc8CKPlM1L0DpC33/utwYRJ/VmIzHoW2k9BiIyg2F2wIwwPWMmJjZ9FjHv6HnDcj kcQK5wIDpCU0EVdTm0rPt7CnKZ315dZzJJFeaW7/R9rTN8pDybAGDNbJ+jqaIw1b/sdM WRrQrUVRHo4ybkKqwSOKlokvHH+SYiR2Xk5dQ46poWVBwImhaaUKdjXQoapvQUlmPTLd HI+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=fwzjDn90p+WbCyuUAz8JCmbSQbTpCjIg7lbls5LaIbw=; b=cHXMcBC8kjyBQlf34Sr7cg1Kk34gC0YpkElCLyqrlyOFIxTbnzJmWqHPA9F95ajq3i 5MaPSnE5vbvg52whYxn+WnihYyum98TO1LBFk9vxy+/UCxfz55dd3406M3GXxM+dmCfw bEEifXl44Ex2TK+m9v7475215AtTApZzzK8C3aGauyF9Wzj5fNGSL/0h46PBt7Wp6BA3 PkJfsm2wb/qDMehMEQz4xdBmFSSh/1aQdZhexsy0Q2Hw/stqgzMZGY7eZ/xksVh31pzl UQ7vMOIyV402ju7DsNwWHeirorKcPt7HZvFnfP0g6yaBsZ+UUXyByVsokvhQektqw5De tL5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=elpUDqDQ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t13si17306214ybl.25.2020.06.16.06.02.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 06:02:40 -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=fail header.i=@linaro.org header.s=google header.b=elpUDqDQ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBEe-00082e-CV for patch@linaro.org; Tue, 16 Jun 2020 09:02:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlBDa-00080d-2q for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:34 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:36114) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlBDY-0001bN-79 for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:33 -0400 Received: by mail-wm1-x32d.google.com with SMTP id d128so2982213wmc.1 for ; Tue, 16 Jun 2020 06:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fwzjDn90p+WbCyuUAz8JCmbSQbTpCjIg7lbls5LaIbw=; b=elpUDqDQP+voxX3qspI04niTK8yFVE1dggAHRwQTKX0A5/Vrbk99B94YXO9IzSDLOx esSt6/dIJYn89k2v3r35kSovlCRii7Ey6lVvlWEbUde2k1XfCA3Pa6usn6p0HH736aKS othSH7klSyZCwpyey+zcwef9JNQQxJFbz1LIXHW9+ed3CamFJ+5h7Rgigt1hSkbUm9IT 6ppjVS6FUygyBe3RuUh1zZYQHtbNWRrEUzkYbkhCCuV/S0D718WEjSZf0Vb2E2W3/Wus V7x1pklaLB+CMNuZbkyvZQlr1zzaDi90m9cQ/zCSouysfTwTCKmhNROIkUSNOJ9Rvf1a RYuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fwzjDn90p+WbCyuUAz8JCmbSQbTpCjIg7lbls5LaIbw=; b=pJzz12fPsDLrzxXjCjYErY0OLsr8J34Q4FQOFAYgtXDhV+7u8YGw9/WHJeDs/ANyFU YrmmEDifEAvQZr+tn3UPAgo0SijPKyQJbzh8CU1S5f0qq7McxASJC26DVLcrilzYP7BX R2A4Cp7fZupY5kh7ZgrbPgLnu9rOVqxObs8px/SVozLXjci2/aIhK/V81P289OOF88d1 aUJm8PP5rs8aa3m1ILJoV5PZ8lgkGHIlNh44JEmW/6irQJGZEBxy3Ce3v500e+ZQQsoE DSfxAcEUlANTS3WqkJX92GGPZRP1UhyiVjxIFjIreQz3a4CyVBrnyvuwyWQ3k4+ryZx5 uRFg== X-Gm-Message-State: AOAM530Z778+k5R1YU+/hxh9+qkDBvQNiTd909gLnv6dlQ9Mv+KJaeZr XXb/xsjNm5gYRFdX8tcXKAWk3A== X-Received: by 2002:a7b:cf06:: with SMTP id l6mr3105322wmg.63.1592312490172; Tue, 16 Jun 2020 06:01:30 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v6sm30963902wrf.61.2020.06.16.06.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 06:01:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 168C61FFA6; Tue, 16 Jun 2020 13:53:26 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 19/21] tests/tcg: build plugin list from contents of src directory Date: Tue, 16 Jun 2020 13:53:22 +0100 Message-Id: <20200616125324.19045-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "open list:ARM TCG CPUs" , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" If you jump back and forth between branches while developing plugins you end up debugging failures caused by plugins left in the build directory. Fix this by basing plugins on the source tree instead. Signed-off-by: Alex Bennée Message-Id: <20200615141922.18829-2-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index b3cff3cad1a..2ae86776cdc 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -126,9 +126,10 @@ RUN_TESTS=$(patsubst %,run-%, $(TESTS)) # If plugins exist also include those in the tests ifeq ($(CONFIG_PLUGIN),y) -PLUGIN_DIR=../../plugin -VPATH+=$(PLUGIN_DIR) -PLUGINS=$(notdir $(wildcard $(PLUGIN_DIR)/*.so)) +PLUGIN_SRC=$(SRC_PATH)/tests/plugin +PLUGIN_LIB=../../plugin +VPATH+=$(PLUGIN_LIB) +PLUGINS=$(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c))) # We need to ensure expand the run-plugin-TEST-with-PLUGIN # pre-requistes manually here as we can't use stems to handle it. We @@ -152,7 +153,7 @@ run-%: % run-plugin-%: $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ - -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ -d plugin -D $*.pout \ $(call strip-plugin,$<), \ "$* on $(TARGET_NAME)") @@ -168,7 +169,7 @@ run-plugin-%: $(call run-test, $@, \ $(QEMU) -monitor none -display none \ -chardev file$(COMMA)path=$@.out$(COMMA)id=output \ - -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ -d plugin -D $*.pout \ $(QEMU_OPTS) $(call strip-plugin,$<), \ "$* on $(TARGET_NAME)") diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index 312f36cde5f..6d60a2f2eed 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -31,7 +31,7 @@ run-semihosting: semihosting run-plugin-semihosting-with-%: $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ - -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ $(call strip-plugin,$<) 2> $<.err, \ "$< on $(TARGET_NAME) with $*") diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index 3da09a38be7..ec951565626 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -45,7 +45,7 @@ run-semihosting-arm: semihosting-arm run-plugin-semihosting-with-%: $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ - -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ $(call strip-plugin,$<) 2> $<.err, \ "$< on $(TARGET_NAME) with $*") From patchwork Tue Jun 16 12:53:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188037 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3630432ilo; Tue, 16 Jun 2020 06:04:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/xV/JeCAzijBkfVSvcOT4LJ06Kqkd9MEsUdJ6+BauzsCpEhd3dxABjQT95pL3n4OIt73Q X-Received: by 2002:a5b:74e:: with SMTP id s14mr3965247ybq.104.1592312673055; Tue, 16 Jun 2020 06:04:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312673; cv=none; d=google.com; s=arc-20160816; b=ouZREVAKHbd7ZaFkU03EZ3+DzW0qDi8rDfPpf1ePbW2/IEB/3LILhNxF2reolHm6cQ RN1PkW2t1khBbzlxBqNoU/b8ZNKrFpG++CeDNWHxD4w6ztbX6/ulACryNwx9SwCsxKdW LrKst9c4Yn0RWeaeVfeEKKSVpUnBjt5NiBrNh904H9za97/mtc9IpZX0b8Rl/j1jzr/X sPNP0gbUurjuCvtzmoblvc1qoCTDZ3TGUv2LbdrdRBhoODTkfvL9UJxe76OTP6JpjGEQ CbF4JJ95aVUKeflJaGQckrWA1CF8BApW+zl4VZIGljcHGfUavzgAIM54gS85dsqlxfWi JE0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=RbNElvIGkjlXKRGPXZgBVVIssKrGvTSw+jbb+dSxtd8=; b=cmeKf4zXTVuHvtyRkpeukXnV5o52I1SkjOnaAT3mjt1J1rMDjxNMD/j+XLUkHjRLN5 0kEdpJkm4d5SufZCtDVz0DIRRqqF942LzsplW27imtEqDAf0GL2GAX+qmm57C0Z7jpmU 3JEQl2pxAu+4VrVZXNQT2x7VWSQEQet6Qj0WK8wxYBTueCvIwUaJMUFm9qf1if+qkknS PZu9XZR7SkKu+ddxj2rwlEUXKTWDUt/IGfCkRP+9TFoRdC9rTeh6z0/lAj8MEeCKoTxH xBDbb2EoZ8Oe8yAZMJYnIBEj+yes+wF2TOLajaYoC7W9kuN0LpFro82Zvsy2HVP2RQL/ AySQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wh+Xx2FT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u5si17708794ybc.479.2020.06.16.06.04.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 06:04:33 -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=fail header.i=@linaro.org header.s=google header.b=wh+Xx2FT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBGS-00033U-DG for patch@linaro.org; Tue, 16 Jun 2020 09:04:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlBDj-0008Dj-VA for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:44 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:34588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlBDe-0001cW-Cy for qemu-devel@nongnu.org; Tue, 16 Jun 2020 09:01:43 -0400 Received: by mail-wm1-x32c.google.com with SMTP id u26so2227377wmn.1 for ; Tue, 16 Jun 2020 06:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RbNElvIGkjlXKRGPXZgBVVIssKrGvTSw+jbb+dSxtd8=; b=wh+Xx2FTQv/Ndc3ibp1IaOIQSeojGsciSxJa8uvAQR3b+Im0UdSFYceFXUXufljQnp p99KO2Rgr/JiMwoCCsHrWKa4oxTpbkANIc/s32W1ZmiabDgtRBxzwUOssUoaVoky6l9T WmcqOJ18xjMOrs/8xjjjT70DA8KCxUiFS/hQvg1qwBoESJaFn4e1EHYIeiXJCqB7rK6Z lWoxCI4GpA4CtkkiY0KhpaNnmUXBC21fLzO1nGqSJbYAxE6R5yN9eESCu6cXMIkBkrQW r3Tv+mteK/ByNWLD96593m+4SV+5gB4ztdYZfEDhoOKVpTBVqL01Tj0xI4n/BsGk9z9w JNsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RbNElvIGkjlXKRGPXZgBVVIssKrGvTSw+jbb+dSxtd8=; b=Dh+v+E5Obyye94t2GJ6gZhfxR/NMSR164WyGRPqLSBDcJMbWgCCQIO5A4xyqAtFcI6 q2aHdQ8HR9297Qs8AjOwEmd7nE4WICxBSnlDJlzqAiAYU0/mKMf3cookNFpfN+HaaCq3 IajedoHyuRnYbYYp7Dl5q+uAmrdOfjjuQlZZocD09ImBwkQZuYlm4YDOiyNfzZm7aZ/T 4Bkq1YXZ2LYaHldx2E8h6m2tk4hq7BxMew9acqjSOOLUjiG+ydQd2ZjidU1qKjpiWwHj MlX4oSl3S5OD6XrrPmvJg/qnInII9oNltTtfsNJT7NVWIYB3kXZ/49vW19KR5lxHHdKf B46w== X-Gm-Message-State: AOAM531/DYyUPuH5zW5qlZfVYgFVlDMic13WRZj7aFV0fd+hcQ6KTw6H VX8DjCtbyE+jS9a/gMstZSNHjQ== X-Received: by 2002:a7b:cb56:: with SMTP id v22mr3217325wmj.180.1592312496060; Tue, 16 Jun 2020 06:01:36 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c68sm3907750wmd.12.2020.06.16.06.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 06:01:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2F49B1FFA9; Tue, 16 Jun 2020 13:53:26 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 20/21] tests/tcg: ensure -cpu max also used for plugin run Date: Tue, 16 Jun 2020 13:53:23 +0100 Message-Id: <20200616125324.19045-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , qemu-devel@nongnu.org, "open list:ARM TCG CPUs" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The check-tcg plugins build was failing because some special case tests that needed -cpu max failed because the plugin variant hadn't carried across the QEMU_OPTS tweak. Guests which globally set QEMU_OPTS=-cpu FOO where unaffected. Signed-off-by: Alex Bennée Message-Id: <20200615141922.18829-3-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index 6d60a2f2eed..b617f2ac7e0 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -20,8 +20,9 @@ run-fcvt: fcvt # Pauth Tests ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_ARMV8_3),) AARCH64_TESTS += pauth-1 pauth-2 pauth-4 -run-pauth-%: QEMU_OPTS += -cpu max pauth-%: CFLAGS += -march=armv8.3-a +run-pauth-%: QEMU_OPTS += -cpu max +run-plugin-pauth-%: QEMU_OPTS += -cpu max endif # Semihosting smoke test for linux-user diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target index 53efec06683..1a6463a7dc1 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -12,6 +12,7 @@ X86_64_TESTS:=$(filter test-i386-ssse3, $(ALL_X86_TESTS)) test-i386-pcmpistri: CFLAGS += -msse4.2 run-test-i386-pcmpistri: QEMU_OPTS += -cpu max +run-plugin-test-i386-pcmpistri-%: QEMU_OPTS += -cpu max # # hello-i386 is a barebones app From patchwork Tue Jun 16 12:53:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 188030 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp3624418ilo; Tue, 16 Jun 2020 05:57:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYunqsb25OuBO808L5G4v4vilvw1cmp0BYbb/nTMvSq2UxGX4wFEwcwiBsexDf5W8S5o0d X-Received: by 2002:a25:abd2:: with SMTP id v76mr3853484ybi.463.1592312273065; Tue, 16 Jun 2020 05:57:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592312273; cv=none; d=google.com; s=arc-20160816; b=QqmR1lMD2LXC4EePoPcPfKeqtwAqB1TsppIu+Lf3OdVJNff2nPwo43G00ubnMgieUh dFWtWVnVS5GKAzP2/b+uUivl7VMw/eytsTcrwV44GM9xevrrDhF/xig8tjG/WMdYD+nE N6GoaLfJVUbQePsKKUKPpKy4BiCd3FW1ccWhlm7VZqzyfSbRxWgYoAte38cffheQnEOE Db7jxNccpfH+wbLwlgMhLMnu6ouBiJRH1PdbetvuE0RVxQ/CJ6LTuastNS7MaOrs6Gx9 wZu8InDNEoGjHKwy9H3uBQdto1ZhzaLwnQ1UsBLM7aRJlfkrh/Bj/+Z6dHvq0lSag52u c8Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=w7mdCAATXvMppzeAHxgpJb4BtPwpqC6YkEJgrydey+Y=; b=HEgBfaMgpZqj5TvAUy210vejrACfvNo0eLeEyqhfsXNF4Ha2Nv6Z3Pr2YjLy3uzmDP TXi77Mpj1dnABp42K0hjOrahd/OB1/mn9/4hHQKXb9HBtL/+ZhAfasxttR/G0SJh8NXC 0UuWC4CerN3yRUAJTO+6ZcJe0EvZ4bKpL5qKH97AR7q3MEB63YhVZF59CMMEA29kDvFy 2Bt0dTdMmZUeqdgL7PjtclVlKb772kgAmVtnKNQFMuKq5WFdhxmiRan3CckpGQPXAS9v 5bAdCvZZ/GWJZJgvMptKy5xiMbTZZidnfwFz4kK4xKxZtzMi+2LKkQAU97s44CqsWwPG IBNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HnNkBPLU; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e187si17311865ybf.249.2020.06.16.05.57.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jun 2020 05:57:53 -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=fail header.i=@linaro.org header.s=google header.b=HnNkBPLU; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jlBA0-0002iC-B5 for patch@linaro.org; Tue, 16 Jun 2020 08:57:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jlB65-00046l-C9 for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:49 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:55097) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jlB62-00008W-7r for qemu-devel@nongnu.org; Tue, 16 Jun 2020 08:53:49 -0400 Received: by mail-wm1-x32f.google.com with SMTP id g10so2765801wmh.4 for ; Tue, 16 Jun 2020 05:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w7mdCAATXvMppzeAHxgpJb4BtPwpqC6YkEJgrydey+Y=; b=HnNkBPLUltrTuIjTLBuAxqFLVnTQmlP26RijbHFh5dUoy12q9/uqo76c01HdDIBJKv mj/nPR3P/k2Lx5tTFWx58xBaduionDw93D9SrTfWsJ7MyUH0o5wm++JGKebkNB2/hBHG L5OhAQM8kD8JDpaqiyUK0U9TiPclofag39TFW1i+Os7UJgr3tUun1T2WWzNrQaguOVBf +bzBMI3LkWaghxbPxN3aHj6aLq6WVYluxgkjeBkXG5Zl2cF6HufqWya4T9dT96CXeyKR yUy6uqJU8QZlPpa0On//l5J7kmCgIRrRHv7m3IEcZI2UaDXwbxw9iA42iqoMiVkCDUHp +1Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w7mdCAATXvMppzeAHxgpJb4BtPwpqC6YkEJgrydey+Y=; b=FTdSOVjO3TQjKddkWEWL0C1ajVQkA0+GBnDS/0uF0Pt8reAy3JL0CJGmIWEi/xhskc v1faFKB0s8YJbla48EXT4z1Wgp3qJd3F2Q5+DuMWrVeEMk4Jfwx6Co/FHfhmLGtVp4Js WsnnzW1QmWC3Ma2biqCSni7XehUNvQ8Kxlcz9NJEWhyLdc2dm6Hu4ok9vxT51IBR//Q3 0gVgh37+KQo8V9O/9Homtma0nG7A34TykFgaVtKuhYrBxfPEY6e0ZWcfjg1yHK+uiIAj DtDtry6w34ZtOR3TgL2cGa+amu0BnXcJOS/OcgcNJX6GcrN7Gg6JObDwlqGJyh28FWNT s8tg== X-Gm-Message-State: AOAM533+GjOmBCZU4LVq6f3n5vszDp9pISTU7I5/2OU6ibJdBWGLJllW xHstOKlGzdF8lP/M74hoh1vPXQ== X-Received: by 2002:a1c:24c6:: with SMTP id k189mr3265346wmk.9.1592312024433; Tue, 16 Jun 2020 05:53:44 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v19sm3853998wml.26.2020.06.16.05.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:53:37 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4A9D21FFAA; Tue, 16 Jun 2020 13:53:26 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 21/21] plugins: new lockstep plugin for debugging TCG changes Date: Tue, 16 Jun 2020 13:53:24 +0100 Message-Id: <20200616125324.19045-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200616125324.19045-1-alex.bennee@linaro.org> References: <20200616125324.19045-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Foley , Mark Cave-Ayland , Richard Henderson , qemu-devel@nongnu.org, =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When we make changes to the TCG we sometimes cause regressions that are deep into the execution cycle of the guest. Debugging this often requires comparing large volumes of trace information to figure out where behaviour has diverged. The lockstep plugin utilises a shared socket so two QEMU's running with the plugin will write their current execution position and wait to receive the position of their partner process. When execution diverges the plugins output where they were and the previous few blocks before unloading themselves and letting execution continue. Originally I planned for this to be most useful with -icount but it turns out you can get divergence pretty quickly due to asynchronous qemu_cpu_kick_rr_cpus() events causing one side to eventually run into a short block a few cycles before the other side. For this reason I've added a bit of tracking and I think the divergence reporting could be finessed to report only if we really start to diverge in execution. An example run would be: qemu-system-sparc -monitor none -parallel none -net none \ -M SS-20 -m 256 -kernel day11/zImage.elf \ -plugin ./tests/plugin/liblockstep.so,arg=lockstep-sparc.sock \ -d plugin,nochain with an identical command in another window in the same working directory. Signed-off-by: Alex Bennée Reviewed-by: Robert Foley Tested-by: Robert Foley Cc: Richard Henderson Cc: Mark Cave-Ayland Message-Id: <20200610155509.12850-3-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/plugin/lockstep.c b/tests/plugin/lockstep.c new file mode 100644 index 00000000000..a696673dff3 --- /dev/null +++ b/tests/plugin/lockstep.c @@ -0,0 +1,340 @@ +/* + * Lockstep Execution Plugin + * + * Allows you to execute two QEMU instances in lockstep and report + * when their execution diverges. This is mainly useful for developers + * who want to see where a change to TCG code generation has + * introduced a subtle and hard to find bug. + * + * Caveats: + * - single-threaded linux-user apps only with non-deterministic syscalls + * - no MTTCG enabled system emulation (icount may help) + * + * While icount makes things more deterministic it doesn't mean a + * particular run may execute the exact same sequence of blocks. An + * asynchronous event (for example X11 graphics update) may cause a + * block to end early and a new partial block to start. This means + * serial only test cases are a better bet. -d nochain may also help. + * + * This code is not thread safe! + * + * Copyright (c) 2020 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + +/* saved so we can uninstall later */ +static qemu_plugin_id_t our_id; + +static unsigned long bb_count; +static unsigned long insn_count; + +/* Information about a translated block */ +typedef struct { + uint64_t pc; + uint64_t insns; +} BlockInfo; + +/* Information about an execution state in the log */ +typedef struct { + BlockInfo *block; + unsigned long insn_count; + unsigned long block_count; +} ExecInfo; + +/* The execution state we compare */ +typedef struct { + uint64_t pc; + unsigned long insn_count; +} ExecState; + +typedef struct { + GSList *log_pos; + int distance; +} DivergeState; + +/* list of translated block info */ +static GSList *blocks; + +/* execution log and points of divergence */ +static GSList *log, *divergence_log; + +static int socket_fd; +static char *path_to_unlink; + +static bool verbose; + +static void plugin_cleanup(qemu_plugin_id_t id) +{ + /* Free our block data */ + g_slist_free_full(blocks, &g_free); + g_slist_free_full(log, &g_free); + g_slist_free(divergence_log); + + close(socket_fd); + if (path_to_unlink) { + unlink(path_to_unlink); + } +} + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + g_autoptr(GString) out = g_string_new("No divergence :-)\n"); + g_string_append_printf(out, "Executed %ld/%d blocks\n", + bb_count, g_slist_length(log)); + g_string_append_printf(out, "Executed ~%ld instructions\n", insn_count); + qemu_plugin_outs(out->str); + + plugin_cleanup(id); +} + +static void report_divergance(ExecState *us, ExecState *them) +{ + DivergeState divrec = { log, 0 }; + g_autoptr(GString) out = g_string_new(""); + bool diverged = false; + + /* + * If we have diverged before did we get back on track or are we + * totally loosing it? + */ + if (divergence_log) { + DivergeState *last = (DivergeState *) divergence_log->data; + GSList *entry; + + for (entry = log; g_slist_next(entry); entry = g_slist_next(entry)) { + if (entry == last->log_pos) { + break; + } + divrec.distance++; + } + + /* + * If the last two records are so close it is likely we will + * not recover synchronisation with the other end. + */ + if (divrec.distance == 1 && last->distance == 1) { + diverged = true; + } + } + divergence_log = g_slist_prepend(divergence_log, + g_memdup(&divrec, sizeof(divrec))); + + /* Output short log entry of going out of sync... */ + if (verbose || divrec.distance == 1 || diverged) { + g_string_printf(out, "@ %#016lx vs %#016lx (%d/%d since last)\n", + us->pc, them->pc, g_slist_length(divergence_log), + divrec.distance); + qemu_plugin_outs(out->str); + } + + if (diverged) { + int i; + GSList *entry; + + g_string_printf(out, "Δ insn_count @ %#016lx (%ld) vs %#016lx (%ld)\n", + us->pc, us->insn_count, them->pc, them->insn_count); + + for (entry = log, i = 0; + g_slist_next(entry) && i < 5; + entry = g_slist_next(entry), i++) { + ExecInfo *prev = (ExecInfo *) entry->data; + g_string_append_printf(out, + " previously @ %#016lx/%ld (%ld insns)\n", + prev->block->pc, prev->block->insns, + prev->insn_count); + } + qemu_plugin_outs(out->str); + qemu_plugin_outs("too much divergence... giving up."); + qemu_plugin_uninstall(our_id, plugin_cleanup); + } +} + +static void vcpu_tb_exec(unsigned int cpu_index, void *udata) +{ + BlockInfo *bi = (BlockInfo *) udata; + ExecState us, them; + ssize_t bytes; + ExecInfo *exec; + + us.pc = bi->pc; + us.insn_count = insn_count; + + /* + * Write our current position to the other end. If we fail the + * other end has probably died and we should shut down gracefully. + */ + bytes = write(socket_fd, &us, sizeof(ExecState)); + if (bytes < sizeof(ExecState)) { + qemu_plugin_outs(bytes < 0 ? + "problem writing to socket" : + "wrote less than expected to socket"); + qemu_plugin_uninstall(our_id, plugin_cleanup); + return; + } + + /* + * Now read where our peer has reached. Again a failure probably + * indicates the other end died and we should close down cleanly. + */ + bytes = read(socket_fd, &them, sizeof(ExecState)); + if (bytes < sizeof(ExecState)) { + qemu_plugin_outs(bytes < 0 ? + "problem reading from socket" : + "read less than expected"); + qemu_plugin_uninstall(our_id, plugin_cleanup); + return; + } + + /* + * Compare and report if we have diverged. + */ + if (us.pc != them.pc) { + report_divergance(&us, &them); + } + + /* + * Assume this block will execute fully and record it + * in the execution log. + */ + insn_count += bi->insns; + bb_count++; + exec = g_new0(ExecInfo, 1); + exec->block = bi; + exec->insn_count = insn_count; + exec->block_count = bb_count; + log = g_slist_prepend(log, exec); +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + BlockInfo *bi = g_new0(BlockInfo, 1); + bi->pc = qemu_plugin_tb_vaddr(tb); + bi->insns = qemu_plugin_tb_n_insns(tb); + + /* save a reference so we can free later */ + blocks = g_slist_prepend(blocks, bi); + qemu_plugin_register_vcpu_tb_exec_cb(tb, vcpu_tb_exec, + QEMU_PLUGIN_CB_NO_REGS, (void *)bi); +} + + +/* + * Instead of encoding master/slave status into what is essentially + * two peers we shall just take the simple approach of checking for + * the existence of the pipe and assuming if it's not there we are the + * first process. + */ +static bool setup_socket(const char *path) +{ + struct sockaddr_un sockaddr; + int fd; + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd < 0) { + perror("create socket"); + return false; + } + + sockaddr.sun_family = AF_UNIX; + g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1); + if (bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { + perror("bind socket"); + close(fd); + return false; + } + + /* remember to clean-up */ + path_to_unlink = g_strdup(path); + + if (listen(fd, 1) < 0) { + perror("listen socket"); + close(fd); + return false; + } + + socket_fd = accept(fd, NULL, NULL); + if (socket_fd < 0 && errno != EINTR) { + perror("accept socket"); + return false; + } + + qemu_plugin_outs("setup_socket::ready\n"); + + return true; +} + +static bool connect_socket(const char *path) +{ + int fd; + struct sockaddr_un sockaddr; + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd < 0) { + perror("create socket"); + return false; + } + + sockaddr.sun_family = AF_UNIX; + g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1); + + if (connect(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) { + perror("failed to connect"); + return false; + } + + qemu_plugin_outs("connect_socket::ready\n"); + + socket_fd = fd; + return true; +} + +static bool setup_unix_socket(const char *path) +{ + if (g_file_test(path, G_FILE_TEST_EXISTS)) { + return connect_socket(path); + } else { + return setup_socket(path); + } +} + + +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv) +{ + int i; + + if (!argc || !argv[0]) { + qemu_plugin_outs("Need a socket path to talk to other instance."); + return -1; + } + + for (i = 0; i < argc; i++) { + char *p = argv[i]; + if (strcmp(p, "verbose") == 0) { + verbose = true; + } else if (!setup_unix_socket(argv[0])) { + qemu_plugin_outs("Failed to setup socket for communications."); + return -1; + } + } + + our_id = id; + + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + return 0; +} diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile index 75467b6db85..b3250e2504c 100644 --- a/tests/plugin/Makefile +++ b/tests/plugin/Makefile @@ -13,6 +13,7 @@ NAMES += mem NAMES += hotblocks NAMES += howvec NAMES += hotpages +NAMES += lockstep SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 2ae86776cdc..4b2b696fcee 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -129,7 +129,8 @@ ifeq ($(CONFIG_PLUGIN),y) PLUGIN_SRC=$(SRC_PATH)/tests/plugin PLUGIN_LIB=../../plugin VPATH+=$(PLUGIN_LIB) -PLUGINS=$(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c))) +PLUGINS=$(filter-out liblockstep.so,\ + $(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c)))) # We need to ensure expand the run-plugin-TEST-with-PLUGIN # pre-requistes manually here as we can't use stems to handle it. We