|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] PCI: drop pci_segments_init()
commit 12e872ae3e7749098b0360af1c6a3118e03d8267
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Mar 11 09:54:19 2025 +0100
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Mar 11 09:54:19 2025 +0100
PCI: drop pci_segments_init()
Have callers invoke pci_add_segment() directly instead: With radix tree
initialization moved out of the function, its name isn't quite
describing anymore what it actually does.
On x86 move the logic into __start_xen() itself, to reduce the risk of
re-introducing ordering issues like the one which was addressed by
26fe09e34566 ("radix-tree: introduce RADIX_TREE{,_INIT}()").
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
xen/arch/arm/pci/pci.c | 3 ++-
xen/arch/x86/setup.c | 7 +++++++
xen/arch/x86/x86_64/mmconfig-shared.c | 2 --
xen/drivers/passthrough/pci.c | 6 ------
xen/include/xen/pci.h | 1 -
5 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/xen/arch/arm/pci/pci.c b/xen/arch/arm/pci/pci.c
index 78b97beaef..8d9692c92e 100644
--- a/xen/arch/arm/pci/pci.c
+++ b/xen/arch/arm/pci/pci.c
@@ -88,7 +88,8 @@ static int __init pci_init(void)
if ( !pci_passthrough_enabled )
return 0;
- pci_segments_init();
+ if ( pci_add_segment(0) )
+ panic("Could not initialize PCI segment 0\n");
if ( acpi_disabled )
return dt_pci_init();
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 143749e5da..4a32d84911 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1899,6 +1899,13 @@ void asmlinkage __init noreturn __start_xen(void)
*/
setup_system_domains();
+ /*
+ * Ahead of any ACPI table parsing make sure we have control structures
+ * for PCI segment 0.
+ */
+ if ( pci_add_segment(0) )
+ panic("Could not initialize PCI segment 0\n");
+
/*
* IOMMU-related ACPI table parsing has to happen before APIC probing, for
* check_x2apic_preenabled() to be able to observe respective findings, in
diff --git a/xen/arch/x86/x86_64/mmconfig-shared.c
b/xen/arch/x86/x86_64/mmconfig-shared.c
index 77ba1e28f1..f1a3d42c5b 100644
--- a/xen/arch/x86/x86_64/mmconfig-shared.c
+++ b/xen/arch/x86/x86_64/mmconfig-shared.c
@@ -402,8 +402,6 @@ void __init acpi_mmcfg_init(void)
{
bool valid = true;
- pci_segments_init();
-
/* MMCONFIG disabled */
if ((pci_probe & PCI_PROBE_MMCONF) == 0)
return;
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index ab25840e20..3edcfa8a04 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -127,12 +127,6 @@ static int pci_segments_iterate(
return rc;
}
-void __init pci_segments_init(void)
-{
- if ( !alloc_pseg(0) )
- panic("Could not initialize PCI segment 0\n");
-}
-
int __init pci_add_segment(u16 seg)
{
return alloc_pseg(seg) ? 0 : -ENOMEM;
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 4f12bcf089..ef60196653 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -219,7 +219,6 @@ void setup_hwdom_pci_devices(struct domain *d,
int (*handler)(uint8_t devfn,
struct pci_dev *pdev));
int pci_release_devices(struct domain *d);
-void pci_segments_init(void);
int pci_add_segment(u16 seg);
const unsigned long *pci_get_ro_map(u16 seg);
int pci_add_device(u16 seg, u8 bus, u8 devfn,
--
generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |