From nobody Tue Feb 10 05:27:10 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 3176B33BBD8; Thu, 30 Oct 2025 20:32:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.21 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761856361; cv=fail; b=rMQfBnHUqGAN4WmOpC47u63nKlQ6B/pOSJvhfcLu7fSSYWuLw/UgV5U188k5rWSwa2swM63ujiiBK3fxEtH0EdIebFtnEcPfuDG3Ofyn41VLr4A53CoWdKiMAKoiiqMqbrqi7nfjs6ZZoI7aNP4lwAPXiabrr2UjdhwgV662bME= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761856361; c=relaxed/simple; bh=zfTnY9H2PGnyeRboOfo9gmNqKI2KPV5vRS5F94K79lM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=u2K2h3KzDVSYAq12gjEMJ+ZmEB1FOXyqs6UGZeSh+rOKJz7SqhldIaZKl3DIN+W4P/vx6W5J8sb2BCqFXsKyVLlRnRZZgR3xkxKCeZQ8lACbrptcTmMbSBvOlRrStkOTsTB1cD40b/lzpe9bO6kdeVH1mNCVjbpvGOjVXcaf5p8= 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=dHC3rDri; arc=fail smtp.client-ip=198.175.65.21 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="dHC3rDri" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1761856359; x=1793392359; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=zfTnY9H2PGnyeRboOfo9gmNqKI2KPV5vRS5F94K79lM=; b=dHC3rDri5MqqmR18kP7x6PbEItbDwDMVvx+V5jg9Twjsl7To2WRAGx8Z uc2UWWGEkxtzhiikN48oG3TF9NaO0fdHpoosGAcQFjj+LZNolODwTAaov Ms9vI4dxHT50ZUrRkhjNFQsXv/Lfauum1m+ZYgaRXRJTY3SiANG6WY0Ra LMcgJN7asCCVA8tOVibmPtwEdNQkBUEtKGdrS3tqt2uvNxns6/RGqZ93h GNV0L2YFxYzXu+fUHzT6QWKAX+rYLPXvubdE7chxC+LCR/k1sIdMAgFMf udBUEmuk98MxaAH+P+F0BOChtB+SRSl0ix+nNHZJ2Sy6rv0SC6ji7cMht Q==; X-CSE-ConnectionGUID: zH+eDCzUTlSr+nIEQgc5RA== X-CSE-MsgGUID: xcWD5wEURPGqjrMKRfgV2A== X-IronPort-AV: E=McAfee;i="6800,10657,11531"; a="63916835" X-IronPort-AV: E=Sophos;i="6.17,312,1747724400"; d="scan'208";a="63916835" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2025 13:32:39 -0700 X-CSE-ConnectionGUID: KRHkkr6uR5WRlvgnhRwyjQ== X-CSE-MsgGUID: CtvaNLxAQ/CMxQjkxyIXfw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,267,1754982000"; d="scan'208";a="223284185" Received: from fmsmsx902.amr.corp.intel.com ([10.18.126.91]) by orviesa001.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2025 13:32:39 -0700 Received: from FMSMSX903.amr.corp.intel.com (10.18.126.92) by fmsmsx902.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.27; Thu, 30 Oct 2025 13:32:37 -0700 Received: from fmsedg903.ED.cps.intel.com (10.1.192.145) by FMSMSX903.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.27 via Frontend Transport; Thu, 30 Oct 2025 13:32:37 -0700 Received: from SJ2PR03CU001.outbound.protection.outlook.com (52.101.43.54) by edgegateway.intel.com (192.55.55.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.27; Thu, 30 Oct 2025 13:32:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GGV+3pzP+1o1cTxgenwV2159BFc2DnEFf8KBnwrbmCiNRUTE6ydwTapxGi89MN8nuo2LQxJ4T9fbUKNmqNtw4FGzjyq9qzyTbp9vQavcRWEC9M5wvIeRfStWPdpzIBFn6J5gH8WIYWClQQA8FgZCTGm27p5KwW9NDTfEcIpdCWzmEMFCwVVzVbTyJVqAkW96UtPlIT+t7hGxj7o3HtFgE6GGxRwXNmekEDRmnzcTu1AvFrNS3xen4DD8/9jd9d2H+abtxPYqlAKhUa6pObXhfeVg1CAr02jQJQSA9F97MQrS0sGyo/9gwDqA7PhK2BTsk4ufB2e7VuVtjpUzsiwcxA== 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=QHXD1oKOpTowW3tNAkLG+HbBUFXbBLRjj08VrrkZs4s=; b=gJM0DacZ8Ur47G4vdmh9B2087cRdkDoJVdDaLqJslpB2lt6oxccoi1QH3xNgvGms4GiP9cKCkfdl/RbW53eGgFyk8pfEooRwSWS+ukbuBMRaQXDIKxIHAhq6RElkXEPAuzr6T2K6ZVVV3RzRO/pAXdan9bQBPIrOq8HbvpdwpkFleF13zq4vPR6xFUqwzn00AHInxykkFfXLFbykojkEd/uPwrOvPNH6p9sP1LPIslmJAFVjI7rb5vEaCoQlqScdq1F77xIxmJFDZ428ZoOiMhSD9aPKgnYk2K0LdHCQdkn23bp1RKuKi0yiobP0znis7cJYHTLO0tV4CdyMQzKPnA== 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 CO1PR11MB4817.namprd11.prod.outlook.com (2603:10b6:303:98::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9275.14; Thu, 30 Oct 2025 20:32:35 +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.9275.011; Thu, 30 Oct 2025 20:32:35 +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 v3 07/28] drm/xe/pf: Add support for encap/decap of bitstream to/from packet Date: Thu, 30 Oct 2025 21:31:14 +0100 Message-ID: <20251030203135.337696-8-michal.winiarski@intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251030203135.337696-1-michal.winiarski@intel.com> References: <20251030203135.337696-1-michal.winiarski@intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: VIYP296CA0006.AUTP296.PROD.OUTLOOK.COM (2603:10a6:800:29d::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_|CO1PR11MB4817:EE_ X-MS-Office365-Filtering-Correlation-Id: f763cb2a-9e21-4342-24ed-08de17f37594 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?B?R29Sa24zTys3d09LZXZmeEN0WGtHSFlDNzA3cFlRMXRyRUFhVzRyeU9tMHlH?= =?utf-8?B?MEdyU0V4SmVqdXplekJMaFJrSXI5ZWlmd3k3VTByZDFSVkRHVlY1bi9NRS9S?= =?utf-8?B?dE5aVjJzQkZ6Q2hSM3MvYVlXcDd2WW9tWVgrekgweXZLSDJRUFdYUDZXU2Jm?= =?utf-8?B?NzVBQjdCalpXZGxwZDA4ZzBpdVV4RGxLZlhPL3RsU0EwcTA2UmhDemhHRlZ5?= =?utf-8?B?Q2IweFd0TTdzVVZLQmovUGJ0VjFJMENOUzFud2VOeEVwczh5emIwdDdtZ2lH?= =?utf-8?B?MEFBSmNoM21qb2dGMTQrOW9pbVhzNm5wcFZSVk5ucmVMWExuQ3F3a2cvY2ZG?= =?utf-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NFN29mczRnbHREdTRzT0VnUDRobWcycUM2WVhwOWpxQmtI?= =?utf-8?B?UUpwMmpma1A4YkVCd1BGdndlYWhuSkFPOWFWRE43TkNHNFVESkIyOWJKaldq?= =?utf-8?B?Ni9JZjd1cUJBMHBkYjhkUEJSVG9za1FMSlRjVDRza1c5bHQyalFnbllTKzlv?= =?utf-8?B?YkxLK0xSYU11SWEzSWdhWWpydnlzY3hvbVVSNWh0R1VXbDdmZm5JL21DY2Iz?= =?utf-8?B?ZzdPTExqWmtvRlFPU0NVd1F4Y2srb1Z6ZkRqWi9Ud05aSjIrdkE3ZFRrVTJ4?= =?utf-8?B?MzNtclFuSjlPZjRVa3R5WGhZYmM5UUFnTHg3RFdlbjlBVWtvdzRPRklxMlAy?= =?utf-8?B?eGFMTjRLQ3Z3ZmY3bU1ZZFB1RkdEOG1ZLzdVcjhMUkoyYVpoWnpxdlNiNnNv?= =?utf-8?B?b0VGVk9KNnVIaWsrQmpUZW81eGRUTWlIL0tCT3g0bVU0OEVNelVuVi9RNG85?= =?utf-8?B?blE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: f763cb2a-9e21-4342-24ed-08de17f37594 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2025 20:32:35.3062 (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: kzlCuiJaDMA3idskBapMJ9NbYzmZm5CUWBHJvMCwpT8ucvjh0+7aQ/0o7VQ9iV+unTVQKtYKLYVCS8YUy+CI2xhj+Dyic2x5Z22ZTfl7Kuo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4817 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 --- drivers/gpu/drm/xe/xe_sriov_migration_data.c | 337 ++++++++++++++++++ drivers/gpu/drm/xe/xe_sriov_migration_data.h | 5 + 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 | 54 +++ .../gpu/drm/xe/xe_sriov_pf_migration_types.h | 9 + 6 files changed, 445 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_sriov_migration_data.c b/drivers/gpu/drm= /xe/xe_sriov_migration_data.c index 2371ca3e6b9a9..a3f50836adc81 100644 --- a/drivers/gpu/drm/xe/xe_sriov_migration_data.c +++ b/drivers/gpu/drm/xe/xe_sriov_migration_data.c @@ -6,6 +6,45 @@ #include "xe_bo.h" #include "xe_device.h" #include "xe_sriov_migration_data.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_migration_data **pf_pick_pending(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.pending; +} + +static struct xe_sriov_migration_data ** +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_migration_data **pf_pick_trailer(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.trailer; +} =20 static bool data_needs_bo(struct xe_sriov_migration_data *data) { @@ -42,6 +81,9 @@ struct xe_sriov_migration_data *xe_sriov_migration_data_a= lloc(struct xe_device * */ void xe_sriov_migration_data_free(struct xe_sriov_migration_data *data) { + if (IS_ERR_OR_NULL(data)) + return; + if (data_needs_bo(data)) xe_bo_unpin_map_no_vm(data->bo); else @@ -124,3 +166,298 @@ int xe_sriov_migration_data_init_from_hdr(struct xe_s= riov_migration_data *data) =20 return mig_data_init(data); } + +static ssize_t vf_mig_data_hdr_read(struct xe_sriov_migration_data *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 vf_mig_data_read(struct xe_sriov_migration_data *data, + char __user *buf, size_t len) +{ + if (len > data->remaining) + len =3D data->remaining; + + if (copy_to_user(buf, data->vaddr + (data->size - data->remaining), len)) + return -EFAULT; + + data->remaining -=3D len; + + return len; +} + +static ssize_t __vf_mig_data_read_single(struct xe_sriov_migration_data **= data, + unsigned int vfid, char __user *buf, size_t len) +{ + ssize_t copied =3D 0; + + if ((*data)->hdr_remaining) + copied =3D vf_mig_data_hdr_read(*data, buf, len); + else + copied =3D vf_mig_data_read(*data, buf, len); + + if ((*data)->remaining =3D=3D 0 && (*data)->hdr_remaining =3D=3D 0) { + xe_sriov_migration_data_free(*data); + *data =3D NULL; + } + + return copied; +} + +static struct xe_sriov_migration_data **vf_mig_pick_data(struct xe_device = *xe, unsigned int vfid) +{ + struct xe_sriov_migration_data **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 ERR_PTR(-ENODATA); +} + +static ssize_t vf_mig_data_read_single(struct xe_device *xe, unsigned int = vfid, + char __user *buf, size_t len) +{ + struct xe_sriov_migration_data **data =3D vf_mig_pick_data(xe, vfid); + + if (IS_ERR(data)) + return PTR_ERR(data); + + return __vf_mig_data_read_single(data, vfid, buf, len); +} + +/** + * xe_sriov_migration_data_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_migration_data_read(struct xe_device *xe, unsigned int vf= id, + char __user *buf, size_t len) +{ + ssize_t ret, consumed =3D 0; + + xe_assert(xe, IS_SRIOV_PF(xe)); + + scoped_cond_guard(mutex_intr, return -EINTR, pf_migration_mutex(xe, vfid)= ) { + while (consumed < len) { + ret =3D vf_mig_data_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; +} + +static ssize_t vf_mig_hdr_write(struct xe_sriov_migration_data *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_migration_data_init_from_hdr(data); + if (ret) + return ret; + } + + return len; +} + +static ssize_t vf_mig_data_write(struct xe_sriov_migration_data *data, + const char __user *buf, size_t len) +{ + if (len > data->remaining) + len =3D data->remaining; + + if (copy_from_user(data->vaddr + (data->size - data->remaining), buf, len= )) + return -EFAULT; + + data->remaining -=3D len; + + return len; +} + +static ssize_t vf_mig_data_write_single(struct xe_device *xe, unsigned int= vfid, + const char __user *buf, size_t len) +{ + struct xe_sriov_migration_data **data =3D pf_pick_pending(xe, vfid); + int ret; + ssize_t copied; + + if (IS_ERR_OR_NULL(*data)) { + *data =3D xe_sriov_migration_data_alloc(xe); + if (!*data) + return -ENOMEM; + } + + if ((*data)->hdr_remaining) + copied =3D vf_mig_hdr_write(*data, buf, len); + else + copied =3D vf_mig_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_migration_data_free(*data); + return ret; + } + + *data =3D NULL; + } + + return copied; +} + +/** + * xe_sriov_migration_data_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_migration_data_write(struct xe_device *xe, unsigned int v= fid, + const char __user *buf, size_t len) +{ + ssize_t ret, produced =3D 0; + + xe_assert(xe, IS_SRIOV_PF(xe)); + + scoped_cond_guard(mutex_intr, return -EINTR, pf_migration_mutex(xe, vfid)= ) { + while (produced < len) { + ret =3D vf_mig_data_write_single(xe, vfid, buf, len - produced); + if (ret < 0) + return ret; + + produced +=3D ret; + buf +=3D ret; + } + } + + return produced; +} + +#define MIGRATION_DESCRIPTOR_DWORDS 0 +static size_t pf_descriptor_init(struct xe_device *xe, unsigned int vfid) +{ + struct xe_sriov_migration_data **desc =3D pf_pick_descriptor(xe, vfid); + struct xe_sriov_migration_data *data; + int ret; + + data =3D xe_sriov_migration_data_alloc(xe); + if (!data) + return -ENOMEM; + + ret =3D xe_sriov_migration_data_init(data, 0, 0, XE_SRIOV_MIGRATION_DATA_= TYPE_DESCRIPTOR, + 0, MIGRATION_DESCRIPTOR_DWORDS * sizeof(u32)); + if (ret) { + xe_sriov_migration_data_free(data); + return ret; + } + + *desc =3D data; + + return 0; +} + +static void pf_pending_init(struct xe_device *xe, unsigned int vfid) +{ + struct xe_sriov_migration_data **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_migration_data **trailer =3D pf_pick_trailer(xe, vfid); + struct xe_sriov_migration_data *data; + int ret; + + data =3D xe_sriov_migration_data_alloc(xe); + if (!data) + return -ENOMEM; + + ret =3D xe_sriov_migration_data_init(data, 0, 0, XE_SRIOV_MIGRATION_DATA_= TYPE_TRAILER, + 0, MIGRATION_TRAILER_SIZE); + if (ret) { + xe_sriov_migration_data_free(data); + return ret; + } + + *trailer =3D data; + + return 0; +} + +/** + * xe_sriov_migration_data_save_init() - Initialize the pending save migra= tion data. + * @xe: the &xe_device + * @vfid: the VF identifier + * + * Return: 0 on success, -errno on failure. + */ +int xe_sriov_migration_data_save_init(struct xe_device *xe, unsigned int v= fid) +{ + 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_migration_data.h b/drivers/gpu/drm= /xe/xe_sriov_migration_data.h index 3958f58a170f5..7ec489c3f28d2 100644 --- a/drivers/gpu/drm/xe/xe_sriov_migration_data.h +++ b/drivers/gpu/drm/xe/xe_sriov_migration_data.h @@ -26,5 +26,10 @@ void xe_sriov_migration_data_free(struct xe_sriov_migrat= ion_data *snapshot); int xe_sriov_migration_data_init(struct xe_sriov_migration_data *data, u8 = tile_id, u8 gt_id, enum xe_sriov_migration_data_type, loff_t offset, size_t size); int xe_sriov_migration_data_init_from_hdr(struct xe_sriov_migration_data *= snapshot); +ssize_t xe_sriov_migration_data_read(struct xe_device *xe, unsigned int vf= id, + char __user *buf, size_t len); +ssize_t xe_sriov_migration_data_write(struct xe_device *xe, unsigned int v= fid, + const char __user *buf, size_t len); +int xe_sriov_migration_data_save_init(struct xe_device *xe, unsigned int v= fid); =20 #endif diff --git a/drivers/gpu/drm/xe/xe_sriov_pf_control.c b/drivers/gpu/drm/xe/= xe_sriov_pf_control.c index 8d8a01faf5291..c2768848daba1 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_migration_data.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_migration_data_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..a9a28aec22421 100644 --- a/drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c +++ b/drivers/gpu/drm/xe/xe_sriov_pf_debugfs.c @@ -9,6 +9,7 @@ #include "xe_device.h" #include "xe_device_types.h" #include "xe_pm.h" +#include "xe_sriov_migration_data.h" #include "xe_sriov_pf.h" #include "xe_sriov_pf_control.h" #include "xe_sriov_pf_debugfs.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_migration_data_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_migration_data_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 7be9f026d80e8..8ea531d36f53b 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_migration_data.h" #include "xe_sriov_pf_helpers.h" #include "xe_sriov_pf_migration.h" #include "xe_sriov_printk.h" @@ -53,6 +54,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_pf_migration *migration =3D arg; + + xe_sriov_migration_data_free(migration->pending); + xe_sriov_migration_data_free(migration->trailer); + xe_sriov_migration_data_free(migration->descriptor); +} + /** * xe_sriov_pf_migration_init() - Initialize support for SR-IOV VF migrati= on. * @xe: the &xe_device @@ -62,6 +72,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 @@ -73,7 +84,15 @@ int xe_sriov_pf_migration_init(struct xe_device *xe) for (n =3D 1; n <=3D totalvfs; n++) { struct xe_sriov_pf_migration *migration =3D pf_pick_migration(xe, n); =20 + err =3D devm_mutex_init(xe->drm.dev, &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; @@ -153,6 +172,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_migration_data *data) +{ + if (data->tile !=3D 0 || data->gt !=3D 0) + return -EINVAL; + + xe_sriov_migration_data_free(data); + + return 0; +} + +static int pf_handle_trailer(struct xe_device *xe, unsigned int vfid, + struct xe_sriov_migration_data *data) +{ + struct xe_gt *gt; + u8 gt_id; + + if (data->tile !=3D 0 || data->gt !=3D 0) + return -EINVAL; + if (data->offset !=3D 0 || data->size !=3D 0 || data->buff || data->bo) + return -EINVAL; + + xe_sriov_migration_data_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 @@ -172,6 +221,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->type =3D=3D XE_SRIOV_MIGRATION_DATA_TYPE_DESCRIPTOR) + return pf_handle_descriptor(xe, vfid, data); + if (data->type =3D=3D XE_SRIOV_MIGRATION_DATA_TYPE_TRAILER) + return pf_handle_trailer(xe, vfid, data); + gt =3D xe_device_get_gt(xe, data->gt); if (!gt || data->tile !=3D gt->tile->id) { xe_sriov_err_ratelimited(xe, "VF%d Invalid GT - tile:%u, GT:%u\n", 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 2a45ee4e3ece8..8468e5eeb6d66 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 /** @@ -53,6 +54,14 @@ struct xe_sriov_migration_data { struct xe_sriov_pf_migration { /** @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_migration_data *pending; + /** @trailer: data packet used to indicate the end of stream */ + struct xe_sriov_migration_data *trailer; + /** @descriptor: data packet containing the metadata describing the devic= e */ + struct xe_sriov_migration_data *descriptor; }; =20 #endif --=20 2.50.1