AmpereComputing / ampere-lts-kernel---DEPRECATED

Linux 5.4 and 5.10 Longterm kernel (LTS) with Ampere patches
20 stars 17 forks source link

[NOUPSTREAM]patch:crashkernel: support reserving crashkernel above 4G on arm64 kdump #94

Open bowen-zhou-ampere opened 3 years ago

bowen-zhou-ampere commented 3 years ago

To support arm64 primary kernel allocating enough memory for crashkernel.

Community review email: https://lkml.org/lkml/2021/1/30/53

The complete ‘crashkernel memory reservation patch’ is composed of below 11 patches (in the sequence of commit in openEuler tree): https://github.com/openeuler-mirror/kernel

(commit first)
873384fe7934a42361ec1d82eba557d337f73acb
8882ba540e3c6467671a593779018b269fcfb036
a2e0b4351d5481fcfda10957a95c078b38732e1d
8ec4a816f20e5fa30ad5359ac7bb2600c0fdaf19
8cb8686864a99cfa7962a56777535101d60f8e39
b332ab8970ed21df61544bf2a9a5274aa4adce3b
667118f8c1160b4c3ff37c8caf5bb75146c2bd7d
70e586365f75361a2885135c38c9c3788c3d956a
c8013ee6cd2b8a8dcb99dab1b5cea83c13cd0b2c
2012a3b392266935acff005312fb0a4b50deabcf
023deaec32df97569322515e2d10381046c3b71e
(commit last)

This patchset introduces a new syntax for kernel boot command line: crashkernel={size},high and crashkernel={size},low

For example on Altra this parameter can be used: crashkernel=1024M,high User can use a larger size if needed.

To verify if memory reservation for crashkernel is successful, use ‘dmesg | grep -i crash’ and ‘cat /proc/iomem | grep -i crash ’ to verify, below is a good result from /proc/iomem:

d4800000-e47fffff : Crash kernel (low)
c1fbde00000-c1ffddfffff : Crash kernel

Then follow standard crashkernel verification method to do complete validation.

adamliyi commented 3 years ago

Merged to linux-5.10.y tree:

57fff4f6225e kdump: update Documentation about crashkernel ab1d6e298504 arm64: kdump: add memory for devices by DT property linux,usable-memory-range 7821bbdf1386 x86, arm64: Add ARCH_WANT_RESERVE_CRASH_KERNEL config b2da6ad29413 arm64: kdump: reimplement crashkernel=X dd1d12dabbb1 arm64: kdump: introduce some macroes for crash kernel reservation 52daf855ce0a x86/elf: Move vmcore_elf_check_arch_cross to arch/x86/include/asm/elf.h 364cdc25f77d x86: kdump: move reserve_crashkernel[_low]() into crash_core.c 3011146bb8c8 x86: kdump: move xen_pv_domain() check and insert_resource() to setup_arch() 8b0f3f64fc61 x86: kdump: use macro CRASH_ADDR_LOW_MAX in functions reserve_crashkernel() 2ebcc6f110a1 x86: kdump: make the lower bound of crash kernel reservation consistent 36e0d48e6a8d x86: kdump: replace the hard-coded alignment with macro CRASH_ALIGN

adamliyi commented 3 years ago

Unit test steps:

  1. Add kernel command line option: "crashkernel=1024M,high crashkernel=16M,low"
  2. After kernel boot:
    #cat /proc/iomem | grep -i crash
    bec00000-bfbfffff : Crash kernel (low)  <--------- The address can be different
    403fbbe00000-403ffbdfffff : Crash kernel  <--------- The address can be different