lkml.org 
[lkml]   [2004]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: set_fs() preemption safety? [was sys_fs() safety oops !]
Date
On Sonntag, 4. Juli 2004 16:36, BAIN wrote:
> is the following block safe to be used in preemptible kernels?
>
> old_fs = get_fs();
> set_fs(KERNEL_DS);
>
> do_your_things here; (usually call sys calls stuff from kernel space)
>
> set_fs(old_fs);

On most architectures, this should not be a problem, because set_fs()
only modifies the state of the current task, not any actual processor
registers as the name suggests.

However, on s390 the state is actually kept in cpu control register cr7
and not in the task_struct. Martin, can you comment on how this is
maintained over a schedule() or if this is a real bug?

Arnd <><
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.021 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site