LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/3 v3] Add kdump support for the SEV enabled guest
@ 2019-04-30  7:44 Lianbo Jiang
  2019-04-30  7:44 ` [PATCH 1/3 v3] x86/kexec: Do not map the kexec area as decrypted when SEV is active Lianbo Jiang
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Lianbo Jiang @ 2019-04-30  7:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: kexec, tglx, mingo, bp, akpm, x86, hpa, dyoung, bhe,
	Thomas.Lendacky, brijesh.singh

Just like the physical machines support kdump, the virtual machines
also need kdump. When a virtual machine panic, we also need to dump
its memory for analysis.

For the SEV virtual machine, the memory is also encrypted. When SEV
is enabled, the second kernel images(kernel and initrd) are loaded
into the encrypted areas. Unlike the SME, the second kernel images
are loaded into the decrypted areas.

Because of this difference between SME and SEV, we need to properly
map the kexec memory area in order to correctly access it.

Test tools:
makedumpfile[v1.6.5]:
git://git.code.sf.net/p/makedumpfile/code
commit <d222b01e516b> ("Add support for AMD Secure Memory Encryption")
Note: This patch was merged into the devel branch.

crash-7.2.5: https://github.com/crash-utility/crash.git
commit <942d813cda35> ("Fix for the "kmem -i" option on Linux 5.0")

kexec-tools-2.0.19:
git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git
commit <942d813cda35> ("Fix for the kmem '-i' option on Linux 5.0")
http://lists.infradead.org/pipermail/kexec/2019-March/022576.html
Note: The second kernel cann't boot without this patch.

kernel:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
commit <f261c4e529da> ("Merge branch 'akpm' (patches from Andrew)")

Test steps:
[1] load the vmlinux and initrd for kdump
# kexec -p /boot/vmlinuz-5.0.0+ --initrd=/boot/initramfs-5.0.0+kdump.img --command-line="BOOT_IMAGE=(hd0,gpt2)/vmlinuz-5.0.0+ ro resume=UUID=126c5e95-fc8b-48d6-a23b-28409198a52e console=ttyS0,115200 earlyprintk=serial irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 rootflags=nofail acpi_no_memhotplug transparent_hugepage=never disable_cpu_apicid=0"

[2] trigger panic
# echo 1 > /proc/sys/kernel/sysrq
# echo c > /proc/sysrq-trigger

[3] check and parse the vmcore
# crash vmlinux /var/crash/127.0.0.1-2019-03-15-05\:03\:42/vmcore

Changes since v1:
1. Modify the patch subject prefixes.
2. Improve patch log: add parentheses at the end of the function names.
3. Fix the multiple confusing checks.
4. Add comment in the arch_kexec_post_alloc_pages().

Changes since v2:
1. Add the explanation to the commit message[Boris' suggestion].
2. Improve the patch log.

Lianbo Jiang (3):
  x86/kexec: Do not map the kexec area as decrypted when SEV is active
  x86/kexec: Set the C-bit in the identity map page table when SEV is
    active
  kdump,proc/vmcore: Enable dumping encrypted memory when SEV was active

 arch/x86/kernel/machine_kexec_64.c | 27 ++++++++++++++++++++++++++-
 fs/proc/vmcore.c                   |  6 +++---
 2 files changed, 29 insertions(+), 4 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2019-06-20 10:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-30  7:44 [PATCH 0/3 v3] Add kdump support for the SEV enabled guest Lianbo Jiang
2019-04-30  7:44 ` [PATCH 1/3 v3] x86/kexec: Do not map the kexec area as decrypted when SEV is active Lianbo Jiang
2019-06-20 10:01   ` [tip:x86/kdump] x86/kexec: Do not map " tip-bot for Lianbo Jiang
2019-04-30  7:44 ` [PATCH 2/3 v3] x86/kexec: Set the C-bit in the identity map page table " Lianbo Jiang
2019-05-15 13:30   ` Borislav Petkov
2019-05-16  1:12     ` lijiang
2019-05-16  8:15       ` Boris Petkov
2019-05-16 11:35         ` lijiang
2019-06-12  1:34         ` lijiang
2019-06-20 10:02   ` [tip:x86/kdump] " tip-bot for Lianbo Jiang
2019-04-30  7:44 ` [PATCH 3/3 v3] kdump,proc/vmcore: Enable dumping encrypted memory when SEV was active Lianbo Jiang
2019-06-20 10:03   ` [tip:x86/kdump] fs/proc/vmcore: Enable dumping of " tip-bot for Lianbo Jiang

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