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: 80139 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp5204qge; Mon, 31 Oct 2016 01:43:41 -0700 (PDT) X-Received: by 10.98.64.195 with SMTP id f64mr24990757pfd.16.1477903420945; Mon, 31 Oct 2016 01:43:40 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id x17si23353264pgi.142.2016.10.31.01.43.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Oct 2016 01:43:40 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org; 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; dmarc=fail (p=NONE dis=NONE) header.from=linaro.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 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-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c00:0:0:0:235 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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+patch=linaro.org@lists.infradead.org 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. -- 2.10.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ===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); } }