public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: BAIN <bainonline@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: Re: set_fs() preemption safety? [was sys_fs() safety oops !]
Date: Sun, 4 Jul 2004 16:53:52 +0200	[thread overview]
Message-ID: <200407041653.55816.arnd@arndb.de> (raw)
In-Reply-To: <2ff21628040704073632ffa1c9@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

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 <><

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-07-04 14:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-04 14:36 set_fs() preemption safety? [was sys_fs() safety oops !] BAIN
2004-07-04 14:53 ` Arnd Bergmann [this message]
2004-07-04 15:14   ` BAIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200407041653.55816.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=bainonline@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox