From patchwork Fri Jun 24 15:29:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: MkfsSion X-Patchwork-Id: 12894778 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5147C433EF for ; Fri, 24 Jun 2022 15:37:54 +0000 (UTC) Received: from localhost ([::1]:57206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4lNZ-00011J-U0 for qemu-devel@archiver.kernel.org; Fri, 24 Jun 2022 11:37:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4lFx-0001QY-VL for qemu-devel@nongnu.org; Fri, 24 Jun 2022 11:30:07 -0400 Received: from mail-108-mta163.mxroute.com ([136.175.108.163]:44567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4lFw-0006nn-5F for qemu-devel@nongnu.org; Fri, 24 Jun 2022 11:30:01 -0400 Received: from filter006.mxroute.com ([140.82.40.27] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta163.mxroute.com (ZoneMTA) with ESMTPSA id 181965584fe00028a7.002 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Fri, 24 Jun 2022 15:29:55 +0000 X-Zone-Loop: 52f4a36c54376147bc758100411fcd25b96cb12feae3 X-Originating-IP: [140.82.40.27] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mkfssion.com; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=EqNlKr6yIv9MTP6XJewjMRBR6Y+N7XbK9fI0jnMDGvY=; b=dR8ALRFhWZcQAyE4Guc2FuaoaM Xz+YX1W59zSB2cbDoahwIhKCYJVwNr+0mGvE7WnYwd2uV6tmT2N86vhEgKbW85vifDh4OuXTYyscu mACZ8LiYV3f7sVo+3voOdrvxzcvfcykJGP5Jc8Xm/F7p+ItggbrqhvEloH5Bb4mP1K5wWOL3Tetu9 ZqT1b3D+f6rOl7ie0govMENqUe48nRvn9hMgT/RgZ/AKoyWnsl2bu9qGEts0017EbIBFT/piuEAi7 VWjmuCi8v3jETwn/1KfIp1PPmS8qAJ2Z/9DBGx7Y32jxFWUNfHmfovDzoAFtCTqzBMugg61Os6724 +vSeykjg==; From: MkfsSion To: qemu-devel@nongnu.org Cc: MkfsSion , Hongren Zheng , "Canokeys.org" , Gerd Hoffmann Subject: [PATCH v3 1/2] hw: canokey: Remove HS support as not compliant to the spec Date: Fri, 24 Jun 2022 23:29:39 +0800 Message-Id: <20220624152940.11756-1-mkfssion@mkfssion.com> MIME-Version: 1.0 X-AuthUser: mkfssion@mkfssion.com Received-SPF: pass client-ip=136.175.108.163; envelope-from=mkfssion@mkfssion.com; helo=mail-108-mta163.mxroute.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Canokey core currently using 16 bytes as maximum packet size for control endpoint, but to run the device in high-speed a 64 bytes maximum packet size is required according to USB 2.0 specification. Since we don't acutally need to run the device in high-speed, simply don't assign high member in USBDesc. When canokey-qemu is used with xhci, xhci would drive canokey in high speed mode, since the bcdUSB in canokey-core is 2.1, yet canokey-core set bMaxPacketSize0 to be 16, this is out of the spec as the spec said that ``The allowable maximum control transfer data payload sizes...for high-speed devices, it is 64 bytes''. In this case, usb device validation in Windows 10 LTSC 2021 as the guest would fail. It would complain USB\DEVICE_DESCRIPTOR_VALIDATION_FAILURE. Note that bcdUSB only identifies the spec version the device complies, but it has no indication of its speed. So it is allowed for the device to run in FS but comply the 2.1 spec. To solve the issue we decided to just drop the high speed support. This only affects usb-ehci as usb-ehci would complain speed mismatch when FS device is attached to a HS port. That's why the .high member was initialized in the first place. Meanwhile, xhci is not affected as it works well with FS device. Since everyone is now using xhci, it does no harm to most users. Suggested-by: Hongren (Zenithal) Zheng Signed-off-by: YuanYang Meng --- hw/usb/canokey.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/usb/canokey.c b/hw/usb/canokey.c index 4a08b1cbd7..6a7ab965a5 100644 --- a/hw/usb/canokey.c +++ b/hw/usb/canokey.c @@ -56,7 +56,6 @@ static const USBDesc desc_canokey = { .iSerialNumber = STR_SERIALNUMBER, }, .full = &desc_device_canokey, - .high = &desc_device_canokey, .str = desc_strings, }; From patchwork Fri Jun 24 15:29:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: MkfsSion X-Patchwork-Id: 12894777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D6BAC43334 for ; Fri, 24 Jun 2022 15:35:09 +0000 (UTC) Received: from localhost ([::1]:50832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4lKu-000578-Eg for qemu-devel@archiver.kernel.org; Fri, 24 Jun 2022 11:35:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4lG9-0001SL-Bf for qemu-devel@nongnu.org; Fri, 24 Jun 2022 11:30:30 -0400 Received: from mail-108-mta59.mxroute.com ([136.175.108.59]:39483) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4lG5-00070F-Ar for qemu-devel@nongnu.org; Fri, 24 Jun 2022 11:30:12 -0400 Received: from filter006.mxroute.com ([140.82.40.27] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta59.mxroute.com (ZoneMTA) with ESMTPSA id 1819655a06f00028a7.002 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Fri, 24 Jun 2022 15:30:02 +0000 X-Zone-Loop: 7cc4fc9f498b7867da8e3660535ba7614f07845bbb9e X-Originating-IP: [140.82.40.27] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mkfssion.com; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=D/L+rnq3I2UGzCJ7SyG/6kCfp0/pJJkFapA28LRXtNM=; b=VGMj22cdq0vY6+7AnKqoZvp0M/ DlCzO2bUxd9nOr4hklfTQ1M2iMlor2DuRcWMvWoIKrEWZw+4uDAetmFByLVNUyZfSopZ2RM/5FmWP DG43tmJ01I4WEV5Aq0+DsYyiNFExNhK+rCpkFBvkZCfZRT9jInXKlOUOC2pfYOWQEP88JhezJKQLj QOHpv4QOOHazIZC2NWDdQdLx0FLMDEap4VlJGfn67QrgDQ/z8FZc1skEy7ah0pXDNtVs24v4DTzxS yD3ackTWgmdkBLGOp7LRteX02jZ64thg3do1l3M1PYbQVT7r6VcVkrIgmgScqo9Yk7fZFQHiVw7+Z 3F0bCbXA==; From: MkfsSion To: qemu-devel@nongnu.org Cc: MkfsSion , Hongren Zheng , "Canokeys.org" Subject: [PATCH v3 2/2] docs/system/devices/canokey: Document limitations on usb-ehci Date: Fri, 24 Jun 2022 23:29:40 +0800 Message-Id: <20220624152940.11756-2-mkfssion@mkfssion.com> In-Reply-To: <20220624152940.11756-1-mkfssion@mkfssion.com> References: <20220624152940.11756-1-mkfssion@mkfssion.com> MIME-Version: 1.0 X-AuthUser: mkfssion@mkfssion.com Received-SPF: pass client-ip=136.175.108.59; envelope-from=mkfssion@mkfssion.com; helo=mail-108-mta59.mxroute.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Suggested-by: Hongren (Zenithal) Zheng Signed-off-by: YuanYang Meng --- docs/system/devices/canokey.rst | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/docs/system/devices/canokey.rst b/docs/system/devices/canokey.rst index 169f99b8eb..650702ad8a 100644 --- a/docs/system/devices/canokey.rst +++ b/docs/system/devices/canokey.rst @@ -146,15 +146,9 @@ multiple CanoKey QEMU running, namely you can not Also, there is no lock on canokey-file, thus two CanoKey QEMU instance can not read one canokey-file at the same time. -Another limitation is that this device is not compatible with ``qemu-xhci``, -in that this device would hang when there are FIDO2 packets (traffic on -interrupt endpoints). If you do not use FIDO2 then it works as intended, -but for full functionality you should use old uhci/ehci bus and attach canokey -to it, for example - -.. parsed-literal:: - - |qemu_system| -device piix3-usb-uhci,id=uhci -device canokey,bus=uhci.0 +Another limitation is that this device is not compatible with ``usb-ehci`` +since we removed high-speed mode support. When a full-speed device attach +to a high-speed port, ``usb-ehci`` would complain about speed mismatch. References ==========