Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751767AbdG1GwL (ORCPT ); Fri, 28 Jul 2017 02:52:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29591 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751751AbdG1GwK (ORCPT ); Fri, 28 Jul 2017 02:52:10 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E0D875FB26 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=bhe@redhat.com Date: Fri, 28 Jul 2017 14:52:02 +0800 From: Baoquan He To: Joerg Roedel Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 06/13] iommu/amd: copy old trans table from old kernel Message-ID: <20170728065202.GJ24304@x1> References: <1500627551-12930-1-git-send-email-bhe@redhat.com> <1500627551-12930-7-git-send-email-bhe@redhat.com> <20170727153825.GM3610@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170727153825.GM3610@suse.de> User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 28 Jul 2017 06:52:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 730 Lines: 24 On 07/27/17 at 05:38pm, Joerg Roedel wrote: > On Fri, Jul 21, 2017 at 04:59:04PM +0800, Baoquan He wrote: > > @@ -2128,9 +2131,43 @@ static void early_enable_iommu(struct amd_iommu *iommu) > > static void early_enable_iommus(void) > > { > > struct amd_iommu *iommu; > > + bool is_pre_enabled = false; > > > > - for_each_iommu(iommu) > > - early_enable_iommu(iommu); > > + for_each_iommu(iommu) { > > + if (translation_pre_enabled(iommu)) { > > + is_pre_enabled = true; > > + break; > > + } > > + } > > is_pre_enabled should only be true when _all_ iommus are pre-enabled. If > only one is found disabled just disable the others and continue without > copying the device table. OK, will change as you suggested. >