Skip to contentSkip to conversation

lguest: fix TSC "divide error: 0000 [#1]" boot crash

PATCH New Rusty Russell 1 participant 1 message Jun 29, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lguest: fix TSC "divide error: 0000 [#1]" boot crash

Configuring a guest with < CONFIG_M586TSC reveals an lguest bug: the TSC code expects to see the TSC capability bit, but we weren't setting up the capabilities until much later in check_bugs -> identify_boot_cpu -> identify_boot_cpu.

Do the same thing as Xen and the head.S native code: populate the first capability word before start_kernel().

drivers/lguest/lguest.c +3 -0
diff -r 7743cd1639b7 drivers/lguest/lguest.c
@@ -598,6 +598,9 @@ __init void lguest_init(void *boot)
 	paravirt_disable_iospace();
 
 	cpu_detect(&new_cpu_data);
+	/* head.S usually sets up the first capability word, so do it here. */
+	new_cpu_data.x86_capability[0] = cpuid_edx(1);
+	
 	/* Math is always hard! */
 	new_cpu_data.hard_math = 1;