From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754200AbdEQMqi (ORCPT ); Wed, 17 May 2017 08:46:38 -0400 Received: from 8bytes.org ([81.169.241.247]:59582 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753849AbdEQMqd (ORCPT ); Wed, 17 May 2017 08:46:33 -0400 Date: Wed, 17 May 2017 14:46:30 +0200 From: Joerg Roedel To: KarimAllah Ahmed Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, David Woodhouse , David Woodhouse , Anthony Liguori Subject: Re: [PATCH] iommu: intel: Flush the IOTLB to get rid of the initial kdump mappings 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-Disposition: inline In-Reply-To: <1494009599-20962-1-git-send-email-karahmed@amazon.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.