From nobody Tue Nov 11 08:45:41 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1569772666; cv=none; d=zoho.com; s=zohoarc; b=XDRGo8HB3dYdTmX4I7h9swHDgEhsdybmMla0nBk/+xZ7ZswXD9xXUr7EuLHj9t/VIbjPu1iF6Dpl8/nktrw+2m9qQhxGzclVsMgCbXNjBqLRu7o73sjgezihobKYHAeyz0JbVXU1+0bcm4X+fZDwxUYlqNYJVWl+h3gIwWwHCpQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569772666; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=h4VfsarHP7iRtdS7PycbvJFEdqF2kbAjfiBA++KVgoY=; b=g/ZsWEDFnhX1GfbdX/9aMci3zlSGu0HlAu259dNFolL7FI/Y7OWs24rnf00xbx94bvHqocj7fhyxU3v/omsQnHQfh2IPaDdbb1HmdFTwxZei4hHly6dp7WmqzCnhXFIYXgx/IqjNs7BxjQHaRIyzMtrormN7LU00EOs5RX1Dj0M= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569772666044612.5106568588429; Sun, 29 Sep 2019 08:57:46 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iEbYt-0002O0-Lf; Sun, 29 Sep 2019 15:56:39 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iEbYr-0002Nu-PC for xen-devel@lists.xenproject.org; Sun, 29 Sep 2019 15:56:37 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by localhost (Halon) with ESMTP id b53c931c-e2d1-11e9-96b9-12813bfff9fa; Sun, 29 Sep 2019 15:56:32 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 815E51570; Sun, 29 Sep 2019 08:56:32 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B51DC3F706; Sun, 29 Sep 2019 08:56:31 -0700 (PDT) X-Inumbo-ID: b53c931c-e2d1-11e9-96b9-12813bfff9fa From: Julien Grall To: xen-devel@lists.xenproject.org Date: Sun, 29 Sep 2019 16:56:26 +0100 Message-Id: <20190929155627.23493-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190929155627.23493-1-julien.grall@arm.com> References: <20190929155627.23493-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.13 1/2] xen/arm: domain_build: Avoid implicit conversion from ULL to UL X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Julien Grall , Stefano Stabellini , Volodymyr Babchuk MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 =3D 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 domian 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 Acked-by: Stefano Stabellini --- Cc: Juergen Gross I am not aware of any users trying to allocate more than 4GB VM for 32-bit (there more it is in the dom0less path). Nonetheless, it would be best to fix it as soon as possible. Only built test it. --- 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 *k= info) { unsigned int i; - unsigned long bank_size; + paddr_t bank_size; =20 printk(XENLOG_INFO "Allocating mappings totalling %ldMB for %pd:\n", /* Don't want format this as PRIpaddr (16 digit hex) */ --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel