On 09/09/2024 11:38 am, Jan Beulich wrote:
> On 09.09.2024 12:08, Frediano Ziglio wrote:
>> --- a/xen/arch/x86/setup.c
>> +++ b/xen/arch/x86/setup.c
>> @@ -1384,9 +1384,9 @@ void asmlinkage __init noreturn __start_xen(unsigned 
>> long mbi_p)
>>          }
>>  
>>          if ( e > min(HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START,
>> -                     1UL << (PAGE_SHIFT + 32)) )
>> +                     UINT64_C(1) << (PAGE_SHIFT + 32)) )
>>              e = min(HYPERVISOR_VIRT_END - DIRECTMAP_VIRT_START,
>> -                    1UL << (PAGE_SHIFT + 32));
>> +                    UINT64_C(1) << (PAGE_SHIFT + 32));
> I disagree - we're dealing with virtual addresses here, which better
> wouldn't use fixed-width quantities.
>
> While not always virtual addresses, I similarly disagree for most or all
> I've left in context further up: If the underlying type to deal with is
> unsigned long, constants should match.

This is the same problem I ran into with fixmap mappings.

GB() and friends used in config.h are ULL constants, and promote the
underlying variables from UL.

64bit mostly copes (give or take some printk formatting), but 32bit
fails to compile.

~Andrew

Reply via email to