[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] common: clean up taint logic



commit 3efeb60c8c78f7113254df6622c2dc1dcf91e7b7
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Aug 9 17:31:46 2016 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Aug 9 17:31:46 2016 +0200

    common: clean up taint logic
    
    Drop unused UNSAFE_SMP and BAD_PAGE flags. Style adjstments.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: George Dunlap <george.dunlap@xxxxxxxxxx>
---
 xen/common/kernel.c   | 16 +++++++---------
 xen/include/xen/lib.h | 14 ++++++--------
 2 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index 91cc4ea..2d3db64 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -22,8 +22,6 @@
 
 enum system_state system_state = SYS_STATE_early_boot;
 
-int tainted;
-
 xen_commandline_t saved_cmdline;
 
 static void __init assign_integer_param(
@@ -168,14 +166,15 @@ int __init parse_bool(const char *s)
     return -1;
 }
 
+unsigned int tainted;
+
 /**
  *      print_tainted - return a string to represent the kernel taint state.
  *
- *  'S' - SMP with CPUs not designed for SMP.
- *  'M' - Machine had a machine check experience.
- *  'B' - System has hit bad_page.
  *  'C' - Console output is synchronous.
+ *  '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.
  *
  *      The string is overwritten by the next call to print_taint().
  */
@@ -183,11 +182,10 @@ char *print_tainted(char *str)
 {
     if ( tainted )
     {
-        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c%c",
-                 tainted & TAINT_UNSAFE_SMP ? 'S' : ' ',
+        snprintf(str, TAINT_STRING_MAX_LEN, "Tainted: %c%c%c%c",
                  tainted & TAINT_MACHINE_CHECK ? 'M' : ' ',
-                 tainted & TAINT_BAD_PAGE ? 'B' : ' ',
                  tainted & TAINT_SYNC_CONSOLE ? 'C' : ' ',
+                 tainted & TAINT_ERROR_INJECT ? 'E' : ' ',
                  tainted & TAINT_HVM_FEP ? 'H' : ' ');
     }
     else
@@ -198,7 +196,7 @@ char *print_tainted(char *str)
     return str;
 }
 
-void add_taint(unsigned flag)
+void add_taint(unsigned int flag)
 {
     tainted |= flag;
 }
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 5272cc3..d04864e 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -137,16 +137,14 @@ unsigned long long parse_size_and_unit(const char *s, 
const char **ps);
 
 uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c);
 
-#define TAINT_UNSAFE_SMP                (1<<0)
-#define TAINT_MACHINE_CHECK             (1<<1)
-#define TAINT_BAD_PAGE                  (1<<2)
-#define TAINT_SYNC_CONSOLE              (1<<3)
-#define TAINT_ERROR_INJECT              (1<<4)
-#define TAINT_HVM_FEP                   (1<<5)
-extern int tainted;
+#define TAINT_SYNC_CONSOLE              (1u << 0)
+#define TAINT_MACHINE_CHECK             (1u << 1)
+#define TAINT_ERROR_INJECT              (1u << 2)
+#define TAINT_HVM_FEP                   (1u << 3)
+extern unsigned int tainted;
 #define TAINT_STRING_MAX_LEN            20
 extern char *print_tainted(char *str);
-extern void add_taint(unsigned);
+extern void add_taint(unsigned int taint);
 
 struct cpu_user_regs;
 void dump_execstate(struct cpu_user_regs *);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.