From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH RFC v1 4/6] swiotlb: enable 64-bit swiotlb
Date: Thu, 04 Feb 2021 12:10:50 +0800 [thread overview]
Message-ID: <202102041243.ZsvxEceW-lkp@intel.com> (raw)
In-Reply-To: <20210203233709.19819-5-dongli.zhang@oracle.com>
[-- Attachment #1: Type: text/plain, Size: 9990 bytes --]
Hi Dongli,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on powerpc/next]
[also build test WARNING on linus/master v5.11-rc6 next-20210125]
[cannot apply to swiotlb/linux-next xen-tip/linux-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]
url: https://github.com/0day-ci/linux/commits/Dongli-Zhang/swiotlb-64-bit-DMA-buffer/20210204-074426
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc64-randconfig-r036-20210202 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 275c6af7d7f1ed63a03d05b4484413e447133269)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://github.com/0day-ci/linux/commit/bb094f75bbb66bf693fc13a9990702b3a88ae93f
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Dongli-Zhang/swiotlb-64-bit-DMA-buffer/20210204-074426
git checkout bb094f75bbb66bf693fc13a9990702b3a88ae93f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> kernel/dma/swiotlb.c:524:33: warning: result of comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always false [-Wtautological-constant-out-of-range-compare]
if (swiotlb_nr > 1 && dma_mask == DMA_BIT_MASK(64))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
~~~~~~~~~~~~~~~~~^~~~~
include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
(cond) ? \
^~~~
>> kernel/dma/swiotlb.c:524:33: warning: result of comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always false [-Wtautological-constant-out-of-range-compare]
if (swiotlb_nr > 1 && dma_mask == DMA_BIT_MASK(64))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
>> kernel/dma/swiotlb.c:524:33: warning: result of comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always false [-Wtautological-constant-out-of-range-compare]
if (swiotlb_nr > 1 && dma_mask == DMA_BIT_MASK(64))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
3 warnings generated.
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for HOTPLUG_CPU
Depends on SMP && (PPC_PSERIES || PPC_PMAC || PPC_POWERNV || FSL_SOC_BOOKE
Selected by
- PM_SLEEP_SMP && SMP && (ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE && PM_SLEEP
vim +524 kernel/dma/swiotlb.c
506
507 phys_addr_t swiotlb_tbl_map_single(struct device *hwdev, phys_addr_t orig_addr,
508 size_t mapping_size, size_t alloc_size,
509 enum dma_data_direction dir, unsigned long attrs)
510 {
511 dma_addr_t tbl_dma_addr;
512 unsigned long flags;
513 phys_addr_t tlb_addr;
514 unsigned int nslots, stride, index, wrap;
515 int i;
516 unsigned long mask;
517 unsigned long offset_slots;
518 unsigned long max_slots;
519 unsigned long tmp_io_tlb_used;
520 unsigned long dma_mask = min_not_zero(*hwdev->dma_mask,
521 hwdev->bus_dma_limit);
522 int type;
523
> 524 if (swiotlb_nr > 1 && dma_mask == DMA_BIT_MASK(64))
525 type = SWIOTLB_HI;
526 else
527 type = SWIOTLB_LO;
528
529 if (no_iotlb_memory[type])
530 panic("Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer");
531
532 if (mem_encrypt_active())
533 pr_warn_once("Memory encryption is active and system is using DMA bounce buffers\n");
534
535 if (mapping_size > alloc_size) {
536 dev_warn_once(hwdev, "Invalid sizes (mapping: %zd bytes, alloc: %zd bytes)",
537 mapping_size, alloc_size);
538 return (phys_addr_t)DMA_MAPPING_ERROR;
539 }
540
541 tbl_dma_addr = phys_to_dma_unencrypted(hwdev, io_tlb_start[type]);
542
543 mask = dma_get_seg_boundary(hwdev);
544
545 tbl_dma_addr &= mask;
546
547 offset_slots = ALIGN(tbl_dma_addr, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
548
549 /*
550 * Carefully handle integer overflow which can occur when mask == ~0UL.
551 */
552 max_slots = mask + 1
553 ? ALIGN(mask + 1, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT
554 : 1UL << (BITS_PER_LONG - IO_TLB_SHIFT);
555
556 /*
557 * For mappings greater than or equal to a page, we limit the stride
558 * (and hence alignment) to a page size.
559 */
560 nslots = ALIGN(alloc_size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
561 if (alloc_size >= PAGE_SIZE)
562 stride = (1 << (PAGE_SHIFT - IO_TLB_SHIFT));
563 else
564 stride = 1;
565
566 BUG_ON(!nslots);
567
568 /*
569 * Find suitable number of IO TLB entries size that will fit this
570 * request and allocate a buffer from that IO TLB pool.
571 */
572 spin_lock_irqsave(&io_tlb_lock, flags);
573
574 if (unlikely(nslots > io_tlb_nslabs[type] - io_tlb_used[type]))
575 goto not_found;
576
577 index = ALIGN(io_tlb_index[type], stride);
578 if (index >= io_tlb_nslabs[type])
579 index = 0;
580 wrap = index;
581
582 do {
583 while (iommu_is_span_boundary(index, nslots, offset_slots,
584 max_slots)) {
585 index += stride;
586 if (index >= io_tlb_nslabs[type])
587 index = 0;
588 if (index == wrap)
589 goto not_found;
590 }
591
592 /*
593 * If we find a slot that indicates we have 'nslots' number of
594 * contiguous buffers, we allocate the buffers from that slot
595 * and mark the entries as '0' indicating unavailable.
596 */
597 if (io_tlb_list[type][index] >= nslots) {
598 int count = 0;
599
600 for (i = index; i < (int) (index + nslots); i++)
601 io_tlb_list[type][i] = 0;
602 for (i = index - 1;
603 (OFFSET(i, IO_TLB_SEGSIZE) != IO_TLB_SEGSIZE - 1) &&
604 io_tlb_list[type][i];
605 i--)
606 io_tlb_list[type][i] = ++count;
607 tlb_addr = io_tlb_start[type] + (index << IO_TLB_SHIFT);
608
609 /*
610 * Update the indices to avoid searching in the next
611 * round.
612 */
613 io_tlb_index[type] = ((index + nslots) < io_tlb_nslabs[type]
614 ? (index + nslots) : 0);
615
616 goto found;
617 }
618 index += stride;
619 if (index >= io_tlb_nslabs[type])
620 index = 0;
621 } while (index != wrap);
622
623 not_found:
624 tmp_io_tlb_used = io_tlb_used[type];
625
626 spin_unlock_irqrestore(&io_tlb_lock, flags);
627 if (!(attrs & DMA_ATTR_NO_WARN) && printk_ratelimit())
628 dev_warn(hwdev, "%s swiotlb buffer is full (sz: %zd bytes), total %lu (slots), used %lu (slots)\n",
629 swiotlb_name[type], alloc_size, io_tlb_nslabs[type], tmp_io_tlb_used);
630 return (phys_addr_t)DMA_MAPPING_ERROR;
631 found:
632 io_tlb_used[type] += nslots;
633 spin_unlock_irqrestore(&io_tlb_lock, flags);
634
635 /*
636 * Save away the mapping from the original address to the DMA address.
637 * This is needed when we sync the memory. Then we sync the buffer if
638 * needed.
639 */
640 for (i = 0; i < nslots; i++)
641 io_tlb_orig_addr[type][index+i] = orig_addr + (i << IO_TLB_SHIFT);
642 if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC) &&
643 (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL))
644 swiotlb_bounce(orig_addr, tlb_addr, mapping_size, DMA_TO_DEVICE);
645
646 return tlb_addr;
647 }
648
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29864 bytes --]
next prev parent reply other threads:[~2021-02-04 4:10 UTC|newest]
Thread overview: 97+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 23:37 [PATCH RFC v1 0/6] swiotlb: 64-bit DMA buffer Dongli Zhang
2021-02-03 23:37 ` [Intel-gfx] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` [Nouveau] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` [PATCH RFC v1 1/6] swiotlb: define new enumerated type Dongli Zhang
2021-02-03 23:37 ` [Intel-gfx] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` [Nouveau] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` [PATCH RFC v1 2/6] swiotlb: convert variables to arrays Dongli Zhang
2021-02-03 23:37 ` [Intel-gfx] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` [Nouveau] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-04 4:17 ` kernel test robot
2021-02-04 5:16 ` kernel test robot
2021-02-04 7:29 ` Christoph Hellwig
2021-02-04 7:29 ` [Intel-gfx] " Christoph Hellwig
2021-02-04 7:29 ` Christoph Hellwig
2021-02-04 7:29 ` [Nouveau] " Christoph Hellwig
2021-02-04 7:29 ` Christoph Hellwig
2021-02-04 11:49 ` Robin Murphy
2021-02-04 11:49 ` [Intel-gfx] " Robin Murphy
2021-02-04 11:49 ` Robin Murphy
2021-02-04 11:49 ` Robin Murphy
2021-02-04 11:49 ` [Nouveau] " Robin Murphy
2021-02-04 11:49 ` Robin Murphy
2021-02-04 19:31 ` Konrad Rzeszutek Wilk
2021-02-04 19:31 ` [Intel-gfx] " Konrad Rzeszutek Wilk
2021-02-04 19:31 ` Konrad Rzeszutek Wilk
2021-02-04 19:31 ` Konrad Rzeszutek Wilk
2021-02-04 19:31 ` [Nouveau] " Konrad Rzeszutek Wilk
2021-02-04 19:31 ` Konrad Rzeszutek Wilk
2021-02-03 23:37 ` [PATCH RFC v1 3/6] swiotlb: introduce swiotlb_get_type() to calculate swiotlb buffer type Dongli Zhang
2021-02-03 23:37 ` [Intel-gfx] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` [Nouveau] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` [PATCH RFC v1 4/6] swiotlb: enable 64-bit swiotlb Dongli Zhang
2021-02-03 23:37 ` [Intel-gfx] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` [Nouveau] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-04 4:10 ` kernel test robot [this message]
2021-02-03 23:37 ` [PATCH RFC v1 5/6] xen-swiotlb: convert variables to arrays Dongli Zhang
2021-02-03 23:37 ` [Intel-gfx] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` [Nouveau] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-04 8:40 ` Christoph Hellwig
2021-02-04 8:40 ` [Intel-gfx] " Christoph Hellwig
2021-02-04 8:40 ` Christoph Hellwig
2021-02-04 8:40 ` [Nouveau] " Christoph Hellwig
2021-02-04 8:40 ` Christoph Hellwig
2021-02-07 15:56 ` Christoph Hellwig
2021-02-07 15:56 ` [Intel-gfx] " Christoph Hellwig
2021-02-07 15:56 ` Christoph Hellwig
2021-02-07 15:56 ` [Nouveau] " Christoph Hellwig
2021-02-07 15:56 ` Christoph Hellwig
2021-02-19 20:32 ` Konrad Rzeszutek Wilk
2021-02-19 20:32 ` [Intel-gfx] " Konrad Rzeszutek Wilk
2021-02-19 20:32 ` Konrad Rzeszutek Wilk
2021-02-19 20:32 ` Konrad Rzeszutek Wilk
2021-02-19 20:32 ` [Nouveau] " Konrad Rzeszutek Wilk
2021-02-19 20:32 ` Konrad Rzeszutek Wilk
2021-02-19 23:59 ` Boris Ostrovsky
2021-02-19 23:59 ` [Intel-gfx] " Boris Ostrovsky
2021-02-19 23:59 ` Boris Ostrovsky
2021-02-19 23:59 ` Boris Ostrovsky
2021-02-19 23:59 ` [Nouveau] " Boris Ostrovsky
2021-02-19 23:59 ` Boris Ostrovsky
2021-02-23 1:22 ` Stefano Stabellini
2021-02-23 1:22 ` Stefano Stabellini
2021-02-23 1:22 ` [Intel-gfx] " Stefano Stabellini
2021-02-23 1:22 ` Stefano Stabellini
2021-02-23 1:22 ` Stefano Stabellini
2021-02-23 1:22 ` [Nouveau] " Stefano Stabellini
2021-02-23 1:22 ` Stefano Stabellini
2021-02-03 23:37 ` [PATCH RFC v1 6/6] xen-swiotlb: enable 64-bit xen-swiotlb Dongli Zhang
2021-02-03 23:37 ` [Intel-gfx] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-03 23:37 ` [Nouveau] " Dongli Zhang
2021-02-03 23:37 ` Dongli Zhang
2021-02-04 11:50 ` kernel test robot
2021-02-04 19:53 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for swiotlb: 64-bit DMA buffer Patchwork
2021-02-04 19:54 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-02-04 20:22 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-02-05 2:08 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-02-04 2:13 [PATCH RFC v1 4/6] swiotlb: enable 64-bit swiotlb kernel test robot
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=202102041243.ZsvxEceW-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@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.