Skip to contentSkip to conversation

tip-queue 2015-10-30

PATCH New Borislav Petkov 2 participants 7 messages Oct 30, 2015 – Nov 1, 2015 x86

lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw

cover tip-queue 2015-10-30

From: Borislav Petkov <[email protected]>

Hi Ingo,

please queue those non-critical platform enablement patches.

Thanks.

Aravind Gopalakrishnan (1):
x86/mce: Add a Scalable MCA vendor flags bit

Borislav Petkov (1):
x86/mce: Add a default case to the switch in

    __mcheck_cpu_ancient_init()

Wan Zongshun (1):
x86/cpu: Add CLZERO detection

 arch/x86/include/asm/cpufeature.h |  5 ++++-
 arch/x86/include/asm/mce.h        | 34 +++++++++++++++++++++-------------
 arch/x86/kernel/cpu/common.c      |  1 +
 arch/x86/kernel/cpu/mcheck/mce.c  |  4 ++++
 4 files changed, 30 insertions(+), 14 deletions(-)
Signature · 1 line
2.3.5
author maintainer
#1 lore raw

PATCH 1/3 x86/mce: Add a Scalable MCA vendor flags bit

From: Aravind Gopalakrishnan <[email protected]>

Scalable MCA (SMCA) is a new feature in AMD Fam17h processors which indicates presence of MCA extensions.

MCA extensions expands existing register space for the MCE banks and also introduces a new MSR range to accommodate new banks.

Add the detection bit.

[ Reformat mce_vendor_flags definitions and save indentation levels. Improve
comments. ]

---
 arch/x86/include/asm/mce.h       | 34 +++++++++++++++++++++-------------
 arch/x86/kernel/cpu/mcheck/mce.c |  2 ++
 2 files changed, 23 insertions(+), 13 deletions(-)
arch/x86/include/asm/mce.h +21 -13
index 2dbc0bf2b9f3..2ea4527e462f 100644
@@ -123,19 +123,27 @@ struct mca_config {
 };
 
 struct mce_vendor_flags {
-			/*
-			 * overflow recovery cpuid bit indicates that overflow
-			 * conditions are not fatal
-			 */
-	__u64		overflow_recov	: 1,
-
-			/*
-			 * SUCCOR stands for S/W UnCorrectable error COntainment
-			 * and Recovery. It indicates support for data poisoning
-			 * in HW and deferred error interrupts.
-			 */
-			succor		: 1,
-			__reserved_0	: 62;
+	/*
+	 * Indicates that overflow conditions are not fatal, when set.
+	 */
+	__u64 overflow_recov	: 1,
+
+	/*
+	 * (AMD) SUCCOR stands for S/W UnCorrectable error COntainment and
+	 * Recovery. It indicates support for data poisoning in HW and deferred
+	 * error interrupts.
+	 */
+	      succor		: 1,
+
+	/*
+	 * (AMD) SMCA: This bit indicates support for Scalable MCA which expands
+	 * the register space for each MCA bank and also increases number of
+	 * banks. Also, to accommodate the new banks and registers, the MCA
+	 * register space is moved to a new MSR range.
+	 */
+	      smca		: 1,
+
+	      __reserved_0	: 61;
 };
 extern struct mce_vendor_flags mce_flags;
 
arch/x86/kernel/cpu/mcheck/mce.c +2 -0
index 9d014b82a124..c7c59d13e3f4 100644
@@ -1605,6 +1605,8 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
 		mce_amd_feature_init(c);
 		mce_flags.overflow_recov = !!(ebx & BIT(0));
 		mce_flags.succor	 = !!(ebx & BIT(1));
+		mce_flags.smca		 = !!(ebx & BIT(3));
+
 		break;
 		}
 
Signature · 1 line
2.3.5
#2 lore raw

[tip:ras/core] x86/mce: Add a Scalable MCA vendor flags bit

x86/mce: Add a Scalable MCA vendor flags bit
Commit-ID:  c7f54d21fb02e90042e6233b46716dcb244e70e6
Gitweb:     http://git.kernel.org/tip/c7f54d21fb02e90042e6233b46716dcb244e70e6
Author:     Aravind Gopalakrishnan <[email protected]>
AuthorDate: Fri, 30 Oct 2015 13:11:37 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sun, 1 Nov 2015 11:26:13 +0100

x86/mce: Add a Scalable MCA vendor flags bit

Scalable MCA (SMCA) is a new feature in AMD Fam17h processors which indicates presence of MCA extensions.

MCA extensions expands existing register space for the MCE banks and also introduces a new MSR range to accommodate new banks.

Add the detection bit.

[ Reformat mce_vendor_flags definitions and save indentation levels. Improve comments. ]
Cc Ashok Raj <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Tony Luck <[email protected]>
Cc linux-edac <[email protected]>
---
 arch/x86/include/asm/mce.h       | 34 +++++++++++++++++++++-------------
 arch/x86/kernel/cpu/mcheck/mce.c |  2 ++
 2 files changed, 23 insertions(+), 13 deletions(-)
arch/x86/include/asm/mce.h +21 -13
index 2dbc0bf..2ea4527 100644
@@ -123,19 +123,27 @@ struct mca_config {
 };
 
 struct mce_vendor_flags {
-			/*
-			 * overflow recovery cpuid bit indicates that overflow
-			 * conditions are not fatal
-			 */
-	__u64		overflow_recov	: 1,
-
-			/*
-			 * SUCCOR stands for S/W UnCorrectable error COntainment
-			 * and Recovery. It indicates support for data poisoning
-			 * in HW and deferred error interrupts.
-			 */
-			succor		: 1,
-			__reserved_0	: 62;
+	/*
+	 * Indicates that overflow conditions are not fatal, when set.
+	 */
+	__u64 overflow_recov	: 1,
+
+	/*
+	 * (AMD) SUCCOR stands for S/W UnCorrectable error COntainment and
+	 * Recovery. It indicates support for data poisoning in HW and deferred
+	 * error interrupts.
+	 */
+	      succor		: 1,
+
+	/*
+	 * (AMD) SMCA: This bit indicates support for Scalable MCA which expands
+	 * the register space for each MCA bank and also increases number of
+	 * banks. Also, to accommodate the new banks and registers, the MCA
+	 * register space is moved to a new MSR range.
+	 */
+	      smca		: 1,
+
+	      __reserved_0	: 61;
 };
 extern struct mce_vendor_flags mce_flags;
 
arch/x86/kernel/cpu/mcheck/mce.c +2 -0
index 17b5ec6..3d631c4 100644
@@ -1605,6 +1605,8 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
 		mce_amd_feature_init(c);
 		mce_flags.overflow_recov = !!(ebx & BIT(0));
 		mce_flags.succor	 = !!(ebx & BIT(1));
+		mce_flags.smca		 = !!(ebx & BIT(3));
+
 		break;
 		}
 
author maintainer
#3 lore raw

PATCH 2/3 x86/mce: Add a default case to the switch in __mcheck_cpu_ancient_init()

In reply to Borislav Petkov

From: Borislav Petkov <[email protected]>

Caught by building with W= which enable -Wswitch-default also.

---
 arch/x86/kernel/cpu/mcheck/mce.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/cpu/mcheck/mce.c +2 -0
index c7c59d13e3f4..78c6f8d65d58 100644
@@ -1586,6 +1586,8 @@ static int __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c)
 		winchip_mcheck_init(c);
 		return 1;
 		break;
+	default:
+		return 0;
 	}
 
 	return 0;
Signature · 1 line
2.3.5
#4 lore raw

[tip:ras/core] x86/mce: Add a default case to the switch in __mcheck_cpu_ancient_init()

x86/mce: Add a default case to the switch in __mcheck_cpu_ancient_init()
Commit-ID:  dc34bdd2367fd31744ee3ba1de1b1cc0fa2ce193
Gitweb:     http://git.kernel.org/tip/dc34bdd2367fd31744ee3ba1de1b1cc0fa2ce193
Author:     Borislav Petkov <[email protected]>
AuthorDate: Fri, 30 Oct 2015 13:11:38 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sun, 1 Nov 2015 11:26:14 +0100

x86/mce: Add a default case to the switch in __mcheck_cpu_ancient_init()

Caught by building with W= which enable -Wswitch-default also.

---
 arch/x86/kernel/cpu/mcheck/mce.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/cpu/mcheck/mce.c +2 -0
index 3d631c4..c5b0d56 100644
@@ -1586,6 +1586,8 @@ static int __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c)
 		winchip_mcheck_init(c);
 		return 1;
 		break;
+	default:
+		return 0;
 	}
 
 	return 0;
author maintainer
#5 lore raw

PATCH 3/3 x86/cpu: Add CLZERO detection

In reply to Borislav Petkov

From: Wan Zongshun <[email protected]>

AMD Fam17h processors introduce support for the CLZERO instruction. It zeroes out the 64 byte cache line specified in RAX.

Add the bit here to allow /proc/cpuinfo to list the feature.

Boris: we're adding this as a separate ->x86_capability leaf because CPUID_80000008_EBX is going to contain more feature bits and it will fill out with time.

Cc Andy Lutomirski <[email protected]>
Cc Denys Vlasenko <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Huang Rui <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Tony Luck <[email protected]>
Cc x86-ml <[email protected]>
[Wrap code in patch form, fix comments. ]
---
 arch/x86/include/asm/cpufeature.h | 5 ++++-
 arch/x86/kernel/cpu/common.c      | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
arch/x86/include/asm/cpufeature.h +4 -1
index 9727b3b48bd1..e4f8010f22e0 100644
@@ -12,7 +12,7 @@
 #include <asm/disabled-features.h>
 #endif
 
-#define NCAPINTS	13	/* N 32-bit words worth of info */
+#define NCAPINTS	14	/* N 32-bit words worth of info */
 #define NBUGINTS	1	/* N 32-bit bug flags */
 
 /*
@@ -255,6 +255,9 @@
 /* Intel-defined CPU QoS Sub-leaf, CPUID level 0x0000000F:1 (edx), word 12 */
 #define X86_FEATURE_CQM_OCCUP_LLC (12*32+ 0) /* LLC occupancy monitoring if 1 */
 
+/* AMD-defined CPU features, CPUID level 0x80000008 (ebx), word 13 */
+#define X86_FEATURE_CLZERO	(13*32+0) /* CLZERO instruction */
+
 /*
  * BUG word(s)
  */
arch/x86/kernel/cpu/common.c +1 -0
index de22ea7ff82f..4ddd780aeac9 100644
@@ -670,6 +670,7 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
 
 		c->x86_virt_bits = (eax >> 8) & 0xff;
 		c->x86_phys_bits = eax & 0xff;
+		c->x86_capability[13] = cpuid_ebx(0x80000008);
 	}
 #ifdef CONFIG_X86_32
 	else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36))
Signature · 1 line
2.3.5
#6 lore raw

[tip:x86/cpu] x86/cpu: Add CLZERO detection

x86/cpu: Add CLZERO detection
Commit-ID:  2167ceabf34163727ca4e283c0f030e3960932e5
Gitweb:     http://git.kernel.org/tip/2167ceabf34163727ca4e283c0f030e3960932e5
Author:     Wan Zongshun <[email protected]>
AuthorDate: Fri, 30 Oct 2015 13:11:39 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sun, 1 Nov 2015 11:26:23 +0100

x86/cpu: Add CLZERO detection

AMD Fam17h processors introduce support for the CLZERO instruction. It zeroes out the 64 byte cache line specified in RAX.

Add the bit here to allow /proc/cpuinfo to list the feature.

Boris: we're adding this as a separate ->x86_capability leaf because CPUID_80000008_EBX is going to contain more feature bits and it will fill out with time.

[ Wrap code in patch form, fix comments. ]
Cc Andy Lutomirski <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Denys Vlasenko <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Huang Rui <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Tony Luck <[email protected]>
---
 arch/x86/include/asm/cpufeature.h | 5 ++++-
 arch/x86/kernel/cpu/common.c      | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
arch/x86/include/asm/cpufeature.h +4 -1
index 9727b3b..e4f8010 100644
@@ -12,7 +12,7 @@
 #include <asm/disabled-features.h>
 #endif
 
-#define NCAPINTS	13	/* N 32-bit words worth of info */
+#define NCAPINTS	14	/* N 32-bit words worth of info */
 #define NBUGINTS	1	/* N 32-bit bug flags */
 
 /*
@@ -255,6 +255,9 @@
 /* Intel-defined CPU QoS Sub-leaf, CPUID level 0x0000000F:1 (edx), word 12 */
 #define X86_FEATURE_CQM_OCCUP_LLC (12*32+ 0) /* LLC occupancy monitoring if 1 */
 
+/* AMD-defined CPU features, CPUID level 0x80000008 (ebx), word 13 */
+#define X86_FEATURE_CLZERO	(13*32+0) /* CLZERO instruction */
+
 /*
  * BUG word(s)
  */
arch/x86/kernel/cpu/common.c +1 -0
index de22ea7..4ddd780 100644
@@ -670,6 +670,7 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
 
 		c->x86_virt_bits = (eax >> 8) & 0xff;
 		c->x86_phys_bits = eax & 0xff;
+		c->x86_capability[13] = cpuid_ebx(0x80000008);
 	}
 #ifdef CONFIG_X86_32
 	else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36))