xen/arm: domain_build: Avoid implicit conversion from ULL to UL
authorJulien Grall <julien.grall@arm.com>
Sun, 29 Sep 2019 15:56:26 +0000 (16:56 +0100)
committerJulien Grall <julien.grall@arm.com>
Tue, 1 Oct 2019 09:03:35 +0000 (10:03 +0100)
commit5ec05cddb8faab834672be6a854c9981b4ae3d8a
tree8c104b26c54047a1334074cd3a39289bf82c6d19
parent58197b685a4f61969c5903e7f079ba0ebf4fa59e
xen/arm: domain_build: Avoid implicit conversion from ULL to UL

Clang 8.0 will fail to build domain_build.c on Arm32 because of the
following error:

domain_build.c:448:21: error: implicit conversion from 'unsigned long long' to 'unsigned long' changes value from 1090921693184 to 0
[-Werror,-Wconstant-conversion]
    bank_size = MIN(GUEST_RAM1_SIZE, kinfo->unassigned_mem);

Arm32 is able to support more than 4GB of physical memory, so it would
be theorically possible to create domain with more the 4GB of RAM.
Therefore, the size of a bank may not fit in 32-bit.

This can be resolved by switch the variable bank_size and the parameter
tot_size to "paddr_t".

Signed-off-by: Julien Grall <julien.grall@arm.com>
Released-acked-by: Juergen Gross <jgross@suse.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/domain_build.c