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 611C5C9830E for ; Fri, 25 Sep 2026 07:03:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1489610E586; Fri, 25 Sep 2026 07:03:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="fqmxBxAB"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id C787F10E586 for ; Fri, 25 Sep 2026 07:02:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1790319779; x=1821855779; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=gCfCYofOJ74Mlh5H0F/VSDVTkAtTzUiqkXwwb1ctc8Q=; b=fqmxBxABzzaTQtDleIFwFFvH8benxY0y4HwmNeYYYJigDcGPuQpmvatk 5OA7xJs8LQo+hnwHqRo5Lnf06Gz3efbzPXoOst6A1d/qrL4HpEj4rQYOY 8Uz4urqKiarY18YHbVc38zQEzJjXpRGMGbeoRJ73VPtojTtM50I3GMpjx tmnlbO+tZXc0EcX+rUpM1XSySAOrcNsycpRvFIC7riMJoAzPPTnfUJ9R1 Qu1Ls1mGI9eUTmYIxLvxJ1OWX7WXFDATGP0NjQN6FD5ngq1Aea3s3Bmgy 4ims5nvQsVCxFAfP5eNkysKFqYXSo6RgNvl4vPAjm6042eCsSqih6tNju w==; X-CSE-ConnectionGUID: utXgi1O8Q3SezTI1CphaHQ== X-CSE-MsgGUID: 8aXN4wgFToacyr+9Orsd2A== X-IronPort-AV: E=McAfee;i="6800,10657,11915"; a="91207187" X-IronPort-AV: E=Sophos;i="6.27,122,1787036400"; d="scan'208";a="91207187" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2026 00:02:58 -0700 X-CSE-ConnectionGUID: 2+6SD7BDR9y4d9qQdWeQpA== X-CSE-MsgGUID: t0+YcbvuSkKPRFPrEJhyiA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,122,1787036400"; d="scan'208";a="278964477" Received: from fmsmsx903.amr.corp.intel.com ([10.18.126.92]) by fmviesa004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2026 00:02:58 -0700 Received: from FMSMSX902.amr.corp.intel.com (10.18.126.91) 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.46; Fri, 25 Sep 2026 00:02:58 -0700 Received: from fmsedg903.ED.cps.intel.com (10.1.192.145) 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.46 via Frontend Transport; Fri, 25 Sep 2026 00:02:58 -0700 Received: from BN8PR05CU002.outbound.protection.outlook.com (52.101.57.22) 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.46; Fri, 25 Sep 2026 00:02:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BY57TmsfBeX4/+E3d7NCiqBi2J7fSEgQrZQWCCfQwZBmz926GYF+GmRDJZsQebZJAqtfE4khD9jLXP0jcUaO7AlNPw2X6uP445CofCAp90/Mb+CDgxGG4dcZamOjOCjZL1/UeLAcWWYtpteS3p+/AYA0A/Es4vRjYAryiVOjaJJ4zSzCQ3njsfwJHqLEKXUpr86R6TfDsQ+h5YSLKYo0ChXnpSecTlE4eqdtZpbILzFOu4tA8UvVTYQPOA7HRuTNZ4UpmVDS+nFi4+CxuX213YMyX0w8HACMnMAS8cEmbFs+zw1ttuVsE/6oK0ncYm2zZqfetVNDCNc1bSTFMcjaHg== 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=3s0++0/BBXrIVi2m4q9WhqcF09hTXJqBZyMWBwUWU28=; b=HJI94fM/9147LXmCWylIVnpSSGYOqAQCQLodPLRv52FcjTEPMPJtFj6TMucogI+ZLFFbvZ4etWOQhTLY/zPmcE/3PDbs5J5ocilUhrs6pVWk6jVRPf9qG9VPG5TQS+Zf6wuq+D/bOZSX+CdMfBFRihTZskLhLw2OFZxuud+Sxxs9isC5wIVPIVBc6gTMmlulo22szu452wXesnIyGb2PadzEUn7aEFuBcfLOTNUYuPW/yjXvY433ETiZCVErYCaYWulAgLWp96tWLgV2EzwYar/DNwwTC8rNdoLrWZ5dxV1xT97+7Medeo0FO+DMaYbjtM/FCrCbU/A8bkEqILqvFg== 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 CO1PR11MB4787.namprd11.prod.outlook.com (2603:10b6:303:95::23) by SN7PR11MB7065.namprd11.prod.outlook.com (2603:10b6:806:298::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.451.18; Fri, 25 Sep 2026 07:02:49 +0000 Received: from CO1PR11MB4787.namprd11.prod.outlook.com ([fe80::e7eb:a872:53d1:21fd]) by CO1PR11MB4787.namprd11.prod.outlook.com ([fe80::e7eb:a872:53d1:21fd%4]) with mapi id 15.21.0451.014; Fri, 25 Sep 2026 07:02:49 +0000 Date: Fri, 25 Sep 2026 00:02:47 -0700 From: Matthew Brost To: CC: Subject: Re: [PATCH v7 20/24] drm/xe: Add ULLS migration job support to ring ops Message-ID: References: <20260925045320.1325860-1-matthew.brost@intel.com> <20260925045320.1325860-21-matthew.brost@intel.com> <20260925063845.5830C1F000FF@smtp.kernel.org> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260925063845.5830C1F000FF@smtp.kernel.org> X-ClientProxiedBy: SJ2PR07CA0021.namprd07.prod.outlook.com (2603:10b6:a03:505::23) To CO1PR11MB4787.namprd11.prod.outlook.com (2603:10b6:303:95::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR11MB4787:EE_|SN7PR11MB7065:EE_ X-MS-Office365-Filtering-Correlation-Id: fbe09dcd-cb1d-4d8a-42a9-08df1ad3027d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|23010399003|1800799024|376014|3023799007|6133799003|10067099003|11063799006|5023799004|56012099006|4143699003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: mAn3cHk0KRD794752iQl9kkHljRbznT9TeZ7/gH2QXwQ/Cp2ZQoYU+8ay88Sc9/XyKTLIntbbxxqp6oGW9I1YU5+w22cwem9/zVZ1h8/rwWML9DgQVl4IGVejxCPR5bjLsSlFr/LtlQ5wC7uEtwdACRnzuJ0tW8a/X8fpT1VyvPpSz/wYwsuX+o6//qCk2sb8lJ9HFV9nTWAaGNgl8WJPkW/yRR3evTUBwFNbrquo0MJtPLcQ3078Em7MahMKEWqeTzEkdH9FQe5cu4jupc1SynnFF92UVgpEMbHreoDhpzVnKf1pHyIIeT4KVtRaO3lGz4IWm2P4WGCAKP86bxmCZXtFMwst1DADeONLCxdBxXPpaRB2HomRrrArCja/10kH+34YbdE8xMu8CZTYZoknNr6FgDe3W9iYAFvttZ9Eq0ovYhWatso8qkM9HsyuBdiE22uEQG6vCpjrM+3bZ7EDvs85LPZU5Id2f+ZzroE5KXp3c6EedMzxP1t9nLlRAKN5siDfZGCM37QrmI+EFEgqdXBx2QJj6HiewuCOXxpbHgAoq4KpCskqe27B+TcrRAvVYuowGXPHRVUsuMTR2XufKWwKDKtPVRf/dKGQ7JBmxM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB4787.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(23010399003)(1800799024)(376014)(3023799007)(6133799003)(10067099003)(11063799006)(5023799004)(56012099006)(4143699003)(22082099003)(18002099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?JMJrga3TBDok1dIdW2QPKDVbKorsiphDuwNZTF/AwqKqpnKe3PN9dOZ0lr?= =?iso-8859-1?Q?HVW1CurkdzKUVGvKg8BhxoUvSxie6GTThqIsJXByJZuGc2YzsQE7JRUksv?= =?iso-8859-1?Q?UzNRCaqS3CkPCf/BMSoRJEh94j8qGHYixPajKwdr9DDylNAUdxJmei04/n?= =?iso-8859-1?Q?tZ3ulNvFnhlfugBh7/o2MEZx08kAexafl9r+JAniJ/wXje3Cn1gspz5gBN?= =?iso-8859-1?Q?Yv8QAOh0CXxL9ZGvjuWST/hupdaFjMrV0xbiCKsRwP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dhAIUQ+0OeL7GnO5RXtx8k9ZC24lD+9xdkSxCyO9DI7H0yyGPAjx+7+pMdGU6O+HDnAjiQWy6AftNjmM50JxCojbhFmDLIB1LxgwG1Am26DxnQ== X-MS-Exchange-CrossTenant-Network-Message-Id: fbe09dcd-cb1d-4d8a-42a9-08df1ad3027d X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4787.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2026 07:02:49.3325 (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: QplXMNhuGIexbzajuIt5OqZudPZddubUcRA1l2fgmaG/wXA5aKQCYYY/7yGpTD0h3jf0K2sRxR6gMgmw0yZ/9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7065 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, Sep 25, 2026 at 06:38:44AM +0000, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [High] drm/xe: GPU hang from CS prefetching uninitialized ULLS jobs > -- > > commit ca5d0374fab1065ae65164d64f6d5510acadd964 > Author: Matthew Brost > > drm/xe: Add ULLS migration job support to ring ops > > Add preamble and postamble for ULLS migrations jobs. Preamble clears > current semaphore for reuse. Postamble waits on next semaphore which is > set upon next job submission, then advances the ring tail over that job > with an LRI to RING_TAIL, so submitting it costs the CPU nothing beyond > signalling the semaphore. > > > diff --git a/drivers/gpu/drm/xe/xe_ring_ops.c b/drivers/gpu/drm/xe/xe_ring_ops.c > > index 46ab1f0f35648..9f462bfecb831 100644 > > --- a/drivers/gpu/drm/xe/xe_ring_ops.c > > +++ b/drivers/gpu/drm/xe/xe_ring_ops.c > [ ... ] > > +/* Publish the next job's tail, then park the engine on its semaphore */ > > +static int emit_ulls_postamble(struct xe_gt *gt, struct xe_lrc *lrc, u32 *dw, > > + int i, u32 seqno, u32 head) > > +{ > > + i = emit_ulls_ring_tail(gt, lrc, dw, i, head); > > + > > + dw[i++] = MI_SEMAPHORE_WAIT | > > + MI_SEMW_GGTT | > > + MI_SEMW_POLL | > > + MI_SEMW_COMPARE(SAD_EQ_SDD); > > + dw[i++] = LRC_MIGRATION_ULLS_SEMAPHORE_SIGNAL; > > [Severity: High] All semmly non-issues during testing. I believe the semaphore wait acts as prefetch flush. Matt > Does updating the ring tail to the next job's boundary before blocking on > the semaphore open a window where the Command Streamer (CS) prefetcher can > fetch uninitialized memory into its instruction cache? > > When the CPU later writes the next job and signals the semaphore, the > absence of an MMIO tail update means the CS cache might not be invalidated. > Could this cause the CS to execute stale data and hang the GPU? > > [ ... ] > > +/* Pad out to the fixed ULLS job size */ > > +static int emit_ulls_pad(struct xe_gt *gt, u32 *dw, int i) > > +{ > > + xe_gt_assert(gt, i <= ULLS_JOB_SIZE_DW); > > + > > + while (i < ULLS_JOB_SIZE_DW) > > + dw[i++] = MI_NOOP; > > + > > + return i; > > +} > > [Severity: High] > If a ULLS job reaches the maximum size of ULLS_JOB_SIZE_DW (which is 48), > this loop will provide 0 NOOPs of padding. > > Will this fail to buffer the prefetcher from the next job's uninitialized > memory, exacerbating the prefetching issue mentioned above? > > [ ... ] > > diff --git a/drivers/gpu/drm/xe/xe_ring_ops_types.h b/drivers/gpu/drm/xe/xe_ring_ops_types.h > > index 52ff96bc41004..ea4af321dd7c4 100644 > > --- a/drivers/gpu/drm/xe/xe_ring_ops_types.h > > +++ b/drivers/gpu/drm/xe/xe_ring_ops_types.h > [ ... ] > > +/* > > + * ULLS migration jobs advance the ring tail from within the ring itself, so a > > + * job has to know where its successor will end before that successor has been > > + * emitted. Every ULLS job is therefore padded to a fixed size, letting the > > + * next tail be derived arithmetically. > > + * > > + * Sized for the largest such job, emitted by emit_migration_job_gen12(): > > + * preamble (4), copy timestamp (8, its size on an SRIOV VF), start seqno > > + * store (4), arbitration off (1), batch buffer starts (2 * 3), pre-parser > > + * bracketed flush invalidate (6), seqno flush (4), user interrupt (3) and > > + * postamble (7 + 5). > > + */ > > +#define ULLS_JOB_SIZE_DW 48 > > +#define ULLS_JOB_SIZE_BYTES (ULLS_JOB_SIZE_DW * 4) > > [Severity: High] > Since this maximum size is exactly equal to the maximal job length, it > guarantees no NOOP padding is appended for the largest jobs. > > Should this maximum size account for additional NOOPs to safely pad the > CS prefetch window? > > -- > Sashiko AI review · https://sashiko.dev/#/patchset/20260925045320.1325860-1-matthew.brost@intel.com?part=20