From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsJqb-0007NR-4o for qemu-devel@nongnu.org; Mon, 07 Jan 2013 16:03:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsJqZ-0004K3-O9 for qemu-devel@nongnu.org; Mon, 07 Jan 2013 16:03:05 -0500 Received: from mail-qc0-f176.google.com ([209.85.216.176]:53024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsJqZ-0004Jv-J5 for qemu-devel@nongnu.org; Mon, 07 Jan 2013 16:03:03 -0500 Received: by mail-qc0-f176.google.com with SMTP id n41so12981198qco.21 for ; Mon, 07 Jan 2013 13:03:02 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1357591919.3256.3.camel@Quad> References: <1357590634-9768-1-git-send-email-laurent@vivier.eu> <1357591919.3256.3.camel@Quad> From: Peter Maydell Date: Mon, 7 Jan 2013 21:02:11 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] linux-user: correct reboot() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Riku Voipio , qemu-devel@nongnu.org On 7 January 2013 20:51, Laurent Vivier wrote: > Le lundi 07 janvier 2013 =C3=A0 20:42 +0000, Peter Maydell a =C3=A9crit : >> On 7 January 2013 20:30, Laurent Vivier wrote: >> > + ret =3D reboot(arg1, arg2, arg3, (void*)(unsigned long)arg= 4); >> >> I don't think we should pass arg4 in this case. It's a pointer, so it's >> definitely wrong to pass a pointer we haven't converted somehow. >> Just passing NULL would be better, I think; that will be safe and >> make it reasonably obvious we need to fix something if the kernel >> ever for some reason adds a new command that takes an argument. > > Yes, but in the traces I have, arg4 is 1. Can we accept to loose it ? That will be because the syscall is just picking up whatever random junk happens to be in the register than arg4 gets passed in. If you look at the kernel sources: http://lxr.linux.no/#linux+v3.7.1/kernel/sys.c#L425 'arg' is ignored for every other command. -- PMM