From nobody Tue Feb 10 08:01:06 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 980302E8B8B; Tue, 11 Nov 2025 01:05:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.18 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762823148; cv=fail; b=ptEL2ktZZoU7datry1/wods3mxYCGtI2y3TVbj9/29LEL7eqFsggfuWhAIHornR9SVN8j/V1a8h1JMfqQrSmWNhpXACjG66ZLUurH/BML1nNfXsH+oqJrHnBmlcPKjCuxtwZwhhtg+5x719ehtCh8XtzJZ0XiE2/rMD48J/hWHA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762823148; c=relaxed/simple; bh=LWn4AKvWKMbUdfeQBKrgh65iq0HlfVqG2AVOpgbcpAk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=fpJAKPhhbBSAcl/oAPIbiGKIS/PEVWpZVpMd4PHW8VX3O5UdhJ0zNkQtVtZNrGfOlUpON1e0xfCbEePXprwkoTkkriihEzZE0EmoPPgPhdyzeQfMghJzDQwIpowhl+FrKnQ/P0IW/V6wiFeoaGDEgmdtlULYlmQvSGcQcrrbv5w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OlwU6PFT; arc=fail smtp.client-ip=192.198.163.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OlwU6PFT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762823145; x=1794359145; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=LWn4AKvWKMbUdfeQBKrgh65iq0HlfVqG2AVOpgbcpAk=; b=OlwU6PFT7o4DJis85YfTjfMIBCILNNkPQyqEXvIJ9Sijk3jZ9ZPEvOBq yNMgw1pFqr1c9DzpRnp4DfDNbpPWscJK1S/FSPwNp+wAc4itlUwj/J9sH smfjBLeUSGcENx+i17sHnvIh7lz/J+to8oe1meE614663V4bZr2vIbmYi S/w0KfmPkMDo7g8qF5did1ieFNrNL0axkXE3gJUg+NnO1a7enlhckEKoE DCMOuOeh0c+7UN0DGEClWdCgXoACHnbjwcW6Rsy+7eVHeQBlHBaP98TyN 2XYb7rxgRdoOnvaZGH5rOuZSMgE8/Bra6p7vJ5UhfqIfnyPS856aHGIzn g==; X-CSE-ConnectionGUID: DIf12HmWQRC6Acihyef7RA== X-CSE-MsgGUID: twrHMcqdQBGzoW0FFJJiYg== X-IronPort-AV: E=McAfee;i="6800,10657,11609"; a="64087417" X-IronPort-AV: E=Sophos;i="6.19,295,1754982000"; d="scan'208";a="64087417" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2025 17:05:45 -0800 X-CSE-ConnectionGUID: 6ppReKIBQkqXtzQD9hDG8A== X-CSE-MsgGUID: 9VQHKiglQW26Jcr0BfCFTw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,295,1754982000"; d="scan'208";a="188081847" Received: from fmsmsx901.amr.corp.intel.com ([10.18.126.90]) by orviesa006.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2025 17:05:44 -0800 Received: from FMSMSX901.amr.corp.intel.com (10.18.126.90) by fmsmsx901.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.27; Mon, 10 Nov 2025 17:05:44 -0800 Received: from fmsedg902.ED.cps.intel.com (10.1.192.144) by FMSMSX901.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.27 via Frontend Transport; Mon, 10 Nov 2025 17:05:43 -0800 Received: from BN1PR04CU002.outbound.protection.outlook.com (52.101.56.26) by edgegateway.intel.com (192.55.55.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.27; Mon, 10 Nov 2025 17:05:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Q68KwVgnLYvGvOASB0rLm5Bx6ILyj1cfwN2mYMnO2rcV3uT6twUQqa6yHglRb3+jp1Busq3kCpb8rRuiNmXoFSjfUJgeCwcfJl5vBre3ptL9Sox7hdP7OF81rCx6ELeCSQjm/PWCcZ3u/l1gDMivsUhcck7gx6fKx8D5p1AVh6xyigbHARpaqRaLoQf0Ugnyav3l0ngB4Hox8hNQzSBKUZx/aGVLE/g8woHv5At34QbECHJBdipa52NMnQ1iCoq15VkqOc4cMtLnku1WKopmglw5JO/X46A4xt29nMeFsodrwCcMgv6aurrGs/M2AowQctVyOXKFAm5ZPKHHP7gCJw== 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=4u3lcWS0P3f3SEZtPiV1rCAAHXs26Er7SCLzXTQDKYU=; b=dNR8zyVyzQGx9StUa2NjumUcV9Auoc4oFCFDg/d5Q5gmBn4JkKVbtCFJQGOLkro90SBW0TMgxyMhC8SwJl2/l7lwpyChUeDVvY586Ydsw13EeZd4kMqWTobUQLeK/cUoAcJoe5qd6GCojonTyujwTc55YQz3kZ4HoD6lMsZL63EflvzUUB7bwr8wxIPePxQXsLD7UK600XAmtfQHY0ci70UMduo3MtjCK4o3l0RamNhPjmBHpWelY3rkRY1OsZSt3ju7W54MSH8+98hAYo6jVTRPWk/wMysoXUBKOKa5zK+IX1Qq0aFWmJ0GH95P/NeLp3OWU9ywAtNgP2SOGadNmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by MN0PR11MB6279.namprd11.prod.outlook.com (2603:10b6:208:3c1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9298.16; Tue, 11 Nov 2025 01:05:39 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::927a:9c08:26f7:5b39]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::927a:9c08:26f7:5b39%5]) with mapi id 15.20.9298.015; Tue, 11 Nov 2025 01:05:39 +0000 From: =?UTF-8?q?Micha=C5=82=20Winiarski?= To: Alex Williamson , Lucas De Marchi , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Rodrigo Vivi , Jason Gunthorpe , Yishai Hadas , Kevin Tian , Shameer Kolothum , , , , Matthew Brost , "Michal Wajdeczko" CC: , Jani Nikula , Joonas Lahtinen , Tvrtko Ursulin , David Airlie , Simona Vetter , "Lukasz Laguna" , Christoph Hellwig , =?UTF-8?q?Micha=C5=82=20Winiarski?= Subject: [PATCH v5 07/28] drm/xe/pf: Add support for encap/decap of bitstream to/from packet Date: Tue, 11 Nov 2025 02:04:18 +0100 Message-ID: <20251111010439.347045-8-michal.winiarski@intel.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251111010439.347045-1-michal.winiarski@intel.com> References: <20251111010439.347045-1-michal.winiarski@intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: WA2P291CA0005.POLP291.PROD.OUTLOOK.COM (2603:10a6:1d0:1e::11) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|MN0PR11MB6279:EE_ X-MS-Office365-Filtering-Correlation-Id: 7afbeb12-5128-445d-d30f-08de20be6e0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|366016|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?B?dlByYmdCbCs5SUZJY29Wdmo1Ri9iRWNBdGt4MWhNbEt4bWhNZkFTUmxUdkZy?= =?utf-8?B?aSswTkV4RXkxd2NWTnNzbDJkU3VxZmxvUmxZZUxBVUtJMFR0dFkzV3Z6WURw?= =?utf-8?B?cTUzaythTnV6VUJHOXdDMGIyajI5WEozeGVFaGVMa1YxdXVwaTUzc01nR1FF?= =?utf-8?B?ZWZTSzFCZjkra3dUUmhVUXpFYndFRTJicVVYN1ZwclptT3E1VFRrbTFydFN4?= =?utf-8?B?MHhUVm9ISHpZUjRGeEVBQkwydldxWGdNc29tdGdHK0txVW8zRE9OMFhCTm5C?= =?utf-8?B?Ym1CQ1J0VzRoT0Vsc3VwdWx5WmQvaEhnR1R2SnlCMjVYOG0wMVBhd0xzWmtq?= =?utf-8?B?K1FrcURqR3lSc3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IUXVRY0FZYkRxUEl5enFjeFdSeXF4cjhjQWJxOW1X?= =?utf-8?B?L0JybUF3bkp6Tm4ra1loMDdKMTZQaG1LSkxkb1RlN2E0Vnl1OXpUWUhlQmFU?= =?utf-8?B?UVVVY3dqOGZvbHFMNWJLdDNqVzZIK2R2dndjWmhyYlYzZWFCU2JhQ2YxdENh?= =?utf-8?B?K0hHU2pPYlVYTDRPUXF0NjBDSldMaUJpL0tubVk1MDM2VTJwNXhWbjYyR0Nn?= =?utf-8?B?LzUzOTNIMDlBSEtzamhFNEJlMFEzNlRKaWRZcHBTUzB6UzhvNjlGb0pHdnRC?= =?utf-8?B?eWUybTJtdk5xdnNvR1hUVEJ3OTYyM3YrYWZLWnpiVElCUUpJU3NiWlNLMFFB?= =?utf-8?B?Z3FpaWRYekVVck5QUXpDdC8rMDhSdmtKdUFHZVlGN0p6SFFMc3dqNGFDeis4?= =?utf-8?B?Y1oydklVeDBMZ0hIMzR6TEh5SjNFRm1CT3g4THpTeVRJVnozeEgyeGhYelVO?= =?utf-8?B?OXc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 7afbeb12-5128-445d-d30f-08de20be6e0f X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2025 01:05:39.8053 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PBvNYDYawzTjERy+n9E+x2igfUH6F4Zg5+kzmNGvf2TznrqUHlezgD7Jr4tHUyfgCQ1gYh/3sy2iSf5h83OAupizkXAvI6LYbSPRWQEszGY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR11MB6279 X-OriginatorOrg: intel.com Add debugfs handlers for migration state and handle bitstream .read()/.write() to convert from bitstream to/from migration data packets. As descriptor/trailer are handled at this layer - add handling for both save and restore side. Signed-off-by: Micha=C5=82 Winiarski Reviewed-by: Michal Wajdeczko --- drivers/gpu/drm/xe/xe_sriov_packet.c | 293 ++++++++++++++++++ drivers/gpu/drm/xe/xe_sriov_packet.h | 6 + drivers/gpu/drm/xe/xe_sriov_pf_control.c | 5 + drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c | 35 +++ drivers/gpu/drm/xe/xe_sriov_pf_migration.c | 121 ++++++++ drivers/gpu/drm/xe/xe_sriov_pf_migration.h | 5 + .../gpu/drm/xe/xe_sriov_pf_migration_types.h | 9 + 7 files changed, 474 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_sriov_packet.c b/drivers/gpu/drm/xe/xe_s= riov_packet.c index 1ac7e025e9fd9..c612f37e9707c 100644 --- a/drivers/gpu/drm/xe/xe_sriov_packet.c +++ b/drivers/gpu/drm/xe/xe_sriov_packet.c @@ -8,6 +8,67 @@ #include "xe_printk.h" #include "xe_sriov_packet.h" #include "xe_sriov_packet_types.h" +#include "xe_sriov_pf_helpers.h" +#include "xe_sriov_pf_migration.h" +#include "xe_sriov_printk.h" + +static struct mutex *pf_migration_mutex(struct xe_device *xe, unsigned int= vfid) +{ + xe_assert(xe, IS_SRIOV_PF(xe)); + xe_assert(xe, vfid <=3D xe_sriov_pf_get_totalvfs(xe)); + + return &xe->sriov.pf.vfs[vfid].migration.lock; +} + +static struct xe_sriov_packet **pf_pick_pending(struct xe_device *xe, unsi= gned int vfid) +{ + xe_assert(xe, IS_SRIOV_PF(xe)); + xe_assert(xe, vfid <=3D xe_sriov_pf_get_totalvfs(xe)); + lockdep_assert_held(pf_migration_mutex(xe, vfid)); + + return &xe->sriov.pf.vfs[vfid].migration.pending; +} + +static struct xe_sriov_packet ** +pf_pick_descriptor(struct xe_device *xe, unsigned int vfid) +{ + xe_assert(xe, IS_SRIOV_PF(xe)); + xe_assert(xe, vfid <=3D xe_sriov_pf_get_totalvfs(xe)); + lockdep_assert_held(pf_migration_mutex(xe, vfid)); + + return &xe->sriov.pf.vfs[vfid].migration.descriptor; +} + +static struct xe_sriov_packet **pf_pick_trailer(struct xe_device *xe, unsi= gned int vfid) +{ + xe_assert(xe, IS_SRIOV_PF(xe)); + xe_assert(xe, vfid <=3D xe_sriov_pf_get_totalvfs(xe)); + lockdep_assert_held(pf_migration_mutex(xe, vfid)); + + return &xe->sriov.pf.vfs[vfid].migration.trailer; +} + +static struct xe_sriov_packet **pf_pick_read_packet(struct xe_device *xe, + unsigned int vfid) +{ + struct xe_sriov_packet **data; + + data =3D pf_pick_descriptor(xe, vfid); + if (*data) + return data; + + data =3D pf_pick_pending(xe, vfid); + if (!*data) + *data =3D xe_sriov_pf_migration_save_consume(xe, vfid); + if (*data) + return data; + + data =3D pf_pick_trailer(xe, vfid); + if (*data) + return data; + + return NULL; +} =20 static bool pkt_needs_bo(struct xe_sriov_packet *data) { @@ -135,3 +196,235 @@ int xe_sriov_packet_init_from_hdr(struct xe_sriov_pac= ket *data) =20 return pkt_init(data); } + +static ssize_t pkt_hdr_read(struct xe_sriov_packet *data, + char __user *buf, size_t len) +{ + loff_t offset =3D sizeof(data->hdr) - data->hdr_remaining; + + if (!data->hdr_remaining) + return -EINVAL; + + if (len > data->hdr_remaining) + len =3D data->hdr_remaining; + + if (copy_to_user(buf, (void *)&data->hdr + offset, len)) + return -EFAULT; + + data->hdr_remaining -=3D len; + + return len; +} + +static ssize_t pkt_data_read(struct xe_sriov_packet *data, + char __user *buf, size_t len) +{ + if (len > data->remaining) + len =3D data->remaining; + + if (copy_to_user(buf, data->vaddr + (data->hdr.size - data->remaining), l= en)) + return -EFAULT; + + data->remaining -=3D len; + + return len; +} + +static ssize_t pkt_read_single(struct xe_sriov_packet **data, + unsigned int vfid, char __user *buf, size_t len) +{ + ssize_t copied =3D 0; + + if ((*data)->hdr_remaining) + copied =3D pkt_hdr_read(*data, buf, len); + else + copied =3D pkt_data_read(*data, buf, len); + + if ((*data)->remaining =3D=3D 0 && (*data)->hdr_remaining =3D=3D 0) { + xe_sriov_packet_free(*data); + *data =3D NULL; + } + + return copied; +} + +/** + * xe_sriov_packet_read_single() - Read migration data from a single packe= t. + * @xe: the &xe_device + * @vfid: the VF identifier + * @buf: start address of userspace buffer + * @len: requested read size from userspace + * + * Return: number of bytes that has been successfully read, + * 0 if no more migration data is available, + * -errno on failure. + */ +ssize_t xe_sriov_packet_read_single(struct xe_device *xe, unsigned int vfi= d, + char __user *buf, size_t len) +{ + struct xe_sriov_packet **data =3D pf_pick_read_packet(xe, vfid); + + if (!data) + return -ENODATA; + if (IS_ERR(*data)) + return PTR_ERR(*data); + + return pkt_read_single(data, vfid, buf, len); +} + +static ssize_t pkt_hdr_write(struct xe_sriov_packet *data, + const char __user *buf, size_t len) +{ + loff_t offset =3D sizeof(data->hdr) - data->hdr_remaining; + int ret; + + if (len > data->hdr_remaining) + len =3D data->hdr_remaining; + + if (copy_from_user((void *)&data->hdr + offset, buf, len)) + return -EFAULT; + + data->hdr_remaining -=3D len; + + if (!data->hdr_remaining) { + ret =3D xe_sriov_packet_init_from_hdr(data); + if (ret) + return ret; + } + + return len; +} + +static ssize_t pkt_data_write(struct xe_sriov_packet *data, + const char __user *buf, size_t len) +{ + if (len > data->remaining) + len =3D data->remaining; + + if (copy_from_user(data->vaddr + (data->hdr.size - data->remaining), buf,= len)) + return -EFAULT; + + data->remaining -=3D len; + + return len; +} + +/** + * xe_sriov_packet_write_single() - Write migration data to a single packe= t. + * @xe: the &xe_device + * @vfid: the VF identifier + * @buf: start address of userspace buffer + * @len: requested write size from userspace + * + * Return: number of bytes that has been successfully written, + * -errno on failure. + */ +ssize_t xe_sriov_packet_write_single(struct xe_device *xe, unsigned int vf= id, + const char __user *buf, size_t len) +{ + struct xe_sriov_packet **data =3D pf_pick_pending(xe, vfid); + int ret; + ssize_t copied; + + if (IS_ERR_OR_NULL(*data)) { + *data =3D xe_sriov_packet_alloc(xe); + if (!*data) + return -ENOMEM; + } + + if ((*data)->hdr_remaining) + copied =3D pkt_hdr_write(*data, buf, len); + else + copied =3D pkt_data_write(*data, buf, len); + + if ((*data)->hdr_remaining =3D=3D 0 && (*data)->remaining =3D=3D 0) { + ret =3D xe_sriov_pf_migration_restore_produce(xe, vfid, *data); + if (ret) { + xe_sriov_packet_free(*data); + return ret; + } + + *data =3D NULL; + } + + return copied; +} + +#define MIGRATION_DESCRIPTOR_DWORDS 0 +static size_t pf_descriptor_init(struct xe_device *xe, unsigned int vfid) +{ + struct xe_sriov_packet **desc =3D pf_pick_descriptor(xe, vfid); + struct xe_sriov_packet *data; + int ret; + + data =3D xe_sriov_packet_alloc(xe); + if (!data) + return -ENOMEM; + + ret =3D xe_sriov_packet_init(data, 0, 0, XE_SRIOV_PACKET_TYPE_DESCRIPTOR, + 0, MIGRATION_DESCRIPTOR_DWORDS * sizeof(u32)); + if (ret) { + xe_sriov_packet_free(data); + return ret; + } + + *desc =3D data; + + return 0; +} + +static void pf_pending_init(struct xe_device *xe, unsigned int vfid) +{ + struct xe_sriov_packet **data =3D pf_pick_pending(xe, vfid); + + *data =3D NULL; +} + +#define MIGRATION_TRAILER_SIZE 0 +static int pf_trailer_init(struct xe_device *xe, unsigned int vfid) +{ + struct xe_sriov_packet **trailer =3D pf_pick_trailer(xe, vfid); + struct xe_sriov_packet *data; + int ret; + + data =3D xe_sriov_packet_alloc(xe); + if (!data) + return -ENOMEM; + + ret =3D xe_sriov_packet_init(data, 0, 0, XE_SRIOV_PACKET_TYPE_TRAILER, + 0, MIGRATION_TRAILER_SIZE); + if (ret) { + xe_sriov_packet_free(data); + return ret; + } + + *trailer =3D data; + + return 0; +} + +/** + * xe_sriov_packet_save_init() - Initialize the pending save migration pac= kets. + * @xe: the &xe_device + * @vfid: the VF identifier + * + * Return: 0 on success, -errno on failure. + */ +int xe_sriov_packet_save_init(struct xe_device *xe, unsigned int vfid) +{ + int ret; + + scoped_cond_guard(mutex_intr, return -EINTR, pf_migration_mutex(xe, vfid)= ) { + ret =3D pf_descriptor_init(xe, vfid); + if (ret) + return ret; + + ret =3D pf_trailer_init(xe, vfid); + if (ret) + return ret; + + pf_pending_init(xe, vfid); + } + + return 0; +} diff --git a/drivers/gpu/drm/xe/xe_sriov_packet.h b/drivers/gpu/drm/xe/xe_s= riov_packet.h index 282a35e77fb39..fd8da5069b53f 100644 --- a/drivers/gpu/drm/xe/xe_sriov_packet.h +++ b/drivers/gpu/drm/xe/xe_sriov_packet.h @@ -19,4 +19,10 @@ int xe_sriov_packet_init(struct xe_sriov_packet *data, u= 8 tile_id, u8 gt_id, enum xe_sriov_packet_type, loff_t offset, size_t size); int xe_sriov_packet_init_from_hdr(struct xe_sriov_packet *data); =20 +ssize_t xe_sriov_packet_read_single(struct xe_device *xe, unsigned int vfi= d, + char __user *buf, size_t len); +ssize_t xe_sriov_packet_write_single(struct xe_device *xe, unsigned int vf= id, + const char __user *buf, size_t len); +int xe_sriov_packet_save_init(struct xe_device *xe, unsigned int vfid); + #endif diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_control.c b/drivers/gpu/drm/xe/= xe_sriov_pf_control.c index e7b904e57b68c..7789d9e1409c9 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf_control.c +++ b/drivers/gpu/drm/xe/xe_sriov_pf_control.c @@ -5,6 +5,7 @@ =20 #include "xe_device.h" #include "xe_gt_sriov_pf_control.h" +#include "xe_sriov_packet.h" #include "xe_sriov_pf_control.h" #include "xe_sriov_printk.h" =20 @@ -165,6 +166,10 @@ int xe_sriov_pf_control_trigger_save_vf(struct xe_devi= ce *xe, unsigned int vfid) unsigned int id; int ret; =20 + ret =3D xe_sriov_packet_save_init(xe, vfid); + if (ret) + return ret; + for_each_gt(gt, xe, id) { ret =3D xe_gt_sriov_pf_control_trigger_save_vf(gt, vfid); if (ret) diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c b/drivers/gpu/drm/xe/= xe_sriov_pf_debugfs.c index e0e6340c49106..4ca86ff4b7dae 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c +++ b/drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c @@ -13,6 +13,7 @@ #include "xe_sriov_pf_control.h" #include "xe_sriov_pf_debugfs.h" #include "xe_sriov_pf_helpers.h" +#include "xe_sriov_pf_migration.h" #include "xe_sriov_pf_provision.h" #include "xe_sriov_pf_service.h" #include "xe_sriov_printk.h" @@ -132,6 +133,7 @@ static void pf_populate_pf(struct xe_device *xe, struct= dentry *pfdent) * /sys/kernel/debug/dri/BDF/ * =E2=94=9C=E2=94=80=E2=94=80 sriov * =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 vf1 + * =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 migration_data * =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 pause * =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 reset * =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 resume @@ -220,6 +222,38 @@ DEFINE_VF_CONTROL_ATTRIBUTE(reset_vf); DEFINE_VF_CONTROL_ATTRIBUTE_RW(save_vf); DEFINE_VF_CONTROL_ATTRIBUTE_RW(restore_vf); =20 +static ssize_t data_write(struct file *file, const char __user *buf, size_= t count, loff_t *pos) +{ + struct dentry *dent =3D file_dentry(file)->d_parent; + struct xe_device *xe =3D extract_xe(dent); + unsigned int vfid =3D extract_vfid(dent); + + if (*pos) + return -ESPIPE; + + return xe_sriov_pf_migration_write(xe, vfid, buf, count); +} + +static ssize_t data_read(struct file *file, char __user *buf, size_t count= , loff_t *ppos) +{ + struct dentry *dent =3D file_dentry(file)->d_parent; + struct xe_device *xe =3D extract_xe(dent); + unsigned int vfid =3D extract_vfid(dent); + + if (*ppos) + return -ESPIPE; + + return xe_sriov_pf_migration_read(xe, vfid, buf, count); +} + +static const struct file_operations data_vf_fops =3D { + .owner =3D THIS_MODULE, + .open =3D simple_open, + .write =3D data_write, + .read =3D data_read, + .llseek =3D default_llseek, +}; + static void pf_populate_vf(struct xe_device *xe, struct dentry *vfdent) { debugfs_create_file("pause", 0200, vfdent, xe, &pause_vf_fops); @@ -228,6 +262,7 @@ static void pf_populate_vf(struct xe_device *xe, struct= dentry *vfdent) debugfs_create_file("reset", 0200, vfdent, xe, &reset_vf_fops); debugfs_create_file("save", 0600, vfdent, xe, &save_vf_fops); debugfs_create_file("restore", 0600, vfdent, xe, &restore_vf_fops); + debugfs_create_file("migration_data", 0600, vfdent, xe, &data_vf_fops); } =20 static void pf_populate_with_tiles(struct xe_device *xe, struct dentry *de= nt, unsigned int vfid) diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_migration.c b/drivers/gpu/drm/x= e/xe_sriov_pf_migration.c index 11bc2e33373c8..ad5a45ddb2ae4 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf_migration.c +++ b/drivers/gpu/drm/xe/xe_sriov_pf_migration.c @@ -10,6 +10,7 @@ #include "xe_gt_sriov_pf_migration.h" #include "xe_pm.h" #include "xe_sriov.h" +#include "xe_sriov_packet.h" #include "xe_sriov_packet_types.h" #include "xe_sriov_pf_helpers.h" #include "xe_sriov_pf_migration.h" @@ -54,6 +55,15 @@ static bool pf_check_migration_support(struct xe_device = *xe) return IS_ENABLED(CONFIG_DRM_XE_DEBUG); } =20 +static void pf_migration_cleanup(void *arg) +{ + struct xe_sriov_migration_state *migration =3D arg; + + xe_sriov_packet_free(migration->pending); + xe_sriov_packet_free(migration->trailer); + xe_sriov_packet_free(migration->descriptor); +} + /** * xe_sriov_pf_migration_init() - Initialize support for SR-IOV VF migrati= on. * @xe: the &xe_device @@ -63,6 +73,7 @@ static bool pf_check_migration_support(struct xe_device *= xe) int xe_sriov_pf_migration_init(struct xe_device *xe) { unsigned int n, totalvfs; + int err; =20 xe_assert(xe, IS_SRIOV_PF(xe)); =20 @@ -74,7 +85,15 @@ int xe_sriov_pf_migration_init(struct xe_device *xe) for (n =3D 1; n <=3D totalvfs; n++) { struct xe_sriov_migration_state *migration =3D pf_pick_migration(xe, n); =20 + err =3D drmm_mutex_init(&xe->drm, &migration->lock); + if (err) + return err; + init_waitqueue_head(&migration->wq); + + err =3D devm_add_action_or_reset(xe->drm.dev, pf_migration_cleanup, migr= ation); + if (err) + return err; } =20 return 0; @@ -155,6 +174,36 @@ xe_sriov_pf_migration_save_consume(struct xe_device *x= e, unsigned int vfid) return data; } =20 +static int pf_handle_descriptor(struct xe_device *xe, unsigned int vfid, + struct xe_sriov_packet *data) +{ + if (data->hdr.tile_id !=3D 0 || data->hdr.gt_id !=3D 0) + return -EINVAL; + + xe_sriov_packet_free(data); + + return 0; +} + +static int pf_handle_trailer(struct xe_device *xe, unsigned int vfid, + struct xe_sriov_packet *data) +{ + struct xe_gt *gt; + u8 gt_id; + + if (data->hdr.tile_id !=3D 0 || data->hdr.gt_id !=3D 0) + return -EINVAL; + if (data->hdr.offset !=3D 0 || data->hdr.size !=3D 0 || data->buff || dat= a->bo) + return -EINVAL; + + xe_sriov_packet_free(data); + + for_each_gt(gt, xe, gt_id) + xe_gt_sriov_pf_control_restore_data_done(gt, vfid); + + return 0; +} + /** * xe_sriov_pf_migration_restore_produce() - Produce a VF migration data p= acket to the device. * @xe: the &xe_device @@ -174,6 +223,11 @@ int xe_sriov_pf_migration_restore_produce(struct xe_de= vice *xe, unsigned int vfi =20 xe_assert(xe, IS_SRIOV_PF(xe)); =20 + if (data->hdr.type =3D=3D XE_SRIOV_PACKET_TYPE_DESCRIPTOR) + return pf_handle_descriptor(xe, vfid, data); + if (data->hdr.type =3D=3D XE_SRIOV_PACKET_TYPE_TRAILER) + return pf_handle_trailer(xe, vfid, data); + gt =3D xe_device_get_gt(xe, data->hdr.gt_id); if (!gt || data->hdr.tile_id !=3D gt->tile->id) { xe_sriov_err_ratelimited(xe, "VF%d Invalid GT - tile:%u, GT:%u\n", @@ -183,3 +237,70 @@ int xe_sriov_pf_migration_restore_produce(struct xe_de= vice *xe, unsigned int vfi =20 return xe_gt_sriov_pf_migration_restore_produce(gt, vfid, data); } + +/** + * xe_sriov_pf_migration_read() - Read migration data from the device. + * @xe: the &xe_device + * @vfid: the VF identifier + * @buf: start address of userspace buffer + * @len: requested read size from userspace + * + * Return: number of bytes that has been successfully read, + * 0 if no more migration data is available, + * -errno on failure. + */ +ssize_t xe_sriov_pf_migration_read(struct xe_device *xe, unsigned int vfid, + char __user *buf, size_t len) +{ + struct xe_sriov_migration_state *migration =3D pf_pick_migration(xe, vfid= ); + ssize_t ret, consumed =3D 0; + + xe_assert(xe, IS_SRIOV_PF(xe)); + + scoped_cond_guard(mutex_intr, return -EINTR, &migration->lock) { + while (consumed < len) { + ret =3D xe_sriov_packet_read_single(xe, vfid, buf, len - consumed); + if (ret =3D=3D -ENODATA) + break; + if (ret < 0) + return ret; + + consumed +=3D ret; + buf +=3D ret; + } + } + + return consumed; +} + +/** + * xe_sriov_pf_migration_write() - Write migration data to the device. + * @xe: the &xe_device + * @vfid: the VF identifier + * @buf: start address of userspace buffer + * @len: requested write size from userspace + * + * Return: number of bytes that has been successfully written, + * -errno on failure. + */ +ssize_t xe_sriov_pf_migration_write(struct xe_device *xe, unsigned int vfi= d, + const char __user *buf, size_t len) +{ + struct xe_sriov_migration_state *migration =3D pf_pick_migration(xe, vfid= ); + ssize_t ret, produced =3D 0; + + xe_assert(xe, IS_SRIOV_PF(xe)); + + scoped_cond_guard(mutex_intr, return -EINTR, &migration->lock) { + while (produced < len) { + ret =3D xe_sriov_packet_write_single(xe, vfid, buf, len - produced); + if (ret < 0) + return ret; + + produced +=3D ret; + buf +=3D ret; + } + } + + return produced; +} diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_migration.h b/drivers/gpu/drm/x= e/xe_sriov_pf_migration.h index d48ff2ecc2308..dbf8094900df8 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf_migration.h +++ b/drivers/gpu/drm/xe/xe_sriov_pf_migration.h @@ -20,4 +20,9 @@ struct xe_sriov_packet * xe_sriov_pf_migration_save_consume(struct xe_device *xe, unsigned int vfid= ); wait_queue_head_t *xe_sriov_pf_migration_waitqueue(struct xe_device *xe, u= nsigned int vfid); =20 +ssize_t xe_sriov_pf_migration_read(struct xe_device *xe, unsigned int vfid, + char __user *buf, size_t len); +ssize_t xe_sriov_pf_migration_write(struct xe_device *xe, unsigned int vfi= d, + const char __user *buf, size_t len); + #endif diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_migration_types.h b/drivers/gpu= /drm/xe/xe_sriov_pf_migration_types.h index 5f2062c8c0c42..363d673ee1dd5 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf_migration_types.h +++ b/drivers/gpu/drm/xe/xe_sriov_pf_migration_types.h @@ -7,6 +7,7 @@ #define _XE_SRIOV_PF_MIGRATION_TYPES_H_ =20 #include +#include #include =20 /** @@ -23,6 +24,14 @@ struct xe_sriov_pf_migration { struct xe_sriov_migration_state { /** @wq: waitqueue used to avoid busy-waiting for snapshot production/con= sumption */ wait_queue_head_t wq; + /** @lock: Mutex protecting the migration data */ + struct mutex lock; + /** @pending: currently processed data packet of VF resource */ + struct xe_sriov_packet *pending; + /** @trailer: data packet used to indicate the end of stream */ + struct xe_sriov_packet *trailer; + /** @descriptor: data packet containing the metadata describing the devic= e */ + struct xe_sriov_packet *descriptor; }; =20 #endif --=20 2.51.2