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 39AFDD6C2AF for ; Tue, 19 Nov 2024 22:08:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E9E6E10E371; Tue, 19 Nov 2024 22:08:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="QHJw2s4h"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 80E2210E371 for ; Tue, 19 Nov 2024 22:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1732054117; x=1763590117; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=rkqkTXKC1v+D+pAH9SQVHFLVMJgq8SA6pEdSFG8ruvo=; b=QHJw2s4h046zWPNgTmqyumq/RZBkJYS14YbnVqldO/6nMJpzocx+3383 h4NlXMi+xnppQXaKKosuPHaeXrLRLZUuIvaeGvixHGlsRD+pCwUtzCGIe 3dFNsv+hQ2hoaSYpFk1pTV0aqKHTgbsNhPzJ/ZytQarwIjM6PVOhNXoqE HXeJrCcYOSbhn00hz3k/It7dXL1/2N7tiWvxpjaE/FjtqMbJ+F92kr0bK TQGM3AelkApvUnFUTEAWOlpGykcO60EHv4HCLVgFsVS1DFzAWwq2Gmbox uDA0TczP5eVf4A2L8VFMcKRNijpOYF57Uj32r8GgaAJZO9kGsnHfwQsxN Q==; X-CSE-ConnectionGUID: fyQPeX7tScSfExC1Pm7+Ag== X-CSE-MsgGUID: Ovv5FcN4RASyGYU+Bt/CyQ== X-IronPort-AV: E=McAfee;i="6700,10204,11261"; a="32333740" X-IronPort-AV: E=Sophos;i="6.12,166,1728975600"; d="scan'208";a="32333740" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2024 14:08:36 -0800 X-CSE-ConnectionGUID: lZ2qMAooTp63+8tI8Iv+mQ== X-CSE-MsgGUID: N4Q8CfknTRuckSi27pFaOg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,166,1728975600"; d="scan'208";a="89698484" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orviesa009.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Nov 2024 14:08:36 -0800 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; Tue, 19 Nov 2024 14:08:35 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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; Tue, 19 Nov 2024 14:08:35 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 19 Nov 2024 14:08:35 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dNnGxJntndy6l0GCTmCkeLv6gYMGgmIN3JNSmstdFm/fMcz+HH5tiFnKV8m+APiSWzyGUS1s9AorTMO6V7zbIVbzfyuhy0oo9/ry2LBsXAZEjUC1BL8iLdjHku942h0SArJjzkksH/g6rMlg8xsPDqVjlC3izk5S9j/ltFdqC3TZ9Xl506LlnFPmMyuN3JOcqikCZ87q35j29hUEbN1OWU9O/LRUKG5r623mTyeapmFGiYbEtbdm25f25RaRGHbGd71bD1K7kgrHetXxMoBVVyfEJXD3QWuMkmroYndy5r5lMZqwA9tPTKZSipAMoJhIFPQaGVHrcXg8e8X/zZm/Fw== 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=PCduPR0DOu4VFNFOZHM4QUg3YOoPvsdmcGyah1h/2+k=; b=gj+gtRYmU9FpaEWyad4BV1MmhCIU5xsqx4jan4UD4krkJU8jRGrA6ZYJjP/kxA1qRw78MvAEr0t3E41ejL+uGOWvmjphV36U3Ziz52oOSd/S9B6QO1GIxgcA9gf58ZfTatHH4HvLBn3POXYjbBhyPvZuVlFgoBauxNkE+G9fRU18cWAvRRSgIjx+3hCNSgJJO3+zXKyRg0cURo7owl9yVU47fQKYsxHT7cZN8XEuLyCDRkeWirFAU819abOnG7dnL/b8Xe6Qq0UVTe2k3USS+8uil80JrPuMHHoH/pWztfCImq7s9ULB6T21D3mTzpReeOojRHNKkuhW+oqgZSy9GA== 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 BL3PR11MB6508.namprd11.prod.outlook.com (2603:10b6:208:38f::5) by DM6PR11MB4610.namprd11.prod.outlook.com (2603:10b6:5:2ab::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.24; Tue, 19 Nov 2024 22:08:32 +0000 Received: from BL3PR11MB6508.namprd11.prod.outlook.com ([fe80::1a0f:84e3:d6cd:e51]) by BL3PR11MB6508.namprd11.prod.outlook.com ([fe80::1a0f:84e3:d6cd:e51%3]) with mapi id 15.20.8158.021; Tue, 19 Nov 2024 22:08:32 +0000 Date: Tue, 19 Nov 2024 14:09:07 -0800 From: Matthew Brost To: "Dixit, Ashutosh" CC: , Umesh Nerlige Ramappa , Jonathan Cavitt Subject: Re: [PATCH] drm/xe/oa: Disallow OA from being enabled on active exec_queue's Message-ID: References: <20241119013256.680030-1-ashutosh.dixit@intel.com> <851pz76ie6.wl-ashutosh.dixit@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <851pz76ie6.wl-ashutosh.dixit@intel.com> X-ClientProxiedBy: MW4PR04CA0069.namprd04.prod.outlook.com (2603:10b6:303:6b::14) To BL3PR11MB6508.namprd11.prod.outlook.com (2603:10b6:208:38f::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL3PR11MB6508:EE_|DM6PR11MB4610:EE_ X-MS-Office365-Filtering-Correlation-Id: 84712e49-e2e6-4065-1172-08dd08e6b497 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?gHutEViofJON1N7ay7/scN5YOBREUl/RhJBIkUsv9QSK4R7V1wgMByX1Uqtp?= =?us-ascii?Q?IcxljEjK0GK/IfJywgdLIjpuwJrLhRgePQQXW3Ib9UuoBEx0Wp/0tcLbWNqY?= =?us-ascii?Q?S6nSdt/t6gaTzR2ycTKhh95umynPmTugYHPuswY6ddvc2WvYK+T2+xQRSOv/?= =?us-ascii?Q?HLjhATveP6wWtRffMnDQIf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Gna?= =?us-ascii?Q?ZBDGc1szT8oYUU0ZHQNX4U8+EnMZ3/SIZTkk3YXBJGAk45lEb8Zbqw4fMmN2?= =?us-ascii?Q?jPmLT+eCUO/95bW3hrcoWvfsrdlMzsmoPLQ/2anHHMiuj/0AIIpaY2V6M7E3?= =?us-ascii?Q?qbxJgf9nC58eYnci5UD4yRv5gzFnoE88MJ3qZa8sWONuRd1/C3x2OIMNRFgp?= =?us-ascii?Q?DwuaqDi17V7avcIrho+y4rWPMv2MSZu+OvLn0YwjOq0NHomD1Zz1fzJKzNA6?= =?us-ascii?Q?6T3t1pkBnRsYoy9xQ7rSTExV?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL3PR11MB6508.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?1KEZmtQ9YM1i10wYhzO87xaFa6udqHVY9lVFitNn3pRjUuXspcX3StzxtNaZ?= =?us-ascii?Q?JEcuBUgMCISkpRZ8JeRNnSX1+FirySBrM32VggShPXQzl/v0EWGCmXGytxvw?= =?us-ascii?Q?LHxbRaRsyUWt71zC1+7YEoSIbN9/CpMklZDv4IzjqXHyDonl+G6lw5CUyXyN?= =?us-ascii?Q?akDsBly/2rTxLeqh5fWfJ75O5XgULHbQl2fpVnCg+wWtlaky7P3WM6cG791J?= =?us-ascii?Q?Nv6LGpjxAKOqsVic4Tegejd2xA3K7h0UzPA817+SsXAwovWVU8L9Xdz71Om0?= =?us-ascii?Q?3BCEAcy0dxix6PX/lkQXXUnlqocqP6JcAwDUPJNpGB5P0Xa0iSHA/FhE3n1K?= =?us-ascii?Q?fQNc+Ybdv1/l9av6iwT6RqD1a8tGmZq3S2c8NDM/UApyhM/af5Y44Gtv00+h?= =?us-ascii?Q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fDf+waWw0oCkqo1CqZ9bwaCUYGf?= =?us-ascii?Q?aUevLiTobkp2RguxACOkDdpmYUqZL2c334xnRVlQbeV05WfaE8kPCoqGFkeP?= =?us-ascii?Q?PzSryJeAoX6nlil7zjD8N9aGg7Uox+jVU0QZhYcBzphHHlTvkOUqlzL3nwFj?= =?us-ascii?Q?76j+qpPJgE9Aelv85FZgpVF9Vl5JwWHI/ecwtLxOfQl/yA3n2C6sAv9p0her?= =?us-ascii?Q?sK2pv4qXgtRfkm6oOInFbOQiTHc7w/8Tc+1LqddSFOAC5KL/cVKyOBu4NdFh?= =?us-ascii?Q?wOPRIqgz8gPXdspe1ATEs+W9qJtrcJJ0khVt2wnaVvst7Mlo8zJf3d3iwV5y?= =?us-ascii?Q?6A=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 84712e49-e2e6-4065-1172-08dd08e6b497 X-MS-Exchange-CrossTenant-AuthSource: BL3PR11MB6508.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 22:08:32.3492 (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: lvrxDFrvbtnrBzqGurtxPsp12rnoXgwLgA+NPnbW/ZAANUOiTX6A+elcteugyhPBBvFyZHIH6p2p1P9hQNRMmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4610 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 Tue, Nov 19, 2024 at 01:08:49PM -0800, Dixit, Ashutosh wrote: > On Tue, 19 Nov 2024 06:44:51 -0800, Matthew Brost wrote: > > > > On Mon, Nov 18, 2024 at 05:32:56PM -0800, Ashutosh Dixit wrote: > > > Enabling OA on an exec_queue toggles the OAC_CONTEXT_ENABLE bit in > > > CTXT_SR_CTL register. Toggling this bit changes the size and layout of the > > > underlying HW context image. Therefore, enabling OA on an already active > > > exec_queue (as currently implemented in xe) is an invalid operation and can > > > cause hangs. Therefore, disallow OA from being enabled on active > > > exec_queue's (here, by active we mean a context on which submissions have > > > previously happened). > > > > > > > This is something we will need to keep on eye on then because in various > > experimental code I've played around enabling exec queues upon creation. > > e.g., If we want to allocate a doorbell. I seem to recall Habana wanting > > to enable exec queues upon creation too. > > The real requirement here is that HW context image should not have been > loaded before OA is enabled on the exec queue. That is what happens today > in the ENABLED state, correct, when user space submissions start? > Yea, that is the current flow. If we change this to enable an exec queue upon allocation we probably could check for ring head & tail == 0. Also note LR queues with preemption fences do toggle the enabled state too. Does OA apply to those queues? If so, a registered check may be better than enabled or maybe just start with ring head & tail == 0. Matt > If operations such as doorbell are only management requests to GuC (which > don't cause HW context image to be loaded) and if we can name a new state > when the exec queue is handed off to userspace for starting submissions, we > should be able to stay with this approach. > > > Just curious if it was ever explored having exec queue creation > > extension which enables OA? It seems like this is something we may need > > at some point if our exec queue creation semantics change of course > > being careful to not break existing flows. > > Yeah I did think of it but didn't want to change the uapi. > Makes sense. > Also, a different implementation is possible which avoids this resizing of > the context image altogether. It requires the kernel OA code submit its > submissions on the user exec queue (and use that exec queue's VM, currently > OA code uses a kernel exec queue). There are some reasons I don't want to > implement that just yet, but worst case, we can do that if absolutely > needed. > > Thanks. > -- > Ashutosh > > > > Transition from 1 -> 0 for this bit was disallowed in > > > '0c8650b09a36 ("drm/xe/oa: Don't reset OAC_CONTEXT_ENABLE on OA stream > > > close")'. Here we disallow the 0 -> 1 transition on active contexts. > > > > > > v2: Don't export exec_queue_enabled, define new xe_exec_queue_op (M Brost) > > > Directly check OAC_CONTEXT_ENABLE bit from context image (J Cavitt) > > > > > > Bspec: 60314 > > > Fixes: 2f4a730fcd2d ("drm/xe/oa: Add OAR support") > > > Cc: stable@vger.kernel.org > > > Signed-off-by: Ashutosh Dixit > > > --- > > > drivers/gpu/drm/xe/xe_exec_queue_types.h | 2 ++ > > > drivers/gpu/drm/xe/xe_guc_submit.c | 1 + > > > drivers/gpu/drm/xe/xe_oa.c | 13 +++++++++++++ > > > 3 files changed, 16 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h > > > index 1158b6062a6cd..b88d617c37b33 100644 > > > --- a/drivers/gpu/drm/xe/xe_exec_queue_types.h > > > +++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h > > > @@ -184,6 +184,8 @@ struct xe_exec_queue_ops { > > > void (*resume)(struct xe_exec_queue *q); > > > /** @reset_status: check exec queue reset status */ > > > bool (*reset_status)(struct xe_exec_queue *q); > > > + /** @enabled: check if exec queue is in enabled state */ > > > + bool (*enabled)(struct xe_exec_queue *q); > > > }; > > > > > > #endif > > > diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c > > > index f9ecee5364d82..b9b9cdb6f768b 100644 > > > --- a/drivers/gpu/drm/xe/xe_guc_submit.c > > > +++ b/drivers/gpu/drm/xe/xe_guc_submit.c > > > @@ -1660,6 +1660,7 @@ static const struct xe_exec_queue_ops guc_exec_queue_ops = { > > > .suspend_wait = guc_exec_queue_suspend_wait, > > > .resume = guc_exec_queue_resume, > > > .reset_status = guc_exec_queue_reset_status, > > > + .enabled = exec_queue_enabled, > > > }; > > > > > > static void guc_exec_queue_stop(struct xe_guc *guc, struct xe_exec_queue *q) > > > diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c > > > index 8dd55798ab312..4a7440c40978c 100644 > > > --- a/drivers/gpu/drm/xe/xe_oa.c > > > +++ b/drivers/gpu/drm/xe/xe_oa.c > > > @@ -2066,6 +2066,19 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f > > > if (XE_IOCTL_DBG(oa->xe, !param.exec_q)) > > > return -ENOENT; > > > > > > + /* > > > + * Disallow OA from being enabled on active exec_queue's. Enabling OA sets the > > > + * OAC_CONTEXT_ENABLE bit in CTXT_SR_CTL register. Toggling the bit changes > > > + * the size and layout of the underlying HW context image and can cause hangs. > > > + */ > > > + if (XE_IOCTL_DBG(oa->xe, > > > + !(xe_lrc_read_ctx_reg(param.exec_q->lrc[0], > > > + CTX_CONTEXT_CONTROL) & CTX_CTRL_OAC_CONTEXT_ENABLE) && > > > + param.exec_q->ops->enabled(param.exec_q))) { > > > + ret = -EADDRINUSE; > > > + goto err_exec_q; > > > + } > > > + > > > if (param.exec_q->width > 1) > > > drm_dbg(&oa->xe->drm, "exec_q->width > 1, programming only exec_q->lrc[0]\n"); > > > } > > > -- > > > 2.41.0 > > >