qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v11 04/29] target: [tcg] Add generic translation


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v11 04/29] target: [tcg] Add generic translation framework
Date: Tue, 4 Jul 2017 12:31:51 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/04/2017 09:14 AM, Peter Maydell wrote:
On 4 July 2017 at 19:59, Lluís Vilanova <address@hidden> wrote:
Richard Henderson writes:
Any reason not to stuff the cpu pointer into the DisasContextBase instead of
passing it around separately?

None, really. I'll move it from DisasContext (in targets where it's present)
into DisasContextBase, and use that one everywhere.

I kind of like not having CPUState* in DisasContext, because
it enforces the rule that you can't read from fields of
it inside the target translate.c code without jumping through
a hoop (ie copying the info from CPUState->foo to
DisasContext->foo). That then acts as a useful flag in code
review (or when writing the code) to confirm that foo really
is constant for the life of the simulation (or to recommend
using a TB flag instead).

I don't see how the spelling "cpu" vs "dc->cpu" really affects that.

More practically, I don't see that "cpu" will actually be used by most of those hooks. But because of things like cpu->some_target_feature, it's kind of hard to predict.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]