diff for duplicates of <202505300720.uhAJlLnM-lkp@intel.com> diff --git a/a/1.txt b/N1/1.txt index e674c29..925261e 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,27 +1,61 @@ +BCC: lkp@intel.com +CC: oe-kbuild-all@lists.linux.dev +In-Reply-To: <20250527164003.1068118-10-himal.prasad.ghimiray@intel.com> +References: <20250527164003.1068118-10-himal.prasad.ghimiray@intel.com> +TO: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> +TO: intel-xe@lists.freedesktop.org +CC: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> + Hi Himal, kernel test robot noticed the following build warnings: +[auto build test WARNING on drm-xe/drm-xe-next] +[also build test WARNING on next-20250529] +[cannot apply to linus/master v6.15] +[If your patch is applied to the wrong git tree, kindly drop us a note. +And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Himal-Prasad-Ghimiray/Introduce-drm_gpuvm_sm_map_ops_flags-enums-for-sm_map_ops/20250528-041919 base: https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next patch link: https://lore.kernel.org/r/20250527164003.1068118-10-himal.prasad.ghimiray%40intel.com patch subject: [PATCH v3 09/19] drm/xe/svm: Split system allocator vma incase of madvise call +:::::: branch date: 2 days ago +:::::: commit date: 2 days ago config: loongarch-randconfig-r073-20250529 (https://download.01.org/0day-ci/archive/20250530/202505300720.uhAJlLnM-lkp@intel.com/config) compiler: loongarch64-linux-gcc (GCC) 15.1.0 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> -| Reported-by: Dan Carpenter <dan.carpenter@linaro.org> +| Reported-by: Dan Carpenter <error27@gmail.com> | Closes: https://lore.kernel.org/r/202505300720.uhAJlLnM-lkp@intel.com/ New smatch warnings: drivers/gpu/drm/xe/xe_vm.c:4255 xe_vm_alloc_madvise_vma() warn: variable dereferenced before check 'ops' (see line 4194) +Old smatch warnings: +drivers/gpu/drm/xe/xe_vm.c:2480 new_vma() error: we previously assumed 'bo' could be null (see line 2454) +drivers/gpu/drm/xe/xe_vm.c:2492 new_vma() error: 'vma' dereferencing possible ERR_PTR() +drivers/gpu/drm/xe/xe_vm.c:2919 prefetch_ranges() warn: iterator 'i' not incremented +drivers/gpu/drm/xe/xe_vm.c:3913 xe_vm_range_tilemask_tlb_invalidation() error: uninitialized symbol 'err'. +arch/loongarch/include/asm/atomic.h:135 arch_atomic_fetch_add_unless() warn: inconsistent indenting +drivers/gpu/drm/xe/xe_vm.c:4119 xe_vm_snapshot_print() warn: passing zero to 'PTR_ERR' + vim +/ops +4255 drivers/gpu/drm/xe/xe_vm.c +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4164 +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4165 /** +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4166 * xe_vm_alloc_madvise_vma - Allocate VMA's with madvise ops +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4167 * @vm: Pointer to the xe_vm structure +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4168 * @start: Starting input address +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4169 * @range: Size of the input range +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4170 * +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4171 * This function splits existing vma to create new vma for user provided input range +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4172 * +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4173 * Return: 0 if success +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4174 */ 524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4175 int xe_vm_alloc_madvise_vma(struct xe_vm *vm, uint64_t start, uint64_t range) 524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4176 { 524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4177 struct xe_vma_ops vops; @@ -46,61 +80,63 @@ vim +/ops +4255 drivers/gpu/drm/xe/xe_vm.c 524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4196 goto free_ops; 524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4197 } 524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4198 - -[ snip ] - +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4199 drm_gpuva_for_each_op(__op, ops) { +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4200 struct xe_vma_op *op = gpuva_op_to_vma_op(__op); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4201 +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4202 if (__op->op == DRM_GPUVA_OP_REMAP) { +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4203 if (xe_vma_is_cpu_addr_mirror(gpuva_to_vma(op->base.remap.unmap->va))) +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4204 is_cpu_addr_mirror = true; +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4205 else +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4206 is_cpu_addr_mirror = false; +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4207 } +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4208 +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4209 if (__op->op == DRM_GPUVA_OP_MAP) +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4210 /* In case of madvise ops DRM_GPUVA_OP_REMAP is always by +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4211 * DRM_GPUVA_OP_REMAP, so ensure we assign op->map.is_cpu_addr_mirror true +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4212 * if REMAP is for xe_vma_is_cpu_addr_mirror vma +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4213 */ +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4214 op->map.is_cpu_addr_mirror = is_cpu_addr_mirror; +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4215 +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4216 print_op(vm->xe, __op); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4217 } +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4218 +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4219 xe_vma_ops_init(&vops, vm, NULL, NULL, 0); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4220 err = vm_bind_ioctl_ops_parse(vm, ops, &vops); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4221 if (err) +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4222 goto unwind_ops; +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4223 +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4224 xe_vm_lock(vm, false); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4225 +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4226 drm_gpuva_for_each_op(__op, ops) { +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4227 struct xe_vma_op *op = gpuva_op_to_vma_op(__op); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4228 struct xe_vma *vma; +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4229 struct xe_vma_mem_attr temp_attr; +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4230 +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4231 if (__op->op == DRM_GPUVA_OP_UNMAP) { +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4232 /* There should be no unmap */ +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4233 XE_WARN_ON("UNEXPECTED UNMAP"); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4234 xe_vma_destroy(gpuva_to_vma(op->base.unmap.va), NULL); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4235 } else if (__op->op == DRM_GPUVA_OP_REMAP) { +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4236 vma = gpuva_to_vma(op->base.remap.unmap->va); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4237 /* Store attributes for REMAP UNMAPPED VMA, so they can be assigned +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4238 * to newly MAPPED vma. +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4239 */ +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4240 cp_vma_mem_attr(&temp_attr, &vma->attr); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4241 xe_vma_destroy(gpuva_to_vma(op->base.remap.unmap->va), NULL); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4242 } else if (__op->op == DRM_GPUVA_OP_MAP) { +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4243 vma = op->map.vma; +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4244 cp_vma_mem_attr(&vma->attr, &temp_attr); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4245 } +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4246 } +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4247 +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4248 xe_vm_unlock(vm); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4249 drm_gpuva_ops_free(&vm->gpuvm, ops); +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4250 return 0; +524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4251 524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4252 unwind_ops: 524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4253 vm_bind_ioctl_ops_unwind(vm, &ops, 1); - ^^^^ -It might be nicer to change this... See below? - 524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4254 free_ops: 524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 @4255 if (ops) - ^^^^^^^^ -This check is unnecessary. - -If we applied this diff then it wouldn't look like maybe -vm_bind_ioctl_ops_unwind() frees ops and sets it to NULL? - -diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c -index 5a978da411b0..48723754b0f9 100644 ---- a/drivers/gpu/drm/xe/xe_vm.c -+++ b/drivers/gpu/drm/xe/xe_vm.c -@@ -2822,13 +2822,13 @@ static void xe_vma_op_unwind(struct xe_vm *vm, struct xe_vma_op *op, - } - - static void vm_bind_ioctl_ops_unwind(struct xe_vm *vm, -- struct drm_gpuva_ops **ops, -+ struct drm_gpuva_ops *ops, - int num_ops_list) - { - int i; - - for (i = num_ops_list - 1; i >= 0; --i) { -- struct drm_gpuva_ops *__ops = ops[i]; -+ struct drm_gpuva_ops *__ops = &ops[i]; - struct drm_gpuva_op *__op; - - if (!__ops) -@@ -3703,7 +3703,7 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file) - - unwind_ops: - if (err && err != -ENODATA) -- vm_bind_ioctl_ops_unwind(vm, ops, args->num_binds); -+ vm_bind_ioctl_ops_unwind(vm, *ops, args->num_binds); - xe_vma_ops_fini(&vops); - for (i = args->num_binds - 1; i >= 0; --i) - if (ops[i]) -@@ -3788,7 +3788,7 @@ struct dma_fence *xe_vm_bind_kernel_bo(struct xe_vm *vm, struct xe_bo *bo, - - unwind_ops: - if (err && err != -ENODATA) -- vm_bind_ioctl_ops_unwind(vm, &ops, 1); -+ vm_bind_ioctl_ops_unwind(vm, ops, 1); - - xe_vma_ops_fini(&vops); - drm_gpuva_ops_free(&vm->gpuvm, ops); - -- 0-DAY CI Kernel Test Service diff --git a/a/content_digest b/N1/content_digest index d7f6952..08f8145 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,39 +1,69 @@ - "ref\020250527164003.1068118-10-himal.prasad.ghimiray@intel.com\0" - "From\0Dan Carpenter <dan.carpenter@linaro.org>\0" + "From\0kernel test robot <lkp@intel.com>\0" "Subject\0Re: [PATCH v3 09/19] drm/xe/svm: Split system allocator vma incase of madvise call\0" - "Date\0Mon, 2 Jun 2025 09:31:23 +0300\0" - "To\0oe-kbuild@lists.linux.dev" - Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> - " intel-xe@lists.freedesktop.org\0" + "Date\0Fri, 30 May 2025 07:18:00 +0800\0" + "To\0oe-kbuild@lists.linux.dev\0" "Cc\0lkp@intel.com" - oe-kbuild-all@lists.linux.dev - " Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>\0" + " Dan Carpenter <error27@gmail.com>\0" "\00:1\0" "b\0" + "BCC: lkp@intel.com\n" + "CC: oe-kbuild-all@lists.linux.dev\n" + "In-Reply-To: <20250527164003.1068118-10-himal.prasad.ghimiray@intel.com>\n" + "References: <20250527164003.1068118-10-himal.prasad.ghimiray@intel.com>\n" + "TO: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>\n" + "TO: intel-xe@lists.freedesktop.org\n" + "CC: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>\n" + "\n" "Hi Himal,\n" "\n" "kernel test robot noticed the following build warnings:\n" "\n" + "[auto build test WARNING on drm-xe/drm-xe-next]\n" + "[also build test WARNING on next-20250529]\n" + "[cannot apply to linus/master v6.15]\n" + "[If your patch is applied to the wrong git tree, kindly drop us a note.\n" + "And when submitting patch, we suggest to use '--base' as documented in\n" "https://git-scm.com/docs/git-format-patch#_base_tree_information]\n" "\n" "url: https://github.com/intel-lab-lkp/linux/commits/Himal-Prasad-Ghimiray/Introduce-drm_gpuvm_sm_map_ops_flags-enums-for-sm_map_ops/20250528-041919\n" "base: https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next\n" "patch link: https://lore.kernel.org/r/20250527164003.1068118-10-himal.prasad.ghimiray%40intel.com\n" "patch subject: [PATCH v3 09/19] drm/xe/svm: Split system allocator vma incase of madvise call\n" + ":::::: branch date: 2 days ago\n" + ":::::: commit date: 2 days ago\n" "config: loongarch-randconfig-r073-20250529 (https://download.01.org/0day-ci/archive/20250530/202505300720.uhAJlLnM-lkp@intel.com/config)\n" "compiler: loongarch64-linux-gcc (GCC) 15.1.0\n" "\n" "If you fix the issue in a separate patch/commit (i.e. not just a new version of\n" "the same patch/commit), kindly add following tags\n" "| Reported-by: kernel test robot <lkp@intel.com>\n" - "| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>\n" + "| Reported-by: Dan Carpenter <error27@gmail.com>\n" "| Closes: https://lore.kernel.org/r/202505300720.uhAJlLnM-lkp@intel.com/\n" "\n" "New smatch warnings:\n" "drivers/gpu/drm/xe/xe_vm.c:4255 xe_vm_alloc_madvise_vma() warn: variable dereferenced before check 'ops' (see line 4194)\n" "\n" + "Old smatch warnings:\n" + "drivers/gpu/drm/xe/xe_vm.c:2480 new_vma() error: we previously assumed 'bo' could be null (see line 2454)\n" + "drivers/gpu/drm/xe/xe_vm.c:2492 new_vma() error: 'vma' dereferencing possible ERR_PTR()\n" + "drivers/gpu/drm/xe/xe_vm.c:2919 prefetch_ranges() warn: iterator 'i' not incremented\n" + "drivers/gpu/drm/xe/xe_vm.c:3913 xe_vm_range_tilemask_tlb_invalidation() error: uninitialized symbol 'err'.\n" + "arch/loongarch/include/asm/atomic.h:135 arch_atomic_fetch_add_unless() warn: inconsistent indenting\n" + "drivers/gpu/drm/xe/xe_vm.c:4119 xe_vm_snapshot_print() warn: passing zero to 'PTR_ERR'\n" + "\n" "vim +/ops +4255 drivers/gpu/drm/xe/xe_vm.c\n" "\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4164 \n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4165 /**\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4166 * xe_vm_alloc_madvise_vma - Allocate VMA's with madvise ops\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4167 * @vm: Pointer to the xe_vm structure\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4168 * @start: Starting input address\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4169 * @range: Size of the input range\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4170 *\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4171 * This function splits existing vma to create new vma for user provided input range\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4172 *\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4173 * Return: 0 if success\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4174 */\n" "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4175 int xe_vm_alloc_madvise_vma(struct xe_vm *vm, uint64_t start, uint64_t range)\n" "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4176 {\n" "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4177 \tstruct xe_vma_ops vops;\n" @@ -58,64 +88,66 @@ "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4196 \t\tgoto free_ops;\n" "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4197 \t}\n" "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4198 \n" - "\n" - "[ snip ]\n" - "\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4199 \tdrm_gpuva_for_each_op(__op, ops) {\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4200 \t\tstruct xe_vma_op *op = gpuva_op_to_vma_op(__op);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4201 \n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4202 \t\tif (__op->op == DRM_GPUVA_OP_REMAP) {\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4203 \t\t\tif (xe_vma_is_cpu_addr_mirror(gpuva_to_vma(op->base.remap.unmap->va)))\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4204 \t\t\t\tis_cpu_addr_mirror = true;\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4205 \t\t\telse\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4206 \t\t\t\tis_cpu_addr_mirror = false;\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4207 \t\t}\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4208 \n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4209 \t\tif (__op->op == DRM_GPUVA_OP_MAP)\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4210 \t\t\t/* In case of madvise ops DRM_GPUVA_OP_REMAP is always by\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4211 \t\t\t * DRM_GPUVA_OP_REMAP, so ensure we assign op->map.is_cpu_addr_mirror true\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4212 \t\t\t * if REMAP is for xe_vma_is_cpu_addr_mirror vma\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4213 \t\t\t */\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4214 \t\t\top->map.is_cpu_addr_mirror = is_cpu_addr_mirror;\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4215 \n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4216 \t\tprint_op(vm->xe, __op);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4217 \t}\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4218 \n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4219 \txe_vma_ops_init(&vops, vm, NULL, NULL, 0);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4220 \terr = vm_bind_ioctl_ops_parse(vm, ops, &vops);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4221 \tif (err)\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4222 \t\tgoto unwind_ops;\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4223 \n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4224 \txe_vm_lock(vm, false);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4225 \n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4226 \tdrm_gpuva_for_each_op(__op, ops) {\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4227 \t\tstruct xe_vma_op *op = gpuva_op_to_vma_op(__op);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4228 \t\tstruct xe_vma *vma;\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4229 \t\tstruct xe_vma_mem_attr temp_attr;\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4230 \n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4231 \t\tif (__op->op == DRM_GPUVA_OP_UNMAP) {\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4232 \t\t\t/* There should be no unmap */\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4233 \t\t\tXE_WARN_ON(\"UNEXPECTED UNMAP\");\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4234 \t\t\txe_vma_destroy(gpuva_to_vma(op->base.unmap.va), NULL);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4235 \t\t} else if (__op->op == DRM_GPUVA_OP_REMAP) {\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4236 \t\t\tvma = gpuva_to_vma(op->base.remap.unmap->va);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4237 \t\t\t/* Store attributes for REMAP UNMAPPED VMA, so they can be assigned\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4238 \t\t\t * to newly MAPPED vma.\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4239 \t\t\t */\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4240 \t\t\tcp_vma_mem_attr(&temp_attr, &vma->attr);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4241 \t\t\txe_vma_destroy(gpuva_to_vma(op->base.remap.unmap->va), NULL);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4242 \t\t} else if (__op->op == DRM_GPUVA_OP_MAP) {\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4243 \t\t\tvma = op->map.vma;\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4244 \t\t\tcp_vma_mem_attr(&vma->attr, &temp_attr);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4245 \t\t}\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4246 \t}\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4247 \n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4248 \txe_vm_unlock(vm);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4249 \tdrm_gpuva_ops_free(&vm->gpuvm, ops);\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4250 \treturn 0;\n" + "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4251 \n" "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4252 unwind_ops:\n" "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4253 \tvm_bind_ioctl_ops_unwind(vm, &ops, 1);\n" - " ^^^^\n" - "It might be nicer to change this... See below?\n" - "\n" "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 4254 free_ops:\n" "524911c937a5a5 Himal Prasad Ghimiray 2025-05-27 @4255 \tif (ops)\n" - " ^^^^^^^^\n" - "This check is unnecessary.\n" - "\n" - "If we applied this diff then it wouldn't look like maybe\n" - "vm_bind_ioctl_ops_unwind() frees ops and sets it to NULL?\n" - "\n" - "diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c\n" - "index 5a978da411b0..48723754b0f9 100644\n" - "--- a/drivers/gpu/drm/xe/xe_vm.c\n" - "+++ b/drivers/gpu/drm/xe/xe_vm.c\n" - "@@ -2822,13 +2822,13 @@ static void xe_vma_op_unwind(struct xe_vm *vm, struct xe_vma_op *op,\n" - " }\n" - " \n" - " static void vm_bind_ioctl_ops_unwind(struct xe_vm *vm,\n" - "-\t\t\t\t struct drm_gpuva_ops **ops,\n" - "+\t\t\t\t struct drm_gpuva_ops *ops,\n" - " \t\t\t\t int num_ops_list)\n" - " {\n" - " \tint i;\n" - " \n" - " \tfor (i = num_ops_list - 1; i >= 0; --i) {\n" - "-\t\tstruct drm_gpuva_ops *__ops = ops[i];\n" - "+\t\tstruct drm_gpuva_ops *__ops = &ops[i];\n" - " \t\tstruct drm_gpuva_op *__op;\n" - " \n" - " \t\tif (!__ops)\n" - "@@ -3703,7 +3703,7 @@ int xe_vm_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file)\n" - " \n" - " unwind_ops:\n" - " \tif (err && err != -ENODATA)\n" - "-\t\tvm_bind_ioctl_ops_unwind(vm, ops, args->num_binds);\n" - "+\t\tvm_bind_ioctl_ops_unwind(vm, *ops, args->num_binds);\n" - " \txe_vma_ops_fini(&vops);\n" - " \tfor (i = args->num_binds - 1; i >= 0; --i)\n" - " \t\tif (ops[i])\n" - "@@ -3788,7 +3788,7 @@ struct dma_fence *xe_vm_bind_kernel_bo(struct xe_vm *vm, struct xe_bo *bo,\n" - " \n" - " unwind_ops:\n" - " \tif (err && err != -ENODATA)\n" - "-\t\tvm_bind_ioctl_ops_unwind(vm, &ops, 1);\n" - "+\t\tvm_bind_ioctl_ops_unwind(vm, ops, 1);\n" - " \n" - " \txe_vma_ops_fini(&vops);\n" - " \tdrm_gpuva_ops_free(&vm->gpuvm, ops);\n" - "\n" "\n" "-- \n" "0-DAY CI Kernel Test Service\n" https://github.com/intel/lkp-tests/wiki -b5c02e79275562320bdd20faa6d3660b0dd58fa23d8d453c244fbc5d838394b4 +3bd33cd332175ac7a96e0a7039113f6178198fc8fb29a47dcc888f4803bef6f1
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.