From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1054C433F5 for ; Tue, 4 Sep 2018 08:34:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 651382086A for ; Tue, 4 Sep 2018 08:34:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 651382086A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726363AbeIDM6U convert rfc822-to-8bit (ORCPT ); Tue, 4 Sep 2018 08:58:20 -0400 Received: from mga05.intel.com ([192.55.52.43]:61179 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbeIDM6U (ORCPT ); Tue, 4 Sep 2018 08:58:20 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 01:34:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,328,1531810800"; d="scan'208";a="254325956" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 04 Sep 2018 01:34:14 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 4 Sep 2018 01:34:14 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 4 Sep 2018 01:34:13 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.205]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.150]) with mapi id 14.03.0319.002; Tue, 4 Sep 2018 16:34:12 +0800 From: "Tian, Kevin" To: Auger Eric , Jean-Philippe Brucker , "eric.auger.pro@gmail.com" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "kvmarm@lists.cs.columbia.edu" , "joro@8bytes.org" , "alex.williamson@redhat.com" , "jacob.jun.pan@linux.intel.com" , "yi.l.liu@linux.intel.com" , "will.deacon@arm.com" , "robin.murphy@arm.com" CC: "marc.zyngier@arm.com" , "peter.maydell@linaro.org" , "christoffer.dall@arm.com" Subject: RE: [RFC 01/13] iommu: Introduce bind_guest_stage API Thread-Topic: [RFC 01/13] iommu: Introduce bind_guest_stage API Thread-Index: AQHUOttfqy1SkTByKESItK+VEUbEjaTM7zGAgAxtLACAAAuEgIAGZ4Rg//+CZACAAIvdQA== Date: Tue, 4 Sep 2018 08:34:11 +0000 Message-ID: References: <1535026656-8450-1-git-send-email-eric.auger@redhat.com> <1535026656-8450-2-git-send-email-eric.auger@redhat.com> <22c01a4d-c74a-7279-d4ae-39e29a3bc942@redhat.com> <4309832b-27ed-597a-b5a1-f439fbea9843@redhat.com> <220e4c2a-d31c-d8fb-2d77-d902d2f13bb2@redhat.com> In-Reply-To: <220e4c2a-d31c-d8fb-2d77-d902d2f13bb2@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjVmNmMwODktNjBkYS00ZmQxLWIwNjItYTM0MDYxYTUzNGQ3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNVFlSXF3MXgxRkhWenZGWk1LMGt5aEwwVXZuM3FYdEpvXC90cDJpKzNwSU9zVGZIRDR2bmxHMUFwc01hWUl0VmQifQ== 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: Auger Eric > Sent: Tuesday, September 4, 2018 4:11 PM > > Hi Kevin, > On 09/04/2018 09:57 AM, Tian, Kevin wrote: > >> From: Auger Eric > >> Sent: Friday, August 31, 2018 9:52 PM > >> > >> Hi Jean-Philippe, > >> > >> On 08/31/2018 03:11 PM, Jean-Philippe Brucker wrote: > >>> Hi Eric, > >>> > >>> On 23/08/18 16:25, Auger Eric wrote: > >>>>> +int iommu_bind_guest_stage(struct iommu_domain *domain, > struct > >> device *dev, > >>>>> + struct iommu_guest_stage_config *cfg) > >>> > >>> About the name change from iommu_bind_pasid_table: is the intent to > >>> reuse this API for SMMUv2, which supports nested but not PASID? > Seems > >>> like a good idea but "iommu_bind_table" may be better since "stage" is > >>> only used by Arm. > >> > >> At the moment I don't target SMUv2 but just SMMUv3. My focus was on > >> nested stage enablement without enabling the multi-CD feature (PASID), > >> whish is not supported by the QEMU vSMMUv3. Afterwards I realized > that > >> basically we are pointing to a CD or PASID table and that's about the > >> same. I don't have a strong opinion on the name, > iommu_bind_guest_table > >> or iommu_bind_pasid_table would be fine with me. Indeed "stage" is > ARM > >> vocable (level for Intel?) > > > > Intel uses first level/second level. > > > > iommu_bind_table is a bit confusing. what should people take table as? > > there is PASID table. there is also page table linked in each stage/level. > and > > maybe other tables in vendor-specific definition. > > > > to me iommu_bind_pasid_table is still clearer. anyway in other places > > we've used pasid explicitly in vfio/iommu APIs, then it should be general > > enough to represent various implementations. > > Fine for me. > > However I I would suggest to rename the original iommu_sva_invalidate > into something that is SVA unrelated. iommu_tlb_invalidate is not OK as > this API also is used to invalidate context caches - which are not > iotlbs -. What about iommu_cache_invalidate? > > At least we must clarify that this API can be used for something else > than SVA enablement. > Agree. using SVA is limiting. I also agree that iommu_cache_invalidate is better, though I don't think you want to pass guest context cache invalidation to host. that information is fully under host control. :-) Thanks Kevin