public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: bauerman@linux.vnet.ibm.com (Thiago Jung Bauermann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v1 1/4] kexec: (bugfix) calc correct end address of memory ranges in device tree
Date: Thu, 28 Jul 2016 20:54:55 -0300	[thread overview]
Message-ID: <1860371.lT9GInp2C3@hactar> (raw)
In-Reply-To: <20160727232331.GY1041@n2100.armlinux.org.uk>

Am Donnerstag, 28 Juli 2016, 00:23:31 schrieb Russell King - ARM Linux:
> On Wed, Jul 27, 2016 at 07:45:13PM -0300, Thiago Jung Bauermann wrote:
> > Hello,
> > 
> > Am Dienstag, 19 Juli 2016, 23:28:13 schrieb Geoff Levand:
> > > From: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > > 
> > > The end address of "reg" attribute in device tree's memory should be
> > > inclusive.
> > 
> > Actually, there's a bug/inconsistency in kexec-tools right now.
> > 
> > crashdump-arm.c expect usablemem_rgns.ranges[i].end to be the last byte
> > in the range, but crashdump-powerpc.c, crashdump-ppc64.c and fs2dt.c
> > expect it to be the first byte after the range.
> 
> Well, ARM (and the generic code I introduced for mem_ranges) follows
> what i386, ia64, mips, s390, and sh all do with struct memory_range
> when used for crashdump.
> 
> It is extremely bad for a project to have a single structure used
> inconsistently like this - even with generic helpers, you can't be
> sure that the right helpers are used on the right structures, and
> it will lead to off-by-one errors all over the place.  Just don't
> pull crap like this, it's asking for trouble - settle on one way
> and stick to it.

Agreed. Personally, I prefer base address and size because it's unambiguous. 
But as long as just one convention is used and the structure and helpers 
make it clear which one they expect, it doesn't matter that much.

> Given that the majority of architectures treat .end as inclusive, I
> think ppc* and fs2dt need to conform to the convention establised by
> the other architectures for this structure.

So do valid_memory_range and find_memory_range in kexec/kexec.c, which 
assume struct memory_range is end-exclusive too. I'm not sure about 
locate_hole, it seems to assume end-inclusive but it does have a line saying 
"size = end - start".

-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center

  reply	other threads:[~2016-07-28 23:54 UTC|newest]

Thread overview: 45+ 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 ` [PATCH v1 3/4] arm64: Add arm64 kexec support Geoff Levand
2016-07-20 15:39   ` Mark Rutland
2016-07-20 19:19     ` Geoff Levand
2016-07-21 10:31       ` Mark Rutland
2016-07-21 10:50         ` Robin Murphy
2016-07-21 21:49           ` Geoff Levand
2016-07-22  4:08             ` Pratyush Anand
2016-07-22  5:33               ` AKASHI Takahiro
2016-07-22  9:54               ` Mark Rutland
2016-07-22 10:03               ` Robin Murphy
2016-07-22 13:56                 ` Pratyush Anand
2016-07-22 17:59                   ` Robin Murphy
2016-07-25 21:56                 ` Geoff Levand
2016-07-20 17:53   ` Pratyush Anand
2016-07-20 20:33     ` Geoff Levand
2016-07-20 20:54   ` [PATCH v1.2 " Geoff Levand
2016-07-22  7:12     ` AKASHI Takahiro
2016-07-26  0:37       ` Geoff Levand
2016-07-25 14:28     ` Ruslan Bilovol
2016-07-25 20:50       ` Geoff Levand
2016-07-26  1:36         ` Ruslan Bilovol
2016-07-26  8:16           ` AKASHI Takahiro
2016-07-26 21:26             ` Ruslan Bilovol
2016-07-26 21:54               ` 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 ` [PATCH v1 1/4] kexec: (bugfix) calc correct end address of memory ranges in device tree Geoff Levand
2016-07-27 22:45   ` Thiago Jung Bauermann
2016-07-27 23:23     ` Russell King - ARM Linux
2016-07-28 23:54       ` Thiago Jung Bauermann [this message]
2016-07-29  8:27         ` Russell King - ARM Linux
2016-07-29 17:12           ` Geoff Levand
2016-07-29 17:23             ` Russell King - ARM Linux
2016-08-01  4:52               ` AKASHI Takahiro
2016-09-06  0:29                 ` Memory range end be inclusive or exclusive? " AKASHI Takahiro
2016-10-31  8:50                   ` AKASHI Takahiro
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-22  7:19   ` AKASHI Takahiro
2016-07-27 18:11     ` Geoff Levand
2016-07-20  4:30 ` [PATCH v1 0/4] arm64 kexec-tools patches AKASHI Takahiro
2016-07-26 23:05 ` Simon Horman
2016-07-27  5:57   ` AKASHI Takahiro
2016-07-28 18:09   ` Geoff Levand
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=1860371.lT9GInp2C3@hactar \
    --to=bauerman@linux.vnet.ibm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox