Re: [patch 19/33] genirq/msi: Provide msi_desc::msi_data
From: Jason Gunthorpe
Date: Wed Nov 16 2022 - 14:28:54 EST
On Fri, Nov 11, 2022 at 02:58:41PM +0100, Thomas Gleixner wrote:
> +/**
> + * struct msi_desc_data - Generic MSI descriptor data
> + * @iobase: Pointer to the IOMEM base adress for interrupt callbacks
> + * @cookie: Device cookie provided at allocation time
> + *
> + * The content of this data is implementation defined, e.g. PCI/IMS
> + * implementations will define the meaning of the data.
> + */
> +struct msi_desc_data {
> + void __iomem *iobase;
> + union msi_dev_cookie cookie;
> +};
It would be nice to see the pci_msi_desc converted to a domain
specific storage as well.
Maybe could be written
struct msi_desc {
u64 domain_data[2];
}
struct pci_msi_desc {
u32 msi_mask;
u8 multiple : 3;
u8 multi_cap : 3;
u8 can_mask : 1;
u8 is_64 : 1;
u8 mask_pos;
u16 default_irq;
}
static_assert(sizeof(struct pci_msi_desc) <= sizeof(((struct msi_desc *)0)->domain_data));
struct pci_msix_desc {
u32 msix_ctrl;
u8 multiple : 3;
u8 multi_cap : 3;
u8 can_mask : 1;
u8 is_64 : 1;
u16 default_irq;
void __iomem *mask_base;
}
static_assert(sizeof(struct pci_msix_desc) <= sizeof(((struct msi_desc *)0)->domain_data));
ideally hidden in the pci code with some irq_chip facing export API to
snoop in the bits a few places need
We've used 128 bits for the PCI descriptor, we might as well like
everyone have all 128 bits for whatever they want to do
Jason