Re: [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once

2010-04-02 Thread Anthony Liguori
On 04/02/2010 12:46 PM, Paolo Bonzini wrote: On 04/02/2010 07:36 PM, Anthony Liguori wrote: On 04/02/2010 11:43 AM, Paolo Bonzini wrote: On 04/02/2010 06:24 PM, Anthony Liguori wrote: I'd rather things be compiled per-target than adding a bunch of crud everywhere. Well, this patch in partic

Re: [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once

2010-04-02 Thread Paolo Bonzini
On 04/02/2010 07:36 PM, Anthony Liguori wrote: On 04/02/2010 11:43 AM, Paolo Bonzini wrote: On 04/02/2010 06:24 PM, Anthony Liguori wrote: I'd rather things be compiled per-target than adding a bunch of crud everywhere. Well, this patch in particular removes more lines than it adds. :-P Any

Re: [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once

2010-04-02 Thread Anthony Liguori
On 04/02/2010 11:43 AM, Paolo Bonzini wrote: On 04/02/2010 06:24 PM, Anthony Liguori wrote: I'd rather things be compiled per-target than adding a bunch of crud everywhere. Well, this patch in particular removes more lines than it adds. :-P Anyway---me too, given how hairy it's coming out.

Re: [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once

2010-04-02 Thread Paolo Bonzini
On 04/02/2010 06:24 PM, Anthony Liguori wrote: I'd rather things be compiled per-target than adding a bunch of crud everywhere. Well, this patch in particular removes more lines than it adds. :-P Anyway---me too, given how hairy it's coming out. Maybe (or without maybe) this work should hav

Re: [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once

2010-04-02 Thread Anthony Liguori
On 04/02/2010 10:43 AM, Paolo Bonzini wrote: On 04/02/2010 05:22 PM, Anthony Liguori wrote: hw/* should never access CPUState. Can you give examples of when qemu-kvm needs this? Indirectly via header files. The problem is that GCC poisoning complains on prototypes too. qemu-kvm.h referen

Re: [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once

2010-04-02 Thread Blue Swirl
On 4/2/10, Paolo Bonzini wrote: > > > > > > > qemu-kvm.h references CPUState and includes cpu.h, so with the latest > > > changes all files that include qemu-kvm.h break, even if they don't > require > > > qemu-kvm.h. With this patch they instead get the opaque definition via > > > hw/hw.h (whic

Re: [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once

2010-04-02 Thread Paolo Bonzini
qemu-kvm.h references CPUState and includes cpu.h, so with the latest changes all files that include qemu-kvm.h break, even if they don't require qemu-kvm.h. With this patch they instead get the opaque definition via hw/hw.h (which includes cpu-common.h), and qemu-kvm.h can avoid including cp

Re: [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once

2010-04-02 Thread Blue Swirl
On 4/2/10, Paolo Bonzini wrote: > On 04/02/2010 05:22 PM, Anthony Liguori wrote: > > > > hw/* should never access CPUState. > > > > Can you give examples of when qemu-kvm needs this? > > > > Indirectly via header files. The problem is that GCC poisoning complains > on prototypes too. > > qemu-k

Re: [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once

2010-04-02 Thread Paolo Bonzini
On 04/02/2010 05:22 PM, Anthony Liguori wrote: hw/* should never access CPUState. Can you give examples of when qemu-kvm needs this? Indirectly via header files. The problem is that GCC poisoning complains on prototypes too. qemu-kvm.h references CPUState and includes cpu.h, so with the l

Re: [Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once

2010-04-02 Thread Anthony Liguori
On 04/02/2010 09:45 AM, Paolo Bonzini wrote: This patch allows to unpoison CPUState and env in once-compiled files. To achieve this, it defines an opaque struct CPUState in cpu-common.h. This also requires tweaking the relationship between CPUState and CPUXYZState in target files. Unpoisoning en

[Qemu-devel] [PATCH] provide opaque CPUState to files that are compiled once

2010-04-02 Thread Paolo Bonzini
This patch allows to unpoison CPUState and env in once-compiled files. To achieve this, it defines an opaque struct CPUState in cpu-common.h. This also requires tweaking the relationship between CPUState and CPUXYZState in target files. Unpoisoning env is needed because it is widely used as the na