[PATCH] Prevent process migration during vfp_init()
From: Hyungwoo Yang
Date: Thu May 03 2012 - 20:25:43 EST
Hello,
I think I've found a bug but actually I'm not sure whether it only
happens to me due to our changes in kernel.
I really need your opinion.
In vfp_init() in "arch/arm/vfp/vfpmodule.c", if there is process
migration between vfp_enable() and smp_call_function() then kernel
crashes.
===== original code =====
if (cpu_arch >= CPU_ARCH_ARMv6)
vfp_enable(NULL); <== if migration happens just after
vfp_enable(NULL), kernel crashes.
:
:
vfpsid = fmrx(FPSID); <== if migration happens, read tries to
access disbled VFP unit.
:
:
if (VFP_arch)
printk("not present\n");
else if (vfpsid & FPSID_NODOUBLE) {
printk("no double precision support\n");
} else {
hotcpu_notifier(vfp_hotplug, 0);
smp_call_function(vfp_enable, NULL, 1); <== if migration happens,
smp_call_function will not work as it is expected.
=======================
Do you have any opinion?
There're a few ways of preventing migration (like set affinity or
disable premption) but the following is one of the way.
=======================