From nobody Sun May 19 03:54:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1562106113; cv=none; d=zoho.com; s=zohoarc; b=aNiLDRH3sIX5WWM51S8/uAt4yIfz+M/bPDHrBAN8fSSzFeKSJUiLU8ehRQtuxzQbNyq7l3BdWhztDLiitU/gLgRIrNHhisuA2Sy1N2PtITwXQZIm1yTDwloH0D1MxCUoubYuZmOoGAaLmnd68YhNOTscFhuo63j/WEOCgCMgnD0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562106113; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=o8DGYYXCaIejfNEYzQkUyr+DAHdtE9M6tLsid/TjDi4=; b=CWc+4SL9zmz2jCziXf4m3QV9RkJ5Evw2OvgnlnNblXVIMO1zbgkJTWsNOU+DsB0/aDSNX+kowq1RsQenLEemlxJtiY98c6eCI1LWsdP2JlNdfDwloFeEQFWuzeCU37abh1L+jveCbnvNSH5h+729Uc7u16Ug2c8KKxuXmsRDTHA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562106113716156.77736429219158; Tue, 2 Jul 2019 15:21:53 -0700 (PDT) Received: from localhost ([::1]:57960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiR9n-0000Bb-2d for importer@patchew.org; Tue, 02 Jul 2019 18:21:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46082) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiR6r-0006ow-Q4 for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiR6m-0002VF-US for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:42 -0400 Received: from mail.ilande.co.uk ([46.43.2.167]:44548 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hiR6k-0002C8-SZ for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:39 -0400 Received: from host109-146-132-17.range109-146.btcentralplus.com ([109.146.132.17] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hiR3n-0004bu-N7; Tue, 02 Jul 2019 23:15:36 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Tue, 2 Jul 2019 23:16:01 +0100 Message-Id: <20190702221606.21600-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> References: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 109.146.132.17 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 46.43.2.167 Subject: [Qemu-devel] [PULL 1/6] sun4m: set default display type to TCX X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 6807874d55 "sun4m: obey -vga none" changed the sun4m machines so that they could be started without a framebuffer installed, but as no default display type was configured the machines would start in headless mode witho= ut an explict -vga option. Set the default display type for all sun4m machines to TCX so that they will start with a framebuffer if one is not specifically requested. Signed-off-by: Mark Cave-Ayland --- hw/sparc/sun4m.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 7e4f61fc3e..99f53e87f7 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -1406,6 +1406,7 @@ static void ss5_class_init(ObjectClass *oc, void *dat= a) mc->is_default =3D 1; mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); + mc->default_display =3D "tcx"; } =20 static const TypeInfo ss5_type =3D { @@ -1424,6 +1425,7 @@ static void ss10_class_init(ObjectClass *oc, void *da= ta) mc->max_cpus =3D 4; mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); + mc->default_display =3D "tcx"; } =20 static const TypeInfo ss10_type =3D { @@ -1442,6 +1444,7 @@ static void ss600mp_class_init(ObjectClass *oc, void = *data) mc->max_cpus =3D 4; mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); + mc->default_display =3D "tcx"; } =20 static const TypeInfo ss600mp_type =3D { @@ -1460,6 +1463,7 @@ static void ss20_class_init(ObjectClass *oc, void *da= ta) mc->max_cpus =3D 4; mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-SuperSparc-II"); + mc->default_display =3D "tcx"; } =20 static const TypeInfo ss20_type =3D { @@ -1477,6 +1481,7 @@ static void voyager_class_init(ObjectClass *oc, void = *data) mc->block_default_type =3D IF_SCSI; mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); + mc->default_display =3D "tcx"; } =20 static const TypeInfo voyager_type =3D { @@ -1494,6 +1499,7 @@ static void ss_lx_class_init(ObjectClass *oc, void *d= ata) mc->block_default_type =3D IF_SCSI; mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); + mc->default_display =3D "tcx"; } =20 static const TypeInfo ss_lx_type =3D { @@ -1511,6 +1517,7 @@ static void ss4_class_init(ObjectClass *oc, void *dat= a) mc->block_default_type =3D IF_SCSI; mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); + mc->default_display =3D "tcx"; } =20 static const TypeInfo ss4_type =3D { @@ -1528,6 +1535,7 @@ static void scls_class_init(ObjectClass *oc, void *da= ta) mc->block_default_type =3D IF_SCSI; mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); + mc->default_display =3D "tcx"; } =20 static const TypeInfo scls_type =3D { @@ -1545,6 +1553,7 @@ static void sbook_class_init(ObjectClass *oc, void *d= ata) mc->block_default_type =3D IF_SCSI; mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-MicroSparc-I"); + mc->default_display =3D "tcx"; } =20 static const TypeInfo sbook_type =3D { --=20 2.11.0 From nobody Sun May 19 03:54:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1562106117; cv=none; d=zoho.com; s=zohoarc; b=CIdfCPqG3TZ/QJSFYgWn80H+N11TzSG3Lr1TTldu6YdpC638CtCmZoPvYVXk+amz8BPWdwwA/BpSS4jVn37EpiLV7PY0mHfwX2NSN8jNNNSx3zFHQIa6SDQFfOjCPee7uVZ4DRG3AjELr2srzPko3c3ZuVviiUghwbGNABg6FNQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562106117; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=qbz7HjpGO5OHQwtVdJAVnfbjEqL2G8F0It+Y5GJ3zQg=; b=bTnI9dA75qavjnvDvtRTcxuRcY/z3sFnKy3q0IXzL1TC54sikd5I5ivcRtXLXNSVkP48BRWvLAy6Sq8QFLZ2dXXj93gk+cm/W8i7qC3AY8awQdwASz/6voT0SFuQFkrmeu8+Gvz2nonMsy/98FXtCe9Q7o4Q8nVz5/fAkm1l8bE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562106116732253.6499548014964; Tue, 2 Jul 2019 15:21:56 -0700 (PDT) Received: from localhost ([::1]:57964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiR9r-0000KQ-0E for importer@patchew.org; Tue, 02 Jul 2019 18:21:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46211) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiR6x-0006rt-Sf for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiR6u-0002hL-RV for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:50 -0400 Received: from mail.ilande.co.uk ([46.43.2.167]:44556 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hiR6q-0002EE-Ph for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:44 -0400 Received: from host109-146-132-17.range109-146.btcentralplus.com ([109.146.132.17] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hiR3o-0004bu-37; Tue, 02 Jul 2019 23:15:36 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Tue, 2 Jul 2019 23:16:02 +0100 Message-Id: <20190702221606.21600-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> References: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 109.146.132.17 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 46.43.2.167 Subject: [Qemu-devel] [PULL 2/6] sunhme: add trace event for logging PCI IRQ X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mark Cave-Ayland --- hw/net/sunhme.c | 2 ++ hw/net/trace-events | 1 + 2 files changed, 3 insertions(+) diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index 1ebaee3c82..6d660a8238 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -209,6 +209,8 @@ static void sunhme_update_irq(SunHMEState *s) } =20 level =3D (seb ? 1 : 0); + trace_sunhme_update_irq(mifmask, mif, sebmask, seb, level); + pci_set_irq(d, level); } =20 diff --git a/hw/net/trace-events b/hw/net/trace-events index 3cd9e122df..d16273c579 100644 --- a/hw/net/trace-events +++ b/hw/net/trace-events @@ -359,6 +359,7 @@ sunhme_rx_filter_reject(void) "rejecting incoming frame" sunhme_rx_filter_accept(void) "accepting incoming frame" sunhme_rx_desc(uint32_t addr, int offset, uint32_t status, int len, int cr= , int nr) "addr 0x%"PRIx32"(+0x%x) status 0x%"PRIx32 " len %d (ring %d/%d)" sunhme_rx_xsum_calc(uint16_t xsum) "calculated incoming xsum as 0x%x" +sunhme_update_irq(uint32_t mifmask, uint32_t mif, uint32_t sebmask, uint32= _t seb, int level) "mifmask: 0x%x mif: 0x%x sebmask: 0x%x seb: 0x%x lev= el: %d" =20 # virtio-net.c virtio_net_announce_notify(void) "" --=20 2.11.0 From nobody Sun May 19 03:54:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1562106400; cv=none; d=zoho.com; s=zohoarc; b=kddm6lXJS5CuS8ut1gf5xq4O9g8nuJe44p7h9n2X2GDI6jO1uPIiDhJRSeYql13ZfogRtxjNLMyWu+s4P4Wl4ezd2N+rkyD7JSLMC1d55JNgAY/VVK6y0zcf1gFazKdqBGaxBIg0WuTeuZJdDPVPhflnP1sTRzijlKpJUBwBh1g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562106400; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=QUKR91xXP63B9XSiDLa9I/XKo7bdA2stZAaaEysVyeE=; b=bMFbnlSmjAQV6N/0fRv8RNy8Vb6+H4sWjYpUEZVsyoNzIRWVmcsUpJHDU5kEeUYvlw5c4eiBsV5TYZ8A3xkKJvB1c6ZO46ZXImb5kuyH1ctjFv7Qoyt1NKSppUuBvYmvEh/eWelDz+40HLpt9DUIE5zI+dGbqymbI3VdWDZtEHk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562106399999399.5703183120256; Tue, 2 Jul 2019 15:26:39 -0700 (PDT) Received: from localhost ([::1]:57984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiRET-0004WK-1K for importer@patchew.org; Tue, 02 Jul 2019 18:26:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46284) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiR71-0006sf-3p for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiR6y-0002ol-88 for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:54 -0400 Received: from mail.ilande.co.uk ([46.43.2.167]:44572 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hiR6x-0002G2-TI for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:52 -0400 Received: from host109-146-132-17.range109-146.btcentralplus.com ([109.146.132.17] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hiR3o-0004bu-Mv; Tue, 02 Jul 2019 23:15:36 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Tue, 2 Jul 2019 23:16:03 +0100 Message-Id: <20190702221606.21600-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> References: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 109.146.132.17 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 46.43.2.167 Subject: [Qemu-devel] [PULL 3/6] sunhme: fix incorrect constant in sunhme_can_receive() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Due to a copy/paste error the wrong register was being checked in order to determine if the NIC is able to receive data. Signed-off-by: Mark Cave-Ayland --- hw/net/sunhme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index 6d660a8238..e3a488ee1d 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -649,7 +649,7 @@ static int sunhme_can_receive(NetClientState *nc) { SunHMEState *s =3D qemu_get_nic_opaque(nc); =20 - return s->macregs[HME_MAC_RXCFG_ENABLE >> 2] & HME_MAC_RXCFG_ENABLE; + return s->macregs[HME_MACI_RXCFG >> 2] & HME_MAC_RXCFG_ENABLE; } =20 static void sunhme_link_status_changed(NetClientState *nc) --=20 2.11.0 From nobody Sun May 19 03:54:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1562106116; cv=none; d=zoho.com; s=zohoarc; b=SidSVxOyf6+W59RqRiAX8xUCxhMXyk6SkK5/AKeeLGeo3f8vxSRR+wCkEGzerjil1B50SdD8k9DvmAP8xtu3vzHWqjRvLwCEH1HIJGVNDC9kq8GylFmhaNLiZQ1ZXxc3xwoGa12nlZ8kdVHd37Zx7rYJd5EvPOrWEQhcCxrS8N0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562106116; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=mxT5T8nDkv3quBT6DtI84tLVjV9a8jEOKq7QW+rIGkU=; b=Th3kzp/uJy5ftKFPpkvQfdWeeHbGu4vQtUOmpbGkrthzDu06c5ZSFC4o88s+DPCGfLILIk176wmcMZRQ4I7AcjsUecaWodzP+oYFv+CvmAzL5yIQGcaR5z+/7IfFGQVI5ZarX0dKRPy2ISh9PTgQLUjUARzWyK1c92b28kNBFM0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562106116677734.1986795543712; Tue, 2 Jul 2019 15:21:56 -0700 (PDT) Received: from localhost ([::1]:57962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiR9q-0000Jz-MQ for importer@patchew.org; Tue, 02 Jul 2019 18:21:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46224) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiR6x-0006s5-Vm for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiR6v-0002k6-UQ for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:51 -0400 Received: from mail.ilande.co.uk ([46.43.2.167]:44552 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hiR6r-0002EH-Oz for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:47 -0400 Received: from host109-146-132-17.range109-146.btcentralplus.com ([109.146.132.17] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hiR3p-0004bu-2C; Tue, 02 Jul 2019 23:15:37 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Tue, 2 Jul 2019 23:16:04 +0100 Message-Id: <20190702221606.21600-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> References: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 109.146.132.17 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 46.43.2.167 Subject: [Qemu-devel] [PULL 4/6] sunhme: flush any queued packets when HME_MAC_RXCFG_ENABLE bit is raised X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Some client drivers use this bit to pause and resume the driver so make sure that queued packets are flushed when the MAC is disabled and then reactivat= ed. Signed-off-by: Mark Cave-Ayland --- hw/net/sunhme.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index e3a488ee1d..14e7effb88 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -373,10 +373,20 @@ static void sunhme_mac_write(void *opaque, hwaddr add= r, uint64_t val, unsigned size) { SunHMEState *s =3D SUNHME(opaque); + uint64_t oldval =3D s->macregs[addr >> 2]; =20 trace_sunhme_mac_write(addr, val); =20 s->macregs[addr >> 2] =3D val; + + switch (addr) { + case HME_MACI_RXCFG: + if (!(oldval & HME_MAC_RXCFG_ENABLE) && + (val & HME_MAC_RXCFG_ENABLE)) { + qemu_flush_queued_packets(qemu_get_queue(s->nic)); + } + break; + } } =20 static uint64_t sunhme_mac_read(void *opaque, hwaddr addr, --=20 2.11.0 From nobody Sun May 19 03:54:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1562106114; cv=none; d=zoho.com; s=zohoarc; b=GdPwkzWXOGFZOjJ6knz5Y+Qn9fYIe65JTL5muAtYQ57vBjKX8G2j5hBMSd/wyEQBxiy7JpgdBWLBB7mCW3iy3qb/AZNxk5xdmNucZZ9036klk65eumGpTI12HHk+sxi5ms3EaZ4/dHrJh74DZ4NXVA9lG+N0cg3fFHaF0XKFL44= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562106114; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ngyPZOptiwmpaW83cKMp+kGgsxAH+VXcnlEaerzHbDM=; b=M34rGpMyAiTyy6bi/VKkhzwUOcXvKi5Dyd/r/kkkiZIKbUWvMn9qC0k0QdpvI9xVdzwFzEv3A/vtNfo63MUJj/mCtuW5W998Uf9W8m3Amt1D6IalJsAj63YzNKsCqPcpa8HQmk9onIBTEhM1Rx5kia4prQZLQBnxkPo2mIOoXaY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562106114624884.6490079934905; Tue, 2 Jul 2019 15:21:54 -0700 (PDT) Received: from localhost ([::1]:57958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiR9n-0000B2-4S for importer@patchew.org; Tue, 02 Jul 2019 18:21:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46047) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiR6q-0006ov-Sh for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiR6n-0002WF-OB for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:44 -0400 Received: from mail.ilande.co.uk ([46.43.2.167]:44564 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hiR6l-0002G1-BH for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:40 -0400 Received: from host109-146-132-17.range109-146.btcentralplus.com ([109.146.132.17] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hiR3p-0004bu-CE; Tue, 02 Jul 2019 23:15:39 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Tue, 2 Jul 2019 23:16:05 +0100 Message-Id: <20190702221606.21600-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> References: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 109.146.132.17 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 46.43.2.167 Subject: [Qemu-devel] [PULL 5/6] sunhme: fix return values from sunhme_receive() during receive packet processing X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The current return values in sunhme_receive() when processing incoming pack= ets are inverted from what they should be. Make sure that we return 0 to indica= te the packet was discarded (and polling is to be disabled) and -1 to indicate that the packet was discarded but polling for incoming data is to be contin= ued. Signed-off-by: Mark Cave-Ayland --- hw/net/sunhme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index 14e7effb88..cd076d642b 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -728,7 +728,7 @@ static ssize_t sunhme_receive(NetClientState *nc, const= uint8_t *buf, =20 /* Do nothing if MAC RX disabled */ if (!(s->macregs[HME_MACI_RXCFG >> 2] & HME_MAC_RXCFG_ENABLE)) { - return -1; + return 0; } =20 trace_sunhme_rx_filter_destmac(buf[0], buf[1], buf[2], @@ -757,14 +757,14 @@ static ssize_t sunhme_receive(NetClientState *nc, con= st uint8_t *buf, /* Didn't match hash filter */ trace_sunhme_rx_filter_hash_nomatch(); trace_sunhme_rx_filter_reject(); - return 0; + return -1; } else { trace_sunhme_rx_filter_hash_match(); } } else { /* Not for us */ trace_sunhme_rx_filter_reject(); - return 0; + return -1; } } else { trace_sunhme_rx_filter_promisc_match(); --=20 2.11.0 From nobody Sun May 19 03:54:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1562106397; cv=none; d=zoho.com; s=zohoarc; b=kRFKbJPLuiOtvnZDwSBS04Avr2a+PutoYLqJFruTwpYERw7Zde9S+3K3RTLANiUlCxSLgQpmeaHEBqIUeIOq5/htW33219RBtx3D2Q4b7FovExpIYFfMt22UQK5ax0FZzohqB8eMltFjtcsedUirj87J1OXFTz8cfRHDCxXSi2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562106397; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=4fyFDv5VRcPTs6q1urf6RW0+fGjmYK9lGMRH/ZmzdGY=; b=jsKukbHugkRXEaU8f7CtHvy/q/Ph6McXCHwIXzLQ3BevTics05tMCYy8dUBC4rQCIxv8YB1CFpA5TkdF9prrnhY4wCO+mNFENAuHDoaDZLpe2Tci0Ujujr25ft/VRx6mU0cSSw4/ad1Cwls9wZopCVWcuxsX3Uaf7z/YbeKYJao= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156210639799645.402230804104306; Tue, 2 Jul 2019 15:26:37 -0700 (PDT) Received: from localhost ([::1]:57982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiREP-0004Jt-I2 for importer@patchew.org; Tue, 02 Jul 2019 18:26:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46223) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiR6x-0006s4-VI for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiR6w-0002l9-3P for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:51 -0400 Received: from mail.ilande.co.uk ([46.43.2.167]:44568 helo=mail.default.ilande.uk0.bigv.io) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hiR6u-0002G0-64 for qemu-devel@nongnu.org; Tue, 02 Jul 2019 18:18:49 -0400 Received: from host109-146-132-17.range109-146.btcentralplus.com ([109.146.132.17] helo=kentang.home) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hiR3r-0004bu-5e; Tue, 02 Jul 2019 23:15:39 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Tue, 2 Jul 2019 23:16:06 +0100 Message-Id: <20190702221606.21600-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> References: <20190702221606.21600-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 109.146.132.17 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 46.43.2.167 Subject: [Qemu-devel] [PULL 6/6] sunhme: ensure that RX descriptor ring overflow is indicated to client driver X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" On very busy networks connected via a tap interface, it is possible to over= flow the RX descriptor ring in the time between the client driver enabling the RX MAC and finishing writing the final configuration to the NIC registers. Ensure that we detect this condition and update the status register accordi= ngly to indicate an overflow has occurred (and the incoming packet dropped) in o= rder to prevent the client driver becoming confused. Signed-off-by: Mark Cave-Ayland --- hw/net/sunhme.c | 9 +++++++++ hw/net/trace-events | 1 + 2 files changed, 10 insertions(+) diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c index cd076d642b..8b8603e696 100644 --- a/hw/net/sunhme.c +++ b/hw/net/sunhme.c @@ -44,6 +44,7 @@ #define HME_SEBI_STAT 0x100 #define HME_SEBI_STAT_LINUXBUG 0x108 #define HME_SEB_STAT_RXTOHOST 0x10000 +#define HME_SEB_STAT_NORXD 0x20000 #define HME_SEB_STAT_MIFIRQ 0x800000 #define HME_SEB_STAT_HOSTTOTX 0x1000000 #define HME_SEB_STAT_TXALL 0x2000000 @@ -787,6 +788,14 @@ static ssize_t sunhme_receive(NetClientState *nc, cons= t uint8_t *buf, pci_dma_read(d, rb + cr * HME_DESC_SIZE, &status, 4); pci_dma_read(d, rb + cr * HME_DESC_SIZE + 4, &buffer, 4); =20 + /* If we don't own the current descriptor then indicate overflow error= */ + if (!(status & HME_XD_OWN)) { + s->sebregs[HME_SEBI_STAT >> 2] |=3D HME_SEB_STAT_NORXD; + sunhme_update_irq(s); + trace_sunhme_rx_norxd(); + return -1; + } + rxoffset =3D (s->erxregs[HME_ERXI_CFG >> 2] & HME_ERX_CFG_BYTEOFFSET) = >> HME_ERX_CFG_BYTEOFFSET_SHIFT; =20 diff --git a/hw/net/trace-events b/hw/net/trace-events index d16273c579..58665655cc 100644 --- a/hw/net/trace-events +++ b/hw/net/trace-events @@ -359,6 +359,7 @@ sunhme_rx_filter_reject(void) "rejecting incoming frame" sunhme_rx_filter_accept(void) "accepting incoming frame" sunhme_rx_desc(uint32_t addr, int offset, uint32_t status, int len, int cr= , int nr) "addr 0x%"PRIx32"(+0x%x) status 0x%"PRIx32 " len %d (ring %d/%d)" sunhme_rx_xsum_calc(uint16_t xsum) "calculated incoming xsum as 0x%x" +sunhme_rx_norxd(void) "no free rx descriptors available" sunhme_update_irq(uint32_t mifmask, uint32_t mif, uint32_t sebmask, uint32= _t seb, int level) "mifmask: 0x%x mif: 0x%x sebmask: 0x%x seb: 0x%x lev= el: %d" =20 # virtio-net.c --=20 2.11.0