Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5409378pxb; Mon, 7 Feb 2022 01:04:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLQe2w1+bNdp07TRBGKlCY+mfy0rbhK08FNc2FfLV1S8NVmiBsiWq+HMPMsBuwm06fzfDq X-Received: by 2002:a17:902:8205:: with SMTP id x5mr15070537pln.29.1644224653999; Mon, 07 Feb 2022 01:04:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644224653; cv=none; d=google.com; s=arc-20160816; b=FSXtEq8eeXXEfqBbaFxsgHCCOcdyaGz6ePhU/uTrZTMH2+9GYTvr7KDNblIVVs3py2 mOvEjUeonQyBhpCsldBzWUXdY/R4ooGW8hUdmi/d4IOs8LX5mRx6ecbH/j9He29ktOeQ Y4qz24iQabgMyC1ZtxbSHlHsGdB07t4rPdQE+qMZzaaZjXsIHozZVFp6sGr1uhRK4Thq dTCfZJ/TPBc2VHmJ3HZ6pz75Nl3bZyvfJ73V+DkCXnx7hvYwFfuUNrTTqD0Z6et7EflD FkbQMs3SRLPS/CYPtPF72fbWCcSG9Qkpjxq9SrPR/D02b4xaRy4rq6b3ehUQv3mEonvk OSzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PckF3KnP60CryFENERjFznM7oND5EMLSXntub2omNAc=; b=hqR/KQe10FoPSLr5FyFXdTQDlhKAww5Zv77i6uW50z5OW7QEoQinMfYrrNIkfexI2c rbjd+MerSnqylqzXKkTtVY/JxNJhbkG3Pu8gQhSTx9k5rXkdzWzxSFZUmqbGW5Ejcp92 qMx3MdJnxULJg/+BJAzm6yilzyUCr+hqNuqMBIZuElg4pQDOY3UKGoT3cFj1WZ6F1LJM gl99yednUwH05DG4/Gi6TwKLhCoFHHk8JwitCyxjMUb+JXxGO9ny0qbfRNAtfrSHkdqc 5+5vp2+BWs9vBZZ2Goc76lo6wOUPJwKy/ZJ2ZUaCMyMowAL91Sj3gYYwMy4eESkR8RUa WV+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Qxd9jDC6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h11si7513776plo.516.2022.02.07.01.03.59; Mon, 07 Feb 2022 01:04:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Qxd9jDC6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235154AbiBEFKR (ORCPT + 99 others); Sat, 5 Feb 2022 00:10:17 -0500 Received: from mga09.intel.com ([134.134.136.24]:48795 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbiBEFKP (ORCPT ); Sat, 5 Feb 2022 00:10:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644037816; x=1675573816; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=JcX/1EZirCjM105wSMia+he9amGan4vf2Bw07F+RiJM=; b=Qxd9jDC6yQpwGIL5UPkzr/yRWQ6aFGRZ7Du/5msTHwNRyk8D+QCkn3X9 CVLyxrkmf21B4zJrYUoZTgAHddNOXVMm3ucyAXZ9ccH463Hd5diw5QuE/ LqohRIC/oR0cBlpEDNEcd7wra1i4AVABfTp7kgLpvwC93ktvd8S/eRFIy KLR2honnftt2z8pFqhYU2uiPuoSq4okBJQPSvsSpyZ2jSLRJ7N4csWkoe S6+Bp6aKg5XWXNbcV3jycT8AE5QT6q7dtXW+K480/DZyIpdX0Uinaato4 Bo8vH9hA+B1UgMs9WlXaQKehcogmh9GDWzKtSIcQc+cLpFQvR9yyA+4ts g==; X-IronPort-AV: E=McAfee;i="6200,9189,10248"; a="248251597" X-IronPort-AV: E=Sophos;i="5.88,344,1635231600"; d="scan'208";a="248251597" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 21:10:15 -0800 X-IronPort-AV: E=Sophos;i="5.88,344,1635231600"; d="scan'208";a="539426486" Received: from otcwcpicx3.sc.intel.com ([172.25.55.73]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 21:10:15 -0800 Date: Fri, 4 Feb 2022 21:10:14 -0800 From: Fenghua Yu To: Lu Baolu Cc: Thomas Gleixner , Dave Hansen , Ingo Molnar , Borislav Petkov , Peter Zijlstra , Andy Lutomirski , Tony Luck , Joerg Roedel , Josh Poimboeuf , Jacob Pan , Ashok Raj , Ravi V Shankar , iommu@lists.linux-foundation.org, x86 , linux-kernel Subject: Re: [PATCH v3 05/11] iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit Message-ID: References: <20220128202905.2274672-1-fenghua.yu@intel.com> <20220128202905.2274672-6-fenghua.yu@intel.com> <6ace7131-4671-6956-944f-df01e5d63470@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6ace7131-4671-6956-944f-df01e5d63470@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Baolu, On Sat, Feb 05, 2022 at 11:50:59AM +0800, Lu Baolu wrote: > Hi Fenghua, > > On 2022/1/29 4:28, Fenghua Yu wrote: > > diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c > > index 92fea3fbbb11..ef03b2176bbd 100644 > > --- a/drivers/iommu/intel/iommu.c > > +++ b/drivers/iommu/intel/iommu.c > > @@ -4781,7 +4781,7 @@ static int aux_domain_add_dev(struct dmar_domain *domain, > > link_failed: > > spin_unlock_irqrestore(&device_domain_lock, flags); > > if (list_empty(&domain->subdevices) && domain->default_pasid > 0) > > - ioasid_put(domain->default_pasid); > > + ioasid_free(domain->default_pasid); > > return ret; > > } > > @@ -4811,7 +4811,7 @@ static void aux_domain_remove_dev(struct dmar_domain *domain, > > spin_unlock_irqrestore(&device_domain_lock, flags); > > if (list_empty(&domain->subdevices) && domain->default_pasid > 0) > > - ioasid_put(domain->default_pasid); > > + ioasid_free(domain->default_pasid); > > } > > static int prepare_domain_attach_device(struct iommu_domain *domain, > > The domain->default_pasid is not relevant to SVA and it's being cleaned > up by another series. No need to take care of it in this series. Because ioasid_put() is renamed to ioasid_free() in this patch, without above changes, this series cannot be compiled. Thomas and I discussed how to handle aux_domain while you will remove the entire aux_domain code (https://lore.kernel.org/lkml/87zgnf29op.ffs@tglx/). The above changes are minimal and temporary changes to compile this series. The changes will be removed along with the entire aux_domain by your removing aux_domain series later in 5.18. Thanks. -Fenghua