Skip to content

x86/kdump: Reserve extra memory when SME or SEV is active

Kairui Song kexec lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 11 repliesIn review
  2. v21 patch 6 repliesSuperseded
  3. v11 patch 2 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2x86/kdump: Split some code out of reserve_crashkernelarch/x86/kernel/setup.c+60 -320 replies
2/2x86/kdump: Reserve extra memory when SME or SEV is activearch/x86/kernel/setup.c+17 -311 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] x86/kdump: Reserve extra memory when SME or SEV is active

This series let kernel reserve extra memory for kdump when SME or SEV is active.

When SME or SEV is active, SWIOTLB will be always be force enabled, and this is also true for kdump kernel. As a result kdump kernel will run out of already scarce pre-reserved memory easily.

So when SME/SEV is active, reserve extra memory for SWIOTLB to ensure kdump kernel have enough memory, except when "crashkernel=size[KMG],high" is specified or any offset is used. With high reservation an extra low memory region will always be reserved and that is enough for SWIOTLB. With offset format, user should be fully aware of any possible kdump kernel memory requirement and have to organize the memory usage carefully.

Patch 1/2 simply split some code out of the reserve_crashkernel, prepare for the change of next patch.

Patch 2/2 will let crashkernel reserve extra memory when SME or SEV is active, and explains more details and history about why this change is introduced.

Update from V2:
- Refactor and split some function out of reserve_crashkernel to make it cleaner, as suggested by Borislav Petkov
- Split into 2 patches

Update from V1:
- Use mem_encrypt_active() instead of "sme_active() || sev_active()"
- Don't reserve extra memory when ",high" or "@offset" is used, and don't print redundant message.
- Fix coding style problem

Kairui Song (2):
x86/kdump: Split some code out of reserve_crashkernel x86/kdump: Reserve extra memory when SME or SEV is active

 arch/x86/kernel/setup.c | 106 ++++++++++++++++++++++++++++------------
 1 file changed, 74 insertions(+), 32 deletions(-)
Signature · 1 line
2.21.0