Date: Thu, 8 May 2014 13:45:16 +0200 From: =?UTF-8?Q?Bernhard_Fr=C3=B6hlich?= <decke@FreeBSD.org> To: "freebsd-usb@FreeBSD.org" <freebsd-usb@freebsd.org> Subject: xHCI driver in FreeBSD 10.0 causing interrupt storm in VirtualBox Message-ID: <CAE-m3X0KveSMod=tkXQ5Loeoi-NMP8y6YXzOo8xT66fG_yeJYg@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Hi guys, I just got a bugreport from a virtualbox developer who has noticed a problem with the xHCI driver in FreeBSD 10.0. The irc transcript follows to not loose any information from the analysis and how this could be addressed. (01:22:20 PM) MichalN: decke: I ran into a funny problem with the xHCI driver in FreeBSD 10.0. It only works if the host uses MSIs, but doesn't make sure. No such problem in 9.2. (01:23:28 PM) MichalN: It probably doesn't come up on physical hardware, or at least it'd require something fairly unusual (an old system with add-on xHCI adapter). michael-vb MichalN (01:23:39 PM) MichalN: But it's a problem in a virtualized environment :) (01:24:13 PM) MichalN: The default VirtualBox config doesn't do MSIs. (01:25:10 PM) klaus-vb: it emulates an old system ;) (01:25:26 PM) MichalN: The driver should either work (just like the 9.2 one does), or at least fail to load if it can't enable MSIs. As it is, it gets an interrupt storm. (01:25:38 PM) MichalN: (which FreeBSD duly detects and reports) (01:26:39 PM) MichalN: Actually if I can find it, I can point you at the code that was removed... (01:27:07 PM) klaus-vb: the standard vbox chipset can't do MSI. only the experimental ICH9 chipset code does MSI, and we generally don't test it much (01:27:52 PM) MichalN: Because there's not a huge advantage to MSIs in a virtualized environment, unlike physical systems. (01:29:47 PM) MichalN: OK, here's some older version of the code: http://www.leidinger.net/FreeBSD/dox/dev_usb/html/d0/d15/xhci_8c_source.html In function xhci_interrupt() the code writing the XHCI_IMAN_INTR_PEND bit was removed in 10.0. (01:30:51 PM) MichalN: For your background - the xHCI controller behaves slightly differently depending on whether MSIs are used or not. If not, that bit (called XHCI_IMAN_INTR_PEND in the FreeBSD driver) must be written to clear an interrupt. (01:31:22 PM) MichalN: If MSIs are used then it doesn't need to be done. It seems someone removed the code which was unconditional and unnecessary on systems with MSI. (01:31:31 PM) MichalN: But that breaks on systems with no MSI. (01:33:07 PM) MichalN: Basically it should still be done, but only conditionally if MSIs aren't used. Otherwise if the driver loads on a system which for whatever reason doesn't use MSIs for xHCI, it'll cause an interrupt storm. -- Bernhard Froehlich http://www.bluelife.at/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE-m3X0KveSMod=tkXQ5Loeoi-NMP8y6YXzOo8xT66fG_yeJYg>