]> Git Repo - qemu.git/commitdiff
target-i386: Fix signedness of MSR_IA32_APICBASE_BASE
authorEduardo Habkost <[email protected]>
Fri, 29 May 2015 19:31:12 +0000 (16:31 -0300)
committerEduardo Habkost <[email protected]>
Tue, 2 Jun 2015 18:15:52 +0000 (15:15 -0300)
Existing definition triggers the following when using clang
-fsanitize=undefined:

    hw/intc/apic_common.c:314:55: runtime error: left shift of 1048575 by 12
        places cannot be represented in type 'int'

Fix it so we won't try to shift a 1 to the sign bit of a signed integer.

Suggested-by: Peter Maydell <[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
target-i386/cpu.h

index 4ee12ca2e92d1d66e8df7d869a2b197742ba7b78..26182bdc7e69bfa0226a43b5f60e724b6a86f696 100644 (file)
 #define MSR_IA32_APICBASE               0x1b
 #define MSR_IA32_APICBASE_BSP           (1<<8)
 #define MSR_IA32_APICBASE_ENABLE        (1<<11)
-#define MSR_IA32_APICBASE_BASE          (0xfffff<<12)
+#define MSR_IA32_APICBASE_BASE          (0xfffffU<<12)
 #define MSR_IA32_FEATURE_CONTROL        0x0000003a
 #define MSR_TSC_ADJUST                  0x0000003b
 #define MSR_IA32_TSCDEADLINE            0x6e0
This page took 0.024546 seconds and 4 git commands to generate.