Skip to contentSkip to conversation

fix wrong proc cpuinfo on x64

Patch1/2 Zou Nan hai 2 participants 2 messages Nov 6, 2007 x86

lore
Share & tools
lore
#0 lore raw

in 2.6.24-rc1 kernel,
The /proc/cpuinfo display is wrong.

One issue is every processor id appears to be 0.

That is because smp_store_cpu_info will set cpuinfo_x86->cpu_index to cpu id then call identify_cpu
identify_cpu will call early_identify_cpu which set c->cpu_index back to 0.

This patch set cpu_index after identify_cpu to fix the issue.

arch/x86/kernel/smpboot_64.c +1 -1
@@ -141,8 +141,8 @@ static void __cpuinit smp_store_cpu_info
 	struct cpuinfo_x86 *c = &cpu_data(id);
 
 	*c = boot_cpu_data;
-	c->cpu_index = id;
 	identify_cpu(c);
+	c->cpu_index = id;
 	print_cpu_info(c);
 }
 
#1 lore raw
Quoted 10 lines · Zou Nan hai

in 2.6.24-rc1 kernel,
The /proc/cpuinfo display is wrong.

One issue is every processor id appears to be 0.

That is because smp_store_cpu_info will set cpuinfo_x86->cpu_index to cpu id then call identify_cpu
identify_cpu will call early_identify_cpu which set c->cpu_index back to 0.

This issue should already be fixed with this patch

http://marc.info/?l=linux-kernel&m=119392088227245

Regards,

Andreas

Signature · 5 lines
Operating | AMD Saxony Limited Liability Company & Co. KG,
  System  | Wilschdorfer Landstr. 101, 01109 Dresden, Germany
 Research | Register Court Dresden: HRA 4896, General Partner authorized
  Center  | to represent: AMD Saxony LLC (Wilmington, Delaware, US)
  (OSRC)  | General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy