Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 310080 Details for
Bug 452587
[BUGFIX] CPU hotplug support for x86_64
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Support physical cpu hotplug for x86_64
acpi-hotplug-support.patch (text/plain), 3.95 KB, created by
Alok Kataria
on 2008-06-23 22:04:00 UTC
(
hide
)
Description:
Support physical cpu hotplug for x86_64
Filename:
MIME Type:
Creator:
Alok Kataria
Created:
2008-06-23 22:04:00 UTC
Size:
3.95 KB
patch
obsolete
>Author: Ashok Raj <ashok.raj@intel.com> >Commit: 73fea175303926055440c06bc8894f0c5c58afc8 > >This patch enables ACPI based physical CPU hotplug support for x86_64. >Implements acpi_map_lsapic() and acpi_unmap_lsapic() to support physical cpu >hotplug. > >Signed-off-by: Alok N Kataria <akataria@vmware.com> > >Index: linux-2.6.18-92.1.1/arch/i386/kernel/acpi/boot.c >=================================================================== >--- linux-2.6.18-92.1.1.orig/arch/i386/kernel/acpi/boot.c 2008-06-23 11:34:20.000000000 -0700 >+++ linux-2.6.18-92.1.1/arch/i386/kernel/acpi/boot.c 2008-06-23 11:45:57.000000000 -0700 >@@ -506,16 +506,76 @@ > #ifdef CONFIG_ACPI_HOTPLUG_CPU > int acpi_map_lsapic(acpi_handle handle, int *pcpu) > { >- /* TBD */ >- return -EINVAL; >+ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; >+ union acpi_object *obj; >+ struct acpi_table_lapic *lapic; >+ cpumask_t tmp_map, new_map; >+ u8 physid; >+ int cpu; >+ >+ if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) >+ return -EINVAL; >+ >+ if (!buffer.length || !buffer.pointer) >+ return -EINVAL; >+ >+ obj = buffer.pointer; >+ if (obj->type != ACPI_TYPE_BUFFER || >+ obj->buffer.length < sizeof(*lapic)) { >+ kfree(buffer.pointer); >+ return -EINVAL; >+ } >+ >+ lapic = (struct acpi_table_lapic *)obj->buffer.pointer; >+ >+ if ((lapic->header.type != ACPI_MADT_LAPIC) || >+ (!lapic->flags.enabled)) { >+ kfree(buffer.pointer); >+ return -EINVAL; >+ } >+ >+ physid = lapic->id; >+ >+ kfree(buffer.pointer); >+ buffer.length = ACPI_ALLOCATE_BUFFER; >+ buffer.pointer = NULL; >+ >+ tmp_map = cpu_present_map; >+ mp_register_lapic(physid, lapic->flags.enabled); >+ >+ /* >+ * If mp_register_lapic successfully generates a new logical cpu >+ * number, then the following will get us exactly what was mapped >+ */ >+ cpus_andnot(new_map, cpu_present_map, tmp_map); >+ if (cpus_empty(new_map)) { >+ printk ("Unable to map lapic to logical cpu number\n"); >+ return -EINVAL; >+ } >+ >+ cpu = first_cpu(new_map); >+ >+ *pcpu = cpu; >+ return 0; > } > > EXPORT_SYMBOL(acpi_map_lsapic); > > int acpi_unmap_lsapic(int cpu) > { >- /* TBD */ >- return -EINVAL; >+ int i; >+ >+ for_each_possible_cpu(i) { >+ if (x86_acpiid_to_apicid[i] == x86_cpu_to_apicid[cpu]) { >+ x86_acpiid_to_apicid[i] = -1; >+ break; >+ } >+ } >+ x86_cpu_to_apicid[cpu] = -1; >+ cpu_clear(cpu, cpu_present_map); >+ num_processors--; >+ >+ return (0); > } > > EXPORT_SYMBOL(acpi_unmap_lsapic); >Index: linux-2.6.18-92.1.1/arch/i386/kernel/mpparse.c >=================================================================== >--- linux-2.6.18-92.1.1.orig/arch/i386/kernel/mpparse.c 2008-06-23 11:34:20.000000000 -0700 >+++ linux-2.6.18-92.1.1/arch/i386/kernel/mpparse.c 2008-06-23 11:45:57.000000000 -0700 >@@ -68,7 +68,7 @@ > /* Processor that is doing the boot up */ > unsigned int boot_cpu_physical_apicid = -1U; > /* Internal processor count */ >-static unsigned int __devinitdata num_processors; >+unsigned int __cpuinitdata num_processors; > > /* Bitmask of physically existing CPUs */ > physid_mask_t phys_cpu_present_map; >Index: linux-2.6.18-92.1.1/include/asm-i386/smp.h >=================================================================== >--- linux-2.6.18-92.1.1.orig/include/asm-i386/smp.h 2006-09-19 20:42:06.000000000 -0700 >+++ linux-2.6.18-92.1.1/include/asm-i386/smp.h 2008-06-23 11:45:57.000000000 -0700 >@@ -91,6 +91,7 @@ > > extern int __cpu_disable(void); > extern void __cpu_die(unsigned int cpu); >+extern unsigned int num_processors; > #endif /* !__ASSEMBLY__ */ > > #else /* CONFIG_SMP */ >Index: linux-2.6.18-92.1.1/arch/x86_64/kernel/mpparse.c >=================================================================== >--- linux-2.6.18-92.1.1.orig/arch/x86_64/kernel/mpparse.c 2006-09-19 20:42:06.000000000 -0700 >+++ linux-2.6.18-92.1.1/arch/x86_64/kernel/mpparse.c 2008-06-23 11:45:57.000000000 -0700 >@@ -64,7 +64,7 @@ > /* Processor that is doing the boot up */ > unsigned int boot_cpu_id = -1U; > /* Internal processor count */ >-unsigned int num_processors __initdata = 0; >+unsigned int num_processors __cpuinitdata; > > unsigned disabled_cpus __initdata; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 452587
: 310080 |
310081
|
310082