-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable PCIe hotplug in dom0 #6620
Comments
Do you have links to Xen discussions re: change in security posture regarding thunderbolt and/or PCIe hotplug? Personally I want this...but only if reasonably safe. |
Historically Xen assigned all new devices to dom0 by default (at least IOMMU-wise). Since XSA-302, it gained a quarantine IOMMU domain support, which should (theoretically) be used instead. This indeed should make it reasonably safe to re-enable PCI hotplug, What remains to be done is:
|
It sounds like enabling this would still be a non-zero increase in security risk, since the intended safety mechanism is yet another thing that could fail in unexpected ways, so shouldn't this be opt-in rather than enabled by default for everyone? |
The decision to disable PCI hotplugging is at: #1673 #3245 is also related, since dom0 kernel is also used in AppVMs by default. From #3245 (comment):
This issue is a duplicate of an issue I have previously reported, which also happens to be among one of the GitHub issues that disappeared a while ago. 😓 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I am using a thunderbolt 4 docking station through which I connect my external displays. These wont be recognized (via xrandr) unless they are cold plugged (at boot). Is this issue (6620) the root cause? And are there possible workarounds known that are maybe specific to external displays connected via TB4? |
Yes, this issue is the root cause. If there is a workaround it would be a bug. For me the workaround was to use a non-thunderbolt old-style Thinkpad Ultra dock, it is working fine with Qubes. |
Thank you. But unfortunately it seems that this is no option for me as I have not found a non-thunderbolt docking station with 130 W power supply over USB-C. |
I wonder now if using a custom kernel with CONFIG_HOTPLUG_PCI =y would be acceptable in my case despite the risk described above and in #1673. These risks only apply to my settings to a limited extent: Firewire and expresscard are something I do not need to worry about. And as described in https://www.kernel.org/doc/html/latest/admin-guide/thunderbolt.html security levels can be defined for TB. In my case, I have already TB restricted to only video and usb via the bios. |
Will this ever be resolved in future updates? |
Is this still an issue? I thought it would be and wanted to build a custom ISO, but in the sources i saw it as enabled, so i decided to just try the official ISO, and well thunderbolt hotplug works fine! I really hope i didn't just ruin my own usecase and it was actually changed on purpose! |
what build was that? just tested 4.2.0-rc3 and |
Some other users report thunderbolt to be working as well. So I wonder whether |
@3hhh it works if you plug in the device (e.g. a dock) before boot; that is not hotplug, however. I don't think anyone reported PCI hotplug to work, including in the thread you linked. |
On 1/13/24 09:51, UndeadDevel wrote:
@3hhh it works if you plug in the device (e.g. a dock) before boot; that is not hotplug, however. I don't think anyone reported PCI hotplug to work, including in the thread you linked.
Ah, ok I see. Yes, that should always have worked I guess.
|
It’s a security issue in either their firmware or how their firmware is configured. |
Granted this was a while ago, but in my testing it worked as a hotplug, so plugging in after booting! |
Interesting! |
Is there any guide/forum post to replicate? I'd love my eGPU to hotplug |
@marmarek: did your testing trust the log output from Xen or dom0, or did it actually try to perform a PCI DMA transaction and see if the operation succeeded? |
Chiming in as another user who desperately needs this feature. I'm a software engineer and AI has become an important part of the skillset. Rather than ship all my keystrokes off to OpenAI/Microsoft, I'd like to be able to run a LLM locally. I want to attach a TH3P4 eGPU to my laptop, but something about the boot process makes it always reset. Then the lack of hotplug means that I never actually get to see it. If there isn't a workaround, I'm probably going to be forced to switch off of Qubes due to the importance of AI-based workflows 😢 |
There aren't any workarounds in R4.2, but there is a hope for some (even partial) support in R4.3. Partial means it isn't going to be fully security supported, but I hope to get it working at least for trusted devices. I'll update this ticket when I get some new information and/or something in testable state. |
Will a fully supported solution need to wait until R4.4? |
It isn't a question whether it "needs" to wait. It's a question how much we will manage in time for R4.3. I would be more than happy to get everything working perfectly in R4.3 (or, even better - yesterday!), but I try to be realistic. |
What makes this more complex? |
Will this be any help for Asus kernel modules such as asus-nb-wmi that rely on PCI hotplug? (See #5453). Currently these systems have no thermal controls. A user on the forums wahcha ended up cutting wires to keep fans at 100%. |
There is related development in Xen - PV-IOMMU: https://lore.kernel.org/xen-devel/e80bf868a009425c03ce4589bf8af09fb147a6e3.1737470269.git.teddy.astie@vates.tech/ Currently patches are at RFC stage (but v5 already), and quite a few parts are still missing. It won't make it into Xen 4.20 for sure, so it's also unlikely to land in Qubes OS 4.3. But maybe Qubes OS 4.4... |
The problem you're addressing (if any)
PCIe hotplug is currently disabled in dom0. This causes breakage on some laptops and prevents Thunderbolt from being used, even though a Thunderbolt eGPU on recent hardware is the most secure method I know of to get hardware-accelerated graphics in a qube.
Describe the solution you'd like
We should enable PCIe hotplug in dom0.
Where is the value to a user, and who might that user be?
Many users, including our own @fepitre.
Describe alternatives you've considered
None
Additional context
Previously, having PCIe hotplug enabled in the dom0 kernel was considered a security risk, but Xen developers have indicated that it is not.
Relevant documentation you've consulted
Related, non-duplicate issues
#4353, #5522, #5453
The text was updated successfully, but these errors were encountered: