linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Update documentation to reflect what TAINT_CPU_OUT_OF_SPEC means nowadays
@ 2020-12-02 15:32 Mathieu Chouquet-Stringer
  2020-12-08 17:54 ` Jonathan Corbet
  0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Chouquet-Stringer @ 2020-12-02 15:32 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Borislav Petkov, Mathieu Chouquet-Stringer, Stephen Kitt,
	Andrew Morton, Kees Cook, Guilherme G. Piccoli, Eric Biggers,
	Randy Dunlap, Qais Yousef, Naoki Hayama, Yue Hu, linux-doc,
	linux-kernel

	Hello Jonathan,

Here's a patch updating the meaning of TAINT_CPU_OUT_OF_SPEC after
Borislav introduced changes in a7e1f67ed29f and upcoming patches in tip.

TAINT_CPU_OUT_OF_SPEC now means a bit more what it implies as the
flag isn't set just because of a CPU misconfiguration or mismatch.
Historically it was for SMP kernel oops on an officially SMP incapable
processor but now it also covers CPUs whose MSRs have been incorrectly
poked at from userspace, drivers being used on non supported
architectures, broken firmware, mismatched CPUs, ...

Update documentation and script to reflect that.

Signed-off-by: Mathieu Chouquet-Stringer <me@mathieu.digital>
---
 Documentation/admin-guide/sysctl/kernel.rst   |  2 +-
 Documentation/admin-guide/tainted-kernels.rst | 23 +++++++++++++++----
 tools/debugging/kernel-chktaint               |  2 +-
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index d4b32cc32bb7..edd89e2d3af7 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -1336,7 +1336,7 @@ ORed together. The letters are seen in "Tainted" line of Oops reports.
 ======  =====  ==============================================================
      1  `(P)`  proprietary module was loaded
      2  `(F)`  module was force loaded
-     4  `(S)`  SMP kernel oops on an officially SMP incapable processor
+     4  `(S)`  kernel running on an out of specification system
      8  `(R)`  module was force unloaded
     16  `(M)`  processor reported a Machine Check Exception (MCE)
     32  `(B)`  bad page referenced or some unexpected page flags
diff --git a/Documentation/admin-guide/tainted-kernels.rst b/Documentation/admin-guide/tainted-kernels.rst
index f718a2eaf1f6..ceeed7b0798d 100644
--- a/Documentation/admin-guide/tainted-kernels.rst
+++ b/Documentation/admin-guide/tainted-kernels.rst
@@ -84,7 +84,7 @@ Bit  Log  Number  Reason that got the kernel tainted
 ===  ===  ======  ========================================================
   0  G/P       1  proprietary module was loaded
   1  _/F       2  module was force loaded
-  2  _/S       4  SMP kernel oops on an officially SMP incapable processor
+  2  _/S       4  kernel running on an out of specification system
   3  _/R       8  module was force unloaded
   4  _/M      16  processor reported a Machine Check Exception (MCE)
   5  _/B      32  bad page referenced or some unexpected page flags
@@ -116,10 +116,23 @@ More detailed explanation for tainting
  1)  ``F`` if any module was force loaded by ``insmod -f``, ``' '`` if all
      modules were loaded normally.
 
- 2)  ``S`` if the oops occurred on an SMP kernel running on hardware that
-     hasn't been certified as safe to run multiprocessor.
-     Currently this occurs only on various Athlons that are not
-     SMP capable.
+ 2)  ``S`` if the kernel is running on a processor or system that is out of
+     specification: hardware has been put into an unsupported configuration,
+     therefore proper execution cannot be guaranteed.
+     Kernel will be tainted if, for example:
+
+     - on x86: PAE is forced through forcepae on intel CPUs (such as Pentium M)
+       which do not report PAE but may have a functional implementation, an SMP
+       kernel is running on non officially capable SMP Athlon CPUs, MSRs are
+       being poked at from userspace.
+     - on arm: kernel running on certain CPUs (such as Keystone 2) without
+       having certain kernel features enabled.
+     - on arm64: there are mismatched hardware features between CPUs, the
+       bootloader has booted CPUs in different modes.
+     - certain drivers are being used on non supported architectures (such as
+       scsi/snic on something else than x86_64, scsi/ips on non
+       x86/x86_64/itanium, have broken firmware settings for the
+       irqchip/irq-gic on arm64 ...).
 
  3)  ``R`` if a module was force unloaded by ``rmmod -f``, ``' '`` if all
      modules were unloaded normally.
diff --git a/tools/debugging/kernel-chktaint b/tools/debugging/kernel-chktaint
index 2240cb56e6e5..607b2b280945 100755
--- a/tools/debugging/kernel-chktaint
+++ b/tools/debugging/kernel-chktaint
@@ -72,7 +72,7 @@ if [ `expr $T % 2` -eq 0 ]; then
 	addout " "
 else
 	addout "S"
-	echo " * SMP kernel oops on an officially SMP incapable processor (#2)"
+	echo " * kernel running on an out of specification system (#2)"
 fi
 
 T=`expr $T / 2`
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Update documentation to reflect what TAINT_CPU_OUT_OF_SPEC means nowadays
  2020-12-02 15:32 [PATCH] Update documentation to reflect what TAINT_CPU_OUT_OF_SPEC means nowadays Mathieu Chouquet-Stringer
@ 2020-12-08 17:54 ` Jonathan Corbet
  2020-12-08 17:58   ` Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Corbet @ 2020-12-08 17:54 UTC (permalink / raw)
  To: Mathieu Chouquet-Stringer
  Cc: Borislav Petkov, Stephen Kitt, Andrew Morton, Kees Cook,
	Guilherme G. Piccoli, Eric Biggers, Randy Dunlap, Qais Yousef,
	Naoki Hayama, Yue Hu, linux-doc, linux-kernel

On Wed,  2 Dec 2020 16:32:43 +0100
Mathieu Chouquet-Stringer <me@mathieu.digital> wrote:

> 	Hello Jonathan,
> 
> Here's a patch updating the meaning of TAINT_CPU_OUT_OF_SPEC after
> Borislav introduced changes in a7e1f67ed29f and upcoming patches in tip.
> 
> TAINT_CPU_OUT_OF_SPEC now means a bit more what it implies as the
> flag isn't set just because of a CPU misconfiguration or mismatch.
> Historically it was for SMP kernel oops on an officially SMP incapable
> processor but now it also covers CPUs whose MSRs have been incorrectly
> poked at from userspace, drivers being used on non supported
> architectures, broken firmware, mismatched CPUs, ...
> 
> Update documentation and script to reflect that.
> 
> Signed-off-by: Mathieu Chouquet-Stringer <me@mathieu.digital>

Hearing no objection, I've applied this.

Thanks,

jon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Update documentation to reflect what TAINT_CPU_OUT_OF_SPEC means nowadays
  2020-12-08 17:54 ` Jonathan Corbet
@ 2020-12-08 17:58   ` Randy Dunlap
  2020-12-08 23:11     ` Mathieu Chouquet-Stringer
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2020-12-08 17:58 UTC (permalink / raw)
  To: Jonathan Corbet, Mathieu Chouquet-Stringer
  Cc: Borislav Petkov, Stephen Kitt, Andrew Morton, Kees Cook,
	Guilherme G. Piccoli, Eric Biggers, Qais Yousef, Naoki Hayama,
	Yue Hu, linux-doc, linux-kernel

On 12/8/20 9:54 AM, Jonathan Corbet wrote:
> On Wed,  2 Dec 2020 16:32:43 +0100
> Mathieu Chouquet-Stringer <me@mathieu.digital> wrote:
> 
>> 	Hello Jonathan,
>>
>> Here's a patch updating the meaning of TAINT_CPU_OUT_OF_SPEC after
>> Borislav introduced changes in a7e1f67ed29f and upcoming patches in tip.
>>
>> TAINT_CPU_OUT_OF_SPEC now means a bit more what it implies as the
>> flag isn't set just because of a CPU misconfiguration or mismatch.
>> Historically it was for SMP kernel oops on an officially SMP incapable
>> processor but now it also covers CPUs whose MSRs have been incorrectly
>> poked at from userspace, drivers being used on non supported
>> architectures, broken firmware, mismatched CPUs, ...
>>
>> Update documentation and script to reflect that.
>>
>> Signed-off-by: Mathieu Chouquet-Stringer <me@mathieu.digital>
> 
> Hearing no objection, I've applied this.


Hm, I was glad to read this new info since my old testing laptop
now tells me that it needs a microcode update.  :(


-- 
~Randy


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Update documentation to reflect what TAINT_CPU_OUT_OF_SPEC means nowadays
  2020-12-08 17:58   ` Randy Dunlap
@ 2020-12-08 23:11     ` Mathieu Chouquet-Stringer
  0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Chouquet-Stringer @ 2020-12-08 23:11 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Jonathan Corbet, Borislav Petkov, Stephen Kitt, Andrew Morton,
	Kees Cook, Guilherme G. Piccoli, Eric Biggers, Qais Yousef,
	Naoki Hayama, Yue Hu, linux-doc, linux-kernel

	Hello,

On Tue, Dec 08, 2020 at 09:58:32AM -0800, Randy Dunlap wrote:
> On 12/8/20 9:54 AM, Jonathan Corbet wrote:
> > On Wed,  2 Dec 2020 16:32:43 +0100
> > Mathieu Chouquet-Stringer <me@mathieu.digital> wrote:
> >> Signed-off-by: Mathieu Chouquet-Stringer <me@mathieu.digital>
> > 
> > Hearing no objection, I've applied this.

Thanks Jon.

> Hm, I was glad to read this new info since my old testing laptop
> now tells me that it needs a microcode update.  :(

In my case I first saw the error because tuned uses
x86_energy_perf_policy which uses to poke at MSRs [1]. And that was
tainting my kernel and I initially couldn't understand why.

It's been fixed but will be released in an upcoming kernel version (it's
in tip at the moment [2]).

Thanks to Borislav for work and for helping me out!

[1] https://lore.kernel.org/lkml/20201117210018.GA4247@weirdfishes/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=fe0a5788624c8b8f113a35bbe4636e37f9321241
-- 
Mathieu Chouquet-Stringer                             me@mathieu.digital
            The sun itself sees not till heaven clears.
	             -- William Shakespeare --

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-08 23:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 15:32 [PATCH] Update documentation to reflect what TAINT_CPU_OUT_OF_SPEC means nowadays Mathieu Chouquet-Stringer
2020-12-08 17:54 ` Jonathan Corbet
2020-12-08 17:58   ` Randy Dunlap
2020-12-08 23:11     ` Mathieu Chouquet-Stringer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).