Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3789273pxy; Tue, 4 May 2021 09:55:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKZ2/f3nlLdoByp0TLYMtAXi0hX190QdwnjWFgmQ2zs0rzxggkyaR2PuuaLH0peOjSgKCK X-Received: by 2002:a17:906:5906:: with SMTP id h6mr23161592ejq.176.1620147328437; Tue, 04 May 2021 09:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620147328; cv=none; d=google.com; s=arc-20160816; b=KUZbikQ8Wvgr0OFatKxcc5wwvWnUJOCfFBGkSx1cOgdkwd4xcMY5b4gUbQfbQJVsSb on5AV/tJkbAzb2BijEMKodNP8Js6tyglbQpj6wOeeY1sRCXHGQn309M1PbvVTgZ5qc5F 53tuAc829y9wDzrnVRNf8igQ5pX9BIncVwwkxFES/2HBvEZfjuskX1PBP98JQJi+b6A6 MQKFXoNv4j1PaZuXMP5kDMNW7sxtuxoCFRVQdoLFkpRYLhnNdi0w8OsS3kyE0/ChNdX6 zReENJ1RWiawRNiG7kcL2hTAliRTdiEK/KTP2tOG1CwPbjagBVwl8Z7D1g9Kr8Z5ebUo UCiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:ironport-sdr:ironport-sdr; bh=IxopD0KA46/fh/nPNEqNGqhxBwdoMrVLeURKyxfdLBs=; b=H7Cbka2+fdilx9d6SUy7oFbQs8oURoLQu2ZLHQhIyc62cX9mVs2CU75mcaQ/3ty17n yIC77O0VJkW2RzSxefivQfo2ME92RgYfIbSryvVPQvUi0eMtPW/ueH4XY55lHh+oJWTp r/gtoMP0y9AhVoPy71OX7TzaRozp2vkdkWxkE8ng4HWll5Dv7/fbKc2v3zgfuiw5C6Zf hguNBOvDy7mV5/Im+FUmgR8q/kq8Fe9qXbzFYA9krkjn5EMDohpdZB1koMcbKv7uZzSv mTFDRuEw0b2FyB/myzZpkT3vn5ifei1EYFeSPfAXkCdkTbQyou3wwib02Mf9zhFi6/kH Q8Tg== 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 q19si394404edv.466.2021.05.04.09.55.04; Tue, 04 May 2021 09:55:28 -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 S230406AbhEDPjz (ORCPT + 99 others); Tue, 4 May 2021 11:39:55 -0400 Received: from mga14.intel.com ([192.55.52.115]:43996 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230112AbhEDPjy (ORCPT ); Tue, 4 May 2021 11:39:54 -0400 IronPort-SDR: SoVxsb2A2CctvZ6e9DjudQiFmiv/DsPwZcf5uBoBc/oh6kHN77sv2RAhyekFWmuCOEiFq7klCP AsiV1nkkkcvQ== X-IronPort-AV: E=McAfee;i="6200,9189,9974"; a="197624568" X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="197624568" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 08:38:59 -0700 IronPort-SDR: eVcqlKDXCpii3jZkhwnN7a0J/3G3igfAg57JBIW0V3O+usbdg9PgdLmu68B05/OGA2lKj1bKla JssfZGxXOk+Q== X-IronPort-AV: E=Sophos;i="5.82,272,1613462400"; d="scan'208";a="427815781" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 08:38:59 -0700 Date: Tue, 4 May 2021 08:41:48 -0700 From: Jacob Pan To: "Tian, Kevin" Cc: Jason Gunthorpe , Alex Williamson , "Liu, Yi L" , Auger Eric , Jean-Philippe Brucker , LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu@lists.linux-foundation.org" , "cgroups@vger.kernel.org" , Tejun Heo , Li Zefan , Johannes Weiner , Jean-Philippe Brucker , Jonathan Corbet , "Raj, Ashok" , "Wu, Hao" , "Jiang, Dave" , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs Message-ID: <20210504084148.4f61d0b5@jacob-builder> In-Reply-To: References: <20210421162307.GM1370958@nvidia.com> <20210421105451.56d3670a@redhat.com> <20210421175203.GN1370958@nvidia.com> <20210421133312.15307c44@redhat.com> <20210421230301.GP1370958@nvidia.com> <20210422121020.GT1370958@nvidia.com> <20210423114944.GF1370958@nvidia.com> <20210426123817.GQ1370958@nvidia.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kevin, On Wed, 28 Apr 2021 06:34:11 +0000, "Tian, Kevin" wrote: > > > > (also looking at ioasid.c, why do we need such a thin and odd wrapper > > around xarray?) > > > > I'll leave it to Jean and Jacob. I am not sure whether you are referring to the current ioasid.c or the changes proposed in this patchset. I added a per VM/ioasid_set (also per /dev/ioasid fd) xarray to store guest-host PASID mapping. The current code has a xarray for the allocators. struct ioasid_allocator_data { struct ioasid_allocator_ops *ops; struct list_head list; struct list_head slist; #define IOASID_ALLOCATOR_CUSTOM BIT(0) /* Needs framework to track results */ unsigned long flags; struct xarray xa; struct rcu_head rcu; }; Could you elaborate? Thanks, Jacob