On Fri, Jul 18, 2025 at 08:01:22AM +0000, Shameerali Kolothum Thodi wrote: > > > + int irq = platform_bus_get_irqn(pbus, sbdev, 0); > > > + hwaddr base = platform_bus_get_mmio_addr(pbus, sbdev, 0); > > > + MachineState *ms = MACHINE(vms); > > > + > > > + if (!(vms->bootinfo.firmware_loaded && virt_is_acpi_enabled(vms)) > > && > > > + strcmp("pcie.0", bus->qbus.name)) { > > > + warn_report("SMMUv3 device only supported with pcie.0 for DT"); > > > + return; > > > + } > > > + base += vms->memmap[VIRT_PLATFORM_BUS].base; > > > + irq += vms->irqmap[VIRT_PLATFORM_BUS]; > > > > The code is fine. > > > > Just a related question here: > > > > Do you know where we define the number of IRQs and the range of > > MMIO for the SysBusDevice? > > > > SMMU has four IRQs. And I see multiple vSMMU instances do have > > correct intervals to their IRQ numbers, but I cannot find where > > the magic is done. > > Look for, > #define PLATFORM_BUS_NUM_IRQS 64 > > So in theory we could have around 16 vSMMU per VM. It depends on > other platform devices specified as well. Do you see a need for more > on a per VM basis? I know there are host systems with large number of > SMMUv3s, but how many a VM will get assigned realistically?
Hmm, I was asking how platform bus knows that SMMU only has four IRQs. But I think number of 16 might not be enough in some cases. So, my question was: where do we set the number of 4 to the sbdev? As platform_bus_get_irqn() returned very correctly with 0, 4, 8, and so on.. Thanks Nicolin