Message ID | 20240916153057.17319-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 4X6pmY4JwBz1y1g for <incoming@patchwork.ozlabs.org>; Tue, 17 Sep 2024 01:31:41 +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 1sqDhN-0003Mn-Kz; Mon, 16 Sep 2024 15:31:33 +0000 Received: from mail-bn8nam12on2064.outbound.protection.outlook.com ([40.107.237.64] helo=NAM12-BN8-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 1sqDhJ-0003JR-BN for kernel-team@lists.ubuntu.com; Mon, 16 Sep 2024 15:31:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dlCR/pedPCnwP5S02FfEYCNg6FmE3QrodtY1ZFQmb9YK1rrES9ozCj+P9OkEh2dLseB+ZEX9a1/TA6lmrFVLmLcKckutgLiECEMI1OdohcC4AEf0daz1bVUVc567WN2uRx5O++fUQ3GEqKQ3tIFpqLwDOluJ2o+9ZX8cRo1970/kSplZEQuPQZEQkQRy/YoGBZVRrVXe9IgIz2VizWCpdTbaQtTL7XaWggIRWIVQYgklqJt+hKNQ09+zMxDra0WpCJTWkwoUryWYSpVhdRqoXqYeVjVmLIeb1zmZqYjxIrPmQPqwsxbP5ACZKEYem63Lr7f9Lsvj2d1PcY8aIk308Q== 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=t+wyHFkohU4NCqZB8EbywcG3erYPj4ZxazIHsHV4wtXeeBJGvGaYz/K0aER+LUagnpNBb+6urSq75kinHKEygDA54h3VS9MHvEPsP2Q5e1230n4MuOlPMwMUwi3x7ZEEuUK4ZMprVu52zgLCi/+eO25i1ceVf10MVnjQO9jscdRqhiNAC0SGnXCZ4Jo1zUmBvXKHd5ib/F5uE7QGUlvvoblPIqUxQXMtC69Q+5HgXpBu2t2yOdtQz5ukqVe4T/QzYo4kjEIfKDprLN12e56DqiJ0o/PiEMWt1sJS4HRVLGQEqvYH6kH2d8/EsQqv6JpgQkEH4diFqC2V/LUzJsR/XA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 CH0PR03CA0287.namprd03.prod.outlook.com (2603:10b6:610:e6::22) by MN2PR12MB4287.namprd12.prod.outlook.com (2603:10b6:208:1dd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.23; Mon, 16 Sep 2024 15:31:24 +0000 Received: from CH1PEPF0000AD78.namprd04.prod.outlook.com (2603:10b6:610:e6:cafe::c1) by CH0PR03CA0287.outlook.office365.com (2603:10b6:610:e6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Mon, 16 Sep 2024 15:31:24 +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 CH1PEPF0000AD78.mail.protection.outlook.com (10.167.244.56) 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, 16 Sep 2024 15:31:23 +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, 16 Sep 2024 08:31:08 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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, 16 Sep 2024 08:31:07 -0700 Received: from vdi.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; Mon, 16 Sep 2024 08:31:06 -0700 From: William Tu <witu@nvidia.com> To: <kernel-team@lists.ubuntu.com> Subject: [SRU][J:linux-bluefield][PATCH v5 5/6] UBUNTU: SAUCE: vfio/pci: Fix p2p address Date: Mon, 16 Sep 2024 15:30:56 +0000 Message-ID: <20240916153057.17319-6-witu@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240916153057.17319-1-witu@nvidia.com> References: <20240916153057.17319-1-witu@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD78:EE_|MN2PR12MB4287:EE_ X-MS-Office365-Filtering-Correlation-Id: 0104aec9-0b4f-40c3-ef54-08dcd6649f83 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: SHNAklDjyUiVdXCeqkqg6o2gkkstQhFxuAPTSUYHcrdGp36O2n5D4Fu4ShBJR70b2RrQRs7TOROOLAiReM3FDCsLe98mcf63ccHY7dCWUWD9O8FmuZfsRV/bfNHD9/xWBsPzk9QsuZORiyifwvsaxYNlOVYxdFta4xLfY4IH+9SCCMGR5uIMagUxGrF/ZWOSqD3tw5CXTwfZGh40Vz8SH5Qm8/WjmarTnzZkAAK3SvI5voLDsTKsmivGnOBwnEFgRfwPRwu2iWGLp1MQOolHwJx+UoJWmoLYBiQtPbI0IPHiQV9+HkoyMM2xy+7iY8t6UzAJBhNFlFoFwdtyr+2V2eV9j1+4GWa6/06UNfZ8EYytJQcqMdWlY8FBbLM/1kKDCvbjIRmR9734L+xS/PUELH993K/yCT+ealPSulvnNgn2ekuoWEAg0d054LKsmZ9UW2/QY3yWIOEzpIq2z/syqt0FfvOHY1gFDVNSHIRFSlSu3h+x6klCr4CfI0MLdvh8UOs2CORnyeBqqCUd6pt/vayzcEvpiLD6CHRA56tix/kw7PrwZcnkBj6+8Nn0sQfgbTew/Spo9k6vGxaZNHgvbZpSJV/ak7o0qleFGpxM4Z3O3SkH2GqXXK+noE+dUovmYkYZbHrGhAEI5GBqyQ+gMbCOMiaPEBsE/32EOpjvnlgKw4bJO42fI6fNsAyQ7dLgnUxP3EFSU7Ngo+4hOu2JxdFsqw6xH2QYKs5WNK5Ph583yyRhkgZ/AeFJX/Esps9CRFcKQyZUJVWQjiTb8cCnk+q78stBrx/IcUjvJufKP9LSsMJyaBJI0mc6i8nkMJTNe5M0ib5PsO1x3F2cfa3q3QwNqohKBUlIZOmCoiCdE1gD1AfGQUO1dwuf213tPvhjG1IaU2Bf5n5sPTl3BpGCExRJiAe/KygYq2Vugcq/VjY7lO97Ce8rzTUdQa+CfjWofSPLsDQunKRqxybDg1mdTK4HP+N5rsjzKpSIvUrPIiFhMCa1MU17Wi3wv/IA9oJdCWw/5RA3DcDbRqquM1u/MmT6MPWzTw5Lm0AcCCHODlh58caZL5q4d8Rc5+GfNbijoobTXh3f2EJg3xFBKl0+ZzUYrZsB1JJySCpcbsH9eSfAfF96iktr4Qtc/nsKBQY0qZ6tlSU69bxIQCSsGt69Y5ENXuhMddSsXZLm8EqkopEyBRYyyYtzCSSJWAQ950vAeqvNLoEDFSZN19vh1NaUG81KsMnro4w5twBMpPjfOiJ58Xt+RQSdxHtTmYyd3tV9PSkuxCf4/TVb4PMRCnsiPyQKINdRgiKVYfSzyEauprM4u6tjn/vVYnlp5znSndxAuLDbx0gM7Oy4eWkKDsotjDFyzp0J9K8ySQlz3Hp55PkIk3UwPXFra3UBxy9zfjjcmzZMHXwFgwV1ufFks4N1xPKV/Q8iitHfFo/J0twht4LVw+EKeLibCmo3FctFSuD+ X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2024 15:31:23.9502 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0104aec9-0b4f-40c3-ef54-08dcd6649f83 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: CH1PEPF0000AD78.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4287 Received-SPF: softfail client-ip=40.107.237.64; envelope-from=witu@nvidia.com; helo=NAM12-BN8-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);