From nobody Sun Apr 28 23:26:10 2024 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=1566425621; cv=none; d=zoho.com; s=zohoarc; b=Ux2SYTluS1Wc6bKy/z7gvG1BTDzFiPKguxrrxeRqOHWihSAfx8FdKLCabh6lHdWCnUq95Whz69B3Dd4/366/ykXHO0dVq3Fsv0FNR/nGqMQaemUALDVGUL++BCe6r7CE4qeKc7U5ja8AezL3LLk6lm1fYmpB469w1tHAg2lsr6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566425621; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=qMW75ZEuNYH11vHIUHqPnEU64HWKeYs8NoptKPFQYPo=; b=Z9671pxv+fiwLArsZQBW8PDy7ePsZ7oBBYUmR7hsaReMg8R6uPKCnzElsWpgGwV9IFRWKOjmpTP5rbOMcu8HCEKKUP041YjNJkY1kHb5UwhrRruBTeyD5qN+OR9sL4RwaDi+wo2yzugTnwjZI/4ltliRGHu3p/AeCO2WBuYdDgw= 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 1566425621855653.8360850678704; Wed, 21 Aug 2019 15:13:41 -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 1i0YqE-0004U5-In; Wed, 21 Aug 2019 22:12:30 +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 1i0YqD-0004U0-6N for xen-devel@lists.xenproject.org; Wed, 21 Aug 2019 22:12:29 +0000 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id c31086b8-c460-11e9-adcc-12813bfff9fa; Wed, 21 Aug 2019 22:12:28 +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 BCBFF337; Wed, 21 Aug 2019 15:12:27 -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 EF4103F718; Wed, 21 Aug 2019 15:12:26 -0700 (PDT) X-Inumbo-ID: c31086b8-c460-11e9-adcc-12813bfff9fa From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 21 Aug 2019 23:12:21 +0100 Message-Id: <20190821221221.19456-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PATCH] xen/arm: domain_build: Don't continue if unable to allocate all dom0 banks 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: Julien Grall , Stefano Stabellini , Volodymyr Babchuk , Bertrand.Marquis@arm.com 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" Xen will only print a warning if there are memory unallocated when using 1:1 mapping (only used by dom0). This also includes the case where no memory has been allocated. It will bring to all sort of issues that can be hard to diagnostic for users (the warning can be difficult to spot or disregard). If the users request 1GB of memory, then most likely they want the exact amount and not 512MB. So panic if all the memory has not been allocated. After this change, the behavior is the same as for non-1:1 memory allocation (used by domU). At the same time, reflow the message to have the format on a single line. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini --- Cc: Bertrand.Marquis@arm.com It took me sometimes this morning to spot the warning in the log. If we don't honor the size, it feels it is better to crash and request the user to request less memory (or re-order the binary). This is inline on how domU memory allocation is handled. --- xen/arch/arm/domain_build.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 1a3dcb1bcd..72e14746cd 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -358,10 +358,9 @@ static void __init allocate_memory_11(struct domain *d, } =20 if ( kinfo->unassigned_mem ) - printk("WARNING: Failed to allocate requested dom0 memory." - /* Don't want format this as PRIpaddr (16 digit hex) */ - " %ldMB unallocated\n", - (unsigned long)kinfo->unassigned_mem >> 20); + /* Don't want format this as PRIpaddr (16 digit hex) */ + panic("Failed to allocate requested dom0 memory. %ldMB unallocated= \n", + (unsigned long)kinfo->unassigned_mem >> 20); =20 for( i =3D 0; i < kinfo->mem.nr_banks; i++ ) { --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel