On 14.12.2023 23:49, Stefano Stabellini wrote: > On Thu, 14 Dec 2023, Roger Pau Monné wrote: >> On Thu, Dec 14, 2023 at 10:58:24AM +0100, Jan Beulich wrote: >>> On 14.12.2023 10:55, Roger Pau Monné wrote: >>>> One way to bodge this would be to detect whether the caller of >>>> XEN_DOMCTL_irq_permission is a PV or an HVM domain, and in case of HVM >>>> assume the pirq field is a GSI. I'm unsure however how that will work >>>> with non-x86 architectures. > > PIRQ is an x86-only concept. We have event channels but no PIRQs on ARM. > I expect RISC-V will be the same. > > >>>> It would be better to introduce a new XEN_DOMCTL_gsi_permission, or > > "GSI" is another x86-only concept.
Just to mention it - going through the ACPI spec, this looks to be an arch-neutral ACPI term. It is also used in places which to me look pretty Arm-centric. Jan > So actually the best name was indeed XEN_DOMCTL_irq_permission, given > that it is using the more arch-neutral "irq" terminology. > > Perhaps it was always a mistake to pass PIRQs to > XEN_DOMCTL_irq_permission and we should always have passed the real > interrupt number (GSI on x86, SPI on ARM). > > So your "bodge" is actually kind of OK in my opinion. Basically everyone > else (x86 HVM/PVH, ARM, RISC-V, probably PPC too) will use > XEN_DOMCTL_irq_permission with hardware interrupt numbers (GSIs, SPIs, > etc.), the only special case is x86 PV. It is x86 PV the odd one. > > Given that DOMCTL is an unstable interface anyway, I feel OK making > changes to it, even better if backward compatible.