qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Laurent Vivier <laurent@vivier.eu>
Cc: Riku Voipio <riku.voipio@iki.fi>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] linux-user: Avoid compilation error with --disable-guest-base
Date: Tue, 30 Jun 2015 18:20:00 +0100	[thread overview]
Message-ID: <CAFEAcA8gafOxWNF0myH8ATMqJkS2SEdUA34=unsEVEf_qcd6bQ@mail.gmail.com> (raw)
In-Reply-To: <5592CE38.2010509@vivier.eu>

On 30 June 2015 at 18:13, Laurent Vivier <laurent@vivier.eu> wrote:
>
>
> Le 30/06/2015 18:45, Peter Maydell a écrit :
>> On 30 June 2015 at 17:19, Laurent Vivier <laurent@vivier.eu> 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...

>> "ul" as a suffix is almost always wrong, incidentally,
>> though obviously here you're just copying the condition
>> from the existing code. Consider the case when an
>> unsigned long is 32 bits but TARGET_VIRT_ADDR_SPACE_BITS
>> is 32 or more (ie almost always on a 32-bit host).
>
> I think it can't happen because of previous lines:
>
> ...
> #if HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS
> #define h2g_valid(x) 1
> #else
> ...

Oops, yes, I didn't read back far enough.

As a patch to fix a compile warning for 2.4,
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

(it's a bit sad the compiler doesn't notice that
it will never evaluate the x < 0 expression.)

thanks
-- PMM

  reply	other threads:[~2015-06-30 17:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 16:19 [Qemu-devel] [PATCH] linux-user: Avoid compilation error with --disable-guest-base Laurent Vivier
2015-06-30 16:45 ` Peter Maydell
2015-06-30 17:13   ` Laurent Vivier
2015-06-30 17:20     ` Peter Maydell [this message]
2015-06-30 23:58       ` Laurent Vivier
2015-07-01 11:12         ` Peter Maydell
2015-07-01 13:15         ` Aurelien Jarno
2015-07-01 18:21           ` Laurent Vivier
2015-07-01 19:46             ` Aurelien Jarno
2015-07-21  6:51             ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA8gafOxWNF0myH8ATMqJkS2SEdUA34=unsEVEf_qcd6bQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).