Skip to contentSkip to conversation

Small issue with 3fde2999fac5 "arm64: cpufeature: Don't dump useless backtrace on CPU_OUT_OF_SPEC"

DISCUSSION Heiner Kallweit 3 participants 4 messages Jun 5, 2017 2 messages not in the archive arm64

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20170605084840.GB4650@leverpostej

#2 lore raw

Am 05.06.2017 um 10:48 schrieb Mark Rutland:

Quoted 9 lines

Hi,

Quoted 2 lines · Heiner Kallweit

The warning is printed unconditionally. An "if (taint)" seems to be missing.

I'm not sure I follow. We're using pr_warn_once(), which should only print the message once, regardless of how many times it is called.

Before we had WARN_TAINT_ONCE(taint, ..), so the warning is triggered by taint != 0.
Now the warning is printed (just once but) even if taint == 0.

Quoted 8 lines

Is that not working correctly for you?

If so, could you please report so on LAKML? That way others can get involved with investigating and fixing the issue.

Thanks,
Mark.

Rgds, Heiner

reviewer
#3 lore raw
Quoted 7 lines · Heiner Kallweit

Am 05.06.2017 um 10:48 schrieb Mark Rutland:

Quoted 6 lines

Hi,

Quoted 2 lines · Heiner Kallweit

The warning is printed unconditionally. An "if (taint)" seems to be missing.

Quoted 6 lines
Quoted 3 lines

I'm not sure I follow. We're using pr_warn_once(), which should only print the message once, regardless of how many times it is called.

Before we had WARN_TAINT_ONCE(taint, ..), so the warning is triggered by taint != 0.
Now the warning is printed (just once but) even if taint == 0.

Ah, I see.

Thanks for the report; I'll put together a fix shortly.

Do you mind if I add:

... to that patch?

Thanks,
Mark.

#4 lore raw

Am 05.06.2017 um 11:24 schrieb Mark Rutland:

Quoted 15 lines · Heiner Kallweit
Quoted 7 lines

Am 05.06.2017 um 10:48 schrieb Mark Rutland:

Quoted 6 lines

Hi,

Quoted 2 lines · Heiner Kallweit

The warning is printed unconditionally. An "if (taint)" seems to be missing.

Quoted 6 lines
Quoted 3 lines

I'm not sure I follow. We're using pr_warn_once(), which should only print the message once, regardless of how many times it is called.

Before we had WARN_TAINT_ONCE(taint, ..), so the warning is triggered by taint != 0.
Now the warning is printed (just once but) even if taint == 0.

Quoted 8 lines

Ah, I see.

Thanks for the report; I'll put together a fix shortly.

Do you mind if I add:

Fine with me.

Rgds, Heiner

Quoted 5 lines

... to that patch?

Thanks,
Mark.

#5 lore raw
Quoted 18 lines · Heiner Kallweit

Am 05.06.2017 um 11:24 schrieb Mark Rutland:

Quoted 17 lines · Heiner Kallweit
Quoted 7 lines

Am 05.06.2017 um 10:48 schrieb Mark Rutland:

Quoted 6 lines

Hi,

Quoted 2 lines · Heiner Kallweit

The warning is printed unconditionally. An "if (taint)" seems to be missing.

Quoted 6 lines
Quoted 3 lines

I'm not sure I follow. We're using pr_warn_once(), which should only print the message once, regardless of how many times it is called.

Before we had WARN_TAINT_ONCE(taint, ..), so the warning is triggered by taint != 0.
Now the warning is printed (just once but) even if taint == 0.

Ah, I see.

Quoted 7 lines
Quoted 6 lines

Thanks for the report; I'll put together a fix shortly.

Do you mind if I add:

Fine with me.

I'm about to apply the patch below.

Will

--->8

Quoted 1 line

From 8dd0ee651d8aefdc2d8ae0fcc9c68dfc943c9e4c Mon Sep 17 00:00:00 2001

From: Will Deacon <[email protected]>
Date: Mon, 5 Jun 2017 11:40:23 +0100
Subject: [PATCH] arm64: cpufeature: Fix CPU_OUT_OF_SPEC taint for uniform
systems

Commit 3fde2999fac5 ("arm64: cpufeature: Don't dump useless backtrace on CPU_OUT_OF_SPEC") changed the cpufeature detection code to use add_taint instead of WARN_TAINT_ONCE when detecting a heterogeneous system with mismatched feature support. Unfortunately, this resulted in all systems getting the taint, regardless of any feature mismatch.

This patch fixes the problem by conditionalising the taint on detecting a feature mismatch.

---
 arch/arm64/kernel/cpufeature.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm64/kernel/cpufeature.c +4 -2
index 22f554320581..55d5c72a507d 100644
@@ -639,8 +639,10 @@ void update_cpu_features(int cpu,
 	 * Mismatched CPU features are a recipe for disaster. Don't even
 	 * pretend to support them.
 	 */
-	pr_warn_once("Unsupported CPU feature variation detected.\n");
-	add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
+	if (taint) {
+		pr_warn_once("Unsupported CPU feature variation detected.\n");
+		add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK);
+	}
 }
 
 u64 read_sanitised_ftr_reg(u32 id)
Signature · 1 line
2.1.4