From: "Andreas Färber" <afaerber@suse.de>
To: Igor Mammedov <imammedo@redhat.com>
Cc: mdroth@linux.vnet.ibm.com, aliguori@us.ibm.com,
qemu-devel@nongnu.org, ehabkost@redhat.com
Subject: Re: [Qemu-devel] [PATCH for 1.1-rc1] mce_init should be called after parsing cpu_model
Date: Thu, 10 May 2012 00:31:34 +0200 [thread overview]
Message-ID: <4FAAF046.3060004@suse.de> (raw)
In-Reply-To: <ebd7c4db-f997-4ae3-9758-1ab1bec97d71@zmail16.collab.prod.int.phx2.redhat.com>
Am 09.05.2012 21:49, schrieb Igor Mammedov:
> ----- Original Message -----
>> From: "Andreas Färber" <afaerber@suse.de>
>> Am 09.05.2012 21:01, schrieb Igor Mammedov:
>>> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
>>> index 65d9af6..5d11e7b 100644
>>> --- a/target-i386/cpu.c
>>> +++ b/target-i386/cpu.c
>>> @@ -1153,6 +1153,22 @@ void x86_cpu_list(FILE *f, fprintf_function
>>> cpu_fprintf, const char *optarg)
>>> }
>>> }
>>>
>>> +static void mce_init(X86CPU *cpu)
>>> +{
>>> + CPUX86State *cenv = &cpu->env;
>>> + unsigned int bank;
>>> +
>>> + if (((cenv->cpuid_version >> 8) & 0xf) >= 6
>>> + && (cenv->cpuid_features & (CPUID_MCE | CPUID_MCA)) ==
>>> + (CPUID_MCE | CPUID_MCA)) {
>>> + cenv->mcg_cap = MCE_CAP_DEF | MCE_BANKS_DEF;
>>> + cenv->mcg_ctl = ~(uint64_t)0;
>>> + for (bank = 0; bank < MCE_BANKS_DEF; bank++) {
>>> + cenv->mce_banks[bank * 4] = ~(uint64_t)0;
>>> + }
>>> + }
>>> +}
>>> +
>>> int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
>>> {
>>> CPUX86State *env = &cpu->env;
>>> @@ -1204,6 +1220,8 @@ int cpu_x86_register(X86CPU *cpu, const char
>>> *cpu_model)
>>> error_free(error);
>>> return -1;
>>> }
>>> +
>>> + mce_init(cpu);
>>
>> This would be okay as a short-term rc1 fix.
>
> Exactly, it is intended as short term fix for 1.1, just noticed that
> mce_init was moved before cpuid_* are initialized.
No doubt should that be fixed for 1.1. Hearing that 1.1-rc1 is already
well under way and in testing, it seems we can give this some more
thought and review.
I've posted an alternative patch that we could merge for 1.1-rc2. As
previously suggested for target-sh4 (where it didn't matter), it avoids
a dependency on Paolo's series, which we will definitely not get during
Hard Freeze, while remaining compatible to it for future assignment in
class_init.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
prev parent reply other threads:[~2012-05-09 22:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-09 19:01 [Qemu-devel] [PATCH for 1.1-rc1] mce_init should be called after parsing cpu_model Igor Mammedov
2012-05-09 19:08 ` Anthony Liguori
2012-05-09 19:26 ` Andreas Färber
2012-05-09 19:49 ` Igor Mammedov
2012-05-09 22:31 ` Andreas Färber [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FAAF046.3060004@suse.de \
--to=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).