Skip to content
  1. Feb 27, 2024
    • Paulo Zanoni's avatar
      drm/xe: get rid of MAX_BINDS · ba6bbdc6
      Paulo Zanoni authored
      Mesa has been issuing a single bind operation per ioctl since xe.ko
      changed to GPUVA due xe.ko bug #746. If I change Mesa to try again to
      issue every single bind operation it can in the same ioctl, it hits
      the MAX_BINDS assertion when running Vulkan conformance tests.
      
      Test dEQP-VK.sparse_resources.transfer_queue.3d.rgba32i.1024_128_8
      issues 960 bind operations in a single ioctl, it's the most I could
      find in the conformance suite.
      
      I don't see a reason to keep the MAX_BINDS restriction: it doesn't
      seem to be preventing any specific issue. If the number is too big for
      the memory allocations, then those will fail. Nothing related to
      num_binds seems to be using the stack. Let's just get rid of it.
      
      Fixes: dd08ebf6
      
       ("drm/xe: Introduce a new DRM driver for Intel GPUs")
      Testcase: dEQP-VK.sparse_resources.transfer_queue.3d.rgba32i.1024_128_8
      References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/746
      Cc: Matthew Brost <matthew.brost@intel.com>
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240215005353.1295420-1-paulo.r.zanoni@intel.com
      ba6bbdc6
    • Matthew Brost's avatar
      drm/xe: Use vmalloc for array of bind allocation in bind IOCTL · 35ed1d2b
      Matthew Brost authored
      Use vmalloc in effort to allow a user pass in a large number of binds in
      an IOCTL (mesa use case). Also use array allocations rather open coding
      the size calculation.
      
      v2: Use __GFP_ACCOUNT for allocations (Thomas)
      
      Fixes: dd08ebf6
      
       ("drm/xe: Introduce a new DRM driver for Intel GPUs")
      Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240226155554.103384-1-matthew.brost@intel.com
      35ed1d2b
  2. Feb 26, 2024
  3. Feb 24, 2024
    • Matthew Brost's avatar
      drm/xe: Don't support execlists in xe_gt_tlb_invalidation layer · a9e483dd
      Matthew Brost authored
      The xe_gt_tlb_invalidation layer implements TLB invalidations for a GuC
      backend. Simply return if in execlists mode. A follow up may properly
      implement the xe_gt_tlb_invalidation layer for both GuC and execlists.
      
      Fixes: a9351846
      
       ("drm/xe: Break of TLB invalidation into its own file")
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240222232021.3911545-4-matthew.brost@intel.com
      a9e483dd
    • Matthew Brost's avatar
      drm/xe: Cleanup some layering in GGTT · 3121fed0
      Matthew Brost authored
      
      
      xe_ggtt.c touched GuC layers which is incorrect. Call into
      xe_gt_tlb_invalidation layer instead.
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240222232021.3911545-3-matthew.brost@intel.com
      3121fed0
    • Matthew Brost's avatar
      drm/xe: Fix execlist splat · ddadc712
      Matthew Brost authored
      Although execlist submission is not supported it should be kept in a
      basic working state as it can be used for very early hardware bring up.
      Fix the below splat.
      
      WARNING: CPU: 3 PID: 11 at drivers/gpu/drm/xe/xe_execlist.c:217 execlist_run_job+0x1c2/0x220 [xe]
      Modules linked in: xe drm_kunit_helpers drm_gpuvm drm_ttm_helper ttm drm_exec drm_suballoc_helper drm_buddy gpu_sched mei_pxp mei_hdcp wmi_bmof x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul snd_hda_intel ghash_clmulni_intel snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core video snd_pcm mei_me mei wmi fuse e1000e i2c_i801 ptp i2c_smbus pps_core intel_lpss_pci
      CPU: 3 PID: 11 Comm: kworker/u16:0 Tainted: G     U             6.8.0-rc3-guc+ #1046
      Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.3243.A01.2006102133 06/10/2020
      Workqueue: rcs0 drm_sched_run_job_work [gpu_sched]
      RIP: 0010:execlist_run_job+0x1c2/0x220 [xe]
      Code: 8b f8 03 00 00 4c 89 39 e9 e2 fe ff ff 49 8d 7d 20 be ff ff ff ff e8 ed fd a6 e1 85 c0 0f 85 e1 fe ff ff 0f 0b e9 da fe ff ff <0f> 0b 0f 0b 41 83 fc 03 0f 86 8a fe ff ff 0f 0b e9 83 fe ff ff be
      RSP: 0018:ffffc9000013bdb8 EFLAGS: 00010246
      RAX: ffff888105021a00 RBX: ffff888105078400 RCX: 0000000000000000
      RDX: 0000000000000001 RSI: ffffc9000013bd14 RDI: ffffc90001609090
      RBP: ffff88811e3f0040 R08: 0000000000000088 R09: 00000000ffffff81
      R10: 0000000000000001 R11: ffff88810c10c000 R12: 00000000fffffffe
      R13: ffff888109b72c28 R14: ffff8881050784a0 R15: ffff888105078408
      FS:  0000000000000000(0000) GS:ffff88849f980000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000563459d130f8 CR3: 000000000563a001 CR4: 0000000000f70ef0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      PKRU: 55555554
      Call Trace:
       <TASK>
       ? __warn+0x7f/0x170
       ? execlist_run_job+0x1c2/0x220 [xe]
       ? report_bug+0x1c7/0x1d0
       ? handle_bug+0x3c/0x70
       ? exc_invalid_op+0x18/0x70
       ? asm_exc_invalid_op+0x1a/0x20
       ? execlist_run_job+0x1c2/0x220 [xe]
       ? execlist_run_job+0x2c/0x220 [xe]
       drm_sched_run_job_work+0x246/0x3f0 [gpu_sched]
       ? process_one_work+0x18d/0x4e0
       process_one_work+0x1f7/0x4e0
       worker_thread+0x1da/0x3e0
       ? __pfx_worker_thread+0x10/0x10
       kthread+0xfe/0x130
       ? __pfx_kthread+0x10/0x10
       ret_from_fork+0x2c/0x50
       ? __pfx_kthread+0x10/0x10
       ret_from_fork_asm+0x1b/0x30
       </TASK>
      
      Fixes: 9b9529ce
      
       ("drm/xe: Rename engine to exec_queue")
      Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240222232021.3911545-2-matthew.brost@intel.com
      ddadc712
  4. Feb 23, 2024
    • Francois Dugast's avatar
      drm/xe/uapi: Remove unused flags · 84a1ed5e
      Francois Dugast authored
      Those cases missed in previous uAPI cleanups were mostly accidentally
      brought in from i915 or created to exercise the possibilities of gpuvm
      but they are not used by userspace yet, so let's remove them. They can
      still be brought back later if needed.
      
      v2:
      - Fix XE_VM_FLAG_FAULT_MODE support in xe_lrc.c (Brian Welty)
      - Leave DRM_XE_VM_BIND_OP_UNMAP_ALL (José Roberto de Souza)
      - Ensure invalid flag values are rejected (Rodrigo Vivi)
      
      v3: Rebase after removal of persistent exec_queues (Francois Dugast)
      
      v4: Rodrigo: Rebase after the new dumpable flag.
      
      Fixes: dd08ebf6
      
       ("drm/xe: Introduce a new DRM driver for Intel GPUs")
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarFrancois Dugast <francois.dugast@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240222232356.175431-1-rodrigo.vivi@intel.com
      84a1ed5e
    • Erick Archer's avatar
      drm/xe: Prefer struct_size over open coded arithmetic · a7a3d736
      Erick Archer authored
      
      
      This is an effort to get rid of all multiplications from allocation
      functions in order to prevent integer overflows [1].
      
      As the "q" variable is a pointer to "struct xe_exec_queue" and this
      structure ends in a flexible array:
      
      struct xe_exec_queue {
      	[...]
      	struct xe_lrc lrc[];
      };
      
      the preferred way in the kernel is to use the struct_size() helper to
      do the arithmetic instead of the argument "size + size * count" in the
      kzalloc() function.
      
      This way, the code is more readable and more safer.
      
      Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [1]
      Link: https://github.com/KSPP/linux/issues/160 [2]
      Signed-off-by: default avatarErick Archer <erick.archer@gmx.com>
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240210141913.6611-1-erick.archer@gmx.com
      a7a3d736
    • Lucas De Marchi's avatar
      drm/xe: Use pointers in trace events · 7a975748
      Lucas De Marchi authored
      Commit a0df2cc8 ("drm/xe/xe_bo_move: Enhance xe_bo_move trace")
      inadvertently reverted commit 8d038f49
      
       ("drm/xe: Fix cast on trace
      variable"), breaking the build on 32bits.
      
      As noted by Ville, there's no point in converting the pointers to u64
      and add casts everywhere. In fact, it's better to just use %p and let
      the address be hashed. Convert all the cases in xe_trace.h to use
      pointers.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
      Cc: Oak Zeng <oak.zeng@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240222144125.2862546-1-lucas.demarchi@intel.com
      7a975748
  5. Feb 22, 2024
  6. Feb 21, 2024