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: <174403630303.31282.7040370239515737751.tip-bot2@tip-bot2>
Date: Mon, 07 Apr 2025 14:31:43 -0000
From: "tip-bot2 for Thomas Gleixner" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
 Jonathan Cameron <Jonathan.Cameron@...wei.com>,
 Michael Kelley <mhklinux@...look.com>, Wei Liu <wei.liu@...nel.org>,
 Bjorn Helgaas <bhelgaas@...gle.com>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: irq/msi] PCI: hv: Switch MSI descriptor locking to guard()

The following commit has been merged into the irq/msi branch of tip:

Commit-ID:     159e0676bcb0c14960aef912fbe95b0858243d51
Gitweb:        https://git.kernel.org/tip/159e0676bcb0c14960aef912fbe95b0858243d51
Author:        Thomas Gleixner <tglx@...utronix.de>
AuthorDate:    Wed, 19 Mar 2025 11:56:55 +01:00
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Mon, 07 Apr 2025 16:24:56 +02:00

PCI: hv: Switch MSI descriptor locking to guard()

Convert the code to use the new guard(msi_descs_lock).

No functional change intended.

Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Reviewed-by: Michael Kelley <mhklinux@...look.com>
Acked-by: Wei Liu <wei.liu@...nel.org>
Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>
Link: https://lore.kernel.org/all/20250319105506.624838146@linutronix.de



---
 drivers/pci/controller/pci-hyperv.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index ac27bda..e1eaa24 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -3975,24 +3975,18 @@ static int hv_pci_restore_msi_msg(struct pci_dev *pdev, void *arg)
 {
 	struct irq_data *irq_data;
 	struct msi_desc *entry;
-	int ret = 0;
 
 	if (!pdev->msi_enabled && !pdev->msix_enabled)
 		return 0;
 
-	msi_lock_descs(&pdev->dev);
+	guard(msi_descs_lock)(&pdev->dev);
 	msi_for_each_desc(entry, &pdev->dev, MSI_DESC_ASSOCIATED) {
 		irq_data = irq_get_irq_data(entry->irq);
-		if (WARN_ON_ONCE(!irq_data)) {
-			ret = -EINVAL;
-			break;
-		}
-
+		if (WARN_ON_ONCE(!irq_data))
+			return -EINVAL;
 		hv_compose_msi_msg(irq_data, &entry->msg);
 	}
-	msi_unlock_descs(&pdev->dev);
-
-	return ret;
+	return 0;
 }
 
 /*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ