Re: [XEN PATCH 09/57] libs/light: Remove -I.

2021-12-06 Thread Juergen Gross
On 06.12.21 18:01, Anthony PERARD wrote: There is no need to include current directory. Signed-off-by: Anthony PERARD Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: [XEN PATCH 07/57] libs/guest: Drop spurious include in Makefile

2021-12-06 Thread Juergen Gross
On 06.12.21 18:01, Anthony PERARD wrote: This include hasn't been useful since e567964a54 (tools: drop ia64 support). Signed-off-by: Anthony PERARD Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP

Re: [patch V2 22/23] genirq/msi: Handle PCI/MSI allocation fail in core code

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:27:59PM +0100, Thomas Gleixner wrote: > Get rid of yet another irqdomain callback and let the core code return the > already available information of how many descriptors could be allocated. > > Signed-off-by: Thomas Gleixner > Tested-by: Juergen Gross > Reviewed-by:

Re: [patch V2 23/23] PCI/MSI: Move descriptor counting on allocation fail to the legacy code

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:28:00PM +0100, Thomas Gleixner wrote: > The irqdomain code already returns the information. Move the loop to the > legacy code. > > Signed-off-by: Thomas Gleixner > Tested-by: Juergen Gross > Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman

[xen-4.13-testing test] 167215: tolerable FAIL - PUSHED

2021-12-06 Thread osstest service owner
flight 167215 xen-4.13-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/167215/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stopfail like 166345

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

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:39:41PM +0100, Thomas Gleixner wrote: > Use msi_get_vector() and handle the return value to be compatible. > > No functional change intended. > > Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman

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

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:39:25PM +0100, Thomas Gleixner wrote: > 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 Reviewed-by: Greg Kroah-Hartman

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

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:39:26PM +0100, Thomas Gleixner wrote: > Store the properties which are interesting for various places so the MSI > descriptor fiddling can be removed. > > Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman

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

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:39:33PM +0100, Thomas Gleixner wrote: > instead of fiddling with MSI descriptors. > > Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman

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

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:39:37PM +0100, Thomas Gleixner wrote: > Set the domain info flag and remove the check. > > Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman

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

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:39:39PM +0100, Thomas Gleixner wrote: > 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. > >

Re: [XEN PATCH 08/57] libs/light: Remove non-existing CFLAGS_libxl.o var

2021-12-06 Thread Juergen Gross
On 06.12.21 18:01, Anthony PERARD wrote: This var was originally $(CFLAGS_$*.o), and probably was copied from the generic %.o:%.c rules. Nothing sets CFLAGS_libxl.o, so remove it. Signed-off-by: Anthony PERARD Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc

Re: [patch V2 21/23] PCI/MSI: Make pci_msi_domain_check_cap() static

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:27:57PM +0100, Thomas Gleixner wrote: > No users outside of that file. > > Signed-off-by: Thomas Gleixner > Tested-by: Juergen Gross > Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman

Re: [patch V2 20/23] PCI/MSI: Move msi_lock to struct pci_dev

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:27:56PM +0100, Thomas Gleixner wrote: > It's only required for PCI/MSI. So no point in having it in every struct > device. > > Signed-off-by: Thomas Gleixner Yes!!! Reviewed-by: Greg Kroah-Hartman

Re: [patch V2 16/23] PCI/MSI: Split out CONFIG_PCI_MSI independent part

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:27:49PM +0100, Thomas Gleixner wrote: > These functions are required even when CONFIG_PCI_MSI is not set. Move them > to their own file. > > Signed-off-by: Thomas Gleixner > Tested-by: Juergen Gross > Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman

Re: [XEN PATCH 06/57] libs/libs.mk: Remove generic variable that already exist

2021-12-06 Thread Juergen Gross
On 06.12.21 18:01, Anthony PERARD wrote: comma, empty, space are already defined in "Config.mk". Signed-off-by: Anthony PERARD Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: [patch V2 18/23] PCI/MSI: Split out irqdomain code

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:27:52PM +0100, Thomas Gleixner wrote: > Move the irqdomain specific code into it's own file. > > Signed-off-by: Thomas Gleixner > Tested-by: Juergen Gross > Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman

Re: [patch V2 17/23] PCI/MSI: Split out !IRQDOMAIN code

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:27:51PM +0100, Thomas Gleixner wrote: > Split out the non irqdomain code into its own file. > > Signed-off-by: Thomas Gleixner > Tested-by: Juergen Gross > Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman

Re: [patch V2 14/23] PCI/MSI: Make msix_update_entries() smarter

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:27:46PM +0100, Thomas Gleixner wrote: > No need to walk the descriptors and check for each one whether the entries > pointer function argument is NULL. Do it once. > > Signed-off-by: Thomas Gleixner > Tested-by: Juergen Gross > Reviewed-by: Jason Gunthorpe

Re: [XEN PATCH 05/57] libs: Remove -Iinclude from CFLAGS

2021-12-06 Thread Juergen Gross
On 06.12.21 18:01, Anthony PERARD wrote: They are no more directory libs/*/include. Signed-off-by: Anthony PERARD Reviewed-by: Juergen Gross Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature

Re: [patch V2 10/23] genirq/msi, treewide: Use a named struct for PCI/MSI attributes

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:27:39PM +0100, Thomas Gleixner wrote: > The unnamed struct sucks and is in the way of further cleanups. Stick the > PCI related MSI data into a real data structure and cleanup all users. > > No functional change. > > Signed-off-by: Thomas Gleixner > Tested-by: Juergen

Re: [XEN PATCH 04/57] libs: Remove _paths.h from libs ctrl and util.

2021-12-06 Thread Juergen Gross
On 06.12.21 18:01, Anthony PERARD wrote: libxenutil doesn't include _paths.h so no need to generate it. libxenctrl doesn't use macros from _paths.h so can be removed. Fix libxenguest to include _paths.h properly instead of relying on xc_private.h Signed-off-by: Anthony PERARD Reviewed-by:

Re: [patch V2 08/23] PCI/sysfs: Use pci_irq_vector()

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:27:36PM +0100, Thomas Gleixner wrote: > instead of fiddling with msi descriptors. > > Signed-off-by: Thomas Gleixner > Tested-by: Juergen Gross > Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman

Re: [patch V2 05/23] genirq/msi: Fixup includes

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:27:31PM +0100, Thomas Gleixner wrote: > Remove the kobject.h include from msi.h as it's not required and add a > sysfs.h include to the core code instead. > > Signed-off-by: Thomas Gleixner > Tested-by: Juergen Gross > Reviewed-by: Jason Gunthorpe Reviewed-by: Greg

Re: [patch V2 03/23] genirq/msi: Guard sysfs code

2021-12-06 Thread Greg Kroah-Hartman
On Mon, Dec 06, 2021 at 11:27:28PM +0100, Thomas Gleixner wrote: > No point in building unused code when CONFIG_SYSFS=n. > > Signed-off-by: Thomas Gleixner > Tested-by: Juergen Gross > Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman

Re: [patch V2 01/23] powerpc/4xx: Remove MSI support which never worked

2021-12-06 Thread Cédric Le Goater
Hello Thomas, On 12/6/21 23:27, Thomas Gleixner wrote: This code is broken since day one. ppc4xx_setup_msi_irqs() has the following gems: 1) The handling of the result of msi_bitmap_alloc_hwirqs() is completely broken: When the result is greater than or equal 0 (bitmap

Re: [PATCH] xen/arm: Do not include in the image functions...

2021-12-06 Thread Michal Orzel
Hi Julien, On 06.12.2021 17:40, Julien Grall wrote: > > > On 06/12/2021 15:00, Michal Orzel wrote: >> Hi Julien, > > Hi Michal, > >> On 06.12.2021 15:39, Julien Grall wrote: >>> Hi Michal, >>> >>> On 06/12/2021 14:19, Michal Orzel wrote: vtimer_update_irqs, vtimer_update_irq and

[xen-4.12-testing test] 167214: tolerable FAIL - PUSHED

2021-12-06 Thread osstest service owner
flight 167214 xen-4.12-testing real [real] http://logs.test-lab.xenproject.org/osstest/logs/167214/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-xl-qcow219 guest-localmigrate/x10 fail like 166313

[xen-unstable test] 167210: tolerable FAIL - PUSHED

2021-12-06 Thread osstest service owner
flight 167210 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/167210/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-i386-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail in 167174 pass in 167210

[xen-unstable-smoke test] 167220: tolerable all pass - PUSHED

2021-12-06 Thread osstest service owner
flight 167220 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/167220/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 15 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm

[patch V2 30/31] genirq/msi: Simplify sysfs handling

2021-12-06 Thread Thomas Gleixner
The sysfs handling for MSI is a convoluted maze and it is in the way of supporting dynamic expansion of the MSI-X vectors because it only supports a one off bulk population/free of the sysfs entries. Change it to do: 1) Creating an empty sysfs attribute group when msi_device_data is

[patch V2 19/31] PCI: hv: Rework MSI handling

2021-12-06 Thread Thomas Gleixner
Replace the about to vanish iterators and make use of the filtering. Take the descriptor lock around the iterators. Signed-off-by: Thomas Gleixner --- drivers/pci/controller/pci-hyperv.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) ---

[patch V2 27/31] genirq/msi: Convert to new functions

2021-12-06 Thread Thomas Gleixner
Use the new iterator functions and add locking where required. Signed-off-by: Thomas Gleixner --- kernel/irq/msi.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -348,6 +348,7 @@

[patch V2 16/31] powerpc/pasemi/msi: Convert to msi_on_each_dec()

2021-12-06 Thread Thomas Gleixner
Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner --- arch/powerpc/platforms/pasemi/msi.c |9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) --- a/arch/powerpc/platforms/pasemi/msi.c +++ b/arch/powerpc/platforms/pasemi/msi.c @@

[patch V2 31/31] genirq/msi: Convert storage to xarray

2021-12-06 Thread Thomas Gleixner
The current linked list storage for MSI descriptors is suboptimal in several ways: 1) Looking up a MSI desciptor requires a O(n) list walk in the worst case 2) The upcoming support of runtime expansion of MSI-X vectors would need to do a full list walk to figure out whether a particular

[patch V2 23/31] bus: fsl-mc-msi: Simplify MSI descriptor handling

2021-12-06 Thread Thomas Gleixner
Let the MSI irq domain code handle descriptor allocation and free. Signed-off-by: Thomas Gleixner --- drivers/bus/fsl-mc/fsl-mc-msi.c | 61 ++-- 1 file changed, 4 insertions(+), 57 deletions(-) --- a/drivers/bus/fsl-mc/fsl-mc-msi.c +++

[patch V2 26/31] genirq/msi: Make interrupt allocation less convoluted

2021-12-06 Thread Thomas Gleixner
There is no real reason to do several loops over the MSI descriptors instead of just doing one loop. In case of an error everything is undone anyway so it does not matter whether it's a partial or a full rollback. Signed-off-by: Thomas Gleixner --- .clang-format |1

[patch V2 12/31] xen/pcifront: Rework MSI handling

2021-12-06 Thread Thomas Gleixner
Replace the about to vanish iterators. Signed-off-by: Thomas Gleixner --- drivers/pci/xen-pcifront.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/pci/xen-pcifront.c +++ b/drivers/pci/xen-pcifront.c @@ -262,7 +262,7 @@ static int pci_frontend_enable_msix(stru }

[patch V2 17/31] powerpc/fsl_msi: Use msi_for_each_desc()

2021-12-06 Thread Thomas Gleixner
Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner --- arch/powerpc/sysdev/fsl_msi.c |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c @@ -125,17 +125,13 @@

[patch V2 20/31] NTB/msi: Convert to msi_on_each_desc()

2021-12-06 Thread Thomas Gleixner
Replace the about to vanish iterators, make use of the filtering and take the descriptor lock around the iteration. Signed-off-by: Thomas Gleixner Reviewed-by: Logan Gunthorpe Cc: Logan Gunthorpe Cc: Jon Mason Cc: Dave Jiang Cc: Allen Hubbe Cc: linux-...@googlegroups.com ---

[patch V2 15/31] powerpc/cell/axon_msi: Convert to msi_on_each_desc()

2021-12-06 Thread Thomas Gleixner
Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner --- arch/powerpc/platforms/cell/axon_msi.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/arch/powerpc/platforms/cell/axon_msi.c +++

[patch V2 22/31] soc: ti: ti_sci_inta_msi: Remove ti_sci_inta_msi_domain_free_irqs()

2021-12-06 Thread Thomas Gleixner
The function has no users and is pointless now that the core frees the MSI descriptors, which means potential users can just use msi_domain_free_irqs(). Signed-off-by: Thomas Gleixner --- drivers/soc/ti/ti_sci_inta_msi.c |6 -- include/linux/soc/ti/ti_sci_inta_msi.h |1 - 2

[patch V2 21/31] soc: ti: ti_sci_inta_msi: Rework MSI descriptor allocation

2021-12-06 Thread Thomas Gleixner
Protect the allocation properly and use the core allocation and free mechanism. No functional change intended. Signed-off-by: Thomas Gleixner --- drivers/soc/ti/ti_sci_inta_msi.c | 71 +-- 1 file changed, 25 insertions(+), 46 deletions(-) ---

[patch V2 28/31] genirq/msi: Mop up old interfaces

2021-12-06 Thread Thomas Gleixner
Get rid of the old iterators, alloc/free functions and adjust the core code accordingly. Signed-off-by: Thomas Gleixner --- include/linux/msi.h | 15 --- kernel/irq/msi.c| 31 +++ 2 files changed, 15 insertions(+), 31 deletions(-) ---

[patch V2 29/31] genirq/msi: Add abuse prevention comment to msi header

2021-12-06 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner --- include/linux/msi.h | 14 ++ 1 file changed, 14 insertions(+) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -2,6 +2,20 @@ #ifndef LINUX_MSI_H #define LINUX_MSI_H +/* + * This header file contains MSI data structures and functions

[patch V2 18/31] powerpc/mpic_u3msi: Use msi_for_each-desc()

2021-12-06 Thread Thomas Gleixner
Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner --- arch/powerpc/sysdev/mpic_u3msi.c |9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) --- a/arch/powerpc/sysdev/mpic_u3msi.c +++ b/arch/powerpc/sysdev/mpic_u3msi.c @@ -104,17

[patch V2 24/31] platform-msi: Let core code handle MSI descriptors

2021-12-06 Thread Thomas Gleixner
Use the core functionality for platform MSI interrupt domains. The platform device MSI interrupt domains will be converted in a later step. Signed-off-by: Thomas Gleixner --- drivers/base/platform-msi.c | 112 ++-- 1 file changed, 48 insertions(+), 64

[patch V2 25/31] platform-msi: Simplify platform device MSI code

2021-12-06 Thread Thomas Gleixner
The allocation code is overly complex. It tries to have the MSI index space packed, which is not working when an interrupt is freed. There is no requirement for this. The only requirement is that the MSI index is unique. Move the MSI descriptor allocation into msi_domain_populate_irqs() and use

[patch V2 13/31] s390/pci: Rework MSI descriptor walk

2021-12-06 Thread Thomas Gleixner
Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner Tested-by: Niklas Schnelle Acked-by: Niklas Schnelle Cc: linux-s...@vger.kernel.org Cc: Heiko Carstens Cc: Christian Borntraeger --- arch/s390/pci/pci_irq.c |6 ++ 1 file changed, 2

[patch V2 14/31] powerpc/4xx/hsta: Rework MSI handling

2021-12-06 Thread Thomas Gleixner
Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner --- arch/powerpc/platforms/4xx/hsta_msi.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/arch/powerpc/platforms/4xx/hsta_msi.c +++ b/arch/powerpc/platforms/4xx/hsta_msi.c

[patch V2 11/31] x86/pci/xen: Use msi_for_each_desc()

2021-12-06 Thread Thomas Gleixner
Replace the about to vanish iterators. Signed-off-by: Thomas Gleixner --- arch/x86/pci/xen.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@ -184,7 +184,7 @@ static int xen_setup_msi_irqs(struct pci if (ret)

[patch V2 10/31] PCI/MSI: Use msi_on_each_desc()

2021-12-06 Thread Thomas Gleixner
Use the new iterator functions which pave the way for dynamically extending MSI-X vectors. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/irqdomain.c |4 ++-- drivers/pci/msi/legacy.c| 19 --- drivers/pci/msi/msi.c | 30 ++ 3

[patch V2 09/31] PCI/MSI: Let core code free MSI descriptors

2021-12-06 Thread Thomas Gleixner
Set the domain info flag which tells the core code to free the MSI descriptors from msi_domain_free_irqs() and add an explicit call to the core function into the legacy code. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/irqdomain.c |3 ++- drivers/pci/msi/legacy.c|1 +

[patch V2 08/31] PCI/MSI: Use msi_add_msi_desc()

2021-12-06 Thread Thomas Gleixner
Simplify the allocation of MSI descriptors by using msi_add_msi_desc() which moves the storage handling to core code and prepares for dynamic extension of the MSI-X vector space. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c | 122 --

[patch V2 07/31] PCI/MSI: Protect MSI operations

2021-12-06 Thread Thomas Gleixner
To prepare for dynamic extension of MSI-X vectors, protect the MSI operations for MSI and MSI-X. This requires to move the invocation of irq_create_affinity_masks() out of the descriptor lock section to avoid reverse lock ordering vs. CPU hotplug lock as some callers of the PCI/MSI allocation

[patch V2 06/31] genirq/msi: Provide domain flags to allocate/free MSI descriptors automatically

2021-12-06 Thread Thomas Gleixner
Provide domain info flags which tell the core to allocate simple descriptors or to free descriptors when the interrupts are freed and implement the required functionality. Signed-off-by: Thomas Gleixner --- include/linux/msi.h | 17 + kernel/irq/msi.c| 48

[patch V2 05/31] genirq/msi: Provide msi_alloc_msi_desc() and a simple allocator

2021-12-06 Thread Thomas Gleixner
Provide msi_alloc_msi_desc() which takes a template MSI descriptor for initializing a newly allocated descriptor. This allows to simplify various usage sites of alloc_msi_entry() and moves the storage handling into the core code. For simple cases where only a linear vector space is required

[patch V2 04/31] genirq/msi: Provide a set of advanced MSI accessors and iterators

2021-12-06 Thread Thomas Gleixner
In preparation for dynamic handling of MSI-X interrupts provide a new set of MSI descriptor accessor functions and iterators. They are benefitial per se as they allow to cleanup quite some code in various MSI domain implementations. Signed-off-by: Thomas Gleixner --- include/linux/msi.h | 33

[patch V2 01/31] genirq/msi: Move descriptor list to struct msi_device_data

2021-12-06 Thread Thomas Gleixner
It's only required when MSI is in use. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman --- drivers/base/core.c|3 --- include/linux/device.h |4 include/linux/msi.h|4 +++- kernel/irq/msi.c |5 - 4 files changed, 7 insertions(+), 9

[patch V2 02/31] genirq/msi: Add mutex for MSI list protection

2021-12-06 Thread Thomas Gleixner
For upcoming runtime extensions of MSI-X interrupts it's required to protect the MSI descriptor list. Add a mutex to struct msi_device_data and provide lock/unlock functions. Signed-off-by: Thomas Gleixner --- include/linux/msi.h |5 + kernel/irq/msi.c| 25

[patch V2 03/31] genirq/msi: Provide msi_domain_alloc/free_irqs_descs_locked()

2021-12-06 Thread Thomas Gleixner
Usage sites which do allocations of the MSI descriptors before invoking msi_domain_alloc_irqs() require to lock the MSI decriptors accross the operation. Provide entry points which can be called with the MSI mutex held and lock the mutex in the existing entry points. Signed-off-by: Thomas

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

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

[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 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
Create struct msi_device_data and add a pointer of that type to struct dev_msi_info, which is part of struct device. Provide an allocator function which can be invoked from the MSI interrupt allocation code pathes. Add a properties field to the data structure as a first member so the allocation

[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 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 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 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 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 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 +++

[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(-) ---

[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 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 ---

[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 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

[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 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 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

[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 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

[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 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 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 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 +++

[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 ---

[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 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 +++

[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 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 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 ---

[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: io...@lists.linux-foundation.org Cc: dmaeng...@vger.kernel.org ---

[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 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 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 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 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 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 +++---

Re: [XEN v2] xen/arm64: io: Decode 32-bit ldr/str post-indexing instructions

2021-12-06 Thread Stefano Stabellini
On Mon, 6 Dec 2021, Julien Grall wrote: > On 01/12/2021 08:41, Bertrand Marquis wrote: > > Hi Ayan, > > > > > On 30 Nov 2021, at 19:13, Ayan Kumar Halder > > > wrote: > > > > > > Hi Andre, > > > > > > Thanks for your comments. They are useful. > > > > > > On 30/11/2021 09:49, Andre Przywara

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

2021-12-06 Thread Thomas Gleixner
The only unconditional part of MSI data in struct device is the irqdomain pointer. Everything else can be allocated on demand. Create a data structure and move the irqdomain pointer into it. The other MSI specific parts are going to be removed from struct device in later steps. Signed-off-by:

  1   2   3   4   >