[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/15] tcg-sparc: Do not use a global register f
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 09/15] tcg-sparc: Do not use a global register for AREG0. |
Date: |
Mon, 26 Mar 2012 17:22:57 +0000 |
On Mon, Mar 26, 2012 at 16:52, Richard Henderson <address@hidden> wrote:
> On 03/26/12 09:31, Blue Swirl wrote:
>>> > +/* In dyngen-exec.h, without AREG0, we fall back to an alias to
>>> > cpu_single_env.
>>> > + We can't actually tell from here whether that's needed or not, but it
>>> > does
>>> > + not hurt to go ahead and make the declaration. */
>>> > +#ifndef CONFIG_TCG_PASS_AREG0
>>> > +extern
>>> > +#ifdef __linux__
>>> > + __thread
>>> > +#endif
>>> > + CPUArchState *env __attribute__((alias("tls__cpu_single_env")));
>>> > +#endif /* CONFIG_TCG_PASS_AREG0 */
>> Please use DECLARE_TLS/DEFINE_TLS and global env accesses should also
>> use tls_var().
>>
>
> That won't work.
>
> This is intended to be a drop-in replacement for the "env" symbol that
> we declare in dyngen-exec.h. For all other hosts, this symbol is a
> global register variable. We can't go wrapping tls_var around all uses
> in all target backends.
>
> As I say in the comment, the most natural replacement is a preprocessor
> macro, but then that fails with the uses of "env" in the DEF_HELPER_N
> macros.
>
> Which leaves no alternative -- short of converting *all* targets to
> CONFIG_TCG_PASS_AREG0 first -- except the symbol alias you see there.
But at that point there will be no global env use anymore, so
dyngen-exec.h etc. can be removed. Perhaps this patch and its
dependencies should wait for that to happen. As an intermediate hack
it's sort of OK.
> Hmm... actually... I'm wrong about the use of preprocessor macros.
> The simple solution there is to re-order the includes on a few ports.
> I.e. "helper.h" must come before "dyngen-exec.h". Now that's a much
> simpler fix...
OK.
>
>
> r~
- [Qemu-devel] [PATCH 00/15] tcg-sparc improvments, Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 01/15] tcg-sparc: Hack in qemu_ld/st64 for 32-bit., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 02/15] tcg-sparc: Fix ADDX opcode., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 06/15] tcg-sparc: Support GUEST_BASE., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 03/15] tcg-sparc: Assume v9 cpu always, i.e. force v8plus in 32-bit mode., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 07/15] tcg-sparc: Steamline qemu_ld/st more., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 09/15] tcg-sparc: Do not use a global register for AREG0., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 05/15] tcg-sparc: Simplify qemu_ld/st direct memory paths., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 04/15] tcg-sparc: Fix qemu_ld/st to handle 32-bit host., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 08/15] Avoid declaring the env variable at all if CONFIG_TCG_PASS_AREG0., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 11/15] tcg-sparc: Clean up cruft stemming from attempts to use global registers., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 14/15] tcg-sparc: Add %g/%o registers to alloc_order, Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 10/15] tcg-sparc: Change AREG0 in generated code to %i0., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 12/15] tcg-sparc: Mask shift immediates to avoid illegal insns., Richard Henderson, 2012/03/25
- [Qemu-devel] [PATCH 15/15] tcg-sparc: Fix and enable direct TB chaining., Richard Henderson, 2012/03/25