Message ID | eae828f3190b89d0a1026ae9e97747210cf96bbc.1723061378.git.nicolinc@nvidia.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56345C52D6F for <linux-arm-kernel@archiver.kernel.org>; Wed, 7 Aug 2024 20:16:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TLRuaC84Ka4PZPe9pc/TLQKq1Vc4xsd2IGKYVfwh890=; b=Jd+aInKtnS/HaMZT485sAZTBmY JqBmnoGT/YdN5wUvmii5ZRwtqrbSvvUVAQGDTu2uWX6nKVkkkl65jvHGQ8MJCYUE/9nOwqnxyIium fjT8k8viiPZ+I/VyYmUkuLmZUIqP6SB+FTlyuLa3Nszfk8vXCId9y+l5bhBM1XLfKxcDAZwlxS1s0 lPUWhBfosRgLSy5EYH21AhY5bwbNApkVhOH2uJBvdUvqIGArm0Hm7HLW4zx8exR+w/4hc3oKosn33 tzeX8Og2LUDVv+NRNrCz/DJ9NuRmbFPxMvA6xkgrXKeuLhydaW/nHPhMBbB2EfniiyWBev4LjWE/w 0kEqmdMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbn5R-00000006B1d-0QmF; Wed, 07 Aug 2024 20:16:45 +0000 Received: from mail-dm3nam02on20601.outbound.protection.outlook.com ([2a01:111:f403:2405::601] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbn0W-000000069Es-2aYG for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2024 20:11:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZTZQ+fSrteauweUHoWhHb8HgD0W2VSAb3GPiiBq4rab7gGI5CPF97FNH5BcMDNPKI86B5qFADWncwr5mRxRbLKcvRip5yPR+mAhB0M6xdZ//2B5cE1EiN9pisD0OMdKigrRT01n0vs5x2LKUm1gca8XTQzEw17N0jwBzjgUu+SVNsxbZM0v/5KAt/zpL9obd2LeQMGtZfrvnkwSupkObqhX7cDuBTaIieJhmy5m9cHE6eki21pkJcgD09aDDXS783u7wQgaMuqZZ/tJWNvSg9appQxwFI6lNuNJdz6axZm0ZTE0FH8OndXnInnGLRzogSOgtWj0TNxN2k3/XwWQzmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TLRuaC84Ka4PZPe9pc/TLQKq1Vc4xsd2IGKYVfwh890=; b=kxUyLkflVva6xDSxd/7hfdskOTLyW3di/EPeIs8a1JQ+CMl4d/NzUvXMzHL7gDKwfdELNTYbkjDSl25LGulQS8zBJChePXO9Ld9qG3mbSztPM6lHnd/+znwfsPxrMDxGUxYQZhUKkw/uosigJbL5cOKh+AtLi0g7ueKGSChmIZEX2D/GBYrTC8Grv8pM2jJovi/WIONTYBKQbxPa7Ts75OZWY+szFHN/cIEVdgaibmTwVQJ2lGYdwYXJZXObigdXNTMQZNwcoT7nCRgIvQLNOxc7sz6eQiWhNzHFy1MntirO+g7ol1AYZOO1s4JZJUN6+lccyCzm01Y3VGeGl0fh4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TLRuaC84Ka4PZPe9pc/TLQKq1Vc4xsd2IGKYVfwh890=; b=maYo0tmRU2jRbKA4Shey5aTsovZwOGnICa3KUZ8WIH2VrA3yaI7Cj4rgxkxDZggRMM9f5svJ1Ld73zCJF5NLLmwH/7kq9P8iHohrPVeVgO1xbQUslvj9tWkKab9mS47DR+kV8E20WV9/9dF3RLZousShsOV7zhsMubnB7bmReIU/rcZnBYcHQbkP0sm02PjohErKtcT1RzYaFkSCZZs88Fp8AIwyQ2tBeZw/4Vby0kI6rkC1evdbDjgLr/C7lh8eqpaEr0arJvnaOO7GawoimvHyNbkMjCf1vAOVW0EQw14GCb95hITrA48ydy91qiyzB/4gmdpVfncEzT6f3CH5ow== Received: from CH5P223CA0010.NAMP223.PROD.OUTLOOK.COM (2603:10b6:610:1f3::11) by CY8PR12MB7731.namprd12.prod.outlook.com (2603:10b6:930:86::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27; Wed, 7 Aug 2024 20:11:35 +0000 Received: from CH2PEPF0000009F.namprd02.prod.outlook.com (2603:10b6:610:1f3:cafe::ff) by CH5P223CA0010.outlook.office365.com (2603:10b6:610:1f3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.14 via Frontend Transport; Wed, 7 Aug 2024 20:11:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CH2PEPF0000009F.mail.protection.outlook.com (10.167.244.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Wed, 7 Aug 2024 20:11:34 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 7 Aug 2024 13:11:18 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 7 Aug 2024 13:11:17 -0700 Received: from Asurada-Nvidia.nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 7 Aug 2024 13:11:16 -0700 From: Nicolin Chen <nicolinc@nvidia.com> To: <jgg@nvidia.com>, <kevin.tian@intel.com>, <will@kernel.org> CC: <joro@8bytes.org>, <suravee.suthikulpanit@amd.com>, <robin.murphy@arm.com>, <dwmw2@infradead.org>, <baolu.lu@linux.intel.com>, <shuah@kernel.org>, <linux-kernel@vger.kernel.org>, <iommu@lists.linux.dev>, <linux-arm-kernel@lists.infradead.org>, <linux-kselftest@vger.kernel.org> Subject: [PATCH v1 09/16] iommufd/viommu: Make iommufd_viommu_find_device a public API Date: Wed, 7 Aug 2024 13:10:50 -0700 Message-ID: <eae828f3190b89d0a1026ae9e97747210cf96bbc.1723061378.git.nicolinc@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <cover.1723061377.git.nicolinc@nvidia.com> References: <cover.1723061377.git.nicolinc@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000009F:EE_|CY8PR12MB7731:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c8d0108-e3f3-4da5-ac27-08dcb71d22d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|7416014|82310400026; X-Microsoft-Antispam-Message-Info: 4VcmKDVCswUZFBFqX8+RMqE5Sl22XDjaZmhxW4XuzDZBPwkTRh7QM5EyG9iA6Rd2XeCNWU/wm18e7rhIRZZcCtFf83YD2ngeYSHRkHI19Wotd6lc9GRNbYTh4LO2iPR+2PZ+r1IF/lXfhJvFhLcBqqiaqeSN3R6I49XzGJvmVrVn/kf4go4LYhk9UwgbX1u7rBTmdkC2tQjWj8WRfFszeDdj4NeOtIoDL7zN6gdJZ77qjmEUm/Fqx7cwIjULtELDoKJWxpI07Q4iwc/hmdN5uq68vgo6aKv4YxvKLudCo2AJ4nBX36NwPmLdogNNgRrx9tCV0sFQz5jrxSoVplLpDASAi9Wbl/LEGqBTxNu1DnXUL2seiLzJ4Gzav+9DVQNz/LzK6JUgpIeRM4D97EkbYURvhI/yV/l0Bddx7U9xBtaDOvhs5CnxMpS68cgNdT2eVSrkUtfJnahkjAgdPIaJmjhvkosiIPIIARWRkNRfIgqr6M7dIOtt+sjYZSP0SvMHJVcUhD4sG9dtINz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040)(1800799024)(36860700013)(376014)(7416014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2024 20:11:34.4240 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c8d0108-e3f3-4da5-ac27-08dcb71d22d0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000009F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7731 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240807_131140_829182_85BC24F3 X-CRM114-Status: GOOD ( 14.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
iommufd: Add VIOMMU infrastructure (Part-1)
|
expand
|
diff --git a/drivers/iommu/iommufd/viommu.c b/drivers/iommu/iommufd/viommu.c index ada9f968b9f6..2304f199b033 100644 --- a/drivers/iommu/iommufd/viommu.c +++ b/drivers/iommu/iommufd/viommu.c @@ -148,7 +148,7 @@ int iommufd_viommu_set_vdev_id(struct iommufd_ucmd *ucmd) return rc; } -static struct device * +struct device * iommufd_viommu_find_device(struct iommufd_viommu *viommu, u64 id) { struct iommufd_vdev_id *vdev_id; diff --git a/include/linux/iommufd.h b/include/linux/iommufd.h index 7da5140fa1b0..e0d7a53acbd5 100644 --- a/include/linux/iommufd.h +++ b/include/linux/iommufd.h @@ -89,6 +89,8 @@ int iommufd_access_rw(struct iommufd_access *access, unsigned long iova, int iommufd_vfio_compat_ioas_get_id(struct iommufd_ctx *ictx, u32 *out_ioas_id); int iommufd_vfio_compat_ioas_create(struct iommufd_ctx *ictx); int iommufd_vfio_compat_set_no_iommu(struct iommufd_ctx *ictx); +struct device * +iommufd_viommu_find_device(struct iommufd_viommu *viommu, u64 id); #else /* !CONFIG_IOMMUFD */ static inline struct iommufd_ctx *iommufd_ctx_from_file(struct file *file) { @@ -129,5 +131,11 @@ static inline int iommufd_vfio_compat_set_no_iommu(struct iommufd_ctx *ictx) { return -EOPNOTSUPP; } + +static inline struct device * +iommufd_viommu_find_device(struct iommufd_viommu *viommu, u64 id) +{ + return NULL; +} #endif /* CONFIG_IOMMUFD */ #endif
Now, an IOMMU driver can use viommu to invalidate a device cache via the viommu_cache_invalidate op. Very likely, this would require the driver to lookup a virtual device ID for a physical device (or just its ID). Since the core already has a helper, make it public. Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> --- drivers/iommu/iommufd/viommu.c | 2 +- include/linux/iommufd.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-)