From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D584420323 for ; Mon, 12 Aug 2024 09:28:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723454900; cv=none; b=fuykibgk2tPgpolcNre+QWU9D7DZaFLLX8luQZVR2XpZAWIbkKXHU7ZnTQwORhTbdycDyVtcwwUO4y4eqkucXmhbtCzjaG34V6Z+EUFNXS+NQUkHeW6jazZHQYZt7CLvwXVW9RkFoER3AGFhYVfHZXskSmpdEgntMCwyrg5rx5E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723454900; c=relaxed/simple; bh=7FYc1fgl7r6e3zRwmBhv/PFJXf5w0bnG1iyPmSbNZI0=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=YfAdV4/b1d12ZbaMNL6rUT1fOH/GhXaJCvB/WDJz1XwNd+sToprlCuTiIM6DjWIA1ya1lx7gq78Ae1EMP6FnVZE4GGyBhYGmG/426zA5RYW40O4h7KQXIhMp2/15JYjeAfb2TWtgp0ocTV8KJ8iESKKFaBLV5JdVGbW7PE/Mc9k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uyj3i/A5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="uyj3i/A5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25CBCC4AF0E; Mon, 12 Aug 2024 09:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723454900; bh=7FYc1fgl7r6e3zRwmBhv/PFJXf5w0bnG1iyPmSbNZI0=; h=Subject:To:Cc:From:Date:From; b=uyj3i/A57bfR2xFFONp0hslrmX+WnNRXiB3dXxeyyoswCmemz3/M8YdQ9CGLo5nPk 5nk/pL+hiPECUVKYj25lghm8fHLwXVoK/KR3CyVSfX2L4GXbHt2FpnJdAJOUYalMLS pp2XyV8oHpmQTq6fmVpO+AQ7b9m3npR4XMbd/8d8= Subject: FAILED: patch "[PATCH] drm/xe: Fix NULL ptr dereference in devcoredump" failed to apply to 4.19-stable tree To: matthew.brost@intel.com,jose.souza@intel.com,rodrigo.vivi@intel.com Cc: From: Date: Mon, 12 Aug 2024 11:27:56 +0200 Message-ID: <2024081256-unlearned-uneasily-0cec@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y git checkout FETCH_HEAD git cherry-pick -x f2bf9e95989c0163650dbeaede658d0fcf929063 # git commit -s git send-email --to '' --in-reply-to '2024081256-unlearned-uneasily-0cec@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^.. Possible dependencies: f2bf9e95989c ("drm/xe: Fix NULL ptr dereference in devcoredump") b10d0c5e9df7 ("drm/xe: Add process name to devcoredump") 0eb2a18a8fad ("drm/xe: Implement VM snapshot support for BO's and userptr") be7d51c5b468 ("drm/xe: Add batch buffer addresses to devcoredump") 4376cee62092 ("drm/xe: Print more device information in devcoredump") 98fefec8c381 ("drm/xe: Change devcoredump functions parameters to xe_sched_job") eb9702ad2986 ("drm/xe: Allow num_batch_buffer / num_binds == 0 in IOCTLs") 53bf60f6d850 ("drm/xe: Use a flags field instead of bools for sync parse") 37d078e51b4c ("drm/xe/uapi: Split xe_sync types from flags") fdb6a05383fa ("drm/xe: Internally change the compute_mode and no_dma_fence mode naming") 3ac4a7896d1c ("drm/xe/uapi: Add _FLAG to uAPI constants usable for flags") d5dc73dbd148 ("drm/xe/uapi: Add missing DRM_ prefix in uAPI constants") be13336e07b5 ("drm/xe/pmu: Drop interrupt pmu event") 60f3c7fc5c24 ("drm/xe/uapi: Remove unused QUERY_CONFIG_GT_COUNT") 4195e5e5e3d5 ("drm/xe/uapi: Remove unused QUERY_CONFIG_MEM_REGION_COUNT") 1a912c90a278 ("drm/xe/uapi: Remove GT_TYPE_REMOTE") de84aa96e442 ("drm/xe/uapi: Remove useless XE_QUERY_CONFIG_NUM_PARAM") 44e694958b95 ("drm/xe/display: Implement display support") 571622740288 ("drm/xe: implement driver initiated function-reset") b8d70702def2 ("drm/xe/xe_exec_queue: Add check for access counter granularity") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From f2bf9e95989c0163650dbeaede658d0fcf929063 Mon Sep 17 00:00:00 2001 From: Matthew Brost Date: Thu, 30 May 2024 13:33:41 -0700 Subject: [PATCH] drm/xe: Fix NULL ptr dereference in devcoredump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kernel VM do not have an Xe file. Include a check for Xe file in the VM before trying to get pid from VM's Xe file when taking a devcoredump. Fixes: b10d0c5e9df7 ("drm/xe: Add process name to devcoredump") Cc: Rodrigo Vivi Cc: José Roberto de Souza Cc: stable@vger.kernel.org Signed-off-by: Matthew Brost Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20240530203341.1795181-1-matthew.brost@intel.com diff --git a/drivers/gpu/drm/xe/xe_devcoredump.c b/drivers/gpu/drm/xe/xe_devcoredump.c index 1973bfaece40..d7f2d19a77c1 100644 --- a/drivers/gpu/drm/xe/xe_devcoredump.c +++ b/drivers/gpu/drm/xe/xe_devcoredump.c @@ -176,7 +176,7 @@ static void devcoredump_snapshot(struct xe_devcoredump *coredump, ss->snapshot_time = ktime_get_real(); ss->boot_time = ktime_get_boottime(); - if (q->vm) { + if (q->vm && q->vm->xef) { task = get_pid_task(q->vm->xef->drm->pid, PIDTYPE_PID); if (task) process_name = task->comm;