From: Julien Grall Subject: [PATCH v2] xen: Use ULL for GB and MB macros Date: Fri, 22 May 2015 11:14:27 +0100 Message-ID: <1432289667-32214-1-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yvjys-0007SZ-87 for xen-devel@lists.xenproject.org; Fri, 22 May 2015 10:15:06 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: keir@xen.org, ian.campbell@citrix.com, tim@xen.org, Julien Grall , stefano.stabellini@citrix.com, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org On 32bit, GB(4) doesn't fit on an unsigned long. Modify MB to avoid further issue. Also, fix a couple of printf format in x86 which breaks after using unsigned long long. Signed-off-by: Julien Grall --- Changes in v2: - Use %Lx rather than %llx - Use ULL in the MB macro too --- xen/arch/x86/apic.c | 2 +- xen/arch/x86/io_apic.c | 2 +- xen/include/xen/config.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c index 499e70f..2c9ae4e 100644 --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -992,7 +992,7 @@ void __init init_apic_mappings(void) apic_phys = mp_lapic_addr; set_fixmap_nocache(FIX_APIC_BASE, apic_phys); - apic_printk(APIC_VERBOSE, "mapped APIC to %08lx (%08lx)\n", APIC_BASE, + apic_printk(APIC_VERBOSE, "mapped APIC to %08Lx (%08lx)\n", APIC_BASE, apic_phys); __next: diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 6f66562..7d4ee5d 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -2546,7 +2546,7 @@ void __init init_ioapic_mappings(void) clear_page(__va(ioapic_phys)); } set_fixmap_nocache(idx, ioapic_phys); - apic_printk(APIC_VERBOSE, "mapped IOAPIC to %08lx (%08lx)\n", + apic_printk(APIC_VERBOSE, "mapped IOAPIC to %08Lx (%08lx)\n", __fix_to_virt(idx), ioapic_phys); idx++; diff --git a/xen/include/xen/config.h b/xen/include/xen/config.h index 6478a0a..f7258c7 100644 --- a/xen/include/xen/config.h +++ b/xen/include/xen/config.h @@ -69,8 +69,8 @@ #define __force #define __bitwise -#define MB(_mb) (_AC(_mb, UL) << 20) -#define GB(_gb) (_AC(_gb, UL) << 30) +#define MB(_mb) (_AC(_mb, ULL) << 20) +#define GB(_gb) (_AC(_gb, ULL) << 30) #define __STR(...) #__VA_ARGS__ #define STR(...) __STR(__VA_ARGS__) -- 2.1.4