From nobody Wed Jan 8 19:55:27 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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 ARC-Seal: i=1; a=rsa-sha256; t=1733685531; cv=none; d=zohomail.com; s=zohoarc; b=HnvBpVhMCeep89pmyU3+iuHXHd9j1IMiAVHNrfDaXSiNC4flLZd41ueChs3a97kh4QT8m+r4cg3HaTNPPvqOartdrdYk/7eZaNqO+m83LWSTl9fM8M9HKA83gnDX5yFVSU6NeVGuu9QgR9iqjkLIpNFS9O6fgP8dTymXlE8g3Bg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733685531; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=acRq5wtuEZY6qfWLgIt8kj488PEzJr2oq6KQkbWz1tc=; b=hGkcRJ2+NAXPAV3/NyLG91Jx2j6moYcrDcVMm2gnaJf9YMulBrhYD7X35/POMEF+SD+dairuEer6EBTeCYucvN8UDsZYk39dCHYqo6ARs5pD55e/ECo6PbgT8VFSkXA8DffZ4cSG49jQHYgJpS735d6hDLB0tV9BlNIMCdMg3xM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1733685531245526.3014340147683; Sun, 8 Dec 2024 11:18:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKMmw-0005LG-Jz; Sun, 08 Dec 2024 14:17:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKMmn-0005JN-Kf for qemu-devel@nongnu.org; Sun, 08 Dec 2024 14:17:49 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKMml-0001W4-Mh for qemu-devel@nongnu.org; Sun, 08 Dec 2024 14:17:45 -0500 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-aa5ec8d6f64so419952366b.2 for ; Sun, 08 Dec 2024 11:17:43 -0800 (PST) Received: from localhost.localdomain (h082218084190.host.wavenet.at. [82.218.84.190]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa665119a06sm240350866b.121.2024.12.08.11.17.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 08 Dec 2024 11:17:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philjordan-eu.20230601.gappssmtp.com; s=20230601; t=1733685462; x=1734290262; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=acRq5wtuEZY6qfWLgIt8kj488PEzJr2oq6KQkbWz1tc=; b=S+wy0mgvIYaKjcW+j+MllyZmeGgpkZ0Y04Png2xNe2EC6rBlFk09lB14hw40EvV0Ps NhIz00gKoVeLwo4HRRnk63G0MPjVSOc/mdOtcDeHcCXJZJyr6K/c8UQZdV+CryABZuM6 oN6e6xemcpNIAutEnL6IrGGQYcPeVpMxRZBtKzVc7Mz4+4MYcEiohmq57VK13E9NbRlS MV6TxoVu69hP+ciYy1nDnbrhKxY/sqsLZV8GhDMwWBPUqsQn5dx5K0UIjsSxN2K4Ffrx +RqZde41T4oma+V/a3gptBgpfDdNnUNU/dMG55K/w+XuhP7RG0Z4gMAbWlVMagcTyDN6 Oopw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733685462; x=1734290262; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=acRq5wtuEZY6qfWLgIt8kj488PEzJr2oq6KQkbWz1tc=; b=DhQlHFAJPKfsIsgS+fP5UdPJPTqPFmvYtbu3hSuC9d2ldmPST1Vu2qUhwe+pwAUay0 +GFzqJcyTOvLXCC/Q5xo4BLf2I8ZTpS6yFt3XbdCkc1fKHrgNw38OzOG3OaOtq1J0PYW jIQDNjPmaEQJCrVcIPqW7VOZ/FXruZ5Q0ICm7U8+JaNOpTdfsW24S8D5+O1z+L3qIiBt 0mU1BOk9voSV/97e8Sg5eqUrt2xKlLoXeRJK6LGhLRcF9rJjY1tT/6aQJif9Rw7EWxKC r5Mc2tYM48iwKgvZbU34smwEEue8Ngu78tGqcf4LzK2xdLwNkLnNpw7UrXZSq5eZaMq/ 62AQ== X-Gm-Message-State: AOJu0YyjHQFlJ3RZRhwvRPWa6cqkyGfaaY2WHDkA+sDMYrF9nMNgPItH gkaWA02aC9iH3mIvKmVh3yzgtqMBQNbIy9PW+4rvDE2nV0ZVJKvqe29wz0XMG7hxcJLPhmpbPsX I7g== X-Gm-Gg: ASbGncucUnU+cSZ7TJx9vfQ8KDmpoHuiV43tbJ4mE4UBPtg4r7aO1VIBd3JRBFpqsV0 yDCJRAVFYodqNaCvgF1lTTwuMkBvpvb/yAZymTAYSEld5HyPgYIdse0/2XptcpYRZbLBTU2MHA0 Qlu8jy5lNw+e7DD/cucNt8PuzEJ0m4dwIaoChs18r8WFU+1/9C6BAq0n3LirfDk4yrbucQxS8O6 /xK84qWmCVl7WrwmSHM8a/WNgT5SqSfKlNo3uanvlyUx8oY2VRz76apoVkIkIsj1wBYW/B9mQJg 9NbSslI4ohdhjP1l6yXiQSOKN4GC+w== X-Google-Smtp-Source: AGHT+IGiIKJIihXmyHTChh917c1Js0pVeG9Vf7NWwWydHbDw8oXp8Wa42Js7HH3AC2SINkgrEZoLzQ== X-Received: by 2002:a05:6402:2806:b0:5d0:c7a7:ac13 with SMTP id 4fb4d7f45d1cf-5d3be744ef2mr28005883a12.34.1733685462163; Sun, 08 Dec 2024 11:17:42 -0800 (PST) From: Phil Dennis-Jordan To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, philmd@linaro.org, thuth@redhat.com, zhao1.liu@intel.com, imammedo@redhat.com, akihiko.odaki@daynix.com, Phil Dennis-Jordan Subject: [PATCH 3/6] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported. Date: Sun, 8 Dec 2024 20:16:43 +0100 Message-Id: <20241208191646.64857-4-phil@philjordan.eu> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20241208191646.64857-1-phil@philjordan.eu> References: <20241208191646.64857-1-phil@philjordan.eu> 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: neutral client-ip=2a00:1450:4864:20::62a; envelope-from=phil@philjordan.eu; helo=mail-ej1-x62a.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @philjordan-eu.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1733685533556116600 Content-Type: text/plain; charset="utf-8" The XHCI specification, section 4.17.1 specifies that "If Interrupter Mapping is not supported, the Interrupter Target field shall be ignored by the xHC and all Events targeted at Interrupter 0." QEMU's XHCI device has so far not specially addressed this case, so we add a check to xhci_event() to redirect to event ring and interrupt 0 if mapping is disabled. Signed-off-by: Phil Dennis-Jordan --- hw/usb/hcd-xhci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index d85adaca0dc..5fb140c2382 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -644,6 +644,10 @@ static void xhci_event(XHCIState *xhci, XHCIEvent *eve= nt, int v) dma_addr_t erdp; unsigned int dp_idx; =20 + if (xhci->numintrs =3D=3D 1) { + v =3D 0; + } + if (v >=3D xhci->numintrs) { DPRINTF("intr nr out of range (%d >=3D %d)\n", v, xhci->numintrs); return; --=20 2.39.5 (Apple Git-154)