qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Pranith Kumar <bobby.prani@gmail.com>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] alpha: Fix build error for linux-user
Date: Thu, 16 Jun 2016 12:07:40 -0700	[thread overview]
Message-ID: <64e568b4-863d-fa79-185e-0da4c719d10d@twiddle.net> (raw)
In-Reply-To: <20160616185639.5312-1-bobby.prani@gmail.com>

On 06/16/2016 11:56 AM, Pranith Kumar wrote:
> Using gcc 6.1 for alpha-linux-user target we see the following build
> error:
> 
> /mnt/devops/code/qemu/target-alpha/translate.c: In function ‘in_superpage’:
> /mnt/devops/code/qemu/target-alpha/translate.c:454:52: error: self-comparison always evaluates to true [-Werror=tautological-compare]
>              && addr >> TARGET_VIRT_ADDR_SPACE_BITS == addr >> 63);
> 
> Fix it by replacing (addr >> 63) by '1' which is what it evaluates to
> since addr is negative.
> 
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> ---
>  target-alpha/translate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target-alpha/translate.c b/target-alpha/translate.c
> index f9b2426..31da6ea 100644
> --- a/target-alpha/translate.c
> +++ b/target-alpha/translate.c
> @@ -451,7 +451,7 @@ static bool in_superpage(DisasContext *ctx, int64_t addr)
>      return ((ctx->tb->flags & TB_FLAGS_USER_MODE) == 0
>              && addr < 0
>              && ((addr >> 41) & 3) == 2
> -            && addr >> TARGET_VIRT_ADDR_SPACE_BITS == addr >> 63);
> +            && addr >> TARGET_VIRT_ADDR_SPACE_BITS == 1);
>  }

This fix is incorrect.

  (1) addr is not always negative.
  (2) in_superpage is only relevant for alpha-softmmu, where
      TARGET_VIRT_ADDR_SPACE_BITS is not 63.


r~

  reply	other threads:[~2016-06-16 19:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 18:56 [Qemu-devel] [PATCH] alpha: Fix build error for linux-user Pranith Kumar
2016-06-16 19:07 ` Richard Henderson [this message]
2016-06-16 19:15   ` Pranith Kumar
2016-06-17  0:43     ` Laurent Vivier
2016-06-17 17:20       ` Pranith Kumar
2016-06-17 18:04   ` Paolo Bonzini
2016-06-17 18:07     ` Pranith Kumar
2016-06-17 18:09       ` Richard Henderson
2016-06-17 18:12         ` Pranith Kumar

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=64e568b4-863d-fa79-185e-0da4c719d10d@twiddle.net \
    --to=rth@twiddle.net \
    --cc=bobby.prani@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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).