From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Stuart Anderson <anderson@netsweng.com>
Subject: Re: [Qemu-devel] RFC: [0/11] EFAULT patch
Date: Wed, 19 Sep 2007 21:00:43 +0100 [thread overview]
Message-ID: <200709192100.43630.paul@codesourcery.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0709191442580.20150@trantor.stuart.netsweng.com>
On Wednesday 19 September 2007, Stuart Anderson wrote:
> On Wed, 19 Sep 2007, J. Mayer wrote:
> > Then, the changes you've done, changing long arguments (which should be
> > target_long to be correct, you can take a look at the last patch I sent
> > on the list) to pointers, for example in function prototypes, are
> > incorrect.
>
> I just went, and looked at the linux code again for 32 on 64 for x86_64 and
> powerpc. In both of these cases (and I suspect the others as well), the
> parameters which are passed via registers are 0 extended from 32 bits to
> 64 bit in the syscall entry asm code. This way, once the C code is
> called via the sys_call_table, everything is dealt with as 64 bits. This
> actually keeps the rest of the code simpler as the rest of the kernel
> doesn't have to be extending & truncating pointers everywhere else.
>
> On x86_64 and powerpc, it appears that both user (ie target) and kernel
> pointers co-exist and that the code that maps structures assume that the
> __get_user()/__put_user() and copy_*_user() routines can handle any
> special situation. The pointers passed into functions like
> cp_compat_stat() are 64-bits for both the structure located in the
> kernel, and the one located in user space.
>
> My understanding is that we want to do as the kernel does as much as
> possible. In light of this, wouldn't we want to be decreasing the use
> of target_long where pointers may be involved instead of increasing it?
No. We're doing more than most 32-64 syscall thunks. To a first approximation
the syscall thunks can bindly zero extend all values. In qemu we need to know
whether something is a pointer or a value.
Kernel and userspace addresses are not interchangeable in the kernel. Any
place that does so is probably a bug.
Paul
next prev parent reply other threads:[~2007-09-19 20:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-19 0:59 [Qemu-devel] RFC: [0/11] EFAULT patch Stuart Anderson
2007-09-19 2:05 ` J. Mayer
2007-09-19 11:30 ` Stuart Anderson
2007-09-19 15:22 ` Paul Brook
2007-09-19 19:00 ` Stuart Anderson
2007-09-19 19:26 ` J. Mayer
2007-09-19 20:00 ` Paul Brook [this message]
2007-09-19 20:44 ` Stuart Anderson
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=200709192100.43630.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=anderson@netsweng.com \
--cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.