qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stuart Anderson <anderson@netsweng.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] linux-user EFAULT implementation
Date: Mon, 9 Jul 2007 07:41:34 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0707090734490.12799@trantor.stuart.netsweng.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0707061433490.12799@trantor.stuart.netsweng.com>

On Fri, 6 Jul 2007, Stuart Anderson wrote:

> So, the question is:
>
> 	Can I simplify this code to assume that guest and
> 	host addresses coexist and use the copy_*_user() or
> 	just the access_ok() interfaces?

Attached is a diff that shows what this will look like for the struct
sockaddr handling case. In short, the two functions for mapping this
structure get renamed

 	target_to_host_sockaddr -> copy_from_user_sockaddr
 	host_to_target_sockaddr -> copy_to_user_sockaddr

and lose the pg_access parameter as read/write access is determined
by wether we are copying to or from "user space". The macro access_ok()
is used to check the validity of the memory being accessed.

This change also completely drops the notion of locking and unlocking memory,
which was the previous model being used.

Fabrice,

Is this change what you had in mind? Does it cause a problem for anyone
else?



                                 Stuart

Stuart R. Anderson                               anderson@netsweng.com
Network & Software Engineering                   http://www.netsweng.com/
1024D/37A79149:                                  0791 D3B8 9A4C 2CDC A31F
                                                  BD03 0A62 E534 37A7 9149

  reply	other threads:[~2007-07-09 11:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-06 15:15 [Qemu-devel] [PATCH] linux-user EFAULT implementation Stuart Anderson
2007-07-06 16:08 ` Fabrice Bellard
2007-07-06 16:55   ` Stuart Anderson
2007-07-06 18:45     ` Stuart Anderson
2007-07-09 11:41       ` Stuart Anderson [this message]
2007-07-09 12:02         ` Stuart Anderson
2007-07-09 21:15         ` Fabrice Bellard
2007-07-10  2:22           ` Stuart Anderson
2007-07-10 12:38             ` Paul Brook
2007-07-10 20:45               ` Fabrice Bellard
2007-07-10 21:09                 ` Stuart Anderson
2007-07-13 17:55                   ` Stuart Anderson
2007-07-20 20:16                     ` 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=Pine.LNX.4.64.0707090734490.12799@trantor.stuart.netsweng.com \
    --to=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 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).