Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: <intel-xe@lists.freedesktop.org>, <matthew.brost@intel.com>,
	<maarten.lankhorst@linux.intel.com>, <philippe.lecluse@intel.com>,
	<mchehab@kernel.org>
Subject: Re: [Intel-xe] [PATCH 27/37] drm/xe: Ensure VMA not userptr before calling xe_bo_is_stolen
Date: Fri, 3 Feb 2023 14:56:08 -0500	[thread overview]
Message-ID: <Y91m2FDhTmRIPcRf@intel.com> (raw)
In-Reply-To: <20230112222538.2000142-28-rodrigo.vivi@intel.com>

On Thu, Jan 12, 2023 at 05:25:28PM -0500, Rodrigo Vivi wrote:
> From: Matthew Brost <matthew.brost@intel.com>
> 
> Fix the below splat:
> 
> [  142.510525] [IGT] xe_exec_basic: starting subtest once-userptr
> [  142.511339] BUG: kernel NULL pointer dereference, address: 0000000000000228
> [  142.518311] #PF: supervisor read access in kernel mode
> [  142.523458] #PF: error_code(0x0000) - not-present page
> [  142.528604] PGD 0 P4D 0
> [  142.531153] Oops: 0000 [#1] PREEMPT SMP NOPTI
> [  142.535518] CPU: 4 PID: 1199 Comm: kworker/u16:8 Not tainted 6.1.0-rc1-xe+ #1
> [  142.542656] Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.3243.A01.2006102133 06/10/2020
> [  142.556033] Workqueue: events_unbound async_op_work_func [xe]
> [  142.561810] RIP: 0010:xe_bo_is_stolen+0x0/0x20 [xe]
> [  142.566709] Code: 20 c8 75 05 83 fa 07 74 05 c3 cc cc cc cc 48 8b 87 08 02 00 00 0f b6 80 2c ff ff ff c3 cc cc cc cc 66 0f 1f 84 00 00 00 00 00 <48> 8b 87 28 02 00 00 83 78 10 07 0f 94 c0 c3 cc cc cc cc 66 66 2e
> [  142.585447] RSP: 0018:ffffc900019eb888 EFLAGS: 00010246
> [  142.590678] RAX: 0000000000000002 RBX: 0000000000000000 RCX: ffff88813f6a2108
> [  142.597821] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> [  142.604962] RBP: ffffc900019ebbc0 R08: 0000000000000001 R09: 0000000000000000
> [  142.612101] R10: 0000000000000001 R11: 0000000000000001 R12: ffff88814107d600
> [  142.619242] R13: ffffc900019eba20 R14: ffff888140442000 R15: 0000000000000000
> [  142.626378] FS:  0000000000000000(0000) GS:ffff88849fa00000(0000) knlGS:0000000000000000
> [  142.634468] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [  142.640219] CR2: 0000000000000228 CR3: 000000010a4c0006 CR4: 0000000000770ee0
> [  142.647361] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [  142.654505] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [  142.661639] PKRU: 55555554
> [  142.664367] Call Trace:
> [  142.666830]  <TASK>
> [  142.668947]  __xe_pt_bind_vma+0x1a1/0xa50 [xe]
> [  142.673417]  ? unwind_next_frame+0x187/0x770
> [  142.677699]  ? __thaw_task+0xc0/0xc0
> [  142.681293]  ? __lock_acquire+0x5e4/0x26e0
> [  142.685409]  ? lockdep_hardirqs_on+0xbf/0x140
> [  142.689779]  ? lock_acquire+0xd2/0x310
> [  142.693548]  ? mark_held_locks+0x49/0x80
> [  142.697485]  ? xe_vm_bind_vma+0xf1/0x3d0 [xe]
> [  142.701866]  xe_vm_bind_vma+0xf1/0x3d0 [xe]
> [  142.706082]  xe_vm_bind+0x76/0x140 [xe]
> [  142.709944]  vm_bind_ioctl+0x26f/0xb40 [xe]
> [  142.714161]  ? async_op_work_func+0x20c/0x450 [xe]
> [  142.718974]  async_op_work_func+0x20c/0x450 [xe]
> [  142.723620]  process_one_work+0x263/0x580
> [  142.727645]  ? process_one_work+0x580/0x580
> [  142.731839]  worker_thread+0x4d/0x3b0
> [  142.735518]  ? process_one_work+0x580/0x580
> [  142.739714]  kthread+0xeb/0x120
> [  142.742872]  ? kthread_complete_and_exit+0x20/0x20
> [  142.747671]  ret_from_fork+0x1f/0x30
> [  142.751264]  </TASK>
> 
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_pt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
> index c8b3b1975098..9e07ad41a007 100644
> --- a/drivers/gpu/drm/xe/xe_pt.c
> +++ b/drivers/gpu/drm/xe/xe_pt.c
> @@ -758,7 +758,7 @@ xe_pt_stage_bind(struct xe_gt *gt, struct xe_vma *vma,
>  		else
>  			xe_walk.cache = XE_CACHE_WB;
>  	}
> -	if (xe_bo_is_stolen(bo))
> +	if (!xe_vma_is_userptr(vma) && xe_bo_is_stolen(bo))
>  		xe_walk.dma_offset = xe_ttm_stolen_gpu_offset(xe_bo_device(bo));
>  
>  	xe_bo_assert_held(bo);
> -- 
> 2.38.1
> 

  reply	other threads:[~2023-02-03 19:56 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 22:25 [Intel-xe] [PATCH 00/37] Catching up since we went public Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 01/37] drm/msm: Fix compile error Rodrigo Vivi
2023-01-31 18:48   ` Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 02/37] drm/xe: Implement a local xe_mmio_wait32 Rodrigo Vivi
2023-01-31 18:49   ` Rodrigo Vivi
2023-02-01  4:44     ` Matthew Brost
2023-01-12 22:25 ` [Intel-xe] [PATCH 03/37] drm/xe: Stop using i915's range_overflows_t macro Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 04/37] drm/xe: Let's return last value read on xe_mmio_wait32 Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 05/37] drm/xe: Convert guc_ready to regular xe_mmio_wait32 Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 06/37] drm/xe: Wait for success on guc done Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 07/37] drm/xe: Remove i915_utils dependency from xe_guc_pc Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 08/37] drm/xe: Stop using i915_utils in xe_wopcm Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 09/37] drm/xe: Let's avoid i915_utils in the xe_force_wake Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 10/37] drm/xe: Convert xe_mmio_wait32 to us so we can stop using wait_for_us Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 11/37] drm/xe: Remove i915_utils dependency from xe_pcode Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 12/37] drm/xe/migrate: Add kerneldoc for the migrate subsystem Rodrigo Vivi
2023-01-20 23:03   ` Mauro Carvalho Chehab
2023-01-12 22:25 ` [Intel-xe] [PATCH 13/37] drm/xe: Take memory ref on kernel job creation Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 14/37] drm/xe: Add intel_pps support too Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 15/37] drm/xe: Rework initialisation ordering slightly so we can inherit fb Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 16/37] drm/xe: Implement stolen memory Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 17/37] drm/xe: Allow fbdev to allocate " Rodrigo Vivi
2023-01-24 15:42   ` Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 18/37] drm/xe: Implement initial hw readout for framebuffer Rodrigo Vivi
2023-01-24 15:43   ` Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 19/37] drm/xe: Put DPT into stolen memory, if available Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 20/37] drm/xe: Implement FBC support Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 21/37] drm/i915: Remove i915_drm_suspend_mode Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 22/37] drm/xe: Fix compilation when Xe driver is builtin Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 23/37] drm/xe: Fix dumb bo create Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 24/37] drm/i915: Expand force_probe to block probe of devices as well Rodrigo Vivi
2023-01-20 23:08   ` Mauro Carvalho Chehab
2023-01-12 22:25 ` [Intel-xe] [PATCH 25/37] drm/xe: Introduce force_probe parameter Rodrigo Vivi
2023-01-20 23:07   ` Mauro Carvalho Chehab
2023-01-12 22:25 ` [Intel-xe] [PATCH 26/37] Revert "drm/xe: Validate BO on CPU fault" Rodrigo Vivi
2023-01-24 15:44   ` Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 27/37] drm/xe: Ensure VMA not userptr before calling xe_bo_is_stolen Rodrigo Vivi
2023-02-03 19:56   ` Rodrigo Vivi [this message]
2023-01-12 22:25 ` [Intel-xe] [PATCH 28/37] drm/xe: Don't use engine_mask until after hwconfig parse Rodrigo Vivi
2023-01-31 18:51   ` Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 29/37] drm/xe: Fake pulling gt->info.engine_mask from hwconfig blob Rodrigo Vivi
2023-01-31 19:03   ` Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 30/37] drm/xe/guc: Report submission version of GuC firmware Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 31/37] drm/xe/guc: s/xe_guc_send_mmio/xe_guc_mmio_send Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 32/37] drm/xe/guc: Add support GuC MMIO send / recv Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 33/37] drm/xe: Make FBC check stolen at use time Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 34/37] drm/xe: Move xe_ttm_stolen_mgr_init back Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 35/37] drm/xe: Fix hidden gotcha regression with bo create Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 36/37] drm/xe: Fix xe_mmio_wait32 timeouts Rodrigo Vivi
2023-01-12 22:25 ` [Intel-xe] [PATCH 37/37] drm/xe: enforce GSMBASE for DG1 instead of BAR2 Rodrigo Vivi
2023-01-24 15:46   ` Rodrigo Vivi
2023-01-24 16:25     ` Lecluse, Philippe
2023-01-31 19:11       ` Rodrigo Vivi
2023-01-31 19:13       ` Rodrigo Vivi
2023-02-01  9:12         ` Matthew Auld
2023-02-01  9:13           ` Matthew Auld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y91m2FDhTmRIPcRf@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.brost@intel.com \
    --cc=mchehab@kernel.org \
    --cc=philippe.lecluse@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox