Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp493503imu; Wed, 19 Dec 2018 23:57:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vk7A9S0or19hg6qR3UgIeVmQErTFMRq5IpG83WdrbcBeLDlY7nxCqcTP+DhxRWo8FIoEZH X-Received: by 2002:a17:902:c85:: with SMTP id 5mr23618502plt.339.1545292632023; Wed, 19 Dec 2018 23:57:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545292632; cv=none; d=google.com; s=arc-20160816; b=p4B+jlY5tgBrW9Laa8qnyWfadUiS50cs/kuIQvh8wN31+UJt7TsFal7zboYXjFDOlh wyGOePHjSB/ZwsBIYbgRBHmtorDFQjElTRvaKkPVlHJcZl06WVbvdKFx4F22J5Rv9hwo CaFGy+d8sIYYMkxt+v7rF4UVrMxYKakQ5tTAeoxp+KmVv0fap2UwycwfrJ4NgiHjn/7T y3vnkLoFPxI1T1DBfjpG548tzpsR5aCwLztyz1jKdwzRYDAktiD0/qAMVPxpjRmsIdaw PtPH02bF4yFuQkg8HzpjnIUsJEajOtTftM/O2J6Ox+zYX6j4D/XLC7oMbb1wqzcEL3vj 8jWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=esdtdIRBzRn6wCL0VVm0kbM/DLIAXRm9f417RznUbqk=; b=SkMVfrLnkFZw7eHsF61f+5x53LqYdJ58S5jBnuCQUJpcsOkLvBqWP+JSgMHw2O8nQQ itXqOIFtr2PGPLICrFfcE70SmT9jYG5MLhwGZQa101T86G7hOnEsxZNq39qAeJEoGSNd sdhsZMsJEOHJqhLPmFfx5s4u0xzwHkb631wYLleq0CeglCHYJKsFTq8ci0Qg/53k9qKT SEZapzbNCxe51kUaJf/jjRr0XmpC8Vw8FTPpejabFqMUJmHvYss1O5HCR9qmASK2fAPJ h/rk9NrpdWzWKiBqCXjpogkU+km9odTWMPGsFaQW/gnSe/ffdGyj/LIf7QqdmsyZ1TIj bmhw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 189si6110586pfd.142.2018.12.19.23.56.43; Wed, 19 Dec 2018 23:57:11 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730371AbeLTFlK (ORCPT + 99 others); Thu, 20 Dec 2018 00:41:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35330 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727652AbeLTFlH (ORCPT ); Thu, 20 Dec 2018 00:41:07 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 87035356E5; Thu, 20 Dec 2018 05:41:07 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-12-51.pek2.redhat.com [10.72.12.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B3DB19745; Thu, 20 Dec 2018 05:41:01 +0000 (UTC) From: Lianbo Jiang To: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, akpm@linux-foundation.org, bhe@redhat.com, dyoung@redhat.com, linux-doc@vger.kernel.org Subject: [PATCH 2/2 v4] kdump,vmcoreinfo: Export the value of sme mask to vmcoreinfo Date: Thu, 20 Dec 2018 13:40:44 +0800 Message-Id: <20181220054044.30738-3-lijiang@redhat.com> In-Reply-To: <20181220054044.30738-1-lijiang@redhat.com> References: <20181220054044.30738-1-lijiang@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 20 Dec 2018 05:41:07 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For AMD machine with SME feature, makedumpfile tools need to know whether the crash kernel was encrypted or not. If SME is enabled in the first kernel, the crash kernel's page table(pgd/pud/pmd/pte) contains the memory encryption mask, so need to remove the sme mask to obtain the true physical address. Signed-off-by: Lianbo Jiang --- 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..bc4108096b18 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c @@ -352,10 +352,13 @@ 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", pgtable_l5_enabled()); + VMCOREINFO_NUMBER(sme_mask); #ifdef CONFIG_NUMA VMCOREINFO_SYMBOL(node_data); -- 2.17.1