* [PATCH] small mca cleanup
@ 2007-08-16 14:36 Christoph Egger
2007-08-16 14:42 ` Keir Fraser
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Egger @ 2007-08-16 14:36 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 662 bytes --]
Hi!
The MCG_CAP MSR never returns a negative count of available
error-reporting banks. Thus make nr_mce_banks unsigned.
While here, do some other minor cleanups.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
AMD Saxony, Dresden, Germany
Operating System Research Center
Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
Dr. Hans-R. Deppe, Thomas McCoy
[-- Attachment #2: mca_cleanup.diff --]
[-- Type: text/x-diff, Size: 2297 bytes --]
diff -r 256160ff19b7 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c Thu Aug 16 13:27:59 2007 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c Thu Aug 16 16:34:45 2007 +0000
@@ -15,7 +15,7 @@
#include "mce.h"
int mce_disabled = 0;
-int nr_mce_banks;
+unsigned int nr_mce_banks;
/* Handle unconfigured int18 (should never happen) */
static fastcall void unexpected_machine_check(struct cpu_user_regs * regs, long error_code)
@@ -29,35 +29,49 @@ void fastcall (*machine_check_vector)(st
/* This has to be run for each processor */
void mcheck_init(struct cpuinfo_x86 *c)
{
- if (mce_disabled==1)
+ uint32_t mca, mce;
+
+ if (mce_disabled == 1) {
+ printk("MCE support disabled by bootparam\n");
return;
+ }
+
+ /* Xen requires an i686 class CPU. So this
+ * check should be almost always true here. */
+ mca = cpu_has(c, X86_FEATURE_MCA);
+ mce = cpu_has(c, X86_FEATURE_MCE);
+
+ if (!mca && !mce) {
+ printk(KERN_INFO "CPU%i: No machine check support available\n",
+ smp_processor_id());
+ return;
+ }
switch (c->x86_vendor) {
- case X86_VENDOR_AMD:
- if (c->x86==6 || c->x86==15)
- amd_mcheck_init(c);
- break;
+ case X86_VENDOR_AMD:
+ amd_mcheck_init(c);
+ break;
- case X86_VENDOR_INTEL:
+ case X86_VENDOR_INTEL:
#ifndef CONFIG_X86_64
- if (c->x86==5)
- intel_p5_mcheck_init(c);
- if (c->x86==6)
- intel_p6_mcheck_init(c);
+ if (c->x86==5)
+ intel_p5_mcheck_init(c);
+ if (c->x86==6)
+ intel_p6_mcheck_init(c);
#endif
- if (c->x86==15)
- intel_p4_mcheck_init(c);
- break;
+ if (c->x86==15)
+ intel_p4_mcheck_init(c);
+ break;
#ifndef CONFIG_X86_64
- case X86_VENDOR_CENTAUR:
- if (c->x86==5)
- winchip_mcheck_init(c);
- break;
+ case X86_VENDOR_CENTAUR:
+ if (c->x86==5)
+ winchip_mcheck_init(c);
+ break;
#endif
- default:
- break;
+ default:
+ break;
}
}
diff -r 256160ff19b7 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h Thu Aug 16 13:27:59 2007 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.h Thu Aug 16 16:34:45 2007 +0000
@@ -10,5 +10,4 @@ extern fastcall void (*machine_check_vec
extern fastcall void (*machine_check_vector)(struct cpu_user_regs *, long error_code);
extern int mce_disabled __initdata;
-extern int nr_mce_banks;
-
+extern unsigned int nr_mce_banks;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] small mca cleanup
2007-08-16 14:36 [PATCH] small mca cleanup Christoph Egger
@ 2007-08-16 14:42 ` Keir Fraser
2007-08-16 15:14 ` Christoph Egger
0 siblings, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2007-08-16 14:42 UTC (permalink / raw)
To: Christoph Egger, xen-devel
The file you modify is from upstream Linux, and that's where this patch
belongs.
-- Keir
On 16/8/07 15:36, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
>
> Hi!
>
> The MCG_CAP MSR never returns a negative count of available
> error-reporting banks. Thus make nr_mce_banks unsigned.
>
> While here, do some other minor cleanups.
>
> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] small mca cleanup
2007-08-16 14:42 ` Keir Fraser
@ 2007-08-16 15:14 ` Christoph Egger
2007-08-16 15:28 ` Keir Fraser
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Egger @ 2007-08-16 15:14 UTC (permalink / raw)
To: xen-devel; +Cc: Keir Fraser
On Thursday 16 August 2007 16:42:37 Keir Fraser wrote:
> The file you modify is from upstream Linux, and that's where this patch
> belongs.
oh, I have many changes in my queue in files that are from Linux
(and also new files, that are not in Linux).
They do one thing, that does not belong into Linux (or any other OS):
Notifying guests, preferably Dom0.
I'm about extracting the least intrusive changes first.
We can still push changes into Linux that belong to there.
For more information where this is going to, please see the
discussion "MCE/MCA concept" on this list. The thread started here:
http://lists.xensource.com/archives/html/xen-devel/2007-05/msg01015.html
Christoph
>
> -- Keir
>
> On 16/8/07 15:36, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
> > Hi!
> >
> > The MCG_CAP MSR never returns a negative count of available
> > error-reporting banks. Thus make nr_mce_banks unsigned.
> >
> > While here, do some other minor cleanups.
> >
> > Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
AMD Saxony, Dresden, Germany
Operating System Research Center
Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
Dr. Hans-R. Deppe, Thomas McCoy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] small mca cleanup
2007-08-16 15:14 ` Christoph Egger
@ 2007-08-16 15:28 ` Keir Fraser
2007-08-16 16:06 ` Keir Fraser
0 siblings, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2007-08-16 15:28 UTC (permalink / raw)
To: Christoph Egger, xen-devel
Oh yeah, sure: Xen-specific stuff and the general MCE/MCA reworking that
you're talking about are one thing. But there's no point in minor fixes and
stylistic cleanups going into Xen and bypassing upstream Linux.
-- Keir
On 16/8/07 16:14, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
> On Thursday 16 August 2007 16:42:37 Keir Fraser wrote:
>> The file you modify is from upstream Linux, and that's where this patch
>> belongs.
>
> oh, I have many changes in my queue in files that are from Linux
> (and also new files, that are not in Linux).
> They do one thing, that does not belong into Linux (or any other OS):
> Notifying guests, preferably Dom0.
>
> I'm about extracting the least intrusive changes first.
> We can still push changes into Linux that belong to there.
>
> For more information where this is going to, please see the
> discussion "MCE/MCA concept" on this list. The thread started here:
> http://lists.xensource.com/archives/html/xen-devel/2007-05/msg01015.html
>
> Christoph
>
>>
>> -- Keir
>>
>> On 16/8/07 15:36, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
>>> Hi!
>>>
>>> The MCG_CAP MSR never returns a negative count of available
>>> error-reporting banks. Thus make nr_mce_banks unsigned.
>>>
>>> While here, do some other minor cleanups.
>>>
>>> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] small mca cleanup
2007-08-16 15:28 ` Keir Fraser
@ 2007-08-16 16:06 ` Keir Fraser
0 siblings, 0 replies; 5+ messages in thread
From: Keir Fraser @ 2007-08-16 16:06 UTC (permalink / raw)
To: Christoph Egger, xen-devel
To be fair -- if you posted this as part of a fuller patchset to move us
away from Linux-synced files and towards a new fully thought-out method for
handling MCA/MCE then I'd have no problems with it (but maybe I would with
the patchset as a whole :-). It's just I see no sense in applying it in
isolation.
-- Keir
On 16/8/07 16:28, "Keir Fraser" <keir@xensource.com> wrote:
> Oh yeah, sure: Xen-specific stuff and the general MCE/MCA reworking that
> you're talking about are one thing. But there's no point in minor fixes and
> stylistic cleanups going into Xen and bypassing upstream Linux.
>
> -- Keir
>
> On 16/8/07 16:14, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
>
>> On Thursday 16 August 2007 16:42:37 Keir Fraser wrote:
>>> The file you modify is from upstream Linux, and that's where this patch
>>> belongs.
>>
>> oh, I have many changes in my queue in files that are from Linux
>> (and also new files, that are not in Linux).
>> They do one thing, that does not belong into Linux (or any other OS):
>> Notifying guests, preferably Dom0.
>>
>> I'm about extracting the least intrusive changes first.
>> We can still push changes into Linux that belong to there.
>>
>> For more information where this is going to, please see the
>> discussion "MCE/MCA concept" on this list. The thread started here:
>> http://lists.xensource.com/archives/html/xen-devel/2007-05/msg01015.html
>>
>> Christoph
>>
>>>
>>> -- Keir
>>>
>>> On 16/8/07 15:36, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
>>>> Hi!
>>>>
>>>> The MCG_CAP MSR never returns a negative count of available
>>>> error-reporting banks. Thus make nr_mce_banks unsigned.
>>>>
>>>> While here, do some other minor cleanups.
>>>>
>>>> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
>>
>>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-08-16 16:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16 14:36 [PATCH] small mca cleanup Christoph Egger
2007-08-16 14:42 ` Keir Fraser
2007-08-16 15:14 ` Christoph Egger
2007-08-16 15:28 ` Keir Fraser
2007-08-16 16:06 ` Keir Fraser
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.