From: "Lluís Vilanova" <vilanova@ac.upc.edu>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Stefan Hajnoczi" <stefanha@gmail.com>,
"Anthony Green" <green@moxielogic.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Alexander Graf" <agraf@suse.de>,
"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>,
"Blue Swirl" <blauwirbel@gmail.com>,
"Max Filippov" <jcmvbkbc@gmail.com>,
"Michael Walle" <michael@walle.cc>,
"open list:ARM" <qemu-arm@nongnu.org>,
"open list:PowerPC" <qemu-ppc@nongnu.org>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Guan Xuetao" <gxt@mprc.pku.edu.cn>,
"Leon Alrae" <leon.alrae@imgtec.com>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Jia Liu" <proljc@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v6 3/4] tcg: Add type for vCPU pointers
Date: Wed, 10 Feb 2016 14:38:00 +0100 [thread overview]
Message-ID: <877ficeldz.fsf@fimbulvetr.bsc.es> (raw)
In-Reply-To: <87d1s4emfn.fsf@fimbulvetr.bsc.es> ("Lluís Vilanova"'s message of "Wed, 10 Feb 2016 14:15:24 +0100")
Lluís Vilanova writes:
> 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
>> C++.
> 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.
[...]
BTW, type overload can also be achieved in C using GCC's
__builtin_types_compatible_p and __builtin_choose_expr intrinsics:
http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
Cheers,
Lluis
WARNING: multiple messages have this Message-ID (diff)
From: "Lluís Vilanova" <vilanova@ac.upc.edu>
To: Richard Henderson <rth@twiddle.net>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Stefan Hajnoczi" <stefanha@gmail.com>,
"Anthony Green" <green@moxielogic.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
qemu-devel@nongnu.org, "Alexander Graf" <agraf@suse.de>,
"Blue Swirl" <blauwirbel@gmail.com>,
"Max Filippov" <jcmvbkbc@gmail.com>,
"Michael Walle" <michael@walle.cc>,
"open list:ARM" <qemu-arm@nongnu.org>,
"open list:PowerPC" <qemu-ppc@nongnu.org>,
"Leon Alrae" <leon.alrae@imgtec.com>,
"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Guan Xuetao" <gxt@mprc.pku.edu.cn>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Jia Liu" <proljc@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v6 3/4] tcg: Add type for vCPU pointers
Date: Wed, 10 Feb 2016 14:38:00 +0100 [thread overview]
Message-ID: <877ficeldz.fsf@fimbulvetr.bsc.es> (raw)
In-Reply-To: <87d1s4emfn.fsf@fimbulvetr.bsc.es> ("Lluís Vilanova"'s message of "Wed, 10 Feb 2016 14:15:24 +0100")
Lluís Vilanova writes:
> 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
>> C++.
> 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.
[...]
BTW, type overload can also be achieved in C using GCC's
__builtin_types_compatible_p and __builtin_choose_expr intrinsics:
http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
Cheers,
Lluis
next prev parent reply other threads:[~2016-02-10 13:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-09 21:14 [Qemu-devel] [PATCH v6 0/4] trace: Show vCPU info in guest code events Lluís Vilanova
2016-02-09 21:14 ` [Qemu-devel] [PATCH v6 1/4] trace: Extend API to manage event arguments Lluís Vilanova
2016-02-09 21:14 ` [Qemu-devel] [PATCH v6 2/4] trace: Remove unnecessary intermediate event copies Lluís Vilanova
2016-02-11 14:30 ` Lluís Vilanova
2016-02-09 21:14 ` [PATCH v6 3/4] tcg: Add type for vCPU pointers Lluís Vilanova
2016-02-09 21:14 ` [Qemu-devel] " Lluís Vilanova
2016-02-10 3:24 ` Richard Henderson
2016-02-10 3:24 ` Richard Henderson
2016-02-10 13:15 ` Lluís Vilanova
2016-02-10 13:15 ` Lluís Vilanova
2016-02-10 13:38 ` Lluís Vilanova [this message]
2016-02-10 13:38 ` Lluís Vilanova
2016-02-09 21:14 ` [Qemu-devel] [PATCH v6 4/4] trace: Add 'vcpu' event property to trace guest vCPU Lluís Vilanova
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=877ficeldz.fsf@fimbulvetr.bsc.es \
--to=vilanova@ac.upc.edu \
--cc=agraf@suse.de \
--cc=alex.bennee@linaro.org \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=ehabkost@redhat.com \
--cc=green@moxielogic.com \
--cc=gxt@mprc.pku.edu.cn \
--cc=jcmvbkbc@gmail.com \
--cc=kbastian@mail.uni-paderborn.de \
--cc=leon.alrae@imgtec.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=michael@walle.cc \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=proljc@gmail.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=rth@twiddle.net \
--cc=stefanha@gmail.com \
/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.