Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1157357ybp; Fri, 4 Oct 2019 10:19:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDTd2/C85VRwtz+Qhb1mJlw+GS6Y5IaBjylU3SRMFr+7aZJ44lbc1WaMrPn3M8BPsCGjkK X-Received: by 2002:a50:9e65:: with SMTP id z92mr16602378ede.49.1570209564803; Fri, 04 Oct 2019 10:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570209564; cv=none; d=google.com; s=arc-20160816; b=qK3tHQFaQjV367Zgj6nWwN5+Rr6gHBpixhg+oHLL+KrldQa0KgLvIvdQy7vdXrVmre tScR2SkGTo/2S+9uP2AktGQE1IaHh3RaeInpiNOuU7gMEgpukmQAssMbbQRQ8CN3c1dM 9YLDtDmF76bgZiERUBdvasE3jU9+XyotYiVwmhOk+MEKT6G7Y1KArSaw9c/ZURyvh7IZ QFO89ykLteHbRGeFy4PPUA5NU2PCpD88LxLwz1Qhy8nX9FtPshsR8+TXeOjkpbnX/Hds E++/UDx5pPfAita3sK53u0zN5pkjkKu+YZWoqEp+c2U2cvZUV19fFGFPuaANPjN7ZxbY GAYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=P6ILDe87atoSpFhr4YLtT8v1Dvs0XN+7b56hhQlsV+s=; b=UebXQHdkMLXzELmT7Ti8UGinqzYmS6jFftYIWKWM7USoJnVbtuEjBkMVODy0VMmj+k vzr/X/K8MwFmQHYMgckkszu+bvnMfA6OiT6wmsFIjO6aqi9Ej8VlwhVoNoln17YECyR8 V1Ih/eyI6XJxIoXuIclKTXH+q4zxoPe/A7G7/keI1S+iCjIn6N44QJPwCrHotqeEb7E2 tk/IYEkj1GSGqV/Gx5P4zPQhChGX96DBxFY0nYjdQGWvYPXsO0Cn3AmpCB94Qc/gs2EN hErHwURKMIQt5PfYDCOe2QIc/kkt+yFMmFnrLuxujU3T5Jfh8Aj/rjBUMRFXM7xlwUEw MTpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=enBXaEXp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11si3243918eji.160.2019.10.04.10.19.00; Fri, 04 Oct 2019 10:19:24 -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; dkim=pass header.i=@linaro.org header.s=google header.b=enBXaEXp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387659AbfJDRSk (ORCPT + 99 others); Fri, 4 Oct 2019 13:18:40 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:38541 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387458AbfJDRSk (ORCPT ); Fri, 4 Oct 2019 13:18:40 -0400 Received: by mail-ed1-f67.google.com with SMTP id l21so6628187edr.5 for ; Fri, 04 Oct 2019 10:18:39 -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:user-agent; bh=P6ILDe87atoSpFhr4YLtT8v1Dvs0XN+7b56hhQlsV+s=; b=enBXaEXpHjow9+Pz4mdlFTKzl3G3RGqsECSmVPyToON6sDWTvSqWHSCx3aJP7zHb8m c5uclc8HWH8hKvhXKNL0V66ONtWbEHwLYEKfdDFvB2KSdfzcCscgixU48XqCxakcz/FZ +qIWnSiT09Tf9EyszAAZicDPeHJ5BrbR8rjE7aaiuwurLJA1u9SBnHjmsCMQJKhElirg 3Qhh9ao8k5amjIpmewf2qbDCXbwfHZ4YoESlQVwSlJiqcB76aEbrl7hu5ITYQIiY+qyI Czo3TxSQRSd/4RyxPrqJtpyVh/yUh1/W7htb9LUJ+WVZaB22qdnYAd4q5YLPc3FHkbz6 G+6g== 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:user-agent; bh=P6ILDe87atoSpFhr4YLtT8v1Dvs0XN+7b56hhQlsV+s=; b=Q16ze2IaqyWWvSm9+5w4ie6M14GQs288k5jPPqNd8/PKxPB1bbLNBEiZKXUQa/ejzw 3DDo5ksHxy0k8u5UAWl8prsswJLOT/1wrRlD7UDKQ06CXcUyO5Msr2/Gai1JLS9vqrzR tQwTYfnx0VNE/KtWGI7i/Jtkt+gDQfQJTeXpoA/bHoJjMTs5NG1LBSRH22gFsxA5UKjT KyZYm3RcJM+jJBuOJqcX0rW1SvIF07uHLRgCC+d/KAxFOKXBrQXj0Q00/qeKM8gZlGg2 M7WR+Pqp3nDtQ4+yrlsydymFom3g5ik9nCvB8Rh6cTkW55wM+E9Co1hZOwS6kGpqEbs+ ogjA== X-Gm-Message-State: APjAAAUz/gOlSmWNEyjLp9imzyyAQIDPVMaUGJ6ujyWzHgbeYqPKUZtP 40wcVfqWIT6S0WtkPhDdQ6EftA== X-Received: by 2002:a17:906:b30b:: with SMTP id n11mr13772893ejz.35.1570209518810; Fri, 04 Oct 2019 10:18:38 -0700 (PDT) Received: from lophozonia ([85.195.192.192]) by smtp.gmail.com with ESMTPSA id s42sm1230595edm.57.2019.10.04.10.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2019 10:18:37 -0700 (PDT) Date: Fri, 4 Oct 2019 19:18:35 +0200 From: Jean-Philippe Brucker To: Jacob Pan Cc: iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Alex Williamson , Jean-Philippe Brucker , Yi Liu , "Tian, Kevin" , Raj Ashok , Christoph Hellwig , Lu Baolu , Jonathan Cameron , Eric Auger , Jerry Snitselaar Subject: Re: [PATCH v4 3/4] iommu/ioasid: Add custom allocators Message-ID: <20191004171835.GB1180125@lophozonia> References: <1570045363-24856-1-git-send-email-jacob.jun.pan@linux.intel.com> <1570045363-24856-4-git-send-email-jacob.jun.pan@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1570045363-24856-4-git-send-email-jacob.jun.pan@linux.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 02, 2019 at 12:42:42PM -0700, Jacob Pan wrote: > IOASID allocation may rely on platform specific methods. One use case is > that when running in the guest, in order to obtain system wide global > IOASIDs, emulated allocation interface is needed to communicate with the > host. Here we call these platform specific allocators custom allocators. > > Custom IOASID allocators can be registered at runtime and take precedence > over the default XArray allocator. They have these attributes: > > - provides platform specific alloc()/free() functions with private data. > - allocation results lookup are not provided by the allocator, lookup > request must be done by the IOASID framework by its own XArray. > - allocators can be unregistered at runtime, either fallback to the next > custom allocator or to the default allocator. > - custom allocators can share the same set of alloc()/free() helpers, in > this case they also share the same IOASID space, thus the same XArray. > - switching between allocators requires all outstanding IOASIDs to be > freed unless the two allocators share the same alloc()/free() helpers. > > Signed-off-by: Jean-Philippe Brucker > Signed-off-by: Jacob Pan > Link: https://lkml.org/lkml/2019/4/26/462 Reviewed-by: Jean-Philippe Brucker