linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Lianbo Jiang <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: dyoung@redhat.com, linux-kernel@vger.kernel.org,
	mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de,
	thomas.lendacky@amd.com, bhe@redhat.com, mingo@redhat.com,
	bp@suse.de, x86@kernel.org, akpm@linux-foundation.org,
	lijiang@redhat.com
Subject: [tip:x86/kdump] x86/kdump: Export the SME mask to vmcoreinfo
Date: Fri, 11 Jan 2019 07:15:59 -0800	[thread overview]
Message-ID: <tip-65f750e5457aef9a8085a99d613fea0430303e93@git.kernel.org> (raw)
In-Reply-To: <20190110121944.6050-3-lijiang@redhat.com>

Commit-ID:  65f750e5457aef9a8085a99d613fea0430303e93
Gitweb:     https://git.kernel.org/tip/65f750e5457aef9a8085a99d613fea0430303e93
Author:     Lianbo Jiang <lijiang@redhat.com>
AuthorDate: Thu, 10 Jan 2019 20:19:44 +0800
Committer:  Borislav Petkov <bp@suse.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@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: anderson@redhat.com
Cc: k-hagio@ab.jp.nec.com
Cc: kexec@lists.infradead.org
Cc: linux-doc@vger.kernel.org
Cc: x86-ml <x86@kernel.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 */

      reply	other threads:[~2019-01-11 15:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10 12:19 [PATCH 0/2 v6] kdump,vmcoreinfo: Export the value of sme mask to vmcoreinfo Lianbo Jiang
2019-01-10 12:19 ` [PATCH 1/2 v6] kdump: add the vmcoreinfo documentation Lianbo Jiang
2019-01-11 12:33   ` Borislav Petkov
2019-01-14  1:52     ` lijiang
2019-01-14  9:10       ` Borislav Petkov
2019-01-14 17:48     ` Kazuhito Hagio
2019-01-14 18:01       ` Borislav Petkov
2019-01-14 18:58         ` Dave Anderson
2019-01-14 19:21           ` Borislav Petkov
2019-01-14 19:36             ` Dave Anderson
2019-01-14 19:59               ` Borislav Petkov
2019-01-14 20:07                 ` Dave Anderson
2019-01-14 20:18                   ` Borislav Petkov
2019-01-14 20:26                     ` Dave Anderson
2019-01-14 20:35                       ` Borislav Petkov
2019-01-14 20:49                         ` Dave Anderson
2019-01-15 10:06                           ` Borislav Petkov
2019-01-15 11:00                           ` lijiang
2019-01-11 14:56   ` Borislav Petkov
2019-01-14  5:30     ` lijiang
2019-01-14  9:15       ` Borislav Petkov
2019-01-15  9:41         ` lijiang
2019-01-15 10:09   ` [tip:x86/kdump] kdump: Document kernel data exported in the vmcoreinfo note tip-bot for Lianbo Jiang
2019-01-10 12:19 ` [PATCH 2/2 v6] kdump,vmcoreinfo: Export the value of sme mask to vmcoreinfo Lianbo Jiang
2019-01-11 15:15   ` tip-bot for Lianbo Jiang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-65f750e5457aef9a8085a99d613fea0430303e93@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=bp@suse.de \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=lijiang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).