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: <20240623142234.964056815@linutronix.de>
Date: Sun, 23 Jun 2024 17:18:38 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: linux-arm-kernel@...ts.infradead.org,
 linux-pci@...r.kernel.org,
 maz@...nel.org,
 tglx@...utronix.de,
 anna-maria@...utronix.de,
 shawnguo@...nel.org,
 s.hauer@...gutronix.de,
 festevam@...il.com,
 bhelgaas@...gle.com,
 rdunlap@...radead.org,
 vidyas@...dia.com,
 ilpo.jarvinen@...ux.intel.com,
 apatel@...tanamicro.com,
 kevin.tian@...el.com,
 nipun.gupta@....com,
 den@...inux.co.jp,
 andrew@...n.ch,
 gregory.clement@...tlin.com,
 sebastian.hesselbarth@...il.com,
 gregkh@...uxfoundation.org,
 rafael@...nel.org,
 alex.williamson@...hat.com,
 will@...nel.org,
 lorenzo.pieralisi@....com,
 jgg@...lanox.com,
 ammarfaizi2@...weeb.org,
 robin.murphy@....com,
 lpieralisi@...nel.org,
 nm@...com,
 kristo@...nel.org,
 vkoul@...nel.org,
 okaya@...nel.org,
 agross@...nel.org,
 andersson@...nel.org,
 mark.rutland@....com,
 shameerali.kolothum.thodi@...wei.com,
 yuzenghui@...wei.com,
 shivamurthy.shastri@...utronix.de
Subject: [patch V4 04/21] irqchip/irq-msi-lib: Prepare for PCI MSI/MSIX

From: Thomas Gleixner <tglx@...utronix.de>

Add the bus tokens for DOMAIN_BUS_PCI_DEVICE_MSI and
DOMAIN_BUS_PCI_DEVICE_MSIX to the common child init
function.

Provide the match mask which can be used by parent domain
implementation so the bitmask based child bus token match
works.

Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
Signed-off-by: Shivamurthy Shastri <shivamurthy.shastri@...utronix.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>


---
v3: removed pci_device_msi_mask_unmask_parent_enable call as there is no
more global static key.
---
 drivers/irqchip/irq-msi-lib.c | 6 ++++++
 drivers/irqchip/irq-msi-lib.h | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/irqchip/irq-msi-lib.c b/drivers/irqchip/irq-msi-lib.c
index acbccf8f7f5b..0b359c5d8c6c 100644
--- a/drivers/irqchip/irq-msi-lib.c
+++ b/drivers/irqchip/irq-msi-lib.c
@@ -48,6 +48,12 @@ bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
 
 	/* Is the target domain bus token supported? */
 	switch(info->bus_token) {
+	case DOMAIN_BUS_PCI_DEVICE_MSI:
+	case DOMAIN_BUS_PCI_DEVICE_MSIX:
+		if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_PCI_MSI)))
+			return false;
+
+		break;
 	default:
 		/*
 		 * This should never be reached. See
diff --git a/drivers/irqchip/irq-msi-lib.h b/drivers/irqchip/irq-msi-lib.h
index f0706cc28264..525aa5284a99 100644
--- a/drivers/irqchip/irq-msi-lib.h
+++ b/drivers/irqchip/irq-msi-lib.h
@@ -9,6 +9,12 @@
 #include <linux/irqdomain.h>
 #include <linux/msi.h>
 
+#ifdef CONFIG_PCI_MSI
+#define MATCH_PCI_MSI		BIT(DOMAIN_BUS_PCI_MSI)
+#else
+#define MATCH_PCI_MSI		(0)
+#endif
+
 int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec,
 			      enum irq_domain_bus_token bus_token);
 
-- 
2.34.1




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ