search for: math_state_restore

Displaying 20 results from an estimated 53 matches for "math_state_restore".

2007 May 09
0
[patch 1/9] lguest: export symbols for lguest as a module
From: Rusty Russell <rusty@rustcorp.com.au> lguest does some fairly lowlevel things to support a host, which normal modules don't need: math_state_restore: When the guest triggers a Device Not Available fault, we need to be able to restore the FPU __put_task_struct: We need to hold a reference to another task for inter-guest I/O, and put_task_struct() is an inline function which calls __put_task_struct. access_process_vm: We need to access an...
2007 May 09
0
[patch 1/9] lguest: export symbols for lguest as a module
From: Rusty Russell <rusty@rustcorp.com.au> lguest does some fairly lowlevel things to support a host, which normal modules don't need: math_state_restore: When the guest triggers a Device Not Available fault, we need to be able to restore the FPU __put_task_struct: We need to hold a reference to another task for inter-guest I/O, and put_task_struct() is an inline function which calls __put_task_struct. access_process_vm: We need to access an...
2007 Apr 18
0
[PATCH 2/6] Paravirt CPU hypercall batching mode
...tsk_thread_flag(prev_p, TIF_IO_BITMAP))) + __switch_to_xtra(next_p, tss); + + disable_tsc(prev_p, next_p); + + /* + * Leave lazy mode, flushing any hypercalls made here. + * This must be done before restoring TLS segments so + * the GDT and LDT are properly updated, and must be + * done before math_state_restore, so the TS bit is up + * to date. + */ + arch_leave_lazy_cpu_mode(); + + /* If the task has used fpu the last 5 timeslices, just do a full + * restore of the math state immediately to avoid the trap; the + * chances of needing FPU soon are obviously high now + */ + if (next_p->fpu_counter &...
2007 Apr 18
0
[PATCH 2/6] Paravirt CPU hypercall batching mode
...tsk_thread_flag(prev_p, TIF_IO_BITMAP))) + __switch_to_xtra(next_p, tss); + + disable_tsc(prev_p, next_p); + + /* + * Leave lazy mode, flushing any hypercalls made here. + * This must be done before restoring TLS segments so + * the GDT and LDT are properly updated, and must be + * done before math_state_restore, so the TS bit is up + * to date. + */ + arch_leave_lazy_cpu_mode(); + + /* If the task has used fpu the last 5 timeslices, just do a full + * restore of the math state immediately to avoid the trap; the + * chances of needing FPU soon are obviously high now + */ + if (next_p->fpu_counter &...
2007 Dec 12
5
[PATCH 0/6] paravirt patches - the non-integration part
Hi, This series corresponds do older patches in the paravirt series that was neither already applied, nor I will touch again. In general, they do not touch code that can be unified (at least, without being the unification a big problem on its own). They passed through this list a lot of times, so I feel them ready for inclusion, unless someone opposes. As with the other patches, they apply to
2007 Dec 12
5
[PATCH 0/6] paravirt patches - the non-integration part
Hi, This series corresponds do older patches in the paravirt series that was neither already applied, nor I will touch again. In general, they do not touch code that can be unified (at least, without being the unification a big problem on its own). They passed through this list a lot of times, so I feel them ready for inclusion, unless someone opposes. As with the other patches, they apply to
2007 Apr 18
2
[PATCH 2/5] Paravirt cpu batching.patch
...; _TIF_WORK_CTXSW) + || test_tsk_thread_flag(prev_p, TIF_IO_BITMAP))) + __switch_to_xtra(next_p, tss); + + /* + * Leave lazy mode, flushing any hypercalls made here. + * This must be done before restoring TLS segments so + * the GDT and LDT are properly updated, and must be + * done before math_state_restore, so the TS bit is up + * to date. + */ + arch_leave_lazy_cpu_mode(); + + disable_tsc(prev_p, next_p); + + /* If the task has used fpu the last 5 timeslices, just do a full + * restore of the math state immediately to avoid the trap; the + * chances of needing FPU soon are obviously high now +...
2007 Apr 18
2
[PATCH 2/5] Paravirt cpu batching.patch
...; _TIF_WORK_CTXSW) + || test_tsk_thread_flag(prev_p, TIF_IO_BITMAP))) + __switch_to_xtra(next_p, tss); + + /* + * Leave lazy mode, flushing any hypercalls made here. + * This must be done before restoring TLS segments so + * the GDT and LDT are properly updated, and must be + * done before math_state_restore, so the TS bit is up + * to date. + */ + arch_leave_lazy_cpu_mode(); + + disable_tsc(prev_p, next_p); + + /* If the task has used fpu the last 5 timeslices, just do a full + * restore of the math state immediately to avoid the trap; the + * chances of needing FPU soon are obviously high now +...
2013 Nov 20
0
[PATCH -tip v3 13/23] x86/trap: Use NOKPROBE_SYMBOL macro in trap.c
...enum ctx_state prev_state; @@ -486,6 +490,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) exit: exception_exit(prev_state); } +NOKPROBE_SYMBOL(do_debug); /* * Note that we play around with the 'TS' bit in an attempt to get @@ -657,7 +662,7 @@ void math_state_restore(void) } EXPORT_SYMBOL_GPL(math_state_restore); -dotraplinkage void __kprobes +dotraplinkage void do_device_not_available(struct pt_regs *regs, long error_code) { enum ctx_state prev_state; @@ -683,6 +688,7 @@ do_device_not_available(struct pt_regs *regs, long error_code) #endif exception...
2008 Nov 24
4
[LLVMdev] how to track down a kernel miscompilation?
...0.004000] ffffffff8075dd88 ffffffff80213546 ffffffff806e2320 ffffffff8075c000 [ 0.004000] ffffffff8075dda8 ffffffff8020d6b9 0000000000000001 0000000000000000 [ 0.004000] Call Trace: [ 0.004000] [<ffffffff80213546>] init_fpu+0x106/0x130 [ 0.004000] [<ffffffff8020d6b9>] math_state_restore+0x89/0xc0 [ 0.004000] [<ffffffff80588739>] do_device_not_available+0x9/0x10 [ 0.004000] [<ffffffff8020d2a5>] device_not_available+0x15/0x20 [ 0.004000] [<ffffffff8045a5df>] ? uart_set_options+0xf/0xf0 [ 0.004000] [<ffffffff8045ca5f>] ? uart_parse_options+0x2f...
2012 Jun 29
0
[PATCH] linux-2.6.18/x86: improve CR0 read/write handling
...R_multicall_check(_mcl, mcl - _mcl, NULL))) BUG(); + if (_mcl->op == __HYPERVISOR_fpu_taskswitch) + __get_cpu_var(xen_x86_cr0) |= X86_CR0_TS; /* * Restore %fs and %gs if needed. --- a/arch/i386/kernel/traps-xen.c +++ b/arch/i386/kernel/traps-xen.c @@ -1057,6 +1057,7 @@ asmlinkage void math_state_restore(struc struct task_struct *tsk = thread->task; /* NB. ''clts'' is done for us by Xen during virtual trap. */ + __get_cpu_var(xen_x86_cr0) &= ~X86_CR0_TS; if (!tsk_used_math(tsk)) init_fpu(tsk); restore_fpu(tsk); --- a/arch/x86_64/kernel/process-xen.c +++ b/arch/x8...
2007 Oct 31
5
[PATCH 0/7] (Re-)introducing pvops for x86_64 - Real pvops work part
Hey folks, This is the part-of-pvops-implementation-that-is-not-exactly-a-merge. Neat, uh? This is the majority of the work. The first patch in the series does not really belong here. It was already sent to lkml separetedly before, but I'm including it again, for a very simple reason: Try to test the paravirt patches without it, and you'll fail miserably ;-) (and it was not yet
2007 Oct 31
5
[PATCH 0/7] (Re-)introducing pvops for x86_64 - Real pvops work part
Hey folks, This is the part-of-pvops-implementation-that-is-not-exactly-a-merge. Neat, uh? This is the majority of the work. The first patch in the series does not really belong here. It was already sent to lkml separetedly before, but I'm including it again, for a very simple reason: Try to test the paravirt patches without it, and you'll fail miserably ;-) (and it was not yet
2008 Nov 24
0
[LLVMdev] how to track down a kernel miscompilation?
...ffffffff80213546 ffffffff806e2320 > ffffffff8075c000 > [ 0.004000] ffffffff8075dda8 ffffffff8020d6b9 0000000000000001 > 0000000000000000 > [ 0.004000] Call Trace: > [ 0.004000] [<ffffffff80213546>] init_fpu+0x106/0x130 > [ 0.004000] [<ffffffff8020d6b9>] math_state_restore+0x89/0xc0 > [ 0.004000] [<ffffffff80588739>] do_device_not_available+0x9/0x10 > [ 0.004000] [<ffffffff8020d2a5>] device_not_available+0x15/0x20 > [ 0.004000] [<ffffffff8045a5df>] ? uart_set_options+0xf/0xf0 > [ 0.004000] [<ffffffff8045ca5f>] ? uar...
2008 Nov 24
1
[LLVMdev] how to track down a kernel miscompilation?
...ff806e2320 >> ffffffff8075c000 >> [ 0.004000] ffffffff8075dda8 ffffffff8020d6b9 0000000000000001 >> 0000000000000000 >> [ 0.004000] Call Trace: >> [ 0.004000] [<ffffffff80213546>] init_fpu+0x106/0x130 >> [ 0.004000] [<ffffffff8020d6b9>] math_state_restore+0x89/0xc0 >> [ 0.004000] [<ffffffff80588739>] do_device_not_available+0x9/0x10 >> [ 0.004000] [<ffffffff8020d2a5>] device_not_available+0x15/0x20 >> [ 0.004000] [<ffffffff8045a5df>] ? uart_set_options+0xf/0xf0 >> [ 0.004000] [<ffffffff804...
2007 Apr 18
0
[RFC/PATCH PV_OPS X86_64 12/17] paravirt_ops - interrupt/exception changes
...;))); + +void __init native_init_IRQ(void) { int i; Index: clean-start/arch/x86_64/kernel/traps.c =================================================================== --- clean-start.orig/arch/x86_64/kernel/traps.c +++ clean-start/arch/x86_64/kernel/traps.c @@ -1067,6 +1067,7 @@ asmlinkage void math_state_restore(void) task_thread_info(me)->status |= TS_USEDFPU; me->fpu_counter++; } +EXPORT_SYMBOL_GPL(math_state_restore); void __init trap_init(void) { Index: clean-start/include/asm-x86_64/irq.h =================================================================== --- clean-start.orig/include/as...
2007 Apr 18
0
[RFC/PATCH PV_OPS X86_64 12/17] paravirt_ops - interrupt/exception changes
...;))); + +void __init native_init_IRQ(void) { int i; Index: clean-start/arch/x86_64/kernel/traps.c =================================================================== --- clean-start.orig/arch/x86_64/kernel/traps.c +++ clean-start/arch/x86_64/kernel/traps.c @@ -1067,6 +1067,7 @@ asmlinkage void math_state_restore(void) task_thread_info(me)->status |= TS_USEDFPU; me->fpu_counter++; } +EXPORT_SYMBOL_GPL(math_state_restore); void __init trap_init(void) { Index: clean-start/include/asm-x86_64/irq.h =================================================================== --- clean-start.orig/include/as...
2007 Jul 12
1
[PATCH] lguest: disable SYSENTER for guests
...pu_has(X86_FEATURE_SEP)) + wrmsr(MSR_IA32_SYSENTER_CS, 0, 0); + run_guest_once(lg, lguest_pages(raw_smp_processor_id())); /* Save cr2 now if we page-faulted. */ @@ -345,6 +349,9 @@ int run_guest(struct lguest *lg, unsigne cr2 = read_cr2(); else if (lg->regs->trapnum == 7) math_state_restore(); + + if (boot_cpu_has(X86_FEATURE_SEP)) + wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0); local_irq_enable(); switch (lg->regs->trapnum) {
2007 Jul 12
1
[PATCH] lguest: disable SYSENTER for guests
...pu_has(X86_FEATURE_SEP)) + wrmsr(MSR_IA32_SYSENTER_CS, 0, 0); + run_guest_once(lg, lguest_pages(raw_smp_processor_id())); /* Save cr2 now if we page-faulted. */ @@ -345,6 +349,9 @@ int run_guest(struct lguest *lg, unsigne cr2 = read_cr2(); else if (lg->regs->trapnum == 7) math_state_restore(); + + if (boot_cpu_has(X86_FEATURE_SEP)) + wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0); local_irq_enable(); switch (lg->regs->trapnum) {
2013 Nov 07
0
Xen PV ABI on FPU doesn't match with pvops kernel FPU code, reducing to a serious memory data damage
...ning (which is different with on baremetal). In Xenolinux and mainline Linux kernel before 2.6.26 everything is fine since they don't sleep nor enable interrupts during the handler, however the current mainline pvops kernel has a schedule window opened within it. [Pls see the code below, void math_state_restore(void) { struct task_struct *tsk = current; if (!tsk_used_math(tsk)) { local_irq_enable(); <<<< Here it might open a schedule window /* * does a slab alloc which can sleep */ if (init_fpu(tsk)) { /*...