From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0D95E6F07D for ; Fri, 1 Nov 2024 19:15:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 918A410E176; Fri, 1 Nov 2024 19:15:54 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="E6G/aJN7"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E7E610E176 for ; Fri, 1 Nov 2024 19:15:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730488553; x=1762024553; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=wvUFdIq0eeHUXiJQfw6DryWkheeFA+d7s0pPX9n4NIU=; b=E6G/aJN7+ORbaODkU7JFWgBQRo15xfeaXe/PyqmsTKxqrEL2xZgnAnIe 5B2vAJL7smd/fkIk+tAFEuCKGFDEUtBFDniTLK4ygW3i2AAPe0EsVh5xg 9i2jzagFz0skRkES9a7A8eiKugBM3Caf6KvOgv0MBBoxJfPDCtlSlfSwU eYiYf7nRfXnDPjMGBnLw5eA5H+DrXc+y+dV102nDjNS5qiTsUzxLYIF/j Fcg9Eg+XlJqn/qKtbV5DPWMkQAcM+URKF+VuPmv3FNp/KKgmR0tbuSj8m tWbavVPZAWmTf66C3J2a8/Hx1imFXxcDPb22mpqFuzT8T8ToKIo9U0oid Q==; X-CSE-ConnectionGUID: PU+pN4x4R1q4IME4w98Opg== X-CSE-MsgGUID: NdGsMIqLS8GPGEJu/HRpVg== X-IronPort-AV: E=McAfee;i="6700,10204,11243"; a="41658796" X-IronPort-AV: E=Sophos;i="6.11,250,1725346800"; d="scan'208";a="41658796" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 12:15:53 -0700 X-CSE-ConnectionGUID: RmSXyFccS7uk2Tg5nQd+lw== X-CSE-MsgGUID: OiIAu8+0SmGma+pILaBvLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,250,1725346800"; d="scan'208";a="83498229" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orviesa007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 01 Nov 2024 12:15:53 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 1 Nov 2024 12:15:52 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Fri, 1 Nov 2024 12:15:52 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.169) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 1 Nov 2024 12:15:52 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tL5W40nwxNHVqodwb2bb7vIhOVdxN6pWfFE4RStNIIPyvgGueA7dQheBDkb/pIGogKqjNYr+j7KWlcI28IlO27xvLyhPACLStLbmsPRreUKlqhaMtO16LD6PqtQuIVKVTozgEUCOk/zkUM7cQOpIt/I3eiyi8AINYausDSb65IcUzlLUnfpP/kygGSamPwVPphKSQV6UKK+xEuDtOogINC/shlGMQ6nvpWlwoOSYRywNluIFOaKGk0KFwa5r0RA3sJ1fnHtxD72h05qf2Hhwr/q64pmQamUIn8apltSNSpyl3achclW7VKZ9O7BvRGEbVonp5INli1rloGgHU8v0mQ== 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=kRbgUw0nbCMrBmch/ztlu7+V2egxbszpWFe91rkB10Y=; b=wUnKR2C3pt+S2HLuzmpU3Gc9Ed0P+1DUAnvOs3D5f/A1sPASvXbnW2ah6ZNRP1yAZCdy08MHGn77TWFWyOov+fFbVCM68BNTcxwd+8imMthqNJrsFE1INQAuWGk2aSWqySe7WEwVrjYagG9SRFGvwfMh3R+j4aqygiMFqSHLWz+WQan4XBrDcIi58mzlhFPpwVd7jRuka6D2j0YNyUkZhIUH9N5AQemmtEWlFVBrQoW/rhNfVtsmSZ0Bt3LxjXSx+x/BW9P0U/+Fx6uX/rGQTvBExmNLP0wxYLN7hmHHsbVd8I8jS/Zl/nufT3/HFkzicXWmDtJtzjF3mqZkliWz7g== 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 PH7PR11MB6522.namprd11.prod.outlook.com (2603:10b6:510:212::12) by SA0PR11MB4573.namprd11.prod.outlook.com (2603:10b6:806:98::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.23; Fri, 1 Nov 2024 19:15:49 +0000 Received: from PH7PR11MB6522.namprd11.prod.outlook.com ([fe80::9e94:e21f:e11a:332]) by PH7PR11MB6522.namprd11.prod.outlook.com ([fe80::9e94:e21f:e11a:332%6]) with mapi id 15.20.8114.015; Fri, 1 Nov 2024 19:15:49 +0000 Date: Fri, 1 Nov 2024 12:16:19 -0700 From: Matthew Brost To: Lucas De Marchi CC: Matthew Auld , , , Subject: Re: [PATCH v2] drm/xe: improve hibernation on igpu Message-ID: References: <20241101170156.213490-2-matthew.auld@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MW4PR04CA0214.namprd04.prod.outlook.com (2603:10b6:303:87::9) To PH7PR11MB6522.namprd11.prod.outlook.com (2603:10b6:510:212::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR11MB6522:EE_|SA0PR11MB4573:EE_ X-MS-Office365-Filtering-Correlation-Id: fc19d3f6-c865-41e2-b9c2-08dcfaa99856 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?bhIGsRT9EnYhs4pURanGQYYx39DeUiunpM3KUcQ9j1xws680IexDkpxtiinf?= =?us-ascii?Q?uPg7Y6TO/A52GT0/4hE0TVB8Oa1HOpLcGRKWk9oHvkOEQzozDh5rvUTVjiUC?= =?us-ascii?Q?cirnsAHHa900GO3o3QoRWkhuij4n4BxhoekkRf9LqfRSCW8tw/f1AHE/Boto?= =?us-ascii?Q?AiUDhlt9XAkLt4WiYckeDzaiud3LYjFvZtYCKUTDJSwvVVSVGngbOqT2aWW5?= =?us-ascii?Q?heuV8bmM/WRzMhxbCv29BJBD72TS5oBubMvgSLM9hJW3GlrQuWQnXFV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uBeDIAWoFMQn47ztY5p4mFnVcf++oPzNzFY2icz?= =?us-ascii?Q?6C9s4JOXZy29KiTbpFlTnkYYF6T843ZkzBlStX2EapPSvX41rqssruE5Z+bX?= =?us-ascii?Q?+yXE9+OYnvcQLVWZPCkW?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR11MB6522.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LjJSZtU8HqBgQxouYKwTc9dq6HN25fxShjhKiMQSDy9lHizkbnnIsikDuDlp?= =?us-ascii?Q?eaOoQhLOVdOUcDODM3PuUABD9i4t/NocAjnSmVXvxGIYqUPo+9XDRMJZ77d6?= =?us-ascii?Q?kPblvXpXT8jJD0bb0mOnEipV2/6r2MB2+DPHETDpCrQdckocum/I7t6ScNzd?= =?us-ascii?Q?xoa2mu/ezNtsJpT7ZCeAeiZJhZaY6HdQ7/u0iFmPKTZQXiXGLhs/NBag13z6?= =?us-ascii?Q?uUaSx7eUNPUJEXy/v9/cbqRBZEuCi/ZlbN3kFddheJGD5dJIU2Swp37/rSus?= =?us-ascii?Q?whoZrQZA7b/u7VXfGgn/6GmrKpt9DhaSoCycPxtWzsy+GajdYwwM2WEaETqx?= =?us-ascii?Q?pDgOudKC7aX6bpi8Q4G1jBYWyUwzplk6E1pbKwsFX4L+MXWBoaefuBsjVXEN?= =?us-ascii?Q?jn4+mr68LPu7nUvIneNyuWlTSa8aj90qd2fh+kz2UTq+DGQJRigSsWoaQcD5?= =?us-ascii?Q?ytPA09fbbN1Owjx4e0wjFVWBy6YekzFHq4bw9kOZb3WxtAsAdSLw/fzzpFAQ?= =?us-ascii?Q?A9g4kXRoLeN7Kk7H072jPMawzkdQ4zrA3ou03wMwjhLn4HL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J4aeeEnuD8CSdOz3ZebevHXlLTU2t9W+nN5q+fP37iKRb9O?= =?us-ascii?Q?fptLYOxSFEBeVaDeJE9FA6SMTDpru5ycxqYO8Y8H+5nhaRuMr0wYNFHS63G/?= =?us-ascii?Q?385QNCS5mvx+BZTK5zie62oGMzxlX+4fILOrrshN5Ni4TPKGT4+Tvfz0cZ2o?= =?us-ascii?Q?MQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: fc19d3f6-c865-41e2-b9c2-08dcfaa99856 X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB6522.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2024 19:15:49.3853 (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: puazDSyPeV6howqcCyt/V/YyOa618tlCNGt9nBQQMXuku4M7XFmuSq6KG581rphfrB5BRfNYxi74+VQJWjq+1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4573 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-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Fri, Nov 01, 2024 at 12:38:19PM -0500, Lucas De Marchi wrote: > On Fri, Nov 01, 2024 at 05:01:57PM +0000, Matthew Auld wrote: > > The GGTT looks to be stored inside stolen memory on igpu which is not > > treated as normal RAM. The core kernel skips this memory range when > > creating the hibernation image, therefore when coming back from > > can you add the log for e820 mapping to confirm? > > > hibernation the GGTT programming is lost. This seems to cause issues > > with broken resume where GuC FW fails to load: > > > > [drm] *ERROR* GT0: load failed: status = 0x400000A0, time = 10ms, freq = 1250MHz (req 1300MHz), done = -1 > > [drm] *ERROR* GT0: load failed: status: Reset = 0, BootROM = 0x50, UKernel = 0x00, MIA = 0x00, Auth = 0x01 > > [drm] *ERROR* GT0: firmware signature verification failed > > [drm] *ERROR* CRITICAL: Xe has declared device 0000:00:02.0 as wedged. > > it seems the message above is cut short. Just above these lines don't > you have a log with __xe_guc_upload? Which means: we actually upload the > firmware again to stolen and it doesn't matter that we lost it when > hibernating. > The image is always uploaded. The upload logic uses a GGTT address to find firmware image in SRAM... See snippet from uc_fw_xfer: 821 /* Set the source address for the uCode */ 822 src_offset = uc_fw_ggtt_offset(uc_fw) + uc_fw->css_offset; 823 xe_mmio_write32(mmio, DMA_ADDR_0_LOW, lower_32_bits(src_offset)); 824 xe_mmio_write32(mmio, DMA_ADDR_0_HIGH, 825 upper_32_bits(src_offset) | DMA_ADDRESS_SPACE_GGTT); If the GGTT mappings are in stolen and not restored we will not be uploading the correct data for the image. See the gitlab issue, this has been confirmed to fix a real problem from a customer. Matt > It'd be good to know the size of the rsa key in the failing scenarios. > > Also it seems this is also reproduced in DG2 and I wonder if it's the > same issue or something different: > > [drm:__xe_guc_upload.isra.0 [xe]] GT0: load still in progress, timeouts = 0, freq = 1700MHz (req 2050MHz), status = 0x00000064 [0x32/00] > [drm:__xe_guc_upload.isra.0 [xe]] GT0: load still in progress, timeouts = 0, freq = 1700MHz (req 2050MHz), status = 0x00000072 [0x39/00] > [drm:__xe_guc_upload.isra.0 [xe]] GT0: load still in progress, timeouts = 0, freq = 1700MHz (req 2050MHz), status = 0x00000086 [0x43/00] > [drm] *ERROR* GT0: load failed: status = 0x400000A0, time = 5ms, freq = 1700MHz (req 2050MHz), done = -1 > [drm] *ERROR* GT0: load failed: status: Reset = 0, BootROM = 0x50, UKernel = 0x00, MIA = 0x00, Auth = 0x01 > [drm] *ERROR* GT0: firmware signature verification failed > > Cc Ulisses. > > > > > Current GGTT users are kernel internal and tracked as pinned, so it > > should be possible to hook into the existing save/restore logic that we > > use for dgpu, where the actual evict is skipped but on restore we > > importantly restore the GGTT programming. This has been confirmed to > > fix hibernation on at least ADL and MTL, though likely all igpu > > platforms are affected. > > > > This also means we have a hole in our testing, where the existing s4 > > tests only really test the driver hooks, and don't go as far as actually > > rebooting and restoring from the hibernation image and in turn powering > > down RAM (and therefore losing the contents of stolen). > > yeah, the problem is that enabling it to go through the entire sequence > we reproduce all kind of issues in other parts of the kernel and userspace > env leading to flaky tests that are usually red in CI. The most annoying > one is the network not coming back so we mark the test as failure > (actually abort. since we stop running everything). > > > > > > v2 (Brost) > > - Remove extra newline and drop unnecessary parentheses. > > > > Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") > > Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3275 > > Signed-off-by: Matthew Auld > > Cc: Matthew Brost > > Cc: # v6.8+ > > Reviewed-by: Matthew Brost > > --- > > drivers/gpu/drm/xe/xe_bo.c | 37 ++++++++++++++------------------ > > drivers/gpu/drm/xe/xe_bo_evict.c | 6 ------ > > 2 files changed, 16 insertions(+), 27 deletions(-) > > > > diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c > > index 8286cbc23721..549866da5cd1 100644 > > --- a/drivers/gpu/drm/xe/xe_bo.c > > +++ b/drivers/gpu/drm/xe/xe_bo.c > > @@ -952,7 +952,10 @@ int xe_bo_restore_pinned(struct xe_bo *bo) > > if (WARN_ON(!xe_bo_is_pinned(bo))) > > return -EINVAL; > > > > - if (WARN_ON(xe_bo_is_vram(bo) || !bo->ttm.ttm)) > > + if (WARN_ON(xe_bo_is_vram(bo))) > > + return -EINVAL; > > + > > + if (WARN_ON(!bo->ttm.ttm && !xe_bo_is_stolen(bo))) > > return -EINVAL; > > > > if (!mem_type_is_vram(place->mem_type)) > > @@ -1774,6 +1777,7 @@ int xe_bo_pin_external(struct xe_bo *bo) > > > > int xe_bo_pin(struct xe_bo *bo) > > { > > + struct ttm_place *place = &bo->placements[0]; > > struct xe_device *xe = xe_bo_device(bo); > > int err; > > > > @@ -1804,8 +1808,6 @@ int xe_bo_pin(struct xe_bo *bo) > > */ > > if (IS_DGFX(xe) && !(IS_ENABLED(CONFIG_DRM_XE_DEBUG) && > > bo->flags & XE_BO_FLAG_INTERNAL_TEST)) { > > - struct ttm_place *place = &(bo->placements[0]); > > - > > if (mem_type_is_vram(place->mem_type)) { > > xe_assert(xe, place->flags & TTM_PL_FLAG_CONTIGUOUS); > > > > @@ -1813,13 +1815,12 @@ int xe_bo_pin(struct xe_bo *bo) > > vram_region_gpu_offset(bo->ttm.resource)) >> PAGE_SHIFT; > > place->lpfn = place->fpfn + (bo->size >> PAGE_SHIFT); > > } > > + } > > > > - if (mem_type_is_vram(place->mem_type) || > > - bo->flags & XE_BO_FLAG_GGTT) { > > - spin_lock(&xe->pinned.lock); > > - list_add_tail(&bo->pinned_link, &xe->pinned.kernel_bo_present); > > - spin_unlock(&xe->pinned.lock); > > - } > > + if (mem_type_is_vram(place->mem_type) || bo->flags & XE_BO_FLAG_GGTT) { > > should this test for devmem so we restore everything rather than just > ggtt? > > Lucas De Marchi > > > + spin_lock(&xe->pinned.lock); > > + list_add_tail(&bo->pinned_link, &xe->pinned.kernel_bo_present); > > + spin_unlock(&xe->pinned.lock); > > } > > > > ttm_bo_pin(&bo->ttm); > > @@ -1867,24 +1868,18 @@ void xe_bo_unpin_external(struct xe_bo *bo) > > > > void xe_bo_unpin(struct xe_bo *bo) > > { > > + struct ttm_place *place = &bo->placements[0]; > > struct xe_device *xe = xe_bo_device(bo); > > > > xe_assert(xe, !bo->ttm.base.import_attach); > > xe_assert(xe, xe_bo_is_pinned(bo)); > > > > - if (IS_DGFX(xe) && !(IS_ENABLED(CONFIG_DRM_XE_DEBUG) && > > - bo->flags & XE_BO_FLAG_INTERNAL_TEST)) { > > - struct ttm_place *place = &(bo->placements[0]); > > - > > - if (mem_type_is_vram(place->mem_type) || > > - bo->flags & XE_BO_FLAG_GGTT) { > > - spin_lock(&xe->pinned.lock); > > - xe_assert(xe, !list_empty(&bo->pinned_link)); > > - list_del_init(&bo->pinned_link); > > - spin_unlock(&xe->pinned.lock); > > - } > > + if (mem_type_is_vram(place->mem_type) || bo->flags & XE_BO_FLAG_GGTT) { > > + spin_lock(&xe->pinned.lock); > > + xe_assert(xe, !list_empty(&bo->pinned_link)); > > + list_del_init(&bo->pinned_link); > > + spin_unlock(&xe->pinned.lock); > > } > > - > > ttm_bo_unpin(&bo->ttm); > > } > > > > diff --git a/drivers/gpu/drm/xe/xe_bo_evict.c b/drivers/gpu/drm/xe/xe_bo_evict.c > > index 32043e1e5a86..b01bc20eb90b 100644 > > --- a/drivers/gpu/drm/xe/xe_bo_evict.c > > +++ b/drivers/gpu/drm/xe/xe_bo_evict.c > > @@ -34,9 +34,6 @@ int xe_bo_evict_all(struct xe_device *xe) > > u8 id; > > int ret; > > > > - if (!IS_DGFX(xe)) > > - return 0; > > - > > /* User memory */ > > for (mem_type = XE_PL_VRAM0; mem_type <= XE_PL_VRAM1; ++mem_type) { > > struct ttm_resource_manager *man = > > @@ -125,9 +122,6 @@ int xe_bo_restore_kernel(struct xe_device *xe) > > struct xe_bo *bo; > > int ret; > > > > - if (!IS_DGFX(xe)) > > - return 0; > > - > > spin_lock(&xe->pinned.lock); > > for (;;) { > > bo = list_first_entry_or_null(&xe->pinned.evicted, > > -- > > 2.47.0 > >