Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp995791pxf; Thu, 18 Mar 2021 17:26:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWoBIFUxfbD5LjAus7NsgAL+YJXErgLttC++sDO4/p6jQe9kSI3DiX3rRy0IHkiBa1G0SV X-Received: by 2002:a05:6402:160e:: with SMTP id f14mr6782721edv.45.1616113591618; Thu, 18 Mar 2021 17:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616113591; cv=none; d=google.com; s=arc-20160816; b=UVURqUG4KleSpRxhQFvtBiF82L3fbq8zWdGDxFQWZPCOrXHZwB+iTHekprzgrAyPiJ BT4BQ1lnQxq02DklXyYsMVxUAJhX1Op5Fon7hIhpsv5Wf6mUsYIPKkOpBGYoOeGVTct1 xK2eMjo1NBHK29CMP9amURsPlQtgiFmvDUzMCBN5okpFTpEucZijTj77MPfGoS7X1se8 Fj+Ao0dIWO5Zwg+P2D8HLco7MGC4UGz80QlylfsFhQPD2m7fS2tCj6Xs4iE0f9G0R/df dLyrnGjN1vl5n+y90SKy/9Hogm5E69l7TvuGkOkrTMOL3C5DR5eIL/ej1VggfCagPzhI xhZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:cc:ironport-sdr:ironport-sdr; bh=WEXS1xFeEwJSgb6KPeRoMua9iUtNlstmc1MjLLzFNKY=; b=xRNXYulk8C+E3lLS2XpZyeYy25lfkQJwTe6+8NaEttzk732brjCxHMW0Ot3yZKSg2F X0O/9VWOf4AO+W97oSTY8VtB2BPixQtrS3PBqk3snObJPsUMM3OlmFFWUF4tzUph2tGH D5679vAQAVV5Caq0gwRXP6wGIoW8WpLjSbwk5Ozn72j140gesURRrHWZbHcuTUhVIByR xYQZj+Yp8ZdQVS0+CbpFN9RUAea0wpNFnwCg8O/KH0jH80/iOpNG8hJjiI74sNgZxU/d /FBFblEnDeDN7P9lt2LsoOyzvOjcFwyMRvdSFdabZ3I8Jsg8XVVYZV+QvZaV1V349tce 4FpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u5si2799522ejg.130.2021.03.18.17.26.09; Thu, 18 Mar 2021 17:26:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230032AbhCSAZJ (ORCPT + 99 others); Thu, 18 Mar 2021 20:25:09 -0400 Received: from mga04.intel.com ([192.55.52.120]:21205 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233372AbhCSAYu (ORCPT ); Thu, 18 Mar 2021 20:24:50 -0400 IronPort-SDR: aKHZSF2tFhYZSLFiZdc8jxASu21WXcGRfiQQpdO5HWlM/B9t1PWLhXweJg06H8fhty4CyapaFJ izAO3PCYBnFA== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="187438966" X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="187438966" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 17:24:50 -0700 IronPort-SDR: hIfyJd7NfvDTTF3A6e+o+p8zQyLtBTT4BdwNItraxk8PSUnAQQhxJLUXsdljRCukjriW1W6az0 5x0Yw9TM75tg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="434067658" Received: from allen-box.sh.intel.com (HELO [10.239.159.128]) ([10.239.159.128]) by fmsmga004.fm.intel.com with ESMTP; 18 Mar 2021 17:24:47 -0700 Cc: baolu.lu@linux.intel.com, chenjiashang , "will@kernel.org" , "iommu@lists.linux-foundation.org" , LKML , "alex.williamson@redhat.com" , "Gonglei (Arei)" , David Woodhouse Subject: =?UTF-8?Q?Re=3a_A_problem_of_Intel_IOMMU_hardware_=ef=bc=9f?= To: "Tian, Kevin" , "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" , Nadav Amit References: <670baaf8-4ff8-4e84-4be3-030b95ab5a5e@huawei.com> <6a218e7fe42d41489d02f0b4e3ad2756@huawei.com> <98DB71EF-FF98-4509-85EC-26FF50825A58@gmail.com> <4d1c3bc0418e48b1b9d44799d65ea375@huawei.com> From: Lu Baolu Message-ID: Date: Fri, 19 Mar 2021 08:15:33 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/18/21 4:56 PM, Tian, Kevin wrote: >> From: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) >> >> >>> -----Original Message----- >>> From: Tian, Kevin [mailto:kevin.tian@intel.com] >>> Sent: Thursday, March 18, 2021 4:27 PM >>> To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) >>> ; Nadav Amit >>> Cc: chenjiashang ; David Woodhouse >>> ; iommu@lists.linux-foundation.org; LKML >>> ; alex.williamson@redhat.com; Gonglei >> (Arei) >>> ; will@kernel.org >>> Subject: RE: A problem of Intel IOMMU hardware ? >>> >>>> From: iommu On Behalf Of >>>> Longpeng (Mike, Cloud Infrastructure Service Product Dept.) >>>> >>>>> 2. Consider ensuring that the problem is not somehow related to >>>>> queued invalidations. Try to use __iommu_flush_iotlb() instead of >>> qi_flush_iotlb(). >>>>> >>>> >>>> I tried to force to use __iommu_flush_iotlb(), but maybe something >>>> wrong, the system crashed, so I prefer to lower the priority of this >> operation. >>>> >>> >>> The VT-d spec clearly says that register-based invalidation can be used only >> when >>> queued-invalidations are not enabled. Intel-IOMMU driver doesn't provide >> an >>> option to disable queued-invalidation though, when the hardware is >> capable. If you >>> really want to try, tweak the code in intel_iommu_init_qi. >>> >> >> Hi Kevin, >> >> Thanks to point out this. Do you have any ideas about this problem ? I tried >> to descript the problem much clear in my reply to Alex, hope you could have >> a look if you're interested. >> > > btw I saw you used 4.18 kernel in this test. What about latest kernel? > > Also one way to separate sw/hw bug is to trace the low level interface (e.g., > qi_flush_iotlb) which actually sends invalidation descriptors to the IOMMU > hardware. Check the window between b) and c) and see whether the > software does the right thing as expected there. Yes. It's better if we can reproduce this with the latest kernel which has debugfs files to expose page tables and the invalidation queues etc. Best regards, baolu