From patchwork Wed Aug 21 22:12:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 171991 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp34389ily; Wed, 21 Aug 2019 15:13:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqybAogsPvhSrmapExybp4DDkOLY9IWHBhr6FbSQY1zo3+aoHMtff4FPpQ8bImKF9kPi/wTH X-Received: by 2002:a5e:9741:: with SMTP id h1mr3685095ioq.24.1566425633853; Wed, 21 Aug 2019 15:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566425633; cv=none; d=google.com; s=arc-20160816; b=dUUPY2qwkDZY8WvWaZoeqU5mVa7GzFTtww/RtXmt3N0XkV9X4dYSxSZ2z6gccRtWdG Ewt143b1shWvP+KRvqLiG40O3rSTTkz/ziEldSlzvBJgbepHoLeltuoIVrObc4fu4DGC tbm1QYMiNLG1eP9oOE4cycWLAokroeCbrO7pS4KmeobhtSFtVfdI4KRrPE0x5i8nAiwU LpYp76P05BSCSx5kilaCYItXEU6wFxybZo0AsZoatVgpMFkUfkvNKkyiYgku8VLJssT3 Tjn0Jp5Jb0gzUyMgU+eNXdhMknCWp7oAQwHBw27xaaVohC7v7LcimEoAZNLuPZ/2k0At IJOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:message-id:date:to:from; bh=qMW75ZEuNYH11vHIUHqPnEU64HWKeYs8NoptKPFQYPo=; b=E44DBZDz5k4pt/3ZUhfXiUDt4bxtVuF4xRBFoNlJYSrmJ/MreZQJSQgrbB+G7HXSIi Zs9RHTk1mWzegWdkKLt7ahwcH1bFqeh9rZOGUMBm4Z41B/8moD7DIxVtGAnFnxCYgrwz Hcch4MnC64Pe+xynwg0JoTuoqVF5vz5/PSSV16FbJIoEll1KRfyWyOtlwb9OsMaTENkD KlHkFrp6hbYRus3u+gIpFKSuB74ux0sgBtgg+b12if9a2TuAlu0Ob7TzoqSszi6LIp3e Qbd5Piwuo9xyeng/FNcqp/hMV068xvd+3LmIXpSGX4Ddlk2oSGQoAIeog5pd2gJnHEyT N0gQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id e133si10857046ioa.117.2019.08.21.15.13.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Aug 2019 15:13:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org 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 X-Inumbo-ID: c31086b8-c460-11e9-adcc-12813bfff9fa 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) 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 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, } 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); for( i = 0; i < kinfo->mem.nr_banks; i++ ) {