From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAHrd-00019I-UE for qemu-devel@nongnu.org; Wed, 01 Jul 2015 09:15:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAHrX-0006z6-PN for qemu-devel@nongnu.org; Wed, 01 Jul 2015 09:15:45 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:46985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAHrX-0006yc-9O for qemu-devel@nongnu.org; Wed, 01 Jul 2015 09:15:39 -0400 Date: Wed, 1 Jul 2015 15:15:36 +0200 From: Aurelien Jarno Message-ID: <20150701131536.GD11361@aurel32.net> References: <1435681199-14392-1-git-send-email-laurent@vivier.eu> <5592CE38.2010509@vivier.eu> <55932D09.5030102@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <55932D09.5030102@vivier.eu> Subject: Re: [Qemu-devel] [PATCH] linux-user: Avoid compilation error with --disable-guest-base List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Peter Maydell , Riku Voipio , QEMU Developers On 2015-07-01 01:58, Laurent Vivier wrote: >=20 >=20 > Le 30/06/2015 19:20, Peter Maydell a =E9crit : > > On 30 June 2015 at 18:13, Laurent Vivier wrote: > >> > >> > >> Le 30/06/2015 18:45, Peter Maydell a =E9crit : > >>> On 30 June 2015 at 17:19, Laurent Vivier wrote: > >>>> When guest base is disabled, RESERVED_VA is 0, and > >>>> (__guest < RESERVED_VA) is always false as __guest is unsigned. > >>>> > >>>> With -Werror=3Dtype-limits, this triggers an error: > >>>> > >>>> include/exec/cpu_ldst.h:60:31: error: comparison of unsigned exp= ression < 0 is always false [-Werror=3Dtype-limits] > >>>> (!RESERVED_VA || (__guest < RESERVED_VA)); \ > >>>> > >>>> This patch removes this comparison when guest base is disabled. > >>> > >>> Is there a useful reason to compile with --disable-guest-base > >>> (ie why we should retain the !CONFIG_USE_GUEST_BASE code > >>> in QEMU at all) ? It was originally optional because we > >>> didn't support it in all our TCG hosts, but we fixed that > >>> back in 2012... > >> > >> TCG generates less code, so performance is better (well, it is what I > >> guess). > >> > >> I've compiled a kernel with and without guest base in a chrooted > >> linux-user-qemu. > >> Without guest base it is ~1 minute less for a 13 minutes build. > >> > >> I can do more tests if you want. > >=20 > > Hmm. That's a fair chunk of speedup. On the downside: > > * you only get this if you're willing to build QEMU from > > source with funny options > > * it won't work for all guest/host combinations (sometimes > > the guest really wants to be able to map at low addresses > > the host won't permit) > > * it's an extra configuration to maintain which we're > > clearly not testing at all upstream > >=20 > > I'd still favour removing it completely, personally... >=20 > In fact, I have made more measurements, it saves only ~10 seconds on a > 13 minutes build. >=20 > my test is: "make -j 4 vmlinux" > (target: m68k, host: x86_64, 4 cores x 2 threads) Note that on x86_64, guest base is implemented by using the gs segment register. That explains why the impact should be relatively low, as your test shows. > --enable-guest-base >=20 > real 13m26.134s 13m28.712s 13m28.053s 13m28.875s > user 52m44.882s 52m56.075s 52m49.223s 52m55.366s > sys 0m33.452s 0m33.613s 0m33.013s 0m33.336s >=20 > --disable-guest-base >=20 > real 13m20.412s 13m17.773s 13m15.836s 13m13.278s > user 52m23.165s 52m7.184s 52m1.547s 51m50.277s > sys 0m33.427s 0m33.392s 0m32.954s 0m33.430s >=20 > Laurent >=20 >=20 >=20 >=20 --=20 Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net