From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from g4t3425.houston.hp.com ([15.201.208.53]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YsSWK-0008AY-8f for kexec@lists.infradead.org; Wed, 13 May 2015 09:00:04 +0000 Message-ID: <55531231.6040506@hp.com> Date: Wed, 13 May 2015 16:58:25 +0800 From: "Li, ZhenHua" MIME-Version: 1.0 Subject: Re: [PATCH v11 06/10] iommu/vt-d: datatypes and functions used for kdump References: <1431337974-545-1-git-send-email-zhen-hual@hp.com> <1431337974-545-7-git-send-email-zhen-hual@hp.com> <20150513085609.GD3736@dhcp-128-28.nay.redhat.com> In-Reply-To: <20150513085609.GD3736@dhcp-128-28.nay.redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Baoquan He Cc: alex.williamson@redhat.com, indou.takao@jp.fujitsu.com, tom.vaden@hp.com, rwright@hp.com, dwmw2@infradead.org, joro@8bytes.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, lisa.mitchell@hp.com, jerry.hoemann@hp.com, iommu@lists.linux-foundation.org, "Li, ZhenHua" , ddutile@redhat.com, doug.hatch@hp.com, ishii.hironobu@jp.fujitsu.com, linux-pci@vger.kernel.org, bhelgaas@google.com, billsumnerlinux@gmail.com, li.zhang6@hp.com, dyoung@redhat.com, vgoyal@redhat.com Hi Dave, iommu->root_entry_old_virt is used to store the mapped old rta. iommu->root_entry_old_phys is used to store the physical address stored in registers. So we must not free/unmap iommu->root_entry_old_phys . Zhenhua On 05/13/2015 04:56 PM, Baoquan He wrote: >> + >> + iommu->root_entry_old_phys = q & VTD_PAGE_MASK; >> + if (!iommu->root_entry_old_phys) { >> + pr_err("Could not read old root entry address."); >> + return -1; >> + } >> + > > I didn't find where you call iounmap to free mapping of > iommu->root_entry_old_phys. Am I missing anything? > >> + iommu->root_entry_old_virt = ioremap_cache(iommu->root_entry_old_phys, >> + VTD_PAGE_SIZE); >> + if (!iommu->root_entry_old_virt) { >> + pr_err("Could not map the old root entry."); >> + return -ENOMEM; >> + } _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Li, ZhenHua" Subject: Re: [PATCH v11 06/10] iommu/vt-d: datatypes and functions used for kdump Date: Wed, 13 May 2015 16:58:25 +0800 Message-ID: <55531231.6040506@hp.com> References: <1431337974-545-1-git-send-email-zhen-hual@hp.com> <1431337974-545-7-git-send-email-zhen-hual@hp.com> <20150513085609.GD3736@dhcp-128-28.nay.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150513085609.GD3736-0VdLhd/A9PlfpSRLqpFUpR/sF2h8X+2i0E9HWUfgJXw@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: Baoquan He Cc: 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, ZhenHua" , 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, vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org List-Id: iommu@lists.linux-foundation.org Hi Dave, iommu->root_entry_old_virt is used to store the mapped old rta. iommu->root_entry_old_phys is used to store the physical address stored in registers. So we must not free/unmap iommu->root_entry_old_phys . Zhenhua On 05/13/2015 04:56 PM, Baoquan He wrote: >> + >> + iommu->root_entry_old_phys = q & VTD_PAGE_MASK; >> + if (!iommu->root_entry_old_phys) { >> + pr_err("Could not read old root entry address."); >> + return -1; >> + } >> + > > I didn't find where you call iounmap to free mapping of > iommu->root_entry_old_phys. Am I missing anything? > >> + iommu->root_entry_old_virt = ioremap_cache(iommu->root_entry_old_phys, >> + VTD_PAGE_SIZE); >> + if (!iommu->root_entry_old_virt) { >> + pr_err("Could not map the old root entry."); >> + return -ENOMEM; >> + } From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <55531231.6040506@hp.com> Date: Wed, 13 May 2015 16:58:25 +0800 From: "Li, ZhenHua" MIME-Version: 1.0 To: Baoquan He CC: dwmw2@infradead.org, indou.takao@jp.fujitsu.com, joro@8bytes.org, vgoyal@redhat.com, dyoung@redhat.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, kexec@lists.infradead.org, alex.williamson@redhat.com, ddutile@redhat.com, ishii.hironobu@jp.fujitsu.com, bhelgaas@google.com, doug.hatch@hp.com, jerry.hoemann@hp.com, tom.vaden@hp.com, li.zhang6@hp.com, lisa.mitchell@hp.com, billsumnerlinux@gmail.com, rwright@hp.com, "Li, ZhenHua" Subject: Re: [PATCH v11 06/10] iommu/vt-d: datatypes and functions used for kdump References: <1431337974-545-1-git-send-email-zhen-hual@hp.com> <1431337974-545-7-git-send-email-zhen-hual@hp.com> <20150513085609.GD3736@dhcp-128-28.nay.redhat.com> In-Reply-To: <20150513085609.GD3736@dhcp-128-28.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: Hi Dave, iommu->root_entry_old_virt is used to store the mapped old rta. iommu->root_entry_old_phys is used to store the physical address stored in registers. So we must not free/unmap iommu->root_entry_old_phys . Zhenhua On 05/13/2015 04:56 PM, Baoquan He wrote: >> + >> + iommu->root_entry_old_phys = q & VTD_PAGE_MASK; >> + if (!iommu->root_entry_old_phys) { >> + pr_err("Could not read old root entry address."); >> + return -1; >> + } >> + > > I didn't find where you call iounmap to free mapping of > iommu->root_entry_old_phys. Am I missing anything? > >> + iommu->root_entry_old_virt = ioremap_cache(iommu->root_entry_old_phys, >> + VTD_PAGE_SIZE); >> + if (!iommu->root_entry_old_virt) { >> + pr_err("Could not map the old root entry."); >> + return -ENOMEM; >> + }