From: Kumar Gala <galak@kernel.crashing.org>
To: kernel mailz <kernelmailz@googlemail.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: 85xx Address space query
Date: Wed, 24 Jun 2009 08:15:25 -0500 [thread overview]
Message-ID: <D47FC871-1535-4DBF-8617-6EEA8C180484@kernel.crashing.org> (raw)
In-Reply-To: <abe8a1fd0906240244i6e33c260xadff5cf462df7b8c@mail.gmail.com>
On Jun 24, 2009, at 4:44 AM, kernel mailz wrote:
> Hi,
>
> I am a newbie, trying to learn but have a few queries, nice if you
> could respond
> For linux on 85xx systems...
>
> (a) Kernel code runs in PR=0 AS=0 and PID=0, which user space
> application run in PR=1 AS=0 and PID 1-255.
> Is this correct.
correct.
> (b) I am writing a small program where the application code opens
> invokes a ioctl call and passes a buffer pointer ( say 0x10000 in
> user space)
> Now the driver code is using copy_from_user.
> How this works internally ?
>
> 1. User code executes ioctl
> 2. interrupt goes to the kernel
On the interrupt the PR changes from 0 -> 1
> 3. ioctl handler in driver gets invoked
> The buffer pointer still contains 0x10000.
>
> How kernel code running in PR=0 accesses it and does the copy. I am
> not able to see a address space switch in the asm code of
> copy_tofrom_user.
There isn't a address space switch. But address spaces exist at the
same time. The user app is given 0..0xc000_0000 and the kernel uses
0xc000_0000..0xffff_ffff.
- k
next prev parent reply other threads:[~2009-06-24 13:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-24 9:44 85xx Address space query kernel mailz
2009-06-24 13:15 ` Kumar Gala [this message]
2009-06-24 17:46 ` kernel mailz
2009-06-24 22:52 ` Scott Wood
2009-06-25 10:51 ` kernel mailz
2009-06-25 17:32 ` Kumar Gala
2009-06-25 17:52 ` kernel mailz
2009-06-25 17:58 ` Kumar Gala
2009-06-25 19:34 ` Scott Wood
2009-06-25 11:33 ` Benjamin Herrenschmidt
2009-06-25 11:32 ` Benjamin Herrenschmidt
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=D47FC871-1535-4DBF-8617-6EEA8C180484@kernel.crashing.org \
--to=galak@kernel.crashing.org \
--cc=kernelmailz@googlemail.com \
--cc=linuxppc-dev@ozlabs.org \
/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;
as well as URLs for NNTP newsgroup(s).