linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] x86/kdump: Reserve extra memory when SME or SEV is active
@ 2019-09-10 15:13 Kairui Song
  2019-09-10 15:13 ` [PATCH v3 1/2] x86/kdump: Split some code out of reserve_crashkernel Kairui Song
  2019-09-10 15:13 ` [PATCH v3 2/2] x86/kdump: Reserve extra memory when SME or SEV is active Kairui Song
  0 siblings, 2 replies; 14+ messages in thread
From: Kairui Song @ 2019-09-10 15:13 UTC (permalink / raw)
  To: linux-kernel
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Thomas Lendacky,
	Baoquan He, Lianbo Jiang, Dave Young, x86, kexec, Kairui Song

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(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-10-15 17:18 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10 15:13 [PATCH v3 0/2] x86/kdump: Reserve extra memory when SME or SEV is active Kairui Song
2019-09-10 15:13 ` [PATCH v3 1/2] x86/kdump: Split some code out of reserve_crashkernel Kairui Song
2019-09-10 15:13 ` [PATCH v3 2/2] x86/kdump: Reserve extra memory when SME or SEV is active Kairui Song
2019-09-11  5:56   ` Ingo Molnar
     [not found]     ` <CACPcB9cEE5eYWixkUvMeLVdRC5qhrru9PbjbLLxP3k1jsbRanQ@mail.gmail.com>
2019-09-18  7:55       ` [PATCH v3 0/2] " Dave Young
2019-09-18 10:17         ` Kairui Song
2019-09-25 10:36     ` [PATCH v3 2/2] " Kairui Song
2019-09-27  5:42       ` Dave Young
2019-09-27  7:52         ` Kairui Song
2019-10-12  9:24         ` Kairui Song
2019-10-14 11:05           ` Dave Young
2019-10-14 11:11             ` Dave Young
2019-10-15  2:18             ` Dave Young
2019-10-15 17:18               ` Kairui Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).