qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stuart Anderson <anderson@netsweng.com>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] RFC: x86_64 Best way to fix 'cast to pointer from integer of different size' problems?
Date: Tue, 6 Nov 2007 17:19:40 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0711061715070.17870@trantor.stuart.netsweng.com> (raw)
In-Reply-To: <200711062205.34944.paul@codesourcery.com>

On Tue, 6 Nov 2007, Paul Brook wrote:

> If you're not careful you get double-copying. Once copying the struct from
> guest to host space, and then again when converting layout/endianess.

Yes, it would be easy to do that by mistake. The approach that has been
taken has been to use typed copy_*_user_<type>() routines for the structs
instead of using a seperate untyped copy_*_user() followed by a
convert_<type>() routine. The copy_*_user_<type>() routines do the copy
and convert in a single step.

This will never be as fast as an optimized buffer copy, but it will also
not be as slow as having seperate routines.



                                 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-11-06 22:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-03 17:26 [Qemu-devel] RFC: x86_64 Best way to fix 'cast to pointer from integer of different size' problems? TJ
2007-11-03 17:52 ` Paul Brook
2007-11-05 19:51   ` Thayne Harbaugh
2007-11-06  1:05     ` Paul Brook
2007-11-06  2:00       ` Thayne Harbaugh
2007-11-07 19:18         ` Fabrice Bellard
2007-11-07 20:59           ` Thayne Harbaugh
2007-11-07 23:02           ` Paul Brook
2007-11-12 16:42           ` Thayne Harbaugh
2007-11-06 20:05       ` Fabrice Bellard
2007-11-06 21:52         ` Stuart Anderson
2007-11-06 22:05           ` Paul Brook
2007-11-06 22:19             ` Stuart Anderson [this message]

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.0711061715070.17870@trantor.stuart.netsweng.com \
    --to=anderson@netsweng.com \
    --cc=paul@codesourcery.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).