qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-1.1] target-i386: Defer MCE init


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH for-1.1] target-i386: Defer MCE init
Date: Fri, 11 May 2012 14:29:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0

Am 10.05.2012 21:14, schrieb Igor Mammedov:
> ----- Original Message -----
>> From: "Andreas Färber" <address@hidden>
>> To: address@hidden
>> Cc: "Eduardo Habkost" <address@hidden>, "Michael Roth" <address@hidden>, 
>> "Anthony Liguori"
>> <address@hidden>, "Paolo Bonzini" <address@hidden>, address@hidden, "Andreas 
>> Färber"
>> <address@hidden>
>> Sent: Thursday, May 10, 2012 12:09:10 AM
>> Subject: [Qemu-devel] [PATCH for-1.1] target-i386: Defer MCE init
>>
>> Commit de024815e3b523addf58f1f79846b7fe74643678 (target-i386: QOM'ify
>> CPU init) moved mce_init() call from helper.c:cpu_x86_init() into
>> X86CPU's cpu.c:x86_cpu_initfn().
>> mce_init() checks for a family >= 6 though, so we could end up with a
>> sequence such as for -cpu somecpu,family=6:
>>
>>   x86_cpu_initfn => X86CPU::family == 5
>>     mce_init => no-op
>>   cpu_x86_register => X86CPU::family = 6
>>   => MCE unexpectedly not init'ed
>>
>> or for -cpu someothercpu,family=5:
>>
>>   x86_cpu_initfn => X86CPU::family == 6
>>     mce_init => init'ed
>>   cpu_x86_register => X86CPU::family = 5
>>   => MCE unexpectedly init'ed
>>
>> Therefore partially revert the above commit. To avoid moving
>> mce_init() back into helper.c, foresightedly move it into a
>> new x86_cpu_realize() function and, in lack of ObjectClass::realize,
>> call it directly from cpu_x86_init().
>>
>> While at it, move the qemu_init_vcpu() call that used to follow
>> mce_init() in cpu_x86_init() into the new realizefn as well.
>>
>> Reported-by: Igor Mammedov <address@hidden>
>> Signed-off-by: Andreas Färber <address@hidden>
>> Cc: Anthony Liguori <address@hidden>
>> Cc: Paolo Bonzini <address@hidden>
>> Cc: Eduardo Habkost <address@hidden>
>> Cc: Michael Roth <address@hidden>
>> ---
>>  target-i386/cpu-qom.h |    4 ++++
>>  target-i386/cpu.c     |    9 ++++++++-
>>  target-i386/helper.c  |    2 +-
>>  3 files changed, 13 insertions(+), 2 deletions(-)
> 
> Looks good to me.
> 
> Reviewed-by: Igor Mammedov <address@hidden>

Thanks, I've applied it to qom-1.1 and qom-next branches for now:
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-1.1
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-next

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]