Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Oct 2024 16:32:51 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Justin Hibbits <jhibbits@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org
Subject:   Re: Direct dumped kernel cores
Message-ID:  <CANCZdfrobB-ZM3aMmD%2BAsjud3%2BM-_kkMB3SqTpaKTxtmY1x3Yg@mail.gmail.com>
In-Reply-To: <20241031182354.14fa48aa@ralga.knownspace>
References:  <20241031182354.14fa48aa@ralga.knownspace>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000c2670d0625cd66ec
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Oct 31, 2024 at 4:24=E2=80=AFPM Justin Hibbits <jhibbits@freebsd.or=
g> wrote:

> Hi everyone,
>
> At Juniper we've been using a so-called 'rescue' kernel for dumping
> vmcores directly to the filesystem after a panic.  We're now
> contributing this feature, implemented by Klara Systems, to FreeBSD, and
> looking for feedback. I posted a review
> at https://reviews.freebsd.org/D47358 for anyone interested.
>
> Interesting bits to keep in mind:
> * It requires a 2-stage build process, one to build the rescue kernel,
>   the other to build the main kernel, which embeds the rescue kernel
>   inside its image.  This might need some further work.
> * Thus far it's been implemented for amd64 and arm64, once proven out,
>   other architectures (powerpc64/le, riscv64) can follow suit.
> * Kernel environment bits to pass down to the rescue kernel are
>   prefixed `debug.rescue.`, for instance
>   `debug.rescue.vfs.root.mountfrom`.
>

First off, this is kinda cool. I've wanted this occasionally when my swap
partition is too small (though in my case, it was easy enough to add anothe=
r
drive to the system that was panicking and dump to that).

I do have a question: I'm curious why you didn't follow the Linux lead of
having
a kexec_load(2) system call to load the 'rescue kernel' to make this more
generic.
That would make the leap to having full kexec support (eg reboot(CMD_KEXEC)
a lot easier to implement.

Warner


> There are many more details in the review summary.
>
> We'd love to get feedback from anyone interested.
>
> Thanks,
> Justin Hibbits
>
>

--000000000000c2670d0625cd66ec
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Oct 31, 2024 at 4:24=E2=80=AF=
PM Justin Hibbits &lt;<a href=3D"mailto:jhibbits@freebsd.org">jhibbits@free=
bsd.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
t:1ex">Hi everyone,<br>
<br>
At Juniper we&#39;ve been using a so-called &#39;rescue&#39; kernel for dum=
ping<br>
vmcores directly to the filesystem after a panic.=C2=A0 We&#39;re now<br>
contributing this feature, implemented by Klara Systems, to FreeBSD, and<br=
>
looking for feedback. I posted a review<br>
at <a href=3D"https://reviews.freebsd.org/D47358" rel=3D"noreferrer" target=
=3D"_blank">https://reviews.freebsd.org/D47358</a>; for anyone interested.<b=
r>
<br>
Interesting bits to keep in mind:<br>
* It requires a 2-stage build process, one to build the rescue kernel,<br>
=C2=A0 the other to build the main kernel, which embeds the rescue kernel<b=
r>
=C2=A0 inside its image.=C2=A0 This might need some further work.<br>
* Thus far it&#39;s been implemented for amd64 and arm64, once proven out,<=
br>
=C2=A0 other architectures (powerpc64/le, riscv64) can follow suit.<br>
* Kernel environment bits to pass down to the rescue kernel are<br>
=C2=A0 prefixed `debug.rescue.`, for instance<br>
=C2=A0 `debug.rescue.vfs.root.mountfrom`.<br></blockquote><div><br></div><d=
iv>First off, this is kinda cool. I&#39;ve wanted=C2=A0this occasionally wh=
en my swap</div><div>partition=C2=A0is too small (though in my case, it was=
 easy enough to add another</div><div>drive to the system that was panickin=
g and dump to that).</div><div><br></div><div>I do have a question: I&#39;m=
 curious why you didn&#39;t follow the Linux lead of having</div><div>a kex=
ec_load(2) system call to load the &#39;rescue kernel&#39; to make this mor=
e generic.</div><div>That would make the leap to having full kexec support =
(eg reboot(CMD_KEXEC)</div><div>a lot easier to implement.</div><div><br></=
div><div>Warner</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-left:1ex">
There are many more details in the review summary.<br>
<br>
We&#39;d love to get feedback from anyone interested.<br>
<br>
Thanks,<br>
Justin Hibbits<br>
<br>
</blockquote></div></div>

--000000000000c2670d0625cd66ec--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrobB-ZM3aMmD%2BAsjud3%2BM-_kkMB3SqTpaKTxtmY1x3Yg>