Re: set_fs() preemption safety? [was sys_fs() safety oops !]

From: BAIN
Date: Sun Jul 04 2004 - 10:15:35 EST


> > 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?
Ok this is new info for me,...

I was under impression that i am banned from calling schedule between
the two calls to set_fs.

This answers my question. Thanks,

BAIN
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/