Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1347568imm; Sun, 2 Sep 2018 20:05:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbW3hd3hrPsvD9lfjeOfpP2GKzgfX5GkAu5MDw6gIpJQrP+M7pFy8GZPutt1b12iICu0Wlc X-Received: by 2002:a62:7e93:: with SMTP id z141-v6mr1405702pfc.14.1535943955744; Sun, 02 Sep 2018 20:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535943955; cv=none; d=google.com; s=arc-20160816; b=wkUtYCJZTfq7Dh8zntEFisHS+DNS8WFdYd/P7VW3oD+UgbUziS9Diqtv1lY8g3NqDc QXuSTK5sOaerrxhKUn2tFwwuQCZuHGWJ4q6D1mrLD5/8x86uHGZuyiig3HFgouJcTEYJ cdYHEAaytyzb5jJtS/ps7cAbUR8SS0nbYcQ+p5qYnT9UxsyB7JCZ06IUmwVeIEipk7rd lOYGzS4otXMpzRJYezsDwU379828qMiRSdQ/vbrRbZN/zjtBQMuvFpBBIPT5d9dsfAT2 if6pq0HiMcyLEWrMbKS4I+0o+R8N9ycruck9po4yzHO7/4YLVsbZ3ckedNkC9PK09J1c lF2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=3C3jt70LqUofQ8z59p1pJry/Xn+bV1W9nbT2NmEY3ZU=; b=OFnH+sef0GqH3B98oEwCcFW6++AXdX3UOqiQV2A9TzVqMaRGp2bV/A6K5gJzKDrGvU xH2y0u9A5fKtmNC5EnETGLg4Zauy9MvYzRQ+qXMUBOX2ooTdCtHfYISanxB3mUWiwQOw VvLK7FodpXzrykvIRXDnanhjkEr//W6PlGEbFCGjQC6O0PaV4/qRZ/Zp4BW5g/RZN1+I APm5B1e4XUPlV7hKDBCpw9VxW0Gc/pt6lt1PsWZEGQcjnWZgrF6RkE6wxowFR69HRpvw h2bWgFIAhdJf5iHJw+Rzn75NTOGN0ngU8uXo4LfQYnUM9bpCn6oRFwoFZ/ph83riUn6f JIcw== 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 h7-v6si17609137pgl.441.2018.09.02.20.05.39; Sun, 02 Sep 2018 20:05:55 -0700 (PDT) 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 S1727550AbeICHD2 (ORCPT + 99 others); Mon, 3 Sep 2018 03:03:28 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48292 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725949AbeICHD2 (ORCPT ); Mon, 3 Sep 2018 03:03:28 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C7B040241C5; Mon, 3 Sep 2018 02:45:24 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-146.pek2.redhat.com [10.72.12.146]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4507F2027EA0; Mon, 3 Sep 2018 02:45:16 +0000 (UTC) Date: Mon, 3 Sep 2018 10:45:12 +0800 From: Dave Young To: Lianbo Jiang Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, ebiederm@xmission.com, joro@8bytes.org, thomas.lendacky@amd.com, kexec@lists.infradead.org, iommu@lists.linux-foundation.org, bhe@redhat.com Subject: Re: [PATCH 2/5 V6] x86/ioremap: strengthen the logic in early_memremap_pgprot_adjust() to adjust encryption mask Message-ID: <20180903024512.GA2568@dhcp-128-65.nay.redhat.com> References: <20180831081930.31561-1-lijiang@redhat.com> <20180831081930.31561-3-lijiang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180831081930.31561-3-lijiang@redhat.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 03 Sep 2018 02:45:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 03 Sep 2018 02:45:24 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dyoung@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/31/18 at 04:19pm, Lianbo Jiang wrote: > For kdump kernel, when SME is enabled, the acpi table and dmi table will need > to be remapped without the memory encryption mask. So we have to strengthen > the logic in early_memremap_pgprot_adjust(), which makes us have an opportunity > to adjust the memory encryption mask. > > Signed-off-by: Lianbo Jiang > --- > arch/x86/mm/ioremap.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c > index e01e6c695add..f9d9a39955f3 100644 > --- a/arch/x86/mm/ioremap.c > +++ b/arch/x86/mm/ioremap.c > @@ -689,8 +689,15 @@ pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr, > encrypted_prot = true; > > if (sme_active()) { > + /* > + * In kdump kernel, the acpi table and dmi table will need > + * to be remapped without the memory encryption mask. Here > + * we have to strengthen the logic to adjust the memory > + * encryption mask. Assume the acpi/dmi tables are identical for both 1st kernel and kdump kernel, I'm not sure what is the difference, why need special handling for kdump. Can you add more explanations? > + */ > if (early_memremap_is_setup_data(phys_addr, size) || > - memremap_is_efi_data(phys_addr, size)) > + memremap_is_efi_data(phys_addr, size) || > + is_kdump_kernel()) > encrypted_prot = false; > } > > -- > 2.17.1 > Thanks Dave