From patchwork Tue Jul 26 20:18:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 9248803 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0A9C26077C for ; Tue, 26 Jul 2016 20:21:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F109926B39 for ; Tue, 26 Jul 2016 20:21:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5ADA272AA; Tue, 26 Jul 2016 20:21:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 818A626B39 for ; Tue, 26 Jul 2016 20:21:09 +0000 (UTC) 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 1bS8pH-0006kY-BA; Tue, 26 Jul 2016 20:19:39 +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 1bS8of-0006Vf-E4; Tue, 26 Jul 2016 20:19:01 +0000 Received: from geoff by merlin.infradead.org with local (Exim 4.85_2 #1 (Red Hat Linux)) id 1bS8ob-0001N4-2n; Tue, 26 Jul 2016 20:18:57 +0000 Message-Id: In-Reply-To: References: From: Geoff Levand Patch-Date: Fri, 22 Aug 2014 13:48:52 +0900 Subject: [PATCH v2 1/4] kexec: (bugfix) calc correct end address of memory ranges in device tree To: Simon Horman Date: Tue, 26 Jul 2016 20:18:57 +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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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); } }