x86/msr: Correct the definition of MSR_IA32_APICBASE_BASE
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
Signed-off-by Andrew Cooper <[email protected]>
---
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
@@ -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
Quoted 6 lines · Andrew Cooper
0xfffff<< 12 is undefined behaviour, due to shifting into the sign bit of an integer.Spotted by the Undefined Behaviour Sanitiser
Signed-off-by Andrew Cooper <[email protected]>
Reviewed-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel