qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] mips-linux-user and POSIX IPC
@ 2011-07-26  8:56 Holger Freyther
  2011-07-28 15:25 ` Riku Voipio
  0 siblings, 1 reply; 2+ messages in thread
From: Holger Freyther @ 2011-07-26  8:56 UTC (permalink / raw)
  To: qemu-devel

Hi All,

I have no idea about the MIPS ABI (or which one I am actually
using). I try to run Qt/Embedded using the linux-user target and
have some issues with the code.

For semctl qemu enters through the do_ipc method, it appears
to be that the 'variable' ptr is really a ptr (to the stack) and
needs to be dereferenced. The below snippet seems to fix that
issue for me.

My next problem is with do_shmctl, somehow third is NULL but it
should point to the out parameter (and the application is doing
this correctly as well). While trying to understand the issue it
looks like target_to_host_shmid_ds will not properly unlock the
struct on all paths.

Is the IPC emulation supposed to work? Is this an 'obvious' API
issue for MIPS?



@@ -2873,7 +2886,13 @@ static abi_long do_ipc(
         break;
 
     case IPCOP_semctl:
-        ret = do_semctl(first, second, third, (union \n
target_semun)(abi_ulong) ptr);
+        if (!lock_user_struct(VERIFY_READ, semun, ptr, 1))
+               ret = -TARGET_EFAULT;
+       else {
+               __get_user(t_semun.buf, &semun->buf);
+               ret = do_semctl(first, second, third, t_semun);
+               unlock_user_struct(semun, ptr, 0);
+       }
         break;
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-28 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-26  8:56 [Qemu-devel] mips-linux-user and POSIX IPC Holger Freyther
2011-07-28 15:25 ` Riku Voipio

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).