target-i386: Fix signedness of MSR_IA32_APICBASE_BASE
authorEduardo Habkost <ehabkost@redhat.com>
Fri, 29 May 2015 19:31:12 +0000 (16:31 -0300)
committerEduardo Habkost <ehabkost@redhat.com>
Tue, 2 Jun 2015 18:15:52 +0000 (15:15 -0300)
commit458cf469f4a1cb520b07092f5537c5a6d2389d23
tree149f539c61a0d0b2fdc15c1e6addf7e7d5e0a231
parent0e3bd56294230ad0ee20fce587879c29a83a0d8b
target-i386: Fix signedness of MSR_IA32_APICBASE_BASE

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 <peter.maydell@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
target-i386/cpu.h