lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e1e50a004a7faf758872380db66876371b32631.camel@linux.ibm.com>
Date: Thu, 04 Dec 2025 10:59:25 +0100
From: Gerd Bayer <gbayer@...ux.ibm.com>
To: Tobias Schumacher <ts@...ux.ibm.com>, Heiko Carstens
 <hca@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Alexander Gordeev
 <agordeev@...ux.ibm.com>,
        Christian Borntraeger	
 <borntraeger@...ux.ibm.com>,
        Sven Schnelle <svens@...ux.ibm.com>,
        Niklas
 Schnelle <schnelle@...ux.ibm.com>,
        Gerald Schaefer
 <gerald.schaefer@...ux.ibm.com>,
        Halil Pasic	 <pasic@...ux.ibm.com>,
        Matthew Rosato <mjrosato@...ux.ibm.com>,
        Thomas Gleixner	
 <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org,
        Farhan Ali
	 <alifm@...ux.ibm.com>
Subject: Re: [PATCH v9 2/2] s390/pci: Migrate s390 IRQ logic to IRQ domain
 API

On Thu, 2025-12-04 at 06:05 +0100, Tobias Schumacher wrote:
> s390 is one of the last architectures using the legacy API for setup and
> teardown of PCI MSI IRQs. Migrate the s390 IRQ allocation and teardown
> to the MSI parent domain API. For details, see:
> 
> https://lore.kernel.org/lkml/20221111120501.026511281@linutronix.de
> 

  [ ... snip ... ]
> 
> Reviewed-by: Niklas Schnelle <schnelle@...ux.ibm.com>
> Reviewed-by: Farhan Ali <alifm@...ux.ibm.com>
> Signed-off-by: Tobias Schumacher <ts@...ux.ibm.com>
> ---
>  arch/s390/Kconfig           |   1 +
>  arch/s390/include/asm/pci.h |   5 +
>  arch/s390/pci/pci.c         |   6 +
>  arch/s390/pci/pci_bus.c     |  18 ++-
>  arch/s390/pci/pci_irq.c     | 332 +++++++++++++++++++++++++++++---------------
>  5 files changed, 247 insertions(+), 115 deletions(-)
> 

  [ ... snip ... ]

> +static void zpci_msi_clear_airq(struct irq_data *d, int i)
>  {
> -	struct zpci_dev *zdev = to_zpci(pdev);
> -	struct msi_desc *msi;
> -	unsigned int i;
> -	int rc;
> +	struct msi_desc *desc = irq_data_get_msi_desc(d);
> +	struct zpci_dev *zdev = to_zpci_dev(desc->dev);
> +	unsigned long bit;
> +	unsigned int cpu;
> +	u16 msi_index;
>  
> -	/* Disable interrupts */
> -	rc = zpci_clear_irq(zdev);
> -	if (rc)
> -		return;
> +	msi_index = zpci_decode_hwirq_msi_index(d->hwirq);
> +	bit = zdev->msi_first_bit + msi_index;
>  
> -	/* Release MSI interrupts */
> -	msi_for_each_desc(msi, &pdev->dev, MSI_DESC_ASSOCIATED) {
> -		for (i = 0; i < msi->nvec_used; i++) {
> -			irq_set_msi_desc(msi->irq + i, NULL);
> -			irq_free_desc(msi->irq + i);
> +	if (irq_delivery == DIRECTED) {
> +		for_each_possible_cpu(cpu) {
> +			airq_iv_set_ptr(zpci_ibv[cpu], bit + i, 0);
> +			airq_iv_set_data(zpci_ibv[cpu], bit + i, 0);
>  		}
> -		msi->msg.address_lo = 0;
> -		msi->msg.address_hi = 0;
> -		msi->msg.data = 0;
> -		msi->irq = 0;
> +	} else {
> +		airq_iv_set_ptr(zdev->aibv, bit + i, 0);
> +		airq_iv_set_data(zdev->aibv, bit + i, 0);
>  	}
> +}
>  
> -	if (zdev->aisb != -1UL) {
> -		zpci_ibv[zdev->aisb] = NULL;
> -		airq_iv_free_bit(zpci_sbv, zdev->aisb);
> -		zdev->aisb = -1UL;
> -	}
> -	if (zdev->aibv) {
> -		airq_iv_release(zdev->aibv);
> -		zdev->aibv = NULL;
> -	}
> +static void zpci_msi_domain_free(struct irq_domain *domain, unsigned int virq,
> +				 unsigned int nr_irqs)
> +{
> +	struct irq_data *d;
> +	int i;
>  
> -	if ((irq_delivery == DIRECTED) && zdev->msi_first_bit != -1U)
> -		airq_iv_free(zpci_ibv[0], zdev->msi_first_bit, zdev->msi_nr_irqs);
> +	for (i = 0; i < nr_irqs; i++) {
> +		d = irq_domain_get_irq_data(domain, virq + i);
> +		zpci_msi_clear_airq(d, i);
> +		irq_domain_reset_irq_data(d);
> +	}
>  }
> 

Thanks for your great work and for addressing all my issues!

Feel free to add
Reviewed-by: Gerd Bayer <gbayer@...ux.ibm.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ