Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp265713imm; Wed, 12 Sep 2018 22:53:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaMH6PMn2D7IMxUeIiK28CmHun5JO4lfWH4n60DHKkshaYS8m07wV+vJg+YszCEmq+2Cps9 X-Received: by 2002:a63:4c02:: with SMTP id z2-v6mr5601022pga.312.1536818006689; Wed, 12 Sep 2018 22:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536818006; cv=none; d=google.com; s=arc-20160816; b=azWHgmVfQaJctr+s/AtIys9EF4ahLkt92dXwycOsKQ5JC97lF4zJr3i9r72yo35Zcg ZQhPIs5U27M4zV23wJoKVq+9NWdhxmZqpFDswt910vT5u8N0T2dhbH3tq9eNkWygEWes 9L2sVWCPcyJ6KbhDCHNjF3tXcpRw6ZD65tPVbtDYN14rbQuANr/RtnCvOHV1jy7J2tin DNx8UuI9M3xXDzFoHopSFL77prE7QnmQ9iUSMMPSXvZZcTC7e9p/T+wInRc/mBNIo6TU g+ZKXrevFY4z4pB3S8f1kurtshBg0EYPQMyYKSy2i60kH2qz/JKzm7EMrv0697xZEfrm tnTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=XBbv0082CJer24hpvlCvuRs/xoM5U3ZRRgVXELKz338=; b=JiHIk+TKHvyq+8cqmKXsuPVJp22TyaOWPbriU6Ih7NFi3E6s8JN4aug0OjbC2DHmY9 57WijtMXDegItYrPErugiDMAupO+d1fZ+iozlpe644Ka6/LsBRWC60U1FJuWsxp+VLEb RERcUpdu9ECmssKkdiZ6ep52p3So68qck9kSaSDoCqzB1K7Kc/3R5gpH+UDBjdswpNde zdGgw4B9Ua3VuE+C+BLk9GTwxTr2LWT/JQ3B7B+IL0AH2hPa6/Q094mkAPLBfzoFuFJn 7mnwh9vNyCZXNJOC97UIKW2YSDrGkxLX3IqyUs60yqW37+xsqc0bNX13n14ELTA5opmO a1OA== 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 d31-v6si3114241pla.479.2018.09.12.22.53.11; Wed, 12 Sep 2018 22:53:26 -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 S1726792AbeIMLAn convert rfc822-to-8bit (ORCPT + 99 others); Thu, 13 Sep 2018 07:00:43 -0400 Received: from mga02.intel.com ([134.134.136.20]:12510 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbeIMLAn (ORCPT ); Thu, 13 Sep 2018 07:00:43 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2018 22:52:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,367,1531810800"; d="scan'208";a="85570604" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 12 Sep 2018 22:52:38 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 12 Sep 2018 22:52:38 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 12 Sep 2018 22:52:37 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.205]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.16]) with mapi id 14.03.0319.002; Thu, 13 Sep 2018 13:52:33 +0800 From: "Tian, Kevin" To: "Raj, Ashok" , Lu Baolu CC: Jean-Philippe Brucker , "Kumar, Sanjay K" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "Sun, Yi Y" , "Pan, Jacob jun" , David Woodhouse Subject: RE: [PATCH v2 06/12] iommu/vt-d: Add second level page table interface Thread-Topic: [PATCH v2 06/12] iommu/vt-d: Add second level page table interface Thread-Index: AQHUQAHwDWc2LNkyDUSjEMfaICr4mqTimnUAgAEJkYCAAPprAIAJKacQ Date: Thu, 13 Sep 2018 05:52:32 +0000 Message-ID: References: <20180830013524.28743-1-baolu.lu@linux.intel.com> <20180830013524.28743-7-baolu.lu@linux.intel.com> <331eef29-ae41-2d36-9487-265d773aae5b@linux.intel.com> <20180907174328.GA95061@otc-nc-03> In-Reply-To: <20180907174328.GA95061@otc-nc-03> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGJiMGU3MjMtMjVhYS00MmVjLThhYWEtZDJlMDI4M2M2ODk2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiODVjXC9OUnRkQXBaVUYxOFdyak5TN2R3cWs0OFJ3TnBkRzhPd01Sb3pVRWtLZXoxakRPMHZoNktGOEtIT29cL3NYIn0= dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Raj, Ashok > Sent: Saturday, September 8, 2018 1:43 AM > > On Fri, Sep 07, 2018 at 10:47:11AM +0800, Lu Baolu wrote: > > > > >>+ > > >>+ intel_pasid_clear_entry(dev, pasid); > > >>+ > > >>+ if (!ecap_coherent(iommu->ecap)) { > > >>+ pte = intel_pasid_get_entry(dev, pasid); > > >>+ clflush_cache_range(pte, sizeof(*pte)); > > >>+ } > > >>+ > > >>+ pasid_based_pasid_cache_invalidation(iommu, did, pasid); > > >>+ pasid_based_iotlb_cache_invalidation(iommu, did, pasid); > > >>+ > > >>+ /* Device IOTLB doesn't need to be flushed in caching mode. */ > > >>+ if (!cap_caching_mode(iommu->cap)) > > >>+ pasid_based_dev_iotlb_cache_invalidation(iommu, dev, > > >>pasid); > > > > > >can you elaborate, or point to any spec reference? > > > > > > > In the driver, device iotlb doesn't get flushed in caching mode. I just > > follow what have been done there. > > > > It also makes sense to me since only the bare metal host needs to > > consider whether and how to flush the device iotlb. > > > > DavidW might remember, i think the idea was to help with cost > of virtualization, we can avoid taking 2 exits vs handling > it directly when we do iotlb flushing instead. > OK, performance-wise it makes sense. though strictly speaking it doesn't follow spec... Thanks Kevin