Message ID | 20240923223522.1203691-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 4XCHrt4p6bz1xsx for <incoming@patchwork.ozlabs.org>; Tue, 24 Sep 2024 08:35:58 +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 1ssren-0006xI-Qs; Mon, 23 Sep 2024 22:35:49 +0000 Received: from mail-dm6nam12on2085.outbound.protection.outlook.com ([40.107.243.85] helo=NAM12-DM6-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 1ssrel-0006v9-UA for kernel-team@lists.ubuntu.com; Mon, 23 Sep 2024 22:35:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c2zet4pp4pX0P5Yyzs9NMZQ1aBu29fnr/ubFFiYlZDG4FSBjej1ioeq7LucVRsrzGy6Xmyhe45yZEvoLOM4V8m3xRrn8WKwE3qwE9qJCnwDyF7RpLlijQ4l9jtNGMrg+/vLlzlPqKdVaHs5rHjgk5cd8iVSmPHY0KCLrd8+MSjVjiGjc8+kICHFHv0+irHFms8F5puAoTnYKSI/kqXnaGZhW/esYlJp/1lYL4tfA2xMj1AjPbvX3BUM1othnqv/J+G+C+4FaE0Vwr/xNsmemzWufTmoOop4qI6gsknUlMgufbp/iuFJ11WpXiAMF29QI/TCRBHqlRCp62iZ0nterRQ== 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=aW1nVwYFMNXes2J53gKEwAyZKi0rWN+6LR/FA4L2nRiBwEh8ATiowMcDS2OO2yzV1JWE8Uxz8XZsiriO7nE2OipBefVwnJihvhlHpT0i9AAhD8FBBZ6xyKR8YUtM+qIWvL07wGJv1jLZJDnZzS5tl7bpFJlbQTZm0+GuBrqNB9HDdMBHc/VHrl6dTCOZrqr4RNAD37JTo/4kSHWjbrEdCtGFJV8i7g1/gKQZ+PBAYcGPZOdXDLLSB82cqYvhWa5HsEBaDggFOlWXC1NJxV/6GKZ2MOkzU7ZAeS9Mn25pZ5WLMejR7Cum40oGiLchmXXR6fGP4f9XzmkZbmy2bVlT2g== 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 SA1P222CA0196.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c4::23) by MN2PR12MB4142.namprd12.prod.outlook.com (2603:10b6:208:1dd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.25; Mon, 23 Sep 2024 22:35:43 +0000 Received: from SA2PEPF00003F66.namprd04.prod.outlook.com (2603:10b6:806:3c4:cafe::2b) by SA1P222CA0196.outlook.office365.com (2603:10b6:806:3c4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.30 via Frontend Transport; Mon, 23 Sep 2024 22:35:43 +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 SA2PEPF00003F66.mail.protection.outlook.com (10.167.248.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Mon, 23 Sep 2024 22:35:43 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) 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; Mon, 23 Sep 2024 15:35:32 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 23 Sep 2024 15:35:31 -0700 Received: from vdi.nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 23 Sep 2024 15:35:31 -0700 From: William Tu <witu@nvidia.com> To: <kernel-team@lists.ubuntu.com> Subject: [SRU][J:linux-bluefield][PATCH v6 5/6] UBUNTU: SAUCE: vfio/pci: Fix p2p address Date: Mon, 23 Sep 2024 22:35:21 +0000 Message-ID: <20240923223522.1203691-6-witu@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240923223522.1203691-1-witu@nvidia.com> References: <20240923223522.1203691-1-witu@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00003F66:EE_|MN2PR12MB4142:EE_ X-MS-Office365-Filtering-Correlation-Id: f932771d-8ba4-4ff5-8dad-08dcdc200f55 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: Jf2m+xY9J5aGvupR/Sxfwmhe+j1WsL+Z/WUdy9Z0hUaXDajZuVM/HyCg3ibwsNO8OCyyj8ebMnns/juxQ5nHJsoKbOMfrb+ln7YzH6a+ehIZsN95RmCc/o2zEef+sInPMsGVQq2kN5xWCZ5M8sjv85qkxRMk/e6mlnHgCugvYGq15TWAd+SErzZzjStb6KiAXFnHG1r23Fiw9HbKx02PNEBC5K6nQSUHc7z+1Nv7mT8QL5j/RgEjptN8mA8iObcJUr2MaMMZ9E/Yqy6FPJ1t/5rEPOYYfXrRNIRVs1rM9bYo9D47GjqYvnq1IQ8cGdzGxJjRp7llI0u/4ENwWUTL+QrD/7P/Y9V5MsYFCQ/cMLi5w6sQD8CFB6TZGUhkJQ5tzGjh4Q06E8mQsvJwGtzkUtZEnehoYM1J58pJQPWWaDdUV9EAE0A1u0w2aLhOTn1/YkOWLHnB8AO8F0DGsUgKD0lG1ePAnP2Y7giwTg4lQC+URqAxgD3UMUq53x/jxTovWcA+3WLpBMZZNZvgeOnbz3bOYE6DGhJceu+mRoUfsMyOu6O1bythnM1pC4kcNTjJEHoCl7ucgGB1UrtlGnTUptLHWhV19oTVoloh+ku1c162tdeVLSRwCFhpkIaeVcaTRHsUB1+AIxk16pFifxFIrhD4Y7FMmwvfsToKmLemm8g28ebUuZxc1XIeAYrQL+rzKJkgXQrx9HSBICxOZggmj3765cht1FKX9RDODTxLEi5GldPo7N+RO5tp3gFXMA6Nk+rUvHopRspCNM+zJ1wj06unzoJw7eVSjUYVdy8heLBSiI8outWolnH3nQJfIpOY7xCCV2x8jyA0Ad0bG85sWMOyeS9ZYWMk5E6RnRPRY2gFSey1aih1LXnUzfE2Qo9TbfffUpDGc6J2264ItH0W24o8qeEQTyNwb36MGwJLtHUT+a3TKTN7TR8itbHKXSXMQ6IbDuc/1ms9LxCFwyf8lUwFpBCj62gXW9LxxJikFvLINN9i0X9GCdb4c/man1JCNa/l/VUgQvW8ydMC2uRR07n69vZaK7Dmqyb83K6BD0EhazUo38tBO7eCamc5L+TcJH8DMx79/OfXdVd6EfHUf4Yymws86VfMj9Hvt0cLd9Ev7leoHQdwdMYE51HIjV3QIMSOnDBHWahqx3vBe1EAS9R/zYsNd4X9uKSYmWT8bDmBY770kMdtKxZh0Sz4Msrwq1JyZ2eKtU9lP+dwzBXAoBLDoD7TMVFCG48y2Wf5Kf8f+S+mNUn0lRLwPwZajQpqT6UgMa9AOavENGGrJ0HBWEe0DsxrKbI6n48c0oYYkPE15sXEArAvflOWvFKracrtHDi+YLGrcDLksN7iBO9OI8WL7o5Mg2juTM+D45U6LWQ0uRoY5BdGaiesd02awUsgIVGm0hlo8GGQqs+N+li153OATHZ7K9waMbhCnY/WGzKP6fddSTjUPTo9+BqoTckb 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)(82310400026)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2024 22:35:43.2847 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f932771d-8ba4-4ff5-8dad-08dcdc200f55 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: SA2PEPF00003F66.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4142 Received-SPF: softfail client-ip=40.107.243.85; envelope-from=witu@nvidia.com; helo=NAM12-DM6-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);