Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp226906lqp; Mon, 10 Jun 2024 02:00:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6VDN6AMbQnsblP1ppQFLQB2q2w54lw7KSvwax0DeaCAuepu+El5Jw94KIcb+/W4/ogb6/JYPSYJXpMULvanz/tgRuO14tPo0R0K9gkA== X-Google-Smtp-Source: AGHT+IHjoULep51OczuAC+9abbPmeWODIHAolNFp1At0DNJReTN7MBPnoNh3S56/MNYlhX0fhiD4 X-Received: by 2002:a05:6a21:19a:b0:1b4:4370:60f with SMTP id adf61e73a8af0-1b443700773mr8170691637.1.1718010055368; Mon, 10 Jun 2024 02:00:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718010055; cv=pass; d=google.com; s=arc-20160816; b=0t5zuCB6tfr7t/xdUpN0kJ0a9PQr8LWjM5Bae4G9Aq+fz7BEiLPmW9Q7X25Pc4JaxZ cA+sX7wiQl4VBZ/NgSXa3OOiOO1hfjmMS3kcbPHk0g35JVYc+VSqNfRyome9KVPSVGrd ROsQL3HkskTjc4XAJeVdoIvLYe/nnTukOINvP01Ej9QB//AwEtxaENHP4CmxTjv+sPoK ZP7IE3NEtP5bWCLDV2Jy+zdW4jSgTN0Di0h3sDw/RYFncO1k8Wcy253uiSmkakBqXx8U TVOrDiTCD+xCgwqI8fkyMi5R7avbpvyZ22gr1LFRVfCcV54iqEojgDZBH1G3Fooys2Xk 8ijw== 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=oRoz4LDkt/UbxdzjLIfinSPySyM8LkCVNiK2R8l1I9w=; fh=oMfgzkEw/ooUXqvARCgNaSZrpwGw5y27+DEhhPidNdU=; b=cFKVdwpgR1eERFypZ0PlWU7tfuqT/71UQ0ceYT1flncvBdhJk8d3LAWdniuqAdPKlK 8XgSlNwzxVNFU87+7wCVBOhbsEEsHuwlpWa9d5vw1N56k0RL4SvFI0YBeLNh0j3X9YrL wC3iSut9qjvj1jlToHw8S+Dv1bFRreY7yzEA+eHfx/zWP8LOG0Y8HeHlepezJpoIktEP srRj/n0ivdzd0zRWi/7m3SiIPAruIlt1gP0Ail3UvlCwAPHmgnAvyPIvQWVN/SawIuvV aPFs8dCf0GNM6LFE87c2n/n2r+H+rY0/BCBtdlxWtS74s4LOfoGuU3vXB/K0pP/D0F/+ rDQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V1CfF+fO; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-207891-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207891-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 41be03b00d2f7-6eb27c19018si2391522a12.13.2024.06.10.02.00.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 02:00:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207891-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=V1CfF+fO; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-207891-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207891-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 5D341283543 for ; Mon, 10 Jun 2024 09:00:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4DDD76035; Mon, 10 Jun 2024 08:58:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="V1CfF+fO" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 831177581A for ; Mon, 10 Jun 2024 08:58:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718009913; cv=none; b=hSVrB2ayY6BcGSMT12JoSQJIiRL3+tCrkz3AoSY9uz4GwM1r392wEUEDD6yrokytWjCQ3YI4zLl89kriwoTOpqNcallh1cPNfZKQcrCY1PaRR6umkpbtZhNhcqCofsV9C853/gOWpNBCZkm2CASWKA1zRCFzdsCSrFXy6Ghxx0I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718009913; c=relaxed/simple; bh=oIx+E7QQWhC/YdRYd5TEuDpoPJpROL8sRrH8nFOhCTw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=axme61TB8A/P+Wi/wuDLRHGVla+zbeaweRYXz3pohDL8qLef4E4GAEJgXTPmxcp+dLF/6yIS7h7mDXGLTP8PSCrHP0PZSyV7Vo9ywMGJmhOzcOSMuTLSb2XTdtt9SWL0UPgoD7cKWXiBWlIsx352+MtUiYglQyEQSCPkBFw+jEk= 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=V1CfF+fO; arc=none smtp.client-ip=192.198.163.13 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=1718009912; x=1749545912; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oIx+E7QQWhC/YdRYd5TEuDpoPJpROL8sRrH8nFOhCTw=; b=V1CfF+fO+clMJL4q7ejfy2Sg/ONrUj4OC8CfkgJaNQYI6ByC2L+vceRK r/w17WlWNy0naex/JKD43VV85jdHsN1av4JX2yeM1r20C5T9JHtyBLioI R63jLtGZLuJrV1cgLHjo0hGWZDZ6Gl8rm0itfj4BlvpXxcpvBl2gvOpa1 9/3JgNHsAv0q5ouLUb7iqCpVazlyRR2cDZr9659vq/GFO0h+fZsIXP85R FcfN+drKqTuslzPn3zrhMYGt1TvRyUQT4Adp9Vr80QW1Qa/KnOvFtNHsr kdt/C7zrI8h/YstkknazmeQOFfMdi/u7Xmq3UAf+mBHtWdYW4thrpj/Qw g==; X-CSE-ConnectionGUID: iV9ZDWLjS8mBppfirYwAog== X-CSE-MsgGUID: 3nQmjHrjR8eLbXb2skEOPw== X-IronPort-AV: E=McAfee;i="6600,9927,11098"; a="17581552" X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="17581552" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 01:58:32 -0700 X-CSE-ConnectionGUID: whhgEdvaSOaveMThVGT9OA== X-CSE-MsgGUID: 6IyxwBSmQmmkJc1+Qq2yEg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="43432439" Received: from unknown (HELO allen-box.sh.intel.com) ([10.239.159.127]) by fmviesa003.fm.intel.com with ESMTP; 10 Jun 2024 01:58:28 -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 , Jeff Johnson , ath10k@lists.infradead.org, ath11k@lists.infradead.org, iommu@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Lu Baolu Subject: [PATCH v3 03/21] vfio/type1: Use iommu_paging_domain_alloc() Date: Mon, 10 Jun 2024 16:55:37 +0800 Message-Id: <20240610085555.88197-4-baolu.lu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610085555.88197-1-baolu.lu@linux.intel.com> References: <20240610085555.88197-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_paging_domain_alloc(). Signed-off-by: Lu Baolu --- drivers/vfio/vfio_iommu_type1.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 3a0218171cfa..0960699e7554 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -2135,7 +2135,7 @@ static int vfio_iommu_domain_alloc(struct device *dev, void *data) { struct iommu_domain **domain = data; - *domain = iommu_domain_alloc(dev->bus); + *domain = iommu_paging_domain_alloc(dev); return 1; /* Don't iterate */ } @@ -2192,11 +2192,12 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, * us a representative device for the IOMMU API call. We don't actually * want to iterate beyond the first device (if any). */ - ret = -EIO; iommu_group_for_each_dev(iommu_group, &domain->domain, vfio_iommu_domain_alloc); - if (!domain->domain) + if (IS_ERR(domain->domain)) { + ret = PTR_ERR(domain->domain); goto out_free_domain; + } if (iommu->nesting) { ret = iommu_enable_nesting(domain->domain); -- 2.34.1