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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no 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 36D2BC433ED for ; Tue, 4 May 2021 15:39:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3DC0611AD for ; Tue, 4 May 2021 15:39:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230494AbhEDPjz (ORCPT ); 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