Skip to contentSkip to conversation

ACPI based I/O APIC hot-plug

PATCH In review Kenji Kaneshige 4 participants 7 messages Apr 21, 2005 – Apr 26, 2005 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ACPI based I/O APIC hot-plug

Hi,

Here is a set of patches to support ACPI based I/O APIC hotplug. This code consists of the following three patches.

- Add the new interfaces for I/O APIC hot-add/hot-remove. The implementation of these interfaces depends on each architecture.

- IA64 implementation of above-mentioned interfeces for I/O APIC hot-add/hot-remove.

- Add I/O APIC hot-add support to ACPIPHP dirver. PCI root bridge hot-add will be fully functional with this patch. This will be also needed to support hot-add of p2p bridge hierarchy that contains I/O APICs. This code supports only hot-add for now.

These patches support I/O APIC hot-plug on ia64 only for now. These are against 2.6.12-rc2-mm3.

Thanks,
Kenji Kaneshige

#1 lore raw
Quoted 2 lines · Kenji Kaneshige

Here is a set of patches to support ACPI based I/O APIC hotplug.

OK, with the help of Tony's git tree I managed to get those merged up.

In future, please avoid sending multiple patches with the same Subject:? Because when you do that I have to invent unique names for the patches and you don't know what those names were, so things get confusing. See
http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt for more, thanks.

#2 lore raw
Quoted 7 lines · Andrew Morton
Quoted 1 line · Kenji Kaneshige

Here is a set of patches to support ACPI based I/O APIC hotplug.

OK, with the help of Tony's git tree I managed to get those merged up.

Wow, great!
But I'm now updating these patches based on the feedbacks. How should I do about this? Should I send these updates as another cleanup patch?

Quoted 4 lines

In future, please avoid sending multiple patches with the same Subject:? Because when you do that I have to invent unique names for the patches and you don't know what those names were, so things get confusing. See
http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt for more, thanks.

Sorry about that.
I'll see this.

Thanks,
Kenji Kaneshige

#3 lore raw
Quoted 7 lines · Kenji Kaneshige
Quoted 5 lines · Andrew Morton
Quoted 1 line · Kenji Kaneshige

Here is a set of patches to support ACPI based I/O APIC hotplug.

Quoted 7 lines
Quoted 2 lines

OK, with the help of Tony's git tree I managed to get those merged up.

Wow, great!
But I'm now updating these patches based on the feedbacks. How should I do about this? Should I send these updates as another cleanup patch?

Replacement patches would be OK at this time. Incremental patches are preferred once the code settles down a bit, so we can see what changed.

#4 lore raw
Quoted 11 lines · Andrew Morton
Quoted 9 lines · Kenji Kaneshige
Quoted 7 lines · Andrew Morton
Quoted 1 line · Kenji Kaneshige

Here is a set of patches to support ACPI based I/O APIC hotplug.

OK, with the help of Tony's git tree I managed to get those merged up.

Quoted 10 lines
Quoted 4 lines

Wow, great!
But I'm now updating these patches based on the feedbacks. How should I do about this? Should I send these updates as another cleanup patch?

Replacement patches would be OK at this time. Incremental patches are preferred once the code settles down a bit, so we can see what changed.

I'm attaching the updated set of patches based on feedbacks. Could you please replace the old ones with these?

Thanks,
Kenji Kaneshige

This patch adds the following new interfaces for I/O xAPIC hotplug. The implemantation of these interfaces depends on each architecture.

o int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);

This new interface is to add a new I/O xAPIC specified by phys_addr and gsi_base pair. phys_addr is the physical address to which the I/O xAPIC is mapped and gsi_base is global system interrupt base of the I/O xAPIC. acpi_register_ioapic returns 0 on success, or negative value on error.

o int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);

This new interface is to remove a I/O xAPIC specified by gsi_base. acpi_unregister_ioapic returns 0 on success, or negative value on error.

---

 linux-2.6.12-rc2-mm3-kanesige/arch/i386/kernel/acpi/boot.c |   16 ++++++++++++
 linux-2.6.12-rc2-mm3-kanesige/arch/ia64/kernel/acpi.c      |   17 +++++++++++++
 linux-2.6.12-rc2-mm3-kanesige/include/linux/acpi.h         |    3 ++
 3 files changed, 36 insertions(+)
arch/i386/kernel/acpi/boot.c renamed from arch/i386/kernel/acpi/boot.c~ioapic_hotplug_acpi +16 -0
diff -puN arch/i386/kernel/acpi/boot.c~ioapic_hotplug_acpi arch/i386/kernel/acpi/boot.c
@@ -506,6 +506,22 @@ acpi_unmap_lsapic(int cpu)
 EXPORT_SYMBOL(acpi_unmap_lsapic);
 #endif /* CONFIG_ACPI_HOTPLUG_CPU */
 
+int
+acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
+{
+	/* TBD */
+	return -EINVAL;
+}
+EXPORT_SYMBOL(acpi_register_ioapic);
+
+int
+acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
+{
+	/* TBD */
+	return -EINVAL;
+}
+EXPORT_SYMBOL(acpi_unregister_ioapic);
+
 static unsigned long __init
 acpi_scan_rsdp (
 	unsigned long		start,
arch/ia64/kernel/acpi.c renamed from arch/ia64/kernel/acpi.c~ioapic_hotplug_acpi +17 -0
diff -puN arch/ia64/kernel/acpi.c~ioapic_hotplug_acpi arch/ia64/kernel/acpi.c
@@ -892,4 +892,21 @@ acpi_map_iosapic (acpi_handle handle, u3
 	return AE_OK;
 }
 #endif /* CONFIG_NUMA */
+
+int
+acpi_register_ioapic (acpi_handle handle, u64 phys_addr, u32 gsi_base)
+{
+	/* TBD */
+	return -EINVAL;
+}
+EXPORT_SYMBOL(acpi_register_ioapic);
+
+int
+acpi_unregister_ioapic (acpi_handle handle, u32 gsi_base)
+{
+	/* TBD */
+	return -EINVAL;
+}
+EXPORT_SYMBOL(acpi_unregister_ioapic);
+
 #endif /* CONFIG_ACPI_BOOT */
include/linux/acpi.h renamed from include/linux/acpi.h~ioapic_hotplug_acpi +3 -0
diff -puN include/linux/acpi.h~ioapic_hotplug_acpi include/linux/acpi.h
@@ -408,6 +408,9 @@ int acpi_map_lsapic(acpi_handle handle, 
 int acpi_unmap_lsapic(int cpu);
 #endif /* CONFIG_ACPI_HOTPLUG_CPU */
 
+int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);
+int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
+
 extern int acpi_mp_config;
 
 extern u32 pci_mmcfg_base_addr;

_

This ia64 implementation of acpi_register_ioapic() and acpi_unregister_ioapic() interfaces.

---

 linux-2.6.12-rc2-mm3-kanesige/arch/ia64/kernel/acpi.c    |   21 +-
 linux-2.6.12-rc2-mm3-kanesige/arch/ia64/kernel/iosapic.c |  134 ++++++++++++---
 linux-2.6.12-rc2-mm3-kanesige/include/asm-ia64/iosapic.h |   12 +
 3 files changed, 135 insertions(+), 32 deletions(-)
arch/ia64/kernel/acpi.c renamed from arch/ia64/kernel/acpi.c~ioapic_hotplug_ia64 +13 -8
diff -puN arch/ia64/kernel/acpi.c~ioapic_hotplug_ia64 arch/ia64/kernel/acpi.c
@@ -242,9 +242,7 @@ acpi_parse_iosapic (acpi_table_entry_hea
 	if (BAD_MADT_ENTRY(iosapic, end))
 		return -EINVAL;
 
-	iosapic_init(iosapic->address, iosapic->global_irq_base);
-
-	return 0;
+	return iosapic_init(iosapic->address, iosapic->global_irq_base);
 }
 
 
@@ -826,7 +824,7 @@ EXPORT_SYMBOL(acpi_unmap_lsapic);
  
 
 #ifdef CONFIG_ACPI_NUMA
-acpi_status __init
+acpi_status __devinit
 acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
 {
 	struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
@@ -896,16 +894,23 @@ acpi_map_iosapic (acpi_handle handle, u3
 int
 acpi_register_ioapic (acpi_handle handle, u64 phys_addr, u32 gsi_base)
 {
-	/* TBD */
-	return -EINVAL;
+	int err;
+
+	if ((err = iosapic_init(phys_addr, gsi_base)))
+		return err;
+
+#if CONFIG_ACPI_NUMA
+	acpi_map_iosapic(handle, 0, NULL, NULL);
+#endif /* CONFIG_ACPI_NUMA */
+
+	return 0;
 }
 EXPORT_SYMBOL(acpi_register_ioapic);
 
 int
 acpi_unregister_ioapic (acpi_handle handle, u32 gsi_base)
 {
-	/* TBD */
-	return -EINVAL;
+	return iosapic_remove(gsi_base);
 }
 EXPORT_SYMBOL(acpi_unregister_ioapic);
 
arch/ia64/kernel/iosapic.c renamed from arch/ia64/kernel/iosapic.c~ioapic_hotplug_ia64 +113 -21

193 lines not on this page · raw message

include/asm-ia64/iosapic.h renamed from include/asm-ia64/iosapic.h~ioapic_hotplug_ia64 +9 -3
diff -puN include/asm-ia64/iosapic.h~ioapic_hotplug_ia64 include/asm-ia64/iosapic.h
@@ -71,8 +71,11 @@ static inline void iosapic_eoi(char __io
 }
 
 extern void __init iosapic_system_init (int pcat_compat);
-extern void __init iosapic_init (unsigned long address,
+extern int __devinit iosapic_init (unsigned long address,
 				    unsigned int gsi_base);
+#ifdef CONFIG_HOTPLUG
+extern int iosapic_remove (unsigned int gsi_base);
+#endif /* CONFIG_HOTPLUG */
 extern int gsi_to_vector (unsigned int gsi);
 extern int gsi_to_irq (unsigned int gsi);
 extern void iosapic_enable_intr (unsigned int vector);
@@ -94,11 +97,14 @@ extern unsigned int iosapic_version (cha
 
 extern void iosapic_pci_fixup (int);
 #ifdef CONFIG_NUMA
-extern void __init map_iosapic_to_node (unsigned int, int);
+extern void __devinit map_iosapic_to_node (unsigned int, int);
 #endif
 #else
 #define iosapic_system_init(pcat_compat)			do { } while (0)
-#define iosapic_init(address,gsi_base)				do { } while (0)
+#define iosapic_init(address,gsi_base)				(-EINVAL)
+#ifdef CONFIG_HOTPLUG
+#define iosapic_remove(gsi_base)				(-ENODEV)
+#endif /* CONFIG_HOTPLUG */
 #define iosapic_register_intr(gsi,polarity,trigger)		(gsi)
 #define iosapic_unregister_intr(irq)				do { } while (0)
 #define iosapic_override_isa_irq(isa_irq,gsi,polarity,trigger)	do { } while (0)

_

This patch adds PCI based I/O xAPIC hot-add support to ACPIPHP driver. When PCI root bridge is hot-added, all PCI based I/O xAPICs under the root bridge are hot-added by this patch. Hot-remove support is TBD.

---

 linux-2.6.12-rc2-mm3-kanesige/drivers/pci/hotplug/acpiphp_glue.c |  127 ++++++++++
 linux-2.6.12-rc2-mm3-kanesige/include/linux/pci_ids.h            |    2 
 2 files changed, 129 insertions(+)
drivers/pci/hotplug/acpiphp_glue.c renamed from drivers/pci/hotplug/acpiphp_glue.c~acpiphp_ioapic_add +127 -0

139 lines not on this page · raw message

include/linux/pci_ids.h renamed from include/linux/pci_ids.h~acpiphp_ioapic_add +2 -0
diff -puN include/linux/pci_ids.h~acpiphp_ioapic_add include/linux/pci_ids.h
@@ -62,6 +62,8 @@
 
 #define PCI_BASE_CLASS_SYSTEM		0x08
 #define PCI_CLASS_SYSTEM_PIC		0x0800
+#define PCI_CLASS_SYSTEM_PIC_IOAPIC	0x080010
+#define PCI_CLASS_SYSTEM_PIC_IOXAPIC	0x080020
 #define PCI_CLASS_SYSTEM_DMA		0x0801
 #define PCI_CLASS_SYSTEM_TIMER		0x0802
 #define PCI_CLASS_SYSTEM_RTC		0x0803

_

#5 lore raw
In reply to Kenji Kaneshige

Hi Kenji,

Quoted 10 lines · Kenji Kaneshige

Hi,

Here is a set of patches to support ACPI based I/O APIC hotplug. This code consists of the following three patches.

- Add the new interfaces for I/O APIC hot-add/hot-remove. The implementation of these interfaces depends on each architecture.

- IA64 implementation of above-mentioned interfeces for I/O APIC hot-add/hot-remove.

Any plans for i386 implementation ?

Quoted 11 lines

- Add I/O APIC hot-add support to ACPIPHP dirver. PCI root bridge hot-add will be fully functional with this patch. This will be also needed to support hot-add of p2p bridge hierarchy that contains I/O APICs. This code supports only hot-add for now.

These patches support I/O APIC hot-plug on ia64 only for now. These are against 2.6.12-rc2-mm3.

Thanks,
Kenji Kaneshige

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

A message that is not in the archive (sent off-list or not yet received): pan.2005.04.26.14.03.23.413590-/[email protected]

#7 lore raw

Hi Paul,

Quoted 10 lines · Paul Ionescu

Hi Kenji,

Quoted 5 lines · Kenji Kaneshige

Hi,

Here is a set of patches to support ACPI based I/O APIC hotplug. This code consists of the following three patches.

Quoted 9 lines
Quoted 5 lines

- Add the new interfaces for I/O APIC hot-add/hot-remove. The implementation of these interfaces depends on each architecture.

- IA64 implementation of above-mentioned interfeces for I/O APIC hot-add/hot-remove.

Any plans for i386 implementation ?

I want to work on i386 implementation, but I don't have enough time for this... I hope someone will also work on this area for i386.

Thanks,
Kenji Kaneshige

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click