On Wed, Jun 08, 2005 at 10:59:00PM +0200, Kurt Garloff wrote:
> + fpu_begin();
> /* Test for the divl bug.. */
> "fldl %1\n\t"
> "fdivl %2\n\t"
> @@ -108,8 +109,9 @@ static void __init check_fpu(void)
> : "=m" (*&boot_cpu_data.fdiv_bug)
> : "m" (*&x), "m" (*&y));
> if (boot_cpu_data.fdiv_bug)
> printk("Hmm, FPU with FDIV bug.\n");
> + fpu_end();
This would works too, but I choose to just reenable the TS flags,
because at this boot point, we don't even care about what is already in
the fpu when entering the inline asm, we just want to take the next FPU fault.
kernel_fpu_begin/end() is more for saving FPU userspace context for doing
something that need FPU in kernelmode. That's probably why this test has
not been wrapped on vanilla kernel.
Xen-devel mailing list