All of lore.kernel.org
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Simon Horman <horms@verge.net.au>
Cc: Pratyush Anand <panand@redhat.com>,
	Geoff Levand <geoff@infradead.org>,
	kexec@lists.infradead.org,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>,
	linux-arm-kernel@lists.infradead.org
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
Date: Mon, 31 Oct 2016 17:50:09 +0900	[thread overview]
Message-ID: <20161031085008.GF19531@linaro.org> (raw)
In-Reply-To: <20160906002958.GB16712@linaro.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.
===8<===
From: AKASHI Takahiro <takahiro.akashi@linaro.org>

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);
 		}
 	}
 
-- 
2.10.0


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

WARNING: multiple messages have this Message-ID (diff)
From: takahiro.akashi@linaro.org (AKASHI Takahiro)
To: linux-arm-kernel@lists.infradead.org
Subject: Memory range end be inclusive or exclusive? Re: [PATCH v1 1/4] kexec: (bugfix) calc correct end address of memory ranges in device tree
Date: Mon, 31 Oct 2016 17:50:09 +0900	[thread overview]
Message-ID: <20161031085008.GF19531@linaro.org> (raw)
In-Reply-To: <20160906002958.GB16712@linaro.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.
===8<===
From: AKASHI Takahiro <takahiro.akashi@linaro.org>

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);
 		}
 	}
 
-- 
2.10.0

  reply	other threads:[~2016-10-31  8:42 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 23:28 [PATCH v1 0/4] arm64 kexec-tools patches Geoff Levand
2016-07-19 23:28 ` Geoff Levand
2016-07-19 23:28 ` [PATCH v1 1/4] kexec: (bugfix) calc correct end address of memory ranges in device tree Geoff Levand
2016-07-19 23:28   ` Geoff Levand
2016-07-27 22:45   ` Thiago Jung Bauermann
2016-07-27 22:45     ` Thiago Jung Bauermann
2016-07-27 23:23     ` Russell King - ARM Linux
2016-07-27 23:23       ` Russell King - ARM Linux
2016-07-28 23:54       ` Thiago Jung Bauermann
2016-07-28 23:54         ` Thiago Jung Bauermann
2016-07-29  8:27         ` Russell King - ARM Linux
2016-07-29  8:27           ` Russell King - ARM Linux
2016-07-29 17:12           ` Geoff Levand
2016-07-29 17:12             ` Geoff Levand
2016-07-29 17:23             ` Russell King - ARM Linux
2016-07-29 17:23               ` Russell King - ARM Linux
2016-08-01  4:52               ` AKASHI Takahiro
2016-08-01  4:52                 ` AKASHI Takahiro
2016-09-06  0:29                 ` Memory range end be inclusive or exclusive? " AKASHI Takahiro
2016-09-06  0:29                   ` AKASHI Takahiro
2016-10-31  8:50                   ` AKASHI Takahiro [this message]
2016-10-31  8:50                     ` AKASHI Takahiro
2016-11-07  8:17                     ` Simon Horman
2016-11-07  8:17                       ` Simon Horman
2016-07-19 23:28 ` [PATCH v1 2/4] kexec: Add common device tree routines Geoff Levand
2016-07-19 23:28   ` Geoff Levand
2016-07-22  7:19   ` AKASHI Takahiro
2016-07-22  7:19     ` AKASHI Takahiro
2016-07-27 18:11     ` Geoff Levand
2016-07-27 18:11       ` Geoff Levand
2016-07-19 23:28 ` [PATCH v1 4/4] arm64: Add support for binary image files Geoff Levand
2016-07-19 23:28   ` Geoff Levand
2016-07-19 23:28 ` [PATCH v1 3/4] arm64: Add arm64 kexec support Geoff Levand
2016-07-19 23:28   ` Geoff Levand
2016-07-20 15:39   ` Mark Rutland
2016-07-20 15:39     ` Mark Rutland
2016-07-20 19:19     ` Geoff Levand
2016-07-20 19:19       ` Geoff Levand
2016-07-21 10:31       ` Mark Rutland
2016-07-21 10:31         ` Mark Rutland
2016-07-21 10:50         ` Robin Murphy
2016-07-21 10:50           ` Robin Murphy
2016-07-21 21:49           ` Geoff Levand
2016-07-21 21:49             ` Geoff Levand
2016-07-22  4:08             ` Pratyush Anand
2016-07-22  4:08               ` Pratyush Anand
2016-07-22  5:33               ` AKASHI Takahiro
2016-07-22  5:33                 ` AKASHI Takahiro
2016-07-22  9:54               ` Mark Rutland
2016-07-22  9:54                 ` Mark Rutland
2016-07-22 10:03               ` Robin Murphy
2016-07-22 10:03                 ` Robin Murphy
2016-07-22 13:56                 ` Pratyush Anand
2016-07-22 13:56                   ` Pratyush Anand
2016-07-22 17:59                   ` Robin Murphy
2016-07-22 17:59                     ` Robin Murphy
2016-07-25 21:56                 ` Geoff Levand
2016-07-25 21:56                   ` Geoff Levand
2016-07-20 17:53   ` Pratyush Anand
2016-07-20 17:53     ` Pratyush Anand
2016-07-20 20:33     ` Geoff Levand
2016-07-20 20:33       ` Geoff Levand
2016-07-20 20:54   ` [PATCH v1.2 " Geoff Levand
2016-07-20 20:54     ` Geoff Levand
2016-07-22  7:12     ` AKASHI Takahiro
2016-07-22  7:12       ` AKASHI Takahiro
2016-07-26  0:37       ` Geoff Levand
2016-07-26  0:37         ` Geoff Levand
2016-07-25 14:28     ` Ruslan Bilovol
2016-07-25 14:28       ` Ruslan Bilovol
2016-07-25 20:50       ` Geoff Levand
2016-07-25 20:50         ` Geoff Levand
2016-07-26  1:36         ` Ruslan Bilovol
2016-07-26  1:36           ` Ruslan Bilovol
2016-07-26  8:16           ` AKASHI Takahiro
2016-07-26  8:16             ` AKASHI Takahiro
2016-07-26 21:26             ` Ruslan Bilovol
2016-07-26 21:26               ` Ruslan Bilovol
2016-07-26 21:54               ` Geoff Levand
2016-07-26 21:54                 ` Geoff Levand
2016-07-20  4:30 ` [PATCH v1 0/4] arm64 kexec-tools patches AKASHI Takahiro
2016-07-20  4:30   ` AKASHI Takahiro
2016-07-26 23:05 ` Simon Horman
2016-07-26 23:05   ` Simon Horman
2016-07-27  5:57   ` AKASHI Takahiro
2016-07-27  5:57     ` AKASHI Takahiro
2016-07-28 18:09   ` Geoff Levand
2016-07-28 18:09     ` Geoff Levand
2016-07-29  0:31     ` Simon Horman
2016-07-29  0:31       ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161031085008.GF19531@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --cc=bauerman@linux.vnet.ibm.com \
    --cc=geoff@infradead.org \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=panand@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.