Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4011495ybi; Mon, 10 Jun 2019 22:51:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqy39VpSGBL8YRmVHZikxmGVKi0SD3F2M0qfqCjys1VSPWUFv3VRddtxAT9Z2S2G+FHbsy4q X-Received: by 2002:a63:9142:: with SMTP id l63mr1425842pge.185.1560232288815; Mon, 10 Jun 2019 22:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560232288; cv=none; d=google.com; s=arc-20160816; b=f0tg1MQ1ETUmZ3S0nb1hHfafWnc2Izl1RpJ2bhyjhRv0RQaFrevJ8jP+i7VfLFqdPK KYyXrNzkhf9OkQTyZHvel0igPwlKO8JudZiu1vHV+Bn/NRWnHuFh03Z23yf7FdpfHSyW kDNf8/jadTDP9WxTj4diLRbDTGzzHMMr6F+ef1ypoBjWvjWLYpPwgF5RiOOXSceEAcfL ResvUn2cdtRkhtRsHqGeGOXf6P6r9WRhMbRBapJGRVBCFX3+nP9NYcdC1J8hFD26Z4eu lGbZqABkRunsKzsVGcRn++toU1v4wK5mMpJMbi+9Rf/ockBEFV/Ed46jsPGEHim37O4J B2BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:cc; bh=DQxzmmDsMbXrFcrAH/WzV23Von5Yj47v9gil51ZuCMc=; b=02P+ROQLj+8Hmc5KsmAcoCc/eZCS7b/FzB3WQuffO6sQ3yOwcsA5HM80AWC7KregBq d5UmdUal4eWGgd9SZREX2paZmlKtDZnc1M8TU4TvX5TYWETZmW+NKrVMU5OhFHUHheNO AMyqVdXGA5EgtLryxYuZE0vH93UA09I7b9s3RH7SUVLiYPDhIQ5QmLsshHgNcHC0sd68 xYG+jhn9ql6gFEwJuTuACHf5PlpeyxOKNfCggwkH1tgTnqyhmF2uBDxKg2TG6sL+7iJG rnivSOb/8oN0RTDWBTJtMpaJWmHzTEjA+/EfSjzeSfW269LvPFPxIWfGeNaJLCfBlPFf FWpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si11274994pgp.328.2019.06.10.22.51.13; Mon, 10 Jun 2019 22:51:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403905AbfFKFuz (ORCPT + 99 others); Tue, 11 Jun 2019 01:50:55 -0400 Received: from mga06.intel.com ([134.134.136.31]:38117 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403879AbfFKFux (ORCPT ); Tue, 11 Jun 2019 01:50:53 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2019 22:50:51 -0700 X-ExtLoop1: 1 Received: from allen-box.sh.intel.com (HELO [10.239.159.136]) ([10.239.159.136]) by orsmga004.jf.intel.com with ESMTP; 10 Jun 2019 22:50:49 -0700 Cc: baolu.lu@linux.intel.com, "linux-kernel@vger.kernel.org" , "Raj, Ashok" , "cai@lca.pw" , "jacob.jun.pan@linux.intel.com" , "iommu@lists.linux-foundation.org" , "Pan, Jacob jun" , "Tian, Kevin" Subject: Re: [PATCH 5/6] iommu/vt-d: Cleanup after delegating DMA domain to generic iommu To: Sai Praneeth Prakhya , "Mehta, Sohil" , "joro@8bytes.org" , "dwmw2@infradead.org" References: <20190609023803.23832-1-baolu.lu@linux.intel.com> <20190609023803.23832-6-baolu.lu@linux.intel.com> <1560192412.27481.12.camel@intel.com> From: Lu Baolu Message-ID: Date: Tue, 11 Jun 2019 13:43:41 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 6/11/19 3:25 AM, Sai Praneeth Prakhya wrote: > On Mon, 2019-06-10 at 11:45 -0700, Mehta, Sohil wrote: >> On Sun, 2019-06-09 at 10:38 +0800, Lu Baolu wrote: >>> static int __init si_domain_init(int hw) >>> @@ -3306,14 +3252,13 @@ static int __init init_dmars(void) >>> if (pasid_supported(iommu)) >>> intel_svm_init(iommu); >>> #endif >>> - } >>> >>> - /* >>> - * Now that qi is enabled on all iommus, set the root entry >>> and flush >>> - * caches. This is required on some Intel X58 chipsets, >>> otherwise the >>> - * flush_context function will loop forever and the boot >>> hangs. >>> - */ >>> - for_each_active_iommu(iommu, drhd) { >>> + /* >>> + * Now that qi is enabled on all iommus, set the root >>> entry and >>> + * flush caches. This is required on some Intel X58 >>> chipsets, >>> + * otherwise the flush_context function will loop >>> forever and >>> + * the boot hangs. >>> + */ >>> iommu_flush_write_buffer(iommu); >>> iommu_set_root_entry(iommu); >>> iommu->flush.flush_context(iommu, 0, 0, 0, >>> DMA_CCMD_GLOBAL_INVL); >> >> This changes the intent of the original code. As the comment says >> enable QI on all IOMMUs, then flush the caches and set the root entry. >> The order of setting the root entries has changed now. >> >> Refer: >> Commit a4c34ff1c029 ('iommu/vt-d: Enable QI on all IOMMUs before >> setting root entry') > > Thanks Sohil! for catching the bug. > Will send a V2 to Lu Baolu fixing this. Okay, I will submit a v2 of this series later. > > Regards, > Sai Best regards, Baolu