Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1322120lqj; Mon, 3 Jun 2024 18:54:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1IlK13IDjTtmkvCDqU5Nz5yXZjOsWeGFzHxB2RWDyg+OyZazruVp9INNtyv1ZUHEUntr3YGdMa0HkmaKITJnWJdLkiGMNS5xexb6jAg== X-Google-Smtp-Source: AGHT+IEc0s5MTyZra9M97nNFeEH+wqRkSpOLKUFsfVqPWM83I5AZkWJVaE3z1pjRz+0qJedIE5Ea X-Received: by 2002:a05:6102:470c:b0:48b:bc62:b142 with SMTP id ada2fe7eead31-48bc22e24a9mr11906876137.27.1717466097974; Mon, 03 Jun 2024 18:54:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717466097; cv=pass; d=google.com; s=arc-20160816; b=ZK+lwtJ/uYYmqbIP5R3zxFni2aovwts7hGTPoaag1CoffH3/vO5NYEJ/dyPMIUV8Dk sAa9GR61PLDQMSx8F3V8TAt3QVG4hubI2Mvs8PEXWwg/tcF7QuKxnf05vwpM4qTrIn2a S07wwAlOUki6Jd3ZR/rEp94XphPrGU/e3/zbF1iAun9YsSJYinOQx/E9e0ErZe3irb9b sotA9uRr/WuskNrEBqljreLbe4daXGkMn9QUTUFRFS+Vsd+tNOCMpkO2Zts6DJGZNcLQ 9ziyHKn6+xfP9MpNbsOxacTHFP537QFRUA4dLOgek48N4xBd+QX92WJC3qqTJjDp958L Pt0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=IFW7wYJ5x8kVgZksPuwvU31pPVfNHwqSdiI8D58JY38=; fh=u7VIfotmvhCnFPKh0R845OAh004BwcT1TGiZ1dQEGzo=; b=uq8m4Wb1K9ibLbu8Lo0r+1i8SNpGb15ztry5S0G0Df6NuI/gIj3OiWi6L8X11fiooI C3reXBI7LBe3U2IUM9ZV/8Lv+HNyQTvtG21hLSZY63/swu6d4FJyvkTHwSG7rkXdhSuF fUKbhmiOe4YZzxTYu+ZhozszLOmQG9qTrpJtsZm3I+EO+QisG+YPAkhoBLZI5OYRaG0x 0sJR20V3/SP4KM4nJQvinipdc0Q0rSQCOiwhxToZdVd8CjkEye6mnUfRNwvmh+jDlfO2 1C57YwjpXVq6+/0FF2dWOohamwd3j5Yw3NriIoS4XoMRh8cGChE3DKk6taBC4NRA2AWz aR1w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MGomGvjh; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-199919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794f32a5339si979303085a.605.2024.06.03.18.54.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 18:54:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MGomGvjh; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-199919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9F0351C23B80 for ; Tue, 4 Jun 2024 01:54:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73BE913DDCB; Tue, 4 Jun 2024 01:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MGomGvjh" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40AE513D8B5 for ; Tue, 4 Jun 2024 01:54:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717466045; cv=none; b=DCb04MsAnw+UFiYr3ZaFMSEMrvgimB6K0KbhCz+nOZgMJymPJmqTLynoRyQpXuvEf0d3exOyE40vU1W3og3F1wBJ8HBr/FheEwdxXBjIRah3WYPjRkmwUMZIaegR35ODvlJWnlCVMzsSH2BvU4/a3B6w+d3PAh1FAyWR6ggRHkM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717466045; c=relaxed/simple; bh=i2g4o4FMSNI6vy56g2mVccrM+MuXNKNyXwoqmECaK9M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sEC2yR72Z4SzLDLe8KsHy2tZ13IiyYt4rHDQHDXbSJ0outr+UQi7A3KmzOtpzuoV+onTYik9sOcrdh1culjQo4UL68DDcwP33AOqAHs8/Ixb1FyAsJSCb9M5Sfs7L5OjeYVCipjhREi7oa0IaPkSe2D2nu0t98s2OZ3iTNFF4nw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MGomGvjh; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717466044; x=1749002044; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=i2g4o4FMSNI6vy56g2mVccrM+MuXNKNyXwoqmECaK9M=; b=MGomGvjh19dTkPR0w1aBpGbXedA+oPSkuq190ZKphcsIsv7LtWHsbPZg CrbBz91rhpz2nCsFCd9MJBd8AfOhkQZOxFtZ6cFBh7xvFSBnx6+UkL5m8 Ygifn6WgLQ7EyDVUrXtmnVLkanpi8h5nRpw5KvEQYi3WclSbzuxkj/4oS x0sEMDl0jjIl2XYdb2RSdvbOY72jCGTn29vSaDdpT3t0nBi49j2/7COVL JcVhHTi4Xd9hOIi/H/HUUk0s7AjjRpuxgXEsbyCltfaUd6WDF0YFP3vFf UMU1fenTMFsbzJiqYoZhk73i8Dh/g7J9wN8KsPWc6/X7JYrh1KNxF3pW9 g==; X-CSE-ConnectionGUID: nQy0yVThRnqFgnPUIfjyow== X-CSE-MsgGUID: mGGZEsAsR8iou0dmLkWgYw== X-IronPort-AV: E=McAfee;i="6600,9927,11092"; a="25384855" X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="25384855" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 18:54:04 -0700 X-CSE-ConnectionGUID: cJdjhM31QJCIcg5kz7jpwA== X-CSE-MsgGUID: PJKNfxZORvC21A1XdJMlrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,212,1712646000"; d="scan'208";a="37661791" Received: from unknown (HELO allen-box.sh.intel.com) ([10.239.159.127]) by orviesa008.jf.intel.com with ESMTP; 03 Jun 2024 18:53:59 -0700 From: Lu Baolu To: Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Kevin Tian Cc: Yi Liu , David Airlie , Daniel Vetter , Kalle Valo , Bjorn Andersson , Mathieu Poirier , Alex Williamson , mst@redhat.com, Jason Wang , Thierry Reding , Jonathan Hunter , Mikko Perttunen , iommu@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v2 02/22] iommufd: Use iommu_user_domain_alloc() Date: Tue, 4 Jun 2024 09:51:14 +0800 Message-Id: <20240604015134.164206-3-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604015134.164206-1-baolu.lu@linux.intel.com> References: <20240604015134.164206-1-baolu.lu@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Replace iommu_domain_alloc() with iommu_user_domain_alloc(). Signed-off-by: Lu Baolu --- drivers/iommu/iommufd/hw_pagetable.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/iommu/iommufd/hw_pagetable.c b/drivers/iommu/iommufd/hw_pagetable.c index 33d142f8057d..ada05fccb36a 100644 --- a/drivers/iommu/iommufd/hw_pagetable.c +++ b/drivers/iommu/iommufd/hw_pagetable.c @@ -127,21 +127,11 @@ iommufd_hwpt_paging_alloc(struct iommufd_ctx *ictx, struct iommufd_ioas *ioas, hwpt_paging->ioas = ioas; hwpt_paging->nest_parent = flags & IOMMU_HWPT_ALLOC_NEST_PARENT; - if (ops->domain_alloc_user) { - hwpt->domain = ops->domain_alloc_user(idev->dev, flags, NULL, - user_data); - if (IS_ERR(hwpt->domain)) { - rc = PTR_ERR(hwpt->domain); - hwpt->domain = NULL; - goto out_abort; - } - hwpt->domain->owner = ops; - } else { - hwpt->domain = iommu_domain_alloc(idev->dev->bus); - if (!hwpt->domain) { - rc = -ENOMEM; - goto out_abort; - } + hwpt->domain = iommu_user_domain_alloc(idev->dev, flags); + if (IS_ERR(hwpt->domain)) { + rc = PTR_ERR(hwpt->domain); + hwpt->domain = NULL; + goto out_abort; } /* -- 2.34.1