qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v2 02/34] cpu-exec: Purge all uses of CPU_GET_ENV


From: Peter Crosthwaite
Subject: Re: [Qemu-devel] [RFC v2 02/34] cpu-exec: Purge all uses of CPU_GET_ENV
Date: Sun, 7 Jun 2015 15:57:49 -0700

On Mon, Jun 1, 2015 at 12:03 PM, Richard Henderson <address@hidden> wrote:
> On 05/30/2015 11:11 PM, Peter Crosthwaite wrote:
>> Remove un-needed usages of CPU_GET_ENV by converting the APIs to use
>> CPUState pointers and retrieving the env_ptr as minimally needed.
>>
>> FIXME: apply target-foo change pattern to all archs.
>
> Yes, please.
>

Fixed.

>>  #ifdef TARGET_I386
>>      X86CPU *x86_cpu = X86_CPU(cpu);
>> +    CPUArchState *env = (CPUArchState *)cpu->env_ptr;
>>  #endif
>
>   CPUArchState *env = &x86_cpu.env;
>

Fixed.

>>  #ifdef TARGET_I386
>> +            env = cpu->env_ptr;
>>              x86_cpu = X86_CPU(cpu);
>>  #endif
>
> Likewise.
>

And fixed.

> Or, indeed, it might be worth propagating away "env" entirely, so you don't
> have to reload it here at the end of the setjmp.
>

I'm leaving this as follow-up for the moment as it is a bit of a
change to target-i386 code. cpu_svm_check_intercept_param() needs to
be de-envified but it has a fair few internal uses in target-x86. I'm
thinking it should take a CPU * (not an X86CPU) due to its call from
common code. This means we should be able to stubbify the function and
remove the TARGET_I386 ifeffery entirely one day. The drawback is
adding QOM casts in target-i386. Is this thing ever a fast path? Will
other arches want to use this hook one day as well?

Regards,
Peter

> Otherwise this starter patch looks good.
>
>
> r~
>
>



reply via email to

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