[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH v6 3/4] tcg: Add type for vCPU pointe
Re: [Qemu-arm] [Qemu-devel] [PATCH v6 3/4] tcg: Add type for vCPU pointers
Wed, 10 Feb 2016 14:15:24 +0100
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Richard Henderson writes:
> On 02/10/2016 08:14 AM, Lluís Vilanova wrote:
>> Adds the 'TCGv_env' type for pointers to 'CPUArchState' objects. The
>> tracing infrastructure later needs to differentiate between regular
>> pointers and pointers to vCPUs.
>> Also changes all targets to use the new 'TCGv_cpu' type instead of the
>> generic 'TCGv_ptr'. As of now, the change is merely cosmetic ('TCGv_env'
>> translates into 'TCGv_ptr'), but that could change in the future to
>> enforce the difference.
> I suppose.
> We won't be able distinguish TCGv_env from TCGv_ptr until env can be
> auto-converted to ptr. Which I can't imagine happening without switching to
It's difficult to differenciate between TCGv_ptr and TCGv_env in "tcg/tcg-op.h"
unless an explicit operation is added to perform casts or to get a TCGv_ptr from
a TCGv_env+offset (e.g., add a tcg_gen_env_ld8u_i32 built on top of
tcg_gen_ld8u_i32). That is, unless QEMU switches to C++.
But types could be easily enforced in helper declarations, which can internally
cast to the pointer type.
As a side note, I've just spotted a typo in the commit message (TCGv_cpu ->
> I see your motivation in 4/4, so I guess this is fine.
> Acked-by: Richard Henderson <address@hidden>