qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 6/6] apic: avoid using CPUState internals


From: Blue Swirl
Subject: [Qemu-devel] Re: [PATCH 6/6] apic: avoid using CPUState internals
Date: Wed, 9 Jun 2010 19:59:40 +0000

On Sun, Jun 6, 2010 at 5:39 PM, Paolo Bonzini <address@hidden> wrote:
> On 06/05/2010 11:31 PM, Blue Swirl wrote:
>>
>> Use only an opaque CPUState pointer and move the actual CPUState
>> contents handling to cpu.h and cpuid.c.
>>
>> Set env->halted in pc.c and add a function to get the local APIC state
>> of the current CPU for the MMIO.
>>
>> Signed-off-by: Blue Swirl<address@hidden>
>> ---
>>  hw/apic.c           |   40 +++++++++++++++-------------------------
>>  hw/apic.h           |    9 ++++++++-
>>  hw/pc.c             |   12 +++++++++++-
>>  target-i386/cpu.h   |   27 ++++++++++++++++-----------
>>  target-i386/cpuid.c |    6 ++++++
>>  5 files changed, 56 insertions(+), 38 deletions(-)
>>
>> diff --git a/hw/apic.c b/hw/apic.c
>> index 91c8d93..332c66e 100644
>> --- a/hw/apic.c
>> +++ b/hw/apic.c
>> @@ -95,7 +95,7 @@
>>  #define MSI_ADDR_SIZE                   0x100000
>>
>>  struct APICState {
>> -    CPUState *cpu_env;
>> +    void *cpu_env;
>
> I proposed having an opaque CPUState type in hw/ but it was rejected. But I
> don't think using a void pointer is any better.

It's not necessary for the patch. Maybe it's possible to avoid all
CPUState references in apic.c by pushing the dependencies to pc.c. It
could affect performance though.



reply via email to

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