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 B305DCA101B for ; Fri, 30 Aug 2024 22:22:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 73FFB10EAFD; Fri, 30 Aug 2024 22:22:13 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="GIO0RbiA"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6680E10EAFD for ; Fri, 30 Aug 2024 22:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725056532; x=1756592532; h=date:message-id:from:to:subject:in-reply-to:references: mime-version; bh=Wa09Xlp0wPmJxQyC8OvlQCI86QUExZ/eaAmbRC+ulTo=; b=GIO0RbiAruh974XMtnHeE4x8L4J+RVXWBeTiJEfcmRp1MO020SVumaZM mku6p13As9ocnovJQB0xgxQPMBSqPzqrrkwNSzmPKhbeOSHzqb7FEVZyK kdjy7Z3LEbsUWkYXajVxFQBoYeOxr/d9r4YKYhbWGenDl1grXToccdut/ HanUL4NgXWmrgikjw4rZLsNissiz9AreUIkGyvl8KDJMkVMYt6Wl7RYjS bX5XIKwZbdptAcCDWOdgk/mQno09/spjLu6Nsm66FSNlIj4jb4VP0LQ1t OWAKZr5AUl9DT1T2A8TeceT2kiiEpRnAlYSB0lL3Jyg6W4oCdn8zwzzcm w==; X-CSE-ConnectionGUID: 4UQAR/qLTB2Genlh1c/aPA== X-CSE-MsgGUID: WUfaSGOeT4yXh+VSmd5Cuw== X-IronPort-AV: E=McAfee;i="6700,10204,11180"; a="41210828" X-IronPort-AV: E=Sophos;i="6.10,190,1719903600"; d="scan'208";a="41210828" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2024 15:22:11 -0700 X-CSE-ConnectionGUID: zdW2tK49RyKGGvadOAfWtw== X-CSE-MsgGUID: oc4u+WNORBSlU6vUiirB0Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,190,1719903600"; d="scan'208";a="87263903" Received: from bholling-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.124.22.42]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2024 15:22:11 -0700 Date: Fri, 30 Aug 2024 15:15:49 -0700 Message-ID: <87ed65hd2i.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: intel-xe@lists.freedesktop.org Subject: Re: [PATCH 4/7] drm/xe/oa: Signal output fences In-Reply-To: <20240830221618.2103948-5-ashutosh.dixit@intel.com> References: <20240830221618.2103948-1-ashutosh.dixit@intel.com> <20240830221618.2103948-5-ashutosh.dixit@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII 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, 30 Aug 2024 15:16:15 -0700, Ashutosh Dixit wrote: > > Introduce 'struct xe_oa_fence' which includes the dma_fence used to signal > output fences in the xe_sync array. The fences are signaled > asynchronously. When there are no output fences to signal, the OA > configuration wait is synchronously re-introduced into the ioctl. > > v2: Don't wait in the work, use callback + delayed work (Matt B) > Use a single, not a per-fence spinlock (Matt Brost) > v3: Move ofence alloc before job submission (Matt) > Assert, don't fail, from dma_fence_add_callback (Matt) > Additional dma_fence_get for dma_fence_wait (Matt) > Change dma_fence_wait to non-interruptible (Matt) > v4: Introduce last_fence to prevent uaf if stream is closed with > pending OA config jobs I made a small change to this patch to prevent a potential uaf. Since the change is small and I have tested them, I have retained previous R-b's on the patch. If you want to review again, please grep for 'last_fence' in the patch. Thanks. -- Ashutosh > Suggested-by: Matthew Brost > Reviewed-by: Jonathan Cavitt > Signed-off-by: Ashutosh Dixit > Reviewed-by: Matthew Brost