All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Alexander Graf <agraf@suse.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] TCG: Fix I64-on-32bit-host temporaries
Date: Tue, 21 Jan 2014 08:35:52 -0800	[thread overview]
Message-ID: <52DEA1E8.5030007@twiddle.net> (raw)
In-Reply-To: <1390146811-59936-1-git-send-email-agraf@suse.de>

On 01/19/2014 07:53 AM, Alexander Graf wrote:
> We have cache pools of temporaries that we can reuse later when they've
> already been allocated before.
> 
> These cache pools differenciate between the target TCG variable type they
> contain. So we have one pool for I32 and one pool for I64 variables.
> 
> On a 32bit system, we can't work with 64bit registers though. So instead we
> spawn two I32 temporaries for every I64 temporary we create. All caching
> works the same way as on a real 64-bit system though: We create a cache entry
> in the 64bit array for the first i32 index.
> 
> However, when we free such a temporary we free it to the pool of its type
> (which is always i32 on 32bit systems) rather than its base_type (which is
> i64 or i32 depending on the variable). This means we put a temporary that
> is of base_type == i64 into the i32 preallocated temporary pool.
> 
> Eventually, this results in failures like this on 32bit hosts:
> 
>   qemu-system-ppc64: tcg/tcg.c:515: tcg_temp_new_internal: Assertion `ts->base_type == type' failed.
> 
> This patch makes the free routine use the base_type instead for the free case,
> so it's consistent with the temporary allocation. It fixes the above failure
> for me.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  tcg/tcg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~

  reply	other threads:[~2014-01-21 16:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-19 15:53 [Qemu-devel] [PATCH] TCG: Fix I64-on-32bit-host temporaries Alexander Graf
2014-01-21 16:35 ` Richard Henderson [this message]
2014-01-30 13:59 ` Peter Maydell

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=52DEA1E8.5030007@twiddle.net \
    --to=rth@twiddle.net \
    --cc=agraf@suse.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.