Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1026289imm; Fri, 13 Jul 2018 10:09:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpffj3+xfqz5phFHwzQJI5GzIcPsU0Smsbmewzu1sC7Dn0rSg3Cjcj35emakdKDMCNb5AYiV X-Received: by 2002:a62:9849:: with SMTP id q70-v6mr7938012pfd.178.1531501796588; Fri, 13 Jul 2018 10:09:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531501796; cv=none; d=google.com; s=arc-20160816; b=xBQm30tflMSIg47MXXK7nH2MHgLt99ADcyb8ZzwO5FystWYPwr3X1Jrhs8woeqaHuX Vha5pgXLJQjfSlGqngr26jO4Pr6xexG31zaOJ0NvHrngvq95Up0rSiP1tAIsgwtyJPtu iFMX07JvweQ8bHAhDkSgz/v86NB9dJ5umga7ZIPZIlOxhLOdL+5ULGPLXIlfN8yltKAC 8eZOdnT9dVO1G36IqKGnxsbnuaxzIxwlKNOdoG7ZLhX5pbdMP0qVE+DVJWGBKMy4Jbbx 7QyY0dv3CxjMpJNhZtc5NGrKpWRtLE3sg107jimwl9AqyR4yTdTXC8RwOR6QrXqJNSfd y15w== 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=Qq+sWqyB5u0cN+ZHyztoWHzxc4VlxIUvPqNhqP54pEw=; b=uVr+A1LDYKfmhzwkQ8S99qssli9+LGDeXU4OzhjvrtijMfFdvO7I7c70zf+eqC6aZP p85TX0r7dOXFEQgHuxzHEF+FnrMITGSXq4HuJiZol/rwa8GkcxM91rMRD1jzCG29UNmJ y09ThIX2YFzGsPK77OmMTihmlh4AKhvdo7oCdLgvFMn8vqmKUd59a9Kwm7Tf7lQJUBdC 2YBzuMroDUIb8BI/qdKevVXhkQ5pm+tTNNdpaAL0POFU1eFaIHEgvCjOWaHwJyc7SM/I uNXsjr//fJwFVS7kooKz/NeAomPbJpIJj809k+o3hy1bUpm7PNrdT4yvyyo54gB2O3+q OhQA== 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 66-v6si22930963pge.159.2018.07.13.10.09.41; Fri, 13 Jul 2018 10:09:56 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732688AbeGMRYb (ORCPT + 99 others); Fri, 13 Jul 2018 13:24:31 -0400 Received: from mail.skyhub.de ([5.9.137.197]:35264 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729622AbeGMRYb (ORCPT ); Fri, 13 Jul 2018 13:24:31 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8ZDgmY6Kfrv0; Fri, 13 Jul 2018 19:09:00 +0200 (CEST) Received: from nazgul.tnic (unknown [78.130.197.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id BEDCD1EC0310; Fri, 13 Jul 2018 19:08:59 +0200 (CEST) Date: Fri, 13 Jul 2018 19:08:57 +0200 From: Borislav Petkov To: lijiang 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, dyoung@redhat.com, kexec@lists.infradead.org, iommu@lists.linux-foundation.org, bhe@redhat.com Subject: Re: [PATCH 1/5 V5] Add a function(ioremap_encrypted) for kdump when AMD sme enabled Message-ID: <20180713170857.GB17896@nazgul.tnic> References: <20180702072639.10110-1-lijiang@redhat.com> <20180702072639.10110-2-lijiang@redhat.com> <20180702101451.GB28730@zn.tnic> <4ae1cfb5-0a4b-2aac-2575-024e2c74826f@redhat.com> <895db996-febd-d50c-91af-4f1ef3d27bd8@redhat.com> <20180703111428.GB5748@zn.tnic> <4fbb843b-9597-a48b-8b6f-00e354b91950@redhat.com> <20180709092901.GA22182@nazgul.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2018 at 09:55:35PM +0800, lijiang wrote: > About this issue, i want to use an example to describe it. > /* drivers/iommu/amd_iommu_init.c */ > static u8 __iomem * __init iommu_map_mmio_space(u64 address, u64 end) Those addresses come from the IVHD header which is an ACPI table. So the dump kernel can find that out too. > Obviously, the iommu mmio space is not encrypted, and the device > mmio space is outside kdump kernel. We know that the old memory is > encrypted, and the old memory is also outside kdump kernel. For the > current case, e820__get_entry_type() and walk_iomem_res_desc() can't > get the desired result, so we can't also decide whether encryption > or not according to this result(rules). If we want to know whether > encryption or not by deducing the address, we will need to read the > content of memory and have a reference value for comparison, then > what's a reference value? Sometimes we don't know that. Again, if we don't know that how is the *caller* supposed to know whether the memory is encrypted or not? Because "we" == "caller" in the kdump kernel. And the more important question is, why are we dumping MMIO space of the previous kernel *at* *all*? That doesn't make any sense to me. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --