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

[PATCH] x86/mwait-idle: fix ubsan warning



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'

Signed-off-by: Tamas K Lengyel <tamas.lengyel@xxxxxxxxx>
Fixes: 5a211704e88 ("mwait-idle: prevent SKL-H boot failure when C8+C9+C10 
enabled")
---
 xen/arch/x86/include/asm/mwait.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mwait.h
index f377d9f..9298f98 100644
--- a/xen/arch/x86/include/asm/mwait.h
+++ b/xen/arch/x86/include/asm/mwait.h
@@ -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
-- 
2.34.1




 


Rackspace

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