Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113495
b: refs/heads/master
c: 7643e9b
h: refs/heads/master
i:
  113493: dde41a4
  113491: e811695
  113487: 7ef3ae9
v: v3
  • Loading branch information
Alexander van Heukelum authored and Ingo Molnar committed Oct 13, 2008
1 parent 4f49c02 commit e3cb503
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 12394cf567d509f6ab5d94544e1f414b35286d9e
refs/heads/master: 7643e9b936b4af31ba4851eb7d5b3a3bfad52502
15 changes: 2 additions & 13 deletions trunk/arch/x86/kernel/entry_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -760,20 +760,9 @@ ENTRY(device_not_available)
RING0_INT_FRAME
pushl $-1 # mark this as an int
CFI_ADJUST_CFA_OFFSET 4
SAVE_ALL
GET_CR0_INTO_EAX
testl $0x4, %eax # EM (math emulation bit)
jne device_not_available_emulate
preempt_stop(CLBR_ANY)
call math_state_restore
jmp ret_from_exception
device_not_available_emulate:
pushl $0 # temporary storage for ORIG_EIP
pushl $do_device_not_available
CFI_ADJUST_CFA_OFFSET 4
call math_emulate
addl $4, %esp
CFI_ADJUST_CFA_OFFSET -4
jmp ret_from_exception
jmp error_code
CFI_ENDPROC
END(device_not_available)

Expand Down
14 changes: 13 additions & 1 deletion trunk/arch/x86/kernel/traps_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <linux/edac.h>
#endif

#include <asm/processor-flags.h>
#include <asm/arch_hooks.h>
#include <asm/stacktrace.h>
#include <asm/processor.h>
Expand Down Expand Up @@ -1236,6 +1237,17 @@ asmlinkage void math_emulate(long arg)

#endif /* CONFIG_MATH_EMULATION */

void __kprobes do_device_not_available(struct pt_regs *regs, long error)
{
if (read_cr0() & X86_CR0_EM) {
conditional_sti(regs);
math_emulate(0);
} else {
math_state_restore(); /* interrupts still off */
conditional_sti(regs);
}
}

void __init trap_init(void)
{
int i;
Expand All @@ -1255,7 +1267,7 @@ void __init trap_init(void)
set_system_intr_gate(4, &overflow); /* int4 can be called from all */
set_intr_gate(5, &bounds);
set_intr_gate(6, &invalid_op);
set_trap_gate(7, &device_not_available);
set_intr_gate(7, &device_not_available);
set_task_gate(8, GDT_ENTRY_DOUBLEFAULT_TSS);
set_trap_gate(9, &coprocessor_segment_overrun);
set_trap_gate(10, &invalid_TSS);
Expand Down

0 comments on commit e3cb503

Please sign in to comment.