From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMxiP-0007dH-K1 for qemu-devel@nongnu.org; Thu, 28 Aug 2014 07:18:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMxiG-0007Qi-JS for qemu-devel@nongnu.org; Thu, 28 Aug 2014 07:18:05 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:55322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMxiG-0007QW-CI for qemu-devel@nongnu.org; Thu, 28 Aug 2014 07:17:56 -0400 Received: by mail-wi0-f177.google.com with SMTP id cc10so673533wib.16 for ; Thu, 28 Aug 2014 04:17:55 -0700 (PDT) Date: Thu, 28 Aug 2014 12:17:51 +0100 From: Stefan Hajnoczi Message-ID: <20140828111751.GJ26741@stefanha-thinkpad.redhat.com> References: <1408704863-12343-1-git-send-email-famz@redhat.com> <20140822133519.GC14126@stefanha-thinkpad.redhat.com> <20140825022707.GA3015@T430.nay.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lYetfuAxy9ic4HK3" Content-Disposition: inline In-Reply-To: <20140825022707.GA3015@T430.nay.redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 0/7] build-sys: Fix iscsi module loading failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, peter.crosthwaite@xilinx.com, mjt@tls.msk.ru, qemu-devel@nongnu.org, Stefan Hajnoczi , pbonzini@redhat.com --lYetfuAxy9ic4HK3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 25, 2014 at 10:27:07AM +0800, Fam Zheng wrote: > On Fri, 08/22 14:35, Stefan Hajnoczi wrote: > > Did you compare the before/after binary size with your patch? Please > > use size(1). >=20 > Before: >=20 > text data bss dec hex filename > 24264 3016 8 27288 6a98 /home/fam/build/master/block= -iscsi.so > 24264 3016 8 27288 6a98 /home/fam/build/master/block= /iscsi.so > 35356 2272 4440 42068 a454 /home/fam/build/master/fsdev= /virtfs-proxy-helper > 392541 7568 4672 404781 62d2d /home/fam/build/master/qemu-= ga > 878979 33168 4204568 5116715 4e132b /home/fam/build/master/qemu-= img > 904801 57784 4208664 5171249 4ee831 /home/fam/build/master/qemu-= io > 854255 32872 4204504 5091631 4db12f /home/fam/build/master/qemu-= nbd > 4896094 1293960 4727496 10917550 a696ae /home/fam/build/master/x86_6= 4-softmmu/qemu-system-x86_64 >=20 > After: >=20 > text data bss dec hex filename > 23852 2992 8 26852 68e4 /home/fam/build/iscsi-module= s/block-iscsi.so > 23852 2992 8 26852 68e4 /home/fam/build/iscsi-module= s/block/iscsi.so > 509345 32488 5192 547025 858d1 /home/fam/build/iscsi-module= s/fsdev/virtfs-proxy-helper > 563169 33312 5192 601673 92e49 /home/fam/build/iscsi-module= s/qemu-ga > 966709 58304 4204632 5229645 4fcc4d /home/fam/build/iscsi-module= s/qemu-img > 940145 58088 4208792 5207025 4f73f1 /home/fam/build/iscsi-module= s/qemu-io > 943434 58048 4204632 5206114 4f7062 /home/fam/build/iscsi-module= s/qemu-nbd > 4904197 1293944 4727560 10925701 a6b685 /home/fam/build/iscsi-module= s/x86_64-softmmu/qemu-system-x86_64 It doesn't have a big impact on the QEMU binary. The QEMU tools do get a bit bloated though. I guess I'm happy with this approach. > > > > It's unfortunate to bloat the binary, not just from a code size > > perspective, but also from a security perspective less code is better > > (cannot be abused in return-oriented-programming). > >=20 >=20 > So would it be a good idea to share code between executables with a > qemu-common.so? (The same as existing modules, we also check the stamp sy= mbol > so that it must be built in the same source tree.) No, I don't think there is any code size advantage to putting things in a common shared library. The whole library will be mmapped so it doesn't reduce code size. Stefan --lYetfuAxy9ic4HK3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT/w/fAAoJEJykq7OBq3PIPjAH/3idZwgFhveHhM6V8ihC3a+2 S20khMOKLVbP38SuiCFnByLEMTJGZWl0AwYe8oIE03/kHCG6YznaDUzhXi9E4t/F pUDwqJQtpeMS3nfArusInEhCd2OsYW7vjN2yqH1U8RoESNWuyBALpTcVp8hCRhnf rHsEumGhSh9zkYzzGv+xPFZGzLfx9h194nlHkVFuoJ+aUsktQ345qHDj/6uXbcxb MMNX8uXqITugYW4RsW2tiPLvA41r8+jv+JH9yXsIABMKhIm/b9ntri+v1f1sFPAB lPIP4ePR9wEA8A2APBF/YMvSQjjq9fp5DTuVHEv7FMxpC1AntY7oCjQjL3f1U3g= =KsJp -----END PGP SIGNATURE----- --lYetfuAxy9ic4HK3--