From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHROt-0002af-2p for qemu-devel@nongnu.org; Tue, 21 Jul 2015 02:51:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHROo-0006Dc-3I for qemu-devel@nongnu.org; Tue, 21 Jul 2015 02:51:39 -0400 Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]:34915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHROn-0006Cf-RQ for qemu-devel@nongnu.org; Tue, 21 Jul 2015 02:51:34 -0400 Received: by wgav7 with SMTP id v7so82240023wga.2 for ; Mon, 20 Jul 2015 23:51:33 -0700 (PDT) Sender: Richard Henderson References: <1435681199-14392-1-git-send-email-laurent@vivier.eu> <5592CE38.2010509@vivier.eu> <55932D09.5030102@vivier.eu> <20150701131536.GD11361@aurel32.net> <55942F8F.9070106@vivier.eu> From: Richard Henderson Message-ID: <55ADEBF1.7030602@twiddle.net> Date: Tue, 21 Jul 2015 07:51:29 +0100 MIME-Version: 1.0 In-Reply-To: <55942F8F.9070106@vivier.eu> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 8bit 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 , Aurelien Jarno Cc: Peter Maydell , Riku Voipio , QEMU Developers On 07/01/2015 07:21 PM, Laurent Vivier wrote: > > > Le 01/07/2015 15:15, Aurelien Jarno a écrit : >> On 2015-07-01 01:58, Laurent Vivier wrote: >>> >>> >>> Le 30/06/2015 19:20, Peter Maydell a écrit : >>>> On 30 June 2015 at 18:13, Laurent Vivier wrote: >>>>> >>>>> >>>>> Le 30/06/2015 18:45, Peter Maydell a écrit : >>>>>> 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=type-limits, this triggers an error: >>>>>>> >>>>>>> include/exec/cpu_ldst.h:60:31: error: comparison of unsigned expression < 0 is always false [-Werror=type-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. >>>> >>>> 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 >>>> >>>> I'd still favour removing it completely, personally... >>> >>> In fact, I have made more measurements, it saves only ~10 seconds on a >>> 13 minutes build. >>> >>> 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. > > I did a similar test on a PowerPC host, It is 2 seconds MORE on an 1m27s > build WITH --disable-guest-base. That should be measurement noise, since a PPC host changes nothing except the register number for the indexed memory address. Same for aarch64, s390, and sparc. We do reserve a register on ia64, but that does require an extra insn. The implementation is less friendly for arm and mips. The former because it's pressed for registers, and the later because it hasn't seen much tlc recently. > So, definitively, I think the option can be dropped. Also agreed. One can still force the same effect at runtime with -B. r~