From patchwork Tue Jun 6 13:14:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 9768885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A7C4660364 for ; Tue, 6 Jun 2017 13:17:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2F4728484 for ; Tue, 6 Jun 2017 13:17:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9502E284D2; Tue, 6 Jun 2017 13:17:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BC78428484 for ; Tue, 6 Jun 2017 13:17:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIEJx-0004pz-En; Tue, 06 Jun 2017 13:14:53 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIEJw-0004pN-P0 for xen-devel@lists.xen.org; Tue, 06 Jun 2017 13:14:53 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id A5/74-01732-BCAA6395; Tue, 06 Jun 2017 13:14:51 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDKsWRWlGSWpSXmKPExsXilM8iqXt6lVm kQftDFoslHxezODB6HN39mymAMYo1My8pvyKBNeNE82nGgoV6FS2XLrM0MM5W62Lk4hASWMUo seTNGsYuRk4gJ1ti2a4bLCAJFoFvLBKHFj5nAklICHhKvPxyhBHCdpa4fH4hG0T3BkaJi9fns IMkWARUJC7OPwNWxCYQLHF9yS9WEFtEQFmi99dvFhCbWcBOYt+vbWA1wgLJEoc27wfr5RXQkX g25xvU0O2MEpO/LGSFSAhKnJz5BKq5VOL91BdARRxAtrTE8n8cIGFOAXuJm09ugc0RBdq1+9Z e5gmMQrOQdM9C0j0LoRvCtJKY8CsdRRSkWF3iz7xLzBjC2hLLFr5mxlTiJXHvhjVE2FZi3br3 LAsYuVcxqhenFpWlFuma6CUVZaZnlOQmZuboGhoY6+WmFhcnpqfmJCYV6yXn525iBMYhAxDsY Gz84nSIUZKDSUmUV32qWaQQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCV4eYFwLCRalpqdWpGXmAB MCTFqCg0dJhPf6SqA0b3FBYm5xZjpE6hSjMceG1eu/MHHc6dvwhUmIJS8/L1VKnHczSKkASGl GaR7cIFiiusQoKyXMywh0mhBPQWpRbmYJqvwrRnEORiVhXoYVQFN4MvNK4Pa9AjqFCegUvksm IKeUJCKkpBoYXZen+OkdyvdmjVrbnP3q2dfFj6aeLr/K/9Y37fDVndNmsBuZ77ial/A/O/WGV U7MervCuaX3XXnlv7YprmlpsNbepOUvzrD09lGTCdoKlW7vA8pfv3o9W97rGztXxf+onK7muW eepdrlz5VVPNV9hNXKY/eC55OfZlob7Vj73WyhbdOFoCnxSizFGYmGWsxFxYkA5NwsUE8DAAA = X-Env-Sender: marmarek@invisiblethingslab.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1496754890!65762080!1 X-Originating-IP: [66.111.4.25] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTExLjQuMjUgPT4gNDQ5ODE=\n X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 58036 invoked from network); 6 Jun 2017 13:14:50 -0000 Received: from out1-smtp.messagingengine.com (HELO out1-smtp.messagingengine.com) (66.111.4.25) by server-6.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 6 Jun 2017 13:14:50 -0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 01CAE20789; Tue, 6 Jun 2017 09:14:50 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Tue, 06 Jun 2017 09:14:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=VMPTw/oZFmpUd6RLBf v6jqKHE/ORom1jlUX/JzgiG+o=; b=VJrymt0nB3B4U9urLziYcs+Q5vr/hlx9Gl hqpIYazOWkwTAzpgDHGIdt/h0D7p3oGk2HRzody3u6FHAaolmBxLLCFTX19iecPT ib1+swSe9jsVCsaeZngd69Ai9a03MBJIIAuXfipNs3yUdMJ8Ox4jEeWglhlDob+L 6hnBhRpnW0YFdyiCIhiDKhHcFsx5wCkEnryWE3/pgzQXTL/0pNBiHMxhuj1ayZhz D3r+gxTRqiH9MheRdVPENI79m8pIIS2NnRSEQ0TSq2B36hx4+VGO3OD9OJxKIMcw WnuQXvAvsIACaFUyPQeWgbT35dcfpL9PLjDybrrFIfUPHNqtQLaw== X-ME-Sender: X-Sasl-enc: lU70DjkP5jtkUnM0pDVVpCorhLw5ZFTiAvFBICQq04Az 1496754889 Received: from mail-itl (89-70-103-23.dynamic.chello.pl [89.70.103.23]) by mail.messagingengine.com (Postfix) with ESMTPA id 3BFFC24753; Tue, 6 Jun 2017 09:14:47 -0400 (EDT) Date: Tue, 6 Jun 2017 15:14:42 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: Jan Beulich Message-ID: <20170606131442.GG1335@mail-itl> References: <20170602105719.GK10404@mail-itl> <593685CD020000780015FAAA@prv-mh.provo.novell.com> <20170606104158.GE1335@mail-itl> <5936A638020000780015FC3D@prv-mh.provo.novell.com> MIME-Version: 1.0 In-Reply-To: <5936A638020000780015FC3D@prv-mh.provo.novell.com> User-Agent: Mutt/1.8.0 (2017-02-23) Cc: HW42 , xen-devel Subject: Re: [Xen-devel] PCI passthrough of USB controllers on Xen 4.8.1, Linux 4.9.29, stubdomain X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Jun 06, 2017 at 04:55:20AM -0600, Jan Beulich wrote: > >>> On 06.06.17 at 12:41, wrote: > > [root@dom0 ~]# lspci -s 00:14.0 -vvv > > 00:14.0 USB controller: Intel Corporation Wildcat Point-LP USB xHCI > > Controller (rev 03) (prog-if 30 [XHCI]) > > Subsystem: Intel Corporation Device 7270 > > Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- > > Stepping- SERR- FastB2B- DisINTx+ > > Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- > Latency: 0 > > Interrupt: pin A routed to IRQ 170 > > Region 0: Memory at b2200000 (64-bit, non-prefetchable) [size=64K] > > Capabilities: [70] Power Management version 2 > > Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0-,D1-,D2-,D3hot+,D3cold+) > > Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME- > > Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+ > > Address: 00000000fee00338 Data: 0000 > > So as I did expect the field accessed is the MSI capability structure. > Such accesses shouldn't reach pciback, but instead be taken care > of by qemu. I can't really comment on the qemu side though, but > this at least makes me think the underlying cause of the problems > you see with the two controllers is the same. > > Is this a regression of some sort, i.e. did the same setup work in > earlier Xen versions? This was working with pure PV, but this is probably irrelevant here. I can't test if switching only Xen version changes anything (that would require a lot of recompiling), but very similar setup with mini-os based stubdom on Xen 4.6.5 and Xen 4.8.1 also doesn't work. Even with a qemu patch disabling MSI reporting (attached). In that case, I don't get any message from qemu, but very similar messages from xhci driver. BTW Other patches: https://github.com/QubesOS/qubes-vmm-xen/tree/xen-4.8/patches.misc I've also checked Xen 4.8.1 with qemu-upstream in dom0 (instead of Linux-based stubdom) and it also doesn't work, but with slightly different messages: qemu: [00:05.0] Write-back to unknown field 0xd8 (partially) inhibited (0x00000000) [00:05.0] If the device doesn't work, try enabling permissive mode [00:05.0] (unsafe) and if it helps report the problem to xen-devel [00:06.0] Write-back to unknown field 0x6c (partially) inhibited (0x00000000) [00:06.0] If the device doesn't work, try enabling permissive mode [00:06.0] (unsafe) and if it helps report the problem to xen-devel Linux in domU: [ 51.679188] xhci_hcd 0000:00:05.0: Error while assigning device slot ID [ 51.679264] xhci_hcd 0000:00:05.0: Max number of devices this xHCI host supports is 32. [ 51.679359] usb usb1-port2: couldn't allocate usb_device (and nothing about ehci, no devices connected to it is visible) --- a/tools/qemu-xen-traditional/hw/pass-through.c 2016-10-31 12:48:42.924026468 -0400 +++ b/tools/qemu-xen-traditional/hw/pass-through.c 2016-10-31 12:50:52.953026468 -0400 @@ -874,6 +874,10 @@ .grp_size = 0x04, .size_init = pt_reg_grp_size_init, }, +#ifndef CONFIG_STUBDOM + /* At present stubdom doesn't support MSI for passthrough, so let's not + * expose MSI capability to stubdom HVM guest for now. + */ #ifndef __ia64__ /* At present IA64 Xen doesn't support MSI for passthrough, so let's not * expose MSI capability to IA64 HVM guest for now. @@ -886,7 +890,8 @@ .size_init = pt_msi_size_init, .emu_reg_tbl= pt_emu_reg_msi_tbl, }, -#endif +#endif /* __ia64__ */ +#endif /* !CONFIG_STUBDOM */ /* PCI-X Capabilities List Item reg group */ { .grp_id = PCI_CAP_ID_PCIX, @@ -931,6 +936,10 @@ .size_init = pt_pcie_size_init, .emu_reg_tbl= pt_emu_reg_pcie_tbl, }, +#ifndef CONFIG_STUBDOM + /* At present stubdom doesn't support MSI for passthrough, so let's not + * expose MSI-X capability to stubdom HVM guest for now. + */ #ifndef __ia64__ /* At present IA64 Xen doesn't support MSI for passthrough, so let's not * expose MSI-X capability to IA64 HVM guest for now. @@ -943,7 +952,8 @@ .size_init = pt_msix_size_init, .emu_reg_tbl= pt_emu_reg_msix_tbl, }, -#endif +#endif /* __ia64__ */ +#endif /* !CONFIG_STUBDOM */ { .grp_size = 0, },