Re: [PATCH v4 1/2] kernel/crash_core: separate the parsing routines to lib/parse_crashkernel.c

From: Borislav Petkov
Date: Tue Apr 16 2019 - 15:01:52 EST


On Mon, Apr 08, 2019 at 01:58:34PM +0800, Pingfan Liu wrote:
> Beside kernel, at early boot stage, the KASLR code also needs to parse the
> crashkernel=x@y or crashkernel=ramsize-range:size[,...][@offset] option,
> and avoid to put randomized kernel in the region.
>
> Extracting the parsing related routines to lib/parse_crashkernel.c, so it
> will be handy included by other
> files.

Use this commit message for your next submission:

crash: Carve out crashkernel= cmdline parsing

Make the "crashkernel=" parsing functionality available to the early
KASLR code. Will be used by a later patch to parse crashkernel regions
which KASLR should aviod.

> Signed-off-by: Pingfan Liu <kernelfans@xxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxxxx>
> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
> Cc: Baoquan He <bhe@xxxxxxxxxx>
> Cc: Will Deacon <will.deacon@xxxxxxx>
> Cc: Nicolas Pitre <nico@xxxxxxxxxx>
> Cc: Chao Fan <fanc.fnst@xxxxxxxxxxxxxx>
> Cc: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx>
> Cc: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
> Cc: Vivek Goyal <vgoyal@xxxxxxxxxx>
> CC: Hari Bathini <hbathini@xxxxxxxxxxxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> ---
> kernel/crash_core.c | 273 ---------------------------------------------
> lib/Makefile | 2 +
> lib/parse_crashkernel.c | 289 ++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 291 insertions(+), 273 deletions(-)

And this is not how you carve out code.

First, you do a patch which does only code move. Nothing more.

In a follow on patch, you make the changes to the moved code so that it
is immediately visible what you're changing.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.