Received: from eggs.gnu.org ([140.186.70.92]:34686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qle7U-0003HR-56 for qemu-devel@nongnu.org; Tue, 26 Jul 2011 05:40:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qle7T-00049u-43 for qemu-devel@nongnu.org; Tue, 26 Jul 2011 05:40:08 -0400 Received: from lo.gmane.org ([80.91.229.12]:33509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qle7S-00048N-RT for qemu-devel@nongnu.org; Tue, 26 Jul 2011 05:40:07 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qle7Q-0000Ix-O4 for qemu-devel@nongnu.org; Tue, 26 Jul 2011 11:40:04 +0200 Received: from 91-64-80-26-dynip.superkabel.de ([91.64.80.26]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Jul 2011 11:40:04 +0200 Received: from zecke by 91-64-80-26-dynip.superkabel.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Jul 2011 11:40:04 +0200 From: Holger Freyther Date: Tue, 26 Jul 2011 08:56:38 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] mips-linux-user and POSIX IPC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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;