From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjDBl-0003Uy-2z for qemu-devel@nongnu.org; Thu, 03 Sep 2009 10:21:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjDBg-0003UK-L3 for qemu-devel@nongnu.org; Thu, 03 Sep 2009 10:21:24 -0400 Received: from [199.232.76.173] (port=58028 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjDBg-0003UH-HJ for qemu-devel@nongnu.org; Thu, 03 Sep 2009 10:21:20 -0400 Received: from mx20.gnu.org ([199.232.41.8]:36968) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MjDBe-0002d5-GE for qemu-devel@nongnu.org; Thu, 03 Sep 2009 10:21:18 -0400 Received: from mail-yx0-f201.google.com ([209.85.210.201]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjDBd-0007P4-Uv for qemu-devel@nongnu.org; Thu, 03 Sep 2009 10:21:18 -0400 Received: by yxe39 with SMTP id 39so1062683yxe.18 for ; Thu, 03 Sep 2009 07:21:14 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20090903120010.GA27116@1und1.de> References: <87ljkxibay.fsf@lechat.rtp-net.org> <1251980117-10089-1-git-send-email-kirill@shutemov.name> <20090903120010.GA27116@1und1.de> Date: Thu, 3 Sep 2009 17:21:13 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH v2] Build *-user targets as PIE From: "Kirill A. Shutemov" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Kirill A. Shutemov" , qemu-devel@nongnu.org On Thu, Sep 3, 2009 at 3:00 PM, Reimar D=C3=B6ffinger wrote: > On Thu, Sep 03, 2009 at 03:15:17PM +0300, Kirill A. Shutemov wrote: >> Now we can drop link hack for i386 and fix text relocations on i386 host= . >> >> v2: >> =C2=A0 - Add configure options do enable/disable PIE for usermode target= s. >> =C2=A0 =C2=A0 Disabling can be useful if you build uswing toolchain whic= h has >> =C2=A0 =C2=A0 broken PIE support. PIE for usermode targets enabled by de= fault. > > Hm. Would be nice if the commit message said more about the "why". What > is the advantage of PIE (I mean, is there something special about qemu > that makes it particularly useful)? The main advantage is that we can drop linking hack for i386 (and keep keep qemu self-virtualizable) and solve text relocations. The other advantage is security. Since qemu is PIE kernel can load at rando= m position in memory. It makes qemu harder for many types of attacks. > Is there any measurable speed > difference between PIE and no PIE? Actually, I have no numbers for qemu. PIE code usually is a bit slower. Approximately, 1% for i386 according to some tests. RISC architectures should be affected less, since they have more registers. On other hand we are getting rid from text relocations on i386 which make executable loading slower. So...