Skip to contentSkip to conversation

x86: Last-minute fixlets

PATCH New Borislav Petkov 1 participant 4 messages Jun 26, 2017

Subsystems (3)
lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw

cover x86: Last-minute fixlets

From: Borislav Petkov <[email protected]>

Hi guys,

last three small fixlets for tip before the merge window. Two go to tip:ras/core and one to tip:x86/microcode.

Please queue,
thanks.

Christophe JAILLET (1):
RAS/CEC: Check the correct variable in the debugfs error handling

Colin Ian King (1):
x86/microcode: Make a couple of symbols static

Yazen Ghannam (1):
x86/mce: Always save severity in machine_check_poll()

 arch/x86/kernel/cpu/mcheck/mce.c      | 7 +------
 arch/x86/kernel/cpu/microcode/amd.c   | 2 +-
 arch/x86/kernel/cpu/microcode/intel.c | 2 +-
 drivers/ras/cec.c                     | 2 +-
 4 files changed, 4 insertions(+), 9 deletions(-)
Signature · 1 line
2.13.0
author maintainer
#1 lore raw

PATCH 1/3 x86/mce: Always save severity in machine_check_poll()

From: Yazen Ghannam <[email protected]>

The MCE severity gives a hint as to how to handle the error. The notifier blocks can then use the severity to decide on an action. It's not necessary for machine_check_poll() to filter errors for the notifier chain, since each block will check its own set of conditions before handling an error.

Also, there isn't any urgency for machine_check_poll() to make decisions based on severity like in do_machine_check().

If we can assume that a severity is set then we can use it in more notifier blocks. For example, the CEC block could check for a "KEEP" severity rather than checking bits in the status. This isn't possible now since the severity is not set except for "DEFFRRED/UCNA" errors with a valid address.

Save the severity since we have it, and let the notifier blocks decide if they want to do anything.

---
 arch/x86/kernel/cpu/mcheck/mce.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
arch/x86/kernel/cpu/mcheck/mce.c +1 -6
index b58b77808ce4..6dde0497efc7 100644
@@ -673,7 +673,6 @@ bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
 {
 	bool error_seen = false;
 	struct mce m;
-	int severity;
 	int i;
 
 	this_cpu_inc(mce_poll_count);
@@ -710,11 +709,7 @@ bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
 
 		mce_read_aux(&m, i);
 
-		severity = mce_severity(&m, mca_cfg.tolerant, NULL, false);
-
-		if (severity == MCE_DEFERRED_SEVERITY && mce_is_memory_error(&m))
-			if (m.status & MCI_STATUS_ADDRV)
-				m.severity = severity;
+		m.severity = mce_severity(&m, mca_cfg.tolerant, NULL, false);
 
 		/*
 		 * Don't get the IP here because it's unlikely to
Signature · 1 line
2.13.0
author maintainer
#2 lore raw

PATCH 2/3 RAS/CEC: Check the correct variable in the debugfs error handling

In reply to Borislav Petkov

From: Christophe JAILLET <[email protected]>

Check the correct variable when handling a potential error from debugfs_create_file(). Most likely a copy-paste botch.

Fixes 011d82611172 ("RAS: Add a Corrected Errors Collector")
[ Rewrite commit message. ]
---
 drivers/ras/cec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ras/cec.c +1 -1
index 6aab46d91d33..d0e5d6ee882c 100644
@@ -481,7 +481,7 @@ static int __init create_debugfs_nodes(void)
 
 	count = debugfs_create_file("count_threshold", S_IRUSR | S_IWUSR, d,
 				    &count_threshold, &count_threshold_ops);
-	if (!decay) {
+	if (!count) {
 		pr_warn("Error creating count_threshold debugfs node!\n");
 		goto err;
 	}
Signature · 1 line
2.13.0
author maintainer
#3 lore raw

PATCH 3/3 x86/microcode: Make a couple of symbols static

In reply to Borislav Petkov

From: Colin Ian King <[email protected]>

The helper function __load_ucode_amd() and pointer intel_ucode_patch do not need to be in global scope, so make them static.

Fixes those sparse warnings:
"symbol '__load_ucode_amd' was not declared. Should it be static?" "symbol 'intel_ucode_patch' was not declared. Should it be static?"

---
 arch/x86/kernel/cpu/microcode/amd.c   | 2 +-
 arch/x86/kernel/cpu/microcode/intel.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +1 -1
index e9f4d762aa5b..21b185793c80 100644
@@ -251,7 +251,7 @@ static bool get_builtin_microcode(struct cpio_data *cp, unsigned int family)
 #endif
 }
 
-void __load_ucode_amd(unsigned int cpuid_1_eax, struct cpio_data *ret)
+static void __load_ucode_amd(unsigned int cpuid_1_eax, struct cpio_data *ret)
 {
 	struct ucode_cpu_info *uci;
 	struct cpio_data cp;
arch/x86/kernel/cpu/microcode/intel.c +1 -1
index d525a0bd7d28..59edbe9d4ccb 100644
@@ -42,7 +42,7 @@
 static const char ucode_path[] = "kernel/x86/microcode/GenuineIntel.bin";
 
 /* Current microcode patch used in early patching on the APs. */
-struct microcode_intel *intel_ucode_patch;
+static struct microcode_intel *intel_ucode_patch;
 
 static inline bool cpu_signatures_match(unsigned int s1, unsigned int p1,
 					unsigned int s2, unsigned int p2)
Signature · 1 line
2.13.0