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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 4B913C43331 for ; Wed, 1 Apr 2020 13:55:40 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B048206CC for ; Wed, 1 Apr 2020 13:55:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Hcyn6fKH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B048206CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E418086E55; Wed, 1 Apr 2020 13:55:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UL-wUHH2g3In; Wed, 1 Apr 2020 13:55:38 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 14D0B86E4E; Wed, 1 Apr 2020 13:55:38 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id F1FC8C1D7F; Wed, 1 Apr 2020 13:55:37 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id A1B1EC089F for ; Wed, 1 Apr 2020 13:55:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8F4FB20447 for ; Wed, 1 Apr 2020 13:55:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q+kzJAN5-4zE for ; Wed, 1 Apr 2020 13:55:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by silver.osuosl.org (Postfix) with ESMTPS id 6E30D20028 for ; Wed, 1 Apr 2020 13:55:35 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id h15so112467wrx.9 for ; Wed, 01 Apr 2020 06:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BokcsbFHdrrz/l4PyjTUoW+8uB/MqRMjCTweSlnNCdg=; b=Hcyn6fKHUAWfyXHU0AQI42LD9l04dXQT2av71U4PkGbjP1d8X5ejQCIr6m6I8zply1 y8ng/jzsrvOEIlv8YqJZzMFhcwDwbkuyqlz2yvuRbQVyaqUGswaO9CNCy9IrzGWiN8hT cFE+955zBtH6yc/aEP2P52gHsEhgURQjFPIZpzhw3Hze/Fc5q/uyfnDn8FSctAt65FG9 9kM1BSabVwbx+rvRSKTrXaLxMRAyfQNDJ23fZKm86OfAiSB69A6ywoCoKMJHavK0GPO/ y6FOyxUw98OPpXYcbhlSDeKwSp23hkf8OsdgmqtEUQoqQguBvFBe70cMzXxajkFcMHGT w23g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BokcsbFHdrrz/l4PyjTUoW+8uB/MqRMjCTweSlnNCdg=; b=ZjqpEQmHQt6ot8jfygly3HpzFiqCcdL0JVZnY6euEfhNUouAn0VhANrKWh8WkHByaQ x50j8tlYuT553aBt2whQsaRV9ciYry/1c2wn2Zn0bkGxEOlZ9vI7W0IoukYQ/EtBd5qe udtsXAcIlxuGptxYJfhJMcYOGVtGm15a8czqG1jMq8Ezv03TYLWrbDuqXTnc3jvlfMrY tVoyPnE7CcXaK30k3XfNulBKTG3ji2ZC6P9mraeqmGrhlmEtwQs97uN6D0F5pSrYG666 CuUjZCheFxf21uPap8UbA1MPrQ+7x9K7O7CwQMugPqw4ZmynO6vuteAI4dI/jn4wavkI rMng== X-Gm-Message-State: ANhLgQ3fZpo4LryS0SBRkIcY9tu5zkCKDXYLBmB7obNMX8uhoEhbl/pK Aj/BiBHiAiAXPdp7Ap08Nca1MA== X-Google-Smtp-Source: ADFU+vtmh9pjwAtzFVJ9AOztFnbZs+VXIuHpNaBbP7+Bz5tpaP97qcOdEJJmKnjKxhSpeN/c6TG6Bw== X-Received: by 2002:adf:bc4a:: with SMTP id a10mr25721435wrh.7.1585749333948; Wed, 01 Apr 2020 06:55:33 -0700 (PDT) Received: from myrica ([2001:171b:226b:54a0:6097:1406:6470:33b5]) by smtp.gmail.com with ESMTPSA id c189sm2853560wmd.12.2020.04.01.06.55.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2020 06:55:33 -0700 (PDT) Date: Wed, 1 Apr 2020 15:55:25 +0200 From: Jean-Philippe Brucker To: Jacob Pan Subject: Re: [PATCH 06/10] iommu/ioasid: Convert to set aware allocations Message-ID: <20200401135525.GG882512@myrica> References: <1585158931-1825-1-git-send-email-jacob.jun.pan@linux.intel.com> <1585158931-1825-7-git-send-email-jacob.jun.pan@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1585158931-1825-7-git-send-email-jacob.jun.pan@linux.intel.com> Cc: "Tian, Kevin" , Raj Ashok , Jean-Philippe Brucker , LKML , iommu@lists.linux-foundation.org, Alex Williamson , David Woodhouse , Jonathan Cameron X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Wed, Mar 25, 2020 at 10:55:27AM -0700, Jacob Pan wrote: > The current ioasid_alloc function takes a token/ioasid_set then record it > on the IOASID being allocated. There is no alloc/free on the ioasid_set. > > With the IOASID set APIs, callers must allocate an ioasid_set before > allocate IOASIDs within the set. Quota and other ioasid_set level > activities can then be enforced. > > This patch converts existing API to the new ioasid_set model. > > Signed-off-by: Liu Yi L > Signed-off-by: Jacob Pan [...] > @@ -379,6 +391,9 @@ ioasid_t ioasid_alloc(struct ioasid_set *set, ioasid_t min, ioasid_t max, > } > data->id = id; > > + /* Store IOASID in the per set data */ > + xa_store(&sdata->xa, id, data, GFP_KERNEL); I couldn't figure out why you're maintaining an additional xarray for each set. We're already storing that data in active_allocator->xa, why the duplication? If it's for the gPASID -> hPASID translation mentioned by the cover letter, maybe you could add this xa when introducing that change? Thanks, Jean _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu