Messages in this thread | | | From | 黄杰 <> | Date | Mon, 25 Jul 2022 20:56:00 +0800 | Subject | Fwd: [External] Re: [PATCH 1/4] kexec: reuse crash kernel reserved memory for normal kexec |
| |
---------- Forwarded message --------- 发件人: Jason A. Donenfeld <Jason@zx2c4.com> Date: 2022年7月25日周一 20:02 Subject: [External] Re: [PATCH 1/4] kexec: reuse crash kernel reserved memory for normal kexec To: Albert Huang <huangjie.albert@bytedance.com> Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, <x86@kernel.org>, H. Peter Anvin <hpa@zytor.com>, Eric Biederman <ebiederm@xmission.com>, Masahiro Yamada <masahiroy@kernel.org>, Michal Marek <michal.lkml@markovi.net>, Nick Desaulniers <ndesaulniers@google.com>, Kirill A. Shutemov <kirill.shutemov@linux.intel.com>, Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>, Michael Roth <michael.roth@amd.com>, Nathan Chancellor <nathan@kernel.org>, Ard Biesheuvel <ardb@kernel.org>, Joerg Roedel <jroedel@suse.de>, Mark Rutland <mark.rutland@arm.com>, Peter Zijlstra <peterz@infradead.org>, Sean Christopherson <seanjc@google.com>, Kees Cook <keescook@chromium.org>, <linux-kernel@vger.kernel.org>, <kexec@lists.infradead.org>, <linux-kbuild@vger.kernel.org>
Hi Albert,
On Mon, Jul 25, 2022 at 04:38:53PM +0800, Albert Huang wrote: > The kexec userspace tool also needs to add parameter options(-r) that > support the use of reserved memory (see another patch for kexec) > > [...] > > - if (kexec_on_panic) { > + if (kexec_on_panic && kexec_on_reserved) {
Two small questions related to this:
- Why does kexec-tools need an option, or more specifically, why does userspace need to communicate about this at all? Can't the kernel just automatically use the available reserved memory in the case that's not already being used by the panic handler kernel? I'm curious about whether there are caveats that would make this occasionally undesirable, hence suggesting an option.
- I don't totally understand how this works, so I might be a bit off here, but is there any chance that this could be made to co-exist with kexec_on_panic? Can a larger region just be reserved, specifically for this, rather than piggy backing on the panic handler region?
> +static struct page *kimage_alloc_reserverd_control_pages(struct kimage *image, > + case KEXEC_TYPE_RESERVED_MEM: > + pages = kimage_alloc_reserverd_control_pages(image, order);
Nit: reserverd -> reserved
Jason
| |