Skip to contentSkip to conversation

MCE: consolidate AMD initialization

PATCH In review Christoph Egger 2 participants 9 messages Oct 26, 2012 – Oct 29, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MCE: consolidate AMD initialization

Move AMD specific initialization to AMD files.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#1 lore raw
Quoted 5 lines · Christoph Egger

Move AMD specific initialization to AMD files.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
xen/arch/x86/cpu/mcheck/mce.c +0 -24
diff -r 7abb25095de0 xen/arch/x86/cpu/mcheck/mce.c
@@ -560,30 +560,6 @@ void mcheck_mca_clearbanks(struct mca_ba
     }
 }
 
-static enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *ci)
-{
-    enum mcheck_type rc = mcheck_none;
-
-    switch (ci->x86) {
-    case 6:
-        rc = amd_k7_mcheck_init(ci);
-        break;
-
-    default:
-        /* Assume that machine check support is available.
-         * The minimum provided support is at least the K8. */
-    case 0xf:
-        rc = amd_k8_mcheck_init(ci);
-        break;
-
-    case 0x10 ... 0x17:
-        rc = amd_f10_mcheck_init(ci);
-        break;
-    }
-
-    return rc;
-}
-
 /*check the existence of Machine Check*/
 int mce_available(struct cpuinfo_x86 *c)
 {
xen/arch/x86/cpu/mcheck/mce.h +1 -4
diff -r 7abb25095de0 xen/arch/x86/cpu/mcheck/mce.h
@@ -39,10 +39,7 @@ enum mcheck_type {
 };
 
 /* Init functions */
-enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c);
-enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
-enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
-
+enum mcheck_type amd_mcheck_init(struct cpuinfo_x86 *c);
 enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
 void intel_mcheck_timer(struct cpuinfo_x86 *c);
xen/arch/x86/cpu/mcheck/mce_amd.c +25 -0
diff -r 7abb25095de0 xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -98,3 +98,28 @@ mc_amd_addrcheck(uint64_t status, uint64
     BUG();
     return 0;
 }
+
+enum mcheck_type
+amd_mcheck_init(struct cpuinfo_x86 *ci)
+{
+    enum mcheck_type rc = mcheck_none;
+
+    switch (ci->x86) {
+    case 6:
+        rc = amd_k7_mcheck_init(ci);
+        break;
+
+    default:
+        /* Assume that machine check support is available.
+         * The minimum provided support is at least the K8. */
+    case 0xf:
+        rc = amd_k8_mcheck_init(ci);
+        break;
+
+    case 0x10 ... 0x17:
+        rc = amd_f10_mcheck_init(ci);
+        break;
+    }
+
+    return rc;
+}
xen/arch/x86/cpu/mcheck/mce_amd.h +4 -0
diff -r 7abb25095de0 xen/arch/x86/cpu/mcheck/mce_amd.h
@@ -1,6 +1,10 @@
 #ifndef _MCHECK_AMD_H
 #define _MCHECK_AMD_H
 
+enum mcheck_type amd_k7_mcheck_init(struct cpuinfo_x86 *c);
+enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
+enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
+
 int mc_amd_recoverable_scan(uint64_t status);
 int mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 4 lines · Christoph Egger

Move AMD specific initialization to AMD files.

Let's do this properly: There's no K7 supporting 64-bit mode afaict, so rather than moving around the call to amd_k7_mcheck_init() can't we just drop it and the whole (inconsistently named) k7.c file?

Also (not in this patch of course), I'd prefer mce_amd_quirks.c to get merged into mce_amd.c now that we have the latter.

Jan

#3 lore raw
Quoted 10 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 4 lines · Christoph Egger

Move AMD specific initialization to AMD files.

Let's do this properly: There's no K7 supporting 64-bit mode afaict, so rather than moving around the call to amd_k7_mcheck_init() can't we just drop it and the whole (inconsistently named) k7.c file?

Yes.

Quoted 2 lines

Also (not in this patch of course), I'd prefer mce_amd_quirks.c to get merged into mce_amd.c now that we have the latter.

Ok.

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#4 lore raw
In reply to Jan Beulich
Quoted 10 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 4 lines · Christoph Egger

Move AMD specific initialization to AMD files.

Let's do this properly: There's no K7 supporting 64-bit mode afaict, so rather than moving around the call to amd_k7_mcheck_init() can't we just drop it and the whole (inconsistently named) k7.c file?

I think it is better to apply this first and then remove k7 to simplify backporting if needed/wanted.

Quoted 2 lines

Also (not in this patch of course), I'd prefer mce_amd_quirks.c to get merged into mce_amd.c now that we have the latter.

After some thinking is there some good reason to do this?

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#5 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 5 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 3 lines · Christoph Egger

Move AMD specific initialization to AMD files.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line

Let's do this properly: There's no K7 supporting 64-bit mode afaict, so rather than moving around the call to amd_k7_mcheck_init() can't we just drop it and the whole (inconsistently named) k7.c file?

I think it is better to apply this first and then remove k7 to simplify backporting if needed/wanted.

I'm not seeing these changes as backporting candidates.

Quoted 4 lines
Quoted 2 lines

Also (not in this patch of course), I'd prefer mce_amd_quirks.c to get merged into mce_amd.c now that we have the latter.

After some thinking is there some good reason to do this?

Imo it had been there simply because there was no mce_amd.c at the time it got introduced (and afaics it should nevertheless have been named mce_amd.c from the beginning).

Jan

#6 lore raw
Quoted 9 lines · Jan Beulich
Quoted 9 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 7 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 4 lines · Christoph Egger

Move AMD specific initialization to AMD files.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Let's do this properly: There's no K7 supporting 64-bit mode afaict, so rather than moving around the call to amd_k7_mcheck_init() can't we just drop it and the whole (inconsistently named) k7.c file?

I think it is better to apply this first and then remove k7 to simplify backporting if needed/wanted.

I'm not seeing these changes as backporting candidates.

I had SLES in mind.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Also (not in this patch of course), I'd prefer mce_amd_quirks.c to get merged into mce_amd.c now that we have the latter.

After some thinking is there some good reason to do this?

Imo it had been there simply because there was no mce_amd.c at the time it got introduced (and afaics it should nevertheless have been named mce_amd.c from the beginning).

I have a patch ready that removes k7 support which is on top of this init cleanup patch.
I also have a patch which merges mce_amd_quirks into mce_amd.c on top of the k7 removal.
In which order do you want them?

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#7 lore raw
Quoted 31 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 9 lines · Jan Beulich
Quoted 9 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 7 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 4 lines · Christoph Egger

Move AMD specific initialization to AMD files.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Let's do this properly: There's no K7 supporting 64-bit mode afaict, so rather than moving around the call to amd_k7_mcheck_init() can't we just drop it and the whole (inconsistently named) k7.c file?

I think it is better to apply this first and then remove k7 to simplify backporting if needed/wanted.

I'm not seeing these changes as backporting candidates.

I had SLES in mind.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Also (not in this patch of course), I'd prefer mce_amd_quirks.c to get merged into mce_amd.c now that we have the latter.

After some thinking is there some good reason to do this?

Imo it had been there simply because there was no mce_amd.c at the time it got introduced (and afaics it should nevertheless have been named mce_amd.c from the beginning).

Quoted 5 lines

I have a patch ready that removes k7 support which is on top of this init cleanup patch.
I also have a patch which merges mce_amd_quirks into mce_amd.c on top of the k7 removal.
In which order do you want them?

Okay, if you got them done already, let's go with the order you have.

Jan

#8 lore raw
Quoted 31 lines · Jan Beulich
Quoted 31 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 9 lines · Jan Beulich
Quoted 9 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 7 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Christoph Egger
Quoted 4 lines · Christoph Egger

Move AMD specific initialization to AMD files.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Let's do this properly: There's no K7 supporting 64-bit mode afaict, so rather than moving around the call to amd_k7_mcheck_init() can't we just drop it and the whole (inconsistently named) k7.c file?

I think it is better to apply this first and then remove k7 to simplify backporting if needed/wanted.

I'm not seeing these changes as backporting candidates.

I had SLES in mind.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Also (not in this patch of course), I'd prefer mce_amd_quirks.c to get merged into mce_amd.c now that we have the latter.

After some thinking is there some good reason to do this?

Imo it had been there simply because there was no mce_amd.c at the time it got introduced (and afaics it should nevertheless have been named mce_amd.c from the beginning).

Quoted 8 lines
Quoted 5 lines

I have a patch ready that removes k7 support which is on top of this init cleanup patch.
I also have a patch which merges mce_amd_quirks into mce_amd.c on top of the k7 removal.
In which order do you want them?

Okay, if you got them done already, let's go with the order you have.

Patches sent.

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632