From: Fabrice Bellard <fabrice@bellard.org>
To: thayne@c2.net, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [PATCH] efault - add data type to put_user()/get_user()
Date: Sat, 03 Nov 2007 20:05:13 +0100 [thread overview]
Message-ID: <472CC669.30907@bellard.org> (raw)
In-Reply-To: <1194045983.2168.17.camel@phantasm.home.enterpriseandprosperity.com>
I think that using host addresses in __put_user and __get_user is not
logical. They should use target addresses as get_user and put_user. As
Paul said, It is not worth mixing get/put/copy and lock/unlock functions.
The ultimate goal of such cleanup is not only to generate -EFAULT
correctly but also to be able to have arbitrary address space changes.
In fact it would be good to be able to introduce an arbitrary address
space change (such as a translation as Paul did) so that we can verify
that all the Linux emulation stills works in this case.
Regards,
Fabrice.
Thayne Harbaugh wrote:
> On Wed, 2007-10-31 at 16:44 -0600, Thayne Harbaugh wrote:
>> This patch updates get_user() and put_user() to take a third argument of
>> data type. get_user() and put_user() use target address which are
>> target_ulong and don't reflect the data type pointed to in target
>> memory.
>>
>> Simply casting the target_ulong to a type before passing to
>> get/put_user() is poor because target_ulong isn't always a simple cast
>> to a host type (consider 32 bit on 64 bit where address are either
>> extended or truncate). Also, simple casting of the argument to
>> get/put_user() results in several warnings when target and long pointer
>> sizes don't match.
>>
>> This patch has additional updates to fix places where get/put_user() are
>> already used.
>
> This is an updated patch that doesn't conflict with the
> abi_long/abi_ulong changes from a couple weeks ago.
next prev parent reply other threads:[~2007-11-03 19:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 22:30 [Qemu-devel] [PATCH] efault - verify pages are in cache and are read/write Thayne Harbaugh
2007-10-31 22:35 ` [Qemu-devel] Re: [PATCH] efault - update __get_user() __put_user() Thayne Harbaugh
2007-10-31 22:43 ` [Qemu-devel] Re: [PATCH] efault - add data type to put_user()/get_user() Thayne Harbaugh
2007-11-02 23:26 ` Thayne Harbaugh
2007-11-03 15:56 ` Thiemo Seufer
2007-11-03 19:05 ` Fabrice Bellard [this message]
2007-11-05 20:22 ` Thayne Harbaugh
2007-11-05 20:43 ` Thayne Harbaugh
2007-11-05 21:42 ` Fabrice Bellard
2007-11-05 23:00 ` Thayne Harbaugh
2007-11-05 23:33 ` Fabrice Bellard
2007-10-31 22:49 ` [Qemu-devel] Re: [PATCH] efault Thayne Harbaugh
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=472CC669.30907@bellard.org \
--to=fabrice@bellard.org \
--cc=qemu-devel@nongnu.org \
--cc=thayne@c2.net \
/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).