common: clean up taint logic Drop unused UNSAFE_SMP and BAD_PAGE flags. Style adjstments. Signed-off-by: Jan Beulich --- 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; } --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -137,16 +137,14 @@ unsigned long long parse_size_and_unit(c 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 *);