Skip to contentSkip to conversation

[PATCH} linux: clean up setup_arch_post.h

PATCH Jan Beulich 1 participant 1 message Mar 2, 2006

lore
Share & tools
lore
#0 lore raw

- machine_specific_memory_setup() was unused on x86-64
- machine_specific_modify_cpu_capabilities() must not be __init (for CPU hotplug)
- machine_specific_modify_cpu_capabilities() should be called in similar ways on 32- and 64-bits

Jan

arch/x86_64/kernel/setup-xen.c +4 -0
Index: head-2006-03-02/arch/x86_64/kernel/setup-xen.c
===================================================================
@@ -82,6 +82,8 @@
 extern unsigned long start_pfn;
 extern struct edid_info edid_info;
 
+extern void machine_specific_modify_cpu_capabilities(struct cpuinfo_x86 *c);
+
 shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
 EXPORT_SYMBOL(HYPERVISOR_shared_info);
 
@@ -1405,6 +1407,8 @@ void __cpuinit identify_cpu(struct cpuin
 	select_idle_routine(c);
 	detect_ht(c); 
 
+	machine_specific_modify_cpu_capabilities(c);
+
 	/*
 	 * On SMP, boot_cpu_data holds the common feature set between
 	 * all CPUs; so make sure that we indicate which features are
include/asm-i386/mach-xen/setup_arch_post.h +1 -1
Index: head-2006-03-02/include/asm-i386/mach-xen/setup_arch_post.h
===================================================================
@@ -16,7 +16,7 @@ static char * __init machine_specific_me
 	return "Xen";
 }
 
-void __init machine_specific_modify_cpu_capabilities(struct cpuinfo_x86 *c)
+void __devinit machine_specific_modify_cpu_capabilities(struct cpuinfo_x86 *c)
 {
 	clear_bit(X86_FEATURE_VME, c->x86_capability);
 	clear_bit(X86_FEATURE_DE, c->x86_capability);
include/asm-x86_64/mach-xen/setup_arch_post.h +2 -18
Index: head-2006-03-02/include/asm-x86_64/mach-xen/setup_arch_post.h
===================================================================
@@ -1,28 +1,12 @@
 /**
- * machine_specific_memory_setup - Hook for machine specific memory setup.
+ * machine_specific_* - Hooks for machine specific setup.
  *
  * Description:
  *	This is included late in kernel/setup.c so that it can make
  *	use of all of the static functions.
  **/
 
-static char * __init machine_specific_memory_setup(void)
-{
-	char *who;
-	unsigned long start_pfn, max_pfn;
-
-	who = "Xen";
-
-	start_pfn = 0;
-	max_pfn = xen_start_info->nr_pages;
-
-	e820.nr_map = 0;
-	add_memory_region(PFN_PHYS(start_pfn), PFN_PHYS(max_pfn) - PFN_PHYS(start_pfn), E820_RAM);
-
-	return who;
-}
-
-void __init machine_specific_modify_cpu_capabilities(struct cpuinfo_x86 *c)
+void __cpuinit machine_specific_modify_cpu_capabilities(struct cpuinfo_x86 *c)
 {
 	clear_bit(X86_FEATURE_VME, c->x86_capability);
 	clear_bit(X86_FEATURE_DE, c->x86_capability);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel