Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp682479imu; Fri, 11 Jan 2019 07:18:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN7qnH8OLM7rW12pleGzaQmv952Stds3t2I9NpDTDe5LcrxHvYRg8Svb8GpVASZqt2TqNiPW X-Received: by 2002:a62:c683:: with SMTP id x3mr14683481pfk.10.1547219888103; Fri, 11 Jan 2019 07:18:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547219888; cv=none; d=google.com; s=arc-20160816; b=C/p37biPHXw49eBIXP5oaarM63PA8UySKyRhnGBzc4karE4OND1ytPlF9Jjbj2FB3M bPGxNBESJumhq5bOsbTkvcqISUgSFHgyMOQCH8OHZBlVqmkM9pdaug960zy6fE9/WY42 w5dlS5QtqGlQiRB99PwTfZ5BBk3ZR59jsnqx9K2L3jvoYZwm+itLNTGHVW63XXMvOtLv RrSY6TSUSB01MuXLBKFitKyywpbJBPs197Ktx7wJLt2yWnlCdgOD3vPXodR+AkEFD9lc hf8fn53bba1/Mp+pzAS7mbNREceOA+CymIiZ+UT/cSx5z2t7N3l8+CuNdjt9Qwg+WGZB y6tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=G0EJYyXJUa7UTGFskH+yhIJpQS0eTltD+FPV4BMhXcY=; b=eKIjHYkfrQId6ud0QOHj4NziHQZp+KVnjSiEiPCq7cVaMAlirUUp2zkJZvKYCa+VUq +5lhZ2JENW2+1AhMm3LyKrUEu4YSwZVyyAUoDSexj+j6uUY5EF03ufwBkk2pv7AxlOXh rN60xRCNBrFeR+rgMxTco5s72uT1T6RLRM+XMYs+OZLK4BbiYHkrQ8GAVJXr1XlFAaDN 7wfC1a41+M6UtidHmCPou3f7HsB1mSiCT+xZLz+DCDuXWuMJmSgEDdF8yzRspgJYos/Q D/79cWW0SHtAyJ5wRnP/tgUzJmvBMC4E9JmG4JYWeDTrUIEyGT0328uqx+RXVDIRsBQ5 UEkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h85si26640019pfd.27.2019.01.11.07.17.51; Fri, 11 Jan 2019 07:18:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733237AbfAKPQ1 (ORCPT + 99 others); Fri, 11 Jan 2019 10:16:27 -0500 Received: from terminus.zytor.com ([198.137.202.136]:53515 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731231AbfAKPQ0 (ORCPT ); Fri, 11 Jan 2019 10:16:26 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x0BFFxcC704922 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 11 Jan 2019 07:15:59 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x0BFFxlx704919; Fri, 11 Jan 2019 07:15:59 -0800 Date: Fri, 11 Jan 2019 07:15:59 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Lianbo Jiang Message-ID: 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 Reply-To: linux-kernel@vger.kernel.org, mingo@kernel.org, dyoung@redhat.com, thomas.lendacky@amd.com, bhe@redhat.com, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, akpm@linux-foundation.org, lijiang@redhat.com, bp@suse.de, x86@kernel.org In-Reply-To: <20190110121944.6050-3-lijiang@redhat.com> References: <20190110121944.6050-3-lijiang@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/kdump] x86/kdump: Export the SME mask to vmcoreinfo Git-Commit-ID: 65f750e5457aef9a8085a99d613fea0430303e93 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 65f750e5457aef9a8085a99d613fea0430303e93 Gitweb: https://git.kernel.org/tip/65f750e5457aef9a8085a99d613fea0430303e93 Author: Lianbo Jiang AuthorDate: Thu, 10 Jan 2019 20:19:44 +0800 Committer: Borislav Petkov 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 Signed-off-by: Borislav Petkov Cc: "H. Peter Anvin" Cc: Andrew Morton Cc: Baoquan He Cc: Dave Young Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Tom Lendacky 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 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 */