LKML Archive on
help / color / mirror / Atom feed
From: Linus Torvalds <>
To: Jan Kiszka <>
Cc: Ingo Molnar <>,, Andrew Morton <>,
	Thomas Gleixner <>,
	Jason Wessel <>
Subject: Re: [2/6] uaccess: add probe_kernel_write()
Date: Sun, 10 Feb 2008 11:12:19 -0800 (PST)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Sun, 10 Feb 2008, Jan Kiszka wrote:
> Along Linus' suggestion to work on larger chunks in kgdb, here are
> improved probe_kernel_read/write helpers that take a size argument.

I don't think this is good.

Make it
 - a function, not a #define
 - preferably uninlined (this does *not* look performance-critical)
 - get rid of the get_fs/set_fs/set_fs dance

The last point is somewhat debatable, but the fact is, those functions are 
not defined to be safe to be called from interrupt context. And since we 
use the "__copy_xxxx()" functions with two underscores, those really are 
supposed to mean that we've checked the address earlier.

So it's possible that some architecture does need the explicit segment 
munging (S390 comes to mind), but in that case, we really should add 
special support for that, or we should really validate that get_fs/set_fs 
are safe in all contexts.

And regardless, if we *do* end up needing to munge some segment register 
(which on other architectures tends to be an address space identifier, not 
a segment, but whatever), that just makes it even more clear that this 
isn't some macro or inline function, because those things tend to explode 
the code-space.


  reply	other threads:[~2008-02-10 19:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-10  7:13 Ingo Molnar
2008-02-10 18:53 ` Jan Kiszka
2008-02-10 19:12   ` Linus Torvalds [this message]
2008-02-10 20:05     ` Ingo Molnar
2008-02-11 16:46       ` Randy Dunlap

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:

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

  git send-email \ \ \ \ \ \ \ \ \
    --subject='Re: [2/6] uaccess: add probe_kernel_write()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).