qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/7] poison TARGET_xxx for compile once object


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 0/7] poison TARGET_xxx for compile once object and header file cleanups
Date: Mon, 28 Jun 2010 10:20:18 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Thunderbird/3.0.5

On 06/27/2010 09:32 PM, Blue Swirl wrote:
 From just clean up or type safety point of view, this is good stuff.
But from architectural point of view, we should make it more difficult
to use CPUState in device code, not easier. This may still be fine as
a temporary measure, before all CPUState references have been removed.

I don't see it at all as a temporary measure. In theory, only devices compiled per-target would need access to CPUState, that's true. However, there are conflicting goals which make an opaque CPUState preferrable.

First, converting devices such as APIC to qdev requires knowledge of CPUState in qdev, unless you want to keep DEFINE_PROP_PTR (whose removal is much more interesting) or sweep it under the void* blanket. PICs are likely to have CPUState members, e.g. hw/pxa2xx_pic.c (and BTW indirect access via functions to these fields is making emulation a little bit slower).

Also, for things compiled in libhw that are not part of device code, requiring knowledge of CPUState is absolutely not problematic and the only alternative loses type-safety and so it is inferior.

Paolo



reply via email to

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