KExec support?

AmigaOne X1000 platform specific issues related to Linux only.
Post Reply
User avatar
Hypex
Beta Tester
Beta Tester
Posts: 909
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

KExec support?

Post by Hypex »

Hello again. :)

So one day I was looking up something Linux related and stumbled upon a useful little feature: KExec. Or kexec as they would call it.

So, I think it would be useful to have support for feature of kexec. Is it possible or do we have hardware limitation?

The X1000 boot is slow (against the X5000 and all else) so it would be great to reboot into a kernel without waiting for CFE to catch up! ;-)

This would be a boon for kernel testing. Install a few in a row. Or install the latest. Then immediately boot it! :-D

Has this kernel feature been tested before on the X1000 or X5000?
User avatar
xeno74
Posts: 10705
Joined: Fri Mar 23, 2012 7:58 am
Contact:

Re: KExec support?

Post by xeno74 »

Hypex wrote: Sat Dec 28, 2024 3:11 pm This would be a boon for kernel testing. Install a few in a row. Or install the latest. Then immediately boot it! :-D

Has this kernel feature been tested before on the X1000 or X5000?
No, I haven't tested it yet but it is interesting.
User avatar
sailorMH
Posts: 272
Joined: Wed Aug 28, 2013 7:01 pm
Location: Czech republic

Re: KExec support?

Post by sailorMH »

It looks interesting, kexec-tools package exists in ppc64 debian sid. I will try it.
A1200, Micro A1-C (G3/1.2 GHz), AmigaOne XE (G4/1.4 GHz), Pegasos II (G4/1.33 GHz), Sam440ep, Sam440ep-flex, Sam460LE, AmigaOne X1000
Efika 5200b, Pegasos I, Powerbook, Mac Mini (1.83 GHz), iMac, Powermac Quad

AmigaOS, MorphOS, linux, MacOS X
User avatar
Hypex
Beta Tester
Beta Tester
Posts: 909
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

Re: KExec support?

Post by Hypex »

sailorMH wrote: Fri Jan 03, 2025 8:10 am It looks interesting, kexec-tools package exists in ppc64 debian sid. I will try it.
I wound have tried to install it myself but I didn't see it enabled in the kernel config so didn't think it would work. Not sure if I tried anyway. Should probably install Debian again since it remains popular on ppc.
User avatar
xeno74
Posts: 10705
Joined: Fri Mar 23, 2012 7:58 am
Contact:

Re: KExec support?

Post by xeno74 »

Hypex wrote: Fri Jan 03, 2025 2:26 pm I wound have tried to install it myself but I didn't see it enabled in the kernel config so didn't think it would work. Not sure if I tried anyway. Should probably install Debian again since it remains popular on ppc.
I will add the KExec support.

Code: Select all

CONFIG_KEXEC_CORE=y
CONFIG_KEXEC=y
User avatar
xeno74
Posts: 10705
Joined: Fri Mar 23, 2012 7:58 am
Contact:

Re: KExec support?

Post by xeno74 »

I tested it today. Further information and downloads: github.com
User avatar
Hypex
Beta Tester
Beta Tester
Posts: 909
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

Re: KExec support?

Post by Hypex »

xeno74 wrote: Fri Jan 03, 2025 4:37 pm I tested it today. Further information and downloads: github.com
Wow great! Thanks for your efforts. Hopefully I can test it out soon. :D
User avatar
Hypex
Beta Tester
Beta Tester
Posts: 909
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

Re: KExec support?

Post by Hypex »

So I tested it myself and can confirm the memory error:

Code: Select all

/proc/device-tree/chosen/linux,kernel-end: No such file or directory
For ppc32 it's in this line which looks optional depending on a crash kernel:
https://github.com/mjg59/kexec-tools/bl ... ppc.c#L425

For ppc64:
https://github.com/mjg59/kexec-tools/bl ... c64.c#L354

What I don't understand is, that kexec is a lowlevel tool, so why is it looking in public DTB variables and not using private kernel API?

It also looks like an old issue we are caught up on:
https://lore.kernel.org/all/alpine.LRH. ... ytel.be/T/

I was looking through some lists and found a comment about 'linux,kernel-end' being removed from kernel start up but now I can't find the reference! So I wonder if there are many ppc64 people using kexec feature? Or pp64el these days? If kexec needs it then why is it removed? Is kexec code obsolete and needs updating to find it elsewhere?

In the meantime, aside from patching it back into the code near by prom_init, a work around could be to set it manually. Such as from CFE using setenv with linux,kernel-end. Just need to know the kernel top from ELF info listed on load. Or, from Linux itself, which is easy to see without a ramdisk.
User avatar
Hypex
Beta Tester
Beta Tester
Posts: 909
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

Re: KExec support?

Post by Hypex »

Another thread:
https://linuxppc-dev.ozlabs.narkive.com ... -directory#

These are old issues. I searched here:
https://github.com/torvalds/linux

I got one result for "linux,kernel-end" so it's in there. Why is it missing? What am I missing? :?:
https://github.com/torvalds/linux/blob/ ... ore.c#L165
Post Reply