Re: Virtio-IOMMU interrupt remapping design

2025-06-17 Thread Jason Gunthorpe
On Tue, Jun 17, 2025 at 04:01:53PM -0400, Michael S. Tsirkin wrote: > > On x86 you also need to use remapping to exceed the max CPU count that > > can be encoded in the MSI, no iommu required to need this. > > More of an x86 quirk though, isn't it? Yes, but so is bundling IOMMU and remapping HW t

Re: Virtio-IOMMU interrupt remapping design

2025-06-17 Thread Michael S. Tsirkin
On Tue, Jun 17, 2025 at 04:57:20PM -0300, Jason Gunthorpe wrote: > On Tue, Jun 17, 2025 at 03:44:20PM -0400, Michael S. Tsirkin wrote: > > On Mon, Jun 16, 2025 at 10:20:31AM -0300, Jason Gunthorpe wrote: > > > On Sun, Jun 15, 2025 at 02:47:15PM -0400, Demi Marie Obenour wrote: > > > > > > > Is a p

Re: Virtio-IOMMU interrupt remapping design

2025-06-17 Thread Jason Gunthorpe
On Tue, Jun 17, 2025 at 03:44:20PM -0400, Michael S. Tsirkin wrote: > On Mon, Jun 16, 2025 at 10:20:31AM -0300, Jason Gunthorpe wrote: > > On Sun, Jun 15, 2025 at 02:47:15PM -0400, Demi Marie Obenour wrote: > > > > > Is a paravirtualized IOMMU with interrupt remapping something that makes > > > se

Re: Virtio-IOMMU interrupt remapping design

2025-06-17 Thread Michael S. Tsirkin
On Sun, Jun 15, 2025 at 02:47:15PM -0400, Demi Marie Obenour wrote: > Virtio-IOMMU interrupt remapping turned out to be much harder than I > realized. The main problem is that interrupt remapping is set up > very early in boot. In fact, Linux calls the interrupt remapping probe > function from th

Re: Virtio-IOMMU interrupt remapping design

2025-06-17 Thread Michael S. Tsirkin
On Mon, Jun 16, 2025 at 10:20:31AM -0300, Jason Gunthorpe wrote: > On Sun, Jun 15, 2025 at 02:47:15PM -0400, Demi Marie Obenour wrote: > > > Is a paravirtualized IOMMU with interrupt remapping something that makes > > sense? > > IMHO linking interrupt remapping to the iommu is a poor design, > in

Re: Virtio-IOMMU interrupt remapping design

2025-06-16 Thread Jason Gunthorpe
On Mon, Jun 16, 2025 at 12:53:40PM -0400, Demi Marie Obenour wrote: > > AFAIK hyperv shows how to build something like this. > Would this need KVM patches? I'm concerned that implementing this > in userspace would interact badly with the irqfd fast path. I don't know. I think you get the same is

Re: Virtio-IOMMU interrupt remapping design

2025-06-16 Thread Demi Marie Obenour
On 6/16/25 09:20, Jason Gunthorpe wrote: > On Sun, Jun 15, 2025 at 02:47:15PM -0400, Demi Marie Obenour wrote: > >> Is a paravirtualized IOMMU with interrupt remapping something that makes >> sense? > > IMHO linking interrupt remapping to the iommu is a poor design, > interrupt routing belongs in

Re: Virtio-IOMMU interrupt remapping design

2025-06-16 Thread Jason Gunthorpe
On Sun, Jun 15, 2025 at 02:47:15PM -0400, Demi Marie Obenour wrote: > Is a paravirtualized IOMMU with interrupt remapping something that makes > sense? IMHO linking interrupt remapping to the iommu is a poor design, interrupt routing belongs in the irq subsystem, not in the iommu. The fact AMD a

Virtio-IOMMU interrupt remapping design

2025-06-15 Thread Demi Marie Obenour
Virtio-IOMMU interrupt remapping turned out to be much harder than I realized. The main problem is that interrupt remapping is set up very early in boot. In fact, Linux calls the interrupt remapping probe function from the APIC initialization code: x86_64_probe_apic -> enable_IR_x2apic -> irq_rem