From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Maciej Zenczykowski <maze@cela.pl>
Cc: Sanil K <Sanil.K@lntinfotech.com>,
Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: Interrupt handling
Date: Thu, 16 Oct 2003 16:10:29 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.53.0310161603360.1209@chaos> (raw)
In-Reply-To: <Pine.LNX.4.44.0310162152590.29425-100000@gaia.cela.pl>
On Thu, 16 Oct 2003, Maciej Zenczykowski wrote:
> On Thu, 16 Oct 2003, Richard B. Johnson wrote:
>
> > The memory-map idea has security problems, though.
> > If the area ever gets unmapped (the user exits), a
> > fatal error could occur in kernel mode within the
> > ISR. In general, it's always best to allocate an
> > interrupt-safe buffer within the driver (module),
> > that is guaranteed to persist as long as the driver
> > is installed. This ultimately means that a copy
> > operation is necessary.
> >
> > Memory-to-memory copy is real fast now days. The
> > copy_to_user() is just memcpy() with a trap mechanism
> > that can save the kernel from a user-induced seg-fault.
> > The actual trap is hardware-induced in ix86 machines
> > and therefore adds no overhead to the normal copy operation.
>
> Is there any reason why we couldn't via kernel routine let user space
> access read-only certain pages of kernel memory? I.e. having the
> userspace function call the driver to map into it's (user) address space a
> read-only mapping of the drivers (kernel) private r/w area?
> If I'm not mistaken this is doable on x86 hardware isn't it?
>
> Cheers,
> MaZe.
>
No reason. From user-space, using mmap, you can read the screen-memory
at 0xb8000, for instance, ........
-d b8000
000B8000 63 09 64 09 72 09 6F 09-6D 09 20 07 20 07 20 07 c.d.r.o.m. . . .
000B8010 20 07 20 07 20 07 20 07-20 07 20 07 20 07 20 07 . . . . . . . .
[SNIPPED]
You can look access many kernel areas that way. The probem is:
(1) When are new data available, and how much.
(2) How do you keep it from being overwritten by the next interrupt
before it's been read.
These, and other, problems are why there are 'standard' ways of doing
things.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.
next prev parent reply other threads:[~2003-10-16 20:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-16 13:16 Sanil K
2003-10-16 13:51 ` Richard B. Johnson
2003-10-16 19:55 ` Maciej Zenczykowski
2003-10-16 20:10 ` Richard B. Johnson [this message]
2003-10-16 18:53 ` George Anzinger
2003-10-16 19:08 ` Tom Zanussi
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=Pine.LNX.4.53.0310161603360.1209@chaos \
--to=root@chaos.analogic.com \
--cc=Sanil.K@lntinfotech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maze@cela.pl \
/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
all inboxes | Powered by JetHome®