From: Jan Beulich Date: Tue, 9 Aug 2016 15:31:46 +0000 (+0200) Subject: common: clean up taint logic X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~581 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3efeb60c8c78f7113254df6622c2dc1dcf91e7b7;p=xen.git common: clean up taint logic Drop unused UNSAFE_SMP and BAD_PAGE flags. Style adjstments. Signed-off-by: Jan Beulich Acked-by: George Dunlap --- diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 91cc4eaf75..2d3db649ab 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 5272cc3a7e..d04864e12c 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 *);