qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] RFC: [0/11] EFAULT patch


From: Stuart Anderson
Subject: Re: [Qemu-devel] RFC: [0/11] EFAULT patch
Date: Wed, 19 Sep 2007 07:30:49 -0400 (EDT)

On Wed, 19 Sep 2007, J. Mayer wrote:

The idea is great but there seem to be a problem in those patches:
you directly cast syscall arguments, which are (or should be)
target_ulong to pointers in the host environment. You should to use the
g2h / h2g macros to get the pointer in the host memory from the offset
in the target address space.

I was explicitly told to _not_ use these in this code.

Offset in the target address  space can not
be assumed to be the same size as an address in the host address space,

And in fact, they definitely are not the same in certain cobinations.

thus can never be casted directly to host pointer.

At some point, we have to convert things from target_long to a host
pointer. If we can agree on what that right mechanism it to do this, I'd
be glad to use it. So far, everything I've seen involved some form of
type casting.


This used to be handled by the lock_user functions and should be handled
in your patch too...

It was handled by g2h() which was just a typecast hidden behind the
macro.


                                Stuart

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]