RE: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-09 Thread Thomas Gleixner
Kevin, On Thu, Dec 09 2021 at 06:26, Kevin Tian wrote: >> From: Jason Gunthorpe >> I don't know of any use case for more than one interrupt on a queue, >> and if it did come up I'd probably approach it by making the queue >> handle above also specify the 'queue relative HW index' > > We have

RE: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-09 Thread Thomas Gleixner
On Thu, Dec 09 2021 at 05:23, Kevin Tian wrote: >> From: Thomas Gleixner >> I don't see anything wrong with that. A subdevice is it's own entity and >> VFIO can chose the most conveniant representation of it to the guest >> obviously. >> >> How that is backe

Re: [patch V2 20/36] x86/pci/XEN: Use device MSI properties

2021-12-08 Thread Thomas Gleixner
On Wed, Dec 08 2021 at 11:53, Jason Gunthorpe wrote: > On Mon, Dec 06, 2021 at 11:39:28PM +0100, Thomas Gleixner wrote: >> static void xen_pv_teardown_msi_irqs(struct pci_dev *dev) >> { >> -struct msi_desc *msidesc = first_pci_msi_entry(dev); >> - >> -if

Re: [patch V2 29/36] PCI/MSI: Simplify pci_irq_get_affinity()

2021-12-07 Thread Thomas Gleixner
Cedric, On Tue, Dec 07 2021 at 18:42, Cédric Le Goater wrote: > > This is breaking nvme on pseries but it's probably one of the previous > patches. I haven't figured out what's wrong yet. Here is the oops FYI. Hrm. > [ 32.494562] WARNING: CPU: 26 PID: 658 at kernel/irq/chip.c:210 >

Re: [patch V2 18/36] genirq/msi: Add msi_device_data::properties

2021-12-07 Thread Thomas Gleixner
On Tue, Dec 07 2021 at 13:47, Thomas Gleixner wrote: > On Tue, Dec 07 2021 at 10:04, Cédric Le Goater wrote: >>> +/** >>> + * msi_device_set_properties - Set device specific MSI properties >>> + * @dev: Pointer to the device which is queried >>> + * @prop

Re: [patch V2 18/36] genirq/msi: Add msi_device_data::properties

2021-12-07 Thread Thomas Gleixner
On Tue, Dec 07 2021 at 10:04, Cédric Le Goater wrote: >> +/** >> + * msi_device_set_properties - Set device specific MSI properties >> + * @dev:Pointer to the device which is queried >> + * @prop: Properties to set >> + */ >> +void msi_device_set_properties(struct device *dev, unsigned long

[patch V2 36/36] dmaengine: qcom_hidma: Cleanup MSI handling

2021-12-06 Thread Thomas Gleixner
There is no reason to walk the MSI descriptors to retrieve the interrupt number for a device. Use msi_get_virq() instead. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Acked-by: Sinan Kaya Cc: dmaeng...@vger.kernel.org --- drivers/dma/qcom

[patch V2 35/36] soc: ti: ti_sci_inta_msi: Get rid of ti_sci_inta_msi_get_virq()

2021-12-06 Thread Thomas Gleixner
Just use the core function msi_get_virq(). Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- drivers/dma/ti/k3-udma-private.c |6 ++ drivers/dma/ti/k3-udma.c | 10 -- drivers/soc/ti/k3-ringacc.c

[patch V2 34/36] bus: fsl-mc: fsl-mc-allocator: Rework MSI handling

2021-12-06 Thread Thomas Gleixner
Storing a pointer to the MSI descriptor just to track the Linux interrupt number is daft. Just store the interrupt number and be done with it. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: Stuart Yoder --- drivers/bus/fsl-mc/dprc-driver.c

[patch V2 33/36] mailbox: bcm-flexrm-mailbox: Rework MSI interrupt handling

2021-12-06 Thread Thomas Gleixner
No point in retrieving the MSI descriptors. Just query the Linux interrupt number. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- drivers/mailbox/bcm-flexrm-mailbox.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions

[patch V2 32/36] iommu/arm-smmu-v3: Use msi_get_virq()

2021-12-06 Thread Thomas Gleixner
Let the core code fiddle with the MSI descriptor retrieval. Signed-off-by: Thomas Gleixner Tested-by: Robin Murphy Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 19 +++ 1 file changed, 3 insertions(+), 16

[patch V2 31/36] perf/smmuv3: Use msi_get_virq()

2021-12-06 Thread Thomas Gleixner
Let the core code fiddle with the MSI descriptor retrieval. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: Mark Rutland Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org --- drivers/perf/arm_smmuv3_pmu.c |5 + 1 file changed, 1

[patch V2 30/36] dmaengine: mv_xor_v2: Get rid of msi_desc abuse

2021-12-06 Thread Thomas Gleixner
Storing a pointer to the MSI descriptor just to keep track of the Linux interrupt number is daft. Use msi_get_virq() instead. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: dmaeng...@vger.kernel.org Cc: Vinod Koul --- drivers/dma/mv_xor_v2.c

[patch V2 28/36] PCI/MSI: Use __msi_get_virq() in pci_get_vector()

2021-12-06 Thread Thomas Gleixner
Use msi_get_vector() and handle the return value to be compatible. No functional change intended. Signed-off-by: Thomas Gleixner --- V2: Handle the INTx case directly instead of trying to be overly smart - Marc --- drivers/pci/msi/msi.c | 25 + 1 file changed, 5

[patch V2 27/36] genirq/msi: Provide interface to retrieve Linux interrupt number

2021-12-06 Thread Thomas Gleixner
This allows drivers to retrieve the Linux interrupt number instead of fiddling with MSI descriptors. msi_get_virq() returns the Linux interrupt number or 0 in case that there is no entry for the given MSI index. Signed-off-by: Thomas Gleixner --- V2: Simplify the implementation and let PCI deal

[patch V2 29/36] PCI/MSI: Simplify pci_irq_get_affinity()

2021-12-06 Thread Thomas Gleixner
Replace open coded MSI descriptor chasing and use the proper accessor functions instead. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- drivers/pci/msi/msi.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions

[patch V2 26/36] powerpc/pseries/msi: Let core code check for contiguous entries

2021-12-06 Thread Thomas Gleixner
Set the domain info flag and remove the check. Signed-off-by: Thomas Gleixner --- V2: Remove it completely - Cedric --- arch/powerpc/platforms/pseries/msi.c | 33 - 1 file changed, 8 insertions(+), 25 deletions(-) --- a/arch/powerpc/platforms/pseries/msi.c

[patch V2 25/36] PCI/MSI: Provide MSI_FLAG_MSIX_CONTIGUOUS

2021-12-06 Thread Thomas Gleixner
Provide a domain info flag which makes the core code check for a contiguous MSI-X index on allocation. That's simpler than checking it at some other domain callback in architecture code. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- drivers

[patch V2 24/36] powerpc/pseries/msi: Use MSI device properties

2021-12-06 Thread Thomas Gleixner
instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- arch/powerpc/platforms/pseries/msi.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch

[patch V2 23/36] powerpc/cell/axon_msi: Use MSI device properties

2021-12-06 Thread Thomas Gleixner
instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner --- V2: Invoke the function with the correct number of arguments - Andy --- arch/powerpc/platforms/cell/axon_msi.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/arch/powerpc/platforms/cell

[patch V2 22/36] genirq/msi: Use device MSI properties

2021-12-06 Thread Thomas Gleixner
instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- kernel/irq/msi.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -122,21

[patch V2 21/36] x86/apic/msi: Use device MSI properties

2021-12-06 Thread Thomas Gleixner
instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- arch/x86/kernel/apic/msi.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) --- a/arch/x86/kernel/apic/msi.c +++ b/arch/x86/kernel/apic/msi.c

[patch V2 19/36] PCI/MSI: Store properties in device::msi::data

2021-12-06 Thread Thomas Gleixner
Store the properties which are interesting for various places so the MSI descriptor fiddling can be removed. Signed-off-by: Thomas Gleixner --- V2: Use the setter function --- drivers/pci/msi/msi.c |8 1 file changed, 8 insertions(+) --- a/drivers/pci/msi/msi.c +++ b/drivers/pci

[patch V2 20/36] x86/pci/XEN: Use device MSI properties

2021-12-06 Thread Thomas Gleixner
instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- arch/x86/pci/xen.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@ -399,9 +399,7

[patch V2 18/36] genirq/msi: Add msi_device_data::properties

2021-12-06 Thread Thomas Gleixner
Add a properties field which allows core code to store information for easy retrieval in order to replace MSI descriptor fiddling. Signed-off-by: Thomas Gleixner --- V2: Add a setter function to prepare for future changes --- include/linux/msi.h | 17 + kernel/irq/msi.c

[patch V2 17/36] PCI/MSI: Use msi_desc::msi_index

2021-12-06 Thread Thomas Gleixner
The usage of msi_desc::pci::entry_nr is confusing at best. It's the index into the MSI[X] descriptor table. Use msi_desc::msi_index which is shared between all MSI incarnations instead of having a PCI specific storage for no value. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman

[patch V2 15/36] bus: fsl-mc-msi: Use msi_desc::msi_index

2021-12-06 Thread Thomas Gleixner
Use the common msi_index member and get rid of the pointless wrapper struct. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- drivers/bus/fsl-mc/fsl-mc-allocator.c |2 +- drivers/bus/fsl-mc/fsl-mc-msi.c |6 +++--- include/linux

[patch V2 16/36] soc: ti: ti_sci_inta_msi: Use msi_desc::msi_index

2021-12-06 Thread Thomas Gleixner
Use the common msi_index member and get rid of the pointless wrapper struct. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- drivers/irqchip/irq-ti-sci-inta.c |2 +- drivers/soc/ti/ti_sci_inta_msi.c |6 +++--- include/linux/msi.h

[patch V2 14/36] platform-msi: Use msi_desc::msi_index

2021-12-06 Thread Thomas Gleixner
Use the common msi_index member and get rid of the pointless wrapper struct. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: linux-arm-ker...@lists.infradead.org Cc: iommu@lists.linux-foundation.org Cc: dmaeng...@vger.kernel.org --- drivers/base

[patch V2 13/36] genirq/msi: Consolidate MSI descriptor data

2021-12-06 Thread Thomas Gleixner
All non PCI/MSI usage variants have data structures in struct msi_desc with only one member: xxx_index. PCI/MSI has a entry_nr member. Add a common msi_index member to struct msi_desc so all implementations can share it which allows further consolidation. Signed-off-by: Thomas Gleixner Reviewed

[patch V2 12/36] platform-msi: Store platform private data pointer in msi_device_data

2021-12-06 Thread Thomas Gleixner
Storing the platform private data in a MSI descriptor is sloppy at best. The data belongs to the device and not to the descriptor. Add a pointer to struct msi_device_data and store the pointer there. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe

[patch V2 11/36] platform-msi: Rename functions and clarify comments

2021-12-06 Thread Thomas Gleixner
It's hard to distinguish what platform_msi_domain_alloc() and platform_msi_domain_alloc_irqs() are about. Make the distinction more explicit and add comments which explain the use cases properly. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe

[patch V2 10/36] genirq/msi: Remove the original sysfs interfaces

2021-12-06 Thread Thomas Gleixner
No more users. Refactor the core code accordingly and move the global interface under CONFIG_PCI_MSI_ARCH_FALLBACKS. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- include/linux/msi.h | 29 +++- kernel/irq/msi.c

[patch V2 09/36] platform-msi: Let the core code handle sysfs groups

2021-12-06 Thread Thomas Gleixner
Set the domain info flag and remove the local sysfs code. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- drivers/base/platform-msi.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) --- a/drivers/base/platform-msi.c +++ b

[patch V2 07/36] genirq/msi: Provide msi_device_populate/destroy_sysfs()

2021-12-06 Thread Thomas Gleixner
Add new allocation functions which can be activated by domain info flags. They store the groups pointer in struct msi_device_data. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- include/linux/msi.h |4 kernel/irq/msi.c| 42

[patch V2 08/36] PCI/MSI: Let the irq code handle sysfs groups

2021-12-06 Thread Thomas Gleixner
Set the domain info flag which makes the core code handle sysfs groups and put an explicit invocation into the legacy code. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- drivers/pci/msi/irqdomain.c |2 +- drivers/pci/msi/legacy.c|6

[patch V2 03/36] PCI/MSI: Allocate MSI device data on first use

2021-12-06 Thread Thomas Gleixner
Allocate MSI device data on first use, i.e. when a PCI driver invokes one of the PCI/MSI enablement functions. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- drivers/pci/msi/msi.c | 20 +++- 1 file changed, 15 insertions(+), 5

[patch V2 06/36] soc: ti: ti_sci_inta_msi: Allocate MSI device data on first use

2021-12-06 Thread Thomas Gleixner
Allocate the MSI device data on first invocation of the allocation function. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: Nishanth Menon Cc: Tero Kristo Cc: Santosh Shilimkar Cc: linux-arm-ker...@lists.infradead.org --- drivers/soc/ti

[patch V2 05/36] bus: fsl-mc-msi: Allocate MSI device data on first use

2021-12-06 Thread Thomas Gleixner
Allocate the MSI device data on first invocation of the allocation function. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: Stuart Yoder Cc: Laurentiu Tudor --- drivers/bus/fsl-mc/fsl-mc-msi.c | 14 -- 1 file changed, 8

[patch V2 02/36] device: Add device::msi_data pointer and struct msi_device_data

2021-12-06 Thread Thomas Gleixner
size is not zero bytes. The field will be uses later on. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- include/linux/device.h |5 + include/linux/msi.h| 18 ++ kernel/irq/msi.c | 32

[patch V2 04/36] platform-msi: Allocate MSI device data on first use

2021-12-06 Thread Thomas Gleixner
Allocate the MSI device data on first invocation of the allocation function for platform MSI private data. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe --- drivers/base/platform-msi.c |8 +++- 1 file changed, 7 insertions(+), 1 deletion

[patch V2 01/36] device: Move MSI related data into a struct

2021-12-06 Thread Thomas Gleixner
-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Cc: Will Deacon Cc: Santosh Shilimkar Cc: iommu@lists.linux-foundation.org Cc: dmaeng...@vger.kernel.org --- drivers/base/platform-msi.c | 12 ++-- drivers/dma/ti/k3-udma.c

[patch V2 00/36] genirq/msi, PCI/MSI: Spring cleaning - Part 2

2021-12-06 Thread Thomas Gleixner
This is the second part of [PCI]MSI refactoring which aims to provide the ability of expanding MSI-X vectors after enabling MSI-X. The first part of this work can be found here: https://lore.kernel.org/r/20211206210147.872865...@linutronix.de This second part has the following important

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-06 Thread Thomas Gleixner
On Mon, Dec 06 2021 at 17:06, Jason Gunthorpe wrote: > On Mon, Dec 06, 2021 at 09:28:47PM +0100, Thomas Gleixner wrote: >> I wish I could mask underneath for some stuff on x86. Though that would >> not help with the worst problem vs. affinity settings. See the horrible >> danc

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-06 Thread Thomas Gleixner
Jason, On Mon, Dec 06 2021 at 13:00, Jason Gunthorpe wrote: > On Mon, Dec 06, 2021 at 04:47:58PM +0100, Thomas Gleixner wrote: >> It will need some more than that, e.g. mask/unmask and as we discussed >> quite some time ago something like the irq_buslock/unlock pair, so you >&g

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-06 Thread Thomas Gleixner
Jason, On Mon, Dec 06 2021 at 10:43, Jason Gunthorpe wrote: > On Sun, Dec 05, 2021 at 03:16:40PM +0100, Thomas Gleixner wrote: >> > That's not really a good idea because dev->irqdomain is a generic >> > mechanism and not restricted to the PCI use case. Special casing it fo

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-06 Thread Thomas Gleixner
Jason, On Mon, Dec 06 2021 at 10:19, Jason Gunthorpe wrote: > On Sat, Dec 04, 2021 at 03:20:36PM +0100, Thomas Gleixner wrote: >> even try to make the irqchip/domain code mangled into the other device >> code. It should create the irqdomain with the associated chip and that >

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-05 Thread Thomas Gleixner
On Sat, Dec 04 2021 at 15:20, Thomas Gleixner wrote: > On Fri, Dec 03 2021 at 12:41, Jason Gunthorpe wrote: > So I need to break that up in a way which caters for both cases, but > does neither create a special case for PCI nor for the rest of the > universe, i.e. the 1:1 case has to

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-04 Thread Thomas Gleixner
Jason, On Fri, Dec 03 2021 at 12:41, Jason Gunthorpe wrote: > On Fri, Dec 03, 2021 at 04:07:58PM +0100, Thomas Gleixner wrote: > Lets do a thought experiment, lets say we forget about the current PCI > MSI API. > > What if it worked more like this: > > probe() > // Acc

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-03 Thread Thomas Gleixner
Jason, On Thu, Dec 02 2021 at 20:37, Jason Gunthorpe wrote: > On Thu, Dec 02, 2021 at 11:31:11PM +0100, Thomas Gleixner wrote: >> >> Of course we can store them in pci_dev.dev.msi.data.store. Either with a >> >> dedicated xarray or by partitioning the xarray space

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-02 Thread Thomas Gleixner
Jason, On Thu, Dec 02 2021 at 16:00, Jason Gunthorpe wrote: > On Thu, Dec 02, 2021 at 08:25:48PM +0100, Thomas Gleixner wrote: >> We seem to have a serious problem of terminology and the understanding >> of topology which is why we continue to talk past each other forever

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-02 Thread Thomas Gleixner
Jason, On Thu, Dec 02 2021 at 09:55, Jason Gunthorpe wrote: > On Thu, Dec 02, 2021 at 01:01:42AM +0100, Thomas Gleixner wrote: >> On Wed, Dec 01 2021 at 21:21, Thomas Gleixner wrote: >> > On Wed, Dec 01 2021 at 14:14, Jason Gunthorpe wrote: >> > Which in turn is co

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-01 Thread Thomas Gleixner
Jason, On Wed, Dec 01 2021 at 21:21, Thomas Gleixner wrote: > On Wed, Dec 01 2021 at 14:14, Jason Gunthorpe wrote: > Which in turn is consistent all over the place and does not require any > special case for anything. Neither for interrupts nor for anything else. that said, feel free t

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-01 Thread Thomas Gleixner
dave, On Wed, Dec 01 2021 at 15:53, Dave Jiang wrote: > On 12/1/2021 3:03 PM, Thomas Gleixner wrote: >> This still depends on how this overall discussion about representation >> of all of this stuff is resolved. >> >>>> What needs a subdevice to expose?

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-01 Thread Thomas Gleixner
On Wed, Dec 01 2021 at 14:49, Dave Jiang wrote: > On 12/1/2021 2:44 PM, Thomas Gleixner wrote: >> How that is backed on the host does not really matter. You can expose >> MSI-X to the guest with a INTx backing as well. >> >> I'm still failing to see the connection

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-01 Thread Thomas Gleixner
On Wed, Dec 01 2021 at 14:21, Dave Jiang wrote: > On 12/1/2021 1:25 PM, Thomas Gleixner wrote: >>> The hardware implementation does not have enough MSIX vectors for >>> guests. There are only 9 MSIX vectors total (8 for queues) and 2048 IMS >>> vectors. So if we a

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-01 Thread Thomas Gleixner
On Wed, Dec 01 2021 at 11:47, Dave Jiang wrote: > On 12/1/2021 11:41 AM, Thomas Gleixner wrote: >>> Hi Thomas. This is actually the IDXD usage for a mediated device passed >>> to a guest kernel when we plumb the pass through of IMS to the guest >>> rather than

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-01 Thread Thomas Gleixner
Jason, On Wed, Dec 01 2021 at 14:14, Jason Gunthorpe wrote: > On Wed, Dec 01, 2021 at 06:35:35PM +0100, Thomas Gleixner wrote: >> On Wed, Dec 01 2021 at 09:00, Jason Gunthorpe wrote: >> But NTB is operating through an abstraction layer and is not a direct >> PCIe device dri

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-01 Thread Thomas Gleixner
Dave, please trim your replies. On Wed, Dec 01 2021 at 09:28, Dave Jiang wrote: > On 12/1/2021 3:16 AM, Thomas Gleixner wrote: >> Jason, >> >> CC+ IOMMU folks >> >> On Tue, Nov 30 2021 at 20:17, Jason Gunthorpe wrote: >>> On Tue, Nov 30, 2021

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-01 Thread Thomas Gleixner
On Wed, Dec 01 2021 at 09:00, Jason Gunthorpe wrote: > On Wed, Dec 01, 2021 at 11:16:47AM +0100, Thomas Gleixner wrote: >> Looking at the device slices as subdevices with their own struct device >> makes a lot of sense from the conceptual level. > > Except IMS is not just for

Re: [patch 21/32] NTB/msi: Convert to msi_on_each_desc()

2021-12-01 Thread Thomas Gleixner
Jason, CC+ IOMMU folks On Tue, Nov 30 2021 at 20:17, Jason Gunthorpe wrote: > On Tue, Nov 30, 2021 at 10:23:16PM +0100, Thomas Gleixner wrote: >> The real problem is where to store the MSI descriptors because the PCI >> device has its own real PCI/MSI-X interrupts which means

Re: [patch 33/37] iommu/arm-smmu-v3: Use msi_get_virq()

2021-11-30 Thread Thomas Gleixner
On Tue, Nov 30 2021 at 09:36, Will Deacon wrote: > On Mon, Nov 29, 2021 at 02:54:18PM +, Robin Murphy wrote: >> On 2021-11-29 14:42, Thomas Gleixner wrote: >> > It's actually 0 when the vector cannot be found. >> >> Oh, -1 for my reading comprehension but +1

Re: [patch 33/37] iommu/arm-smmu-v3: Use msi_get_virq()

2021-11-29 Thread Thomas Gleixner
On Mon, Nov 29 2021 at 13:13, Robin Murphy wrote: > On 2021-11-29 10:55, Will Deacon wrote: >>> - } >>> + smmu->evtq.q.irq = msi_get_virq(dev, EVTQ_MSI_INDEX); >>> + smmu->gerr_irq = msi_get_virq(dev, GERROR_MSI_INDEX); >>> + smmu->priq.q.irq = msi_get_virq(dev, PRIQ_MSI_INDEX); >> >>

Re: [patch 33/37] iommu/arm-smmu-v3: Use msi_get_virq()

2021-11-29 Thread Thomas Gleixner
On Mon, Nov 29 2021 at 13:52, Thomas Gleixner wrote: > On Mon, Nov 29 2021 at 10:55, Will Deacon wrote: >> On Sat, Nov 27, 2021 at 02:20:59AM +0100, Thomas Gleixner wrote: >>> + smmu->evtq.q.irq = msi_get_virq(dev, EVTQ_MSI_INDEX); >>> + smmu->gerr_irq = m

Re: [patch 33/37] iommu/arm-smmu-v3: Use msi_get_virq()

2021-11-29 Thread Thomas Gleixner
Will, On Mon, Nov 29 2021 at 10:55, Will Deacon wrote: > On Sat, Nov 27, 2021 at 02:20:59AM +0100, Thomas Gleixner wrote: >> +smmu->evtq.q.irq = msi_get_virq(dev, EVTQ_MSI_INDEX); >> +smmu->gerr_irq = msi_get_virq(dev, GERROR_MSI_INDEX); >> +smmu->

Re: [patch 29/37] PCI/MSI: Use __msi_get_virq() in pci_get_vector()

2021-11-28 Thread Thomas Gleixner
On Sun, Nov 28 2021 at 19:37, Marc Zyngier wrote: > On Sat, 27 Nov 2021 01:22:03 +, > Thomas Gleixner wrote: > > I worked around it with the hack below, but I doubt this is the real > thing. portdrv_core.c does complicated things, and I don't completely > understand its

Re: [patch 00/37] genirq/msi, PCI/MSI: Spring cleaning - Part 2

2021-11-28 Thread Thomas Gleixner
On Sat, Nov 27 2021 at 20:39, Jason Gunthorpe wrote: > On Sat, Nov 27, 2021 at 02:21:17AM +0100, Thomas Gleixner wrote: >>4) Provide a function to retrieve the Linux interrupt number for a given >> MSI index similar to pci_irq_vector() and cleanup all open coded &g

Re: [patch 02/37] device: Add device::msi_data pointer and struct msi_device_data

2021-11-28 Thread Thomas Gleixner
On Sat, Nov 27 2021 at 20:14, Jason Gunthorpe wrote: > On Sat, Nov 27, 2021 at 02:20:09AM +0100, Thomas Gleixner wrote: > >> +/** >> + * msi_setup_device_data - Setup MSI device data >> + * @dev:Device for which MSI device data should be set up >> + * >> +

[patch 37/37] dmaengine: qcom_hidma: Cleanup MSI handling

2021-11-26 Thread Thomas Gleixner
There is no reason to walk the MSI descriptors to retrieve the interrupt number for a device. Use msi_get_virq() instead. Signed-off-by: Thomas Gleixner Cc: Sinan Kaya Cc: dmaeng...@vger.kernel.org --- drivers/dma/qcom/hidma.c | 42 ++ 1 file changed

[patch 36/37] soc: ti: ti_sci_inta_msi: Get rid of ti_sci_inta_msi_get_virq()

2021-11-26 Thread Thomas Gleixner
Just use the core function msi_get_virq(). Signed-off-by: Thomas Gleixner --- drivers/dma/ti/k3-udma-private.c |6 ++ drivers/dma/ti/k3-udma.c | 10 -- drivers/soc/ti/k3-ringacc.c|2 +- drivers/soc/ti/ti_sci_inta_msi.c | 12

[patch 35/37] bus: fsl-mc: fsl-mc-allocator: Rework MSI handling

2021-11-26 Thread Thomas Gleixner
Storing a pointer to the MSI descriptor just to track the Linux interrupt number is daft. Just store the interrupt number and be done with it. Signed-off-by: Thomas Gleixner Cc: Stuart Yoder --- drivers/bus/fsl-mc/dprc-driver.c|8 drivers/bus/fsl-mc/fsl-mc

[patch 34/37] mailbox: bcm-flexrm-mailbox: Rework MSI interrupt handling

2021-11-26 Thread Thomas Gleixner
No point in retrieving the MSI descriptors. Just query the Linux interrupt number. Signed-off-by: Thomas Gleixner --- drivers/mailbox/bcm-flexrm-mailbox.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/drivers/mailbox/bcm-flexrm-mailbox.c +++ b/drivers/mailbox/bcm-flexrm

[patch 33/37] iommu/arm-smmu-v3: Use msi_get_virq()

2021-11-26 Thread Thomas Gleixner
Let the core code fiddle with the MSI descriptor retrieval. Signed-off-by: Thomas Gleixner --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm

[patch 31/37] dmaengine: mv_xor_v2: Get rid of msi_desc abuse

2021-11-26 Thread Thomas Gleixner
Storing a pointer to the MSI descriptor just to keep track of the Linux interrupt number is daft. Use msi_get_virq() instead. Signed-off-by: Thomas Gleixner Cc: dmaeng...@vger.kernel.org Cc: Vinod Koul --- drivers/dma/mv_xor_v2.c | 16 +--- 1 file changed, 5 insertions(+), 11

[patch 32/37] perf/smmuv3: Use msi_get_virq()

2021-11-26 Thread Thomas Gleixner
Let the core code fiddle with the MSI descriptor retrieval. Signed-off-by: Thomas Gleixner Cc: Mark Rutland Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org --- drivers/perf/arm_smmuv3_pmu.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/perf

[patch 30/37] PCI/MSI: Simplify pci_irq_get_affinity()

2021-11-26 Thread Thomas Gleixner
Replace open coded MSI descriptor chasing and use the proper accessor functions instead. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c

[patch 29/37] PCI/MSI: Use __msi_get_virq() in pci_get_vector()

2021-11-26 Thread Thomas Gleixner
Use __msi_get_vector() and handle the return values to be compatible. No functional change intended. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c | 25 + 1 file changed, 5 insertions(+), 20 deletions(-) --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi

[patch 28/37] genirq/msi: Provide interface to retrieve Linux interrupt number

2021-11-26 Thread Thomas Gleixner
This allows drivers to retrieve the Linux interrupt number instead of fiddling with MSI descriptors. msi_get_virq() returns the Linux interrupt number or 0, __msi_get_virq() has more detailed return codes so pci_irq_vector() can use it as well. Signed-off-by: Thomas Gleixner --- include/linux

[patch 27/37] powerpc/pseries/msi: Let core code check for contiguous entries

2021-11-26 Thread Thomas Gleixner
Set the domain info flag and remove the check. Signed-off-by: Thomas Gleixner --- arch/powerpc/platforms/pseries/msi.c | 32 +--- 1 file changed, 9 insertions(+), 23 deletions(-) --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c

[patch 26/37] PCI/MSI: Provide MSI_FLAG_MSIX_CONTIGUOUS

2021-11-26 Thread Thomas Gleixner
Provide a domain info flag which makes the core code check for a contiguous MSI-X index on allocation. That's simpler than checking it at some other domain callback in architecture code. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/irqdomain.c | 16 ++-- include/linux/msi.h

[patch 25/37] powerpc/pseries/msi: Use MSI device properties

2021-11-26 Thread Thomas Gleixner
instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner --- arch/powerpc/platforms/pseries/msi.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c @@ -447,9 +447,9 @@ static int

[patch 24/37] powerpc/cell/axon_msi: Use MSI device properties

2021-11-26 Thread Thomas Gleixner
instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner --- arch/powerpc/platforms/cell/axon_msi.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c @@ -199,7 +199,7

[patch 23/37] genirq/msi: Use device MSI properties

2021-11-26 Thread Thomas Gleixner
instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner Cc: x...@kernel.org --- kernel/irq/msi.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -114,21 +114,8 @@ int msi_setup_device_data(struct

[patch 22/37] x86/apic/msi: Use device MSI properties

2021-11-26 Thread Thomas Gleixner
instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/apic/msi.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) --- a/arch/x86/kernel/apic/msi.c +++ b/arch/x86/kernel/apic/msi.c @@ -160,11 +160,8 @@ static struct irq_chip pci_msi_controlle

[patch 21/37] x86/pci/XEN: Use device MSI properties

2021-11-26 Thread Thomas Gleixner
instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner --- arch/x86/pci/xen.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@ -399,9 +399,7 @@ static void xen_teardown_msi_irqs(struct static void

[patch 20/37] PCI/MSI: Store properties in device::msi::data

2021-11-26 Thread Thomas Gleixner
Store the properties which are interesting for various places so the MSI descriptor fiddling can be removed. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c |6 ++ 1 file changed, 6 insertions(+) --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -244,6 +244,8

[patch 19/37] genirq/msi: Add msi_device_data::properties

2021-11-26 Thread Thomas Gleixner
Add a properties field which allows core code to store information for easy retrieval in order to replace MSI descriptor fiddling. Signed-off-by: Thomas Gleixner --- include/linux/msi.h | 17 + kernel/irq/msi.c| 12 2 files changed, 29 insertions

[patch 18/37] PCI/MSI: Use msi_desc::msi_index

2021-11-26 Thread Thomas Gleixner
The usage of msi_desc::pci::entry_nr is confusing at best. It's the index into the MSI[X] descriptor table. Use msi_desc::msi_index which is shared between all MSI incarnations instead of having a PCI specific storage for no value. Signed-off-by: Thomas Gleixner --- arch/powerpc/platforms

[patch 17/37] soc: ti: ti_sci_inta_msi: Use msi_desc::msi_index

2021-11-26 Thread Thomas Gleixner
Use the common msi_index member and get rid of the pointless wrapper struct. Signed-off-by: Thomas Gleixner --- drivers/irqchip/irq-ti-sci-inta.c |2 +- drivers/soc/ti/ti_sci_inta_msi.c |6 +++--- include/linux/msi.h | 16 ++-- 3 files changed, 6 insertions

[patch 15/37] platform-msi: Use msi_desc::msi_index

2021-11-26 Thread Thomas Gleixner
Use the common msi_index member and get rid of the pointless wrapper struct. Signed-off-by: Thomas Gleixner Cc: linux-arm-ker...@lists.infradead.org Cc: iommu@lists.linux-foundation.org Cc: dmaeng...@vger.kernel.org --- drivers/base/platform-msi.c | 10 +- drivers/dma

[patch 16/37] bus: fsl-mc-msi: Use msi_desc::msi_index

2021-11-26 Thread Thomas Gleixner
Use the common msi_index member and get rid of the pointless wrapper struct. Signed-off-by: Thomas Gleixner --- drivers/bus/fsl-mc/fsl-mc-allocator.c |2 +- drivers/bus/fsl-mc/fsl-mc-msi.c |6 +++--- include/linux/msi.h | 10 -- 3 files changed, 4

[patch 14/37] genirq/msi: Consolidate MSI descriptor data

2021-11-26 Thread Thomas Gleixner
All non PCI/MSI usage variants have data structures in struct msi_desc with only one member: xxx_index. PCI/MSI has a entry_nr member. Add a common msi_index member to struct msi_desc so all implementations can share it which allows further consolidation. Signed-off-by: Thomas Gleixner

[patch 13/37] platform-msi: Store platform private data pointer in msi_device_data

2021-11-26 Thread Thomas Gleixner
Storing the platform private data in a MSI descriptor is sloppy at best. The data belongs to the device and not to the descriptor. Add a pointer to struct msi_device_data and store the pointer there. Signed-off-by: Thomas Gleixner --- drivers/base/platform-msi.c | 79

[patch 12/37] platform-msi: Rename functions and clarify comments

2021-11-26 Thread Thomas Gleixner
It's hard to distinguish what platform_msi_domain_alloc() and platform_msi_domain_alloc_irqs() are about. Make the distinction more explicit and add comments which explain the use cases properly. Signed-off-by: Thomas Gleixner --- drivers/base/platform-msi.c | 36

[patch 11/37] genirq/msi: Remove the original sysfs interfaces

2021-11-26 Thread Thomas Gleixner
No more users. Refactor the core code accordingly. Signed-off-by: Thomas Gleixner --- include/linux/msi.h | 12 --- kernel/irq/msi.c| 53 +++- 2 files changed, 20 insertions(+), 45 deletions(-) --- a/include/linux/msi.h +++ b

[patch 10/37] platform-msi: Let the core code handle sysfs groups

2021-11-26 Thread Thomas Gleixner
Set the domain info flag and remove the local sysfs code. Signed-off-by: Thomas Gleixner --- drivers/base/platform-msi.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) --- a/drivers/base/platform-msi.c +++ b/drivers/base/platform-msi.c @@ -23,7 +23,6 @@ struct

[patch 09/37] PCI/MSI: Let the irq code handle sysfs groups

2021-11-26 Thread Thomas Gleixner
Set the domain info flag which makes the core code handle sysfs groups and put an explicit invocation into the legacy code. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/irqdomain.c |2 +- drivers/pci/msi/legacy.c|6 +- drivers/pci/msi/msi.c | 23

[patch 08/37] genirq/msi: Provide msi_device_populate/destroy_sysfs()

2021-11-26 Thread Thomas Gleixner
Add new allocation functions which can be activated by domain info flags. They store the groups pointer in struct msi_device_data. Signed-off-by: Thomas Gleixner --- include/linux/msi.h | 12 +++- kernel/irq/msi.c| 42 -- 2 files changed

[patch 07/37] soc: ti: ti_sci_inta_msi: Allocate MSI device data on first use

2021-11-26 Thread Thomas Gleixner
Allocate the MSI device data on first invocation of the allocation function. Signed-off-by: Thomas Gleixner Cc: Nishanth Menon Cc: Tero Kristo Cc: Santosh Shilimkar Cc: linux-arm-ker...@lists.infradead.org --- drivers/soc/ti/ti_sci_inta_msi.c |4 1 file changed, 4 insertions

[patch 06/37] bus: fsl-mc-msi: Allocate MSI device data on first use

2021-11-26 Thread Thomas Gleixner
Allocate the MSI device data on first invocation of the allocation function. Signed-off-by: Thomas Gleixner Cc: Stuart Yoder Cc: Laurentiu Tudor --- drivers/bus/fsl-mc/fsl-mc-msi.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) --- a/drivers/bus/fsl-mc/fsl-mc-msi.c

<    1   2   3   4   5   6   >