aboutsummaryrefslogtreecommitdiff
path: root/lib/cpu-notifier-error-inject.c
diff options
context:
space:
mode:
authorHuacai Chen <[email protected]>2014-07-16 09:19:16 +0800
committerRalf Baechle <[email protected]>2014-07-30 21:30:22 +0200
commit2e5767a27337812f6850b3fa362419e2f085e5c3 (patch)
tree8f88cd60354799fa47ccb7893165332232908925 /lib/cpu-notifier-error-inject.c
parentdce0e7d54a710400c0056d86d0f0ed972133b25d (diff)
MIPS: Remove BUG_ON(!is_fpu_owner()) in do_ade()
In do_ade(), is_fpu_owner() isn't preempt-safe. For example, when an unaligned ldc1 is executed, do_cpu() is called and then FPU will be enabled (and TIF_USEDFPU will be set for the current process). Then, do_ade() is called because the access is unaligned. If the current process is preempted at this time, TIF_USEDFPU will be cleard. So when the process is scheduled again, BUG_ON(!is_fpu_owner()) is triggered. This small program can trigger this BUG in a preemptible kernel: int main (int argc, char *argv[]) { double u64[2]; while (1) { asm volatile ( ".set push \n\t" ".set noreorder \n\t" "ldc1 $f3, 4(%0) \n\t" ".set pop \n\t" ::"r"(u64): ); } return 0; } V2: Remove the BUG_ON() unconditionally due to Paul's suggestion. Signed-off-by: Huacai Chen <[email protected]> Signed-off-by: Jie Chen <[email protected]> Signed-off-by: Rui Wang <[email protected]> Cc: <[email protected]> Cc: John Crispin <[email protected]> Cc: Steven J. Hill <[email protected]> Cc: [email protected] Cc: Fuxin Zhang <[email protected]> Cc: Zhangjin Wu <[email protected]> Cc: [email protected] Signed-off-by: Ralf Baechle <[email protected]>
Diffstat (limited to 'lib/cpu-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions