]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
x86/msr: Correct the definition of MSR_IA32_APICBASE_BASE
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 5 Aug 2016 13:51:13 +0000 (14:51 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 3 Oct 2017 16:45:24 +0000 (17:45 +0100)
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 <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
xen/include/asm-x86/msr-index.h

index 4e08de63845fbbd7a5af4c2aa282df16a4af8b5c..b99c623367b83184318677f89e5f3e8b8642d34c 100644 (file)
 #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