qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Updated RFC: linux user problems]]


From: J. Mayer
Subject: [Qemu-devel] Updated RFC: linux user problems]]
Date: Fri, 21 Sep 2007 08:39:19 +0200

-------- Forwarded Message --------
> From: Jocelyn Mayer <address@hidden>
> Reply-To: address@hidden, address@hidden
> To: address@hidden
> Subject: Re: [Fwd: [Qemu-devel] RFC: linux user problems]
> Date: Wed, 19 Sep 2007 11:23:03 +0200
> 
> On Wed, 2007-09-19 at 10:07 +0100, Thiemo Seufer wrote:
> > J. Mayer wrote:
> > > Following my previous message, I did a patch that makes syscalls take
> > > target_long/target_ulong argument and return target_long value instead
> > > of long/unsigned long.
> > > I also included the #ifdef protection for do_socketcall and do_ipc to
> > > avoid compilation warnings.
> > > And I also converted the fd given to do_ioctl to be an int.
> > > 
> > > In addition to my previous remarks, I noticed some other things while
> > > reading the code:
> > > - the do_msgctl function seems very strange to me. It looks like half of
> > > the code is missing in the switch...
> > > - do_ipc directly uses pointers from the emulated environment without
> > > using lock_user related functions like it seems to be done everywhere
> > > else.
> > > - there are at least two problems in IPCOP_shmat:
> > >  * the returned address could not fit in the target address space when
> > > emulating a 32 bits
> > >   target on a 64 bits host
> > > * the returned address is always casted into a 32 bits value. I changed
> > > this to be target_ulong.
> > > - I also noticed some suspicious warnings (cast between pointer and
> > > integer of different size) that may hide other problems:
> > > * target_to_host_cmsg:567
> > > * host_to_target_cmsg:612
> > > * do_ipc:1608
> > > * do_ipc: 1620
> > > * do_ipc: 1644
> > > * do_ipc: 1654
> > > * do_ipc: 1676 (multiple times)
> > > * do_ipc: 1688
> > > * do_ipc: 1710
>  > > * write_ldt:2009
> > > * do_syscall:2684
> > > * do_syscall: 3901
>  > > * do_syscall: 3902
> > > * do_syscall: 4669
> > > 
> > > May someone take a look at my patch and say if it seems reasonable to
> > > include this in the repository ?
> > 
> > Looks reasonable, but introduces new compiler warnings
> > (on a ppc32/Linux host):

The reported warnings have been fixed.
There are still a lot of warnings related to 32/64 bits invalid casts on
64 bits hosts (see above) which will need to be fixed once.

I also changed some parameters of do_ipc from long to int (instead of
target_long), following the do_ipc man page specification, and reported
this change in child functions. There may be more to do...

Please comment...


-- 
J. Mayer <address@hidden>
Never organized

Attachment: syscall.diff
Description: Text Data


reply via email to

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