@@ -283,6 +283,9 @@ static int __init __parse_crashkernel(char *cmdline,
283
283
/*
284
284
* That function is the entry point for command line parsing and should be
285
285
* called from the arch-specific code.
286
+ *
287
+ * If crashkernel=,high|low is supported on architecture, non-NULL values
288
+ * should be passed to parameters 'low_size' and 'high'.
286
289
*/
287
290
int __init parse_crashkernel (char * cmdline ,
288
291
unsigned long long system_ram ,
@@ -296,10 +299,37 @@ int __init parse_crashkernel(char *cmdline,
296
299
/* crashkernel=X[@offset] */
297
300
ret = __parse_crashkernel (cmdline , system_ram , crash_size ,
298
301
crash_base , NULL );
299
- if (!high )
300
- return ret ;
302
+ #ifdef CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION
303
+ /*
304
+ * If non-NULL 'high' passed in and no normal crashkernel
305
+ * setting detected, try parsing crashkernel=,high|low.
306
+ */
307
+ if (high && ret == - ENOENT ) {
308
+ ret = __parse_crashkernel (cmdline , 0 , crash_size ,
309
+ crash_base , suffix_tbl [SUFFIX_HIGH ]);
310
+ if (ret || !* crash_size )
311
+ return - EINVAL ;
301
312
302
- return 0 ;
313
+ /*
314
+ * crashkernel=Y,low can be specified or not, but invalid value
315
+ * is not allowed.
316
+ */
317
+ ret = __parse_crashkernel (cmdline , 0 , low_size ,
318
+ crash_base , suffix_tbl [SUFFIX_LOW ]);
319
+ if (ret == - ENOENT ) {
320
+ * low_size = DEFAULT_CRASH_KERNEL_LOW_SIZE ;
321
+ ret = 0 ;
322
+ } else if (ret ) {
323
+ return ret ;
324
+ }
325
+
326
+ * high = true;
327
+ }
328
+ #endif
329
+ if (!* crash_size )
330
+ ret = - EINVAL ;
331
+
332
+ return ret ;
303
333
}
304
334
305
335
int __init parse_crashkernel_high (char * cmdline ,
0 commit comments