Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp804358ybx; Fri, 1 Nov 2019 11:29:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxn3AHf/8+ikj2LAy+izP4DXjQ4fgJDWxK82JXgu4jpoNZBrvC6R0XIkQeMlG2VzR38Hkwa X-Received: by 2002:a17:906:1d59:: with SMTP id o25mr11217107ejh.115.1572632968758; Fri, 01 Nov 2019 11:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572632968; cv=none; d=google.com; s=arc-20160816; b=0bnX/xOtsXdd1UVhjHjElztYzmDhy6pjaf4wRAnZzqRsfRK2K2vDpLhjNS36bhSxzo CVx5DBrRa/FM75tg8ZHhU4SknC0V6mktQAvgU72R/eGxk1NcATXnG7dXOzrL3MTGqFQd a05aFP+N6LtNNKjuIGtyFLxdm59BQwGgxSDF1NeO8p2xUFOHGSPHw5auInmaWcurEutg Fpgd/HXxZWvNHxPuKd5SQoXB8tb8IScQTGclw7oSpzvdHPr5Ryo+vytzCraUlTRnRfbh HvL7eSRb0AwksOneNowBvuOwNmhu3Q8FnCk0sERJF4aBbRjIgUhSJxGKYuVuE5e2rdWR oeYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=aa0eRJvqrDkoa58Mdr+1wOUMtM+BI+rsbW/u/2igzGw=; b=o599nh8875AlBRhgcOKdUeRD0/Lcm7eOyhpejTUFBgrm6XzYIc8ZJ0xcItUtdZ7lIV LSxJuxmy8H85bSjED8pdMVktJ2hMf6WnRp72AnTGhXlCD/PFY8943OOGVBkWM82C7F+t 5JM12TJ/ISAozaDzzuChXSQmtdGKi7Vehtik8lng4VsQ5BizLwqc97Q2GE7XK0cO2ANU znhegrvBdgRpbUM0vb052SrB8FnnUzq0ZxRrKIpSpJ1YyiH83gc7G2mqGV1gzsZzakkY MML8khig96VqJkQyCVUl0Ezz3dhBJdlyhqk4edowCu/Lzl9Ntmpgf8LyAfunQSd0saYZ /QXQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h21si6150620ejs.69.2019.11.01.11.29.05; Fri, 01 Nov 2019 11:29:28 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727346AbfKASZI (ORCPT + 99 others); Fri, 1 Nov 2019 14:25:08 -0400 Received: from mga09.intel.com ([134.134.136.24]:18181 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726532AbfKASZI (ORCPT ); Fri, 1 Nov 2019 14:25:08 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2019 11:25:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,256,1569308400"; d="scan'208";a="212854720" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga002.jf.intel.com with ESMTP; 01 Nov 2019 11:25:07 -0700 Date: Fri, 1 Nov 2019 11:29:33 -0700 From: Jacob Pan To: Lu Baolu Cc: iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Alex Williamson , Jean-Philippe Brucker , Yi Liu , "Tian, Kevin" , Raj Ashok , Christoph Hellwig , Jonathan Cameron , Eric Auger , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH v7 04/11] iommu/vt-d: Replace Intel specific PASID allocator with IOASID Message-ID: <20191101112933.0e8a738f@jacob-builder> In-Reply-To: <87bb4356-136b-b395-894e-8cffa1709309@linux.intel.com> References: <1571946904-86776-1-git-send-email-jacob.jun.pan@linux.intel.com> <1571946904-86776-5-git-send-email-jacob.jun.pan@linux.intel.com> <87bb4356-136b-b395-894e-8cffa1709309@linux.intel.com> Organization: OTC X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Oct 2019 13:47:25 +0800 Lu Baolu wrote: > Hi, > > On 10/25/19 3:54 AM, Jacob Pan wrote: > > Make use of generic IOASID code to manage PASID allocation, > > free, and lookup. Replace Intel specific code. > > > > Signed-off-by: Jacob Pan > > --- > > drivers/iommu/intel-iommu.c | 12 ++++++------ > > drivers/iommu/intel-pasid.c | 36 > > ------------------------------------ drivers/iommu/intel-svm.c | > > 39 +++++++++++++++++++++++---------------- 3 files changed, 29 > > insertions(+), 58 deletions(-) > > [--cut--] > > > @@ -458,10 +465,11 @@ int intel_svm_is_pasid_valid(struct device > > *dev, int pasid) if (!iommu) > > goto out; > > > > - svm = intel_pasid_lookup_id(pasid); > > - if (!svm) > > + svm = ioasid_find(NULL, pasid, NULL); > > + if (IS_ERR(svm)) { > > Shall we check whether svm is NULL? > Missed this earlier, you are right we need to check for NULL. Thanks, > Others looks good to me. > > Reviewed-by: Lu Baolu > > Best regards, > baolu [Jacob Pan]