From: kernel test robot <lkp@intel.com>
To: Vivek Kasireddy <vivek.kasireddy@intel.com>,
dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: oe-kbuild-all@lists.linux.dev,
"Vivek Kasireddy" <vivek.kasireddy@intel.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Subject: Re: [PATCH v2 4/5] drm/xe/bo: Create new dma_addr array for dmabuf BOs associated with VFs
Date: Tue, 22 Oct 2024 18:12:50 +0800 [thread overview]
Message-ID: <202410221702.FLgKnDgM-lkp@intel.com> (raw)
In-Reply-To: <20241021052236.1820329-5-vivek.kasireddy@intel.com>
Hi Vivek,
kernel test robot noticed the following build errors:
[auto build test ERROR on drm-xe/drm-xe-next]
[also build test ERROR on drm/drm-next drm-exynos/exynos-drm-next drm-intel/for-linux-next drm-intel/for-linux-next-fixes drm-misc/drm-misc-next drm-tip/drm-tip linus/master v6.12-rc4 next-20241021]
[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/Vivek-Kasireddy/PCI-P2PDMA-Don-t-enforce-ACS-check-for-functions-of-same-device/20241021-134804
base: https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link: https://lore.kernel.org/r/20241021052236.1820329-5-vivek.kasireddy%40intel.com
patch subject: [PATCH v2 4/5] drm/xe/bo: Create new dma_addr array for dmabuf BOs associated with VFs
config: i386-buildonly-randconfig-003-20241022 (https://download.01.org/0day-ci/archive/20241022/202410221702.FLgKnDgM-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241022/202410221702.FLgKnDgM-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/202410221702.FLgKnDgM-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/gpu/drm/xe/xe_bo.c: In function 'xe_bo_translate_iova_to_dpa':
>> drivers/gpu/drm/xe/xe_bo.c:591:29: error: invalid use of undefined type 'struct drm_pagemap_dma_addr'
591 | bo->dma_addr[i] = drm_pagemap_dma_addr_encode(addr,
| ^
>> drivers/gpu/drm/xe/xe_bo.c:591:35: error: implicit declaration of function 'drm_pagemap_dma_addr_encode' [-Werror=implicit-function-declaration]
591 | bo->dma_addr[i] = drm_pagemap_dma_addr_encode(addr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_bo.c:592:49: error: 'DRM_INTERCONNECT_DRIVER' undeclared (first use in this function)
592 | DRM_INTERCONNECT_DRIVER,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_bo.c:592:49: note: each undeclared identifier is reported only once for each function it appears in
drivers/gpu/drm/xe/xe_bo.c:591:33: error: invalid use of undefined type 'struct drm_pagemap_dma_addr'
591 | bo->dma_addr[i] = drm_pagemap_dma_addr_encode(addr,
| ^
In file included from include/linux/percpu.h:5,
from arch/x86/include/asm/msr.h:15,
from arch/x86/include/asm/tsc.h:10,
from arch/x86/include/asm/timex.h:6,
from include/linux/timex.h:67,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/jiffies.h:10,
from include/linux/ktime.h:25,
from include/linux/timer.h:6,
from include/linux/workqueue.h:9,
from include/linux/mm_types.h:19,
from include/linux/mmzone.h:22,
from include/linux/gfp.h:7,
from include/linux/mm.h:7,
from include/linux/pagemap.h:8,
from include/drm/ttm/ttm_tt.h:30,
from drivers/gpu/drm/xe/xe_bo.h:9,
from drivers/gpu/drm/xe/xe_bo.c:6:
drivers/gpu/drm/xe/xe_bo.c: In function 'xe_bo_sg_to_dma_addr_array':
>> drivers/gpu/drm/xe/xe_bo.c:626:55: error: invalid application of 'sizeof' to incomplete type 'struct drm_pagemap_dma_addr'
626 | bo->dma_addr = kmalloc_array(sg->nents, sizeof(*bo->dma_addr),
| ^
include/linux/alloc_tag.h:202:16: note: in definition of macro 'alloc_hooks_tag'
202 | typeof(_do_alloc) _res = _do_alloc; \
| ^~~~~~~~~
include/linux/slab.h:925:49: note: in expansion of macro 'alloc_hooks'
925 | #define kmalloc_array(...) alloc_hooks(kmalloc_array_noprof(__VA_ARGS__))
| ^~~~~~~~~~~
drivers/gpu/drm/xe/xe_bo.c:626:24: note: in expansion of macro 'kmalloc_array'
626 | bo->dma_addr = kmalloc_array(sg->nents, sizeof(*bo->dma_addr),
| ^~~~~~~~~~~~~
>> drivers/gpu/drm/xe/xe_bo.c:626:55: error: invalid application of 'sizeof' to incomplete type 'struct drm_pagemap_dma_addr'
626 | bo->dma_addr = kmalloc_array(sg->nents, sizeof(*bo->dma_addr),
| ^
include/linux/alloc_tag.h:202:34: note: in definition of macro 'alloc_hooks_tag'
202 | typeof(_do_alloc) _res = _do_alloc; \
| ^~~~~~~~~
include/linux/slab.h:925:49: note: in expansion of macro 'alloc_hooks'
925 | #define kmalloc_array(...) alloc_hooks(kmalloc_array_noprof(__VA_ARGS__))
| ^~~~~~~~~~~
drivers/gpu/drm/xe/xe_bo.c:626:24: note: in expansion of macro 'kmalloc_array'
626 | bo->dma_addr = kmalloc_array(sg->nents, sizeof(*bo->dma_addr),
| ^~~~~~~~~~~~~
drivers/gpu/drm/xe/xe_bo.c:626:22: warning: assignment to 'struct drm_pagemap_dma_addr *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
626 | bo->dma_addr = kmalloc_array(sg->nents, sizeof(*bo->dma_addr),
| ^
cc1: some warnings being treated as errors
vim +591 drivers/gpu/drm/xe/xe_bo.c
570
571
572 static void xe_bo_translate_iova_to_dpa(struct iommu_domain *domain,
573 struct xe_bo *bo, struct sg_table *sg,
574 resource_size_t io_start, int vfid)
575 {
576 struct xe_device *xe = xe_bo_device(bo);
577 struct xe_gt *gt = xe_root_mmio_gt(xe);
578 struct scatterlist *sgl;
579 struct xe_bo *lmem_bo;
580 phys_addr_t phys;
581 dma_addr_t addr;
582 u64 offset, i;
583
584 lmem_bo = xe_gt_sriov_pf_config_get_lmem_obj(gt, ++vfid);
585
586 for_each_sgtable_dma_sg(sg, sgl, i) {
587 phys = iommu_iova_to_phys(domain, sg_dma_address(sgl));
588 offset = phys - io_start;
589 addr = xe_bo_addr(lmem_bo, offset, sg_dma_len(sgl));
590
> 591 bo->dma_addr[i] = drm_pagemap_dma_addr_encode(addr,
> 592 DRM_INTERCONNECT_DRIVER,
593 get_order(sg_dma_len(sgl)),
594 DMA_BIDIRECTIONAL);
595 }
596 }
597
598 static int xe_bo_sg_to_dma_addr_array(struct sg_table *sg, struct xe_bo *bo)
599 {
600 struct xe_device *xe = xe_bo_device(bo);
601 struct iommu_domain *domain;
602 resource_size_t io_start;
603 struct pci_dev *pdev;
604 phys_addr_t phys;
605 int vfid;
606
607 if (!IS_SRIOV_PF(xe))
608 return 0;
609
610 domain = iommu_get_domain_for_dev(xe->drm.dev);
611 if (!domain)
612 return 0;
613
614 phys = iommu_iova_to_phys(domain, sg_dma_address(sg->sgl));
615 if (page_is_ram(PFN_DOWN(phys)))
616 return 0;
617
618 pdev = xe_find_vf_dev(xe, phys);
619 if (!pdev)
620 return 0;
621
622 vfid = pci_iov_vf_id(pdev);
623 if (vfid < 0)
624 return 0;
625
> 626 bo->dma_addr = kmalloc_array(sg->nents, sizeof(*bo->dma_addr),
627 GFP_KERNEL);
628 if (!bo->dma_addr)
629 return -ENOMEM;
630
631 bo->is_devmem_external = true;
632 io_start = pci_resource_start(pdev, LMEM_BAR);
633 xe_bo_translate_iova_to_dpa(domain, bo, sg, io_start, vfid);
634
635 return 0;
636 }
637
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-10-22 10:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-21 5:21 [PATCH v2 0/5] drm/xe/sriov: Don't migrate dmabuf BO to System RAM while running in VM Vivek Kasireddy
2024-10-21 5:21 ` [PATCH v2 1/5] PCI/P2PDMA: Don't enforce ACS check for functions of same device Vivek Kasireddy
2024-10-22 15:16 ` Bjorn Helgaas
2024-10-22 21:15 ` Logan Gunthorpe
2024-10-24 5:50 ` Kasireddy, Vivek
2024-10-24 16:21 ` Logan Gunthorpe
2024-10-24 18:01 ` Bjorn Helgaas
2024-10-24 5:58 ` Kasireddy, Vivek
2024-10-24 17:59 ` Bjorn Helgaas
2024-10-25 6:57 ` Kasireddy, Vivek
2024-10-30 18:46 ` Bjorn Helgaas
2024-10-30 21:20 ` Logan Gunthorpe
2024-10-30 22:07 ` Bjorn Helgaas
2024-10-31 6:59 ` Kasireddy, Vivek
2024-10-21 5:21 ` [PATCH v2 2/5] drm/xe/dmabuf: Don't migrate BO to System RAM while running in VF mode Vivek Kasireddy
2024-10-21 5:21 ` [PATCH v2 3/5] drm/xe/pf: Add a helper function to get a VF's backing object in LMEM Vivek Kasireddy
2024-10-21 5:21 ` [PATCH v2 4/5] drm/xe/bo: Create new dma_addr array for dmabuf BOs associated with VFs Vivek Kasireddy
2024-10-22 10:12 ` kernel test robot [this message]
2024-10-22 10:54 ` kernel test robot
2024-10-21 5:21 ` [PATCH v2 5/5] drm/xe/pt: Add an additional check for dmabuf BOs while updating PTEs Vivek Kasireddy
2024-10-22 12:58 ` kernel test robot
2024-10-21 5:52 ` ✓ CI.Patch_applied: success for drm/xe/sriov: Don't migrate dmabuf BO to System RAM while running in VM (rev2) Patchwork
2024-10-21 5:52 ` ✗ CI.checkpatch: warning " Patchwork
2024-10-21 5:52 ` ✗ CI.KUnit: failure " Patchwork
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=202410221702.FLgKnDgM-lkp@intel.com \
--to=lkp@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=thomas.hellstrom@linux.intel.com \
--cc=vivek.kasireddy@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox