From: Randy Dunlap on
On Thu, 17 Jun 2010 09:54:45 -0400 Prarit Bhargava wrote:

> This patch is similar to Theordore Ts'o's TAINT_USER patch,
> linux-2.6 commit 34f5a39899f3f3e815da64f48ddb72942d86c366.

and augmented by 92946bc72f2e74c3281b7fc12be9704d455fb3ed, so please
add similar info to Documentation/oops-tracing.txt.


> This patch introduces the TAINT_HARDWARE_UNSUPPORTED flag for distributions
> to use.
>
> Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
> Signed-off-by: Don Zickus <dzickus(a)redhat.com>
>
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 8317ec4..f722b0d 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -347,6 +347,7 @@ extern enum system_states {
> #define TAINT_WARN 9
> #define TAINT_CRAP 10
> #define TAINT_FIRMWARE_WORKAROUND 11
> +#define TAINT_HARDWARE_UNSUPPORTED 12
>
> extern void dump_stack(void) __cold;
>
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 3b16cd9..394a5bb 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -180,6 +180,7 @@ static const struct tnt tnts[] = {
> { TAINT_WARN, 'W', ' ' },
> { TAINT_CRAP, 'C', ' ' },
> { TAINT_FIRMWARE_WORKAROUND, 'I', ' ' },
> + { TAINT_HARDWARE_UNSUPPORTED, 'H', ' ' },
> };
>
> /**
> @@ -197,6 +198,7 @@ static const struct tnt tnts[] = {
> * 'W' - Taint on warning.
> * 'C' - modules from drivers/staging are loaded.
> * 'I' - Working around severe firmware bug.
> + * 'H' - Hardware is unsupported.
> *
> * The string is overwritten by the next call to print_tainted().
> */
> @@ -243,6 +245,9 @@ void add_taint(unsigned flag)
> */
> if (flag != TAINT_CRAP && flag != TAINT_WARN && __debug_locks_off())
> printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n");
> + if (flag == TAINT_HARDWARE_UNSUPPORTED)
> + printk(KERN_CRIT "WARNING: This system's hardware is "
> + "unsupported.\n");

Preferable not to split the string, so more like:

printk(KERN_CRIT
"WARNING: This system's hardware is unsupported.\n");
>
> set_bit(flag, &tainted_mask);
> }
> --


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Prarit Bhargava on
On 06/17/2010 12:13 PM, Randy Dunlap wrote:
> On Thu, 17 Jun 2010 09:54:45 -0400 Prarit Bhargava wrote:
>
>> This patch is similar to Theordore Ts'o's TAINT_USER patch,
>> linux-2.6 commit 34f5a39899f3f3e815da64f48ddb72942d86c366.
>
> and augmented by 92946bc72f2e74c3281b7fc12be9704d455fb3ed, so please
> add similar info to Documentation/oops-tracing.txt.
>
>
>> This patch introduces the TAINT_HARDWARE_UNSUPPORTED flag for distributions
>> to use.

<snip>

>> + "unsupported.\n");
>
> Preferable not to split the string, so more like:
>
> printk(KERN_CRIT
> "WARNING: This system's hardware is unsupported.\n");
>>
>> set_bit(flag, &tainted_mask);

Hey Randy, thanks for the input. New patch.

This patch is similar to Theordore Ts'o's TAINT_USER patch,
linux-2.6 commit 34f5a39899f3f3e815da64f48ddb72942d86c366.

Individual distributions may enable "generic" features such as X86 support,
PPC support, and driver support.

Some of the features that are enabled by these "generic" feature flags may
not be considered supported by the individual distribution.

For example, a distribution may want to support PPC but not the Power5
chipset, or the e1000e driver but not a card with a specific DeviceID because
of known firmware issues.

Typically, one would push a config patch to enable and disable the feature and
patch the distribution. However, in some cases this is not feasible in order
to preserve kabi and at the same time maintain parity with the upstream kernel.
In some cases the distribution may want to allow booting of these features but
explicitly notify a user that they are not "officially" supported. It is also
possible that the hardware is fixed via a firmware update at a later date,
making it supported again.

It would be useful for a distribution to notify the installer and
bug reporting applications, and notify users that the hardware they are using
is unsupported during panic, oops, BUG(), and WARN().

This patch introduces the TAINT_HARDWARE_UNSUPPORTED flag for distributions
to use.

Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
Signed-off-by: Don Zickus <dzickus(a)redhat.com>

diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt
index 6fe9001..e337b0a 100644
--- a/Documentation/oops-tracing.txt
+++ b/Documentation/oops-tracing.txt
@@ -263,6 +263,8 @@ characters, each representing a particular tainted value.
12: 'I' if the kernel is working around a severe bug in the platform
firmware (BIOS or similar).

+ 13: 'H' if the hardware is unsupported by the distribution
+
The primary reason for the 'Tainted: ' string is to tell kernel
debuggers if this is a clean kernel or if anything unusual has
occurred. Tainting is permanent: even if an offending module is
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 8317ec4..f722b0d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -347,6 +347,7 @@ extern enum system_states {
#define TAINT_WARN 9
#define TAINT_CRAP 10
#define TAINT_FIRMWARE_WORKAROUND 11
+#define TAINT_HARDWARE_UNSUPPORTED 12

extern void dump_stack(void) __cold;

diff --git a/kernel/panic.c b/kernel/panic.c
index 3b16cd9..8d081ff 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -180,6 +180,7 @@ static const struct tnt tnts[] = {
{ TAINT_WARN, 'W', ' ' },
{ TAINT_CRAP, 'C', ' ' },
{ TAINT_FIRMWARE_WORKAROUND, 'I', ' ' },
+ { TAINT_HARDWARE_UNSUPPORTED, 'H', ' ' },
};

/**
@@ -197,6 +198,7 @@ static const struct tnt tnts[] = {
* 'W' - Taint on warning.
* 'C' - modules from drivers/staging are loaded.
* 'I' - Working around severe firmware bug.
+ * 'H' - Hardware is unsupported.
*
* The string is overwritten by the next call to print_tainted().
*/
@@ -243,6 +245,9 @@ void add_taint(unsigned flag)
*/
if (flag != TAINT_CRAP && flag != TAINT_WARN && __debug_locks_off())
printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n");
+ if (flag == TAINT_HARDWARE_UNSUPPORTED)
+ printk(KERN_CRIT
+ "WARNING: This system's hardware is unsupported.\n");

set_bit(flag, &tainted_mask);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Randy Dunlap on
On Thu, 17 Jun 2010 15:54:09 -0400 Prarit Bhargava wrote:

> This patch is similar to Theordore Ts'o's TAINT_USER patch,
> linux-2.6 commit 34f5a39899f3f3e815da64f48ddb72942d86c366.
>
> Individual distributions may enable "generic" features such as X86 support,
> PPC support, and driver support.
>
> Some of the features that are enabled by these "generic" feature flags may
> not be considered supported by the individual distribution.
>
> For example, a distribution may want to support PPC but not the Power5
> chipset, or the e1000e driver but not a card with a specific DeviceID because
> of known firmware issues.
>
> Typically, one would push a config patch to enable and disable the feature and
> patch the distribution. However, in some cases this is not feasible in order
> to preserve kabi and at the same time maintain parity with the upstream kernel.
> In some cases the distribution may want to allow booting of these features but
> explicitly notify a user that they are not "officially" supported. It is also
> possible that the hardware is fixed via a firmware update at a later date,
> making it supported again.
>
> It would be useful for a distribution to notify the installer and
> bug reporting applications, and notify users that the hardware they are using
> is unsupported during panic, oops, BUG(), and WARN().
>
> This patch introduces the TAINT_HARDWARE_UNSUPPORTED flag for distributions
> to use.
>
> Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
> Signed-off-by: Don Zickus <dzickus(a)redhat.com>

Acked-by: Randy Dunlap <randy.dunlap(a)oracle.com>

Thanks.

> diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt
> index 6fe9001..e337b0a 100644
> --- a/Documentation/oops-tracing.txt
> +++ b/Documentation/oops-tracing.txt
> @@ -263,6 +263,8 @@ characters, each representing a particular tainted value.
> 12: 'I' if the kernel is working around a severe bug in the platform
> firmware (BIOS or similar).
>
> + 13: 'H' if the hardware is unsupported by the distribution
> +
> The primary reason for the 'Tainted: ' string is to tell kernel
> debuggers if this is a clean kernel or if anything unusual has
> occurred. Tainting is permanent: even if an offending module is
> diff --git a/include/linux/kernel.h b/include/linux/kernel.h
> index 8317ec4..f722b0d 100644
> --- a/include/linux/kernel.h
> +++ b/include/linux/kernel.h
> @@ -347,6 +347,7 @@ extern enum system_states {
> #define TAINT_WARN 9
> #define TAINT_CRAP 10
> #define TAINT_FIRMWARE_WORKAROUND 11
> +#define TAINT_HARDWARE_UNSUPPORTED 12
>
> extern void dump_stack(void) __cold;
>
> diff --git a/kernel/panic.c b/kernel/panic.c
> index 3b16cd9..8d081ff 100644
> --- a/kernel/panic.c
> +++ b/kernel/panic.c
> @@ -180,6 +180,7 @@ static const struct tnt tnts[] = {
> { TAINT_WARN, 'W', ' ' },
> { TAINT_CRAP, 'C', ' ' },
> { TAINT_FIRMWARE_WORKAROUND, 'I', ' ' },
> + { TAINT_HARDWARE_UNSUPPORTED, 'H', ' ' },
> };
>
> /**
> @@ -197,6 +198,7 @@ static const struct tnt tnts[] = {
> * 'W' - Taint on warning.
> * 'C' - modules from drivers/staging are loaded.
> * 'I' - Working around severe firmware bug.
> + * 'H' - Hardware is unsupported.
> *
> * The string is overwritten by the next call to print_tainted().
> */
> @@ -243,6 +245,9 @@ void add_taint(unsigned flag)
> */
> if (flag != TAINT_CRAP && flag != TAINT_WARN && __debug_locks_off())
> printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n");
> + if (flag == TAINT_HARDWARE_UNSUPPORTED)
> + printk(KERN_CRIT
> + "WARNING: This system's hardware is unsupported.\n");
>
> set_bit(flag, &tainted_mask);
> }
> --

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Andi Kleen on
Prarit Bhargava <prarit(a)redhat.com> writes:
nt\n");
> + if (flag == TAINT_HARDWARE_UNSUPPORTED)
> + printk(KERN_CRIT "WARNING: This system's hardware is "
> + "unsupported.\n");

The problem with such a message in mainline is that it would
imply that other hardware is actually 'supported'

Which is not really true in most cases.

-Andi

--
ak(a)linux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Alan Cox on
> Typically, one would push a config patch to enable and disable the feature and
> patch the distribution. However, in some cases this is not feasible in order

If you can push a patch to set the flag you can push a patch to panic or
reject that combination.

Devil's advocate time:

Also the fact some distributions chose a binary compatible interface for
their internal modules was their choice. It is one that has been
repeatedly rejected by upstream and at kernel summit.

So given we fundamnetally reject your approach why should we carry your
flag ?

> In some cases the distribution may want to allow booting of these features but
> explicitly notify a user that they are not "officially" supported. It is also

We have printk. You can add a module of your own which indicates
'support' status too.

> possible that the hardware is fixed via a firmware update at a later date,
> making it supported again.

IMHO it's not properly named in the first place. You are talking about
combinations of hardware/firmware and you actually mean 'configuration
not supported' ?

> This patch introduces the TAINT_HARDWARE_UNSUPPORTED flag for distributions
> to use.

and why KERN_CRIT when the other printk's don't use that level ?

A suggestion: instead of all this push a single patch with a comment and
maybe defines indicating that taint flag bits 28-31 are 'reserved' for
experimental and out of tree applications.

That way anyone who has a requirement like yours can deal with it and
nobody has to worry about bit collisions, naming and the like. Nor if you
suddenely need an extra bit in 3 years time are you going to come unstuck
on your KABI. That will help other people doing experiments with taint or
with differing needs to the Red Hat one.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/