From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH] iommu: intel: Flush the IOTLB to get rid of the initial kdump mappings Date: Wed, 17 May 2017 14:46:30 +0200 Message-ID: <20170517124630.GC11068@8bytes.org> References: <1494009599-20962-1-git-send-email-karahmed@amazon.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1494009599-20962-1-git-send-email-karahmed-ebkRAfMGSJGzQB+pC5nmwQ@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: KarimAllah Ahmed Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, David Woodhouse , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Woodhouse , Anthony Liguori List-Id: iommu@lists.linux-foundation.org On Fri, May 05, 2017 at 11:39:59AM -0700, KarimAllah Ahmed wrote: > Ever since commit 091d42e43d ("iommu/vt-d: Copy translation tables from > old kernel") Please put the commit-information into a Fixes: tag next time. I'll added a Fixes tag to the commit this time. > the kdump kernel copies the IOMMU context tables from the > previous kernel. Each device mappings will be destroyed once the driver > for the respective device takes over. > > This unfortunately breaks the workflow of mapping and unmapping a new > context to the IOMMU. The mapping function assumes that either: > > 1) Unmapping did the proper IOMMU flushing and it only ever flush if the > IOMMU unit supports caching invalid entries. > 2) The system just booted and the initialization code took care of > flushing all IOMMU caches. > > This assumption is not true for the kdump kernel since the context > tables have been copied from the previous kernel and translations could > have been cached ever since. So make sure to flush the IOTLB as well > when we destroy these old copied mappings. > > Cc: Joerg Roedel > Cc: David Woodhouse > Cc: David Woodhouse > Cc: Anthony Liguori > Signed-off-by: KarimAllah Ahmed Applied to iommu/fixes, thanks.