From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342557709839.3453614523952; Tue, 6 Mar 2018 05:22:37 -0800 (PST) Received: from localhost ([::1]:55701 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCY8-0007Vl-Qz for importer@patchew.org; Tue, 06 Mar 2018 08:22:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVH-0004kV-Co for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVE-00068y-59 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:39 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:32919) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVD-00068V-Ur for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:36 -0500 Received: by mail-wm0-x244.google.com with SMTP id s206so17984031wme.0 for ; Tue, 06 Mar 2018 05:19:35 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=0S2FbjpdEAor8vcbHqWa5Ih7n6+S2JM8WjuAvzNYIac=; b=FA+Ff9mL+ZS5pfx5FzBreQbKuOBsKQUH0O/znyOzEtVslYP7OVjdMz2ofkAtJU1At9 sVhWxxOKbK1/8GVIgCuN/tKoClWgW/7W8/zhI4SrjHhK5XyT0drTRcPJKIMoVW8h/537 8dyZFsyyaldQ82AUUYQrprnh3QHwp0PfmflgCV8qkW0+3b00xvk1MNs6eg3b16iWKnVm UYsee+DeSsYYxxD8BpB5K6FaI+1kVLUtIngZW7erX//Cj9ovLpYRCk895Jx07yg1NnDw w3P8yCtX9EBY1UDWQrG4JrWwXkAOw12ZYIOojs+NNIyiBGupX/6DcTQDO8vLt9wzI+a5 FJ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=0S2FbjpdEAor8vcbHqWa5Ih7n6+S2JM8WjuAvzNYIac=; b=AgMQxUtlX4tkywtjVSNTVSnwmoYSIcfcDkko4U4LUtRcskU+Icm2TzEZHZCfEE2gRv ogl8YBYYSCKDWM7Sj+l2uMCBxjR4wiyFLGqH4xPctOqAaQ3o88fkl4dXP6pD5CJN7CGe VvfB1azSFwpGNhVcSJaWH6yAUne0+qOuR/Su235kPnnFeXhzXRFU7g0EIuOIGBvfnG/j QHom1pC4twUQFLXkCcWV8AkbswCNo+qi4jdktyTo6M6POsJi2iARMYmhsTP7Ihs3RWr4 E6gBTLpx263GXZNqneGnq20Vq7CwABZPTJqEiQbEhyjkh58Lf1VawCtKVs17xs9BOQJ1 02Rw== X-Gm-Message-State: AElRT7HjcdJh6/QzBCyN+3xU3GkBfD7nqkGwrVTevYzHvrFWmWjXqknm FWvWQr+I0xBSFbfGapawwPKG7gsN X-Google-Smtp-Source: AG47ELtrPd1IGSWAJyFl8aoXEgMz4AdCr1OCGYrsQHwQfME2/IPFKrfawJuldkn1tiWbA3qpkSl+nw== X-Received: by 10.28.6.83 with SMTP id 80mr11097351wmg.12.1520342374623; Tue, 06 Mar 2018 05:19:34 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:18:57 +0100 Message-Id: <1520342370-123606-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 01/34] g364fb: fix DirtyBitmapSnapshot leak X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- hw/display/g364fb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c index 819f8be..3d75394 100644 --- a/hw/display/g364fb.c +++ b/hw/display/g364fb.c @@ -207,6 +207,7 @@ done: if (xmax || ymax) { dpy_gfx_update(s->con, xmin, ymin, xmax - xmin + 1, ymax - ymin + = 1); } + g_free(snap); } =20 static void g364fb_draw_blank(G364State *s) --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342717588311.01457421749967; Tue, 6 Mar 2018 05:25:17 -0800 (PST) Received: from localhost ([::1]:55715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCad-00022Z-QI for importer@patchew.org; Tue, 06 Mar 2018 08:25:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVH-0004kW-D5 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVF-00069f-Bb for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:39 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:54856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVF-00069C-5A for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:37 -0500 Received: by mail-wm0-x242.google.com with SMTP id z81so22679557wmb.4 for ; Tue, 06 Mar 2018 05:19:37 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=HY23dVqW0W6L18TCZnCrbwZMZAs44WbuJFfXFMDUiXU=; b=pKeZ1rCmErkT/gZP1ky6TwxU+65MDbOtQea3jtTWahZOrn0TbC5/dYRP8Z29PLJdJV kbptNXAGamH5uetgTUKrewIr49O8UNiap4lq6ezXrV7rjIoChOMQmVC52Kx2TjOKLiDE avkHHeGTISjvVtLILpnCGY9+lAnQQNroXJZ5dX8uqqsDQOboy/XV070K0zz16F7y/eoc pKQlW5HcjeMMgKI7yAuE/+U/9S5vsgpj3/DHvlsq7/6lPUSiQZMnF69waoYF3EeknymE yZ45fs46W6G7NbCSDFeowuBYT963MaXbPEwF+lC0+kenG27WhLHnFaSlQA5B0ObnFTEv vSTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=HY23dVqW0W6L18TCZnCrbwZMZAs44WbuJFfXFMDUiXU=; b=uXDzAqOxG0Utv8CDwulmzsoq4MbtnzlEDWIIfSJwbMrblF51RKPeXZgX3rdBttFNlV STL63fYaG7nPF6qAJd6r1pbMjnF3G2EuoB84USTppz2S0zCWtO5EgIFJ0d1WC/LbDjSD r8ccN4T1NYMLwNY/llRGPfoWW2T2mMhgz+vNPlroOUPNpysuHZ5jU+0HOEOVrX9yDmyE D2ysZo9OIYt9uy52cxNYCUOHO6wvewR9chizzsLkTCnctyBTlivI8Z9FmKIUXil2lRhg uBqSXsn3kf+cgm7FYE0IKUMr9poJMpnxuSdeXgzocbYobi6+hfsq/5gdSWuzBPz7Ze75 cPuA== X-Gm-Message-State: AElRT7EA1+9EQjM5+39CrpaSEUuMXGB2fedRgyLn2xDmbn3X10ZnA8+k v1Q+rsrWyhasSJtpn4kzjsSBeNpw X-Google-Smtp-Source: AG47ELvTPRAnC3rV4G8FOxE2Tedf3LRy5sGMa54u9Cady6jSM1Udawr0LlYftjuzyjccywcte1FIMg== X-Received: by 10.28.34.3 with SMTP id i3mr10539655wmi.121.1520342375825; Tue, 06 Mar 2018 05:19:35 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:18:58 +0100 Message-Id: <1520342370-123606-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 02/34] Remove the deprecated -tdf option X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth It's been marked as deprecated since a very long time already, and the parameter is not doing anything useful anymore except for printing a warning, so it's now time to finally get rid of this option. Signed-off-by: Thomas Huth Message-Id: <1519071820-4062-1-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- qemu-doc.texi | 7 ------- vl.c | 3 --- 2 files changed, 10 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 4fcc85a..76ca83f 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2606,13 +2606,6 @@ which is the default. =20 @section System emulator command line arguments =20 -@subsection -tdf (since 1.3.0) - -The ``-tdf'' argument is ignored. The behaviour implemented -by this argument is now the default when using the KVM PIT, -but can be requested explicitly using -``-global kvm-pit.lost_tick_policy=3Dslew''. - @subsection -no-kvm-pit-reinjection (since 1.3.0) =20 The ``-no-kvm-pit-reinjection'' argument is now a diff --git a/vl.c b/vl.c index 6120b88..a92f60c 100644 --- a/vl.c +++ b/vl.c @@ -3842,9 +3842,6 @@ int main(int argc, char **argv, char **envp) exit(1); } break; - case QEMU_OPTION_tdf: - warn_report("ignoring deprecated option"); - break; case QEMU_OPTION_name: opts =3D qemu_opts_parse_noisily(qemu_find_opts("name"), optarg, true); --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342507107504.694856766198; Tue, 6 Mar 2018 05:21:47 -0800 (PST) Received: from localhost ([::1]:55700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCXK-0006iy-8y for importer@patchew.org; Tue, 06 Mar 2018 08:21:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVN-0004m2-F3 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVH-0006Ab-00 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:45 -0500 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:53448) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVG-0006A1-LN for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:38 -0500 Received: by mail-wm0-x232.google.com with SMTP id e194so3743398wmd.3 for ; Tue, 06 Mar 2018 05:19:38 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=O56CItQg5XN2lG7A0+x49/Yphhm0UZ8kODuJoxd3WdQ=; b=MDK+n/po2o+mVWNKah3e/tcYlys2873yPp0muNroJeJUOxB8ON1D51Cc4kAPXV4KMR 7kI2zqCWs1H5WqZvOnf1TXtTO2tlBkQ0Vzcu4aSVZ2v/yqm1wPQc6zHIFQ+1RWOnDUWO +xLQTf9wQ86CT3HILYgwOCCplfAkA90yNsXbAFWrsK/agQGg3HbjOqKhb874v7W+dscW Rfbkm0o375jlVaOjxZF7C1sgr4AlXl9CxL51kvnPlCN3vWCEEGSAgnegxeyBVM6JSce8 sfz9P6Sm1M6EcKxWXOpzR5bz1d+0MItxEz33nXhatJfe7TjUxnnKqnkhk7+5Hrti7HUS Djpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=O56CItQg5XN2lG7A0+x49/Yphhm0UZ8kODuJoxd3WdQ=; b=TAWthPp+XTXgaZFvs+IOzc/xqaqPcMcfXzo4M9Z2yAKz4KiIOa6K9UT+ulTja5oflA hCT7Nf0Y6bF7OmxAMHnw54saQCtkpVprca73suXkr75FY3809Llm0myaa9gRb+88RMa1 2Ol7QTqwHZJ5JYAbdBb52U4qeLMYiCnv1LeX1wAp9MuhFjGZPcj5hZkR2PHZzQpNke0F PIbxBNMuWjnGWDJ8QHJjqRqhf9vpnRlAXhco2xeHbOPilw3jSnSv5kZ8ElqtbJkH0EFL k6oOKQW1VIeuNDOaIT/KPzyCqXz9tGlAuv7zGsjNjHpQEUxzLjn6w1DGyokxtRLcSdwu g3KA== X-Gm-Message-State: AElRT7HuLiwnTy84XSJvb7Myy6xcuER45MGZYBAyBKdh5WXKbmZZp/PR bftlLT6FOT8eUvXyE1iAFvLidjRp X-Google-Smtp-Source: AG47ELvzCy8GzL08g3i5RuGFIDyYNxBBRRyDRsbvtThfgJrnLGCz+UWyC8y9V/5BcKzHLlE1OB6ADg== X-Received: by 10.28.18.2 with SMTP id 2mr10648662wms.108.1520342377201; Tue, 06 Mar 2018 05:19:37 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:18:59 +0100 Message-Id: <1520342370-123606-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::232 Subject: [Qemu-devel] [PULL 03/34] scsi: Remove automatic creation of SCSI controllers with -drive if=scsi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Automatic creation of SCSI controllers for "-drive if=3Dscsi" for x86 machines was quite a bad idea (see description of commit f778a82f0c179 for details). This is marked as deprecated since QEMU v2.9.0, and as far as I know, nobody complained that this is still urgently required anymore. Time to remove this now. Suggested-by: Markus Armbruster Signed-off-by: Thomas Huth Message-Id: <1519123357-13225-1-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 17 ----------------- hw/i386/pc_piix.c | 4 ---- hw/i386/pc_q35.c | 3 --- hw/scsi/lsi53c895a.c | 2 +- hw/scsi/scsi-bus.c | 49 +---------------------------------------------= --- hw/scsi/spapr_vscsi.c | 3 +-- include/hw/scsi/scsi.h | 2 +- qemu-doc.texi | 5 ----- tests/qemu-iotests/051 | 4 ---- vl.c | 9 --------- 10 files changed, 4 insertions(+), 94 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 94cfd40..35fcb6e 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1636,23 +1636,6 @@ void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus) rom_reset_order_override(); } =20 -void pc_pci_device_init(PCIBus *pci_bus) -{ - int max_bus; - int bus; - - /* Note: if=3Dscsi is deprecated with PC machine types */ - max_bus =3D drive_get_max_bus(IF_SCSI); - for (bus =3D 0; bus <=3D max_bus; bus++) { - pci_create_simple(pci_bus, -1, "lsi53c895a"); - /* - * By not creating frontends here, we make - * scsi_legacy_handle_cmdline() create them, and warn that - * this usage is deprecated. - */ - } -} - void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name) { DeviceState *dev; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 456dc9e..8658bcb 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -295,10 +295,6 @@ static void pc_init1(MachineState *machine, PC_MACHINE_ACPI_DEVICE_PROP, &error_abort= ); } =20 - if (pcmc->pci_enabled) { - pc_pci_device_init(pci_bus); - } - if (pcms->acpi_nvdimm_state.is_enabled) { nvdimm_init_acpi_state(&pcms->acpi_nvdimm_state, system_io, pcms->fw_cfg, OBJECT(pcms)); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index aba7541..0c0bc48 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -273,9 +273,6 @@ static void pc_q35_init(MachineState *machine) /* the rest devices to which pci devfn is automatically assigned */ pc_vga_init(isa_bus, host_bus); pc_nic_init(isa_bus, host_bus); - if (pcmc->pci_enabled) { - pc_pci_device_init(host_bus); - } =20 if (pcms->acpi_nvdimm_state.is_enabled) { nvdimm_init_acpi_state(&pcms->acpi_nvdimm_state, system_io, diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 191505d..f3d4c4d 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -2277,5 +2277,5 @@ void lsi53c895a_create(PCIBus *bus) { LSIState *s =3D LSI53C895A(pci_create_simple(bus, -1, "lsi53c895a")); =20 - scsi_bus_legacy_handle_cmdline(&s->bus, false); + scsi_bus_legacy_handle_cmdline(&s->bus); } diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index b7bafbe..1eaeffc 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -271,7 +271,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, Blo= ckBackend *blk, return SCSI_DEVICE(dev); } =20 -void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool deprecated) +void scsi_bus_legacy_handle_cmdline(SCSIBus *bus) { Location loc; DriveInfo *dinfo; @@ -284,59 +284,12 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, boo= l deprecated) continue; } qemu_opts_loc_restore(dinfo->opts); - if (deprecated) { - /* Handling -drive not claimed by machine initialization */ - if (blk_get_attached_dev(blk_by_legacy_dinfo(dinfo))) { - continue; /* claimed */ - } - if (!dinfo->is_default) { - warn_report("bus=3D%d,unit=3D%d is deprecated with this" - " machine type", - bus->busnr, unit); - } - } scsi_bus_legacy_add_drive(bus, blk_by_legacy_dinfo(dinfo), unit, false, -1, false, NULL, &error_fat= al); } loc_pop(&loc); } =20 -static bool is_scsi_hba_with_legacy_magic(Object *obj) -{ - static const char *magic[] =3D { - "am53c974", "dc390", "esp", "lsi53c810", "lsi53c895a", - "megasas", "megasas-gen2", "mptsas1068", "spapr-vscsi", - "virtio-scsi-device", - NULL - }; - const char *typename =3D object_get_typename(obj); - int i; - - for (i =3D 0; magic[i]; i++) - if (!strcmp(typename, magic[i])) { - return true; - } - - return false; -} - -static int scsi_legacy_handle_cmdline_cb(Object *obj, void *opaque) -{ - SCSIBus *bus =3D (SCSIBus *)object_dynamic_cast(obj, TYPE_SCSI_BUS); - - if (bus && is_scsi_hba_with_legacy_magic(OBJECT(bus->qbus.parent))) { - scsi_bus_legacy_handle_cmdline(bus, true); - } - - return 0; -} - -void scsi_legacy_handle_cmdline(void) -{ - object_child_foreach_recursive(object_get_root(), - scsi_legacy_handle_cmdline_cb, NULL); -} - static int32_t scsi_invalid_field(SCSIRequest *req, uint8_t *buf) { scsi_req_build_sense(req, SENSE_CODE(INVALID_FIELD)); diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c index 360db53..a9e49c7 100644 --- a/hw/scsi/spapr_vscsi.c +++ b/hw/scsi/spapr_vscsi.c @@ -1215,8 +1215,7 @@ void spapr_vscsi_create(VIOsPAPRBus *bus) dev =3D qdev_create(&bus->bus, "spapr-vscsi"); =20 qdev_init_nofail(dev); - scsi_bus_legacy_handle_cmdline(&VIO_SPAPR_VSCSI_DEVICE(dev)->bus, - false); + scsi_bus_legacy_handle_cmdline(&VIO_SPAPR_VSCSI_DEVICE(dev)->bus); } =20 static int spapr_vscsi_devnode(VIOsPAPRDevice *dev, void *fdt, int node_of= f) diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 802a647..7ecadda 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -153,7 +153,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, Blo= ckBackend *blk, int unit, bool removable, int bootin= dex, bool share_rw, const char *serial, Error **errp); -void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool deprecated); +void scsi_bus_legacy_handle_cmdline(SCSIBus *bus); void scsi_legacy_handle_cmdline(void); =20 SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d, diff --git a/qemu-doc.texi b/qemu-doc.texi index 76ca83f..fb6fac5 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2680,11 +2680,6 @@ The ``-net vlan=3DNN'' argument is partially replace= d with the new ``-netdev'' argument. The remaining use cases will no longer be directly supported in QEMU. =20 -@subsection -drive if=3Dscsi (since 2.9.0) - -The ``-drive if=3Dscsi'' argument is replaced by the the -``-device BUS-TYPE'' argument combined with ``-drive if=3Dnone''. - @subsection -drive cyls=3D...,heads=3D...,secs=3D...,trans=3D... (since 2.= 10.0) =20 The drive geometry arguments are replaced by the the geometry arguments diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index 0c3be16..f617e25 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -157,9 +157,7 @@ case "$QEMU_DEFAULT_MACHINE" in pc) run_qemu -drive if=3Dfloppy run_qemu -drive if=3Dide,media=3Dcdrom - run_qemu -drive if=3Dscsi,media=3Dcdrom run_qemu -drive if=3Dide - run_qemu -drive if=3Dscsi ;; *) ;; @@ -188,9 +186,7 @@ case "$QEMU_DEFAULT_MACHINE" in pc) run_qemu -drive file=3D"$TEST_IMG",if=3Dfloppy,readonly=3Don run_qemu -drive file=3D"$TEST_IMG",if=3Dide,media=3Dcdrom,readonly= =3Don - run_qemu -drive file=3D"$TEST_IMG",if=3Dscsi,media=3Dcdrom,readonl= y=3Don run_qemu -drive file=3D"$TEST_IMG",if=3Dide,readonly=3Don - run_qemu -drive file=3D"$TEST_IMG",if=3Dscsi,readonly=3Don ;; *) ;; diff --git a/vl.c b/vl.c index a92f60c..6e4f1a2 100644 --- a/vl.c +++ b/vl.c @@ -4621,15 +4621,6 @@ int main(int argc, char **argv, char **envp) =20 rom_reset_order_override(); =20 - /* - * Create frontends for -drive if=3Dscsi leftovers. - * Normally, frontends for -drive get created by machine - * initialization for onboard SCSI HBAs. However, we create a few - * more ever since SCSI qdevification, but this is pretty much an - * implementation accident, and deprecated. - */ - scsi_legacy_handle_cmdline(); - /* Did we create any drives that we failed to create a device for? */ drive_check_orphaned(); =20 --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342659964457.2499616400779; Tue, 6 Mar 2018 05:24:19 -0800 (PST) Received: from localhost ([::1]:55713 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCZn-0001CF-4O for importer@patchew.org; Tue, 06 Mar 2018 08:24:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVI-0004kf-Lj for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVH-0006BA-Q7 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:40 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:40135) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVH-0006Af-JB for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:39 -0500 Received: by mail-wm0-x242.google.com with SMTP id t6so22233144wmt.5 for ; Tue, 06 Mar 2018 05:19:39 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=A8wDLGlTXwepJKrKsGV1d3qjqd6tavTx4JsivP4jWVg=; b=jMFwmZTYU0S2vWMDPNOq2AGFS8LEQNuo48fK4s5gK9Kyr+NHDlPJYG75nomFQhGN2Q qrpYX4LreRo+8I6+qSRI91yYwXFirwebXeweE+0UkkwL8xVRASJNP1vVRgR5uO5HfLhN wau5JYasNiKfWFbZGRqEv+Syb+tLH5e9uQ7DmdWPeCqFDIkLlb90/ofuRG14hfJfvW7c wcxoiSDnVX4C+1NKsdf3vTxwkPqnmZSJUCAD308SQ5HzkFlhKH+8tUBqeNWSd0xgP7ZG 4GWRkrf4TKeTlpmsuIN7hQvgv111I4eZkA4NZ1L7ChsG4bnRJgPRxauqA83lZlKSsilx kVzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=A8wDLGlTXwepJKrKsGV1d3qjqd6tavTx4JsivP4jWVg=; b=pX7YrsxRlNXGVxbd5qcpeBfXM8NMrXf63tATJ2wNB/9LTFx/oiWCCwn4Z2eIXNEalE J0F192Uv5jj4PjZpNBI9w0e2oaj7IBrmbg1SWU8MvGEGp6jFypIsSN/SH1Dj+xM575cv fZtTjFi41wd6F6zpxP/J62nNTjtsgGwvSqH7rwYZ/31CW6svNBCBzAi3CxIZcQnpnKZp +fidutbGTQNewQXzhbb8yglg7M9+OaDa/p1mpr+rX74lYNSHxuGIUiibtzyncvMaR/R1 zTlw6EuCFoUJYtOyVRzXDYT7kRBFxT+ywAqFsGCBPKzlE+rJ88aTGamij+fBWcxLACLP 8M6g== X-Gm-Message-State: AElRT7EYYyr5kbfJQaX875d1DwFwamSAWjvkRDwJVlFKBVbdGSDvB47b QLw731e73OQ7U6ptL7/bZ9fNfdUw X-Google-Smtp-Source: AG47ELuKTv2olTStoSd3NgPAjswzWW7QDCyYkEhSMs4v/MzXN8gym+b/1q6Wm36/IvPbxGS37OOMyQ== X-Received: by 10.28.193.134 with SMTP id r128mr10963395wmf.85.1520342378287; Tue, 06 Mar 2018 05:19:38 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:00 +0100 Message-Id: <1520342370-123606-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 04/34] cpus: properly inititalize CPU > 1 under single-threaded TCG X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand All but the first CPU are currently not fully inititalized (e.g. cpu->created is never set). Signed-off-by: David Hildenbrand Message-Id: <20180209195239.16048-2-david@redhat.com> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- cpus.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpus.c b/cpus.c index 4f5f88e..970390b 100644 --- a/cpus.c +++ b/cpus.c @@ -1863,6 +1863,9 @@ static void qemu_tcg_init_vcpu(CPUState *cpu) /* For non-MTTCG cases we share the thread */ cpu->thread =3D single_tcg_cpu_thread; cpu->halt_cond =3D single_tcg_halt_cond; + cpu->thread_id =3D first_cpu->thread_id; + cpu->can_do_io =3D 1; + cpu->created =3D true; } } =20 --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342504382327.7130071788728; Tue, 6 Mar 2018 05:21:44 -0800 (PST) Received: from localhost ([::1]:55699 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCXE-0006f8-DQ for importer@patchew.org; Tue, 06 Mar 2018 08:21:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVJ-0004kq-Vv for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVJ-0006Bs-1K for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:41 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:53341) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVI-0006BO-QX for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:40 -0500 Received: by mail-wm0-x244.google.com with SMTP id e194so3743636wmd.3 for ; Tue, 06 Mar 2018 05:19:40 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=xjz0oM0shCZiDKncEfNZC6Nv4HNIWxzt3rlo6WWD6Mw=; b=J3/8UHw0mzCzeXvrPpgXqHlTDE9d3s6eVIBhe1DXAMvf/vXv/yjtI1mmiu6YHF/im2 u6CCoWuM9vfM/vIJZvyE+WE02TSxPr7EkU09nHbvyVTU+c3HvwVt+gYjNvwYfPnFcR3a 5S/Imw8BW6yf9AQEc4XDmkwvWuOxKiBKpRvrwxiOatBn74aGyf50pePRBpFxobUMdK1R kkbmuyWVYYjeQHB1xo37zpDLVJxbB0nLddeWs7YkKG/eEgtULzh93LAuKvFE5aooYlHR aH7v/atwHS5E5Dslm7KKgK79qGK+oaA8OAxT/2ajzEwtJ3anZbRi+HkDa1EiomTM65VO cHTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=xjz0oM0shCZiDKncEfNZC6Nv4HNIWxzt3rlo6WWD6Mw=; b=BNZ3o7cZUI4W4iUQD5wbF0QmcPq58VwhAmcKaWI7WZxnen/2D65I5sdnerm+4on+eZ WIASAqWvclus+PBG5upaYhJiIsJRwirL6luA/Op/zA4bVOZSDq2qxnBa2q0nWWyZtg5b pArtoLu6jAE6LU7PxElrgYxXHbCWo7iyx+SvxEenD3wJb8U0d8Ac37/Z3V8S41xKrUrn E9YSRLZOxBIf/IF9jQrahywtD2b6p1tty/8wgeH680Sgx2bgt6FhPB4Efn4gTUdtgq0/ rbnr1B2C2BeXliFtcyNwRImE/mFgnqZwhROzhnD3ng39fYfTB7joie6d2dBFGKQSlZ9q HJwQ== X-Gm-Message-State: AElRT7GiM98SEz0QMXJUhuW2gym3qBmFBDZnoqCY1E0LYhrAvg7/e3TQ ni9iubCdWvEUJ6gC1NC2sqNKjcM/ X-Google-Smtp-Source: AG47ELsho3wyMtOJeJaJGe7z8L2jGkn9YXrF66fSUVr2VNwAdVXcn+gPSysVHBzL0Peb58WfhFkTfw== X-Received: by 10.28.48.11 with SMTP id w11mr12135664wmw.88.1520342379544; Tue, 06 Mar 2018 05:19:39 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:01 +0100 Message-Id: <1520342370-123606-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 05/34] cpus: wait for CPU creation at central place X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand We can now also wait for the CPU creation for single-threaded TCG, so we can move the waiting bits further out. Signed-off-by: David Hildenbrand Message-Id: <20180209195239.16048-3-david@redhat.com> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- cpus.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/cpus.c b/cpus.c index 970390b..bcfc0a4 100644 --- a/cpus.c +++ b/cpus.c @@ -1856,9 +1856,6 @@ static void qemu_tcg_init_vcpu(CPUState *cpu) #ifdef _WIN32 cpu->hThread =3D qemu_thread_get_handle(cpu->thread); #endif - while (!cpu->created) { - qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); - } } else { /* For non-MTTCG cases we share the thread */ cpu->thread =3D single_tcg_cpu_thread; @@ -1884,9 +1881,6 @@ static void qemu_hax_start_vcpu(CPUState *cpu) #ifdef _WIN32 cpu->hThread =3D qemu_thread_get_handle(cpu->thread); #endif - while (!cpu->created) { - qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); - } } =20 static void qemu_kvm_start_vcpu(CPUState *cpu) @@ -1900,9 +1894,6 @@ static void qemu_kvm_start_vcpu(CPUState *cpu) cpu->cpu_index); qemu_thread_create(cpu->thread, thread_name, qemu_kvm_cpu_thread_fn, cpu, QEMU_THREAD_JOINABLE); - while (!cpu->created) { - qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); - } } =20 static void qemu_hvf_start_vcpu(CPUState *cpu) @@ -1921,9 +1912,6 @@ static void qemu_hvf_start_vcpu(CPUState *cpu) cpu->cpu_index); qemu_thread_create(cpu->thread, thread_name, qemu_hvf_cpu_thread_fn, cpu, QEMU_THREAD_JOINABLE); - while (!cpu->created) { - qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); - } } =20 static void qemu_whpx_start_vcpu(CPUState *cpu) @@ -1940,9 +1928,6 @@ static void qemu_whpx_start_vcpu(CPUState *cpu) #ifdef _WIN32 cpu->hThread =3D qemu_thread_get_handle(cpu->thread); #endif - while (!cpu->created) { - qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); - } } =20 static void qemu_dummy_start_vcpu(CPUState *cpu) @@ -1956,9 +1941,6 @@ static void qemu_dummy_start_vcpu(CPUState *cpu) cpu->cpu_index); qemu_thread_create(cpu->thread, thread_name, qemu_dummy_cpu_thread_fn,= cpu, QEMU_THREAD_JOINABLE); - while (!cpu->created) { - qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); - } } =20 void qemu_init_vcpu(CPUState *cpu) @@ -1988,6 +1970,10 @@ void qemu_init_vcpu(CPUState *cpu) } else { qemu_dummy_start_vcpu(cpu); } + + while (!cpu->created) { + qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); + } } =20 void cpu_stop_current(void) --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342664922125.06864346286466; Tue, 6 Mar 2018 05:24:24 -0800 (PST) Received: from localhost ([::1]:55714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCZs-0001Hi-2W for importer@patchew.org; Tue, 06 Mar 2018 08:24:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVO-0004mS-14 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVK-0006Cj-8B for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:46 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35468) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVK-0006C9-1g for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:42 -0500 Received: by mail-wm0-x242.google.com with SMTP id x7so22123216wmc.0 for ; Tue, 06 Mar 2018 05:19:41 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=VUHyNubaBBAeKNMVXSOcLMklLgAC/oR1DHBBc7WTMWE=; b=esjpsnm1HaemAkvgrgpclICsz/fleCOS3CUkvWp4CsZ/z5nQlx7PdjeB27vzciCgF4 HzU4r1UVsGvt/FS+tRdXj38Pn//8wpg+2sUGNJB920DTdeb4A+oU6it/zPEAmGZm8poK I8R+Rl4AAxLheFN7XIKSkcpZvB8zW6fAcEaIHc3HmzJAXv3u8x8d5auGEZX/8Rkd8Uxi AlgtMk9midi6rPZA2GKVvthYfwmZ+H3I4Yu6tGoCcIVmsx9tQem0+bUMQ9APCsxwCTQF LMh/+ZZawxuZYagXaHE24auJtvBex33VFEtBeQ5m+3Dlbmv2m3SK+gkxieyq4dasL9SM GW0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=VUHyNubaBBAeKNMVXSOcLMklLgAC/oR1DHBBc7WTMWE=; b=EPECPNQ8/qwPF3cEBKHyWecUOz7yCqjtFfGwo2NROtwn6/bYYY+WJJBGON30zayFmt 0FvI/ws5s24oJ9jANYFitf1872pduUNXgVjvUmdgWJvrpbBn1ErBGCRP5VuLNtVtH53U c6pZ6jqci8RT11ArdEzDrOINmF/WIQaiqJ7fUhXqLC1c8jycdtZ8kGda6ICjJdRYTvgq tBx4Di19amYXIwlew56GP63HHHsppq2SSzzRneGMoqTHtJMLH2imFkAqn0I9wq5d7wqf qlO8R7VTHUBS9XFGstmFFFQKiAK3y5oMf7uzi+Fel0gBERmTIysB2m42u8Y64Nv+TVrE Dxzw== X-Gm-Message-State: AElRT7GX7WSfgIKxku6LUfCwcbH+leiZp8vgwB37RdQ04Av0zzm1qWBa mxNGFBI2GBK+Vv43qeX+QThRVZ47 X-Google-Smtp-Source: AG47ELtlHilrFutUT/GS83rRuNfEHBMZejFpfx2LRdlF17cPBO7m1Rl5LlQe8jOMXG9/VeT9fT676A== X-Received: by 10.28.35.14 with SMTP id j14mr10283753wmj.43.1520342380786; Tue, 06 Mar 2018 05:19:40 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:02 +0100 Message-Id: <1520342370-123606-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 06/34] cpus: CPU threads are always created initially for one CPU only X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand It can never happen for single-threaded TCG that we have more than one CPU in the list, while the first one has not been marked as "created". Signed-off-by: David Hildenbrand Message-Id: <20180209195239.16048-4-david@redhat.com> Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- cpus.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cpus.c b/cpus.c index bcfc0a4..9bcff7d 100644 --- a/cpus.c +++ b/cpus.c @@ -1383,11 +1383,9 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg) qemu_mutex_lock_iothread(); qemu_thread_get_self(cpu->thread); =20 - CPU_FOREACH(cpu) { - cpu->thread_id =3D qemu_get_thread_id(); - cpu->created =3D true; - cpu->can_do_io =3D 1; - } + cpu->thread_id =3D qemu_get_thread_id(); + cpu->created =3D true; + cpu->can_do_io =3D 1; qemu_cond_signal(&qemu_cpu_cond); =20 /* wait for initial kick-off after machine start */ --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342982590278.84470683581947; Tue, 6 Mar 2018 05:29:42 -0800 (PST) Received: from localhost ([::1]:55746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCev-0006j4-7E for importer@patchew.org; Tue, 06 Mar 2018 08:29:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVN-0004lX-28 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVL-0006Dg-HO for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:45 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:34163) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVL-0006D3-AK for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:43 -0500 Received: by mail-wr0-x241.google.com with SMTP id o8so9403293wra.1 for ; Tue, 06 Mar 2018 05:19:43 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=KQ5qMhC3TVUn85ynEE/lo8rHBM6IWExpez/snF+3xQM=; b=SK4bIarhUlFeIhnSY26LBUl/H4e059xvillCJKtQUrk3ywE4pHlLY+Iw7x8DlfD9Jt RRnHS8BxsavltQB/cXMziGDYVDgXvL4RY2H6BoUDetMcnJZA5FuCJoM62TJVRG6DaLGS 2za7Sv4Rck/UMtE84N4vZZmiK5Twc3J6XQu9czzVSp0f3YQvDxSqRh0juPWhJCN4tTip aCBfNu6U1UoSv+IbaQHMhNtlC3thVudnZGHPMPwd5TzrzBHOXDO+2bPaD2XFMhsnFWYY RrOZrA8zMHZUSDogIkfHtDmTUtROqh1S9/Qpn+m6KRw8WWylT2QI6heAZOznfmGu7WNi PUhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=KQ5qMhC3TVUn85ynEE/lo8rHBM6IWExpez/snF+3xQM=; b=rCMu4mJGLn4ZPHREaof9Yp7LbxvxPxyJntSYQWEOhmo02COnDFYij5J9OVOx6VuDIr AtBbayt9fgMcM6BVRH7SmJp3pTD3Cj9x2LsiNMqRK44ZdAFy04EVeAwu1jELeVDknovM y8MkJi1qUy7wkEjATU3tviLSunFV93ghwva6WHuPJvZC9Y6/ysQG3gpy2jzUaGueldqs 3KVi7ja/Xr/CxUbGPsZRRBlKi8aJf+aqZg7JmqtuTN2Cn7rqrhqqSHJPjknan8viUUUp 4WO3hplyW8WJBvPui3C5y7EZ9NGzCYnoiS+G+h0c2ufrf7qXrnmk/GNCL7xkjZ8hgeUI jKCw== X-Gm-Message-State: APf1xPDhptYl9UJ9tbhQT8IEqjKD4eSNO3glE/B2ML7vcq1Ky+gu4EVf SjnxosyOrwYEO1GFYTGCzshVNuMt X-Google-Smtp-Source: AG47ELstCNjLDKWx3LYv683sTybJ8C6c6kGHZZ9k/wmTYHc+n2hh6rH2eJxHSO+1u/mhjc6Ygi6TFA== X-Received: by 10.223.166.135 with SMTP id t7mr15318671wrc.260.1520342381945; Tue, 06 Mar 2018 05:19:41 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:03 +0100 Message-Id: <1520342370-123606-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PULL 07/34] Document --rtc-td-hack, --localtime and --startdate as deprecated X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth These options have been marked in a comment in qemu-options.hx as deprecated in 2009 already (see commit 1ed2fc1fa35fadc0d6), but we never informed the users about these deprecations. Let's catch up on that omission now. Signed-off-by: Thomas Huth Message-Id: <1519138892-12836-1-git-send-email-thuth@redhat.com> [Fix messages. - Paolo] Signed-off-by: Paolo Bonzini --- qemu-doc.texi | 16 +++++++++++----- vl.c | 5 +++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index fb6fac5..589519a 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2723,12 +2723,18 @@ filesystem test suite. Also it requires the CAP_DAC= _READ_SEARCH capability, which is not the recommended way to run QEMU. This backend should not be used and it will be removed with no replacement. =20 -@subsection -no-frame (since 2.12.0) +@subsection -rtc-td-hack (since 2.12.0) =20 -The ``-no-frame'' argument works with SDL 1.2 only. SDL 2.0 lacks -support for frameless windows, and the other user interfaces never -implemented this in the first place. So this will be removed together -with SDL 1.2 support. +The @code{-rtc-td-hack} option has been replaced by +@code{-rtc driftfix=3Dslew}. + +@subsection -localtime (since 2.12.0) + +The @code{-localtime} option has been replaced by @code{-rtc base=3Dlocalt= ime}. + +@subsection -startdate (since 2.12.0) + +The @code{-startdate} option has been replaced by @code{-rtc base=3D@var{d= ate}}. =20 @section qemu-img command line arguments =20 diff --git a/vl.c b/vl.c index 6e4f1a2..e648bed 100644 --- a/vl.c +++ b/vl.c @@ -3406,6 +3406,8 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_localtime: rtc_utc =3D 0; + warn_report("This option is deprecated, " + "use '-rtc base=3Dlocaltime' instead."); break; case QEMU_OPTION_vga: vga_model =3D optarg; @@ -3665,6 +3667,8 @@ int main(int argc, char **argv, char **envp) }; =20 qdev_prop_register_global(&slew_lost_ticks); + warn_report("This option is deprecated, " + "use '-rtc driftfix=3Dslew' instead."); break; } case QEMU_OPTION_acpitable: @@ -3866,6 +3870,7 @@ int main(int argc, char **argv, char **envp) */ break; case QEMU_OPTION_startdate: + warn_report("This option is deprecated, use '-rtc base=3D'= instead."); configure_rtc_date_offset(optarg, 1); break; case QEMU_OPTION_rtc: --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342821336184.30793636366218; Tue, 6 Mar 2018 05:27:01 -0800 (PST) Received: from localhost ([::1]:55732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCcO-0003jM-Ez for importer@patchew.org; Tue, 06 Mar 2018 08:27:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVO-0004mQ-07 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVM-0006Ek-M4 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:45 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:38598) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVM-0006Dy-Cw for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:44 -0500 Received: by mail-wr0-x242.google.com with SMTP id n7so20915594wrn.5 for ; Tue, 06 Mar 2018 05:19:44 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=FA3dueBTvWbvB24Dqdt7eQRaGTBZz6g82dqP1EHG2S0=; b=u1aqbinRxUJbnRDkpybYg//Ftt0CAbmFOLMtYUmFdtvZKvfydM8WB7YKA48GiRJWuy wT3X25xK2xGsaG4ytkRZ94liSKGWZ49zTMMTG39USkP0Rhb1rdYizKIr0SlKu+SNe/r+ nH+52VsBP+un7/L8inPgPIZtcOfLjGRjoUP2QnPvP60pN4GvTcsE1AUJiqFg+O/i+2Z+ dlEjMdC5eMO+J029MBcdTiMUIioLd7IaF1w342Du+5DE4CIWXpDeIknBV+E0PeKV+R6/ Q2UU7x/djSNPBL/GIXp/VIFeGBSNkGosCQ9uL8ZK6cMUTrjEomjQvAUbR/eTl2F3k4WW e4mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=FA3dueBTvWbvB24Dqdt7eQRaGTBZz6g82dqP1EHG2S0=; b=FDWL3KTyHSXkRLznxJR6fvRwpQ+ZaAraVDvkQA1c6W1XALnHkdffFXsX3KhYAUYcrt 2jjuR6Y1CVY4lhu8iACABJ58QoMNr3jQScc9CjmF7R0ldBgD2kGPKIv9fZcMT1dRGMEJ 6+TfwgQcJTKjaGDC1rRAUm6L9Q4XXj5kelPjhi1isYXx+Kxtgy1fWilBU/XJLyTcuNai wgW9uZeJcMsWLPI1oBtT7QcNtcPG3MxWWy1fMfZOlGaCPSOBOv+tPHiLRBwRceZDIGgS mEsSik3FlTuk68FNdoH9gnCTQCKzTd5jFWdSbDCtLT8EW/TG6S8zSj0ALNdDdn3aFg8F 2c6A== X-Gm-Message-State: APf1xPCcUkGNx4QKU6tZCx4+9RTXEBrYCrol6pDogn1XLejWpkcxl7MK zXQMoh0N66qnGeOYZNbi53iM9b+U X-Google-Smtp-Source: AG47ELsCU+KCnyaiOmpwaETKl9itbZcU8KP/A29L7QfLU4+8qLmY1Ma7qGD91AWtngFQMWLKT6cT4w== X-Received: by 10.223.182.174 with SMTP id j46mr16882027wre.43.1520342382995; Tue, 06 Mar 2018 05:19:42 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:04 +0100 Message-Id: <1520342370-123606-9-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PULL 08/34] qmp: Merge ObjectPropertyInfo and DevicePropertyInfo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alexey Kardashevskiy ObjectPropertyInfo is more generic and only missing @description. This adds a description to ObjectPropertyInfo and removes DevicePropertyInfo so the resulting ObjectPropertyInfo can be used elsewhere. Signed-off-by: Alexey Kardashevskiy Message-Id: <20180301130939.15875-2-aik@ozlabs.ru> Signed-off-by: Paolo Bonzini --- qapi/misc.json | 23 +++++------------------ qdev-monitor.c | 6 +++--- qmp.c | 20 ++++++++++---------- 3 files changed, 18 insertions(+), 31 deletions(-) diff --git a/qapi/misc.json b/qapi/misc.json index a1702c9..fb9f41d 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1285,10 +1285,12 @@ # 3) A link type in the form 'link' where subtype is a qdev # device type name. Link properties form the device model graph. # +# @description: if specified, the description of the property. +# # Since: 1.2 ## { 'struct': 'ObjectPropertyInfo', - 'data': { 'name': 'str', 'type': 'str' } } + 'data': { 'name': 'str', 'type': 'str', '*description': 'str' } } =20 ## # @qom-list: @@ -1444,34 +1446,19 @@ 'returns': [ 'ObjectTypeInfo' ] } =20 ## -# @DevicePropertyInfo: -# -# Information about device properties. -# -# @name: the name of the property -# @type: the typename of the property -# @description: if specified, the description of the property. -# (since 2.2) -# -# Since: 1.2 -## -{ 'struct': 'DevicePropertyInfo', - 'data': { 'name': 'str', 'type': 'str', '*description': 'str' } } - -## # @device-list-properties: # # List properties associated with a device. # # @typename: the type name of a device # -# Returns: a list of DevicePropertyInfo describing a devices properties +# Returns: a list of ObjectPropertyInfo describing a devices properties # # Since: 1.2 ## { 'command': 'device-list-properties', 'data': { 'typename': 'str'}, - 'returns': [ 'DevicePropertyInfo' ] } + 'returns': [ 'ObjectPropertyInfo' ] } =20 ## # @xen-set-global-dirty-log: diff --git a/qdev-monitor.c b/qdev-monitor.c index b8f6bc3..b7e3291 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -258,8 +258,8 @@ int qdev_device_help(QemuOpts *opts) { Error *local_err =3D NULL; const char *driver; - DevicePropertyInfoList *prop_list; - DevicePropertyInfoList *prop; + ObjectPropertyInfoList *prop_list; + ObjectPropertyInfoList *prop; =20 driver =3D qemu_opt_get(opts, "driver"); if (driver && is_help_option(driver)) { @@ -295,7 +295,7 @@ int qdev_device_help(QemuOpts *opts) } } =20 - qapi_free_DevicePropertyInfoList(prop_list); + qapi_free_ObjectPropertyInfoList(prop_list); return 1; =20 error: diff --git a/qmp.c b/qmp.c index ba82e1d..66332c3 100644 --- a/qmp.c +++ b/qmp.c @@ -465,12 +465,12 @@ ObjectTypeInfoList *qmp_qom_list_types(bool has_imple= ments, * * The caller must free the return value. */ -static DevicePropertyInfo *make_device_property_info(ObjectClass *klass, - const char *name, - const char *default_t= ype, - const char *descripti= on) +static ObjectPropertyInfo *make_device_property_info(ObjectClass *klass, + const char *name, + const char *default_type, + const char *description) { - DevicePropertyInfo *info; + ObjectPropertyInfo *info; Property *prop; =20 do { @@ -510,14 +510,14 @@ static DevicePropertyInfo *make_device_property_info(= ObjectClass *klass, return info; } =20 -DevicePropertyInfoList *qmp_device_list_properties(const char *typename, - Error **errp) +ObjectPropertyInfoList *qmp_device_list_properties(const char *typename, + Error **errp) { ObjectClass *klass; Object *obj; ObjectProperty *prop; ObjectPropertyIterator iter; - DevicePropertyInfoList *prop_list =3D NULL; + ObjectPropertyInfoList *prop_list =3D NULL; =20 klass =3D object_class_by_name(typename); if (klass =3D=3D NULL) { @@ -542,8 +542,8 @@ DevicePropertyInfoList *qmp_device_list_properties(cons= t char *typename, =20 object_property_iter_init(&iter, obj); while ((prop =3D object_property_iter_next(&iter))) { - DevicePropertyInfo *info; - DevicePropertyInfoList *entry; + ObjectPropertyInfo *info; + ObjectPropertyInfoList *entry; =20 /* Skip Object and DeviceState properties */ if (strcmp(prop->name, "type") =3D=3D 0 || --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342875181419.28403316427296; Tue, 6 Mar 2018 05:27:55 -0800 (PST) Received: from localhost ([::1]:55735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCdG-0004XR-4f for importer@patchew.org; Tue, 06 Mar 2018 08:27:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVR-0004qH-Ch for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVO-0006G3-00 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:49 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:53342) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVN-0006FD-MB for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:45 -0500 Received: by mail-wm0-x242.google.com with SMTP id e194so3744139wmd.3 for ; Tue, 06 Mar 2018 05:19:45 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7+LiNaufRCYJCzk/506106RvVtVvV0Ta8hjIN3C9JJ8=; b=BlCQ7XyFBR6/g7poWx0g7dor5QKFQtEwL9+eeHg7CDeflOIE/M5GYqhpUbKEQQcxPP w83zVsBJzBrOYfa0uuVDRotG84k3Qq68ZLzZ8nYrZ8e9jsYeCqEdBLXzC+gzfpfUhBri UOmsKwO9XIL5lyyIero1mMphma+kyHgU7P+0P0pFv6YZ1dYVEBjn4C7NjFklzG6BeqgE +Tl9LeUpLjoMxxfzaUY9DwjCqyPurafQYYfSQXmcDvwZiXAA1BbwURlZjJxBrqLSEIpx +crWUxuqQVxQKTAAmvyZEWpj0D+9Xb32sXRZods0gFYsYPhc+A+KqcHlFc1tSQQ5GvaI bb+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7+LiNaufRCYJCzk/506106RvVtVvV0Ta8hjIN3C9JJ8=; b=iowezB07qow+ktnmr4HNYrjcV6PxE81dvKM1XAkKpAS8zLfbgGtLfbQaVWqpchkz3i iL5JIe3ZIYEmUgaqcl1rZXIAvVMgHq/H0M8vJPrygwjVE+aWwMkvlD/6Xu+Q5HoPcHx4 oON4kfLfUJdb5mnqnUEpy79xRxtmNj0NXMgOJgMcqv7MLfPN833eXWFlsEDyYpVnsdEH I2X1DNOfIS36mzx5ulNW2cVFu11GsJKTHbApkuNgAXar+l/y9p8KmPA9FBU25WfHTzpU gdkuOybp8MoJJVkItZ5BA4srxNIykP99acT1Djappy8siGqWxpnrcpA+8omQ6vR0KV7v R0Uw== X-Gm-Message-State: AElRT7FMLIuRx0eOWX2SvjuHdXpY5u0ZNjSEGFR/cdNr9bzMaSo7/W9h mY9e0Yi8Llyi5W3bvv/EiZyHK7SE X-Google-Smtp-Source: AG47ELuof+k7jbFCn3s47/D+8bZuCiEdGBQbMmkPuvuarlRXWlnRR2EgYO1N9FpsUQ0L74wN8zweVQ== X-Received: by 10.28.3.68 with SMTP id 65mr6612697wmd.63.1520342384179; Tue, 06 Mar 2018 05:19:44 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:05 +0100 Message-Id: <1520342370-123606-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 09/34] qmp: Add qom-list-properties to list QOM object properties X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alexey Kardashevskiy There is already 'device-list-properties' which does most of the job, however it does not handle everything returned by qom-list-types such as machines as they inherit directly from TYPE_OBJECT and not TYPE_DEVICE. It does not handle abstract classes either. This adds a new qom-list-properties command which prints properties of a specific class and its instance. It is pretty much a simplified copy of the device-list-properties handler. Since it creates an object instance, device properties should appear in the output as they are copied to QOM properties at the instance_init hook. This adds a object_class_property_iter_init() helper to allow class properties enumeration uses it in the new QMP command to allow properties listing for abstract classes. Signed-off-by: Alexey Kardashevskiy Message-Id: <20180301130939.15875-3-aik@ozlabs.ru> Signed-off-by: Paolo Bonzini --- include/qom/object.h | 16 ++++++++++++++++ qapi/misc.json | 15 +++++++++++++++ qmp.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ qom/object.c | 7 +++++++ 4 files changed, 87 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index 30db296..4f07090 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1017,6 +1017,22 @@ void object_property_iter_init(ObjectPropertyIterato= r *iter, Object *obj); =20 /** + * object_class_property_iter_init: + * @klass: the class + * + * Initializes an iterator for traversing all properties + * registered against an object class and all parent classes. + * + * It is forbidden to modify the property list while iterating, + * whether removing or adding properties. + * + * This can be used on abstract classes as it does not create a temporary + * instance. + */ +void object_class_property_iter_init(ObjectPropertyIterator *iter, + ObjectClass *klass); + +/** * object_property_iter_next: * @iter: the iterator instance * diff --git a/qapi/misc.json b/qapi/misc.json index fb9f41d..bd04469 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1461,6 +1461,21 @@ 'returns': [ 'ObjectPropertyInfo' ] } =20 ## +# @qom-list-properties: +# +# List properties associated with a QOM object. +# +# @typename: the type name of an object +# +# Returns: a list of ObjectPropertyInfo describing object properties +# +# Since: 2.12 +## +{ 'command': 'qom-list-properties', + 'data': { 'typename': 'str'}, + 'returns': [ 'ObjectPropertyInfo' ] } + +## # @xen-set-global-dirty-log: # # Enable or disable the global dirty log mode. diff --git a/qmp.c b/qmp.c index 66332c3..8c7d1cc 100644 --- a/qmp.c +++ b/qmp.c @@ -578,6 +578,55 @@ ObjectPropertyInfoList *qmp_device_list_properties(con= st char *typename, return prop_list; } =20 +ObjectPropertyInfoList *qmp_qom_list_properties(const char *typename, + Error **errp) +{ + ObjectClass *klass; + Object *obj =3D NULL; + ObjectProperty *prop; + ObjectPropertyIterator iter; + ObjectPropertyInfoList *prop_list =3D NULL; + + klass =3D object_class_by_name(typename); + if (klass =3D=3D NULL) { + error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, + "Class '%s' not found", typename); + return NULL; + } + + klass =3D object_class_dynamic_cast(klass, TYPE_OBJECT); + if (klass =3D=3D NULL) { + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "typename", TYPE_OB= JECT); + return NULL; + } + + if (object_class_is_abstract(klass)) { + object_class_property_iter_init(&iter, klass); + } else { + obj =3D object_new(typename); + object_property_iter_init(&iter, obj); + } + while ((prop =3D object_property_iter_next(&iter))) { + ObjectPropertyInfo *info; + ObjectPropertyInfoList *entry; + + info =3D g_malloc0(sizeof(*info)); + info->name =3D g_strdup(prop->name); + info->type =3D g_strdup(prop->type); + info->has_description =3D !!prop->description; + info->description =3D g_strdup(prop->description); + + entry =3D g_malloc0(sizeof(*entry)); + entry->value =3D info; + entry->next =3D prop_list; + prop_list =3D entry; + } + + object_unref(obj); + + return prop_list; +} + CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) { return arch_query_cpu_definitions(errp); diff --git a/qom/object.c b/qom/object.c index f70a75c..755ad03 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1037,6 +1037,13 @@ ObjectProperty *object_property_iter_next(ObjectProp= ertyIterator *iter) return val; } =20 +void object_class_property_iter_init(ObjectPropertyIterator *iter, + ObjectClass *klass) +{ + g_hash_table_iter_init(&iter->iter, klass->properties); + iter->nextclass =3D klass; +} + ObjectProperty *object_class_property_find(ObjectClass *klass, const char = *name, Error **errp) { --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152034332575213.322211400017636; Tue, 6 Mar 2018 05:35:25 -0800 (PST) Received: from localhost ([::1]:55780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCkV-00039B-Um for importer@patchew.org; Tue, 06 Mar 2018 08:35:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVR-0004qF-Cf for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVO-0006Gp-WB for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:49 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:40136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVO-0006GG-Pp for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:46 -0500 Received: by mail-wm0-x241.google.com with SMTP id t6so22233856wmt.5 for ; Tue, 06 Mar 2018 05:19:46 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ExnxpKndTsPSZ9cB3srpn658cSG5Kyd5DBF0UQm4lKI=; b=aEBpJFG9pi7ntb97OiNAnCI1MfOPj+lEEG7g2P1Q4ncJQzEMzEcQV4TZn4mG9rt4eb v4T/Hr4BjtRKW4qdCej6PTmUZuwSpPyAssfV6Ym6KVKXG5L2qIIeZL60XlIuciCYYf2D rk7ize47z9GEuhdeLm6VLBts6Kp2CugeTtQxcs9etrZLDr50/009Tw9jpxb7r91zTDYu S9ZWMKWQz7ixwpNbmpwrJUSvGfaxw9yodFf+cozX6VSlwxUT2gYjfunt7GFhjaeMZHvh ghxxhJzxQM8IRpBQzK4AX1+ZpZY89gIupG5qOk7yp3dGKfC21BvVJVoPyRvaAH2XpJ6P fxIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ExnxpKndTsPSZ9cB3srpn658cSG5Kyd5DBF0UQm4lKI=; b=kOj17BsolJxL5TGhcS8f6s1JOi0eRWB+Pft+hIOJ+YGINyZzg4Q1BMhcT94lvLluWj /eBstL3J4Nu5l3WXkkBYlLapzVHxwevqYYU0qyGV3JKHuEOPlWKOpVK0pPWMAqeGezgD 9kx+NDmgXKhOPu1vAZNVfV6sMXWt98F25ErF/zDJYBIHXDYCvr8Yq3ALDMxfS4xvdcPt zMMBjGwZ6TztYopwmZE1uhFncDNfE0BRpSDySszgjRlilJL6nIGZg4q+s2KJ/hA79p0w oX/aWIIw1Y4i2REacBXRfG2A5Q/gJOrnnjkmLmDYZcN+wkTDFpdIBhqE4FH1gra0yEPw blxA== X-Gm-Message-State: AElRT7HyQqg2qP9xms6Nb8FEOQI5GFhQRDeB+aI3dcuJNlflIvBI9UuL Lji0Hlh+5hqX6OXYuFY1m76erPHP X-Google-Smtp-Source: AG47ELtCNS++ACNJakgsy12azSJQKqXokVy4SUy50wrZkog0/2FUP0pMfARiqHAfSlx0KqUK1t+UmQ== X-Received: by 10.28.34.3 with SMTP id i3mr10540035wmi.121.1520342385436; Tue, 06 Mar 2018 05:19:45 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:06 +0100 Message-Id: <1520342370-123606-11-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 10/34] build-sys: fix -fsanitize=address check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau Since 218bb57dd79d6843e0592c30a82ea8c1fddc74a5, the -fsanitize=3Daddress check fails with: config-temp/qemu-conf.c:3:20: error: integer overflow in expression [-Werro= r=3Doverflow] return INT32_MIN / -1; Interestingly, UBSAN check doesn't produce a compile time warning. Use a test that doesn't have compile time warnings, and make it specific to UBSAN check. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20180215212552.26997-2-marcandre.lureau@redhat.com> Reviewed-by: Emilio G. Cota Signed-off-by: Paolo Bonzini --- configure | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/configure b/configure index 27d3f66..7ff00f8 100755 --- a/configure +++ b/configure @@ -5316,25 +5316,27 @@ fi ########################################## # checks for sanitizers =20 -# we could use a simple skeleton for flags checks, but this also -# detect the static linking issue of ubsan, see also: -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D84285 -cat > $TMPC << EOF -#include -int main(void) { - return INT32_MIN / -1; -} -EOF - have_asan=3Dno have_ubsan=3Dno have_asan_iface_h=3Dno have_asan_iface_fiber=3Dno =20 if test "$sanitizers" =3D "yes" ; then + write_c_skeleton if compile_prog "$CPU_CFLAGS -Werror -fsanitize=3Daddress" ""; then have_asan=3Dyes fi + + # we could use a simple skeleton for flags checks, but this also + # detect the static linking issue of ubsan, see also: + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D84285 + cat > $TMPC << EOF +#include +int main(void) { + void *tmp =3D malloc(10); + return *(int *)(tmp + 2); +} +EOF if compile_prog "$CPU_CFLAGS -Werror -fsanitize=3Dundefined" ""; then have_ubsan=3Dyes fi --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343168750748.583583071808; Tue, 6 Mar 2018 05:32:48 -0800 (PST) Received: from localhost ([::1]:55763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etChu-0000oq-W6 for importer@patchew.org; Tue, 06 Mar 2018 08:32:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVR-0004qI-D1 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVQ-0006Hu-DB for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:49 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:55683) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVQ-0006HF-5y for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:48 -0500 Received: by mail-wm0-x241.google.com with SMTP id q83so22817436wme.5 for ; Tue, 06 Mar 2018 05:19:48 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K7gAKeKF3wkSBFX3nXuIOPWmTz1FGWtJrmq9Ed1PGEI=; b=sA6kFxCNkr1orEnXwEwQ/bZvDNlB/7OGRE0EVb3DlH7l8/7etVlYs3tjGuudKFg96e Oz5Q1ru1eYty6+YGpahTsSJht2wk9xRYNabM12YD7aASaFKMdJKYJCmpVj3I8vI2z/5K Ldqx9u3qso05sgSPHEhnOypzcBFURpOC40syGFtKPflHIy5Q1tfuxmqfRCc0JeKLmgyi 2GLOcWuQ+5Mq5131a2rtC5LJbeQGJjF4+JtSoOgotvstD7t37ubkUOatQpdRYbmsWTIR XVIWpfkxSSaKdZdJj076TbZhNtXCigOld6OApzU/7UHixdJIHa9pWh+9rUIUMxC4p+rO xGfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=K7gAKeKF3wkSBFX3nXuIOPWmTz1FGWtJrmq9Ed1PGEI=; b=BQZ/o/aBC+yqOcIPHGOyHMGWQjsQMOn9QTFY6Oj8HhTmslg9elaLkAHbcQmiy05pKX rjqhii9hSERCP8aVvct/h8pHPdwEgXjlOj2ImBOkzvsRnKaGLeS7TFB+mWeYxtoO5370 nJCXAB11qf9I7GvlkWvPuOKhMGnb+bnfjQRUQkbln4dI+EXZiQp28HuMpEH1o0n+X4IS /KDdU1ps3lYxmcLN31MBnS5ZbMXUiRRdO06bJ6WUMsk5WWzwZAZ0YyxorfwzOGme61Wz LCvDbMfrEVmi/Nt1QklZeP3/ENIg6dFZM4/suewvzS3E3nsDsGLevD0WpddZ5eXuLu0X vbRw== X-Gm-Message-State: AElRT7E46Pdy8QrK5Rc/VqE5wRMGly06xlhz9jfqpdoj4+9Bgwbfa3Rk J6Dnmo0uEsy12lN97bVEImKKgGp1 X-Google-Smtp-Source: AG47ELulUJ5Rcbaxa1ZxYYtRH93KNNvaCJYkVSkFg416np5WnMpvohOS5P9XmLzPYcHDlgwDBu145A== X-Received: by 10.28.18.2 with SMTP id 2mr10649055wms.108.1520342386904; Tue, 06 Mar 2018 05:19:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:07 +0100 Message-Id: <1520342370-123606-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 11/34] lockable: workaround GCC link issue with ASAN X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau Current GCC has an optimization bug when compiling with ASAN. See also GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D84307 Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20180215212552.26997-3-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- include/qemu/lockable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/lockable.h b/include/qemu/lockable.h index b6ed6c8..84ea794 100644 --- a/include/qemu/lockable.h +++ b/include/qemu/lockable.h @@ -28,7 +28,7 @@ struct QemuLockable { * to QEMU_MAKE_LOCKABLE. For optimized builds, we can rely on dead-code = elimination * from the compiler, and give the errors already at link time. */ -#ifdef __OPTIMIZE__ +#if defined(__OPTIMIZE__) && !defined(__SANITIZE_ADDRESS__) void unknown_lock_type(void *); #else static inline void unknown_lock_type(void *unused) --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342664941969.8501049577451; Tue, 6 Mar 2018 05:24:24 -0800 (PST) Received: from localhost ([::1]:55712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCZn-0001Bl-0K for importer@patchew.org; Tue, 06 Mar 2018 08:24:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVV-0004vB-Df for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVR-0006J1-G0 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:53 -0500 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:35038) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVR-0006I1-8Q for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:49 -0500 Received: by mail-wm0-x233.google.com with SMTP id x7so22123961wmc.0 for ; Tue, 06 Mar 2018 05:19:49 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AcfrYezGbpb3459nOVQ3Hy+fTnPB2M7uLYZC8Fmvl5Y=; b=jpKHiI1mBFPlMJe+AlVCemsE0n1JQqw4B2VcdT4Kerb1aykq8+GQVhQoRacSerGDar PVp2qjs05wuW8sw2DvSTriCKXi4fXdB2RVXs8HSdm17KUdpgiAnIcyO5bR/Hlcgxs3P8 wZe/oXDP07eobXuZDUQ/Tw16Z77nyyUbyqd9URyDKOXwv9ONZNQMOJIyzFuTe/hmUvyW bdLoszR5Jew7AWFr8/2HlZ8JFjh7dJcKrDymwEN6yn8FtAEtu0QEyT1cU3/g/2GdMG36 nCwADx6SLBbr0AyiDwhsnbUbEd7x6BsU3orpYiOa5OiX0m7CWBAGFtr0YxXvMqKMOr1w 1UUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AcfrYezGbpb3459nOVQ3Hy+fTnPB2M7uLYZC8Fmvl5Y=; b=BjX3kVB7+6/DyYaVIxK6W0lr2JAO8Xn7P5xpS9cwoaWte7UGyO3r/QXqTktXT20Qsi aIK7wKtDSXybHMzbVVyI/IGS9/46O8c5LygApJs4C5+XrCaoV8IBRUi7Wki06Pl8Ik/H vMI6yk5UKLuqj73ukv/N3kiEQHZmzJkLN4C5JtQOG5UEkihvqn/6azn9txgcawEul80U f/M1J8robsqJuFay4BC9gzSyY1LGDZa4b0JzveT9RO69FHtUTuZFeX7Hr2QCyy+SXXRt 2bU1gFvNizSITqqhZlYCRI/arAHCJUY+lyuw6twNKDVt6c6NjicBcq3DjpEtgGXO34HU bgSw== X-Gm-Message-State: AElRT7Fy5JS26CYB3cvaPYcrAhd3eeTtgxVMtU2LSrIhwXxcyTIjeYmk LRERMaCX90LRyYazGDSF2aLvWDPg X-Google-Smtp-Source: AG47ELsxyJb/7TI/w1ZattrIUW+Pwht/JiElmf0a7c3AN29WP0h4p0k3LBdEYFIsxAu096mvoS7RtQ== X-Received: by 10.28.111.145 with SMTP id c17mr10283384wmi.74.1520342387915; Tue, 06 Mar 2018 05:19:47 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:08 +0100 Message-Id: <1520342370-123606-13-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::233 Subject: [Qemu-devel] [PULL 12/34] ahci-test: fix opts leak of skip tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau Fixes the following ASAN report: Direct leak of 128 byte(s) in 8 object(s) allocated from: #0 0x7fefce311850 in malloc (/lib64/libasan.so.4+0xde850) #1 0x7fefcdd5ef0c in g_malloc ../glib/gmem.c:94 #2 0x559b976faff0 in create_ahci_io_test /home/elmarco/src/qemu/tests/a= hci-test.c:1810 Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20180215212552.26997-6-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- tests/ahci-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 2342fe3..fb3cd84 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -1823,6 +1823,7 @@ static void create_ahci_io_test(enum IOMode type, enu= m AddrMode addr, if ((addr =3D=3D ADDR_MODE_LBA48) && (offset =3D=3D OFFSET_HIGH) && (mb_to_sectors(test_image_size_mb) <=3D 0xFFFFFFF)) { g_test_message("%s: skipped; test image too small", name); + g_free(opts); g_free(name); return; } --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152034346488813.896153490399115; Tue, 6 Mar 2018 05:37:44 -0800 (PST) Received: from localhost ([::1]:55799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCmk-00059B-3i for importer@patchew.org; Tue, 06 Mar 2018 08:37:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVT-0004sm-RI for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVS-0006KL-T0 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:51 -0500 Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]:37735) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVS-0006Jb-Lv for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:50 -0500 Received: by mail-wr0-x230.google.com with SMTP id z12so20914602wrg.4 for ; Tue, 06 Mar 2018 05:19:50 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jXy4UcFZOklfR5mqTUr9twHRnkMsoazxyJ2TDAnZhqI=; b=kRecFNsImlKjiMsNCc7AkbBeHsxGJHcH6oSkoJHZeQam5hmbcFoIyvgC+0K8f1XUvf X5G+pzVsTpzeZZntGSS7OViGgR7LFRePJk1XtP0cAoc+bZyGhnXVNua0x5P4E1T4z1J1 zNfQhLG0RTf3n8tzqiJ/hvdVbDcP87qmQt7SMOPv4Ofr6VO4spGMHTaNKDfI0Ky9JAZW 4sirK8tI4tC4yqzVz351HeBN+CclgJCZQQbm0mjtEK3okGtC3FSdn4AKzTOYkwJ2oean Uc/2iXWGg0Nf4X+VKLagJ6iNQy/L+OH/60g+OVa7GQbYOwf5WxLn5C7h7D0fAWAiJykJ MsVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jXy4UcFZOklfR5mqTUr9twHRnkMsoazxyJ2TDAnZhqI=; b=MEKeDKhGzqdeKMntxfctbvIL+Y2sLTFYIL+96Jd8h95KHod87iUE4kCuc72Nz7tTVB 0N/BG7C0yFfAZrUv4pvN0c/5d4ddmSVIoHJYoNtUyR+U4paZbZVIKH1E0do2TGM60z5X q+6FbPq6u1g7LDHyCXG/DMSHYqHn7SUOBupEj8qxXLVj0qrh6P5YMhd226SF2oQh41Jt REyDMMHxXCvf1BTaLgFiRejUk2Tnxc3BpFjlDO2mIQURvAwRcLVmBj4oYb1WAU0awJ9j VYaZdJWyVG7brJpRiMtrDqS9XaXBYj5oAjVOOO4tRvAIg+w6RgforVRsyIy0x/oA2Tes xqEg== X-Gm-Message-State: AElRT7EzKbX5JdyO2iD0bVcGLk4WmeqbuFTVZXOeD3e+gewLVTWCru5A hgeAQvUHlgDxEVQARzXvd9uaygmW X-Google-Smtp-Source: AG47ELukLO8Nq9WFlhSWDdQd5WVaYTGZ2ibqVve+YygVUyVidBPFrsYc1hbWneqhuu9SGi0hsEmSgA== X-Received: by 10.223.209.11 with SMTP id a11mr1418136wri.122.1520342389252; Tue, 06 Mar 2018 05:19:49 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:09 +0100 Message-Id: <1520342370-123606-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::230 Subject: [Qemu-devel] [PULL 13/34] sdhci-test: fix leaks X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau Fix the following ASAN reports: =3D=3D20125=3D=3DERROR: LeakSanitizer: detected memory leaks Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7f0faea03a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38) #1 0x7f0fae450f75 in g_malloc0 ../glib/gmem.c:124 #2 0x562fffd526fc in machine_start /home/elmarco/src/qemu/tests/sdhci-t= est.c:180 Indirect leak of 152 byte(s) in 1 object(s) allocated from: #0 0x7f0faea03850 in malloc (/lib64/libasan.so.4+0xde850) #1 0x7f0fae450f0c in g_malloc ../glib/gmem.c:94 #2 0x562fffd5d21d in qpci_init_pc /home/elmarco/src/qemu/tests/libqos/p= ci-pc.c:122 Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20180215212552.26997-7-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- tests/sdhci-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sdhci-test.c b/tests/sdhci-test.c index 6b3a532..1d825eb 100644 --- a/tests/sdhci-test.c +++ b/tests/sdhci-test.c @@ -209,8 +209,10 @@ static QSDHCI *machine_start(const struct sdhci_t *tes= t) =20 static void machine_stop(QSDHCI *s) { + qpci_free_pc(s->pci.bus); g_free(s->pci.dev); qtest_quit(global_qtest); + g_free(s); } =20 static void test_machine(const void *data) --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343038785268.1346109991274; Tue, 6 Mar 2018 05:30:38 -0800 (PST) Received: from localhost ([::1]:55748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCfp-0007Vi-7S for importer@patchew.org; Tue, 06 Mar 2018 08:30:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVV-0004ue-2j for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVU-0006LO-4A for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:53 -0500 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:37515) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVT-0006Ke-TK for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:52 -0500 Received: by mail-wr0-x243.google.com with SMTP id z12so20914668wrg.4 for ; Tue, 06 Mar 2018 05:19:51 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=gUYOTu54Gbb/O3JUTFVV2IsgSRSAgLKw/SO/h4nHON0=; b=bF92i0D3JR/z2dwdkp1C+XtWkra1gVrhBnEy9nHbseyyuCZTBQnijOfRqouJSLyVZv cCxwmuR32eR696pNwsCLG2PnfVeek/OoOI920Cv0JqvQ42ZEGLxQgJlcew1AlD6gCIDw OTHaLKjP6TR9RcxNTElzWrB23gu/SGesxjmZU77TKt96jbM0dbwYSxMZ4CNhDjD8tx6v IhtQSu2vRc7JDdIa95IvIYHZeDAEikQr6K+INv+tcfZQ7p6dwo6UDPTRoTqsmYK7FkKY FIhKEwTVTWXIJwTekbnS7k1/v9h/FXi4ZmqqN9ZFavkOWNYpHIG7J80k39Da74n8fUlc q2iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=gUYOTu54Gbb/O3JUTFVV2IsgSRSAgLKw/SO/h4nHON0=; b=p8yQ5pkCV98SSUu4KA4Vl8ojRWAimBJ0j+gMXmvc+sYxv1QgAJskWpZR+GvsV1uCU0 yBMSSUL1MHRcWvldf4IdM1RDWkz8TClNuoLELcxqKWltF7wyngXeMXn80Gtssd0j8d4K VtAjGg5sn4uH+aQAwA4W4BfO7Krx3i+47+imIOYcKyG4KbQ+bM403wjdpfExXdQW949j Tse7HgFZLWRBmeXxAGGoilCHrJVvwdWQP1rkDqdE7eQoz7pCHsKmHqGVKB7rw68nW6MW hmDOsKJGhD6t0UTtp1saTPv1q4K/LHOhU6ysrIHRWCOaYHlIARLPIkttNQIMf2l7W+iO EJaw== X-Gm-Message-State: APf1xPAvqO98WsrHZXrEdHoTf3M+1rGQFsTGfyTN+BjuY9xhnx/Sug5J 9Re0KPeUU7QJik2DiTTtK5YdplnQ X-Google-Smtp-Source: AG47ELtVkoEPfnu9lo+RcyDzvxGVQSfvt01+oHQ0AxKpuk0HHdonjxzAD3Al8ekaInLUfv1fHUt0iA== X-Received: by 10.223.130.176 with SMTP id 45mr15843418wrc.250.1520342390581; Tue, 06 Mar 2018 05:19:50 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:10 +0100 Message-Id: <1520342370-123606-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PULL 14/34] chardev: fix leak in tcp_chr_telnet_init_io() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Xu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu Need to free TCPChardevTelnetInit when session established. Since at it, switch to use G_SOURCE_* macros. Reviewed-by: Daniel P. Berrange Signed-off-by: Peter Xu Message-Id: <20180301084438.13594-2-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- chardev/char-socket.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 22f6597..8401aae 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -592,19 +592,23 @@ static gboolean tcp_chr_telnet_init_io(QIOChannel *io= c, ret =3D 0; } else { tcp_chr_disconnect(init->chr); - return FALSE; + goto end; } } init->buflen -=3D ret; =20 if (init->buflen =3D=3D 0) { tcp_chr_connect(init->chr); - return FALSE; + goto end; } =20 memmove(init->buf, init->buf + ret, init->buflen); =20 - return TRUE; + return G_SOURCE_CONTINUE; + +end: + g_free(init); + return G_SOURCE_REMOVE; } =20 static void tcp_chr_telnet_init(Chardev *chr) --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343609771620.749994313214; Tue, 6 Mar 2018 05:40:09 -0800 (PST) Received: from localhost ([::1]:55809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCp3-000787-Li for importer@patchew.org; Tue, 06 Mar 2018 08:40:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVW-0004vp-0m for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVV-0006M9-3G for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:53 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:53346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVU-0006Lg-T3 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:53 -0500 Received: by mail-wm0-x244.google.com with SMTP id e194so3744853wmd.3 for ; Tue, 06 Mar 2018 05:19:52 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=dzAfTIDAO2KxlJFnLw5ZEBcbIF1HNoLCqsGJE0jjOPg=; b=rK7zlQRfOBUIZQ6gvLWICf7DnqwvVCwc/lyY37gFGsouUyttXMqKxOvr63Zf6UCspI vKvti8Q/IV4aK+K1ePQJNPy0g6+GmDQXq+3bv7Y1VHgKFO5/MqdlKsxKvISEB8ewW6ga QOLQmn9I1UB4wr1gqyyOPzorFz/n/SyrYcp9P+dlG6ZFC52/IOYoH4KKqYAikZ8UTB4t luCuv5Iyq0I1WojHAHjJ8Gu24yzCS1gf2MRMNNbmIc0DhUBHHz3kRPy2XNdpGS7Q860+ +GBXNko6YnNTEDYZPtuJ9T4wpJ1rH0ffIN/BvtVbcolFLRwrNSDvTUFhzt5enRopw90H J4Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=dzAfTIDAO2KxlJFnLw5ZEBcbIF1HNoLCqsGJE0jjOPg=; b=reIHQAzY1Sz3lG8MX6v1QwKIm57YvN/fZ8NCxT7xhyEM/d+nL1EneVDjvfdXN+8JBz dgGZkPrhgfuBqETE1RxRB/lgg+/63IqycE+9WMKciaXpyNCWWrXOq2dJWWE+P/00wSUR /Cap7wSy1vanvMe4WAfd/l1Sa48P/6MWwAfPpRgZtH3uzZ4KsGCqdwgVnRZ/LP4ZGWT7 J0VLxnou0rBtueXLzacyfG4QrtPu1sxYTew0UKcM4cz2jUFvzaQpTFSbHDs1zgdS2YRO KYlMxgrUg4gcDjFwau8BCsm9HC1J+yQJ80yGKJnqC/dGKXiO8NJp0Imz12SEDlMb8EPY pofQ== X-Gm-Message-State: AElRT7HqzHlV3D+EcMT7bFQqwt1x7bakGuZGGDDZgMn4+zXJGvW4TyqR Lh4M1RT/1vmJ6yIWMaFSODEDjQX3 X-Google-Smtp-Source: AG47ELuE9xsMrPAY2zMy5dLOsqQZ6HwEzCDAWNdTH42faZUgk0avPq8i3yrnF6Tl0iNp9ZAn/ac4ag== X-Received: by 10.28.241.2 with SMTP id p2mr10570847wmh.105.1520342391738; Tue, 06 Mar 2018 05:19:51 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:11 +0100 Message-Id: <1520342370-123606-16-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 15/34] openpic_kvm: drop address_space_to_flatview call X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The MemoryListener is registered on address_space_memory, there is not much to assert. This currently works because the callback is invoked only once when the listener is registered, but section->fv is the _new_ FlatView, not the old one on later calls and that would break. This confines address_space_to_flatview to exec.c and memory.c. Acked-by: David Gibson Reviewed-by: Alexey Kardashevskiy Signed-off-by: Paolo Bonzini --- hw/intc/openpic_kvm.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/intc/openpic_kvm.c b/hw/intc/openpic_kvm.c index f1a59e5..928bc04 100644 --- a/hw/intc/openpic_kvm.c +++ b/hw/intc/openpic_kvm.c @@ -125,10 +125,6 @@ static void kvm_openpic_region_add(MemoryListener *lis= tener, uint64_t reg_base; int ret; =20 - if (section->fv !=3D address_space_to_flatview(&address_space_memory))= { - abort(); - } - /* Ignore events on regions that are not us */ if (section->mr !=3D &opp->mem) { return; --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342825670763.5441118529196; Tue, 6 Mar 2018 05:27:05 -0800 (PST) Received: from localhost ([::1]:55733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCcS-0003nV-Kd for importer@patchew.org; Tue, 06 Mar 2018 08:27:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVc-0005Gs-IR for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVW-0006NO-F2 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:00 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:39657) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVW-0006Mh-95 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:54 -0500 Received: by mail-wr0-x241.google.com with SMTP id w77so20920129wrc.6 for ; Tue, 06 Mar 2018 05:19:54 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=ejuOZ4fycEmyLZGVgVLzduy4qGDCYyllGJMr3iKT+Iw=; b=gMUq8Qq4POuEslZclOUGk3hQpyCgK9g71Zrrm0gFyO6diIRL4KPfk9tL/I9SD/oOYh hIBdUC/bQFRg0bYRifrk/fVHCpJqTSuVnoQFxTjfloikyRzhLc5SNwxE5zMf+7HB2O/A z0CiWMJwgTiQeqkzXZotxneDXylg6N0CBx6vjLsoxphN1KOZKxMqDnsl/Ns7DdURqFEk KMfvNm44xVPvhd6KSNmmn0pcxBNG67tZ+VUqz3CtS2bQ5fwiRmshxkmn3JBffqZf35mN J0McrCj5/VTxy2ic4nu8XCwIy8CRxCJSuEAOtNyMbDFQkQXIHYKTtP2T/W6LbYqiRtDH gqjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=ejuOZ4fycEmyLZGVgVLzduy4qGDCYyllGJMr3iKT+Iw=; b=ccg2YUxbzB3MFri8hMQvDqP7ccqF8U3lhBJVfQEVzR4RrEnxk89w6kKBEP+OG9ajBE mz27sja3Xq3qdx2DGc5bRTaScTL98Ao3cs1NWzTcdYPVMaTADa5uDk10vK0y2rP5ht3Q 8v2Ci8QhK/OhJb3g2oHXY00P288MeGLWVmPX/0U/ZRM2xSJXS6SpWC2BbhSXtub0AB9L 9C+NhdsrNievNiTb+KLwP018+F3YTyybFRlIWKTZAHRCnEfS4H4x/cVmdYDN4NOUbKM2 WkiX3aeMIXybTtYN5+zMc0WSTe9Cn5t7GLWV5qrwzrcuHGGCQV5c+5TfQJhKcbZsMwWb j1cg== X-Gm-Message-State: APf1xPCzDFHI44c9mBB86shF+Ym7ZdYe3yskEwAFin+Q7EentVFbJgPM uAuT5CHPNrx95b/GOZEdhhbPnpuX X-Google-Smtp-Source: AG47ELuwKMluna1yckpRUy39DrNzjFDSnFJYgAOkH8ErEsZ22kAPg1qJv+ShjGzRmK76jT3XQBdcRw== X-Received: by 10.223.190.17 with SMTP id n17mr14929224wrh.189.1520342392730; Tue, 06 Mar 2018 05:19:52 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:12 +0100 Message-Id: <1520342370-123606-17-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PULL 16/34] memory: inline some performance-sensitive accessors X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" These accessors are called from inlined functions, and the call sequence is much more expensive than just inlining the access. Move the struct declaration to memory-internal.h so that exec.c and memory.c can both use an inline function. Reviewed-by: Alexey Kardashevskiy Signed-off-by: Paolo Bonzini --- include/exec/memory-internal.h | 13 +++++++++---- include/exec/memory.h | 22 +++++++++++++++++++++- memory.c | 30 ------------------------------ 3 files changed, 30 insertions(+), 35 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 4162474..6a5ee42 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/memory-internal.h @@ -21,7 +21,15 @@ #define MEMORY_INTERNAL_H =20 #ifndef CONFIG_USER_ONLY -typedef struct AddressSpaceDispatch AddressSpaceDispatch; +static inline AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv) +{ + return fv->dispatch; +} + +static inline AddressSpaceDispatch *address_space_to_dispatch(AddressSpace= *as) +{ + return flatview_to_dispatch(address_space_to_flatview(as)); +} =20 extern const MemoryRegionOps unassigned_mem_ops; =20 @@ -31,9 +39,6 @@ bool memory_region_access_valid(MemoryRegion *mr, hwaddr = addr, void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section); AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv); void address_space_dispatch_compact(AddressSpaceDispatch *d); - -AddressSpaceDispatch *address_space_to_dispatch(AddressSpace *as); -AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv); void address_space_dispatch_free(AddressSpaceDispatch *d); =20 void mtree_print_dispatch(fprintf_function mon, void *f, diff --git a/include/exec/memory.h b/include/exec/memory.h index 15e8111..4b65b56 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -326,7 +326,27 @@ struct AddressSpace { QTAILQ_ENTRY(AddressSpace) address_spaces_link; }; =20 -FlatView *address_space_to_flatview(AddressSpace *as); +typedef struct AddressSpaceDispatch AddressSpaceDispatch; +typedef struct FlatRange FlatRange; + +/* Flattened global view of current active memory hierarchy. Kept in sort= ed + * order. + */ +struct FlatView { + struct rcu_head rcu; + unsigned ref; + FlatRange *ranges; + unsigned nr; + unsigned nr_allocated; + struct AddressSpaceDispatch *dispatch; + MemoryRegion *root; +}; + +static inline FlatView *address_space_to_flatview(AddressSpace *as) +{ + return atomic_rcu_read(&as->current_map); +} + =20 /** * MemoryRegionSection: describes a fragment of a #MemoryRegion diff --git a/memory.c b/memory.c index 6515131..e70b64b 100644 --- a/memory.c +++ b/memory.c @@ -210,8 +210,6 @@ static bool memory_region_ioeventfd_equal(MemoryRegionI= oeventfd a, && !memory_region_ioeventfd_before(b, a); } =20 -typedef struct FlatRange FlatRange; - /* Range of memory in the global map. Addresses are absolute. */ struct FlatRange { MemoryRegion *mr; @@ -222,19 +220,6 @@ struct FlatRange { bool readonly; }; =20 -/* Flattened global view of current active memory hierarchy. Kept in sort= ed - * order. - */ -struct FlatView { - struct rcu_head rcu; - unsigned ref; - FlatRange *ranges; - unsigned nr; - unsigned nr_allocated; - struct AddressSpaceDispatch *dispatch; - MemoryRegion *root; -}; - typedef struct AddressSpaceOps AddressSpaceOps; =20 #define FOR_EACH_FLAT_RANGE(var, view) \ @@ -322,21 +307,6 @@ static void flatview_unref(FlatView *view) } } =20 -FlatView *address_space_to_flatview(AddressSpace *as) -{ - return atomic_rcu_read(&as->current_map); -} - -AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv) -{ - return fv->dispatch; -} - -AddressSpaceDispatch *address_space_to_dispatch(AddressSpace *as) -{ - return flatview_to_dispatch(address_space_to_flatview(as)); -} - static bool can_merge(FlatRange *r1, FlatRange *r2) { return int128_eq(addrrange_end(r1->addr), r2->addr.start) --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343752095665.0696487454452; Tue, 6 Mar 2018 05:42:32 -0800 (PST) Received: from localhost ([::1]:55832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCrP-00012E-CV for importer@patchew.org; Tue, 06 Mar 2018 08:42:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVb-0005EH-FG for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVX-0006Nx-Fa for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:59 -0500 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:42918) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVX-0006NX-8Y for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:55 -0500 Received: by mail-wr0-x243.google.com with SMTP id k9so20878356wre.9 for ; Tue, 06 Mar 2018 05:19:55 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=hOS1RwABf20pTv/sBn3lio9Rwa9RkF0vJoM8RX6VPZY=; b=ad16U+/dH7FUVnKojqAIAFsOqDgjX+SnOVJIYQBbmJYOZzqHAY6sWp4+fkBxc5u2Zf LkRf6WTA9O6zFtI0XEarM8M0GuiGTQGb4jaoqd4WEfXfyDu2LSAuUsGKkvI/TzeJ9LFz 4bQVUB2shLpK0XGX7XyJlhxMyNEAhe27dvxMljuZWzFwZG2r8PHcE2ONuQcRnyyhNGgd p6ytF9kBQvuQBRIvv11EtQt074ugs/mvSxBh3NKAIPdYWqhTfKneFq8HX0TsxNKDPtad 0Nuri4Gt5L+/VFP+2uzdqKaK6XREGicVUU3aRcL/Kr3SyxTvaFomXRY+cUdlPdfa1QDx go5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=hOS1RwABf20pTv/sBn3lio9Rwa9RkF0vJoM8RX6VPZY=; b=CcBpmWdR5FSNe8aZJQBfmnz7D9W5A7vCAlM2xlx/wOVlZsu/bvlC/CGjLye4sv6KyL YtfhUYongeIQagMJwIkK/hs6Cwrini9QIgP/09x57tFzJHX6Yo6oQibsDC3AIpnS9vdd h4eNv9SJi3GeMasIAII/J1wqt3y0tZrXchnD+Y1RaydRa2lIrpMkvRPYpgKuS0P7oDHY S1GFiy2bnTY2nYhKwUfUY48if2A8A0EzpA45V2ErzBOdScwzaX70zrSURRE6sMx+BECA fyqd/USpzIjiunZ+HC9NuZdQz8k2lIcLb72l872Uw1zzQMevNMw6SWsZAsKm2uxdpThx N96A== X-Gm-Message-State: APf1xPA8HLVWdTZHGkvM6q0VrSm9ziCf8z714vzJayZ19JwXptLAFudd A1cAHN0ADw+Wvq6bf9bSEKhYYMA/ X-Google-Smtp-Source: AG47ELs74DVEKMy5u3Wi13Wchp0NkTRh2SN3wo3ifoJE1PAeXDGFYRm/Sq9nAuYcY+BQup2k6eOMEg== X-Received: by 10.223.134.170 with SMTP id 39mr15129037wrx.221.1520342393965; Tue, 06 Mar 2018 05:19:53 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:13 +0100 Message-Id: <1520342370-123606-18-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PULL 17/34] address_space_write: address_space_to_flatview needs RCU lock X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" address_space_write is calling address_space_to_flatview but it can be called outside the RCU lock. To fix it, push the rcu_read_lock/unlock pair up from flatview_write to address_space_write. Reviewed-by: Alexey Kardashevskiy Signed-off-by: Paolo Bonzini --- exec.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/exec.c b/exec.c index 4d8addb..ec91162 100644 --- a/exec.c +++ b/exec.c @@ -3078,6 +3078,7 @@ static MemTxResult flatview_write_continue(FlatView *= fv, hwaddr addr, return result; } =20 +/* Called from RCU critical section. */ static MemTxResult flatview_write(FlatView *fv, hwaddr addr, MemTxAttrs at= trs, const uint8_t *buf, int len) { @@ -3086,25 +3087,14 @@ static MemTxResult flatview_write(FlatView *fv, hwa= ddr addr, MemTxAttrs attrs, MemoryRegion *mr; MemTxResult result =3D MEMTX_OK; =20 - if (len > 0) { - rcu_read_lock(); - l =3D len; - mr =3D flatview_translate(fv, addr, &addr1, &l, true); - result =3D flatview_write_continue(fv, addr, attrs, buf, len, - addr1, l, mr); - rcu_read_unlock(); - } + l =3D len; + mr =3D flatview_translate(fv, addr, &addr1, &l, true); + result =3D flatview_write_continue(fv, addr, attrs, buf, len, + addr1, l, mr); =20 return result; } =20 -MemTxResult address_space_write(AddressSpace *as, hwaddr addr, - MemTxAttrs attrs, - const uint8_t *buf, int len) -{ - return flatview_write(address_space_to_flatview(as), addr, attrs, buf,= len); -} - /* Called within RCU critical section. */ MemTxResult flatview_read_continue(FlatView *fv, hwaddr addr, MemTxAttrs attrs, uint8_t *buf, @@ -3213,6 +3203,23 @@ MemTxResult address_space_rw(AddressSpace *as, hwadd= r addr, addr, attrs, buf, len, is_write); } =20 +MemTxResult address_space_write(AddressSpace *as, hwaddr addr, + MemTxAttrs attrs, + const uint8_t *buf, int len) +{ + MemTxResult result =3D MEMTX_OK; + FlatView *fv; + + if (len > 0) { + rcu_read_lock(); + fv =3D address_space_to_flatview(as); + result =3D flatview_write(fv, addr, attrs, buf, len); + rcu_read_unlock(); + } + + return result; +} + void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf, int len, int is_write) { --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342819663394.78935030413265; Tue, 6 Mar 2018 05:26:59 -0800 (PST) Received: from localhost ([::1]:55731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCcM-0003i1-Nd for importer@patchew.org; Tue, 06 Mar 2018 08:26:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVb-0005EU-Fu for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVY-0006Oy-NS for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:59 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:39211) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVY-0006O9-Cp for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:56 -0500 Received: by mail-wm0-x241.google.com with SMTP id i3so22100837wmi.4 for ; Tue, 06 Mar 2018 05:19:56 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=hJxET/c3ydg1FCybJ8v/94k4KSi4zKViHorP/gNpv8M=; b=PmcOloy0v5TXorXx6LjX56bdT2lLeXjrqXMHk+6KwMf2wQJrSWhAz1YRpRAViYKaCd lO+yIpyG1iM6FtGcLHPsfvLeOlkFVJJxCSVuK4u/XQ8au//rHoWLdCXCHOZP9iZUwLRt 3POlQw9L05IuEgYXQzKtGThPhZc6t0LXBwNiyMFGbN7jSB98SzNKLtlidNflmtLV7Ewj vuJ7BnnHfSa1Zm5B9+SSMPEi6I++9+WQ2tRPKyvrOdrwprkZcnU2w90JkUcYkn7YOwHm niKhe6yuNP9gvt1n26Obu182nVnShBNlIrYD8P3spnCOrWLkrTf5L8MV8//exCZGPK2W 9WlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=hJxET/c3ydg1FCybJ8v/94k4KSi4zKViHorP/gNpv8M=; b=qfWAvlYWBJln2aZl9OQ3Y9n7H1QHE8KCKcuQJXq3+c0/DCdBcXTMUURtWOxNT/LmL0 lOrgdwVgyJv409RBCjRuWAsweIwfW1l0M/Zi2pzw+QlLmHtJB2daCvS8liFzW+u5W3t4 AbV9gTHaoVBKCXkgHJ9RezpQZ8beRUECv1ful5nrS0Kf+yRP15vFdW83aKe3a6rwWSo7 fdMTmTYrM9N91Zv02UhkOBfCN2jgjD9L/VjdLJYbwJgoExAnJcfEqi14JAONcbqv+rwl hw7dAT+Yjw9ofZtsdEVlAPzMuksgug7Jumipit9wVK279xme2IlXhKOsiNsmxsTTDf3+ UNag== X-Gm-Message-State: AElRT7GgHWUZUKhwjOq2zHcw/G32gvGK2N53O9GXdECA5Ig5qPXzP4Sw aXP4Ba7nkRLCEP44EYA5NvFRDIqO X-Google-Smtp-Source: AG47ELscjo3pg1yxA0ycVT+8oYH3XlyvYuW51oc03fch5ANbrTQ2XqLyNeqQzwFbHbmYXpE4S5ZbaQ== X-Received: by 10.28.35.14 with SMTP id j14mr10284307wmj.43.1520342395090; Tue, 06 Mar 2018 05:19:55 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:14 +0100 Message-Id: <1520342370-123606-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 18/34] address_space_read: address_space_to_flatview needs RCU lock X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" address_space_read is calling address_space_to_flatview but it can be called outside the RCU lock. To fix it, push the rcu_read_lock/unlock pair up from flatview_read_full to address_space_read's constant size fast path and address_space_read_full. Reviewed-by: Alexey Kardashevskiy Signed-off-by: Paolo Bonzini --- exec.c | 38 +++++++++++++++++++++++++------------- include/exec/memory.h | 25 ++++++++++--------------- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/exec.c b/exec.c index ec91162..e4552ee 100644 --- a/exec.c +++ b/exec.c @@ -2616,6 +2616,8 @@ static const MemoryRegionOps watch_mem_ops =3D { }, }; =20 +static MemTxResult flatview_read(FlatView *fv, hwaddr addr, + MemTxAttrs attrs, uint8_t *buf, int = len); static MemTxResult flatview_write(FlatView *fv, hwaddr addr, MemTxAttrs at= trs, const uint8_t *buf, int len); static bool flatview_access_valid(FlatView *fv, hwaddr addr, int len, @@ -3165,24 +3167,18 @@ MemTxResult flatview_read_continue(FlatView *fv, hw= addr addr, return result; } =20 -MemTxResult flatview_read_full(FlatView *fv, hwaddr addr, - MemTxAttrs attrs, uint8_t *buf, int len) +/* Called from RCU critical section. */ +static MemTxResult flatview_read(FlatView *fv, hwaddr addr, + MemTxAttrs attrs, uint8_t *buf, int len) { hwaddr l; hwaddr addr1; MemoryRegion *mr; - MemTxResult result =3D MEMTX_OK; - - if (len > 0) { - rcu_read_lock(); - l =3D len; - mr =3D flatview_translate(fv, addr, &addr1, &l, false); - result =3D flatview_read_continue(fv, addr, attrs, buf, len, - addr1, l, mr); - rcu_read_unlock(); - } =20 - return result; + l =3D len; + mr =3D flatview_translate(fv, addr, &addr1, &l, false); + return flatview_read_continue(fv, addr, attrs, buf, len, + addr1, l, mr); } =20 static MemTxResult flatview_rw(FlatView *fv, hwaddr addr, MemTxAttrs attrs, @@ -3203,6 +3199,22 @@ MemTxResult address_space_rw(AddressSpace *as, hwadd= r addr, addr, attrs, buf, len, is_write); } =20 +MemTxResult address_space_read_full(AddressSpace *as, hwaddr addr, + MemTxAttrs attrs, uint8_t *buf, int le= n) +{ + MemTxResult result =3D MEMTX_OK; + FlatView *fv; + + if (len > 0) { + rcu_read_lock(); + fv =3D address_space_to_flatview(as); + result =3D flatview_read(fv, addr, attrs, buf, len); + rcu_read_unlock(); + } + + return result; +} + MemTxResult address_space_write(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, const uint8_t *buf, int len) diff --git a/include/exec/memory.h b/include/exec/memory.h index 4b65b56..31eae0a 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1917,13 +1917,12 @@ void address_space_unmap(AddressSpace *as, void *bu= ffer, hwaddr len, =20 =20 /* Internal functions, part of the implementation of address_space_read. = */ +MemTxResult address_space_read_full(AddressSpace *as, hwaddr addr, + MemTxAttrs attrs, uint8_t *buf, int le= n); MemTxResult flatview_read_continue(FlatView *fv, hwaddr addr, MemTxAttrs attrs, uint8_t *buf, int len, hwaddr addr1, hwaddr l, MemoryRegion *mr); - -MemTxResult flatview_read_full(FlatView *fv, hwaddr addr, - MemTxAttrs attrs, uint8_t *buf, int len); void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr); =20 static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write) @@ -1942,25 +1941,28 @@ static inline bool memory_access_is_direct(MemoryRe= gion *mr, bool is_write) * * Return a MemTxResult indicating whether the operation succeeded * or failed (eg unassigned memory, device rejected the transaction, - * IOMMU fault). + * IOMMU fault). Called within RCU critical section. * - * @fv: #FlatView to be accessed + * @as: #AddressSpace to be accessed * @addr: address within that address space * @attrs: memory transaction attributes * @buf: buffer with the data transferred */ static inline __attribute__((__always_inline__)) -MemTxResult flatview_read(FlatView *fv, hwaddr addr, MemTxAttrs attrs, - uint8_t *buf, int len) +MemTxResult address_space_read(AddressSpace *as, hwaddr addr, + MemTxAttrs attrs, uint8_t *buf, + int len) { MemTxResult result =3D MEMTX_OK; hwaddr l, addr1; void *ptr; MemoryRegion *mr; + FlatView *fv; =20 if (__builtin_constant_p(len)) { if (len) { rcu_read_lock(); + fv =3D address_space_to_flatview(as); l =3D len; mr =3D flatview_translate(fv, addr, &addr1, &l, false); if (len =3D=3D l && memory_access_is_direct(mr, false)) { @@ -1973,18 +1975,11 @@ MemTxResult flatview_read(FlatView *fv, hwaddr addr= , MemTxAttrs attrs, rcu_read_unlock(); } } else { - result =3D flatview_read_full(fv, addr, attrs, buf, len); + result =3D address_space_read_full(as, addr, attrs, buf, len); } return result; } =20 -static inline MemTxResult address_space_read(AddressSpace *as, hwaddr addr, - MemTxAttrs attrs, uint8_t *bu= f, - int len) -{ - return flatview_read(address_space_to_flatview(as), addr, attrs, buf, = len); -} - /** * address_space_read_cached: read from a cached RAM region * --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343229967441.75097944718595; Tue, 6 Mar 2018 05:33:49 -0800 (PST) Received: from localhost ([::1]:55765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCit-0001fU-T5 for importer@patchew.org; Tue, 06 Mar 2018 08:33:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVb-0005EP-Fg for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVZ-0006Pn-J4 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:59 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:34909) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVZ-0006P3-BX for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:57 -0500 Received: by mail-wr0-x241.google.com with SMTP id l43so20924986wrc.2 for ; Tue, 06 Mar 2018 05:19:57 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=BNa7P5RweYFos/JNDHg6ZtbhBGSRpHQEEfFugw886GY=; b=KdweSSKeL7oZvlFhD2nzeeytYFGXcV3nlDjALuV+wT6e0OLn7UX/AYf1qoCdd+HFSw YLxekECM6yBZElsSnLy0OcG5rM11AOGNI2VxlnFuayYRCark5UrFqCnpDTbFSHFRzIoK klBgcgIBeuFOlm1BYGGsUyEQUx9aDEmzGeyms4nUYt5KIQkvldFUw1eax4yvTeHaSmDs zH3R2BsI6dizVSYz1EUotihmjQQCVKKHXoc5rODtvBdnGiJWvSB3XGXrFC/zFqmQQQci yrtdA4oMWTHX/CajVlXkIm1CpGCKtPMFzvUNULksvGYL8Z9okr57EAnISWgRkMve5OkH STTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=BNa7P5RweYFos/JNDHg6ZtbhBGSRpHQEEfFugw886GY=; b=r6HvXHL64P4XylL0zHsiJXmPrSVuKOPz3qQ5KUdlC0P3dkfTbHOXGafLS+CTSmX6Zy qHhhB0en9dyHAfU+f58aE35B6fFWSLF6ZaCZtv2yCnHnG0I3CeUGUN5uasa5I8d8Za8g FAm9gPhqGHHqfy3Rajsb/2dkIZN+zuDWjEgWz2YR1Jmm7anVU2wQbFPEsPFVyHI7PURG vK9htYBlQzhWPVSgT2PXu2lQFTBOwueoAK8ELakf5s+zpFLE53WKZ9owD7Ej2L6Ly7Xp PuHOkyEtagdNh5dWfLgjGF3FyC+KkjvkE0vGcEcF57/coxwt2JBlM85hWCpWbBvci7s9 aAlA== X-Gm-Message-State: APf1xPDJqj4GXD/WrMjWJtRL5XqpNGz/m4GMkbMzMUlzhfZlOAqR1bzU UdmOqaTSlAIBHAXqbVNabxwlX8KP X-Google-Smtp-Source: AG47ELtY4iZh6upSEzC+7X9zLGaGFJpzWCo+o4jjaF8z1pPTDXE4vUJRh68xxPSNWcL/RIUr6TLiDg== X-Received: by 10.223.145.67 with SMTP id j61mr16623481wrj.152.1520342396162; Tue, 06 Mar 2018 05:19:56 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:15 +0100 Message-Id: <1520342370-123606-20-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PULL 19/34] address_space_access_valid: address_space_to_flatview needs RCU lock X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" address_space_access_valid is calling address_space_to_flatview but it can be called outside the RCU lock. To fix it, push the rcu_read_lock/unlock pair up from flatview_access_valid to address_space_access_valid. Reviewed-by: Alexey Kardashevskiy Signed-off-by: Paolo Bonzini --- exec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index e4552ee..62ed49d 100644 --- a/exec.c +++ b/exec.c @@ -3395,7 +3395,6 @@ static bool flatview_access_valid(FlatView *fv, hwadd= r addr, int len, MemoryRegion *mr; hwaddr l, xlat; =20 - rcu_read_lock(); while (len > 0) { l =3D len; mr =3D flatview_translate(fv, addr, &xlat, &l, is_write); @@ -3410,15 +3409,20 @@ static bool flatview_access_valid(FlatView *fv, hwa= ddr addr, int len, len -=3D l; addr +=3D l; } - rcu_read_unlock(); return true; } =20 bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_write) { - return flatview_access_valid(address_space_to_flatview(as), - addr, len, is_write); + FlatView *fv; + bool result; + + rcu_read_lock(); + fv =3D address_space_to_flatview(as); + result =3D flatview_access_valid(fv, addr, len, is_write); + rcu_read_unlock(); + return result; } =20 static hwaddr --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520342982412451.85189205767153; Tue, 6 Mar 2018 05:29:42 -0800 (PST) Received: from localhost ([::1]:55747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCez-0006mr-Go for importer@patchew.org; Tue, 06 Mar 2018 08:29:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVe-0005JC-Oc for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVa-0006RX-RM for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:02 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:36360) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVa-0006Q7-Kw for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:58 -0500 Received: by mail-wr0-x241.google.com with SMTP id v111so20894746wrb.3 for ; Tue, 06 Mar 2018 05:19:58 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=GG8FyGaJIJGAdKnTkr7DQxGIWuvcWVtONCmF/qWLibs=; b=VwmJGslYiAi3J8a9nuaBPQj4V3JdP2YpWjlm4XYIMfA0bAxDlWJ3tUhTUt3U9E+pGm n7I8Eop4RrdP+29HEl/R2VF+4rnybTfLAVRTpdgWJCv/XlQPYokhnpl0BzLEt6s5wok3 K662+gzsuaqC4XTbvYycm879JSi4F3ncALuj1mhpNOjXZByQmD35sKesU6MZjIK5okCd cZP6chbg2PDqNe4DfF3K31CmhLT4DWs1Ii3lrWl6BHfrsRAZ9WEloNEx/4BNsh7BY/1A ywRCtg0rTpBgk01ywuuINTpA7oaSX/klP6D+Lab7NZaSBO68xI8oSfgFUK3lkLIaI4NG qtUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=GG8FyGaJIJGAdKnTkr7DQxGIWuvcWVtONCmF/qWLibs=; b=lC/DPkuZJUmuShiGbmtHhe4SHJ/Co9CQiE8CWfrI3wXUWOzM+GFW4bN/XnDt/PrLFU uRD2olFSFF99PGIF/6NbaRy0+pauAMpDiXpVmUMWZKyoyBr/UcZKCUwuAo1Xo+jhzS4Z pJaGSFGS1CRMchWC+eUW31/yO0Ve58z3sq4j1eJygVwON2idoATWUREEpk/ylX6LEKjJ YX4OxYi0EQAezamB6h3qn428pNHbLfm9Muay34ZgMHa91BoDFDQYkrKstbh3pPKnHWxG TUrn8QTNRhNl1Se8lnWk6sfoJ1Ahvj6hrqOlnnWp2Y2glZ3B/TGIWGe/0wSHFHzJEF/W d+mQ== X-Gm-Message-State: APf1xPBR3MG3cwuLVhtKnaxgnzk/wgqh74ScmU9hR2N+rw0tDS1JHxTW qzdJTV8ImqPUr8bGbWuLyawRwUvT X-Google-Smtp-Source: AG47ELvgFRviNjatBaZnea2h0asVZa05qvsqEJt9b/THBceIGxenz4E5ZwDbTI215CyK/gbpQec5GA== X-Received: by 10.223.152.83 with SMTP id v77mr15366464wrb.70.1520342397217; Tue, 06 Mar 2018 05:19:57 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:16 +0100 Message-Id: <1520342370-123606-21-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PULL 20/34] address_space_map: address_space_to_flatview needs RCU lock X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" address_space_map is calling address_space_to_flatview but it can be called outside the RCU lock. The function itself is calling rcu_read_lock/rcu_read_unlock, just in the wrong place, so the fix is easy. Reviewed-by: Alexey Kardashevskiy Signed-off-by: Paolo Bonzini --- exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 62ed49d..bffb959 100644 --- a/exec.c +++ b/exec.c @@ -3468,7 +3468,7 @@ void *address_space_map(AddressSpace *as, hwaddr l, xlat; MemoryRegion *mr; void *ptr; - FlatView *fv =3D address_space_to_flatview(as); + FlatView *fv; =20 if (len =3D=3D 0) { return NULL; @@ -3476,6 +3476,7 @@ void *address_space_map(AddressSpace *as, =20 l =3D len; rcu_read_lock(); + fv =3D address_space_to_flatview(as); mr =3D flatview_translate(fv, addr, &xlat, &l, is_write); =20 if (!memory_access_is_direct(mr, is_write)) { --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343039439124.8094345339407; Tue, 6 Mar 2018 05:30:39 -0800 (PST) Received: from localhost ([::1]:55750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCfu-0007eD-LH for importer@patchew.org; Tue, 06 Mar 2018 08:30:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVd-0005Hc-4t for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVb-0006Sy-Vu for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:01 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35846) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVb-0006Ry-OC for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:19:59 -0500 Received: by mail-wm0-x242.google.com with SMTP id 188so22105574wme.1 for ; Tue, 06 Mar 2018 05:19:59 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=VXantA8UjXNTtilrbmOx9OPb5EbYCqUZhoTFibKxx44=; b=SxDUfO79FFtwczRpjaRQ/EjMA0Px6z6yJ+2UYdhmDrfYOCdjoxx1D4FKIWaqj5W2bc secRMyx36esnfSmVs7mfiaftXLkLWSPtsMIBnd4Q45/wUMScHqzH+dpNKSJqO4XLEWSU 3qwwbr/5iAZmcQnP2kUT/KMcGSdeqbeCBbqagUxMRAG5urEx1vioRf+YWz7FzZuxNyvU URtBzN7x7aj+K2vA/kLRr9iKzQeyjwxYjPMwWUL+yWWZcuZG2zgJ8wTPvV5nFELcconA BCxKj9AACuVw+gPDxX11jxrDMtu5fWwtd6GEkk6UduYthinwUyFmAguZG2LUAFRxoeCH ADKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=VXantA8UjXNTtilrbmOx9OPb5EbYCqUZhoTFibKxx44=; b=Z+6PWtih6SZiagJf+4UAWeM7DKlIQaIRYC4Qh1lu318sVfjElYei9W4qGTEK09cIwu iLMsV1g2oBL/NLWU93EioL6AvLU50pGd90EldtXjM/tkm/tYyBOpsdH/J2lbFeoTtRX7 w8Ooqd1nTPsRfcbI4/hnXckauYgiXLwi9unFpGRpswKEl7UFjmBuf4UT0U4yrTLfMOvu RRRVDmZ0dd4+jb9v1MDAX0T/yUTybb8dvLLIT9QIS+EL0xWy3cQyTj4Qs4BHywvwxOBc DdXfE3k+JCt5MErqpmq06IylxaJmtS4rBBzN67rjCzdWSC3NeTFwK6jXFcWnwrbLODwC E12Q== X-Gm-Message-State: AElRT7HNGUtoKcQbsOVOcVyOlbgHpfqz27T1nBARiqs5tT9NavlV2gOU 9/Ae9tIsQmL4cTNunfI3rQUBN2X3 X-Google-Smtp-Source: AG47ELtKekoMR1mpStKVRRuDyelgwrK1P28XkxjQDqMrje09bhBbz2pJGqTw/HSQc2JuHUbDQQoMwg== X-Received: by 10.28.34.3 with SMTP id i3mr10540553wmi.121.1520342398472; Tue, 06 Mar 2018 05:19:58 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:17 +0100 Message-Id: <1520342370-123606-22-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 21/34] address_space_rw: address_space_to_flatview needs RCU lock X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" address_space_rw is calling address_space_to_flatview but it can be called outside the RCU lock. To fix it, transform flatview_rw into address_space_rw, since flatview_rw is otherwise unused. Reviewed-by: Alexey Kardashevskiy Signed-off-by: Paolo Bonzini --- exec.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/exec.c b/exec.c index bffb959..604f03c 100644 --- a/exec.c +++ b/exec.c @@ -3181,24 +3181,6 @@ static MemTxResult flatview_read(FlatView *fv, hwadd= r addr, addr1, l, mr); } =20 -static MemTxResult flatview_rw(FlatView *fv, hwaddr addr, MemTxAttrs attrs, - uint8_t *buf, int len, bool is_write) -{ - if (is_write) { - return flatview_write(fv, addr, attrs, (uint8_t *)buf, len); - } else { - return flatview_read(fv, addr, attrs, (uint8_t *)buf, len); - } -} - -MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, - MemTxAttrs attrs, uint8_t *buf, - int len, bool is_write) -{ - return flatview_rw(address_space_to_flatview(as), - addr, attrs, buf, len, is_write); -} - MemTxResult address_space_read_full(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, uint8_t *buf, int le= n) { @@ -3232,6 +3214,16 @@ MemTxResult address_space_write(AddressSpace *as, hw= addr addr, return result; } =20 +MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs att= rs, + uint8_t *buf, int len, bool is_write) +{ + if (is_write) { + return address_space_write(as, addr, attrs, buf, len); + } else { + return address_space_read_full(as, addr, attrs, buf, len); + } +} + void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf, int len, int is_write) { --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343372372812.5292297081655; Tue, 6 Mar 2018 05:36:12 -0800 (PST) Received: from localhost ([::1]:55787 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etClH-0003t5-JA for importer@patchew.org; Tue, 06 Mar 2018 08:36:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVe-0005IY-2X for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVd-0006Tx-6U for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:02 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:34506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVd-0006TH-0B for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:01 -0500 Received: by mail-wm0-x244.google.com with SMTP id a20so17994662wmd.1 for ; Tue, 06 Mar 2018 05:20:00 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:19:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ti1KBCOXk8Zbl/PHNQj4ViY72BfU4+ewc/IR29wGV2g=; b=UU/QUOkSikqx2J+dOal1xoIipIUaMCcKEMdGb5fw2Xdd6o0PL15o2FbVo9TsRvD9ef FSBlPm4XnivK5o5DpE4nsmdYKnvAi3xfH/a1PKxhsL9XjYcusJt90dUX8QrDyGQsVhW2 Aa63EZmvS6h726Xm9mxB/a8ALyso9Qb3Ad8/um4olGB+Wsj+0aK/JZ3Tz6HY+sOi2OGT K4aaTNuAvdI9LFSp6NIf0DpEVg4rdrAtxwYeC2XptuL1eQFnFgWmAO48BXN1nNvH3GlM AQNJ0e/l7tM8u4raypJFotgdm5wEwbv8I1AYghJbULfMzG0gBo5bmhBP53g2pHmDv7UN JYzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ti1KBCOXk8Zbl/PHNQj4ViY72BfU4+ewc/IR29wGV2g=; b=fO7RJ+n28mn/MhRiQviE9nyAdI0Q24ltgqBuwRuvRJjsqdkNlr5L5499tCSlkBPLur 4ReL+X2rolmY48XDwVHQnk2KhUB+XXTVBM/WTG5QJkQEdG8za199R42VqqgenEkVmQmT AD1Ee088A1WZ+FaPEIDWcicDvOvCmVYCzdXLVNWCY2RYzD7ei44E1BwyGP7kFlwmFgni hqnpy8UopDvFol575QLx08JIZvxEdEwteojc+MzYFXMKUiMOBL9r4TjK5d4Euwr9pvG9 byoxLPQBFIHgExDIRsvtuovpplX5vJp/6125hnNs58XH5XwaETmNMsC81f98N3d+Yd1b +qMg== X-Gm-Message-State: AElRT7GLi+fAy3LF/TRYUNAgsoDhA3xTfzABYRZpfzJ82WdYnzy8USxS O3Mws1YJyUgTl8zd6Hl9r6q4UdeI X-Google-Smtp-Source: AG47ELslbsSTBKXM+4LeteL5FO2KxVFPosyeO7f/ldunMgxgCjbrPVmKynLea4OktVMaHj495zCkqA== X-Received: by 10.28.18.2 with SMTP id 2mr10649566wms.108.1520342399683; Tue, 06 Mar 2018 05:19:59 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:18 +0100 Message-Id: <1520342370-123606-23-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 22/34] checkpatch: add a warning for basename/dirname X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julia Suvorova Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julia Suvorova g_path_get_* do the same as g_strdup(basename/dirname(...)) but without modifying the argument. Signed-off-by: Julia Suvorova Message-Id: <1519987399-19160-1-git-send-email-jusual@mail.ru> Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1b4b812..a88af61 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2584,6 +2584,11 @@ sub process { ERROR("__func__ should be used instead of gcc specific __FUNCTION__\n" = . $herecurr); } =20 +# recommend g_path_get_* over g_strdup(basename/dirname(...)) + if ($line =3D~ /\bg_strdup\s*\(\s*(basename|dirname)\s*\(/) { + WARN("consider using g_path_get_$1() in preference to g_strdup($1())\n"= . $herecurr); + } + # recommend qemu_strto* over strto* for numeric conversions if ($line =3D~ /\b(strto[^kd].*?)\s*\(/) { ERROR("consider using qemu_$1 in preference to $1\n" . $herecurr); --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343908029240.68659274290633; Tue, 6 Mar 2018 05:45:08 -0800 (PST) Received: from localhost ([::1]:55844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCtv-0003JA-9c for importer@patchew.org; Tue, 06 Mar 2018 08:45:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVi-0005N7-Pg for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVe-0006Uq-Ah for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:06 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:38807) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVe-0006UE-3i for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:02 -0500 Received: by mail-wm0-x243.google.com with SMTP id z9so22089062wmb.3 for ; Tue, 06 Mar 2018 05:20:02 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.19.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Lv9gOqmu9FgJ7NdfG8Zud8R7mAvfm/jlJqnOoPBYVZA=; b=ADzkBOusX9hY1srTxw06W3+ONgnE04/HqPZ3TD/PmVdraQBsGSVeBIHrdmhfbjb2Nm HXuCuTkp/Vmz/app6c+JdPR5wQ50sFEmbmz/CiSbiQE9djKGTkxsdNSzaDzlkfNfsr0o t+mqLDpnl/Rvf1QLIwclk+6NGlv45Dq6wziQxF7N7U2TI4ltcX1yqISGmO1Ly3SebVms unVcPT7kpEmxZI1hjHSq86gGK/OwRZb9yvCuQC9SYELhdd4gstXdb6AGN0GyMjOqtT33 rxL4uyu12E+93EqDexWOmrtjbTd+KNq3F5EmIzwHDHzShpJBBf1WRMzS8/gKDpTjxQqT sfBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Lv9gOqmu9FgJ7NdfG8Zud8R7mAvfm/jlJqnOoPBYVZA=; b=lhqURQQ2JcXZAMl5l8BvMFtSzXtxz6XvvGyIyh2SAw8okaU3ft3Lhaijn66HGmvCQL dpu0qgjYowHdvvOYVtLTxsD0CPpF6TViZeQPJlU6CMIvZfuEh9NS4S3Mu7ydLJRl6xky EG2u798z9oqnNaK9hXssHTZfr4AZAFcAjVljjwnqK+2LQFljGEPWJQXyzYGHBXIq3IBI 546i+/x1JDHghUD5EDyThLug41zi/xzCDIOTJW0WcXXZ7whEMU266/dExilyjMmkCqq4 GkfngQ3EqGMboHIhDl9z0EhuOjL5DJWgLzmEed0nQZm7xaQgnA/2ATqVrrZ1VJQOEY7h LLtQ== X-Gm-Message-State: AElRT7HlCbEKni0tTOh1Uhdt1VPMhEkiDMwyyADV1FoBzy3/tsGfBQd5 TOnuIgSLAH6wGc0CvCxt1FR1t7Wj X-Google-Smtp-Source: AG47ELsmdS0rCI0PjWYYJqTkM5sIkAzqUlzkvX+oHFlaIdBW8pTPkxn3aDNTabq7uODxAoz0/Hmmdw== X-Received: by 10.28.111.145 with SMTP id c17mr10283895wmi.74.1520342400729; Tue, 06 Mar 2018 05:20:00 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:19 +0100 Message-Id: <1520342370-123606-24-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 23/34] checkpatch: add check for `while` and `for` X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Su Hang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Su Hang Adding check for `while` and `for` statements, which condition has more than one line. The former checkpatch.pl can check `if` statement, which condition has more than one line, whether block misses brace round, like this: ''' if (cond1 || cond2) statement; ''' But it doesn't do the same check for `for` and `while` statements. Using `(?:...)` instead of `(...)` in regex pattern catch. Because `(?:...)` is faster and avoids unwanted side-effect. Suggested-by: Stefan Hajnoczi Suggested-by: Eric Blake Suggested-by: Thomas Huth Signed-off-by: Su Hang Message-Id: <1520319890-19761-1-git-send-email-suhang16@mails.ucas.ac.cn> Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a88af61..d1fe79b 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2352,8 +2352,9 @@ sub process { } } =20 -# check for missing bracing round if etc - if ($line =3D~ /(^.*)\bif\b/ && $line !~ /\#\s*if/) { +# check for missing bracing around if etc + if ($line =3D~ /(^.*)\b(?:if|while|for)\b/ && + $line !~ /\#\s*if/) { my ($level, $endln, @chunks) =3D ctx_statement_full($linenr, $realcnt, 1); if ($dbg_adv_apw) { --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343505609758.6871659777636; Tue, 6 Mar 2018 05:38:25 -0800 (PST) Received: from localhost ([::1]:55800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCnQ-0005hr-QS for importer@patchew.org; Tue, 06 Mar 2018 08:38:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVh-0005Lr-4Q for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVf-0006W4-UQ for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:05 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:46334) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVf-0006Vd-Nv for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:03 -0500 Received: by mail-wr0-x242.google.com with SMTP id m12so20875546wrm.13 for ; Tue, 06 Mar 2018 05:20:03 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=VpFvYwsFfgx9RfeAoKX1IXH69fx4gFu64k/QPe4d7U0=; b=qyrxP8ONNdffAjXHRZ0JQBhA/ozXwX2U37mU4ADf5J+NxqTeb+aUnzmUXw0ctLPQVA mRHe8TRBh+zi5coR0GLCvRgSol6NOCIHafum+sDNCt09YCwki95cueni3H/gDl/9T/QO eWW1R65kbmJgteYLSfEBmQgg+/gHklKpRcwUxJAj/e+OXZPJIGG3dqtTT4Nrzq5w5ZTd i5lU7kS33l6VSReBhd6OjfTkbJDm0x/hDlmpNRwyVc3DjSrYLzyanAz2dlvswR/7fZeO 4D8y9HxRNd34jLP/z7LHAV7PmVP7tDdHIpNuGwV2rtFObXwgY4oiK20ON0uCoVWDp3na i8qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=VpFvYwsFfgx9RfeAoKX1IXH69fx4gFu64k/QPe4d7U0=; b=tYxAHZTwsvd+UBi51nB1xsAC4Ttn16wL6WitF0KJjM/8dtBG6yG/wBvln2QIx+TtPN ONOlYpNO+ak7v+F9rpWpH3ynsRebNTvqhM+xiKm3IuCVck3MeIixcXSBP2w2NWwei0j4 0y3gu7+cLi+O80hoKrvvXQU7LK/p/cnK3cWIUSYViNLQMZu/RWy1+lV3tD1dbnUeYlzz TjTRM0FMZRNGno/SK0cmyZEHbkhkZuhcIVw35haGZxjPkkjeXJB9a9g/n6b65oQ4W74y K9QxXU7uqj2eAgEZW+VHqs5HVcBHwOfSjRCyY+kSf9LWnBhl0TyWig4e4MIAJ3SuyvSW yPTQ== X-Gm-Message-State: APf1xPAmReobhX/sZmpLkc3fFOOMzXaD4Nryfvvvp22NcjTtwdvpM/5R Y4BIMSqdA8o509zKyoMy3boLEW6x X-Google-Smtp-Source: AG47ELvvXep7vSGQTxlePsdx3z1fmfVZHthbO42hCC+x8pYwDIgbP/7SZeaW1+vmOcjkY8DUyWdPNQ== X-Received: by 10.223.190.134 with SMTP id i6mr15987496wrh.157.1520342402303; Tue, 06 Mar 2018 05:20:02 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:20 +0100 Message-Id: <1520342370-123606-25-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PULL 24/34] Revert "build-sys: compile with -Og or -O1 when --enable-debug" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This reverts commit 906548689e37ab6cca1e93b3f8d9327a4e17e8af. Even with -Og, the debug experience is noticeably worse because gdb shows a lot more "" variables and function arguments. Signed-off-by: Paolo Bonzini --- configure | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 7ff00f8..ebbda23 100755 --- a/configure +++ b/configure @@ -5368,19 +5368,8 @@ if test "$gcov" =3D "yes" ; then LDFLAGS=3D"-fprofile-arcs -ftest-coverage $LDFLAGS" elif test "$fortify_source" =3D "yes" ; then CFLAGS=3D"-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3D2 $CFLAGS" -elif test "$debug" =3D "yes"; then - if compile_prog "-Og" ""; then - CFLAGS=3D"-Og $CFLAGS" - elif compile_prog "-O1" ""; then - CFLAGS=3D"-O1 $CFLAGS" - fi - # Workaround GCC false-positive Wuninitialized bugs with Og or O1: - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D24639 - if cc_has_warning_flag "-Wno-maybe-uninitialized"; then - CFLAGS=3D"-Wno-maybe-uninitialized $CFLAGS" - fi -else - CFLAGS=3D"-O2 $CFLAGS" +elif test "$debug" =3D "no"; then + CFLAGS=3D"-O2 $CFLAGS" fi =20 if test "$have_asan" =3D "yes"; then --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343232023825.2730985114338; Tue, 6 Mar 2018 05:33:52 -0800 (PST) Received: from localhost ([::1]:55766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCj1-0001kg-4e for importer@patchew.org; Tue, 06 Mar 2018 08:33:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVl-0005RX-3f for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVh-0006X2-48 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:09 -0500 Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]:42125) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVg-0006WQ-Rm for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:05 -0500 Received: by mail-wr0-x229.google.com with SMTP id k9so20878858wre.9 for ; Tue, 06 Mar 2018 05:20:04 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ioCotlTDGi8KwzXPQfFoG8zF6bduA/7dUSyADKloCNQ=; b=MtHtfI8OWoB58QpSNxCSpMbuN4p01ueUzTZ4m7s7tvIL0yERHbdxTQ7bIk0tcn4lsZ QFmue1tlawp1sXEJqqd6ZdLV+i5YAZBbg6q3KD1plkLUPMxxt+iJRWApE5V38iJFQO1R j7lg0G1L83IWweksZomXYM5Svwv+oZKhsPF+oTnvQumI3pbVDdHpmXIhlx+j5E5e1MSJ UzisvdvOxeNvsTqMuYm9k1RYCMBlm5jlX0mVsYVuYbgpBhmo1hpNN2Sw3ouX2d2TsDCI 60IpKRt3g1MQVEvrtHxkcpE/XRaTIbuagGnZ+vVBQVvhR2uG30iJbDeIkz1+PIdNqI7q OITg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ioCotlTDGi8KwzXPQfFoG8zF6bduA/7dUSyADKloCNQ=; b=mQbGxFtqLAw5Sm9PYfwT+ckwubjamYwLJUEyH0hDHJoHtNG/Vdznbe6yDDjE2Vhauj jVMqrU7B1xQL3m4oLMWwDvpEHMV4PB8dv/OH4DVE61DzWZsiXt5y2A9FOlhsYs06q44Y 5XXJ5638d+sC6IpwGaZokplsHOFPbAC81DRc7x8wmxs2c37IPdeou/9oYsfpaMTGWBm5 WDWpytsn8/X9CIVP2GPX3+Q+ems+umKXk7G6iZkNkjWwhK/ATtKpGilWi8bNLBdUbwPg zorX/ZtpwtXbn1fUbK360abZgF3GUSTBvPte0etNWbM2NleD6kZ0hRrLwKzg29kHiJKP NBag== X-Gm-Message-State: APf1xPAcoRgm7GRstrhXgAuvItpfscY69UtrOUVzs+Mfx9Bp8B7qQ8jQ lYERgTwwwbvfiDGOmBuvZuaJvedA X-Google-Smtp-Source: AG47ELunLqincy33/PEypWLBlOJJFGQJ+wBjUIBO+I+05da835snTf1qZkbU7wMh0VM/A6alCK/BtA== X-Received: by 10.223.134.12 with SMTP id 12mr15437956wrv.193.1520342403509; Tue, 06 Mar 2018 05:20:03 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:21 +0100 Message-Id: <1520342370-123606-26-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::229 Subject: [Qemu-devel] [PULL 25/34] Fixing WHPX casing to match SDK X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Justin Terry \(VM\)" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Justin Terry (VM) via Qemu-devel" Fixes an issue where the SDK that was releases had a different casing for t= he *.h and *.lib files causing a build break if linked directly from Windows K= its. Signed-off-by: Justin Terry (VM) Message-Id: <1519665216-1078-2-git-send-email-juterry@microsoft.com> Signed-off-by: Paolo Bonzini Signed-off-by: Justin Terry (VM) via Qemu-devel --- configure | 10 +++++----- target/i386/whpx-all.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure b/configure index ebbda23..6f3921c 100755 --- a/configure +++ b/configure @@ -2486,20 +2486,20 @@ fi if test "$whpx" !=3D "no" ; then cat > $TMPC << EOF #include -#include -#include +#include +#include int main(void) { WHV_CAPABILITY whpx_cap; WHvGetCapability(WHvCapabilityCodeFeatures, &whpx_cap, sizeof(whpx_cap= )); return 0; } EOF - if compile_prog "" "-lwinhvplatform -lwinhvemulation" ; then - libs_softmmu=3D"$libs_softmmu -lwinhvplatform -lwinhvemulation" + if compile_prog "" "-lWinHvPlatform -lWinHvEmulation" ; then + libs_softmmu=3D"$libs_softmmu -lWinHvPlatform -lWinHvEmulation" whpx=3D"yes" else if test "$whpx" =3D "yes"; then - feature_not_found "winhvplatform" "winhvemulation is not insta= lled" + feature_not_found "WinHvPlatform" "WinHvEmulation is not insta= lled" fi whpx=3D"no" fi diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index 0015b27..eeee43e 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -26,8 +26,8 @@ #include "qapi/error.h" #include "migration/blocker.h" =20 -#include -#include +#include +#include =20 struct whpx_state { uint64_t mem_quota; --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343377893320.8417718146245; Tue, 6 Mar 2018 05:36:17 -0800 (PST) Received: from localhost ([::1]:55788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etClM-0003yc-P1 for importer@patchew.org; Tue, 06 Mar 2018 08:36:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVl-0005RV-32 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVi-0006Xy-Cf for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:09 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:40144) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVi-0006XO-5s for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:06 -0500 Received: by mail-wm0-x244.google.com with SMTP id t6so22235844wmt.5 for ; Tue, 06 Mar 2018 05:20:06 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=0am+7a+KVRHdqnld2lf+MnvSqKx9p6qAd6Als13tS1w=; b=lgIWRAznjjtP6vkkbMr8AWha2uzjwLOCkXDnMNfynBp3X3m5U/GPLsgmgP4npG5ZRo g+YjM4voF1ufWVoaKzssIz4L/WuWlZ0l/CcSHY3X2S1k4u3EYVo8NxBDeD9EUeuNGMYT ioCO7gwy2EuW8AX0QB4Mxl8TfjDT4X36yjfzLqCYL+tWlBc7a3doopW15LtGUgFlXTS9 +DovJWWnk81xh1uLezZdgckJPIeERXaax6+tKg9L6S4rXSN213REGmFwqjkXnx1tR2se 7bWkeRBIenFkYa5imPm5/hH+rUywtdESU71LG5c++9DdxzfCcaDF7ULln1E0rbQRo+d/ hn9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=0am+7a+KVRHdqnld2lf+MnvSqKx9p6qAd6Als13tS1w=; b=A1etfGifXT2WPZsi4jZRiCkYDPoPFudGpbflBARYC/7+iHI9qfJwRLWr5ubpqBfkVk /RR7vTMFdD1SHhjIlkRpABrRr4XKEQIx0KLZTtA5i5I/aZr/PTecMyOUKIRylJy8Rn8g RQi4iSwadvWZiD2HPar0RCI1jhgsY4h8kUBViAzbg42vAzOnH+Om8RKpzLUaLCJQNQfu HFitP/e0ergqSABvSOKQE/9RgB59B+DzQYQJcKYh+r06tOnJpBOSVywjjfZwdSuvzb+N FKcOiT8aaMpe/Ipbdy5MH6fHZbDaS1jB/NP1Byyay003SzeJIdlBVZlXAvrT/WNPaimy +AYw== X-Gm-Message-State: AElRT7G6b8i+lrhFmiNkkoN8JA0YMBrVEVqv1j1mbZ4FgF8qhTDwtamx jEXHhojSJyq0WxvTQRZABgP9D4ys X-Google-Smtp-Source: AG47ELt/A70OnkTvVZ4aK+56R8FIBHqRcAgd4JRJGD/eud/ZurDNaj6p7O51iwx1t8S6ejjOrv2czw== X-Received: by 10.28.197.205 with SMTP id v196mr10622100wmf.141.1520342404843; Tue, 06 Mar 2018 05:20:04 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:22 +0100 Message-Id: <1520342370-123606-27-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 26/34] Resolves WHPX breaking changes in SDK 17095 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Justin Terry \(VM\)" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Justin Terry (VM) via Qemu-devel" 1. Fixes the changes required to the WHvTryMmioEmulation, WHvTryIoEmulation= , and WHvEmulatorCreateEmulator based on the new VpContext forwarding. 2. Removes the WHvRunVpExitReasonAlerted case. Signed-off-by: Justin Terry (VM) Message-Id: <1519665216-1078-3-git-send-email-juterry@microsoft.com> Signed-off-by: Paolo Bonzini Signed-off-by: Justin Terry (VM) via Qemu-devel --- target/i386/whpx-all.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index eeee43e..969c2f5 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -613,6 +613,7 @@ static HRESULT CALLBACK whpx_emu_translate_callback( } =20 static const WHV_EMULATOR_CALLBACKS whpx_emu_callbacks =3D { + .Size =3D sizeof(WHV_EMULATOR_CALLBACKS), .WHvEmulatorIoPortCallback =3D whpx_emu_ioport_callback, .WHvEmulatorMemoryCallback =3D whpx_emu_memio_callback, .WHvEmulatorGetVirtualProcessorRegisters =3D whpx_emu_getreg_callback, @@ -626,7 +627,9 @@ static int whpx_handle_mmio(CPUState *cpu, WHV_MEMORY_A= CCESS_CONTEXT *ctx) struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); WHV_EMULATOR_STATUS emu_status; =20 - hr =3D WHvEmulatorTryMmioEmulation(vcpu->emulator, cpu, ctx, &emu_stat= us); + hr =3D WHvEmulatorTryMmioEmulation(vcpu->emulator, cpu, + &vcpu->exit_ctx.VpContext, ctx, + &emu_status); if (FAILED(hr)) { __debugbreak(); error_report("WHPX: Failed to parse MMIO access, hr=3D%08lx", hr); @@ -649,7 +652,9 @@ static int whpx_handle_portio(CPUState *cpu, struct whpx_vcpu *vcpu =3D get_whpx_vcpu(cpu); WHV_EMULATOR_STATUS emu_status; =20 - hr =3D WHvEmulatorTryIoEmulation(vcpu->emulator, cpu, ctx, &emu_status= ); + hr =3D WHvEmulatorTryIoEmulation(vcpu->emulator, cpu, + &vcpu->exit_ctx.VpContext, ctx, + &emu_status); if (FAILED(hr)) { __debugbreak(); error_report("WHPX: Failed to parse PortIO access, hr=3D%08lx", hr= ); @@ -905,18 +910,8 @@ static int whpx_vcpu_run(CPUState *cpu) whpx_vcpu_kick(cpu); } =20 - for (;;) { - hr =3D WHvRunVirtualProcessor(whpx->partition, cpu->cpu_index, - &vcpu->exit_ctx, whpx->exit_ctx_si= ze); - - if (SUCCEEDED(hr) && (vcpu->exit_ctx.ExitReason =3D=3D - WHvRunVpExitReasonAlerted)) { - WHvCancelRunVirtualProcessor(whpx->partition, cpu->cpu_ind= ex, - 0); - } else { - break; - } - } + hr =3D WHvRunVirtualProcessor(whpx->partition, cpu->cpu_index, + &vcpu->exit_ctx, whpx->exit_ctx_size); =20 if (FAILED(hr)) { error_report("WHPX: Failed to exec a virtual processor," @@ -956,7 +951,6 @@ static int whpx_vcpu_run(CPUState *cpu) case WHvRunVpExitReasonX64MsrAccess: case WHvRunVpExitReasonX64Cpuid: case WHvRunVpExitReasonException: - case WHvRunVpExitReasonAlerted: default: error_report("WHPX: Unexpected VP exit code %d", vcpu->exit_ctx.ExitReason); @@ -1068,7 +1062,7 @@ int whpx_init_vcpu(CPUState *cpu) return -ENOMEM; } =20 - hr =3D WHvEmulatorCreateEmulator(whpx_emu_callbacks, &vcpu->emulator); + hr =3D WHvEmulatorCreateEmulator(&whpx_emu_callbacks, &vcpu->emulator); if (FAILED(hr)) { error_report("WHPX: Failed to setup instruction completion support= ," " hr=3D%08lx", hr); --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343656654545.4557219029729; Tue, 6 Mar 2018 05:40:56 -0800 (PST) Received: from localhost ([::1]:55816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCpr-0007wW-OV for importer@patchew.org; Tue, 06 Mar 2018 08:40:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVl-0005Sj-Sk for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVj-0006Z3-FX for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:09 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:39659) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVj-0006YA-8H for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:07 -0500 Received: by mail-wr0-x241.google.com with SMTP id w77so20920791wrc.6 for ; Tue, 06 Mar 2018 05:20:07 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=yJhV4FjpGyvDqAF3K5RhnlIZ2zXZ4jJ4bQpOd7SyU3M=; b=cDAliY3nXBkXR+fgKHiXHMojkaLNiHFndnTiI8VVp4mlaaB5beNrZGzlqGY0wCyRgm T9JCYwvemH2BYp2/8wXVkmn1levBmWgrNFCaQDCwCrfWvgRLoRzsAQ5N7Bn9yjdpSytO hSQGZrm6STgizVpgsyuRwE1uUcQtAbMApbrlcGSScg2CapUp1gn5buUtKAsqIltFh9MI h+ezoHGQc53gfEx+mGpnPSwJvgHi53iCzVuMyC8tG4iMw/khZ0CRQAlgxC/Ga4gtARsB +WMbRPAj+/PR+L0OsV8/npFcqlH0zLBYTTiVvJmrCld2apPahAjqXGbYozIn+xGNoCjg o5iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=yJhV4FjpGyvDqAF3K5RhnlIZ2zXZ4jJ4bQpOd7SyU3M=; b=r6aeouVyNwIoezrRCXwdKkiksuhKTeFAnjbrgv013v2HE3BnpbDWZ/1CSqTCTBA5Yn 7msobTYYfEQbyJsTOzInYHmfG7UDx+bwbhjhBWfjfl/IZREnf0FTXAF+nzTXj2GcXYT/ jqQw3te6Aly64r3ohlvBiA7Gu4iDaNpwT14cLTfdXHPbnysBvq7i/od1CPMI60AMumaA VP4scQGDoC6Cc5t25XbDGHI2pLepagCwRPWLaA3VyrgDc3k7Ioe+vmqdB9w3XeapksLS F8iBuUf0YJn/d9ptaVv56P9qoX2/cG+vAd3IRXNetW+LVb8YI4B308QLk2ntZmqncBqj TBaQ== X-Gm-Message-State: APf1xPCcFzgkD2M+pN3S49oJt5Rmqr0JdvbUze5WJDP9X8ZksEVRxqoa gPa2hqWrAlcnnYRGxAcVoKtuFbk4 X-Google-Smtp-Source: AG47ELvTVRIDRRWFeiJULde7WB/HCqWYUlgATeoHPvotKAsFXPJk+GeALhqDtYuVY2RXwOTm/QhI/Q== X-Received: by 10.223.179.82 with SMTP id k18mr16085852wrd.173.1520342405998; Tue, 06 Mar 2018 05:20:05 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:23 +0100 Message-Id: <1520342370-123606-28-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PULL 27/34] Remove unnecessary WHPX __debugbreak(); X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Justin Terry \(VM\)" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Justin Terry (VM) via Qemu-devel" Minor code cleanup. The calls to __debugbreak() are not required and should no longer be used to prevent unnecessary breaks. Signed-off-by: Justin Terry (VM) Message-Id: <1519665216-1078-4-git-send-email-juterry@microsoft.com> Signed-off-by: Paolo Bonzini Signed-off-by: Justin Terry (VM) via Qemu-devel --- target/i386/whpx-all.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index 969c2f5..14ea732 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -364,7 +364,6 @@ static void whpx_set_registers(CPUState *cpu) if (FAILED(hr)) { error_report("WHPX: Failed to set virtual processor context, hr=3D= %08lx", hr); - __debugbreak(); } =20 return; @@ -391,7 +390,6 @@ static void whpx_get_registers(CPUState *cpu) if (FAILED(hr)) { error_report("WHPX: Failed to get virtual processor context, hr=3D= %08lx", hr); - __debugbreak(); } =20 /* Indexes for first 16 registers match between HV and QEMU definition= s */ @@ -554,7 +552,6 @@ static HRESULT CALLBACK whpx_emu_getreg_callback( if (FAILED(hr)) { error_report("WHPX: Failed to get virtual processor registers," " hr=3D%08lx", hr); - __debugbreak(); } =20 return hr; @@ -576,7 +573,6 @@ static HRESULT CALLBACK whpx_emu_setreg_callback( if (FAILED(hr)) { error_report("WHPX: Failed to set virtual processor registers," " hr=3D%08lx", hr); - __debugbreak(); } =20 /* @@ -604,7 +600,6 @@ static HRESULT CALLBACK whpx_emu_translate_callback( Gva, TranslateFlags, &res, Gpa); if (FAILED(hr)) { error_report("WHPX: Failed to translate GVA, hr=3D%08lx", hr); - __debugbreak(); } else { *TranslationResult =3D res.ResultCode; } @@ -631,13 +626,11 @@ static int whpx_handle_mmio(CPUState *cpu, WHV_MEMORY= _ACCESS_CONTEXT *ctx) &vcpu->exit_ctx.VpContext, ctx, &emu_status); if (FAILED(hr)) { - __debugbreak(); error_report("WHPX: Failed to parse MMIO access, hr=3D%08lx", hr); return -1; } =20 if (!emu_status.EmulationSuccessful) { - __debugbreak(); error_report("WHPX: Failed to emulate MMIO access"); return -1; } @@ -656,13 +649,11 @@ static int whpx_handle_portio(CPUState *cpu, &vcpu->exit_ctx.VpContext, ctx, &emu_status); if (FAILED(hr)) { - __debugbreak(); error_report("WHPX: Failed to parse PortIO access, hr=3D%08lx", hr= ); return -1; } =20 if (!emu_status.EmulationSuccessful) { - __debugbreak(); error_report("WHPX: Failed to emulate PortMMIO access"); return -1; } @@ -716,7 +707,6 @@ static void whpx_vcpu_pre_run(CPUState *cpu) if (cpu->interrupt_request & CPU_INTERRUPT_SMI) { qemu_mutex_lock_iothread(); cpu->interrupt_request &=3D ~CPU_INTERRUPT_SMI; - __debugbreak(); qemu_mutex_unlock_iothread(); } } @@ -785,7 +775,6 @@ static void whpx_vcpu_pre_run(CPUState *cpu) if (FAILED(hr)) { error_report("WHPX: Failed to set interrupt state registers," " hr=3D%08lx", hr); - __debugbreak(); } } =20 @@ -812,7 +801,6 @@ static void whpx_vcpu_post_run(CPUState *cpu) if (FAILED(hr)) { error_report("WHPX: Failed to get interrupt state regusters," " hr=3D%08lx", hr); - __debugbreak(); vcpu->interruptable =3D false; return; } --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520344276481795.8613257435552; Tue, 6 Mar 2018 05:51:16 -0800 (PST) Received: from localhost ([::1]:55894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCzo-0008Tq-6i for importer@patchew.org; Tue, 06 Mar 2018 08:51:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVu-0005dE-8x for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVk-0006bU-SS for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:18 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:40145) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVk-0006aK-M4 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:08 -0500 Received: by mail-wm0-x244.google.com with SMTP id t6so22236132wmt.5 for ; Tue, 06 Mar 2018 05:20:08 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=a5ViPcxDzs39R44v8095r4iNrAUeZILFkzPiYSYV01g=; b=bbRX3AcJu5fHoCzvC+WvZShsH4I4Jt4G94937HhGUorWlxySsoFkVQI6VpT8+rdlhK 8+WcZgfZmJ2qP1CiyUc0dOnVG9KcuZoZZQOA0HcvSRdB/DruVNITgK9tLDntnsiRQmsQ T1yWIS7PS7dD8U+kzpgI1uBxbJwXcsac4c2wPDm6RHHnDGZEUiVjZ5eLn/Leyt+ONAIR FeT2ih4G6GkTX8LgV3bfv2M0hly+I4LbObEIPMlCzCZpsXgUY9gZf+yhRKC1M7UmDGMy e6rKf2v8ybx+PneskAp+lTKfsRkgDcKAWRMA9wkkGcBNjMk5nOqeySkxQDUtexSbJV+n Zbiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=a5ViPcxDzs39R44v8095r4iNrAUeZILFkzPiYSYV01g=; b=a/SFelrveIEkwErz4IB5iE1FrnRNeQ8dCCDD5ycTJnZeBJKAcqvawLTG6PHbRYYtvy 8ZU4gn2BFqjPvoFy9Dpn1CKaL5Bs2LnZobycLWlBsH9FTs4vVFAmWu15W4i0+jeWdoBX iDpC2+LDvxyuTL6QOVun8f5qI+tVmR7lakFXmZoEg+DW6jUYe9/ICsIB9hLrpTZaJPSC BnlqS0+yKHNeNvbkebtpXBNP8LHJfuI6c2UxLCp0v6lv7yENaz69RBMJjz26CAEukFvq vvbcmGRNP00YiZrMJr5uwQoW69q4CfQT6X2ONsz1dS6m4C4C9ZkvVIB07sti2NNcemNe VLbg== X-Gm-Message-State: AElRT7Gg0oVyKjrD9F8K5geSAdb8yqcPR/XJ6AuUdwFuIOjHNUPr/Xuv wE5AHqHSvyqWK1OH7RfUMwcMlZcO X-Google-Smtp-Source: AG47ELtppeKgtRmclheQzUHFKbhDnaG7JMau2yM2zRQpMCNaYsvbmG+qGkNeKz/t3PLBDLPeeINBag== X-Received: by 10.28.116.14 with SMTP id p14mr12158953wmc.117.1520342407433; Tue, 06 Mar 2018 05:20:07 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:24 +0100 Message-Id: <1520342370-123606-29-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 28/34] Fix WHPX additional lock acquisition X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Justin Terry \(VM\)" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Justin Terry (VM) via Qemu-devel" The code already is holding the qemu_mutex for the IO thread. We do not need to additionally take the lock again in this case. Signed-off-by: Justin Terry (VM) Message-Id: <1519665216-1078-5-git-send-email-juterry@microsoft.com> Signed-off-by: Paolo Bonzini Signed-off-by: Justin Terry (VM) via Qemu-devel --- target/i386/whpx-all.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index 14ea732..74a8f4d 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -705,9 +705,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) new_int.InterruptionVector =3D 2; } if (cpu->interrupt_request & CPU_INTERRUPT_SMI) { - qemu_mutex_lock_iothread(); cpu->interrupt_request &=3D ~CPU_INTERRUPT_SMI; - qemu_mutex_unlock_iothread(); } } =20 --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343805667983.2366421183333; Tue, 6 Mar 2018 05:43:25 -0800 (PST) Received: from localhost ([::1]:55836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCsD-0001eB-Sy for importer@patchew.org; Tue, 06 Mar 2018 08:43:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVr-0005aC-5o for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVm-0006e3-3c for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:14 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:55691) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVl-0006d3-TE for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:10 -0500 Received: by mail-wm0-x241.google.com with SMTP id q83so22819823wme.5 for ; Tue, 06 Mar 2018 05:20:09 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=jwNUVLZJG+8IviKwDCpiOTaw9rbdyhdyemvLRl+/aJE=; b=MMT2wVKEFDZDT8LM9bx2sNaWh8zFkSyDomd28CSxbtPNycRX8ES6+5OB6Gw4WmOGCH mCZ8sJlHropSEquZPd6PfDymqh4+aRd5Xs47IO4z3aY4LXYxZgZMvv9GI4ljBacebnEV ivLFPum2W9T/C3YPbx1tvxZZNye6tBqEA/ANNiwC0gD83sJQ7MkIfQ54lE/m5I6Ld+WS 1YOTRHK0nYahPRDLwYFT+VOfLdP4egDJR+NcdtPq3yi4nf1SWTjgITZjXGvdAQO0yic+ iPBupriBdZh8NCKRnBvq7lycMQ+47rTs6CNBDO/yH76QaKn7FaTJAzQ+SIJhdOnUj1Lf 4bZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=jwNUVLZJG+8IviKwDCpiOTaw9rbdyhdyemvLRl+/aJE=; b=NTNlX1Xoi7UTQkMVD9g/xCz+fCghzIHojSUCRSPhtniezHDSYnymWHrkxdyQsDqk6t SgSD9Rmzt4QMF0KFbwxZt1RrF0NSZYcNaaehDznkKC8Lj9oaM6tX/+JY61Ike0nNYRBC 03RCAU4lLsClgvv2eCQXMwJfCJyoJ2ns9/5WZ510EexPvX8V0GTq74SPD49KEKnvVFhU P0//SqrezvCYARtcNGOB7YrRPLzxQI89TBpDTEMmF/EyMXINLOjE48rD6ivryERRHecf eMcvjtMinIpfaU4RlYpiF8YBPkLvXhnSe9Eb+shnDlOX653IoDgq2UvXGi/CnXv9D9gq Z35g== X-Gm-Message-State: AElRT7H2dWorJo5CBRH5qbrUSI3l7LqkIpM34s9BKOUpDXUUkCtt31Ce fVJodjUAjZKVsjbRntRAnfhKhiB1 X-Google-Smtp-Source: AG47ELvf4vi1aIoImp7HzA98FO6DiPOwQ62Kmg5A2r64RNZbxj579pJl9WMsE3VQtS05keT0Z4tEAA== X-Received: by 10.28.18.2 with SMTP id 2mr10649970wms.108.1520342408737; Tue, 06 Mar 2018 05:20:08 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:25 +0100 Message-Id: <1520342370-123606-30-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 29/34] Fix WHPX typo in 'mmio' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Justin Terry \(VM\)" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Justin Terry (VM) via Qemu-devel" Renames the usage of 'memio' to 'mmio' in the emulator callbacks. Signed-off-by: Justin Terry (VM) Message-Id: <1519665216-1078-6-git-send-email-juterry@microsoft.com> Signed-off-by: Paolo Bonzini Signed-off-by: Justin Terry (VM) via Qemu-devel --- target/i386/whpx-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index 74a8f4d..7e58d5f 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -527,7 +527,7 @@ static HRESULT CALLBACK whpx_emu_ioport_callback( return S_OK; } =20 -static HRESULT CALLBACK whpx_emu_memio_callback( +static HRESULT CALLBACK whpx_emu_mmio_callback( void *ctx, WHV_EMULATOR_MEMORY_ACCESS_INFO *ma) { @@ -610,7 +610,7 @@ static HRESULT CALLBACK whpx_emu_translate_callback( static const WHV_EMULATOR_CALLBACKS whpx_emu_callbacks =3D { .Size =3D sizeof(WHV_EMULATOR_CALLBACKS), .WHvEmulatorIoPortCallback =3D whpx_emu_ioport_callback, - .WHvEmulatorMemoryCallback =3D whpx_emu_memio_callback, + .WHvEmulatorMemoryCallback =3D whpx_emu_mmio_callback, .WHvEmulatorGetVirtualProcessorRegisters =3D whpx_emu_getreg_callback, .WHvEmulatorSetVirtualProcessorRegisters =3D whpx_emu_setreg_callback, .WHvEmulatorTranslateGvaPage =3D whpx_emu_translate_callback, --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520344077680471.2926359648301; Tue, 6 Mar 2018 05:47:57 -0800 (PST) Received: from localhost ([::1]:55870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCwb-0005gJ-Vi for importer@patchew.org; Tue, 06 Mar 2018 08:47:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVr-0005aw-U7 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVn-0006fl-Pf for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:15 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:50449) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVn-0006ew-IB for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:11 -0500 Received: by mail-wm0-x244.google.com with SMTP id w128so22837323wmw.0 for ; Tue, 06 Mar 2018 05:20:11 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Tkz2ongW9kX/Io0mR9VFvFDsSJg0Erq+WrO23N6k6w8=; b=sNKfVIs4IEdMqRCdNIoiSRbGaWkf8taKqnred1jqroNXXlscbfUNoaWt5vu3A0maDp DQk7CFrFBmzRn+jcz+Cl+Osxnjvw4c5Mq8lfKydZ+gcq4kkvYvhclWy/tW95+7aVOaAC 4+N9NVSLMMX0oVw4YUflDlcqb7rCnfxXohzTCiGntg5i293HgZypbIRNy4thXv2MlJ3I n65gKa2ByefZz5d0I2Zcd515IRpnDLBsf1GBcoR6tHEy/4+De3oBtlpdTDOOXtnffUD4 ep4LYBc/dFUe1WoSNLGFoyRxLbLF2UewfjEW9H9VE9dse5MgHket5OppO1xfQpUKBmdr tDCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Tkz2ongW9kX/Io0mR9VFvFDsSJg0Erq+WrO23N6k6w8=; b=X8Xw6dyiy+A7EEqy+6z5eL3/fML/Qq4mMj1dtIMKgl8cFKU9PGUtWj9FUXbYg/zKX/ B5d/st3OJJo5rpqRiH7GYeAh1w8jGV5LhgS4wQIUlLcn4cW/MUsHMw81vRan7hKeRyj5 X0jPGLF3vx5f9tIRASkMGR976oDyBir5CtQAN42wuVk8/kb/gKTC0TnRIpzeL72OtJPo zkLnlyd6KSY7opFCt9yms1F0fXQ0WzzA6PakwUQxVe4CRE3P917uAysewDjFCd6jA+F+ 8CZ1KvmMwG5fxNmSr/k8bBtu0C9z8Iqi4p0mDTrOLKKYb/0ZYjCzi92dxPOYZClwzOj6 FImw== X-Gm-Message-State: AElRT7G0fzKnJhOCjZlKrbZTTyCFnnyNMnsXxZ+cqu23GurVuEQSfLtz Jr+/pz62FpAODnHaE2y0enVXruKJ X-Google-Smtp-Source: AG47ELujMGXfyNBhEWT6zhSwwruetjr0y4jl2q7tIFF2pCdIXNSywEbpj9v6cG6m0BgI5UYvlrzuMw== X-Received: by 10.28.193.134 with SMTP id r128mr10964731wmf.85.1520342410186; Tue, 06 Mar 2018 05:20:10 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:26 +0100 Message-Id: <1520342370-123606-31-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 30/34] Fix WHPX issue leaking tpr values X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Justin Terry \(VM\)" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Justin Terry (VM) via Qemu-devel" Fixes an issue where if the tpr is assigned to the array but not a different value from what is already expected on the vp the code will skip incrementi= ng the reg_count. In this case its possible that we set an invalid memory sect= ion of the next call for DeliverabilityNotifications that was not expected. The fix is to use a local variable to store the temporary tpr and only upda= te the array if the local tpr value is different than the vp context. Signed-off-by: Justin Terry (VM) Message-Id: <1519665216-1078-7-git-send-email-juterry@microsoft.com> Signed-off-by: Paolo Bonzini Signed-off-by: Justin Terry (VM) via Qemu-devel --- target/i386/whpx-all.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index 7e58d5f..47a6935 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -687,6 +687,7 @@ static void whpx_vcpu_pre_run(CPUState *cpu) struct CPUX86State *env =3D (CPUArchState *)(cpu->env_ptr); X86CPU *x86_cpu =3D X86_CPU(cpu); int irq; + uint8_t tpr; WHV_X64_PENDING_INTERRUPTION_REGISTER new_int =3D {0}; UINT32 reg_count =3D 0; WHV_REGISTER_VALUE reg_values[3] =3D {0}; @@ -746,9 +747,10 @@ static void whpx_vcpu_pre_run(CPUState *cpu) } =20 /* Sync the TPR to the CR8 if was modified during the intercept */ - reg_values[reg_count].Reg64 =3D cpu_get_apic_tpr(x86_cpu->apic_state); - if (reg_values[reg_count].Reg64 !=3D vcpu->tpr) { - vcpu->tpr =3D reg_values[reg_count].Reg64; + tpr =3D cpu_get_apic_tpr(x86_cpu->apic_state); + if (tpr !=3D vcpu->tpr) { + vcpu->tpr =3D tpr; + reg_values[reg_count].Reg64 =3D tpr; cpu->exit_request =3D 1; reg_names[reg_count] =3D WHvX64RegisterCr8; reg_count +=3D 1; --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520344226947932.1766444518215; Tue, 6 Mar 2018 05:50:26 -0800 (PST) Received: from localhost ([::1]:55887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCz4-0007oM-3r for importer@patchew.org; Tue, 06 Mar 2018 08:50:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVr-0005aD-6W for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVq-0006gw-6S for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:15 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:33672) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVo-0006ft-JB for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:12 -0500 Received: by mail-wr0-x242.google.com with SMTP id v18so20261543wrv.0 for ; Tue, 06 Mar 2018 05:20:12 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=0Mp4Sge0QMX+4aE/aXh1JQ5RmXxh4gw1rUr6pS87d5k=; b=Z67Obz7lFSqwhAnnBDueTgJRLFuc7zhgXWDvasJ8sTs1RHeIFWi9fO7KrZEUExSJxs 1B87JenCxTrncZ6wIPL8gfonpCEycoLqI345SNA/QEOSQaVROfrWZ2NA32MDSgeLHi09 55EJFiDs9+7sknOnNNSPf6yl3vM5DI1d7vtd2JdMVuTlBc6lSYaMxd4moulScRtxk+Hp s7DK+yhacsnMd2aVXh/odTJf+s3jVFqvYlbxYbjJSNcAaUuJJ6dp7pF5gVPE/VemFm4l mIYgwWj77Ji2BgSUEL+QtY7M/An54wINjmmgI5J1J271TeqNoVlsGdUo4axJwUvDTQEl ny8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=0Mp4Sge0QMX+4aE/aXh1JQ5RmXxh4gw1rUr6pS87d5k=; b=DQnn+QP0LqsKXTH94N/37/6SwO+8n/OQY5lcUX8ITJPj6F8z0+/ssT6RK/mOQEcZw7 FJNIM4pIX3xcFXQpuC84oMsQroaV4QUvYc4/sb7lmye1am5+lIsDLS0Y8Xa5VApEMLsn 0DnEbd98axfjCVo2E7KV6u36Yrwh6+IiygB/LRB3L9ynuVMpezWkKgBKHUieNwY9sTIL RT3/YYWOAY6WBopmN+wy09sevxaBZhUPmRnXfXycqjZaE4+eiKfok9o00lz/hn0tuMMI 3nXQGQgK/N/YO+gLF0d+qMxjDxY6doHbJ4ASd7Jh3/auRyU5ZWwkq3SNool3v4QhFnKK dSPA== X-Gm-Message-State: APf1xPDMfFZR/M5kWUv7j1bHpzN9khQEPZOGwA9Zd0HT1TnljPpYLog4 mc0s+rnRsKC6Lj68mNGINK+Qf/7P X-Google-Smtp-Source: AG47ELs+0TYTkUndPJXhx4xqnsNcW+XTz5pDmYd/uztpws50Nx6Z/BoxKIFlZ4PyUxXX+/f8DtAnnw== X-Received: by 10.223.151.204 with SMTP id t12mr17049835wrb.156.1520342411273; Tue, 06 Mar 2018 05:20:11 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:27 +0100 Message-Id: <1520342370-123606-32-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PULL 31/34] WHXP Removes the use of WHvGetExitContextSize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Justin Terry \(VM\)" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Justin Terry (VM) via Qemu-devel" The use of WHvGetExitContextSize will break ABI compatibility if the platfo= rm changes the context size while a qemu compiled executable does not recompil= e. To avoid this we now use sizeof and let the platform determine which version of the struction was passed for ABI compatibility. Signed-off-by: Justin Terry (VM) Message-Id: <1519665216-1078-8-git-send-email-juterry@microsoft.com> Signed-off-by: Paolo Bonzini Signed-off-by: Justin Terry (VM) via Qemu-devel --- target/i386/whpx-all.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index 47a6935..24387be 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -32,7 +32,6 @@ struct whpx_state { uint64_t mem_quota; WHV_PARTITION_HANDLE partition; - uint32_t exit_ctx_size; }; =20 static const WHV_REGISTER_NAME whpx_register_names[] =3D { @@ -899,7 +898,7 @@ static int whpx_vcpu_run(CPUState *cpu) } =20 hr =3D WHvRunVirtualProcessor(whpx->partition, cpu->cpu_index, - &vcpu->exit_ctx, whpx->exit_ctx_size); + &vcpu->exit_ctx, sizeof(vcpu->exit_ctx= )); =20 if (FAILED(hr)) { error_report("WHPX: Failed to exec a virtual processor," @@ -1042,8 +1041,7 @@ int whpx_init_vcpu(CPUState *cpu) } } =20 - vcpu =3D g_malloc0(FIELD_OFFSET(struct whpx_vcpu, exit_ctx) + - whpx->exit_ctx_size); + vcpu =3D g_malloc0(sizeof(struct whpx_vcpu)); =20 if (!vcpu) { error_report("WHPX: Failed to allocte VCPU context."); @@ -1300,9 +1298,6 @@ static int whpx_accel_init(MachineState *ms) goto error; } =20 - whpx->exit_ctx_size =3D WHvGetRunExitContextSize(); - assert(whpx->exit_ctx_size); - whpx_memory_init(); =20 cpu_interrupt_handler =3D whpx_handle_interrupt; --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520343972971203.0881954940213; Tue, 6 Mar 2018 05:46:12 -0800 (PST) Received: from localhost ([::1]:55854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCuu-0004Ef-F2 for importer@patchew.org; Tue, 06 Mar 2018 08:46:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVx-0005su-Aw for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVr-0006hq-7G for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:21 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:50450) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVq-0006gi-KT for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:14 -0500 Received: by mail-wm0-x244.google.com with SMTP id w128so22837638wmw.0 for ; Tue, 06 Mar 2018 05:20:14 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=/TP6gD5rzLr2rVY7NSla9bSEC1y0SdEvHzyW8Dpf5Z0=; b=dRGvuoJpqbRhc9HSQbgshm4LiqQEeDaelhUqqkk5ZtvcBUH6xintW4o2KH71Q8W6oV CI/QPJ1nVbXeYNg4sY769gdUyZSFLWOjYIaiZrtN4Rqm5zlKoIJQHB+uR7pwwQiAvsZU f/wHNNZOVfdu3Q3v9iT0l6O4ARzaQJFO/o63usYFnzyl0/E4WzvUEKcC7vVPUCNP9aAO lFrIQIOf0zZbuxqeyVbKNrnB8CxHqkctiwIJIF2OtL2/RUcsMdlAKi9Pway+MquBXUJb WJISMGidEs01dHeZLgJawRmyr2xBROvRSuLbcc3TD1funroWJzq9siAx7ozxNlhc7Puk hgvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=/TP6gD5rzLr2rVY7NSla9bSEC1y0SdEvHzyW8Dpf5Z0=; b=HxDecQ8KofLPCL7JmY/53t56zc+nLhgtFeL4bzsL7ygBFjiWmmxeLPgdBgGlx0q2SU B/kVAacGUqCcPq32e/3DQlzz7aDiuWwBtW3ANSSx6R0uikBTSb1kb4tLWUamaGm2Y7t3 abrx/4qpe9JUg+oiuFUu0QwF6LPjAaB2IvYmW7x9S1/LB4POUJElR531ccMB9lA08sG+ HXEJeQDFnWg+Jvc59opN4x9kLg9pcMk4fyLkb1e0aqJ1BHdz43u3LZiCWhls1rUbW6TP VfXmjPQ1oT2Jm/Sc3xKdy6xCk9j8PEth6WnLfwnDbBlydPp2pwrtlQ/IyVMYwUE0D5aR Rb9A== X-Gm-Message-State: AElRT7Fr8r3Nb0WJSJe1SI7Gbo48sEmWhEdXkqyXe79/y7Jox+q/HpgJ vmdiuMZOLXXXon4BJoOHMi5bWIOk X-Google-Smtp-Source: AG47ELucRjSf6Z7/YbuHawB6UWYOR59tfgXDOIP1b7HKQBUVmDboGjKaOJEab9SmDs9h4PCP5GPBMg== X-Received: by 10.28.197.205 with SMTP id v196mr10622462wmf.141.1520342413134; Tue, 06 Mar 2018 05:20:13 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:28 +0100 Message-Id: <1520342370-123606-33-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 32/34] WHPX improve interrupt notification registration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Justin Terry \(VM\)" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Justin Terry (VM) via Qemu-devel" Improves the usage of the InterruptNotification registration by skipping the additional call to WHvSetVirtualProcessorRegisters if we have already registered for the window exit. Signed-off-by: Justin Terry (VM) Message-Id: <1519665216-1078-9-git-send-email-juterry@microsoft.com> Signed-off-by: Paolo Bonzini Signed-off-by: Justin Terry (VM) via Qemu-devel --- target/i386/whpx-all.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c index 24387be..940bbe5 100644 --- a/target/i386/whpx-all.c +++ b/target/i386/whpx-all.c @@ -756,12 +756,11 @@ static void whpx_vcpu_pre_run(CPUState *cpu) } =20 /* Update the state of the interrupt delivery notification */ - if (cpu->interrupt_request & CPU_INTERRUPT_HARD) { + if (!vcpu->window_registered && + cpu->interrupt_request & CPU_INTERRUPT_HARD) { reg_values[reg_count].DeliverabilityNotifications.InterruptNotific= ation =3D 1; - if (vcpu->window_registered !=3D 1) { - vcpu->window_registered =3D 1; - } + vcpu->window_registered =3D 1; reg_names[reg_count] =3D WHvX64RegisterDeliverabilityNotifications; reg_count +=3D 1; } --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520344126355861.9194838872921; Tue, 6 Mar 2018 05:48:46 -0800 (PST) Received: from localhost ([::1]:55875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCxR-0006Pf-JJ for importer@patchew.org; Tue, 06 Mar 2018 08:48:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVy-0005te-2p for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVs-0006iR-0h for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:22 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35478) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVr-0006hd-Kp for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:15 -0500 Received: by mail-wm0-x242.google.com with SMTP id x7so22126670wmc.0 for ; Tue, 06 Mar 2018 05:20:15 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=uGdYCr7++73u6ogXAqiohwj7e8Q+kY89vb653r6xBSI=; b=aISno239Udv5sSr2RkYp54Z6+BNS59MFuBTbhATAxe+x/579e3mXI1qiO58+XNKE2c I+9uUEFcLYsVrGdC8Q+H/wBIAEB+EKhLGtJa9YBkr7qsed8639/gdMK+mssuwCxqOlTH gUMSW3CaXl6Es5VDPx5D3DCYTzvYH6127/nUZIg2sAomHdF+oKHGPQQty7RRramnHlcw eN8pe75xRmKyPhKLXHv/T7kTOGyaohDs6xtYlOo4PT8UIwviTYu/iyHz/XeFtD2/Yysu tKRFrRmASmwHgn8KSpeBGwtojp5KxQb465fIFVZrKy7q2bjyqnsukG/dPR6nGmtryw8/ gTFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=uGdYCr7++73u6ogXAqiohwj7e8Q+kY89vb653r6xBSI=; b=pzyodwVjwearMlTIEmsc5JiDIH6+AQ1+kjJUVT5n6FazyCuRK0V3z9oyCxAiY2TqRQ Le4XgBFqDCeXw2QH1AGBqAy561CPlhKjFcZqYFy9EzHQorKFM8Qe5JrF0BhC6J/QMaCW 7IDT4PYVJvFcj5XIJB/U4R2OO1PUxYizY9EcK/wMzKS2fiLsam0A+vfeyLWU67ppaHDL ms2kxP4+77JqQ5k3bFE5MnzSWz2pXhTQJgJX92zkl32i4GDZc9JNNl7DSOdyORQzXTep 4SXOLblxX3gI39Dsh1pBW0HA38pvPqb1TVnSOiRI1GxFMp0EQ9uh7gkAjeTnMdki0k/c MoMw== X-Gm-Message-State: AElRT7GN4aojhPSjpO3oPD3yZIAqV0U19pCVi8K5wmL06r5orhRByCFs igjTDJNoA1EqIj/9yFascQ4cIj7S X-Google-Smtp-Source: AG47ELudB7fQboOO66z2GxgQeqx5nCsa08V+4hsHkpBy6KdFNDOzZl15tAka90hixAcCjHXE76p3hA== X-Received: by 10.28.6.83 with SMTP id 80mr11099138wmg.12.1520342414304; Tue, 06 Mar 2018 05:20:14 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:29 +0100 Message-Id: <1520342370-123606-34-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 33/34] balloon: Fix documentation of the --balloon parameter and deprecate it X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth There are two issues with the documentation of the --balloon parameter: First, "--balloon none" is simply doing nothing. Even if a machine had a balloon device by default, this option is not disabling anything, it is simply ignored. Thus let's simply drop this option from the documentation to avoid to confuse the users (but keep the code in vl.c for backward compatibility). Second, the documentation claims that "--balloon virtio" is the default mode, but this is not true anymore since commit 382f074371f7dc32a34. Since that commit, the option also has no real use case anymore, since you can simply use "--device virtio-balloon" nowadays instead. Thus to simplify our complex parameter zoo a little bit, let's deprecate the the parameter now and tell the user to use "--device virtio-balloon" instead. Fixes: 382f074371f7dc32a34c944c845b1698e83d8c36 Signed-off-by: Thomas Huth Message-Id: <1519796303-13257-1-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- qemu-doc.texi | 5 +++++ qemu-options.hx | 11 ++++------- vl.c | 3 +++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 589519a..39e38c8 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2707,6 +2707,11 @@ enabled via the ``-machine usb=3Don'' argument. =20 The ``-nodefconfig`` argument is a synonym for ``-no-user-config``. =20 +@subsection -balloon (since 2.12.0) + +The @option{--balloon virtio} argument has been superseded by +@option{--device virtio-balloon}. + @subsection -machine s390-squash-mcss=3Don|off (since 2.12.0) =20 The ``s390-squash-mcss=3Don`` property has been obsoleted by allowing the diff --git a/qemu-options.hx b/qemu-options.hx index 2a22a62..6585058 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -462,16 +462,13 @@ modprobe i810_audio clocking=3D48000 ETEXI =20 DEF("balloon", HAS_ARG, QEMU_OPTION_balloon, - "-balloon none disable balloon device\n" "-balloon virtio[,addr=3Dstr]\n" - " enable virtio balloon device (default)\n", QEMU_ARCH_= ALL) + " enable virtio balloon device (deprecated)\n", QEMU_AR= CH_ALL) STEXI -@item -balloon none -@findex -balloon -Disable balloon device. @item -balloon virtio[,addr=3D@var{addr}] -Enable virtio balloon device (default), optionally with PCI address -@var{addr}. +@findex -balloon +Enable virtio balloon device, optionally with PCI address @var{addr}. This +option is deprecated, use @option{--device virtio-balloon} instead. ETEXI =20 DEF("device", HAS_ARG, QEMU_OPTION_device, diff --git a/vl.c b/vl.c index e648bed..dae986b 100644 --- a/vl.c +++ b/vl.c @@ -2209,6 +2209,9 @@ static int balloon_parse(const char *arg) { QemuOpts *opts; =20 + warn_report("This option is deprecated. " + "Use '--device virtio-balloon' to enable the balloon devic= e."); + if (strcmp(arg, "none") =3D=3D 0) { return 0; } --=20 1.8.3.1 From nobody Fri Oct 24 21:57:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 152034316892949.73302531744355; Tue, 6 Mar 2018 05:32:48 -0800 (PST) Received: from localhost ([::1]:55764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etChy-0000s5-8p for importer@patchew.org; Tue, 06 Mar 2018 08:32:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etCVv-0005iZ-6z for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etCVt-0006k9-Fe for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:19 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:38810) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etCVt-0006ij-5X for qemu-devel@nongnu.org; Tue, 06 Mar 2018 08:20:17 -0500 Received: by mail-wm0-x242.google.com with SMTP id z9so22090600wmb.3 for ; Tue, 06 Mar 2018 05:20:17 -0800 (PST) Received: from 640k.lan (94-36-191-219.adsl-ull.clienti.tiscali.it. [94.36.191.219]) by smtp.gmail.com with ESMTPSA id l38sm25652538wrc.96.2018.03.06.05.20.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 05:20:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6ob20XI+EkHjTbRhUVxloR84w+duLaRCy7QP0BFOpXE=; b=kw6dZypcrnecPPzzJb66Rk6onaTQVh4QMx7t88yxKj7U55pCPu9pb0IzCuGhf3GgNO mG1uVjgQg043qcIjcL3pUi0vV0anpRQZY6yqsdg8N97XJotjgFtzh+3RPzd2ud0RJDmj KZkzo/BKufW4KDvuUT7sIdi0WhZbref5c9Mtip4EPsVBE9vAKsX9UnJfDFt6mboICQPH PhBERXAwmrbWERFKKcHQd60b9hZUJWo8iV594rqYm0g/fMYP7t2hZ3oUX8mKSMAgEwFc YRnuKHBPF21sTz3Xe1b/AsviZlGj5sEQr4Z2NqfGuBE3eFypiuhoXJ1RHOy+pjPdUSEV qxTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=6ob20XI+EkHjTbRhUVxloR84w+duLaRCy7QP0BFOpXE=; b=DbhoRwY7G/iNnJEGICaCQa2AbNP31L9lfe5h1NKhU/vEQkPUb4z5exGzA2nQr3vjHB GKhGEHdOX1Q0E0MLgtxqKg8DAqdYLTeiFu1+lY6DGzwDNNhde6jGNZkAqRfFqaIQvZT4 NmwpWLz64ZP7Rp6ov+ZCHZfmOQfhdbOwCpdlx46ng78/Xeq+OPH1J4Oe69deXfnReMKh q9P3bAYuQ6sXIS2YXgtre7U1c7JOSEW0vQhG0LDqN/AKonsceXJ7BU4Vh39wCXR1OIk4 EFoWOJgtCwI5B4yGU68W0p/BWF5On/lmrVorlxv9Q1b6Ckz1sgv5uOfEiSWtO20jq+pW i5NA== X-Gm-Message-State: AElRT7H9JUwuNhpz35M0eG9x21mSVFYAg7Dbr5nf93kMLUshAxn1uTJ6 X0GyiHNakbnQCXhAnagQ9WKoKOF4 X-Google-Smtp-Source: AG47ELtqVWNQSH+6MG/qJYfkVeeDbHdljqKMefwjXJLjGlqZBGgyXbAKM86ZVpzu9DyYNq0xO+oTYA== X-Received: by 10.28.239.8 with SMTP id n8mr11886702wmh.120.1520342415761; Tue, 06 Mar 2018 05:20:15 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 6 Mar 2018 14:19:30 +0100 Message-Id: <1520342370-123606-35-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> References: <1520342370-123606-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PULL 34/34] use g_path_get_basename instead of basename X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julia Suvorova Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Julia Suvorova basename(3) and dirname(3) modify their argument and may return pointers to statically allocated memory which may be overwritten by subsequent calls. g_path_get_basename and g_path_get_dirname have no such issues, and therefore more preferable. Signed-off-by: Julia Suvorova Message-Id: <1519888086-4207-1-git-send-email-jusual@mail.ru> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Cornelia Huck Signed-off-by: Paolo Bonzini --- fsdev/virtfs-proxy-helper.c | 15 +++++++++------ hw/s390x/s390-ccw.c | 2 +- hw/vfio/pci.c | 2 +- hw/vfio/platform.c | 2 +- qemu-io.c | 2 +- qga/commands-posix.c | 4 ++-- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index 8e48500..6f132c5 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -55,6 +55,7 @@ static struct option helper_opts[] =3D { =20 static bool is_daemon; static bool get_version; /* IOC getversion IOCTL supported */ +static char *prog_name; =20 static void GCC_FMT_ATTR(2, 3) do_log(int loglevel, const char *format, ..= .) { @@ -785,7 +786,7 @@ error: return -1; } =20 -static void usage(char *prog) +static void usage(void) { fprintf(stderr, "usage: %s\n" " -p|--path 9p path to export\n" @@ -795,7 +796,7 @@ static void usage(char *prog) " access to this socket\n" " \tNote: -s & -f can not be used together\n" " [-n|--nodaemon] Run as a normal program\n", - basename(prog)); + prog_name); } =20 static int process_reply(int sock, int type, @@ -1045,6 +1046,8 @@ int main(int argc, char **argv) struct statfs st_fs; #endif =20 + prog_name =3D g_path_get_basename(argv[0]); + is_daemon =3D true; sock =3D -1; own_u =3D own_g =3D -1; @@ -1077,7 +1080,7 @@ int main(int argc, char **argv) case '?': case 'h': default: - usage(argv[0]); + usage(); exit(EXIT_FAILURE); } } @@ -1085,13 +1088,13 @@ int main(int argc, char **argv) /* Parameter validation */ if ((sock_name =3D=3D NULL && sock =3D=3D -1) || rpath =3D=3D NULL) { fprintf(stderr, "socket, socket descriptor or path not specified\n= "); - usage(argv[0]); + usage(); return -1; } =20 if (sock_name && sock !=3D -1) { fprintf(stderr, "both named socket and socket descriptor specified= \n"); - usage(argv[0]); + usage(); exit(EXIT_FAILURE); } =20 @@ -1099,7 +1102,7 @@ int main(int argc, char **argv) fprintf(stderr, "owner uid:gid not specified, "); fprintf(stderr, "owner uid:gid specifies who can access the socket file\n"= ); - usage(argv[0]); + usage(); exit(EXIT_FAILURE); } =20 diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index 7fc1c60..214c940 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -48,7 +48,7 @@ static void s390_ccw_get_dev_info(S390CCWDevice *cdev, return; } =20 - cdev->mdevid =3D g_strdup(basename(dev_path)); + cdev->mdevid =3D g_path_get_basename(dev_path); =20 tmp =3D basename(dirname(dev_path)); if (sscanf(tmp, "%2x.%1x.%4x", &cssid, &ssid, &devid) !=3D 3) { diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 033cc8d..3ba3cbc 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2807,7 +2807,7 @@ static void vfio_realize(PCIDevice *pdev, Error **err= p) return; } =20 - vdev->vbasedev.name =3D g_strdup(basename(vdev->vbasedev.sysfsdev)); + vdev->vbasedev.name =3D g_path_get_basename(vdev->vbasedev.sysfsdev); vdev->vbasedev.ops =3D &vfio_pci_ops; vdev->vbasedev.type =3D VFIO_DEVICE_TYPE_PCI; vdev->vbasedev.dev =3D &vdev->pdev.qdev; diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 0d4bc0a..5c921c2 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -561,7 +561,7 @@ static int vfio_base_device_init(VFIODevice *vbasedev, = Error **errp) /* @sysfsdev takes precedence over @host */ if (vbasedev->sysfsdev) { g_free(vbasedev->name); - vbasedev->name =3D g_strdup(basename(vbasedev->sysfsdev)); + vbasedev->name =3D g_path_get_basename(vbasedev->sysfsdev); } else { if (!vbasedev->name || strchr(vbasedev->name, '/')) { error_setg(errp, "wrong host device name"); diff --git a/qemu-io.c b/qemu-io.c index 2c00ea0..160fb2a 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -504,7 +504,7 @@ int main(int argc, char **argv) #endif =20 module_call_init(MODULE_INIT_TRACE); - progname =3D basename(argv[0]); + progname =3D g_path_get_basename(argv[0]); qemu_init_exec_dir(argv[0]); =20 qcrypto_init(&error_fatal); diff --git a/qga/commands-posix.c b/qga/commands-posix.c index ac17d0d..0dc219d 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -808,7 +808,7 @@ static char *get_pci_driver(char const *syspath, int pa= thlen, Error **errp) len =3D readlink(dpath, buf, sizeof(buf) - 1); if (len !=3D -1) { buf[len] =3D 0; - driver =3D g_strdup(basename(buf)); + driver =3D g_path_get_basename(buf); } g_free(dpath); g_free(path); @@ -1053,7 +1053,7 @@ static void build_guest_fsinfo_for_device(char const = *devpath, } =20 if (!fs->name) { - fs->name =3D g_strdup(basename(syspath)); + fs->name =3D g_path_get_basename(syspath); } =20 g_debug(" parse sysfs path '%s'", syspath); --=20 1.8.3.1