From patchwork Mon Oct 31 08:50:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 9405161 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 786AC60585 for ; Mon, 31 Oct 2016 08:44:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D14129276 for ; Mon, 31 Oct 2016 08:44:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6199029278; Mon, 31 Oct 2016 08:44:16 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 43FFC29276 for ; Mon, 31 Oct 2016 08:44:15 +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 1c18Aa-0008GZ-7Q; Mon, 31 Oct 2016 08:42:16 +0000 Received: from mail-pf0-x235.google.com ([2607:f8b0:400e:c00::235]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c18AT-00089e-W1 for linux-arm-kernel@lists.infradead.org; Mon, 31 Oct 2016 08:42:11 +0000 Received: by mail-pf0-x235.google.com with SMTP id 189so20390480pfz.3 for ; Mon, 31 Oct 2016 01:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2GmdMKmHefM7wYPFvRvbo2+AQ28OumCqrlOqq31adUc=; b=aJLfApynhakZxu78QQVgc1vQ6K43fPsZFcrSLMr4eM1nI0/aHdgqy846PBqUJaZqF+ h4By1WMv5+L1pdR5z7al+YfBPVTP3TgYwIVTu1LuiaGX+vDJtMejoXhBIaDueuAoVCJF PhcEDVzhtleIudX2Of1q5fPMqh0hDuTSSKNCI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=2GmdMKmHefM7wYPFvRvbo2+AQ28OumCqrlOqq31adUc=; b=JfW7gcGrVM42zQ64MOYfMxZea67Y2CNKD27gATBviYFoiyAaa2Sm8wjRa92jqvDVqQ 3Hf0+/Vmu5I5a/+YG/4cVinqF7xjeT06hcsc/IYs7cbKC633nAtd4B72w661VtDWXMvU 6ZyPrXX8mAdXJYSZ9vI77YhiNam/1J3mXnr332XqbeoncM+MA9bQTrvH0vvuC/ZUk3nS CD1Yt+7t2r/jV+yeKZWt3rHHF2YSStf2haGaUQb9E4tc7mfiyjTDk/9hxyDnjD+bI1aR VNmVX7Wyr7FI7l3jqHZB7UiiA24ktyU6TXno0iknu7h1otwcgxO1hAo8dqTsauE6wAMN Is6Q== X-Gm-Message-State: ABUngvfBy7/LukCGxQ4JveGtM5sHQSLOVphyLsu1R+yXABuMzF+NQGXzQAqIkXWE9kHRQPaK X-Received: by 10.98.90.135 with SMTP id o129mr47253253pfb.81.1477903306572; Mon, 31 Oct 2016 01:41:46 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id 3sm34259316pfo.31.2016.10.31.01.41.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Oct 2016 01:41:46 -0700 (PDT) Date: Mon, 31 Oct 2016 17:50:09 +0900 From: AKASHI Takahiro To: Simon Horman Subject: Re: Memory range end be inclusive or exclusive? Re: [PATCH v1 1/4] kexec: (bugfix) calc correct end address of memory ranges in device tree Message-ID: <20161031085008.GF19531@linaro.org> Mail-Followup-To: AKASHI Takahiro , Simon Horman , Russell King - ARM Linux , Geoff Levand , Thiago Jung Bauermann , kexec@lists.infradead.org, Pratyush Anand , linux-arm-kernel@lists.infradead.org References: <3562841.ROYbCgkeeq@hactar> <20160727232331.GY1041@n2100.armlinux.org.uk> <1860371.lT9GInp2C3@hactar> <20160729082714.GA1041@n2100.armlinux.org.uk> <1469812346.16559.40.camel@infradead.org> <20160729172356.GD1041@n2100.armlinux.org.uk> <20160801045240.GD7995@linaro.org> <20160906002958.GB16712@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160906002958.GB16712@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161031_014210_328428_D4AB5ECA X-CRM114-Status: GOOD ( 28.83 ) 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 , Geoff Levand , kexec@lists.infradead.org, Russell King - ARM Linux , Thiago Jung Bauermann , linux-arm-kernel@lists.infradead.org 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 Simon, On Tue, Sep 06, 2016 at 09:29:59AM +0900, AKASHI Takahiro wrote: > Simon, > > What is your opinion on this issue? Pinged you several times so far. Can you please give me your comment? (attached below is the original patch.) -Takahiro AKASHI > > On Mon, Aug 01, 2016 at 01:52:40PM +0900, AKASHI Takahiro wrote: > > On Fri, Jul 29, 2016 at 06:23:56PM +0100, Russell King - ARM Linux wrote: > > > On Fri, Jul 29, 2016 at 10:12:26AM -0700, Geoff Levand wrote: > > > > On Fri, 2016-07-29 at 09:27 +0100, Russell King - ARM Linux wrote: > > > > > > > > > So, these functions are a mess and need fixing. > > > > > > > > Since this change isn't really related to arm64 support, I'll > > > > drop this patch from my series. > > > > > > Do you have a case which triggers bugs in this code? > > > > Actually, this patch was necessary when my kdump used "usable-memory" > > properties in "memory" nodes, as on ppc64, to limit the usable memory > > regions that can be used by crash dump kernel. > > Since then, I've moved to the approach of using "mem=" kernel parameter, > > then introducing a new property, "linux,usable-memory-range," under /chosen > > and now we don't need this patch any more. > > > > So, we can drop it but I still believe that it is buggy. > > Due to the discussions[1], I may want to re-enable "usable-memory" > property on arm64. In addition, I would like to add a function, > dtb_add_usable_memory_properties(), a variant of > add_usable_memory_properties(), to kexec/dt-ops.c. > So this issue is quite crucial now. > > [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2016-August/452685.html > > -Takahiro AKASHI > > > Thanks, > > -Takahiro AKASHI > > > > > -- > > > RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ > > > FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up > > > according to speedtest.net. ===8<=== From: AKASHI Takahiro The end address of "reg" attribute in device tree's memory should be inclusive. --- kexec/fs2dt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c index 79aa0f3..953f78a 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); } }