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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221213140844.15470-3-johan+linaro@kernel.org>
Date:   Tue, 13 Dec 2022 15:08:44 +0100
From:   Johan Hovold <johan+linaro@...nel.org>
To:     Thomas Gleixner <tglx@...utronix.de>, Marc Zyngier <maz@...nel.org>
Cc:     Hector Martin <marcan@...can.st>, Sven Peter <sven@...npeter.dev>,
        Alyssa Rosenzweig <alyssa@...enzweig.io>,
        Andrew Lunn <andrew@...n.ch>,
        Gregory Clement <gregory.clement@...tlin.com>,
        Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Broadcom internal kernel review list 
        <bcm-kernel-feedback-list@...adcom.com>,
        Ray Jui <rjui@...adcom.com>,
        Scott Branden <sbranden@...adcom.com>, asahi@...ts.linux.dev,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-rpi-kernel@...ts.infradead.org,
        Johan Hovold <johan+linaro@...nel.org>
Subject: [PATCH 2/2] genirq/irqdomain/msi: Add irq_domain_alloc_irqs_affinity() wrapper

The full __irq_domain_alloc_irqs() interface was initially only intended
for some legacy (x86) use cases while most callers should use the
irq_domain_alloc_irqs() wrapper.

Add a matching irq_domain_alloc_irqs_affinity() wrapper that can be used
when an affinity hint needs to be provided and use it for MSI
allocations.

Signed-off-by: Johan Hovold <johan+linaro@...nel.org>
---
 include/linux/irqdomain.h | 15 +++++++++++++++
 kernel/irq/msi.c          |  6 +++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index cad47737a052..b1b06d75d31a 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -507,6 +507,14 @@ static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
 				       NULL);
 }
 
+static inline int irq_domain_alloc_irqs_affinity(struct irq_domain *domain,
+			unsigned int nr_irqs, int node, void *arg,
+			const struct irq_affinity_desc *affinity)
+{
+	return __irq_domain_alloc_irqs(domain, -1, nr_irqs, node, arg, false,
+				       affinity);
+}
+
 extern int irq_domain_alloc_irqs_hierarchy(struct irq_domain *domain,
 					   unsigned int irq_base,
 					   unsigned int nr_irqs, void *arg);
@@ -585,6 +593,13 @@ static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
 	return -1;
 }
 
+static inline int irq_domain_alloc_irqs_affinity(struct irq_domain *domain,
+			unsigned int nr_irqs, int node, void *arg,
+			const struct irq_affinity_desc *affinity)
+{
+	return -1;
+}
+
 static inline void irq_domain_free_irqs(unsigned int virq,
 					unsigned int nr_irqs) { }
 
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index bd4d4dd626b4..01f7f3c8d77a 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -1272,9 +1272,9 @@ static int __msi_domain_alloc_irqs(struct device *dev, struct irq_domain *domain
 
 		ops->set_desc(&arg, desc);
 
-		virq = __irq_domain_alloc_irqs(domain, -1, desc->nvec_used,
-					       dev_to_node(dev), &arg, false,
-					       desc->affinity);
+		virq = irq_domain_alloc_irqs_affinity(domain, desc->nvec_used,
+						      dev_to_node(dev), &arg,
+						      desc->affinity);
 		if (virq < 0)
 			return msi_handle_pci_fail(domain, desc, allocated);
 
-- 
2.37.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ