Message ID | a15812f3a4beb7ae4b9a04538298128bcc42e4f2.1729555967.git.nicolinc@nvidia.com (mailing list archive) |
---|---|
State | New |
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 E361DD1714F for <linux-arm-kernel@archiver.kernel.org>; Tue, 22 Oct 2024 00:45:09 +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=EwJx/BRKIugP0909wpkxhc1D5mIIylULj6NO49deMv8=; b=J+xSMywfbGDnMd6eJArQItTmcH lPTe+at9FL57LFvzEZnC+bElTNYytIPWAcbTISYXYl7rHre094YRDaI0/PZfToee84WnSo0dgllHn AJUV6QN3UtoU8qPHQluiYhsBXI86Of7D4PA5WZ+otcGv/2S90u2/pmHQNGTkUeYge0MB22SnCJo5o dmCDydabez5o+pPTUIB99tMNeXi8a4ouKv3OjMSM6pbL+vhYrESN7e+L5ZWSx1hCZZ5YUwAjCUrJK 291UN5qgrW2SY7m+EpgwdHzsliYwEbw0NTYQvDVMKcBch9sqISQWBXSfyg/zdkn4CxOS2TSyJ5R1b EqeUmbtg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3317-000000096d2-2Yiy; Tue, 22 Oct 2024 00:44:57 +0000 Received: from mail-bn7nam10on2062c.outbound.protection.outlook.com ([2a01:111:f403:2009::62c] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t32ds-000000092SQ-3gVF for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 00:20:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Zyu/pfh25Y4umLO4+JDt80zUeuzwqEH/GX2cNdrlo3tp0zDeWgWtyXcDpkug8uIkI7ypfb8ubsWouNgm66qZLTjX7DbFnQbIYObXmfN+5nGjl1NwG5ld+6Eh05lRmCPnSrcpIZR/Vx66n5edMSUo/ciVcT4i/qB/KnIAVdtsZ1Qe8Lp9Ck/Wr5fHrrvKvIOrYuxUlspB3UND28IA2I1M1HWVvyV2whVsdyz5FpygKpX/hBRe+dLeewsYL/sE/GYaA6CFv8fPlreT3kgyGKxnA5BOoL38erQHY6pl6VtdCGKaXM2zYVDGGwwsbb7/bHpkNlR3WkyCRUvxj9CIU/KytA== 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=EwJx/BRKIugP0909wpkxhc1D5mIIylULj6NO49deMv8=; b=yzsQcABHFzNjfjpNSSSf4Qs6h6DVVstrucUa4stU5RG2RW8n4gAbNpQM20OEzNNU4x9Y4H/PXRoX3qQdg8/NbCztc8ssD3cR1N03Wljmpx1hJ6MT+Z8aODjrpMoTEJXuO5+Zk/DVKJ9Oy7yfJl8CVIjVQrF0bwmFf6vsG6xP9z3hcUzLQXd/cNx9YStr2h5Laby+Ojqk2H5z827Ydz2ii6Ko0uJT27zhyQ4hIx9U9QfAd+2i0qZt1kkemAxvwmwHgMJwJP+vcw/aokP0jkuu8NWba7A66ir8nLTRtM6TaIAc2VZeufeUBlGPT/w/DsHk0yN9zLshsDJqkJa4kJhAXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=amd.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=EwJx/BRKIugP0909wpkxhc1D5mIIylULj6NO49deMv8=; b=FDEcprWgMgJJ8lxL+Tg3Z5ZkfR6lAucEXJT0VWr9Zu/2gphsit5jHobpr9Y8IDmr4N9oLlYs/K8weVXJxNtUonV+1xe+WWFrC18XDTj2ZbDigdkwnkr+NMVTRq1Q4+A8iVmjXyjNahgGCDslneDDSHiIty1ZfTC1UKejc5Od4+F4wX3LUnZGdZkB1vbJ/35QkhZ39TvO7r+raBV3suiInRnUcwzTdkWc869MG+hrGGEYnzYC/EhPxJBhcxVmoscPrm8I26t6a7gpisAc2tt3/GLSf8qKitQQaEtbv+ajAQVz0fTYFbR96T4HnnyKq5CpvZerkq3hmu7QIfroW4miPw== Received: from BL1P222CA0004.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:2c7::9) by SN7PR12MB7836.namprd12.prod.outlook.com (2603:10b6:806:34e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Tue, 22 Oct 2024 00:20:50 +0000 Received: from BL02EPF0001A101.namprd05.prod.outlook.com (2603:10b6:208:2c7:cafe::9c) by BL1P222CA0004.outlook.office365.com (2603:10b6:208:2c7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Tue, 22 Oct 2024 00:20:49 +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 BL02EPF0001A101.mail.protection.outlook.com (10.167.241.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Tue, 22 Oct 2024 00:20:49 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) 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; Mon, 21 Oct 2024 17:20:33 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 21 Oct 2024 17:20:33 -0700 Received: from Asurada-Nvidia.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 21 Oct 2024 17:20:32 -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>, <eric.auger@redhat.com>, <jean-philippe@linaro.org>, <mdf@kernel.org>, <mshavit@google.com>, <shameerali.kolothum.thodi@huawei.com>, <smostafa@google.com>, <yi.l.liu@intel.com>, <aik@amd.com>, <zhangfei.gao@linaro.org>, <patches@lists.linux.dev> Subject: [PATCH v4 04/14] iommu/viommu: Add cache_invalidate to iommufd_viommu_ops Date: Mon, 21 Oct 2024 17:20:13 -0700 Message-ID: <a15812f3a4beb7ae4b9a04538298128bcc42e4f2.1729555967.git.nicolinc@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <cover.1729555967.git.nicolinc@nvidia.com> References: <cover.1729555967.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: BL02EPF0001A101:EE_|SN7PR12MB7836:EE_ X-MS-Office365-Filtering-Correlation-Id: 12973697-3588-41c1-3f97-08dcf22f61c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|7416014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: cEAcHqlbAeFURTt0faU58GpjP2aK7FwQI7UuHmNDPVbD1Tgpk9Cai4v2L5avT6AJeH/PSmkGezm012ET3A0dxEdileMNoLLJj9RWRxOLgCo0nnER+KY6bHtOEbwCeCVOnXyFDfa+w6PrNNoziXWsnZs6m6zbWgHjv9BVMVQEnA9kbm76RlTgxWYrf1BkPS8ppdz7HupkfMjT+S4DqMQwLXx0SplxCek8qRlXCgdAdinvz3xFsqhH6MEqS4l+ba/lYFQF3hJ+8ui3lwhUqv1h9pvfowqcEaZ5T3SRft3Z7I+BSgB4FCzTbUN3aPTdOmKWnz/rz2yJzmU/Mo217FbIfQ1aeVlaCLAB23kW079XSW9ZgLcIFygBfLZ9Yyl1nxQ8GDLRE+UybZyd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:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(7416014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 00:20:49.5503 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12973697-3588-41c1-3f97-08dcf22f61c6 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: BL02EPF0001A101.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7836 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_172057_013587_F7E8E60E X-CRM114-Status: GOOD ( 11.95 ) 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-2: vDEVICE)
|
expand
|
diff --git a/include/linux/iommufd.h b/include/linux/iommufd.h index 821816e3b1fd..559f274a26ea 100644 --- a/include/linux/iommufd.h +++ b/include/linux/iommufd.h @@ -15,6 +15,7 @@ struct device; struct file; struct iommu_group; struct iommu_user_data; +struct iommu_user_data_array; struct iommufd_access; struct iommufd_ctx; struct iommufd_device; @@ -121,6 +122,13 @@ struct iommufd_vdevice { * @vdevice_free: Free a driver-managed iommufd_vdevice to de-init its structure * or HW procedure. The memory of the vdevice will be free-ed by * iommufd core. + * @cache_invalidate: Flush hardware cache used by a vIOMMU. It can be used for + * any IOMMU hardware specific cache: TLB and device cache. + * The @array passes in the cache invalidation requests, in + * form of a driver data structure. A driver must update the + * array->entry_num to report the number of handled requests. + * The data structure of the array entry must be defined in + * include/uapi/linux/iommufd.h */ struct iommufd_viommu_ops { void (*free)(struct iommufd_viommu *viommu); @@ -130,6 +138,8 @@ struct iommufd_viommu_ops { struct iommufd_vdevice *(*vdevice_alloc)(struct iommufd_viommu *viommu, struct device *dev, u64 id); void (*vdevice_free)(struct iommufd_vdevice *vdev); + int (*cache_invalidate)(struct iommufd_viommu *viommu, + struct iommu_user_data_array *array); }; #if IS_ENABLED(CONFIG_IOMMUFD)