All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever III <chuck.lever@oracle.com>
To: kernel test robot <lkp@intel.com>
Cc: Chuck Lever <cel@kernel.org>,
	"oe-kbuild-all@lists.linux.dev" <oe-kbuild-all@lists.linux.dev>
Subject: Re: [PATCH RFC 3/9] dma-debug: Add dma_debug_ helpers for mapping bio_vec arrays
Date: Thu, 19 Oct 2023 23:21:36 +0000	[thread overview]
Message-ID: <D61BB9F1-C4AC-4654-9F0D-8FB4F3A737ED@oracle.com> (raw)
In-Reply-To: <202310200545.ScAzFYdK-lkp@intel.com>



> On Oct 19, 2023, at 5:38 PM, kernel test robot <lkp@intel.com> wrote:
> 
> Hi Chuck,
> 
> [This is a private test report for your RFC patch.]
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on akpm-mm/mm-everything]
> [also build test WARNING on rdma/for-next linus/master v6.6-rc6 next-20231019]
> [cannot apply to joro-iommu/next]
> [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/Chuck-Lever/dma-debug-Fix-a-typo-in-a-debugging-eye-catcher/20231020-032859
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
> patch link:    https://lore.kernel.org/r/169772915215.5232.10127407258544978465.stgit%40klimt.1015granger.net
> patch subject: [PATCH RFC 3/9] dma-debug: Add dma_debug_ helpers for mapping bio_vec arrays
> config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20231020/202310200545.ScAzFYdK-lkp@intel.com/config)
> compiler: m68k-linux-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231020/202310200545.ScAzFYdK-lkp@intel.com/reproduce)
> 
> 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>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202310200545.ScAzFYdK-lkp@intel.com/

Fwiw, this was an RFC series. Reviewers have already rejected
this approach, so I won't be posting another version of this.

Is there a way to flush out the test pipeline so no more tests
are run on the series?


> All warnings (new ones prefixed by >>):
> 
>   kernel/dma/debug.c: In function 'check_bv_segment':
>   kernel/dma/debug.c:1204:15: error: 'struct bio_vec' has no member named 'length'
>    1204 |         if (bv->length > max_seg)
>         |               ^~
>   In file included from arch/m68k/include/asm/bug.h:32,
>                    from include/linux/bug.h:5,
>                    from include/linux/thread_info.h:13,
>                    from include/asm-generic/preempt.h:5,
>                    from ./arch/m68k/include/generated/asm/preempt.h:1,
>                    from include/linux/preempt.h:79,
>                    from arch/m68k/include/asm/irqflags.h:6,
>                    from include/linux/irqflags.h:17,
>                    from arch/m68k/include/asm/atomic.h:6,
>                    from include/linux/atomic.h:7,
>                    from include/linux/rcupdate.h:25,
>                    from include/linux/rculist.h:11,
>                    from include/linux/pid.h:5,
>                    from include/linux/sched.h:14,
>                    from include/linux/sched/task_stack.h:9,
>                    from kernel/dma/debug.c:10:
>   kernel/dma/debug.c:1206:30: error: 'struct bio_vec' has no member named 'length'
>    1206 |                            bv->length, max_seg);
>         |                              ^~
>   include/asm-generic/bug.h:99:62: note: in definition of macro '__WARN_printf'
>      99 |                 warn_slowpath_fmt(__FILE__, __LINE__, taint, arg);      \
>         |                                                              ^~~
>   kernel/dma/debug.c:224:25: note: in expansion of macro 'WARN'
>     224 |                         WARN(1, pr_fmt("%s %s: ") format,               \
>         |                         ^~~~
>   kernel/dma/debug.c:1205:17: note: in expansion of macro 'err_printk'
>    1205 |                 err_printk(dev, NULL, "mapping bv entry longer than device claims to support [len=%u] [max=%u]\n",
>         |                 ^~~~~~~~~~
>   kernel/dma/debug.c: In function 'debug_dma_map_bvecs':
>   kernel/dma/debug.c:1377:38: error: implicit declaration of function 'bv_page'; did you mean 'sg_page'? [-Werror=implicit-function-declaration]
>    1377 |                 check_for_stack(dev, bv_page(bv), bv->offset);
>         |                                      ^~~~~~~
>         |                                      sg_page
>   kernel/dma/debug.c:1377:55: error: 'struct bio_vec' has no member named 'offset'; did you mean 'bv_offset'?
>    1377 |                 check_for_stack(dev, bv_page(bv), bv->offset);
>         |                                                       ^~~~~~
>         |                                                       bv_offset
>>> kernel/dma/debug.c:1377:38: warning: passing argument 2 of 'check_for_stack' makes pointer from integer without a cast [-Wint-conversion]
>    1377 |                 check_for_stack(dev, bv_page(bv), bv->offset);
>         |                                      ^~~~~~~~~~~
>         |                                      |
>         |                                      int
>   kernel/dma/debug.c:1059:42: note: expected 'struct page *' but argument is of type 'int'
>    1059 |                             struct page *page, size_t offset)
>         |                             ~~~~~~~~~~~~~^~~~
>>> kernel/dma/debug.c:1378:34: warning: passing argument 1 of 'PageHighMem' makes pointer from integer without a cast [-Wint-conversion]
>    1378 |                 if (!PageHighMem(bv_page(bv)))
>         |                                  ^~~~~~~~~~~
>         |                                  |
>         |                                  int
>   In file included from include/linux/mmzone.h:23,
>                    from include/linux/gfp.h:7,
>                    from include/linux/mm.h:7,
>                    from include/linux/scatterlist.h:8,
>                    from kernel/dma/debug.c:11:
>   include/linux/page-flags.h:437:50: note: expected 'const struct page *' but argument is of type 'int'
>     437 | static inline int Page##uname(const struct page *page) { return 0; }
>         |                               ~~~~~~~~~~~~~~~~~~~^~~~
>   include/linux/page-flags.h:461:38: note: in expansion of macro 'TESTPAGEFLAG_FALSE'
>     461 | #define PAGEFLAG_FALSE(uname, lname) TESTPAGEFLAG_FALSE(uname, lname)   \
>         |                                      ^~~~~~~~~~~~~~~~~~
>   include/linux/page-flags.h:531:1: note: in expansion of macro 'PAGEFLAG_FALSE'
>     531 | PAGEFLAG_FALSE(HighMem, highmem)
>         | ^~~~~~~~~~~~~~
>   kernel/dma/debug.c:1379:68: error: 'struct bio_vec' has no member named 'length'
>    1379 |                         check_for_illegal_area(dev, bv_virt(bv), bv->length);
>         |                                                                    ^~
>   In file included from arch/m68k/include/asm/page.h:66,
>                    from arch/m68k/include/asm/thread_info.h:6,
>                    from include/linux/thread_info.h:60:
>   include/asm-generic/memory_model.h:19:57: error: invalid operands to binary - (have 'int' and 'struct page *')
>      19 | #define __page_to_pfn(page)     ((unsigned long)((page) - mem_map) + \
>         |                                                  ~~~~~~ ^
>   include/asm-generic/memory_model.h:64:21: note: in expansion of macro '__page_to_pfn'
>      64 | #define page_to_pfn __page_to_pfn
>         |                     ^~~~~~~~~~~~~
>   kernel/dma/debug.c:1391:41: note: in expansion of macro 'page_to_pfn'
>    1391 |                 entry->pfn            = page_to_pfn(bv_page(bv));
>         |                                         ^~~~~~~~~~~
>   kernel/dma/debug.c:1392:45: error: 'struct bio_vec' has no member named 'offset'; did you mean 'bv_offset'?
>    1392 |                 entry->offset         = bv->offset;
>         |                                             ^~~~~~
>         |                                             bv_offset
>   kernel/dma/debug.c: In function 'debug_dma_unmap_bvecs':
>   kernel/dma/debug.c:1464:25: error: 'nents' undeclared (first use in this function); did you mean 'net'?
>    1464 |         for (i = 0; i < nents; i++) {
>         |                         ^~~~~
>         |                         net
>   kernel/dma/debug.c:1464:25: note: each undeclared identifier is reported only once for each function it appears in
>   include/asm-generic/memory_model.h:19:57: error: invalid operands to binary - (have 'int' and 'struct page *')
>      19 | #define __page_to_pfn(page)     ((unsigned long)((page) - mem_map) + \
>         |                                                  ~~~~~~ ^
>   include/asm-generic/memory_model.h:64:21: note: in expansion of macro '__page_to_pfn'
>      64 | #define page_to_pfn __page_to_pfn
>         |                     ^~~~~~~~~~~~~
>   kernel/dma/debug.c:1469:43: note: in expansion of macro 'page_to_pfn'
>    1469 |                         .pfn            = page_to_pfn(bv_page(bv)),
>         |                                           ^~~~~~~~~~~
>   kernel/dma/debug.c:1470:47: error: 'struct bio_vec' has no member named 'offset'; did you mean 'bv_offset'?
>    1470 |                         .offset         = bv->offset,
>         |                                               ^~~~~~
>         |                                               bv_offset
>   kernel/dma/debug.c: In function 'debug_dma_sync_bvecs_for_cpu':
>   kernel/dma/debug.c:1700:25: error: 'nents' undeclared (first use in this function); did you mean 'net'?
>    1700 |         for (i = 0; i < nents; i++) {
>         |                         ^~~~~
>         |                         net
>>> kernel/dma/debug.c:1695:25: warning: unused variable 'bv' [-Wunused-variable]
>    1695 |         struct bio_vec *bv;
>         |                         ^~
>   kernel/dma/debug.c: In function 'debug_dma_sync_bvecs_for_device':
>   kernel/dma/debug.c:1732:25: error: 'nents' undeclared (first use in this function); did you mean 'net'?
>    1732 |         for (i = 0; i < nents; i++) {
>         |                         ^~~~~
>         |                         net
>   kernel/dma/debug.c:1727:25: warning: unused variable 'bv' [-Wunused-variable]
>    1727 |         struct bio_vec *bv;
>         |                         ^~
>   cc1: some warnings being treated as errors
> 
> 
> vim +/check_for_stack +1377 kernel/dma/debug.c
> 
>  1363 
>  1364 void debug_dma_map_bvecs(struct device *dev, struct bio_vec *bvecs,
>  1365 int nents, int mapped_ents, int direction,
>  1366 unsigned long attrs)
>  1367 {
>  1368 struct dma_debug_entry *entry;
>  1369 struct bio_vec *bv;
>  1370 int i;
>  1371 
>  1372 if (unlikely(dma_debug_disabled()))
>  1373 return;
>  1374 
>  1375 for (i = 0; i < nents; i++) {
>  1376 bv = &bvecs[i];
>> 1377 check_for_stack(dev, bv_page(bv), bv->offset);
>> 1378 if (!PageHighMem(bv_page(bv)))
>  1379 check_for_illegal_area(dev, bv_virt(bv), bv->length);
>  1380 }
>  1381 
>  1382 for (i = 0; i < nents; i++) {
>  1383 bv = &bvecs[i];
>  1384 
>  1385 entry = dma_entry_alloc();
>  1386 if (!entry)
>  1387 return;
>  1388 
>  1389 entry->type           = dma_debug_bv;
>  1390 entry->dev            = dev;
>  1391 entry->pfn      = page_to_pfn(bv_page(bv));
>  1392 entry->offset      = bv->offset;
>  1393 entry->size           = bv_dma_len(bv);
>  1394 entry->dev_addr       = bv_dma_address(bv);
>  1395 entry->direction      = direction;
>  1396 entry->sg_call_ents   = nents;
>  1397 entry->sg_mapped_ents = mapped_ents;
>  1398 
>  1399 check_bv_segment(dev, bv);
>  1400 
>  1401 add_dma_entry(entry, attrs);
>  1402 }
>  1403 }
>  1404 
>  1405 static int get_nr_mapped_entries(struct device *dev,
>  1406 struct dma_debug_entry *ref)
>  1407 {
>  1408 struct dma_debug_entry *entry;
>  1409 struct hash_bucket *bucket;
>  1410 unsigned long flags;
>  1411 int mapped_ents;
>  1412 
>  1413 bucket       = get_hash_bucket(ref, &flags);
>  1414 entry        = bucket_find_exact(bucket, ref);
>  1415 mapped_ents  = 0;
>  1416 
>  1417 if (entry)
>  1418 mapped_ents = entry->sg_mapped_ents;
>  1419 put_hash_bucket(bucket, flags);
>  1420 
>  1421 return mapped_ents;
>  1422 }
>  1423 
>  1424 void debug_dma_unmap_sg(struct device *dev, struct scatterlist *sglist,
>  1425 int nelems, int dir)
>  1426 {
>  1427 struct scatterlist *s;
>  1428 int mapped_ents = 0, i;
>  1429 
>  1430 if (unlikely(dma_debug_disabled()))
>  1431 return;
>  1432 
>  1433 for_each_sg(sglist, s, nelems, i) {
>  1434 
>  1435 struct dma_debug_entry ref = {
>  1436 .type           = dma_debug_sg,
>  1437 .dev            = dev,
>  1438 .pfn = page_to_pfn(sg_page(s)),
>  1439 .offset = s->offset,
>  1440 .dev_addr       = sg_dma_address(s),
>  1441 .size           = sg_dma_len(s),
>  1442 .direction      = dir,
>  1443 .sg_call_ents   = nelems,
>  1444 };
>  1445 
>  1446 if (mapped_ents && i >= mapped_ents)
>  1447 break;
>  1448 
>  1449 if (!i)
>  1450 mapped_ents = get_nr_mapped_entries(dev, &ref);
>  1451 
>  1452 check_unmap(&ref);
>  1453 }
>  1454 }
>  1455 
>  1456 void debug_dma_unmap_bvecs(struct device *dev, struct bio_vec *bvecs,
>  1457   int nelems, int dir)
>  1458 {
>  1459 int mapped_ents = 0, i;
>  1460 
>  1461 if (unlikely(dma_debug_disabled()))
>  1462 return;
>  1463 
>  1464 for (i = 0; i < nents; i++) {
>  1465 struct bio_vec *bv = &bvecs[i];
>  1466 struct dma_debug_entry ref = {
>  1467 .type           = dma_debug_bv,
>  1468 .dev            = dev,
>  1469 .pfn = page_to_pfn(bv_page(bv)),
>> 1470 .offset = bv->offset,
>  1471 .dev_addr       = bv_dma_address(bv),
>  1472 .size           = bv_dma_len(bv),
>  1473 .direction      = dir,
>  1474 .sg_call_ents   = nelems,
>  1475 };
>  1476 
>  1477 if (mapped_ents && i >= mapped_ents)
>  1478 break;
>  1479 
>  1480 if (!i)
>  1481 mapped_ents = get_nr_mapped_entries(dev, &ref);
>  1482 
>  1483 check_unmap(&ref);
>  1484 }
>  1485 }
>  1486 
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

--
Chuck Lever



  reply	other threads:[~2023-10-19 23:21 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19 15:25 [PATCH RFC 0/9] Exploring biovec support in (R)DMA API Chuck Lever
2023-10-19 15:25 ` Chuck Lever
2023-10-19 15:25 ` [PATCH RFC 1/9] dma-debug: Fix a typo in a debugging eye-catcher Chuck Lever
2023-10-20  4:49   ` Christoph Hellwig
2023-10-20 13:38     ` Chuck Lever III
2023-10-23  5:56       ` Christoph Hellwig
2023-10-19 15:25 ` [PATCH RFC 2/9] bvec: Add bio_vec fields to manage DMA mapping Chuck Lever
2023-10-19 15:25   ` Chuck Lever
2023-10-19 15:25 ` [PATCH RFC 3/9] dma-debug: Add dma_debug_ helpers for mapping bio_vec arrays Chuck Lever
2023-10-19 15:25   ` Chuck Lever
2023-10-19 21:38   ` kernel test robot
2023-10-19 23:21     ` Chuck Lever III [this message]
2023-10-23  2:43       ` Liu, Yujie
2023-10-23 14:27         ` Chuck Lever III
2023-10-19 21:49   ` kernel test robot
2023-10-19 15:25 ` [PATCH RFC 4/9] mm: kmsan: Add support for DMA " Chuck Lever
2023-10-19 15:25   ` Chuck Lever
2023-10-19 15:26 ` [PATCH RFC 5/9] dma-direct: Support direct " Chuck Lever
2023-10-19 15:26   ` Chuck Lever
2023-10-19 15:26 ` [PATCH RFC 6/9] DMA-API: Add dma_sync_bvecs_for_cpu() and dma_sync_bvecs_for_device() Chuck Lever
2023-10-19 15:26   ` Chuck Lever
2023-10-19 15:26 ` [PATCH RFC 7/9] DMA: Add dma_map_bvecs_attrs() Chuck Lever
2023-10-19 15:26   ` Chuck Lever
2023-10-19 22:10   ` kernel test robot
2023-10-19 15:26 ` [PATCH RFC 8/9] iommu/dma: Support DMA-mapping a bio_vec array Chuck Lever
2023-10-19 15:26   ` Chuck Lever
2023-10-19 15:26 ` [PATCH RFC 9/9] RDMA: Add helpers for DMA-mapping an array of bio_vecs Chuck Lever
2023-10-19 15:26   ` Chuck Lever
2023-10-19 15:53 ` [PATCH RFC 0/9] Exploring biovec support in (R)DMA API Matthew Wilcox
2023-10-19 17:48   ` Chuck Lever
2023-10-20  4:58   ` Christoph Hellwig
2023-10-20 10:30     ` Robin Murphy
2023-10-23  5:59       ` Christoph Hellwig
2023-10-19 16:43 ` Robin Murphy
2023-10-19 17:53   ` Jason Gunthorpe

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=D61BB9F1-C4AC-4654-9F0D-8FB4F3A737ED@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=cel@kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.