Loading drivers/char/adsprpc.c +11 −5 Original line number Diff line number Diff line /* * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -297,6 +297,7 @@ struct fastrpc_mmap { int uncached; int secure; uintptr_t attr; bool is_filemap; /*flag to indicate map used in process init*/ }; struct fastrpc_perf { Loading Loading @@ -556,9 +557,10 @@ static int fastrpc_mmap_remove(struct fastrpc_file *fl, uintptr_t va, spin_lock(&me->hlock); hlist_for_each_entry_safe(map, n, &me->maps, hn) { if (map->raddr == va && if (map->refs == 1 && map->raddr == va && map->raddr + map->len == va + len && map->refs == 1) { /*Remove map if not used in process initialization*/ !map->is_filemap) { match = map; hlist_del_init(&map->hn); break; Loading @@ -571,9 +573,10 @@ static int fastrpc_mmap_remove(struct fastrpc_file *fl, uintptr_t va, } spin_lock(&fl->hlock); hlist_for_each_entry_safe(map, n, &fl->maps, hn) { if (map->raddr == va && if (map->refs == 1 && map->raddr == va && map->raddr + map->len == va + len && map->refs == 1) { /*Remove map if not used in process initialization*/ !map->is_filemap) { match = map; hlist_del_init(&map->hn); break; Loading Loading @@ -711,6 +714,7 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd, unsigned attr, map->fl = fl; map->fd = fd; map->attr = attr; map->is_filemap = false; if (mflags == ADSP_MMAP_HEAP_ADDR || mflags == ADSP_MMAP_REMOTE_HEAP_ADDR) { DEFINE_DMA_ATTRS(rh_attrs); Loading Loading @@ -1900,6 +1904,8 @@ static int fastrpc_init_process(struct fastrpc_file *fl, if (init->filelen) { VERIFY(err, !fastrpc_mmap_create(fl, init->filefd, 0, init->file, init->filelen, mflags, &file)); if (file) file->is_filemap = true; if (err) goto bail; } Loading drivers/gpu/msm/kgsl_drawobj.c +11 −24 Original line number Diff line number Diff line /* Copyright (c) 2016-2017,2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2017,2019,2021, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -585,6 +585,7 @@ static void add_profiling_buffer(struct kgsl_device *device, { struct kgsl_mem_entry *entry; struct kgsl_drawobj *drawobj = DRAWOBJ(cmdobj); u64 start; if (!(drawobj->flags & KGSL_DRAWOBJ_PROFILING)) return; Loading @@ -601,7 +602,14 @@ static void add_profiling_buffer(struct kgsl_device *device, gpuaddr); if (entry != NULL) { if (!kgsl_gpuaddr_in_memdesc(&entry->memdesc, gpuaddr, size)) { start = id ? (entry->memdesc.gpuaddr + offset) : gpuaddr; /* * Make sure there is enough room in the object to store the * entire profiling buffer object */ if (!kgsl_gpuaddr_in_memdesc(&entry->memdesc, gpuaddr, size) || !kgsl_gpuaddr_in_memdesc(&entry->memdesc, start, sizeof(struct kgsl_drawobj_profiling_buffer))) { kgsl_mem_entry_put(entry); entry = NULL; } Loading @@ -614,28 +622,7 @@ static void add_profiling_buffer(struct kgsl_device *device, return; } if (!id) { cmdobj->profiling_buffer_gpuaddr = gpuaddr; } else { u64 off = offset + sizeof(struct kgsl_drawobj_profiling_buffer); /* * Make sure there is enough room in the object to store the * entire profiling buffer object */ if (off < offset || off >= entry->memdesc.size) { dev_err(device->dev, "ignore invalid profile offset ctxt %d id %d offset %lld gpuaddr %llx size %lld\n", drawobj->context->id, id, offset, gpuaddr, size); kgsl_mem_entry_put(entry); return; } cmdobj->profiling_buffer_gpuaddr = entry->memdesc.gpuaddr + offset; } cmdobj->profiling_buffer_gpuaddr = start; cmdobj->profiling_buf_entry = entry; } Loading drivers/soc/qcom/msm_minidump.c +13 −2 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017,2021, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -189,6 +189,7 @@ static int md_update_smem_table(const struct md_region *entry) int msm_minidump_add_region(const struct md_region *entry) { u32 entries; u32 toc_init; struct md_region *mdr; int ret = 0; Loading @@ -214,6 +215,16 @@ int msm_minidump_add_region(const struct md_region *entry) return -ENOMEM; } toc_init = 0; if (minidump_enabled) { toc_init = 1; if (region_idx >= MAX_NUM_ENTRIES) { spin_unlock(&mdt_lock); pr_err("Maximum regions in minidump table reached.\n"); return -ENOMEM; } } mdr = &minidump_table.entry[entries]; strlcpy(mdr->name, entry->name, sizeof(mdr->name)); mdr->virt_addr = entry->virt_addr; Loading @@ -223,7 +234,7 @@ int msm_minidump_add_region(const struct md_region *entry) minidump_table.num_regions = entries + 1; if (minidump_enabled) if (toc_init) ret = md_update_smem_table(entry); else pendings++; Loading gen_headers_arm.bp +1 −0 Original line number Diff line number Diff line Loading @@ -533,6 +533,7 @@ gen_headers_out_arm = [ "linux/shm.h", "linux/signal.h", "linux/signalfd.h", "linux/slatecom_interface.h", "linux/smcinvoke.h", "linux/smiapp.h", "linux/snmp.h", Loading gen_headers_arm64.bp +1 −0 Original line number Diff line number Diff line Loading @@ -531,6 +531,7 @@ gen_headers_out_arm64 = [ "linux/shm.h", "linux/signal.h", "linux/signalfd.h", "linux/slatecom_interface.h", "linux/smcinvoke.h", "linux/smiapp.h", "linux/snmp.h", Loading Loading
drivers/char/adsprpc.c +11 −5 Original line number Diff line number Diff line /* * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -297,6 +297,7 @@ struct fastrpc_mmap { int uncached; int secure; uintptr_t attr; bool is_filemap; /*flag to indicate map used in process init*/ }; struct fastrpc_perf { Loading Loading @@ -556,9 +557,10 @@ static int fastrpc_mmap_remove(struct fastrpc_file *fl, uintptr_t va, spin_lock(&me->hlock); hlist_for_each_entry_safe(map, n, &me->maps, hn) { if (map->raddr == va && if (map->refs == 1 && map->raddr == va && map->raddr + map->len == va + len && map->refs == 1) { /*Remove map if not used in process initialization*/ !map->is_filemap) { match = map; hlist_del_init(&map->hn); break; Loading @@ -571,9 +573,10 @@ static int fastrpc_mmap_remove(struct fastrpc_file *fl, uintptr_t va, } spin_lock(&fl->hlock); hlist_for_each_entry_safe(map, n, &fl->maps, hn) { if (map->raddr == va && if (map->refs == 1 && map->raddr == va && map->raddr + map->len == va + len && map->refs == 1) { /*Remove map if not used in process initialization*/ !map->is_filemap) { match = map; hlist_del_init(&map->hn); break; Loading Loading @@ -711,6 +714,7 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd, unsigned attr, map->fl = fl; map->fd = fd; map->attr = attr; map->is_filemap = false; if (mflags == ADSP_MMAP_HEAP_ADDR || mflags == ADSP_MMAP_REMOTE_HEAP_ADDR) { DEFINE_DMA_ATTRS(rh_attrs); Loading Loading @@ -1900,6 +1904,8 @@ static int fastrpc_init_process(struct fastrpc_file *fl, if (init->filelen) { VERIFY(err, !fastrpc_mmap_create(fl, init->filefd, 0, init->file, init->filelen, mflags, &file)); if (file) file->is_filemap = true; if (err) goto bail; } Loading
drivers/gpu/msm/kgsl_drawobj.c +11 −24 Original line number Diff line number Diff line /* Copyright (c) 2016-2017,2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2016-2017,2019,2021, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -585,6 +585,7 @@ static void add_profiling_buffer(struct kgsl_device *device, { struct kgsl_mem_entry *entry; struct kgsl_drawobj *drawobj = DRAWOBJ(cmdobj); u64 start; if (!(drawobj->flags & KGSL_DRAWOBJ_PROFILING)) return; Loading @@ -601,7 +602,14 @@ static void add_profiling_buffer(struct kgsl_device *device, gpuaddr); if (entry != NULL) { if (!kgsl_gpuaddr_in_memdesc(&entry->memdesc, gpuaddr, size)) { start = id ? (entry->memdesc.gpuaddr + offset) : gpuaddr; /* * Make sure there is enough room in the object to store the * entire profiling buffer object */ if (!kgsl_gpuaddr_in_memdesc(&entry->memdesc, gpuaddr, size) || !kgsl_gpuaddr_in_memdesc(&entry->memdesc, start, sizeof(struct kgsl_drawobj_profiling_buffer))) { kgsl_mem_entry_put(entry); entry = NULL; } Loading @@ -614,28 +622,7 @@ static void add_profiling_buffer(struct kgsl_device *device, return; } if (!id) { cmdobj->profiling_buffer_gpuaddr = gpuaddr; } else { u64 off = offset + sizeof(struct kgsl_drawobj_profiling_buffer); /* * Make sure there is enough room in the object to store the * entire profiling buffer object */ if (off < offset || off >= entry->memdesc.size) { dev_err(device->dev, "ignore invalid profile offset ctxt %d id %d offset %lld gpuaddr %llx size %lld\n", drawobj->context->id, id, offset, gpuaddr, size); kgsl_mem_entry_put(entry); return; } cmdobj->profiling_buffer_gpuaddr = entry->memdesc.gpuaddr + offset; } cmdobj->profiling_buffer_gpuaddr = start; cmdobj->profiling_buf_entry = entry; } Loading
drivers/soc/qcom/msm_minidump.c +13 −2 Original line number Diff line number Diff line /* Copyright (c) 2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2017,2021, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -189,6 +189,7 @@ static int md_update_smem_table(const struct md_region *entry) int msm_minidump_add_region(const struct md_region *entry) { u32 entries; u32 toc_init; struct md_region *mdr; int ret = 0; Loading @@ -214,6 +215,16 @@ int msm_minidump_add_region(const struct md_region *entry) return -ENOMEM; } toc_init = 0; if (minidump_enabled) { toc_init = 1; if (region_idx >= MAX_NUM_ENTRIES) { spin_unlock(&mdt_lock); pr_err("Maximum regions in minidump table reached.\n"); return -ENOMEM; } } mdr = &minidump_table.entry[entries]; strlcpy(mdr->name, entry->name, sizeof(mdr->name)); mdr->virt_addr = entry->virt_addr; Loading @@ -223,7 +234,7 @@ int msm_minidump_add_region(const struct md_region *entry) minidump_table.num_regions = entries + 1; if (minidump_enabled) if (toc_init) ret = md_update_smem_table(entry); else pendings++; Loading
gen_headers_arm.bp +1 −0 Original line number Diff line number Diff line Loading @@ -533,6 +533,7 @@ gen_headers_out_arm = [ "linux/shm.h", "linux/signal.h", "linux/signalfd.h", "linux/slatecom_interface.h", "linux/smcinvoke.h", "linux/smiapp.h", "linux/snmp.h", Loading
gen_headers_arm64.bp +1 −0 Original line number Diff line number Diff line Loading @@ -531,6 +531,7 @@ gen_headers_out_arm64 = [ "linux/shm.h", "linux/signal.h", "linux/signalfd.h", "linux/slatecom_interface.h", "linux/smcinvoke.h", "linux/smiapp.h", "linux/snmp.h", Loading