Message ID | 20240906194908.1127733-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 4X0mz1222gz1y1K for <incoming@patchwork.ozlabs.org>; Sat, 7 Sep 2024 05:49:49 +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 1smexg-0002St-VX; Fri, 06 Sep 2024 19:49:40 +0000 Received: from mail-bn8nam04on2048.outbound.protection.outlook.com ([40.107.100.48] helo=NAM04-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 1smexf-0002P0-65 for kernel-team@lists.ubuntu.com; Fri, 06 Sep 2024 19:49:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e0FapXMsI3zYfWbHrEdMwgcpVKyk/oyCZQsUHKKTU6hfNcHz3A7ykgzfQMpcG4uEjVgSMrJjFmdHEx57FlLNzCxHGSjxTnQYNPtiCzQxcNMyHnQSl+x2T0cG+hrbWXdp4APpacJmkl5K6uslNGeDK9PC+ofbVBNWovWe8UJuxc6erxKKgiQ2zY0wGFzj4zerlgn8iUYU79s0plkp1AtSXw986RHK4uZ6BlkYsrRhNM6BRVA9eGaN2i6lBRVz6jIdA7q8yY9HfkZUUOF0M5IQv0kpPL+7BRXtE+4n4Aw54k+Q8DJFv/OXBxNVvmJ4/UL900c9458OxFhLHQuxvcrvEw== 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=jwISTG9WhA1r9eJZU6vZOzSVPMCi65yCBB+Aj9fWk50A1X6yDSouAn4aQ8RgjWLzeqcI4oFV1UGKP9+zpkq+BshACnGxLbPwy4BkJU8qslJum6pjOKKNPlkB2Y5RwZDmXr6V+dNJETy66kaRkm9tsRdlKJWAfB7giSb4z0sIgRNcbCrXxeYmnrlKG3rJgLfcIvHIRNgaWQxxJRcpZwyhBCa0eBWTyp93Q+MphCUMQHvtoP/gl08lgOHJxL5q0BeRxP3u78tu22O6ib+hQHodpmvk4+FtgsFsQLf1D4ypRfBRf7pWb8z04Fl+VLmzM2j6XxC6aiUCgQO5ITv2ACQe0g== 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 SN7PR04CA0073.namprd04.prod.outlook.com (2603:10b6:806:121::18) by SA1PR12MB7127.namprd12.prod.outlook.com (2603:10b6:806:29e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.17; Fri, 6 Sep 2024 19:49:33 +0000 Received: from SN1PEPF0002636A.namprd02.prod.outlook.com (2603:10b6:806:121:cafe::93) by SN7PR04CA0073.outlook.office365.com (2603:10b6:806:121::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.14 via Frontend Transport; Fri, 6 Sep 2024 19:49:33 +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 SN1PEPF0002636A.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Fri, 6 Sep 2024 19:49:33 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Fri, 6 Sep 2024 12:49:18 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Fri, 6 Sep 2024 12:49:18 -0700 Received: from vdi.nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Fri, 6 Sep 2024 12:49:17 -0700 From: William Tu <witu@nvidia.com> To: <kernel-team@lists.ubuntu.com> Subject: [SRU][J:linux-bluefield][PATCH v3 5/6] UBUNTU: SAUCE: vfio/pci: Fix p2p address Date: Fri, 6 Sep 2024 19:49:07 +0000 Message-ID: <20240906194908.1127733-6-witu@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240906194908.1127733-1-witu@nvidia.com> References: <20240906194908.1127733-1-witu@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636A:EE_|SA1PR12MB7127:EE_ X-MS-Office365-Filtering-Correlation-Id: 784aef13-6249-436a-604e-08dccead07c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: G+0W+qKCZstxxL/dUiR8VvLoIexVvK3RiQlg854iMcG6wQJ9B68poyxtVrahxtBbeRD1DDOHDxD4nPIRyCm/recrzze0tKxqDVUJoDLw9+F9DBrB8oRrXWn+blmK2JRW+qZK0jmKtn3sfN1Kbn5YwvLb49pa1f/jjjvEVd+7eYkPdUn0EGr0J89HPFk+eGuh4xxIZM4gBdfBxjzUcKPRDWcopj1xRij8GyrNNGTnmSL+l2mEFKYeMl+dJ8VAZQJogtiKBYexv2FF89SROXhOpEqxmRNuf87RUbQTd0hyTyo/0+HgsLX+9iAVQrYqmK+/nEdhRYKJnDbHpjp0Vw6udepX9D+reUOhd6O3xJjZbzY/fRGm7EOxA8nZ/hgxtMpvevQvU5RR9njrqp4FycVMmH/uVG3slnbZfAIiCcUYfed+e/nAxFsRGLRI41x9wGVur6njvvbRaxyHKQazPaWGewFDntlViTI13076c880RpKuxb1PfvBl4R5SppA2O2ULbp2ez0JE+D2Vf0VlOAAdno4uvkdtnVoShr4gEJwPJN578Iw3PgY16Bdr6UYh0LTP4U0v7f7OLUbGADwpI/F6elIE66HdJviJSY2Qz3B4bKF2PdquflJotmjRxLMKL97nZG2tQNsJ1x/+dgGQXDrexZrucSonNy+8dBMX/LYpqhANRA+IadQ2z8pQjSj+oEc9NFUjyPakSCutTs2+J5QpuJLolr+8gdH0E90vMFZw5O1Bjdlviz3mxCpaNThqiXIjbeVXNx2P3giGFmjixUpnjoh9tZ3j6EGyy9YZE0+amnblv8T36Wk1usI9IeaftAnrFZ3ytOttw6KSiJqE7FTUtcV3ljxgc/rR2ws4Vpxbwyd6Xv1ak5EPYszjEFa05ptxnT6rcFCdFh4iOizFUpyoOtwGCsT5Zpvmx0UOab58YDatJCmTm+WUXw2eT0+1mMtncouhjWIBhKnPrNiUMVLSMy0i7QSBDWa7o/XKdj+sil82OGvPpQ7MIlWRtxT0oJ/YiT+5xYMF/PY308cE/43RimNd0a/jccnxa7/0BI2TyHT6z8wawTDVOG+XCqETQzFsV++RWALCMvPK/r+WnroJd2cYKkR+PbgaD0NIlZU571j+jaZQ81tl1671i4dzGPlCq2f46wgbPHNMKQ0fFYEL0WjcYEAjPSSHm952I0Am7HuMUUNu2/VFwzeGjb4067AfWRD8RE7OXqhnkzXBM0pm9uh0aFq5In3055gde22RuMKQfRIZzNwzgRt/8IXO37g59xclG8/7tQur+oL4cZDdvdd9l3iaNDqSNRQrBz3SVk8p5xtbDI6yfu/tJ5R8sGrMGydZg7/zsvmGU72kd3gZC23Y9E1OG/0rkDLJCo8kcAIhDN3vPvltMoV+MaEtogkbxcRzPrZVe2rUZPhADK+I/Catu5mhP2/y49ECj8MRfMu/UpasEchlCWi3E6HDx5Zy 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)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2024 19:49:33.3139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 784aef13-6249-436a-604e-08dccead07c1 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: SN1PEPF0002636A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7127 Received-SPF: softfail client-ip=40.107.100.48; envelope-from=witu@nvidia.com; helo=NAM04-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);