On 4/14/20 4:07 PM, Marek Marczykowski-Górecki wrote:
On Tue, Apr 14, 2020 at 03:56:47PM -0600, Jim Fehlig wrote:
> On 4/13/20 1:17 PM, Marek Marczykowski-Górecki wrote:
>> FWIW, in Qubes we have a patches adding e820_host setting here:
>>
https://github.com/QubesOS/qubes-core-libvirt/
>> (patches 8-11)
>> Not submitted before, exactly to avoid adding temporary options. But
>> since 8+ years later it is still there, I think it's safe to assume it
>> will be there for some more. Or at least it's worth to unbreak some
>> configurations in the meantime.
>
> BTW, the other piece of the puzzle for PCI passthrough starting with xen
> 4.13 is the xl.cfg 'passthrough' option. See xen commit babde47a3fe. Without
> that enabled, hotplugging a PCI device to an HVM or PV domain is not
> possible, with or without e820_host. AFAICT there are no patches in your
> queue for the 'passthrough' option. Perhaps you haven't rebased to xen
4.13.
TBH, I don't do PCI hotplugging.
Lucky you :-).
> Do you have any thoughts on modeling that option?
>
> My thoughts are adding another xen hypervisor feature (similar to e820_host)
> or map it to the new IOMMU device in libvirt [1]. I suppose it depends on
> the need to support the {sync,share}_pt values vs a simple enable/disable.
> If enabling and disabling passthrough is enough, I'd lean towards another
> xen hypervisor feature. Otherwise we'll need to explore the IOMMU device?
Isn't IOMMU device about allowing the guest to control (v)IOMMU? I've seen
some discussion about it in context of Xen, so IMO we should not use it
now for something else.
What about adding <controller type='pci'/> ?
I'm not sure about {sync,share}_pt, but probably could be squeezed there
if needed.
I suppose adding a PCI controller is one way of configuring the guest to later
hotplug PCI devices, although I'm not sure if (sync,share}_pt could be
considered attributes of a PCI controller. Also, xen has no notion of a PCI
controller that I'm aware of, so it would only exist in libvirt. It seems like a
heavy-weight approach for a setting that essentially enables or disables PCI
passthrough.
Daniel, do you have any ideas about modeling the xl.cfg(5) 'passthrough' option?
For convenience, see 'passthrough' under "Other Options"
https://xenbits.xen.org/docs/unstable/man/xl.cfg.5.html#Other-Options
Regards,
Jim