From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH v8 02/10] iommu/vt-d: Items required for kdump Date: Mon, 12 Jan 2015 17:48:03 +0100 Message-ID: <20150112164803.GG6343@8bytes.org> References: <1421046388-27925-1-git-send-email-zhen-hual@hp.com> <1421046388-27925-3-git-send-email-zhen-hual@hp.com> <20150112152207.GC6343@8bytes.org> <20150112152919.GA16162@redhat.com> <20150112160646.GF6343@8bytes.org> <20150112161538.GB16162@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20150112161538.GB16162-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Vivek Goyal Cc: bhe-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, tom.vaden-VXdhtT5mjnY@public.gmane.org, rwright-VXdhtT5mjnY@public.gmane.org, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lisa.mitchell-VXdhtT5mjnY@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, "Li, Zhen-Hua" , doug.hatch-VXdhtT5mjnY@public.gmane.org, ishii.hironobu-+CUm20s59erQFUHtdCDX3A@public.gmane.org, linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, billsumnerlinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, li.zhang6-VXdhtT5mjnY@public.gmane.org, dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org List-Id: iommu@lists.linux-foundation.org On Mon, Jan 12, 2015 at 11:15:38AM -0500, Vivek Goyal wrote: > On Mon, Jan 12, 2015 at 05:06:46PM +0100, Joerg Roedel wrote: > > On Mon, Jan 12, 2015 at 10:29:19AM -0500, Vivek Goyal wrote: > > > Kdump has the notion of backup region. Where certain parts of old kernels > > > memory can be moved to a different location (first 640K on x86 as of now) > > > and new kernel can make use of this memory now. > > > > > > So we will have to just make sure that no parts of this old page table > > > fall into backup region. > > > > Uuh, looks like the 'iommu-with-kdump-issue' isn't complicated enough > > yet ;) > > Sadly, your above statement is true for all hardware-accessible data > > structures in IOMMU code. I think about how we can solve this, is there > > an easy way to allocate memory that is not in any backup region? > > Hmm..., there does not seem to be any easy way to do this. In fact, as of > now, kernel does not even know where is backup region. All these details are > managed by user space completely (except for new kexec_file_load() syscall). > > That means we are left with ugly options now. > > - Define per arch kexec backup regions in kernel and export it to user > space and let kexec-tools make use of that deinition (instead of > defining its own). That way memory allocation code in kernel can look > at this backup area and skip it for certain allocations. Yes, that makes sense. In fact, I think all allocations for DMA memory need to take this into account to avoid potentially serious data corruption. If any memory for a disk superblock gets allocated in backup memory and a kdump happens, the new kernel might zero out that area and the disk controler then writes the zeroes to disk instead of the superblock. Joerg