Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp446932lqb; Tue, 28 May 2024 23:36:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUwpaLN4E/xu+BxA27E7yP3MelXVln7XsnrWUboSMFu1nAhCuNth647pi9+zjtFtSIISdV6m9M8t8oFobq81toYzUDEz6I9MAikXofvBA== X-Google-Smtp-Source: AGHT+IHTeCONBqIUocLVcZj2sImm8qbfeQTsUTxO/aXq6XFu18G6kzS+YIgljYP32wDfbp3gIchj X-Received: by 2002:a05:6a20:3941:b0:1ab:82fe:910b with SMTP id adf61e73a8af0-1b212e64a70mr18502979637.58.1716964615066; Tue, 28 May 2024 23:36:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716964615; cv=pass; d=google.com; s=arc-20160816; b=cEtTtLu/HRqCp8S1in6GjMjeBj4fzHP/PanCPC/OS3S89qre55+YxjoXLpDcm8SqR6 GJRZ4ZrqPOGLIbomOoLLTotXvLOIeulPCbgijnxNP7jNuuncwQW8VLFTSOLk6lLlia8g lV2oAD4kp015HsmlSFD8GB5Fm1X0BpE8FDh86A0Pku+WzPLsg85Ibbd+CsmCtG+eWsAn 6a5LekDots4Jm7j2elpQqsFKefPuCRBjAu7H1lwQPbBLnkvzuiXxikfSR/pMXILuhC3V zb1H0V7pApvYB4KgNlZkKCCyuDGgX/KIBLdkYUSSMjuQk4TME7k9BvS3+tuejXXwsooV 9qzw== 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=HiQq/voPfYTP1Ot9FrSMbwCKuUHBuDYR2xHqPL36uZZesnK965sWP30q5hSYpOnmZm STr7WQNCi6Khec/FuACie3vLjotxAWxqHfGO0uYnRAYJisixrzbRCp2+HPCxpjVAWRnA 23dP1VRVt706qDPr2oBT/aMOEoT9OXvlbQKp01WFf8uTbjmI3Lbhk7R82qQLq/wQLr9Y y2+IW5S5VpS+Fgqphg0ncR4ZrwTqD6KqmcoDX7pa4ph7XIBcdWpOWdzubP97Gesig9wD Z1ptVNKSBtM9ptJVTnPmeAc9v/jHLgCN6u9mWEjkT2Gw7BR9W7cpa7b2mVlBXOTKBaVp a4BQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="LoHlT/xK"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-193451-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193451-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f49906e58csi52406895ad.516.2024.05.28.23.36.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 23:36:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193451-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="LoHlT/xK"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-193451-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193451-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CF1CB28ABC5 for ; Wed, 29 May 2024 05:37:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3934715FD17; Wed, 29 May 2024 05:36:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LoHlT/xK" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 E957B15B99F for ; Wed, 29 May 2024 05:36:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716960974; cv=none; b=WsUdK4YseZ8NGdO8KhfI5dyg+SwMdLjJ1tH69W5KGkSJMjc56V+Wn1cFvhpS9H3hvzcXW2r5gf0wu3XRDtTWJYpfsZlUGuvG+jbj2aHS+n78SVZU9bwA1tONf7Xq8ZTe1NcWGGS5ZQG4IVnm5ckYXjQLJ7sX7y4AGtClvZbWsh4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716960974; c=relaxed/simple; bh=i2g4o4FMSNI6vy56g2mVccrM+MuXNKNyXwoqmECaK9M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gCYayg2BzNde7TUHHktX7lSQ1CAxY71Pfs2BOsHik4wV8I8xq7RcEz3kO+nUwOyRBCORLWfXSOkV6ZXrCcH0o+vSPruxIjWd8oZe+5AK9M1OKfuOkU/INerfhEYoZbaozW5V5BhywrQDV93bGRmFaLwDEXjQC/hopLrlFyeQJ+Q= 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=LoHlT/xK; arc=none smtp.client-ip=192.198.163.14 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=1716960973; x=1748496973; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=i2g4o4FMSNI6vy56g2mVccrM+MuXNKNyXwoqmECaK9M=; b=LoHlT/xKZsJ3n82UnMR7MhwE7kMuSLFeUf+MtzUztsBWfLLr6vC9Rajv KTzHFyJB1Z9KPW/ImITeJ77BokppLmQ+mlHyauBeGwKErN5qjizn4qDBL xqEXkrOsVTXsDWtBDu8fe7SG6JwJZzWzhKl6jsA+8Rl8YgHZ9QBuYHHJd syK3fFdNUWZUOYCdCV8GISmU5hcm3i9Cqc5v+NZ83GmEeLcLzzpvgM6kX HaDIIQsQEGYNSOf5Iw/Z0kqELG04NB2ibBKC0qmFJ81iYfZJzeoPLMCxI VgkCZ/SapkPN9Ah/jYs12Zw4PJWnCy9vWE4otZwfWDFOwVGccayAeM3zy Q==; X-CSE-ConnectionGUID: nmTIRLnNSKm4XCBasgy7qA== X-CSE-MsgGUID: 2WemJI2wTimyi1F/xArePA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13568764" X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="13568764" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 22:35:11 -0700 X-CSE-ConnectionGUID: ooEsLAqOTEq37Hrx3ZeYbQ== X-CSE-MsgGUID: FAzliAhcS6u1szAMWmJLKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,197,1712646000"; d="scan'208";a="35257473" Received: from unknown (HELO allen-box.sh.intel.com) ([10.239.159.127]) by fmviesa007.fm.intel.com with ESMTP; 28 May 2024 22:35:06 -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 02/20] iommufd: Use iommu_user_domain_alloc() Date: Wed, 29 May 2024 13:32:32 +0800 Message-Id: <20240529053250.91284-3-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529053250.91284-1-baolu.lu@linux.intel.com> References: <20240529053250.91284-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