Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4035919ybg; Fri, 25 Oct 2019 12:23:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXoRA8Sy4Wzx8SKulQ92DId+8u31tt5AlknQ6DtNSvOaNMrlbMhX8aqNE1BDsISj0GGJJF X-Received: by 2002:a17:906:e101:: with SMTP id gj1mr5145490ejb.253.1572031424322; Fri, 25 Oct 2019 12:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572031424; cv=none; d=google.com; s=arc-20160816; b=jFXjUghk1dVatMxcQg1qltXi5El7OZM9wxOlfvi/KU6HIVmUlbvzEtMrQRuaVHqz3U fBrTH/bLIzJRX1GOTdZRi4H682B8MZJD6yuGdnzhg4JD3scMPd6XpuEdbsbYsgf37ef8 uDSFJEnX3tO3ZuIW4+qAeIwBG13JJs/jxQ32WxmoqfbpNrAdCZyrRE0+Cb05os6PTf1X fPtFWLqMp6EU+juff+G6fm1VPYg8vOCGL3KYGrUqslACzNnGDTdycaM8MzXrsXRdapkd s0e5O+qbRGgg4qQlImlQJN7zZzaiPjiI67BMUTO8Ka4zE1AmUYeiIRM7OlLUsG1MWQC6 QWWQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:cc; bh=5ZxcJKi/r4UdnVq9d61QBv+5vccU4J4ChSU6toh03S0=; b=L8NsU24JXFluVAqWhsWAdT9ZU0ah5gGvbK+aRg8gvlI+wEHFoVVI2GlpAVdxmGOX50 ruYbZQy0/cR9xU90Lo8i7l5xgTfriGOwyiazPmt78udWT0bmHPwGm9lUe00qWBE1w2ko +FJE8rox8u0hUX5GdUvgVV0cUe2o5y3YXNOFKG0ctqAxidkefreBRIUABkihFpXOENqZ DAAXVcaF7WHTVXCIJFE2tWzKz1ApMwz3FjP6gGNiW5BnGzDrU2gphbdfFT0/6Q3MdCrs vaVU2WFNt+yPwH4TQJLd8oeJSoZjwbS82Y6vluSSYjWi7/weuXTLkAzfcsHroCEOaklR Ga1A== 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 k12si1928048ede.181.2019.10.25.12.23.21; Fri, 25 Oct 2019 12:23:44 -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 S2393633AbfJYFuC (ORCPT + 99 others); Fri, 25 Oct 2019 01:50:02 -0400 Received: from mga14.intel.com ([192.55.52.115]:65037 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390519AbfJYFuB (ORCPT ); Fri, 25 Oct 2019 01:50:01 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2019 22:50:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,227,1569308400"; d="scan'208";a="223811198" Received: from allen-box.sh.intel.com (HELO [10.239.159.136]) ([10.239.159.136]) by fmsmga004.fm.intel.com with ESMTP; 24 Oct 2019 22:49:59 -0700 Cc: baolu.lu@linux.intel.com, Yi Liu , "Tian, Kevin" , Raj Ashok , Christoph Hellwig , Jonathan Cameron , Eric Auger Subject: Re: [PATCH v7 04/11] iommu/vt-d: Replace Intel specific PASID allocator with IOASID To: Jacob Pan , iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Alex Williamson , Jean-Philippe Brucker 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> From: Lu Baolu Message-ID: <87bb4356-136b-b395-894e-8cffa1709309@linux.intel.com> Date: Fri, 25 Oct 2019 13:47:25 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1571946904-86776-5-git-send-email-jacob.jun.pan@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Others looks good to me. Reviewed-by: Lu Baolu Best regards, baolu