From nobody Tue Feb 10 12:59:49 2026 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=1731036678; cv=none; d=zohomail.com; s=zohoarc; b=bqjapzGnVCYHeXdQ4p4CWlcyt+gVWCNoFghd09PNPxOsczk/i6K1GT7cWHUBxVOHAX07ngqe56RBM0nE95mNMPBaVqTzuzj6xVbPkukm850Hr9d+jk75Zl+u+a189cA5G9jJ1YJEjvw8XhAlXl84iHTqET4j2nzA4xm1dXD7L80= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731036678; 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=YdDTOzE8Etes0rYL2f7MFCzF5u0h8F5dwae5lb252JU=; b=NiJLGhGt47MLdDeRHo6cYdgHxsR4hF5DbcngtJD0W8Zf5pRJ+adFf85r9yl5rTDsUXluVLu7agMf3kBIRGSyg63XI+LqEQrZi8srviU/jhJeVmdGJavROs6y7whlxGt4XAYDf7ipnpL8IxAsX224hY3LwVGdQKLszqYD8cKQiso= 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 1731036678389741.2026174088011; Thu, 7 Nov 2024 19:31:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9Fhq-000064-L5; Thu, 07 Nov 2024 22:30:42 -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 1t9Fho-000055-2L for qemu-devel@nongnu.org; Thu, 07 Nov 2024 22:30:40 -0500 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t9Fhm-0001JV-Hz for qemu-devel@nongnu.org; Thu, 07 Nov 2024 22:30:39 -0500 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-7180f2f5fb0so1136840a34.1 for ; Thu, 07 Nov 2024 19:30:35 -0800 (PST) Received: from ThinkPad-T14-hirose.hq.igel.co.jp (napt.igel.co.jp. [219.106.231.132]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7f41f65d358sm2326435a12.84.2024.11.07.19.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 19:30:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20230601.gappssmtp.com; s=20230601; t=1731036634; x=1731641434; 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=YdDTOzE8Etes0rYL2f7MFCzF5u0h8F5dwae5lb252JU=; b=YMubqQ1y39AuCwtzlCbTGMxEwO6JHeShtvkXMwj1Weh6Yjcnj6yRJBd2tJhIo985LR Je6q7OVAkbmSfm+HuJPaxGP76x3eOXVuUcuNebUnoykbsJ/KxNp97uAVMJRGInOsIOfJ trYjCBGleBuxbUNEHe6gbQwOf9GuSWHtHjUfcrB/1pJxGsshzh/wRL1HhUUmqAVZ0W3H tlFrgVQsjlvRIPQl67oTo4Cpnpv6NRDkNPfI6SN/2Zrx4UocyceFHv2M+3lngC42sr6K 7CNpJB/52TF8k75ybrLBS8CrQeEFaktUyD1tFOXu2Dyf3UVIFNS3zwmXWMsl4MaExbEs ahVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731036634; x=1731641434; 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=YdDTOzE8Etes0rYL2f7MFCzF5u0h8F5dwae5lb252JU=; b=JxHQobjRLonqyRJBUxn+vrFxIBp8w78WxKkWS/QEt+mdLcKzM65E3rJkpLHBhjKzrM 3iLxnUXfePGptph0iSJ383elcNeR4zCuCA6ck9Qzx8ZjnJCtnjIgK09WIgihe3vCOvSD pzfM4CX8jFXFwQpxxpvFa91+NXxnoyMGRZGEyzc2ouap9CSnd0X1+1/51sQB5fimgaXO Llg89knGLQkTBV1yi+IvbMfsUPvitx9cr/ADTIZdS4+UbPsgV7BYr/0NCyJvf1PMJCeA woHgDi4IqAr3ewW5I97Bmcteny2xBKF1hOdxZOFPMx/GR305qglNb3aHqaXTOmLFeO5b OqKA== X-Gm-Message-State: AOJu0Yzb5JFM1SIFCPWrxCZ/aJoc/QhLSlacGD9secdNmd6rtSr0g9GK IOt/6coih+dKtQGUAPWnwlFHceubrxXfbWDTWRfFuO5HQtm7IqwRscaIdhGiVDbea7AkvFRmSpI zxFw= X-Google-Smtp-Source: AGHT+IEXu0s1GY0UffiljTFVCGJoqox2Xl6bnTZv3GnKuobp6H4w0dAo/HfduPYWhQcb6kU2n/iI4w== X-Received: by 2002:a05:6830:40c1:b0:718:2eb7:4ebe with SMTP id 46e09a7af769-71a1c28462cmr1871399a34.27.1731036634271; Thu, 07 Nov 2024 19:30:34 -0800 (PST) From: Tomoyuki HIROSE To: qemu-devel@nongnu.org Cc: Tomoyuki HIROSE Subject: [RFC PATCH 5/5] hw/usb/hcd-xhci: allow unaligned access to Capability Registers Date: Fri, 8 Nov 2024 12:29:49 +0900 Message-ID: <20241108032952.56692-6-tomoyuki.hirose@igel.co.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241108032952.56692-1-tomoyuki.hirose@igel.co.jp> References: <20241108032952.56692-1-tomoyuki.hirose@igel.co.jp> 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=2607:f8b0:4864:20::335; envelope-from=tomoyuki.hirose@igel.co.jp; helo=mail-ot1-x335.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_PASS=-0.001 autolearn=ham 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 @igel-co-jp.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1731036680023116600 Content-Type: text/plain; charset="utf-8" According to xHCI spec rev 1.2, unaligned access to xHCI Host Controller Capability Registers is not prohibited. In addition, the limit of access size is also unspecified. Actually, some real devices allow unaligned access and 8-byte access to these registers. This commit makes it possible to unaligned access and 8-byte access to Host Controller Capability Registers. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/143 Signed-off-by: Tomoyuki HIROSE --- hw/usb/hcd-xhci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index d85adaca0d..f35cbe526f 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3165,9 +3165,11 @@ static const MemoryRegionOps xhci_cap_ops =3D { .read =3D xhci_cap_read, .write =3D xhci_cap_write, .valid.min_access_size =3D 1, - .valid.max_access_size =3D 4, + .valid.max_access_size =3D 8, + .valid.unaligned =3D true, .impl.min_access_size =3D 4, .impl.max_access_size =3D 4, + .impl.unaligned =3D false, .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 --=20 2.43.0