From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.skyhub.de ([5.9.137.197]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1faHmg-00081I-SD for kexec@lists.infradead.org; Tue, 03 Jul 2018 09:39:44 +0000 Date: Tue, 3 Jul 2018 11:39:24 +0200 From: Borislav Petkov Subject: Re: [PATCH 1/5 V5] Add a function(ioremap_encrypted) for kdump when AMD sme enabled Message-ID: <20180703093924.GA5748@zn.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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4ae1cfb5-0a4b-2aac-2575-024e2c74826f@redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: lijiang Cc: thomas.lendacky@amd.com, bhe@redhat.com, joro@8bytes.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, mingo@redhat.com, ebiederm@xmission.com, hpa@zytor.com, tglx@linutronix.de, dyoung@redhat.com On Tue, Jul 03, 2018 at 10:17:19AM +0800, lijiang wrote: > for example, the elfcorehdr. In fact, the elfcorehdr and notes You mean this? ssize_t __weak elfcorehdr_read_notes(char *buf, size_t count, u64 *ppos) { - return read_from_oldmem(buf, count, ppos, 0); + return read_from_oldmem(buf, count, ppos, 0, sme_active()); That looks encrypted to me. > call the same function(read_from_oldmem->ioremap_cache), in this case, > it is very difficult to properly remap the memory if the caller don't > care whether the memory is encrypted. So beef up the logic in __ioremap_caller() to figure out based on the address whether to access the memory encrypted or not. You can find out the elfcorehdr address in the capture kernel. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply. _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec