linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Jimi Xenidis <jimix@watson.ibm.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [patch][rfc]flattened device tree: Passing a dtb (blob) to Linux.
Date: Fri, 14 Apr 2006 18:19:50 +0200	[thread overview]
Message-ID: <1145031590.13366.5.camel@localhost.localdomain> (raw)
In-Reply-To: <52F25F7B-ED3C-4A72-A8C9-3631D8D83357@watson.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 2897 bytes --]

On Fri, 2006-04-14 at 08:45 -0400, Jimi Xenidis wrote:
> On Apr 13, 2006, at 7:12 PM, Benjamin Herrenschmidt wrote:
> >
> > We should make lmb_reserve() of redudant/overlapping entries become
> > harmless I think.
> 
> Hmm.. I think it would be worthy of a warning, no?

Definitely. We had weird bugs in kexec because regions were overlapping.
I just haven't got 'round to writing the patch .. maybe I should :)

> > We need to be backward compatible with earlier blobs
> > that do contain themselves in the reserve map
> 
> Do you think it is possible that the blob may have a single  
> reservation that includes the blob but is larger? if not then we  
> could simply do..

Well it's definitely possible, but I don't know if anyone actually does
it. But I guess we should try to be nice and not warn for old blobs.

This patch looks like a decent approach, although I'd want to add a
check so that if the blob is reserved _three_ times we do warn, it's
getting a bit silly isn't it :)

cheers

> --
> diff -r eb0990a251a9 arch/powerpc/kernel/prom.c
> --- a/arch/powerpc/kernel/prom.c	Thu Mar 30 22:05:40 2006 -0500
> +++ b/arch/powerpc/kernel/prom.c	Fri Apr 14 08:44:10 2006 -0400
> @@ -1129,9 +1129,17 @@ static void __init early_reserve_mem(voi
> {
> 	u64 base, size;
> 	u64 *reserve_map;
> +	unsigned long self_base;
> +	unsigned long self_size;
> 	reserve_map = (u64 *)(((unsigned long)initial_boot_params) +
> 					initial_boot_params->off_mem_rsvmap);
> +
> +	/* before we do anything, lets reserve the dt blob */
> +	self_base = __pa((unsigned long)initial_boot_params);
> +	self_size = initial_boot_params->totalsize;
> +	lmb_reserve(self_base, self_size);
> +
> #ifdef CONFIG_PPC32
> 	/*
> 	 * Handle the case where we might be booting from an old kexec
> @@ -1146,6 +1154,9 @@ static void __init early_reserve_mem(voi
> 			size_32 = *(reserve_map_32++);
> 			if (size_32 == 0)
> 				break;
> +			/* skip if the reservation is for the blob */
> +			if (base_32 == self_base && size_32 == self_size)
> +				continue;
> 			DBG("reserving: %x -> %x\n", base_32, size_32);
> 			lmb_reserve(base_32, size_32);
> 		}
> @@ -1157,6 +1168,9 @@ static void __init early_reserve_mem(voi
> 		size = *(reserve_map++);
> 		if (size == 0)
> 			break;
> +		/* skip if the reservation is for the blob */
> +		if (base == self_base && size == self_size)
> +			continue;
> 		DBG("reserving: %llx -> %llx\n", base, size);
> 		lmb_reserve(base, size);
> 	}
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

  reply	other threads:[~2006-04-14 16:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-13  2:05 [patch][rfc]flattened device tree: Passing a dtb (blob) to Linux Jimi Xenidis
2006-04-13  2:15 ` Jimi Xenidis
2006-04-13  5:36   ` Michael Neuling
2006-04-13 10:37     ` Jimi Xenidis
2006-04-13 11:07       ` Michael Ellerman
2006-04-13 13:19         ` Jimi Xenidis
2006-04-13 14:34           ` Michael Ellerman
2006-04-18 16:48             ` Jon Loeliger
2006-04-18 18:04               ` Michael Ellerman
2006-04-18 18:42                 ` Jimi Xenidis
2006-04-20 15:42                 ` Jon Loeliger
2006-04-20 20:20                   ` Mark A. Greer
2006-04-13 23:12 ` Benjamin Herrenschmidt
2006-04-14 12:45   ` Jimi Xenidis
2006-04-14 16:19     ` Michael Ellerman [this message]
2006-05-18 22:03 ` [PATCH] powerpc: Auto reserve of device tree blob Michael Neuling
2006-05-22 16:25   ` Jon Loeliger
2006-05-23 15:04     ` Jon Loeliger

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=1145031590.13366.5.camel@localhost.localdomain \
    --to=michael@ellerman.id.au \
    --cc=jimix@watson.ibm.com \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).