From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6E12606A31A for ; Wed, 2 Dec 2026 13:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ieB3IFyv Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A4D910E445; Wed, 2 Dec 2026 13:43:25 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 42D461121ED; Wed, 2 Dec 2026 13:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796219000; x=1827755000; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=uSyWgq97Ijjgtz8dbL2fZGGEvKzgL/2P7vNB/duWFCM=; b=ieB3IFyvgJlgd9wpSk9BGCwp8rvPT57aSK4wH45HyWrICOTn612jOp7X 72nt3Fa6rgymzr3EQBcrf1BQb8VOwsknD56YPs1N6SSAcB5ekgH28oVyo dqNNoVRTwK5b75JAlcEi16g1FEyKomj2+ll/rnMvtYYFRpRhEzlKK31af uw6/L/bw8mYm5p9OoQFWt017H54K8GAqP+mHL0pRBSFwTSgdTJxWHCIqC THuqSXFGM8JmmA857MQ4EERr/FW8EPhOAd4RM3Qjd2TDerLT5PLbplNc6 2M/Gkhd3QGhtSIC17HrA4Kf6pMzdc7kJ3mEeGXKWPpxnQO6WissluomBN A==; X-CSE-ConnectionGUID: xwqWMV/qTx2voNxMc/cadg== X-CSE-MsgGUID: km+nxpWbSMuBMnhXu8xZCQ== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="5146720" X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="5146720" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 05:42:25 -0800 X-CSE-ConnectionGUID: 2abQh0ZbQ9OGG/hM8LN3qQ== X-CSE-MsgGUID: xhy78qTISMafl+f7iq6LTQ== X-Ironport-Invalid-End-Of-Message: True X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="13756276" Received: from fmsmsx901.amr.corp.intel.com ([10.18.126.90]) by fmviesa002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 05:42:24 -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.57; Wed, 2 Dec 2026 05:42:23 -0800 Received: from fmsedg903.ED.cps.intel.com (10.1.192.145) 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.57 via Frontend Transport; Wed, 2 Dec 2026 05:42:23 -0800 Received: from DM1PR04CU001.outbound.protection.outlook.com (52.101.61.60) 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.57; Wed, 2 Dec 2026 05:42:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PKKWxdOlhd/brhxFlsa9Ew2+SG4SliMXlAH7dtipG6JVNZOsCM7ftW+7Amr4vgqJoaSB6rCociy5eAIBk23fHe3OguZa2yeQyq5VkIKC88TynjxkhsXAAgw8CMHICqgVhXVgO4utY0PAEjEdjwfe/BYNZfWHMrfj/MM0t8ToykzAc3Gb3qfW66pHisBXUZ4Cu0usy5ElSKmRbxJxaO6hFbArkSmjf/hxYWeH6HrLKqf3MVKUFQjTg+U6LxY6BvshfiBzGHblwwtS+Bg2qMGonfjFrpl1nMCa/ypQlflFN2LJEouOMJQqpgbfsk2/HMPiFoUGwQJB4jzFh5ojeR8NsQ== 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=EaEhymcqbQ6f6g1INgACn6Jf+UF0ytT9jcZ4QfT0QOs=; b=rlfba8caNKlMDInKIUa0tqeP3SxTjWE5ZFm7PpG6FgAIciiMW2Mw/UzA5LA6pEr7fXjV/6B937XO/KwtouCEl/naoyGMgfy7IRTz7UgF24grN9osul4C/PHuziGUuzZj1/4tS3JRTTeh9iS8T1epp9lVTG0CpauVouQMv9VBC+etf02yr2F6qcz7rnHdfAbDwkdaoaDONyD0btrB6WkkE1Mo09ckxmm8Ndx5TcBkNwGro6G9GLCmkABG80VmkpQJCTHEeb/3A0mzehRnO70Q58ZCEk6L6n8xgu8owGN4HpPtGbXFhP75dvt94zphDYdt8Jkxszx78W7DtHODwQKXUw== 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: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS7PR11MB5990.namprd11.prod.outlook.com (2603:10b6:8:71::5) by SN7PR11MB8041.namprd11.prod.outlook.com (2603:10b6:806:2ec::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Wed, 2 Dec 2026 13:42:16 +0000 Received: from DS7PR11MB5990.namprd11.prod.outlook.com ([fe80::133c:5eed:3aec:b899]) by DS7PR11MB5990.namprd11.prod.outlook.com ([fe80::133c:5eed:3aec:b899%3]) with mapi id 15.21.0688.009; Wed, 2 Dec 2026 13:42:16 +0000 Date: Wed, 2 Dec 2026 08:42:13 -0500 From: Rodrigo Vivi To: "Tauro, Riana" CC: , , Aravind Iddamsetty , Tejas Upadhyay , Himal Prasad Ghimiray Subject: Re: [PATCH v7 3/3] drm/xe: Expose retired VRAM pages via drm-ras Message-ID: References: <21df333f4b1e83c0f5bad75c17dac68fee415155.1796060999.git.rodrigo.vivi@intel.com> <32a0015f-aa9f-4b14-8156-14a770fcdc61@intel.com> Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <32a0015f-aa9f-4b14-8156-14a770fcdc61@intel.com> X-ClientProxiedBy: SJ2P220CA0012.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5da::9) To DS7PR11MB5990.namprd11.prod.outlook.com (2603:10b6:8:71::5) X-Archived-By: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR11MB5990:EE_|SN7PR11MB8041:EE_ X-MS-Office365-Filtering-Correlation-Id: e454a0ee-fcbf-4d39-1b55-08df507a141b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|23010399003|376014|22082099003|18002099003|10067099003|56012099006|260925022911599003|260925021911599003|260925021311599003|261026121527099003|261026140227099003|261028144727099003|261022105027099003|261022075727099003|261021121427099003|261102123227099003|261009220027099003|261009221227099003|261009221727099003|261009223327099003|261009223027099003|4143699003|11063799006|6133799003; X-Microsoft-Antispam-Message-Info: gBEgwIOZU20RyuZoAU9NPer27xeorDirxt9X2vUG1dM/7+eS7VqZV6Cralom6PcHE7+Iz/UATT1G1QQBhBNTNvipWyMOu+TArgKA5FnKo+zboWnU4k2KT5LHUvSORjDoaKHy/i7vvlWB2XcYX6/6Zdd9jUfLT4VPX1uMfvsgYn/9tllHhlesS+5B23WQ2BpFpXVA/1Dar6lv4lU1xBtNDaVP2UZ3j+0cwKSAVoRNI1+sdkmsz7TYunNK7uO/6hd5nHk5nstc5Vf7kRRDwI0KzaWAXYwfZnAjBTLN/PRFNJmtFRQYmoo66VFgW6+70lQ0jnwVWAkrxjc+mbvUS8/GhrdIikEYlouGlmMi1fVoVZ29Z2YAPoK7qp2+QbCS/InihykxJyGK85YRcZUE/CE/DMSy+IGfTS1dmt8Pzy6WqyJXVAF4G9FYTc0abz6EWgcSMZUlh6pS6gzPE8UJMbC9JE8OiEbWeaKbvd3YGXTv46h7DEmRH9xVOOr+GmD1XuZWApjDuxcrg0zwGP97sLLb13un/ONL1PEyuEu8DrTkq/6kRjPVyxyLq3L1//RvqvekKMWKBE3w2825SlBFTSa0kFTIGmaCUNwP8t5pzsptHmn1ty+AtloOa5DU/A31RwfCw+O1PpKQiJYVrWV+Dbj177Gn+Dd4gWG0fRQJKhy1vsQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS7PR11MB5990.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(23010399003)(376014)(22082099003)(18002099003)(10067099003)(56012099006)(260925022911599003)(260925021911599003)(260925021311599003)(261026121527099003)(261026140227099003)(261028144727099003)(261022105027099003)(261022075727099003)(261021121427099003)(261102123227099003)(261009220027099003)(261009221227099003)(261009221727099003)(261009223327099003)(261009223027099003)(4143699003)(11063799006)(6133799003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: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-8859-1?Q?5RhHdawUCssbn03OD/E/RxyL1R12KhK76GPcxf/tnFuqKMHLkI3EOQqcDm?= =?iso-8859-1?Q?QbJuQ7BQDw=3D=3D?= X-Exchange-RoutingPolicyChecked: jKFHBYwmsq7cCqz2+5EyYfHl+O6+b4exenQUdHggXNQBq3DwpgtC3R7l2NFwPYlMasTAO4ZgqoYzFRivGyAePRwXBYLsBgJeq5mLdxbRnhDWtyWbhtwkIx2v3TuaWhAXaxV1l3Exl8CIbt1ukyYb+lVkgvJtzNYwY+0wR+4VwqBttqJYaASYUdgykfDes0R2F2CxAUBNUSj6ejdFc1cJtVja9W4hQ9PAoN9PVEgqJEGjbLP+n4IphlNJX1XV1+0L8ZVr0qQ9rOV6w7nEx8LPZbFqMJ3yfZuOJuWpzDLBR39L1oBYl9KW2vF/atbAEnWtTU7jXCfHfkD9ahgkvez5dw== X-MS-Exchange-CrossTenant-Network-Message-Id: e454a0ee-fcbf-4d39-1b55-08df507a141b X-MS-Exchange-CrossTenant-AuthSource: DS7PR11MB5990.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 13:42:16.6048 (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: mcVYelbj4z5m7skJaAEg6sRtVN8/byu78RL/PlLDyy35fR9t6AFaVxujMoxYu8HPC89ywGR35IXVDwm2J+JNTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB8041 X-OriginatorOrg: intel.com X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-xe" X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Wed, Dec 02, 2026 at 11:07:28AM +0530, Tauro, Riana wrote: > > On 30-11-2026 23:23, Rodrigo Vivi wrote: > > From: Aravind Iddamsetty > > > > Retired VRAM pages are only visible through the vram_bad_pages debugfs > > file today. Register a drm-ras retired-pages node so userspace gets > > them, and the maximum number of pages that can be retired, through a > > stable interface. > > > > The snapshot of the dump is taken in one pass over the page lists of > > each VRAM manager, under its lock. > > > > v3 (Rodrigo+LLM): > > - Use the drm-ras retired-pages node type, which replaces the nested > > retired-resources layout (Jakub). > > - Walk the lists under mgr->lock instead of RCU, which they are not > > protected by, and stop reading the buddy blocks (Sashiko). > > - Add a generation counter for interrupted dumps. > > - Keep the vram_bad_pages debugfs file for now. > > - Remove deprecated Assisted-by tag. > > > > v4 (Rodrigo+LLM): > > - Register the node at the end of xe_ras_init(), once the retired page > > lists are fetched. That point is only reached with a system > > controller, which replaces the XE_CRESCENTISLAND check and keeps the > > node off VFs (local Sashiko). > > - Report the list generation also when no page is left (local Sashiko). > > > > v6 (Rodrigo+LLM): > > - Add the pages to the drm-ras snapshot in one pass over the page > > lists, instead of a walk per page, and drop the generation counter > > (Riana). > > - Do not read the pages of an unplugged device (Riana). > > - Return -EINVAL when firmware reports no max pages (Riana). > > - Do not register the node when page offlining is disabled, and do not > > fail probe if the registration fails (Riana). > > > > Cc: Tejas Upadhyay > > Cc: Himal Prasad Ghimiray > > Cc: Riana Tauro > > Signed-off-by: Aravind Iddamsetty > > Reviewed-by: Tejas Upadhyay > > Reviewed-by: Riana Tauro (#xe_drm_ras) > > Signed-off-by: Rodrigo Vivi > > --- > > drivers/gpu/drm/xe/xe_drm_ras.c | 78 ++++++++++++++++++++++++++++ > > drivers/gpu/drm/xe/xe_drm_ras.h | 1 + > > drivers/gpu/drm/xe/xe_ras.c | 2 + > > drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 58 +++++++++++++++++++++ > > drivers/gpu/drm/xe/xe_ttm_vram_mgr.h | 2 + > > 5 files changed, 141 insertions(+) > > > > diff --git a/drivers/gpu/drm/xe/xe_drm_ras.c b/drivers/gpu/drm/xe/xe_drm_ras.c > > index 86c589437a9f..7490281095ae 100644 > > --- a/drivers/gpu/drm/xe/xe_drm_ras.c > > +++ b/drivers/gpu/drm/xe/xe_drm_ras.c > > @@ -13,6 +13,7 @@ > > #include "xe_device_types.h" > > #include "xe_drm_ras.h" > > #include "xe_ras.h" > > +#include "xe_ttm_vram_mgr.h" > > #include "xe_wedge.h" > > static const char * const error_components[] = DRM_XE_RAS_ERROR_COMPONENT_NAMES; > > @@ -272,6 +273,83 @@ static int register_nodes(struct xe_device *xe) > > return ret; > > } > > +static int query_retired_pages(struct drm_ras_node *node, struct drm_ras_retired_pages *list) > > +{ > > + struct xe_device *xe = node->priv; > > + int idx, ret; > > + > > + if (!drm_dev_enter(&xe->drm, &idx)) > > + return -ENODEV; > > + > > + ret = xe_ttm_vram_get_retired_pages(xe, list); > > + > > + drm_dev_exit(idx); > > + > > + return ret; > > +} > > + > > +static int query_retired_pages_info(struct drm_ras_node *node, > > + struct drm_ras_retired_pages_info *info) > > +{ > > + struct xe_device *xe = node->priv; > > + int idx, ret = 0; > > + > > + if (!drm_dev_enter(&xe->drm, &idx)) > > + return -ENODEV; > > + > > + info->max_pages = xe_ras_get_max_pages(xe); > > + if (!info->max_pages) > > + ret = -EINVAL; > > + > > + drm_dev_exit(idx); > > + > > + return ret; > > +} > > + > > +/** > > + * xe_drm_ras_register_retired_pages() - Register the retired VRAM pages node > > + * @xe: xe device instance > > + * > > + * Called once the retired page lists are populated. > > + * > > + * Return: 0 on success, negative error code otherwise. > > + */ > > +int xe_drm_ras_register_retired_pages(struct xe_device *xe) > > +{ > > + struct pci_dev *pdev = to_pci_dev(xe->drm.dev); > > + struct drm_ras_node *node; > > + int ret; > > + > > + if (!xe->info.has_drm_ras || xe_ras_get_disable_vram_page_offline(xe)) > > This is failing build now because of a recent change. > commit a6276b686dd3607638d8d24049253ff62def784d  drm/xe: Invert > vram_page_offline configfs attribute ouch, good catch, thanks for noticing this before the merge. v8 is rebased on today's drm-tip and uses !xe_ras_get_enable_vram_page_offline(xe). The default is still on, and it is set at the start of xe_ras_init(), before we register the node, so the behaviour doesn't change. > > Riana > > > + return 0; > > + > > + node = drmm_kzalloc(&xe->drm, sizeof(*node), GFP_KERNEL); > > + if (!node) > > + return -ENOMEM; > > + > > + node->device_name = kasprintf(GFP_KERNEL, "%04x:%02x:%02x.%d", > > + pci_domain_nr(pdev->bus), pdev->bus->number, > > + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); > > + if (!node->device_name) > > + return -ENOMEM; > > + > > + node->node_name = "vram-retired-pages"; > > + node->type = DRM_RAS_NODE_TYPE_RETIRED_PAGES; > > + node->query_retired_pages = query_retired_pages; > > + node->query_retired_pages_info = query_retired_pages_info; > > + node->priv = xe; > > + > > + ret = drm_ras_node_register(node); > > + if (ret) { > > + drm_err(&xe->drm, "Failed to register DRM RAS retired pages node (%pe)\n", > > + ERR_PTR(ret)); > > + cleanup_node_param(node); > > + return ret; > > + } > > + > > + return drmm_add_action_or_reset(&xe->drm, cleanup_node, node); > > +} > > + > > /** > > * xe_drm_ras_event() - Report drm-ras error event to userspace > > * @xe: xe device structure > > diff --git a/drivers/gpu/drm/xe/xe_drm_ras.h b/drivers/gpu/drm/xe/xe_drm_ras.h > > index 723229b2cffb..a6fc2255986d 100644 > > --- a/drivers/gpu/drm/xe/xe_drm_ras.h > > +++ b/drivers/gpu/drm/xe/xe_drm_ras.h > > @@ -13,6 +13,7 @@ struct xe_device; > > for (i = 0; i < DRM_XE_RAS_ERR_SEV_MAX; i++) > > int xe_drm_ras_init(struct xe_device *xe); > > +int xe_drm_ras_register_retired_pages(struct xe_device *xe); > > void xe_drm_ras_event(struct xe_device *xe, u32 component, u32 severity, u32 value); > > #endif > > diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c > > index f8113530068d..2dd1391724c9 100644 > > --- a/drivers/gpu/drm/xe/xe_ras.c > > +++ b/drivers/gpu/drm/xe/xe_ras.c > > @@ -1523,6 +1523,8 @@ int xe_ras_init(struct xe_device *xe) > > get_offline_list(xe); > > get_offline_queue(xe); > > + xe_drm_ras_register_retired_pages(xe); > > + > > /* > > * During probe, process and log any errors detected by firmware while the driver was not > > * loaded. Critical errors such as Punit and CSC are reported through Pcode init failure, > > diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c > > index 36d47de8b11b..7658ce9f1bd9 100644 > > --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c > > +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c > > @@ -10,6 +10,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > @@ -625,6 +626,63 @@ u64 xe_ttm_vram_get_avail(struct ttm_resource_manager *man) > > return avail; > > } > > +/** > > + * xe_ttm_vram_get_retired_pages - Get a snapshot of the retired VRAM pages > > + * @xe: xe device instance > > + * @list: drm-ras snapshot to add the retired pages to > > + * > > + * Return: 0 on success, negative error code otherwise. > > + */ > > +int xe_ttm_vram_get_retired_pages(struct xe_device *xe, struct drm_ras_retired_pages *list) > > +{ > > + struct xe_ttm_vram_offline_resource *pos; > > + struct drm_ras_retired_page page; > > + struct xe_tile *tile; > > + u8 id; > > + int ret; > > + > > + for_each_tile(tile, xe, id) { > > + struct xe_vram_region *vr = tile->mem.vram; > > + struct ttm_resource_manager *man; > > + struct xe_ttm_vram_mgr *mgr; > > + > > + man = ttm_manager_type(&xe->ttm, XE_PL_VRAM0 + id); > > + if (!man || !vr) > > + continue; > > + mgr = to_xe_ttm_vram_mgr(man); > > + > > + guard(mutex)(&mgr->lock); > > + > > + list_for_each_entry(pos, &mgr->offlined_pages, offlined_link) { > > + page = (struct drm_ras_retired_page) { > > + .address = pos->addr + vr->dpa_base, > > + .size = PAGE_SIZE, > > + .status = DRM_RAS_RETIRED_PAGE_STATUS_RETIRED, > > + }; > > + > > + ret = drm_ras_retired_pages_add(list, &page); > > + if (ret) > > + return ret; > > + } > > + > > + list_for_each_entry(pos, &mgr->queued_pages, queued_link) { > > + page = (struct drm_ras_retired_page) { > > + .address = pos->addr + vr->dpa_base, > > + .size = PAGE_SIZE, > > + .status = pos->status == XE_PAGE_RESERVE_FAIL ? > > + DRM_RAS_RETIRED_PAGE_STATUS_FAILED : > > + DRM_RAS_RETIRED_PAGE_STATUS_PENDING, > > + }; > > + > > + ret = drm_ras_retired_pages_add(list, &page); > > + if (ret) > > + return ret; > > + } > > + } > > + > > + return 0; > > +} > > + > > static int xe_ttm_vram_purge_page(struct xe_device *xe, struct xe_bo *bo) > > { > > u32 q_flag = DRM_XE_EXEC_QUEUE_BAN_REASON_PAGE_OFFLINE; > > diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h > > index d77f067d197b..7fdcd9836148 100644 > > --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h > > +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h > > @@ -9,6 +9,7 @@ > > #include "xe_ttm_vram_mgr_types.h" > > enum dma_data_direction; > > +struct drm_ras_retired_pages; > > struct xe_device; > > struct xe_tile; > > struct xe_vram_region; > > @@ -33,6 +34,7 @@ void xe_ttm_vram_get_used(struct ttm_resource_manager *man, > > u64 *used, u64 *used_visible); > > int xe_ttm_vram_handle_addr_fault(struct xe_device *xe, u64 addr); > > int xe_ttm_vram_inject_fault(struct xe_device *xe); > > +int xe_ttm_vram_get_retired_pages(struct xe_device *xe, struct drm_ras_retired_pages *list); > > static inline struct xe_ttm_vram_mgr_resource * > > to_xe_ttm_vram_mgr_resource(struct ttm_resource *res)