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>] [day] [month] [year] [list]
Message-ID: <20251226113938.52145-1-boqun.feng@gmail.com>
Date: Fri, 26 Dec 2025 19:39:38 +0800
From: Boqun Feng <boqun.feng@...il.com>
To: Danilo Krummrich <dakr@...nel.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Miguel Ojeda <ojeda@...nel.org>
Cc: Boqun Feng <boqun.feng@...il.com>,
	Gary Guo <gary@...yguo.net>,
	Björn Roy Baron <bjorn3_gh@...tonmail.com>,
	Benno Lossin <lossin@...nel.org>,
	Andreas Hindborg <a.hindborg@...nel.org>,
	Alice Ryhl <aliceryhl@...gle.com>,
	Trevor Gross <tmgross@...ch.edu>,
	Joel Fernandes <joelagnelf@...dia.com>,
	linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	rust-for-linux@...r.kernel.org,
	Dirk Behme <dirk.behme@...il.com>,
	FUJITA Tomonori <fujita.tomonori@...il.com>,
	kernel test robot <lkp@...el.com>,
	Liang Jie <liangjie@...iang.com>,
	Drew Fustini <fustini@...nel.org>,
	David Gow <davidgow@...gle.com>
Subject: [PATCH v2] PCI: Provide pci_free_irq_vectors() for CONFIG_PCI=n

Commit 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI
is disabled") fixed a build error by providing rust helpers when
CONFIG_PCI_MSI=n. However the rust helpers rely on the
pci_alloc_irq_vectors() function is defined, which is not true when
CONFIG_PCI=n. There are multiple ways to fix this, e.g. a possible fix
could be just remove the calling of pci_alloc_irq_vectors() since it's
empty when CONFIG_PCI_MSI=n anyway. However, since PCI irq APIs, such as
pci_alloc_irq_vectors(), are already defined even when CONFIG_PCI=n, the
more reasonable fix is to define pci_alloc_irq_vectors() when
CONFIG_PCI=n and this aligns with the situations of other primitives as
well.

Reported-by: FUJITA Tomonori <fujita.tomonori@...il.com>
Closes: https://lore.kernel.org/rust-for-linux/20251209014312.575940-1-fujita.tomonori@gmail.com/
Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512220740.4Kexm4dW-lkp@intel.com/
Reported-by: Liang Jie <liangjie@...iang.com>
Closes: https://lore.kernel.org/rust-for-linux/20251222034415.1384223-1-buaajxlj@163.com/
Fixes: 473b9f331718 ("rust: pci: fix build failure when CONFIG_PCI_MSI is disabled")
Reviewed-by: Drew Fustini <fustini@...nel.org>
Reviewed-by: David Gow <davidgow@...gle.com>
Reviewed-by: Joel Fernandes <joelagnelf@...dia.com>
Reviewed-by: Danilo Krummrich <dakr@...nel.org>
Signed-off-by: Boqun Feng <boqun.feng@...il.com>
---
v1 --> v2:

* Add Reported-by from FUJITA Tomonori, kernel test robot and Liang Jie.
* Add Reviewed-by tags.

Thanks!

Liang Jie, I added you as Reported-by because of [1], if you prefer not
to have that tag, feel free to let me know, thanks!

[1]: https://lore.kernel.org/rust-for-linux/20251222034415.1384223-1-buaajxlj@163.com/

 include/linux/pci.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 864775651c6f..b5cc0c2b9906 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2210,6 +2210,10 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
 {
 	return -ENOSPC;
 }
+
+static inline void pci_free_irq_vectors(struct pci_dev *dev)
+{
+}
 #endif /* CONFIG_PCI */
 
 /* Include architecture-dependent settings and functions */
-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ