Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e7cf5b0 authored by Suresh Siddha's avatar Suresh Siddha Committed by H. Peter Anvin
Browse files

x86-32, fpu: Fix DNA exception during check_fpu()



Before check_fpu() is called, we have cr0.TS bit set and hence the floating
point code to check the FDIV bug was generating a DNA exception.

Use kernel_fpu_begin()/kernel_fpu_end() around the floating point
code to avoid this unnecessary device not available exception during
boot.

Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
Link: http://lkml.kernel.org/r/1309479572.2665.1372.camel@sbsiddha-MOBL3.sc.intel.com


Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent b0af8dfd
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -62,6 +62,8 @@ static void __init check_fpu(void)
		return;
		return;
	}
	}


	kernel_fpu_begin();

	/*
	/*
	 * trap_init() enabled FXSR and company _before_ testing for FP
	 * trap_init() enabled FXSR and company _before_ testing for FP
	 * problems here.
	 * problems here.
@@ -80,6 +82,8 @@ static void __init check_fpu(void)
		: "=m" (*&fdiv_bug)
		: "=m" (*&fdiv_bug)
		: "m" (*&x), "m" (*&y));
		: "m" (*&x), "m" (*&y));


	kernel_fpu_end();

	boot_cpu_data.fdiv_bug = fdiv_bug;
	boot_cpu_data.fdiv_bug = fdiv_bug;
	if (boot_cpu_data.fdiv_bug)
	if (boot_cpu_data.fdiv_bug)
		printk(KERN_WARNING "Hmm, FPU with FDIV bug.\n");
		printk(KERN_WARNING "Hmm, FPU with FDIV bug.\n");