All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: Use ULL for GB macro
@ 2015-05-21 23:16 Julien Grall
  2015-05-22  6:53 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Grall @ 2015-05-21 23:16 UTC (permalink / raw)
  To: xen-devel
  Cc: keir, ian.campbell, tim, Julien Grall, stefano.stabellini, jbeulich

On 32bit, GB(4) doesn't fit on an unsigned long.

Alos, fix a couple of printf format in x86 which breaks after using
unsigned long long.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
---
 xen/arch/x86/apic.c      | 2 +-
 xen/arch/x86/io_apic.c   | 2 +-
 xen/include/xen/config.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
index 499e70f..bf0b2fe 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 %08llx (%08lx)\n", APIC_BASE,
                 apic_phys);
 
 __next:
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 976c0c5..1b2300a 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 %08llx (%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..f0746c2 100644
--- a/xen/include/xen/config.h
+++ b/xen/include/xen/config.h
@@ -70,7 +70,7 @@
 #define __bitwise
 
 #define MB(_mb)     (_AC(_mb, UL) << 20)
-#define GB(_gb)     (_AC(_gb, UL) << 30)
+#define GB(_gb)     (_AC(_gb, ULL) << 30)
 
 #define __STR(...) #__VA_ARGS__
 #define STR(...) __STR(__VA_ARGS__)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen: Use ULL for GB macro
  2015-05-21 23:16 [PATCH] xen: Use ULL for GB macro Julien Grall
@ 2015-05-22  6:53 ` Jan Beulich
  2015-05-22  9:37   ` Julien Grall
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2015-05-22  6:53 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, keir, stefano.stabellini, ian.campbell, tim

>>> On 22.05.15 at 01:16, <julien.grall@citrix.com> wrote:
> --- 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 %08llx (%08lx)\n", APIC_BASE,

Please use 'L' as the shorter equivalent.

> --- a/xen/include/xen/config.h
> +++ b/xen/include/xen/config.h
> @@ -70,7 +70,7 @@
>  #define __bitwise
>  
>  #define MB(_mb)     (_AC(_mb, UL) << 20)
> -#define GB(_gb)     (_AC(_gb, UL) << 30)
> +#define GB(_gb)     (_AC(_gb, ULL) << 30)

So why do you leave MB() alone? It obviously suffers from the same
problem (perhaps only latent at this point, but anyway).

Jan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen: Use ULL for GB macro
  2015-05-22  6:53 ` Jan Beulich
@ 2015-05-22  9:37   ` Julien Grall
  0 siblings, 0 replies; 3+ messages in thread
From: Julien Grall @ 2015-05-22  9:37 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, keir, stefano.stabellini, ian.campbell, tim

Hi Jan,

On 22/05/2015 07:53, Jan Beulich wrote:
>>>> On 22.05.15 at 01:16, <julien.grall@citrix.com> wrote:
>> --- 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 %08llx (%08lx)\n", APIC_BASE,
>
> Please use 'L' as the shorter equivalent.

I didn't know this shorthand. I will use %Lx

>
>> --- a/xen/include/xen/config.h
>> +++ b/xen/include/xen/config.h
>> @@ -70,7 +70,7 @@
>>   #define __bitwise
>>
>>   #define MB(_mb)     (_AC(_mb, UL) << 20)
>> -#define GB(_gb)     (_AC(_gb, UL) << 30)
>> +#define GB(_gb)     (_AC(_gb, ULL) << 30)
>
> So why do you leave MB() alone? It obviously suffers from the same
> problem (perhaps only latent at this point, but anyway).

Because I haven't had any problem with MB. I will resend a new version 
with the 2 fixes.

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-22  9:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21 23:16 [PATCH] xen: Use ULL for GB macro Julien Grall
2015-05-22  6:53 ` Jan Beulich
2015-05-22  9:37   ` Julien Grall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.