From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KFq1b-0001b7-SY for qemu-devel@nongnu.org; Mon, 07 Jul 2008 08:40:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KFq1Y-0001Y4-6y for qemu-devel@nongnu.org; Mon, 07 Jul 2008 08:40:59 -0400 Received: from [199.232.76.173] (port=60160 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KFq1Y-0001Xt-0Z for qemu-devel@nongnu.org; Mon, 07 Jul 2008 08:40:56 -0400 Received: from gecko.sbs.de ([194.138.37.40]:17057) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KFq1X-0000tg-4p for qemu-devel@nongnu.org; Mon, 07 Jul 2008 08:40:55 -0400 Received: from mail2.sbs.de (localhost [127.0.0.1]) by gecko.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id m67CehUv014831 for ; Mon, 7 Jul 2008 14:40:43 +0200 Received: from [139.25.109.167] (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail2.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id m67Ceh8r024763 for ; Mon, 7 Jul 2008 14:40:43 +0200 Message-ID: <48720EC8.3000408@siemens.com> Date: Mon, 07 Jul 2008 14:40:40 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <486CECB1.8000504@siemens.com> In-Reply-To: <486CECB1.8000504@siemens.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [REGRESSION] mprotect in guest makes qemu-i386 crash Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Jan Kiszka wrote: > Hi, > > this fragment from a code self-modification test of mine used to work a > few weeks ago with qemu-i386 userspace emulation. Now it causes a segfault. > > #include > main() > { > mprotect((void *)((unsigned long)main & ~0xfff), 0x1000, > PROT_READ|PROT_WRITE|PROT_EXEC); > } > > qemu-x86_64 even complains about an "Unsupported syscall: 221", while > the same 64-bit binary works fine with 0.9.1 (I don't recall anymore if > it worked recently with SVN head). Some clarification: mprotect is fine with qemu-x86_64, that syscall warning is another, unrelated issue (it pops up with every x86_64 application in userland emu). That leaves us with mprotect being broken in qemu-i386 on x86_64 hosts. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux