From patchwork Tue Jul 19 23:28:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 72384 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp334421qga; Tue, 19 Jul 2016 16:30:05 -0700 (PDT) X-Received: by 10.98.36.134 with SMTP id k6mr59456129pfk.116.1468971004167; Tue, 19 Jul 2016 16:30:04 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ts10si2014793pac.256.2016.07.19.16.30.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2016 16:30:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bPeRE-0005fr-8S; Tue, 19 Jul 2016 23:28:32 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bPeQz-0005bj-QG; Tue, 19 Jul 2016 23:28:17 +0000 Received: from geoff by merlin.infradead.org with local (Exim 4.85_2 #1 (Red Hat Linux)) id 1bPeQv-0006t7-Aw; Tue, 19 Jul 2016 23:28:13 +0000 Message-Id: In-Reply-To: References: From: Geoff Levand Patch-Date: Fri, 22 Aug 2014 13:48:52 +0900 Subject: [PATCH v1 1/4] kexec: (bugfix) calc correct end address of memory ranges in device tree To: Simon Horman Date: Tue, 19 Jul 2016 23:28:13 +0000 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pratyush Anand , AKASHI Takahiro , kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org From: AKASHI Takahiro The end address of "reg" attribute in device tree's memory should be inclusive. From: AKASHI Takahiro Signed-off-by: Geoff Levand --- kexec/fs2dt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c index 6ed2399..f00fd98 100644 --- a/kexec/fs2dt.c +++ b/kexec/fs2dt.c @@ -236,7 +236,8 @@ static void add_dyn_reconf_usable_mem_property__(int fd) ranges_size*8); } ranges[rlen++] = cpu_to_be64(loc_base); - ranges[rlen++] = cpu_to_be64(loc_end - loc_base); + ranges[rlen++] = cpu_to_be64(loc_end + - loc_base + 1); rngs_cnt++; } } @@ -350,7 +351,7 @@ static void add_usable_mem_property(int fd, size_t len) ranges_size*sizeof(*ranges)); } ranges[rlen++] = cpu_to_be64(loc_base); - ranges[rlen++] = cpu_to_be64(loc_end - loc_base); + ranges[rlen++] = cpu_to_be64(loc_end - loc_base + 1); } }