From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [linux-next:master 6316/7856] drivers/gpu/drm/etnaviv/etnaviv_dump.c:213 etnaviv_core_dump() warn: should - mem_map) + << 12' be a 64 bit
Date: Tue, 24 Nov 2020 16:38:16 +0800 [thread overview]
Message-ID: <202011241612.bHAPi2Io-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 9816 bytes --]
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Mike Rapoport <rppt@linux.ibm.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 62918e6fd7b5751c1285c7f8c6cbd27eb6600c02
commit: 3c70b547b266994bab10f4f65aefc8b130fb79cb [6316/7856] m68k/mm: enable use of generic memory_model.h for !DISCONTIGMEM
:::::: branch date: 24 hours ago
:::::: commit date: 6 days ago
config: m68k-randconfig-m031-20201124 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/gpu/drm/etnaviv/etnaviv_dump.c:213 etnaviv_core_dump() warn: should '(((*pages++) - mem_map) + (m68k_memory[0]->addr)) << 12' be a 64 bit type?
vim +213 drivers/gpu/drm/etnaviv/etnaviv_dump.c
a8c21a5451d831e The etnaviv authors 2015-12-03 112
9a1fdae58760169 Lucas Stach 2019-08-09 113 void etnaviv_core_dump(struct etnaviv_gem_submit *submit)
a8c21a5451d831e The etnaviv authors 2015-12-03 114 {
9a1fdae58760169 Lucas Stach 2019-08-09 115 struct etnaviv_gpu *gpu = submit->gpu;
a8c21a5451d831e The etnaviv authors 2015-12-03 116 struct core_dump_iterator iter;
a8c21a5451d831e The etnaviv authors 2015-12-03 117 struct etnaviv_gem_object *obj;
a8c21a5451d831e The etnaviv authors 2015-12-03 118 unsigned int n_obj, n_bomap_pages;
a8c21a5451d831e The etnaviv authors 2015-12-03 119 size_t file_size, mmu_size;
a8c21a5451d831e The etnaviv authors 2015-12-03 120 __le64 *bomap, *bomap_start;
9a1fdae58760169 Lucas Stach 2019-08-09 121 int i;
a8c21a5451d831e The etnaviv authors 2015-12-03 122
6d7a20c07760361 Lucas Stach 2017-12-06 123 /* Only catch the first event, or when manually re-armed */
6d7a20c07760361 Lucas Stach 2017-12-06 124 if (!etnaviv_dump_core)
6d7a20c07760361 Lucas Stach 2017-12-06 125 return;
6d7a20c07760361 Lucas Stach 2017-12-06 126 etnaviv_dump_core = false;
6d7a20c07760361 Lucas Stach 2017-12-06 127
27b67278e007b54 Lucas Stach 2019-07-05 128 mutex_lock(&gpu->mmu_context->lock);
1396500d673bd02 Lucas Stach 2019-05-21 129
27b67278e007b54 Lucas Stach 2019-07-05 130 mmu_size = etnaviv_iommu_dump_size(gpu->mmu_context);
a8c21a5451d831e The etnaviv authors 2015-12-03 131
9a1fdae58760169 Lucas Stach 2019-08-09 132 /* We always dump registers, mmu, ring, hanging cmdbuf and end marker */
9a1fdae58760169 Lucas Stach 2019-08-09 133 n_obj = 5;
a8c21a5451d831e The etnaviv authors 2015-12-03 134 n_bomap_pages = 0;
a8c21a5451d831e The etnaviv authors 2015-12-03 135 file_size = ARRAY_SIZE(etnaviv_dump_registers) *
a8c21a5451d831e The etnaviv authors 2015-12-03 136 sizeof(struct etnaviv_dump_registers) +
9a1fdae58760169 Lucas Stach 2019-08-09 137 mmu_size + gpu->buffer.size + submit->cmdbuf.size;
a8c21a5451d831e The etnaviv authors 2015-12-03 138
a8c21a5451d831e The etnaviv authors 2015-12-03 139 /* Add in the active buffer objects */
9a1fdae58760169 Lucas Stach 2019-08-09 140 for (i = 0; i < submit->nr_bos; i++) {
9a1fdae58760169 Lucas Stach 2019-08-09 141 obj = submit->bos[i].obj;
a8c21a5451d831e The etnaviv authors 2015-12-03 142 file_size += obj->base.size;
a8c21a5451d831e The etnaviv authors 2015-12-03 143 n_bomap_pages += obj->base.size >> PAGE_SHIFT;
a8c21a5451d831e The etnaviv authors 2015-12-03 144 n_obj++;
a8c21a5451d831e The etnaviv authors 2015-12-03 145 }
a8c21a5451d831e The etnaviv authors 2015-12-03 146
a8c21a5451d831e The etnaviv authors 2015-12-03 147 /* If we have any buffer objects, add a bomap object */
a8c21a5451d831e The etnaviv authors 2015-12-03 148 if (n_bomap_pages) {
a8c21a5451d831e The etnaviv authors 2015-12-03 149 file_size += n_bomap_pages * sizeof(__le64);
a8c21a5451d831e The etnaviv authors 2015-12-03 150 n_obj++;
a8c21a5451d831e The etnaviv authors 2015-12-03 151 }
a8c21a5451d831e The etnaviv authors 2015-12-03 152
a8c21a5451d831e The etnaviv authors 2015-12-03 153 /* Add the size of the headers */
a8c21a5451d831e The etnaviv authors 2015-12-03 154 file_size += sizeof(*iter.hdr) * n_obj;
a8c21a5451d831e The etnaviv authors 2015-12-03 155
a8c21a5451d831e The etnaviv authors 2015-12-03 156 /* Allocate the file in vmalloc memory, it's likely to be big */
88dca4ca5a93d2c Christoph Hellwig 2020-06-01 157 iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN |
88dca4ca5a93d2c Christoph Hellwig 2020-06-01 158 __GFP_NORETRY);
a8c21a5451d831e The etnaviv authors 2015-12-03 159 if (!iter.start) {
27b67278e007b54 Lucas Stach 2019-07-05 160 mutex_unlock(&gpu->mmu_context->lock);
a8c21a5451d831e The etnaviv authors 2015-12-03 161 dev_warn(gpu->dev, "failed to allocate devcoredump file\n");
a8c21a5451d831e The etnaviv authors 2015-12-03 162 return;
a8c21a5451d831e The etnaviv authors 2015-12-03 163 }
a8c21a5451d831e The etnaviv authors 2015-12-03 164
a8c21a5451d831e The etnaviv authors 2015-12-03 165 /* Point the data member after the headers */
a8c21a5451d831e The etnaviv authors 2015-12-03 166 iter.hdr = iter.start;
a8c21a5451d831e The etnaviv authors 2015-12-03 167 iter.data = &iter.hdr[n_obj];
a8c21a5451d831e The etnaviv authors 2015-12-03 168
a8c21a5451d831e The etnaviv authors 2015-12-03 169 memset(iter.hdr, 0, iter.data - iter.start);
a8c21a5451d831e The etnaviv authors 2015-12-03 170
a8c21a5451d831e The etnaviv authors 2015-12-03 171 etnaviv_core_dump_registers(&iter, gpu);
27b67278e007b54 Lucas Stach 2019-07-05 172 etnaviv_core_dump_mmu(&iter, gpu->mmu_context, mmu_size);
2f9225dbc09abe7 Lucas Stach 2017-11-24 173 etnaviv_core_dump_mem(&iter, ETDUMP_BUF_RING, gpu->buffer.vaddr,
2f9225dbc09abe7 Lucas Stach 2017-11-24 174 gpu->buffer.size,
db82a0435b8be32 Lucas Stach 2019-07-05 175 etnaviv_cmdbuf_get_va(&gpu->buffer,
17e4660ae3d7e14 Lucas Stach 2019-07-05 176 &gpu->mmu_context->cmdbuf_mapping));
2f9225dbc09abe7 Lucas Stach 2017-11-24 177
2f9225dbc09abe7 Lucas Stach 2017-11-24 178 etnaviv_core_dump_mem(&iter, ETDUMP_BUF_CMD,
2f9225dbc09abe7 Lucas Stach 2017-11-24 179 submit->cmdbuf.vaddr, submit->cmdbuf.size,
db82a0435b8be32 Lucas Stach 2019-07-05 180 etnaviv_cmdbuf_get_va(&submit->cmdbuf,
17e4660ae3d7e14 Lucas Stach 2019-07-05 181 &gpu->mmu_context->cmdbuf_mapping));
a8c21a5451d831e The etnaviv authors 2015-12-03 182
ca8cb69580236f4 Lucas Stach 2019-10-16 183 mutex_unlock(&gpu->mmu_context->lock);
ca8cb69580236f4 Lucas Stach 2019-10-16 184
a8c21a5451d831e The etnaviv authors 2015-12-03 185 /* Reserve space for the bomap */
a8c21a5451d831e The etnaviv authors 2015-12-03 186 if (n_bomap_pages) {
a8c21a5451d831e The etnaviv authors 2015-12-03 187 bomap_start = bomap = iter.data;
a8c21a5451d831e The etnaviv authors 2015-12-03 188 memset(bomap, 0, sizeof(*bomap) * n_bomap_pages);
a8c21a5451d831e The etnaviv authors 2015-12-03 189 etnaviv_core_dump_header(&iter, ETDUMP_BUF_BOMAP,
a8c21a5451d831e The etnaviv authors 2015-12-03 190 bomap + n_bomap_pages);
a8c21a5451d831e The etnaviv authors 2015-12-03 191 } else {
a8c21a5451d831e The etnaviv authors 2015-12-03 192 /* Silence warning */
a8c21a5451d831e The etnaviv authors 2015-12-03 193 bomap_start = bomap = NULL;
a8c21a5451d831e The etnaviv authors 2015-12-03 194 }
a8c21a5451d831e The etnaviv authors 2015-12-03 195
9a1fdae58760169 Lucas Stach 2019-08-09 196 for (i = 0; i < submit->nr_bos; i++) {
9a1fdae58760169 Lucas Stach 2019-08-09 197 struct etnaviv_vram_mapping *vram;
a8c21a5451d831e The etnaviv authors 2015-12-03 198 struct page **pages;
a8c21a5451d831e The etnaviv authors 2015-12-03 199 void *vaddr;
a8c21a5451d831e The etnaviv authors 2015-12-03 200
9a1fdae58760169 Lucas Stach 2019-08-09 201 obj = submit->bos[i].obj;
9a1fdae58760169 Lucas Stach 2019-08-09 202 vram = submit->bos[i].mapping;
a8c21a5451d831e The etnaviv authors 2015-12-03 203
339073ef77e45e8 Lucas Stach 2016-01-22 204 mutex_lock(&obj->lock);
a8c21a5451d831e The etnaviv authors 2015-12-03 205 pages = etnaviv_gem_get_pages(obj);
339073ef77e45e8 Lucas Stach 2016-01-22 206 mutex_unlock(&obj->lock);
f8261c376e7f8cb Dan Carpenter 2019-01-14 207 if (!IS_ERR(pages)) {
a8c21a5451d831e The etnaviv authors 2015-12-03 208 int j;
a8c21a5451d831e The etnaviv authors 2015-12-03 209
a8c21a5451d831e The etnaviv authors 2015-12-03 210 iter.hdr->data[0] = bomap - bomap_start;
a8c21a5451d831e The etnaviv authors 2015-12-03 211
a8c21a5451d831e The etnaviv authors 2015-12-03 212 for (j = 0; j < obj->base.size >> PAGE_SHIFT; j++)
a8c21a5451d831e The etnaviv authors 2015-12-03 @213 *bomap++ = cpu_to_le64(page_to_phys(*pages++));
:::::: The code at line 213 was first introduced by commit
:::::: a8c21a5451d831e67b7a6fb910f9ca8bc7b43554 drm/etnaviv: add initial etnaviv DRM driver
:::::: TO: The etnaviv authors <dri-devel@lists.freedesktop.org>
:::::: CC: Lucas Stach <l.stach@pengutronix.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30342 bytes --]
reply other threads:[~2020-11-24 8:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202011241612.bHAPi2Io-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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 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.