|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging] xen/arm: domain_build: Avoid implicit conversion from ULL to UL
commit 5ec05cddb8faab834672be6a854c9981b4ae3d8a
Author: Julien Grall <julien.grall@xxxxxxx>
AuthorDate: Sun Sep 29 16:56:26 2019 +0100
Commit: Julien Grall <julien.grall@xxxxxxx>
CommitDate: Tue Oct 1 10:03:35 2019 +0100
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@xxxxxxx>
Released-acked-by: Juergen Gross <jgross@xxxxxxxx>
Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
xen/arch/arm/domain_build.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 337a89e518..b791e4b512 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -377,7 +377,7 @@ static void __init allocate_memory_11(struct domain *d,
static bool __init allocate_bank_memory(struct domain *d,
struct kernel_info *kinfo,
gfn_t sgfn,
- unsigned long tot_size)
+ paddr_t tot_size)
{
int res;
struct page_info *pg;
@@ -433,7 +433,7 @@ static bool __init allocate_bank_memory(struct domain *d,
static void __init allocate_memory(struct domain *d, struct kernel_info *kinfo)
{
unsigned int i;
- unsigned long bank_size;
+ paddr_t bank_size;
printk(XENLOG_INFO "Allocating mappings totalling %ldMB for %pd:\n",
/* Don't want format this as PRIpaddr (16 digit hex) */
--
generated by git-patchbot for /home/xen/git/xen.git#staging
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |