Skip to contentSkip to conversation

x86/msr: Correct the definition of MSR_IA32_APICBASE_BASE

PATCH In review Andrew Cooper 2 participants 2 messages Oct 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/msr: Correct the definition of MSR_IA32_APICBASE_BASE

0xfffff << 12 is undefined behaviour, due to shifting into the sign bit of an integer.

Spotted by the Undefined Behaviour Sanitiser

---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>

I appear to have missed this patch from my past UBSAN work.

---
 xen/include/asm-x86/msr-index.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/asm-x86/msr-index.h +1 -1
index 4e08de6..b99c623 100644
@@ -305,7 +305,7 @@
 #define MSR_IA32_APICBASE_BSP		(1<<8)
 #define MSR_IA32_APICBASE_EXTD		(1<<10)
 #define MSR_IA32_APICBASE_ENABLE	(1<<11)
-#define MSR_IA32_APICBASE_BASE		(0xfffff<<12)
+#define MSR_IA32_APICBASE_BASE		0x000ffffffffff000ul
 #define MSR_IA32_APICBASE_MSR           0x800
 #define MSR_IA32_APICTPR_MSR            0x808
 #define MSR_IA32_APICPPR_MSR            0x80a
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel