From nobody Sat May 18 03:46:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1651328997761916.5695680509385; Sat, 30 Apr 2022 07:29:57 -0700 (PDT) Received: from localhost ([::1]:52520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nko6e-0006op-1Z for importer@patchew.org; Sat, 30 Apr 2022 10:29:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkiQg-0003D5-My; Sat, 30 Apr 2022 04:26:14 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:34871) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkiQe-0003u2-OW; Sat, 30 Apr 2022 04:26:14 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id BEE635C010A; Sat, 30 Apr 2022 04:26:09 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 30 Apr 2022 04:26:09 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 30 Apr 2022 04:26:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bzzt.net; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1651307169; x=1651393569; bh=zDht1KUoBQsbXmkhCkY2Mzl8H p9Hocud9nuQ12H9mSI=; b=Br0lqAxvJxqpeYZ/fMHqVmJpIls0GY2/WrptHvV6G tDXXBIQR4g11X52raDutMwDpE3z80/mRPd/4BjP3aoZyNYoaJY7NSssLA9vyIMUm niuGKVbn/Wjys85/ctSHJnWjf+Z14+wVxSeH4GVqN16XId3msHzBZMyfKKE8bueW BtFFCslmPRLzfYzCFHuSc3Zm0GoP5ojhRp48uxra8VBoCDZOmIxA3Nxz3YQSz8xP hVLkZkODWqo4M4V4GoOKvey4CqXyMLrgf0FPwUoRlhjsXljslT794SvM/hOVxplt PXtyWRuECxLEqlNyx6p0ZEfsN1Wb2Xo2WMRmAgJiMkDsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1651307169; x=1651393569; bh=z Dht1KUoBQsbXmkhCkY2Mzl8Hp9Hocud9nuQ12H9mSI=; b=GsOZwQbLWY2DbYfvB sSjIjLtM+f+j00OIEAlEHDggl1peq/xY+Zoc+MYvXg7AtAer/lFPRb3FHU/jv8lz uh6F5CRaHwDapgTVPTCoLKqDVHudpZz+HWz7i5Rr7d5szPjHLMof/Gg463bS8IPp sRiw3lxg4Xjuhe1KrCqkexhufow45glqM10GaZu9gJc0ADgzxWpmWzd8YytCkd7M FIApGxDm6BkBMfIih7Ze04A6O/wbcRGx20Y0qS9xFpsJkMoPo98QhbOira6JljBb QZHy7ic0VkqgYQKnnZV0xkwlYHk+ZRdn5RvSI6XFFFh6CqO+tUVl7Sb1NmR9tN/4 Jurpg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddugddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgggfestdekredtre dttdenucfhrhhomheptehrnhhouhhtucfgnhhgvghlvghnuceorghrnhhouhhtsegsiiii thdrnhgvtheqnecuggftrfgrthhtvghrnhepkefgieehjeelheektedugeduueevjeevue dugeevleekjeefveeikefggeduveffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprghrnhhouhhtsegsiiiithdrnhgvth X-ME-Proxy: From: Arnout Engelen To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, kraxel@redhat.com Subject: [PATCH] hw/usb/hcd-ehci.c: print diagnostics when cpage out of range Date: Sat, 30 Apr 2022 10:25:56 +0200 Message-Id: <20220430082556.271627-1-arnout@bzzt.net> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=66.111.4.25; envelope-from=arnout@bzzt.net; helo=out1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 30 Apr 2022 10:29:03 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnout Engelen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1651328998959100001 Content-Type: text/plain; charset="utf-8" Making it easier to diagnose what is going on when it happens Signed-off-by: Arnout Engelen --- hw/usb/hcd-ehci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 33a8a377bd..8e2f6578c2 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -1195,6 +1195,11 @@ static int ehci_init_transfer(EHCIPacket *p) while (bytes > 0) { if (cpage > 4) { fprintf(stderr, "cpage out of range (%u)\n", cpage); + bytes =3D get_field(p->qtd.token, QTD_TOKEN_TBYTES); + offset =3D p->qtd.bufptr[0] & ~QTD_BUFPTR_MASK; + cpage =3D get_field(p->qtd.token, QTD_TOKEN_CPAGE); + fprintf(stderr, "reading %u bytes from offset %u at page %u\n", + bytes, offset, cpage); qemu_sglist_destroy(&p->sgl); return -1; } --=20 2.35.3