qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH qom-cpu v2 02/29] kvm: Change cpu_synchronize_st


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH qom-cpu v2 02/29] kvm: Change cpu_synchronize_state() argument to CPUState
Date: Mon, 17 Jun 2013 23:09:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

Am 17.06.2013 23:02, schrieb Richard Henderson:
> On 06/17/2013 01:58 PM, Andreas Färber wrote:
>> Am 17.06.2013 21:46, schrieb Richard Henderson:
>>> On 06/16/2013 08:57 AM, Andreas Färber wrote:
>>>> @@ -627,7 +627,7 @@ static void vapic_write(void *opaque, hwaddr addr, 
>>>> uint64_t data,
>>>>      hwaddr rom_paddr;
>>>>      VAPICROMState *s = opaque;
>>>>  
>>>> -    cpu_synchronize_state(env);
>>>> +    cpu_synchronize_state(CPU(x86_env_get_cpu(env)));
>>>
>>> ENV_GET_CPU, surely.
>>
>> No, ENV_GET_CPU() is only a compatibility macro for generic code and
>> shouldn't be used in target-specific code.
>>
>> Background is that foo_env_get_cpu() can coexist with bar_env_get_cpu()
>> whereas ENV_GET_CPU() relies on there being only one arch per
>> executable, which we hope to fix for heterogeneous emulations.
> 
> What has that got to do with anything?  ENV_GET_CPU is a macro, and only
> applies within the current translation unit.  This corresponds well with the
> CPUArchState type, which is also local to the current translation unit.

The whole point of my refactorings is to drop the CPUArchState define
completely. Generic code should use CPUState instead, and CPU*State
becomes an implementation detail of the specific target. Therefore
ENV_GET_CPU() will no longer be needed either at some point, so I don't
want to introduce usages now just to save a few characters and later
have to convert them back in one big go.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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