[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-65f750e5457aef9a8085a99d613fea0430303e93@git.kernel.org>
Date: Fri, 11 Jan 2019 07:15:59 -0800
From: tip-bot for Lianbo Jiang <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: dyoung@...hat.com, linux-kernel@...r.kernel.org, mingo@...nel.org,
hpa@...or.com, tglx@...utronix.de, thomas.lendacky@....com,
bhe@...hat.com, mingo@...hat.com, bp@...e.de, x86@...nel.org,
akpm@...ux-foundation.org, lijiang@...hat.com
Subject: [tip:x86/kdump] x86/kdump: Export the SME mask to vmcoreinfo
Commit-ID: 65f750e5457aef9a8085a99d613fea0430303e93
Gitweb: https://git.kernel.org/tip/65f750e5457aef9a8085a99d613fea0430303e93
Author: Lianbo Jiang <lijiang@...hat.com>
AuthorDate: Thu, 10 Jan 2019 20:19:44 +0800
Committer: Borislav Petkov <bp@...e.de>
CommitDate: Fri, 11 Jan 2019 16:09:25 +0100
x86/kdump: Export the SME mask to vmcoreinfo
On AMD SME machines, makedumpfile tools need to know whether the crashed
kernel was encrypted.
If SME is enabled in the first kernel, the crashed kernel's page table
entries (pgd/pud/pmd/pte) contain the memory encryption mask which
makedumpfile needs to remove in order to obtain the true physical
address.
Export that mask in a vmcoreinfo variable.
[ bp: Massage commit message and move define at the end of the
function. ]
Signed-off-by: Lianbo Jiang <lijiang@...hat.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Baoquan He <bhe@...hat.com>
Cc: Dave Young <dyoung@...hat.com>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Tom Lendacky <thomas.lendacky@....com>
Cc: anderson@...hat.com
Cc: k-hagio@...jp.nec.com
Cc: kexec@...ts.infradead.org
Cc: linux-doc@...r.kernel.org
Cc: x86-ml <x86@...nel.org>
Link: https://lkml.kernel.org/r/20190110121944.6050-3-lijiang@redhat.com
---
arch/x86/kernel/machine_kexec_64.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 4c8acdfdc5a7..ceba408ea982 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -352,6 +352,8 @@ void machine_kexec(struct kimage *image)
void arch_crash_save_vmcoreinfo(void)
{
+ u64 sme_mask = sme_me_mask;
+
VMCOREINFO_NUMBER(phys_base);
VMCOREINFO_SYMBOL(init_top_pgt);
vmcoreinfo_append_str("NUMBER(pgtable_l5_enabled)=%d\n",
@@ -364,6 +366,7 @@ void arch_crash_save_vmcoreinfo(void)
vmcoreinfo_append_str("KERNELOFFSET=%lx\n",
kaslr_offset());
VMCOREINFO_NUMBER(KERNEL_IMAGE_SIZE);
+ VMCOREINFO_NUMBER(sme_mask);
}
/* arch-dependent functionality related to kexec file-based syscall */
Powered by blists - more mailing lists