Skip to contentSkip to conversation

xen: Fix incorrect taint constant

PATCH Superseded Andrew Cooper 3 participants 6 messages Jun 5, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: Fix incorrect taint constant

Insecure the word being looked for here. Especially given the nature of the sole caller, and the (correct) comment next to it.

I've left the taint constant as 'U' as it's a rather more user-visible.

Fixes 82c0d3d491cc ("xen: Add an unsecure Taint type")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>

I'm happy to change 'U' to 'I' if we think that no-one is going to be impacted by it. I just wasn't sure.

---
 xen/arch/arm/cpuerrata.c | 2 +-
 xen/common/kernel.c      | 2 +-
 xen/include/xen/lib.h    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
xen/arch/arm/cpuerrata.c +1 -1
index 1abacfe5bb67..d0658aedb6aa 100644
@@ -695,7 +695,7 @@ void __init enable_errata_workarounds(void)
                     "**** Only trusted guests should be used.                             ****\n");
 
         /* Taint the machine has being insecure */
-        add_taint(TAINT_MACHINE_UNSECURE);
+        add_taint(TAINT_MACHINE_INSECURE);
     }
 #endif
 }
xen/common/kernel.c +1 -1
index f7b1f65f373c..14ce6b40ce06 100644
@@ -354,7 +354,7 @@ char *print_tainted(char *str)
     if ( tainted )
     {
         snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c%c%c",
-                 tainted & TAINT_MACHINE_UNSECURE ? 'U' : ' ',
+                 tainted & TAINT_MACHINE_INSECURE ? 'U' : ' ',
                  tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
                  tainted & TAINT_SYNC_CONSOLE ? 'C' : ' ',
                  tainted & TAINT_ERROR_INJECT ? 'E' : ' ',
xen/include/xen/lib.h +1 -1
index e914ccade095..75ae7489b9f0 100644
@@ -201,7 +201,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
 #define TAINT_MACHINE_CHECK             (1u << 1)
 #define TAINT_ERROR_INJECT              (1u << 2)
 #define TAINT_HVM_FEP                   (1u << 3)
-#define TAINT_MACHINE_UNSECURE          (1u << 4)
+#define TAINT_MACHINE_INSECURE          (1u << 4)
 #define TAINT_CPU_OUT_OF_SPEC           (1u << 5)
 extern unsigned int tainted;
 #define TAINT_STRING_MAX_LEN            20

base-commit: 67fdffef9246c82cecd8db28838ed09e79e2528a

Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw
Quoted 1 line · Andrew Cooper

Insecure the word being looked for here. Especially given the nature of the

Nit: Missing "is"?

Quoted 6 lines

sole caller, and the (correct) comment next to it.

I've left the taint constant as 'U' as it's a rather more user-visible.

Fixes 82c0d3d491cc ("xen: Add an unsecure Taint type")
Quoted 2 lines

I'm happy to change 'U' to 'I' if we think that no-one is going to be impacted by it. I just wasn't sure.

I agree with what you have done, i.e. leaving it as is.

Jan

#2 lore raw
Quoted 3 lines · Jan Beulich
Quoted 1 line · Andrew Cooper

Insecure the word being looked for here. Especially given the nature of the

Nit: Missing "is"?

Oops yes.

Quoted 8 lines
Quoted 7 lines

sole caller, and the (correct) comment next to it.

I've left the taint constant as 'U' as it's a rather more user-visible.

Fixes 82c0d3d491cc ("xen: Add an unsecure Taint type")

Thanks, although I've got one extra hunk to add having just done the other half of the taint work.

xen/common/kernel.c +0 -0
index 14ce6b40ce06..ff67f00e41bb 100644
@@ -344,7 +344,7 @@ unsigned int tainted;

  *  'E' - An error (e.g. a machine check exceptions) has been injected. *  'H' - HVM forced emulation prefix is permitted.
  *  'M' - Machine had a machine check experience.
- *  'U' - Platform is unsecure (usually due to an errata on the platform).
+ *  'U' - Platform is insecure (usually due to an errata on the platform). *  'S' - Out of spec CPU (One core has a feature incompatible with others).
  *
  *      The string is overwritten by the next call to print_taint().

Quoted 3 lines
Quoted 2 lines

I'm happy to change 'U' to 'I' if we think that no-one is going to be impacted by it. I just wasn't sure.

I agree with what you have done, i.e. leaving it as is.

Yeah, I assumed that was going to be the preferred route.

~Andrew

#3 lore raw
Quoted 30 lines · Andrew Cooper
Quoted 3 lines · Jan Beulich
Quoted 1 line · Andrew Cooper

Insecure the word being looked for here. Especially given the nature of the

Nit: Missing "is"?

Oops yes.

Quoted 8 lines
Quoted 7 lines

sole caller, and the (correct) comment next to it.

I've left the taint constant as 'U' as it's a rather more user-visible.

Fixes 82c0d3d491cc ("xen: Add an unsecure Taint type")

Thanks, although I've got one extra hunk to add having just done the other half of the taint work.

xen/common/kernel.c +1 -1
index 14ce6b40ce06..ff67f00e41bb 100644
@@ -344,7 +344,7 @@ unsigned int tainted;
   *  'E' - An error (e.g. a machine check exceptions) has been injected.
   *  'H' - HVM forced emulation prefix is permitted.
   *  'M' - Machine had a machine check experience.
- *  'U' - Platform is unsecure (usually due to an errata on the platform).
+ *  'U' - Platform is insecure (usually due to an errata on the platform).
   *  'S' - Out of spec CPU (One core has a feature incompatible with
Quoted 3 lines

others).
  *
  *      The string is overwritten by the next call to print_taint().

My ack (quite obviously) stands with this further adjustment.

Jan

#4 lore raw
In reply to Andrew Cooper

Hi Andrew,

Quoted 4 lines · Andrew Cooper

Insecure the word being looked for here. Especially given the nature of the sole caller, and the (correct) comment next to it.

Good finding.

Quoted 2 lines

I've left the taint constant as 'U' as it's a rather more user-visible.

I would vote to change the U in I here as it will make it more coherent with the doc after your added fix for it.

Quoted 12 lines
Fixes 82c0d3d491cc ("xen: Add an unsecure Taint type")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>

Quoted 2 lines

I'm happy to change 'U' to 'I' if we think that no-one is going to be impacted by it. I just wasn't sure.

Here i do not think many will be impacted so I would rather make this coherent.

Cheers
Bertrand

Quoted 50 lines

---

xen/arch/arm/cpuerrata.c | 2 +-
xen/common/kernel.c      | 2 +-
xen/include/xen/lib.h    | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
xen/arch/arm/cpuerrata.c +1 -1
index 1abacfe5bb67..d0658aedb6aa 100644
@@ -695,7 +695,7 @@ void __init enable_errata_workarounds(void)
                    "**** Only trusted guests should be used.                             ****\n");
 
        /* Taint the machine has being insecure */
-        add_taint(TAINT_MACHINE_UNSECURE);
+        add_taint(TAINT_MACHINE_INSECURE);
    }
 #endif
 }
xen/common/kernel.c +1 -1
index f7b1f65f373c..14ce6b40ce06 100644
@@ -354,7 +354,7 @@ char *print_tainted(char *str)
    if ( tainted )
    {
        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c%c%c",
-                 tainted & TAINT_MACHINE_UNSECURE ? 'U' : ' ',
+                 tainted & TAINT_MACHINE_INSECURE ? 'U' : ' ',
                 tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
                 tainted & TAINT_SYNC_CONSOLE ? 'C' : ' ',
                 tainted & TAINT_ERROR_INJECT ? 'E' : ' ',
xen/include/xen/lib.h +1 -1
index e914ccade095..75ae7489b9f0 100644
@@ -201,7 +201,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
 #define TAINT_MACHINE_CHECK             (1u << 1)
 #define TAINT_ERROR_INJECT              (1u << 2)
 #define TAINT_HVM_FEP                   (1u << 3)
-#define TAINT_MACHINE_UNSECURE          (1u << 4)
+#define TAINT_MACHINE_INSECURE          (1u << 4)
 #define TAINT_CPU_OUT_OF_SPEC           (1u << 5)
 extern unsigned int tainted;
 #define TAINT_STRING_MAX_LEN            20

base-commit: 67fdffef9246c82cecd8db28838ed09e79e2528a

Signature · 1 line
2.30.2
#5 lore raw
Quoted 23 lines · Bertrand Marquis

Hi Andrew,

Quoted 4 lines · Andrew Cooper

Insecure the word being looked for here. Especially given the nature of the sole caller, and the (correct) comment next to it.

Good finding.

Quoted 1 line

I've left the taint constant as 'U' as it's a rather more user-visible.

I would vote to change the U in I here as it will make it more coherent with the doc after your added fix for it.

Quoted 11 lines
Fixes 82c0d3d491cc ("xen: Add an unsecure Taint type")

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>

Quoted 3 lines
Quoted 2 lines

I'm happy to change 'U' to 'I' if we think that no-one is going to be impacted by it. I just wasn't sure.

Here i do not think many will be impacted so I would rather make this coherent.

Ok.  I'll submit a v2 with everything adjusted.

~Andrew