From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MEVXg-00009b-1a for qemu-devel@nongnu.org; Wed, 10 Jun 2009 17:41:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MEVXe-00008u-DG for qemu-devel@nongnu.org; Wed, 10 Jun 2009 17:41:07 -0400 Received: from [199.232.76.173] (port=50315 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEVXe-00008o-8m for qemu-devel@nongnu.org; Wed, 10 Jun 2009 17:41:06 -0400 Received: from naru.obs2.net ([84.20.150.76]:56217) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MEVXd-0004Mv-Ra for qemu-devel@nongnu.org; Wed, 10 Jun 2009 17:41:06 -0400 Date: Thu, 11 Jun 2009 00:41:02 +0300 From: Riku Voipio Subject: Re: [Qemu-devel] [PATCH] linux-user: shmctl() should ignore IPC_64 Message-ID: <20090610214102.GA23525@kos.to> References: <1243895557-18462-1-git-send-email-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1243895557-18462-1-git-send-email-laurent@vivier.eu> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: qemu-devel@nongnu.org On Tue, Jun 02, 2009 at 12:32:37AM +0200, Laurent Vivier wrote: > This has been detected trying to use "dbench" with m68k-linux-user/qemu-m68k where > "shmctl()" is called with "IPC_RMID | IPC_64". > > IPC_64 is useless with IPC_RMID, SHM_LOCK, SHM_UNLOCK > (as the only parameter is the id without shmid_ds) and > already ignored with semctl() and msgctl(). > > Signed-off-by: Laurent Vivier > --- > linux-user/syscall.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index b1bba48..c3d1d73 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -2539,11 +2539,11 @@ static abi_long do_ipc(unsigned int call, int first, > > /* IPC_* and SHM_* command values are the same on all linux platforms */ > case IPCOP_shmctl: > - switch(second) { > + switch(second & 0xff) { This appears to be also taken care in this old patch where shmctl was moved to do_shmctl() https://git.maemo.org/projects/qemu/gitweb?p=qemu;a=commitdiff;h=d1f365ccd0615c57d2869d33fb5e0637b3623b64 > case IPC_RMID: > case SHM_LOCK: > case SHM_UNLOCK: > - ret = get_errno(shmctl(first, second, NULL)); > + ret = get_errno(shmctl(first, second & 0xff, NULL)); > break; > default: > goto unimplemented; > -- > 1.5.6.5 > >