qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thiemo Seufer <ths@networkno.de>
To: "J. Mayer" <l_indien@magic.fr>
Cc: qemu-devel@nongnu.org
Subject: Re: [Fwd: [Qemu-devel] RFC: linux user problems]
Date: Wed, 19 Sep 2007 10:07:52 +0100	[thread overview]
Message-ID: <20070919090752.GN9972@networkno.de> (raw)
In-Reply-To: <1190158103.14938.315.camel@rapid>

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:1609
> * do_ipc: 1621
> * do_ipc: 1645
> * do_ipc: 1655
> * do_ipc: 1677 (multiple times)
> * do_ipc: 1687
> * do_ipc: 1711
> * do_syscall:2686
> * do_syscall: 3903
> * do_syscall: 4671
> 
> 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):

Most (all?) targets show:

/home/ths/qemu/qemu-work/linux-user/syscall.c: In function do_ipc':
/home/ths/qemu/qemu-work/linux-user/syscall.c:1612: warning: long int format, target_long arg (arg 2)

There's also one instance of:

/home/ths/qemu/qemu-work/linux-user/syscall.c: At top level:
/home/ths/qemu/qemu-work/linux-user/syscall.c:1258: warning: 'shm_regions' defined but not used

which looks like a missing #ifdef TARGET_NR_ipc.


Thiemo

  reply	other threads:[~2007-09-19  9:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18 23:28 [Fwd: [Qemu-devel] RFC: linux user problems] J. Mayer
2007-09-19  9:07 ` Thiemo Seufer [this message]
2007-09-19  9:23   ` Jocelyn Mayer

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=20070919090752.GN9972@networkno.de \
    --to=ths@networkno.de \
    --cc=l_indien@magic.fr \
    --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).