Message ID | 20240911205939.85317-6-witu@nvidia.com |
---|---|
State | New |
Headers | show
Return-Path: <kernel-team-bounces@lists.ubuntu.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X3tJ30Tqfz1y28 for <incoming@patchwork.ozlabs.org>; Thu, 12 Sep 2024 07:00:19 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from <kernel-team-bounces@lists.ubuntu.com>) id 1soURe-0002su-PW; Wed, 11 Sep 2024 21:00:10 +0000 Received: from mail-bn7nam10on2070.outbound.protection.outlook.com ([40.107.92.70] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from <witu@nvidia.com>) id 1soURa-0002mQ-JR for kernel-team@lists.ubuntu.com; Wed, 11 Sep 2024 21:00:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NMWgBBf/Zr9DrUwFu+srYTMQXzuM6k6odBbh+3ECDHUdjvUZR8OP5inDMIgbijyx8m8weCJhFTpBQptWUlt4X3jC+kir9JmXN+2nddEbJEq0qyTGveXPQlj9fnrbJXSDt9oWGkOoVSaLxgd1mQxcVKfh/QI8GHf4OpEfiGri06C1kgm5q5CIgnI5U6S/vZvZLV/MSbm8nv7Qlq2LSaQFt+hPBLI5bL8ajf2Tzjx1IZpGFIFVSMD59C5mohnFUXiD6VNOgiLPxp7/XcArMbJRxhH3MWB5voZjk59m57aWZAP0GoCUbtBbzJVr477phAZi/MThp0MKcVbDxwCHPpjXKA== 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=yFC3xmVz1MIRSlx5zQS5CondPztMnj/Qz8Vzpzk8Fqo=; b=DX1YCtN/MkgaBgAlRSrBc3t79qlWpUjzXGXeSG+ip43gP8Z2YC6B0/og5hQLjtvVQXYmDj1sMGuWKE+/73ZaSSfFtxCBvTIdxISuQoasFaEJh3FV2VQnL8wQW8sfHH+Izl+APG71wXH9FYARfi4oqxFxjcNUx6R+W7W0q66A3DIklfDxx+zXSoKeoKlBEENidy4bgwTo8cL9RjnefUnLGkfM9VlsVnUxW4ymnl4W/zt8kREtH5etCVsZ4234t4hMJjDlHHu7Q5kG0v08nC63J5IiEL4SG1BzGdBYOaWlUMzQN4LWj7RT3GfN4ZqrU8k/KKHj1V7vQJ+UljzLUyW/+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=lists.ubuntu.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) Received: from BN0PR07CA0015.namprd07.prod.outlook.com (2603:10b6:408:141::30) by CY8PR12MB7514.namprd12.prod.outlook.com (2603:10b6:930:92::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Wed, 11 Sep 2024 21:00:00 +0000 Received: from BN1PEPF00006001.namprd05.prod.outlook.com (2603:10b6:408:141:cafe::af) by BN0PR07CA0015.outlook.office365.com (2603:10b6:408:141::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.25 via Frontend Transport; Wed, 11 Sep 2024 20:59:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by BN1PEPF00006001.mail.protection.outlook.com (10.167.243.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Wed, 11 Sep 2024 20:59:59 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 11 Sep 2024 13:59:49 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 11 Sep 2024 13:59:48 -0700 Received: from vdi.nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 11 Sep 2024 13:59:48 -0700 From: William Tu <witu@nvidia.com> To: <kernel-team@lists.ubuntu.com> Subject: [SRU][J:linux-bluefield][PATCH v4 5/6] UBUNTU: SAUCE: vfio/pci: Fix p2p address Date: Wed, 11 Sep 2024 20:59:38 +0000 Message-ID: <20240911205939.85317-6-witu@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240911205939.85317-1-witu@nvidia.com> References: <20240911205939.85317-1-witu@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00006001:EE_|CY8PR12MB7514:EE_ X-MS-Office365-Filtering-Correlation-Id: 850e9aeb-6b9c-4c44-d9cf-08dcd2a4b2ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: jmkdxQZZKgScQLY1XkxK4KZZj+JjsupPpb05jY9hfGeiOrGoNG3hIAR/hCNGiHhT11gK65o/IyKBfx4iUidFvjolUeUuV8RYQihlyx4JJJPCEfITS6BbtvnqORG5S7KblgrqpBMXgEJcqWVCs1Jj2e+hWKH6X7vCVDFVf9aAPloz5YL1zlb8sGaybcMOEN1juku1unPcKzzV1GOSEcgVZw5gq1UuaS2agANKJ4H6BQIiZdUvgLjpgxCEN4+FswP/RplGZjYzqw3oEwuJmD91GDzhdCg3pB0ck3tjNaKNMAcZjEzcnRfyW6/BLIGkfQqzIafeYbeaVNVYHMnuPKF/bmIvblyY82mLXzpB4OjhjaXdDwhJfM7WTjpkG3/dZkPiUYL7KlOeH3Mvbj692F6X7CSjGlctSUye88gddy47G25BsWDz3/Xx/U0dgJzqI/yeZuNISaJb+tYPSiUzoGwX8n5wio0BcYLSvTA7XvFIX5lNlYpXlUxG1NT3bgQpnrW47B55QLePLoA+M49HWCMrTEmIsROFFMxchqtCOmK2NyzOjjnK/uHBpLnKLXUrWyNuCHrTc3FHyQy1T2LbzKhWcQff51DP5l5FsXFLiXV3m0PDtIXfVVHdrlWSd8FOJD7iQcwbua1j+IS4hlPuMiC8O5SSUaWQslDpje+BJXVgDV5UBYAozrhlTDUP0YOPHEXjkCf9QVDMTuBHzFlnCNuFPpbEDF+yaK6sa7ib+Ci6hDU+U7vfR5f+gFQ5WP558mhgUwyNgCSkZogKfbU4jV/m/syGlsPDbpJrmf2MpQkL6pD481VwDrm2ctRnCPaadRv1a5RsAko6rzmr1e75lFhADztKxGl+vTnk30E979njZEU5Wg09sGyaFIiwN0FoZ0s/FVK7UZ7y8BuVgrqj4r6J5KtwBUvh628XS8Yg557npMm2m/pm/90U/uY9zIjHBDtkV3GDEw+QHGcCEHpounhC1dmxx4C0FeH541yLFqEbR0jJ9dnjifq6OIx3VhWM78zb/pmNc15sc2XDjW/K6QeYd+kdApHY0rl35HLsJZ2em7TOQQgjyNOVM8IlJes9neOV825CgSu/B9qotK+glNkCnYplVCtIOGaHWpQuxf7N0bJdD1o85kooyBiIl1icDk4DnhpAHPu6vO/ENRmAOCSXXLAl9fiMiWCEN0p7H9IagSql+AGTU6hPWfAiNmDLv0NI9+TwsU+WovgQYc9eWBScOdALDFXl484xgoTw3FPKkK9TNdD2jZmCbbGz4isN2xDqZHxoEf5+V2rfGaEfun74YO832Kfmg3+t5UFC4YmRcQPTUj2sgGyXZyhAGDk8PzvBynismE9TTeKvfdtDXClf4E8mzr/hiVS9jTvnYcpzprwp09F96We5cStwQuaBPbSjgEvROy0fpOCmcXrlJIM12fUB8ukKbF7SkLLdlzaD4srjkZ6uRx8GXx3PhwhxCy7e X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2024 20:59:59.6360 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 850e9aeb-6b9c-4c44-d9cf-08dcd2a4b2ee X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00006001.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7514 Received-SPF: softfail client-ip=40.107.92.70; envelope-from=witu@nvidia.com; helo=NAM10-BN7-obe.outbound.protection.outlook.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions <kernel-team.lists.ubuntu.com> List-Unsubscribe: <https://lists.ubuntu.com/mailman/options/kernel-team>, <mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe> List-Archive: <https://lists.ubuntu.com/archives/kernel-team> List-Post: <mailto:kernel-team@lists.ubuntu.com> List-Help: <mailto:kernel-team-request@lists.ubuntu.com?subject=help> List-Subscribe: <https://lists.ubuntu.com/mailman/listinfo/kernel-team>, <mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe> Cc: vlad@nvidia.com, bodong@nvidia.com, sergeygo@nvidia.com, jgg@nvidia.com, zwaksman@nvidia.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" <kernel-team-bounces@lists.ubuntu.com> |
Series |
Add VFIO P2P support
|
expand
|
diff --git a/drivers/vfio/pci/dma_buf.c b/drivers/vfio/pci/dma_buf.c index 14d32a580190..58fd3db9c249 100644 --- a/drivers/vfio/pci/dma_buf.c +++ b/drivers/vfio/pci/dma_buf.c @@ -4,6 +4,9 @@ #include <linux/dma-buf.h> #include <linux/pci-p2pdma.h> #include <linux/dma-resv.h> +#include <linux/module.h> +#include <uapi/linux/vfio.h> +#include <linux/vfio_pci_core.h> #include "vfio_pci_priv.h" @@ -81,7 +84,7 @@ vfio_pci_dma_buf_map(struct dma_buf_attachment *attachment, */ dma_addr = dma_map_resource( attachment->dev, - pci_resource_start(priv->vdev->pdev, priv->index) + + pci_bus_address(priv->vdev->pdev, priv->index) + priv->offset, priv->dmabuf->size, dir, DMA_ATTR_SKIP_CPU_SYNC); ret = dma_mapping_error(attachment->dev, dma_addr);