]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
x86/mwait-idle: fix ubsan warning
authorTamas K Lengyel <tamas.lengyel@intel.com>
Mon, 8 Jan 2024 09:16:58 +0000 (10:16 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 8 Jan 2024 09:16:58 +0000 (10:16 +0100)
Fix warning:
(XEN) UBSAN: Undefined behaviour in arch/x86/cpu/mwait-idle.c:1300:44
(XEN) left shift of 15 by 28 places cannot be represented in type 'int'
originating from sklh_idle_state_table_update() and hence observable on
one kind of CPU only.

Fixes: 5a211704e88 ("mwait-idle: prevent SKL-H boot failure when C8+C9+C10 enabled")
Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/include/asm/mwait.h

index f377d9fdcad4bf91d7005daf3a638faa03e2baa4..9298f987c4355fd1d6898512368092393922f55c 100644 (file)
@@ -4,7 +4,7 @@
 #include <xen/types.h>
 
 #define MWAIT_SUBSTATE_MASK            0xf
-#define MWAIT_CSTATE_MASK              0xf
+#define MWAIT_CSTATE_MASK              0xfU
 #define MWAIT_SUBSTATE_SIZE            4
 
 #define CPUID_MWAIT_LEAF               5