[PATCH v2 4/8] crash_core: add generic function to do reservation

Baoquan He bhe at redhat.com
Fri Sep 1 03:08:55 PDT 2023


On 08/31/23 at 11:23am, Leizhen (ThunderTown) wrote:
......
> > +void __init reserve_crashkernel_generic(char *cmdline,
> > +			     unsigned long long crash_size,
> > +			     unsigned long long crash_base,
> > +			     unsigned long long crash_low_size,
> > +			     bool high)
> > +{
> > +	unsigned long long search_end = CRASH_ADDR_LOW_MAX, search_base = 0;
> > +	bool fixed_base = false;
> > +
> > +	/* User specifies base address explicitly. */
> > +	if (crash_base) {
> > +		fixed_base = true;
> > +		search_base = crash_base;
> > +		search_end = crash_base + crash_size;
> > +	}
> > +
> > +	if (high) {
> 
> It might be a little clearer to use "else if (high) {"

Makes sense, will update.

> 
> > +		search_base = CRASH_ADDR_LOW_MAX;
> > +		search_end = CRASH_ADDR_HIGH_MAX;
> > +	}
> > +
> > +retry:
> > +	crash_base = memblock_phys_alloc_range(crash_size, CRASH_ALIGN,
> > +					       search_base, search_end);
......




More information about the kexec mailing list