From nobody Mon May 6 06:33:39 2024 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; 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 1529031833517436.3388231986693; Thu, 14 Jun 2018 20:03:53 -0700 (PDT) Received: from localhost ([::1]:44040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTf1g-0001ev-T8 for importer@patchew.org; Thu, 14 Jun 2018 23:03:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTezZ-0000XD-MO for qemu-devel@nongnu.org; Thu, 14 Jun 2018 23:01:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTezY-0002Pt-Qs for qemu-devel@nongnu.org; Thu, 14 Jun 2018 23:01:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51928 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTezY-0002PK-MU; Thu, 14 Jun 2018 23:01:36 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CFB4406F8B0; Fri, 15 Jun 2018 03:01:36 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-70.pek2.redhat.com [10.72.12.70]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2FE523174; Fri, 15 Jun 2018 03:01:30 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 15 Jun 2018 11:01:20 +0800 Message-Id: <1529031683-27458-2-git-send-email-jasowang@redhat.com> In-Reply-To: <1529031683-27458-1-git-send-email-jasowang@redhat.com> References: <1529031683-27458-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 15 Jun 2018 03:01:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 15 Jun 2018 03:01:36 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jasowang@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 1/4] tap: set vhostfd passed from qemu cli to non-blocking 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: Jason Wang , Brijesh Singh , qemu-stable@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Brijesh Singh A guest boot hangs while probing the network interface when iommu_platform=3Don is used. The following qemu cli hangs without this patch: # $QEMU \ -netdev tap,fd=3D3,id=3Dhostnet0,vhost=3Don,vhostfd=3D4 3<>/dev/tap67 4<>= /dev/host-net \ -device virtio-net-pci,netdev=3Dhostnet0,id=3Dnet0,iommu_platform=3Don,di= sable-legacy=3Don \ ... Commit: c471ad0e9bd46 (vhost_net: device IOTLB support) took care of setting vhostfd to non-blocking when QEMU opens /dev/host-net but if the fd is passed from qemu cli then we need to ensure that fd is set to non-blocking. Fixes: c471ad0e9bd46 ("vhost_net: device IOTLB support") Cc: qemu-stable@nongnu.org Cc: Michael S. Tsirkin Cc: Jason Wang Signed-off-by: Brijesh Singh Signed-off-by: Jason Wang --- net/tap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/tap.c b/net/tap.c index de05f20..2126f48 100644 --- a/net/tap.c +++ b/net/tap.c @@ -40,6 +40,7 @@ #include "qemu-common.h" #include "qemu/cutils.h" #include "qemu/error-report.h" +#include "qemu/sockets.h" =20 #include "net/tap.h" =20 @@ -693,6 +694,7 @@ static void net_init_tap_one(const NetdevTapOptions *ta= p, NetClientState *peer, } return; } + qemu_set_nonblock(vhostfd); } else { vhostfd =3D open("/dev/vhost-net", O_RDWR); if (vhostfd < 0) { --=20 2.7.4 From nobody Mon May 6 06:33:39 2024 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; 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 1529031847402654.5442746982162; Thu, 14 Jun 2018 20:04:07 -0700 (PDT) Received: from localhost ([::1]:44041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTf1v-0001rv-FW for importer@patchew.org; Thu, 14 Jun 2018 23:04:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTezh-0000d4-I4 for qemu-devel@nongnu.org; Thu, 14 Jun 2018 23:01:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTezd-0002WW-4s for qemu-devel@nongnu.org; Thu, 14 Jun 2018 23:01:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36746 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTezd-0002W3-18; Thu, 14 Jun 2018 23:01:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8100540122A0; Fri, 15 Jun 2018 03:01:40 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-70.pek2.redhat.com [10.72.12.70]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB2B5422AB; Fri, 15 Jun 2018 03:01:36 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 15 Jun 2018 11:01:21 +0800 Message-Id: <1529031683-27458-3-git-send-email-jasowang@redhat.com> In-Reply-To: <1529031683-27458-1-git-send-email-jasowang@redhat.com> References: <1529031683-27458-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 15 Jun 2018 03:01:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 15 Jun 2018 03:01:40 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jasowang@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 2/4] net: Fix a potential segfault 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: Jason Wang , qemu-stable@nongnu.org, Lin Ma Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Lin Ma If user forgets to provide any backend types for '-netdev' in qemu CLI, It triggers seg fault. e.g. Expected: $ qemu -netdev id=3Dnet0 qemu-system-x86_64: Parameter 'type' is missing Actual: $ qemu -netdev id=3Dnet0 Segmentation fault (core dumped) Fixes: 547203ead4327 ("net: List available netdevs with "-netdev help") Reviewed-by: Thomas Huth Cc: qemu-stable@nongnu.org Signed-off-by: Lin Ma Signed-off-by: Jason Wang --- net/net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/net.c b/net/net.c index efb9eaf..2a31339 100644 --- a/net/net.c +++ b/net/net.c @@ -1093,7 +1093,9 @@ static int net_client_init(QemuOpts *opts, bool is_ne= tdev, Error **errp) int ret =3D -1; Visitor *v =3D opts_visitor_new(opts); =20 - if (is_netdev && is_help_option(qemu_opt_get(opts, "type"))) { + const char *type =3D qemu_opt_get(opts, "type"); + + if (is_netdev && type && is_help_option(type)) { show_netdevs(); exit(0); } else { --=20 2.7.4 From nobody Mon May 6 06:33:39 2024 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; 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 1529031964648408.5247191010078; Thu, 14 Jun 2018 20:06:04 -0700 (PDT) Received: from localhost ([::1]:44056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTf3s-0003nD-0y for importer@patchew.org; Thu, 14 Jun 2018 23:06:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTezk-0000dk-Ta for qemu-devel@nongnu.org; Thu, 14 Jun 2018 23:01:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTezi-0002d1-JX for qemu-devel@nongnu.org; Thu, 14 Jun 2018 23:01:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51934 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTezi-0002ci-ER for qemu-devel@nongnu.org; Thu, 14 Jun 2018 23:01:46 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E870E406F8B0; Fri, 15 Jun 2018 03:01:45 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-70.pek2.redhat.com [10.72.12.70]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2727923174; Fri, 15 Jun 2018 03:01:42 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 15 Jun 2018 11:01:22 +0800 Message-Id: <1529031683-27458-4-git-send-email-jasowang@redhat.com> In-Reply-To: <1529031683-27458-1-git-send-email-jasowang@redhat.com> References: <1529031683-27458-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 15 Jun 2018 03:01:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 15 Jun 2018 03:01:45 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jasowang@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 3/4] e1000e: Do not auto-clear ICR bits which aren't set in EIAC 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: Jan Kiszka , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jan Kiszka The spec does not justify clearing of any E1000_ICR_OTHER_CAUSES when E1000_ICR_OTHER is set in EIAC. In fact, removing this code fixes the issue the Linux driver runs into since 4aea7a5c5e94 ("e1000e: Avoid receiver overrun interrupt bursts") and was worked around by 745d0bd3af99 ("e1000e: Remove Other from EIAC"). Signed-off-by: Jan Kiszka Signed-off-by: Jason Wang --- hw/net/e1000e_core.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index c93c466..9504891 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -2022,10 +2022,6 @@ e1000e_msix_notify_one(E1000ECore *core, uint32_t ca= use, uint32_t int_cfg) =20 effective_eiac =3D core->mac[EIAC] & cause; =20 - if (effective_eiac =3D=3D E1000_ICR_OTHER) { - effective_eiac |=3D E1000_ICR_OTHER_CAUSES; - } - core->mac[ICR] &=3D ~effective_eiac; =20 if (!(core->mac[CTRL_EXT] & E1000_CTRL_EXT_IAME)) { --=20 2.7.4 From nobody Mon May 6 06:33:39 2024 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; 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 1529031852259285.03670039644237; Thu, 14 Jun 2018 20:04:12 -0700 (PDT) Received: from localhost ([::1]:44042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTf23-0001yx-Iu for importer@patchew.org; Thu, 14 Jun 2018 23:04:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTezo-0000im-DW for qemu-devel@nongnu.org; Thu, 14 Jun 2018 23:01:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTezn-0002jA-Di for qemu-devel@nongnu.org; Thu, 14 Jun 2018 23:01:52 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36752 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTezn-0002in-8n; Thu, 14 Jun 2018 23:01:51 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF0E340122A0; Fri, 15 Jun 2018 03:01:50 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-70.pek2.redhat.com [10.72.12.70]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B90823174; Fri, 15 Jun 2018 03:01:46 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Fri, 15 Jun 2018 11:01:23 +0800 Message-Id: <1529031683-27458-5-git-send-email-jasowang@redhat.com> In-Reply-To: <1529031683-27458-1-git-send-email-jasowang@redhat.com> References: <1529031683-27458-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 15 Jun 2018 03:01:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 15 Jun 2018 03:01:50 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jasowang@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 4/4] vhost-user: delete net client if necessary 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: linzhecheng , Jason Wang , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: linzhecheng As qemu_new_net_client create new ncs but error happens later, ncs will be left in global net_clients list and we can't use them any more, so we need to cleanup them. Cc: qemu-stable@nongnu.org Signed-off-by: linzhecheng Signed-off-by: Jason Wang --- net/vhost-user.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/vhost-user.c b/net/vhost-user.c index 608b837..a39f9c9 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -345,6 +345,9 @@ err: s->vhost_user =3D NULL; } } + if (nc0) { + qemu_del_net_client(nc0); + } =20 return -1; } --=20 2.7.4