Skip to contentSkip to conversation

kexec: remove memory reserve patching for powerpc device tree

PATCH In review Michael Neuling 5 participants 11 messages Sep 21, 2006 – Sep 22, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec: remove memory reserve patching for powerpc device tree

This code no longer needed with Jimi's auto reserve of device tree blob kernel patch now in 2.6.18.

This patch will break Linux if you're kexecing to a kernel which doesn't have this patch (ie. earlier than 2.6.17). Required kernel patch is this one:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d1f3f25d9c303d1ce63b42cc94c54ac0ab2e950

---
This should be save to include now 2.6.18 has been released.

 kexec/arch/ppc64/fs2dt.c           |    2 --
 kexec/arch/ppc64/kexec-elf-ppc64.c |   19 -------------------
 2 files changed, 21 deletions(-)
kexec/arch/ppc64/fs2dt.c +0 -2
Index: kexec-tools-1.101/kexec/arch/ppc64/fs2dt.c
===================================================================
@@ -445,8 +445,6 @@ int create_flatten_tree(struct kexec_inf
 	bb->version = 2;
 	bb->last_comp_version = 2;
 
-	reserve(me, bb->totalsize); /* patched later in kexec_load */
-
 	buf = (unsigned char *) malloc(bb->totalsize);
 	*bufp = buf;
 	memcpy(buf, bb, bb->off_mem_rsvmap);
kexec/arch/ppc64/kexec-elf-ppc64.c +0 -19
Index: kexec-tools-1.101/kexec/arch/ppc64/kexec-elf-ppc64.c
===================================================================
@@ -81,8 +81,6 @@ int elf_ppc64_load(int argc, char **argv
 	off_t seg_size = 0;
 	struct mem_phdr *phdr;
 	size_t size;
-	unsigned long long *rsvmap_ptr;
-	struct bootblock *bb_ptr;
 	unsigned int nr_segments, i;
 	int result, opt;
 	unsigned long my_kernel, my_dt_offset;
@@ -249,23 +247,6 @@ int elf_ppc64_load(int argc, char **argv
 				0, 0, max_addr, -1);
 	}
 
-	/* patch reserve map address for flattened device-tree
-	 * find last entry (both 0) in the reserve mem list.  Assume DT
-	 * entry is before this one
-	 */
-	bb_ptr = (struct bootblock *)(
-		(unsigned char *)info->segment[(info->nr_segments)-1].buf);
-	rsvmap_ptr = (unsigned long long *)(
-		(unsigned char *)info->segment[(info->nr_segments)-1].buf +
-		bb_ptr->off_mem_rsvmap);
-	while (*rsvmap_ptr || *(rsvmap_ptr+1))
-		rsvmap_ptr += 2;
-	rsvmap_ptr -= 2;
-	*rsvmap_ptr = (unsigned long long)(
-		info->segment[(info->nr_segments)-1].mem);
-	rsvmap_ptr++;
-	*rsvmap_ptr = (unsigned long long)bb_ptr->totalsize;
-
 	nr_segments = info->nr_segments;
 
 	/* Set kernel */
#1 lore raw
Quoted 8 lines · Michael Neuling

This code no longer needed with Jimi's auto reserve of device tree blob kernel patch now in 2.6.18.

This patch will break Linux if you're kexecing to a kernel which doesn't have this patch (ie. earlier than 2.6.17). Required kernel patch is this one:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d1f3f25d9c303d1ce63b42cc94c54ac0ab2e950

Although it'd be nice to get rid of that code, I'm not sure we want to go breaking this. This will mean RHEL5 and SLES10 users can't use upstream kexec-tools :/

cheers

Signature · 8 lines
Michael Ellerman
OzLabs, IBM Australia Development Lab

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
#2 lore raw
Quoted 10 lines · Michael Ellerman
Quoted 8 lines · Michael Neuling

This code no longer needed with Jimi's auto reserve of device tree blob kernel patch now in 2.6.18.

This patch will break Linux if you're kexecing to a kernel which doesn't have this patch (ie. earlier than 2.6.17). Required kernel patch is this one:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d1f3f25d9c303d1ce63b42cc94c54ac0ab2e950

Quoted 3 lines

Although it'd be nice to get rid of that code, I'm not sure we want to go breaking this. This will mean RHEL5 and SLES10 users can't use upstream kexec-tools :/

Surely if they are using a RHEL5 or SLES10 kernel then its reasonably to expect they are also using a RHEL5 or SLES10 supplied kexec-tool.

I guess it all comes down to backwards compatibility. And IMHO thats a hard thing to maintain with something as green as kexec.

I'm in favour of the patch, though I'm prepared to be convinced otherwise.

If the code needs to stay, perhaps this patch could be modified so that the code in question is only executed if the kernel is pre 2.6.18. Or is that just overly complex?

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/
#3 lore raw
Quoted 11 lines · Horms
Quoted 10 lines · Michael Ellerman
Quoted 8 lines · Michael Neuling

This code no longer needed with Jimi's auto reserve of device tree blob kernel patch now in 2.6.18.

This patch will break Linux if you're kexecing to a kernel which doesn't have this patch (ie. earlier than 2.6.17). Required kernel patch is this one:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d1f3f25d9c303d1ce63b42cc94c54ac0ab2e950

Quoted 7 lines
Quoted 3 lines

Although it'd be nice to get rid of that code, I'm not sure we want to go breaking this. This will mean RHEL5 and SLES10 users can't use upstream kexec-tools :/

Surely if they are using a RHEL5 or SLES10 kernel then its reasonably to expect they are also using a RHEL5 or SLES10 supplied kexec-tool.

Or Ubuntu Dapper .. Debian Stable .. FC whatever. In general they'll be using the distro tools sure, but I'd rather not force them to. I generally expect to be able to run mainline kernels without upgrading my entire distro - it should cut both ways IMHO.

Quoted 5 lines

I guess it all comes down to backwards compatibility. And IMHO thats a hard thing to maintain with something as green as kexec.

I'm in favour of the patch, though I'm prepared to be convinced otherwise.

Sure it's hard, but we can at least try. If we put this patch in we'll be breaking backward compatibility simply in order to beautify the kexec-tools code a little.

Quoted 3 lines

If the code needs to stay, perhaps this patch could be modified so that the code in question is only executed if the kernel is pre 2.6.18. Or is that just overly complex?

There's no need, it simply means the blob is reserved twice, which is pretty harmless.

I think the best option is just to add a note somewhere in the kexec sources that we can remove that code sometime in the future.

cheers

Signature · 8 lines
Michael Ellerman
OzLabs, IBM Australia Development Lab

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
#4 lore raw
Quoted 3 lines

Sure it's hard, but we can at least try. If we put this patch in we'll be breaking backward compatibility simply in order to beautify the kexec-tools code a little.

Agreed.

Quoted 2 lines

I think the best option is just to add a note somewhere in the kexec sources that we can remove that code sometime in the future.

Agreed. The code being removed is hacky, but mostly harmless.

Mikey

#5 lore raw
In reply to Michael Ellerman
Quoted 16 lines · Michael Ellerman
Quoted 15 lines · Horms
Quoted 13 lines · Michael Ellerman
Quoted 8 lines · Michael Neuling

This code no longer needed with Jimi's auto reserve of device tree blob kernel patch now in 2.6.18.

This patch will break Linux if you're kexecing to a kernel which doesn't have this patch (ie. earlier than 2.6.17). Required kernel patch is this one:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d1f3f25d9c303d1ce63b42cc94c54ac0ab2e950

Although it'd be nice to get rid of that code, I'm not sure we want to go breaking this. This will mean RHEL5 and SLES10 users can't use upstream kexec-tools :/

Quoted 9 lines
Quoted 3 lines

Surely if they are using a RHEL5 or SLES10 kernel then its reasonably to expect they are also using a RHEL5 or SLES10 supplied kexec-tool.

Or Ubuntu Dapper .. Debian Stable .. FC whatever. In general they'll be using the distro tools sure, but I'd rather not force them to. I generally expect to be able to run mainline kernels without upgrading my entire distro - it should cut both ways IMHO.

Now with distros adopting kexce-tools, I am in for maintaining the backward compatibility as far as possible. Putting a note in the code is good that down the line, get rid of this code.

-Vivek

#6 lore raw

So, like, the other day Vivek Goyal mumbled:

Quoted 4 lines

Now with distros adopting kexce-tools, I am in for maintaining the backward compatibility as far as possible. Putting a note in the code is good that down the line, get rid of this code.

Perhaps scheduling it as an entry in

Documentation/feature-removal-schedule.txt

just so people (distros) can plan around it?

jdl

#7 lore raw
Quoted 11 lines · Jon Loeliger

So, like, the other day Vivek Goyal mumbled:

Quoted 4 lines

Now with distros adopting kexce-tools, I am in for maintaining the backward compatibility as far as possible. Putting a note in the code is good that down the line, get rid of this code.

Perhaps scheduling it as an entry in

Documentation/feature-removal-schedule.txt

just so people (distros) can plan around it?

Perfect. In kexec-tools it can go in doc/feature-removal-schedule.txt.

-Vivek

#8 lore raw
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 3 lines · Jon Loeliger

So, like, the other day Vivek Goyal mumbled:

Quoted 2 lines

Now with distros adopting kexce-tools, I am in for maintaining the backwa

rd

Quoted 10 lines
Quoted 8 lines
Quoted 2 lines

compatibility as far as possible. Putting a note in the code is good that down the line, get rid of this code.

Perhaps scheduling it as an entry in

Documentation/feature-removal-schedule.txt

just so people (distros) can plan around it?

Perfect. In kexec-tools it can go in doc/feature-removal-schedule.txt.

It doesn't really need to go in the kernel source as the kernel has already changed and besides, we were adding a feature to the kernel, not removing one.

At this stage, it's just a kexec tools feature removal.

Mikey

#9 lore raw
Quoted 15 lines · Michael Neuling
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 3 lines · Jon Loeliger

So, like, the other day Vivek Goyal mumbled:

Quoted 2 lines

Now with distros adopting kexce-tools, I am in for maintaining the backwa

rd

Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

compatibility as far as possible. Putting a note in the code is good that down the line, get rid of this code.

Perhaps scheduling it as an entry in

Documentation/feature-removal-schedule.txt

just so people (distros) can plan around it?

Quoted 7 lines
Quoted 1 line

Perfect. In kexec-tools it can go in doc/feature-removal-schedule.txt.

It doesn't really need to go in the kernel source as the kernel has already changed and besides, we were adding a feature to the kernel, not removing one.

At this stage, it's just a kexec tools feature removal.

If someone wants to make a patch for kexec-tools I'm happy to put it into kexec-tools-testing. Though I am a little dubious about the possibilities of vendors taking any notice of it.

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/
#10 lore raw
In reply to Michael Neuling
Quoted 15 lines · Michael Neuling
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 3 lines · Jon Loeliger

So, like, the other day Vivek Goyal mumbled:

Quoted 2 lines

Now with distros adopting kexce-tools, I am in for maintaining the backwa

rd

Quoted 9 lines
Quoted 8 lines
Quoted 2 lines

compatibility as far as possible. Putting a note in the code is good that down the line, get rid of this code.

Perhaps scheduling it as an entry in

Documentation/feature-removal-schedule.txt

just so people (distros) can plan around it?

Quoted 8 lines
Quoted 1 line

Perfect. In kexec-tools it can go in doc/feature-removal-schedule.txt.

It doesn't really need to go in the kernel source as the kernel has already changed and besides, we were adding a feature to the kernel, not removing one.

At this stage, it's just a kexec tools feature removal.

Well, what I meant is that a similar file can go in kexec-tools/doc/ dir.

-Vivek