From: kbuild test robot <lkp@intel.com>
To: "Liu, Yi L" <yi.l.liu@intel.com>
Cc: jean-philippe@linaro.org, kevin.tian@intel.com,
kbuild-all@lists.01.org, ashok.raj@intel.com,
kvm@vger.kernel.org, iommu@lists.linux-foundation.org,
yi.y.sun@intel.com, linux-kernel@vger.kernel.org,
alex.williamson@redhat.com, jun.j.tian@intel.com,
hao.wu@intel.com
Subject: Re: [PATCH v1 6/8] vfio/type1: Bind guest page tables to host
Date: Mon, 23 Mar 2020 02:10:55 +0800 [thread overview]
Message-ID: <202003230231.zWRABTJF%lkp@intel.com> (raw)
In-Reply-To: <1584880325-10561-7-git-send-email-yi.l.liu@intel.com>
[-- Attachment #1: Type: text/plain, Size: 8974 bytes --]
Hi Yi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on vfio/next]
[also build test ERROR on v5.6-rc6 next-20200320]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Liu-Yi-L/vfio-expose-virtual-Shared-Virtual-Addressing-to-VMs/20200322-213259
base: https://github.com/awilliam/linux-vfio.git next
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/vfio/vfio_iommu_type1.c: In function 'vfio_iommu_get_stage1_format':
drivers/vfio/vfio_iommu_type1.c:2300:4: error: 'DOMAIN_ATTR_PASID_FORMAT' undeclared (first use in this function)
2300 | DOMAIN_ATTR_PASID_FORMAT, &format)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2300:4: note: each undeclared identifier is reported only once for each function it appears in
drivers/vfio/vfio_iommu_type1.c: In function 'vfio_iommu_type1_ioctl':
drivers/vfio/vfio_iommu_type1.c:2464:11: error: implicit declaration of function 'iommu_get_uapi_version' [-Werror=implicit-function-declaration]
2464 | return iommu_get_uapi_version();
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/vfio/vfio_iommu_type1.c:2626:15: error: implicit declaration of function 'iommu_uapi_get_data_size' [-Werror=implicit-function-declaration]
2626 | data_size = iommu_uapi_get_data_size(
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/vfio/vfio_iommu_type1.c:2627:5: error: 'IOMMU_UAPI_BIND_GPASID' undeclared (first use in this function)
2627 | IOMMU_UAPI_BIND_GPASID, version);
| ^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/iommu_uapi_get_data_size +2626 drivers/vfio/vfio_iommu_type1.c
2446
2447 static long vfio_iommu_type1_ioctl(void *iommu_data,
2448 unsigned int cmd, unsigned long arg)
2449 {
2450 struct vfio_iommu *iommu = iommu_data;
2451 unsigned long minsz;
2452
2453 if (cmd == VFIO_CHECK_EXTENSION) {
2454 switch (arg) {
2455 case VFIO_TYPE1_IOMMU:
2456 case VFIO_TYPE1v2_IOMMU:
2457 case VFIO_TYPE1_NESTING_IOMMU:
2458 return 1;
2459 case VFIO_DMA_CC_IOMMU:
2460 if (!iommu)
2461 return 0;
2462 return vfio_domains_have_iommu_cache(iommu);
2463 case VFIO_NESTING_IOMMU_UAPI:
2464 return iommu_get_uapi_version();
2465 default:
2466 return 0;
2467 }
2468 } else if (cmd == VFIO_IOMMU_GET_INFO) {
2469 struct vfio_iommu_type1_info info;
2470 struct vfio_info_cap caps = { .buf = NULL, .size = 0 };
2471 unsigned long capsz;
2472 int ret;
2473
2474 minsz = offsetofend(struct vfio_iommu_type1_info, iova_pgsizes);
2475
2476 /* For backward compatibility, cannot require this */
2477 capsz = offsetofend(struct vfio_iommu_type1_info, cap_offset);
2478
2479 if (copy_from_user(&info, (void __user *)arg, minsz))
2480 return -EFAULT;
2481
2482 if (info.argsz < minsz)
2483 return -EINVAL;
2484
2485 if (info.argsz >= capsz) {
2486 minsz = capsz;
2487 info.cap_offset = 0; /* output, no-recopy necessary */
2488 }
2489
2490 info.flags = VFIO_IOMMU_INFO_PGSIZES;
2491
2492 info.iova_pgsizes = vfio_pgsize_bitmap(iommu);
2493
2494 ret = vfio_iommu_iova_build_caps(iommu, &caps);
2495 if (ret)
2496 return ret;
2497
2498 ret = vfio_iommu_info_add_nesting_cap(iommu, &caps);
2499 if (ret)
2500 return ret;
2501
2502 if (caps.size) {
2503 info.flags |= VFIO_IOMMU_INFO_CAPS;
2504
2505 if (info.argsz < sizeof(info) + caps.size) {
2506 info.argsz = sizeof(info) + caps.size;
2507 } else {
2508 vfio_info_cap_shift(&caps, sizeof(info));
2509 if (copy_to_user((void __user *)arg +
2510 sizeof(info), caps.buf,
2511 caps.size)) {
2512 kfree(caps.buf);
2513 return -EFAULT;
2514 }
2515 info.cap_offset = sizeof(info);
2516 }
2517
2518 kfree(caps.buf);
2519 }
2520
2521 return copy_to_user((void __user *)arg, &info, minsz) ?
2522 -EFAULT : 0;
2523
2524 } else if (cmd == VFIO_IOMMU_MAP_DMA) {
2525 struct vfio_iommu_type1_dma_map map;
2526 uint32_t mask = VFIO_DMA_MAP_FLAG_READ |
2527 VFIO_DMA_MAP_FLAG_WRITE;
2528
2529 minsz = offsetofend(struct vfio_iommu_type1_dma_map, size);
2530
2531 if (copy_from_user(&map, (void __user *)arg, minsz))
2532 return -EFAULT;
2533
2534 if (map.argsz < minsz || map.flags & ~mask)
2535 return -EINVAL;
2536
2537 return vfio_dma_do_map(iommu, &map);
2538
2539 } else if (cmd == VFIO_IOMMU_UNMAP_DMA) {
2540 struct vfio_iommu_type1_dma_unmap unmap;
2541 long ret;
2542
2543 minsz = offsetofend(struct vfio_iommu_type1_dma_unmap, size);
2544
2545 if (copy_from_user(&unmap, (void __user *)arg, minsz))
2546 return -EFAULT;
2547
2548 if (unmap.argsz < minsz || unmap.flags)
2549 return -EINVAL;
2550
2551 ret = vfio_dma_do_unmap(iommu, &unmap);
2552 if (ret)
2553 return ret;
2554
2555 return copy_to_user((void __user *)arg, &unmap, minsz) ?
2556 -EFAULT : 0;
2557
2558 } else if (cmd == VFIO_IOMMU_PASID_REQUEST) {
2559 struct vfio_iommu_type1_pasid_request req;
2560 unsigned long offset;
2561
2562 minsz = offsetofend(struct vfio_iommu_type1_pasid_request,
2563 flags);
2564
2565 if (copy_from_user(&req, (void __user *)arg, minsz))
2566 return -EFAULT;
2567
2568 if (req.argsz < minsz ||
2569 !vfio_iommu_type1_pasid_req_valid(req.flags))
2570 return -EINVAL;
2571
2572 if (copy_from_user((void *)&req + minsz,
2573 (void __user *)arg + minsz,
2574 sizeof(req) - minsz))
2575 return -EFAULT;
2576
2577 switch (req.flags & VFIO_PASID_REQUEST_MASK) {
2578 case VFIO_IOMMU_PASID_ALLOC:
2579 {
2580 int ret = 0, result;
2581
2582 result = vfio_iommu_type1_pasid_alloc(iommu,
2583 req.alloc_pasid.min,
2584 req.alloc_pasid.max);
2585 if (result > 0) {
2586 offset = offsetof(
2587 struct vfio_iommu_type1_pasid_request,
2588 alloc_pasid.result);
2589 ret = copy_to_user(
2590 (void __user *) (arg + offset),
2591 &result, sizeof(result));
2592 } else {
2593 pr_debug("%s: PASID alloc failed\n", __func__);
2594 ret = -EFAULT;
2595 }
2596 return ret;
2597 }
2598 case VFIO_IOMMU_PASID_FREE:
2599 return vfio_iommu_type1_pasid_free(iommu,
2600 req.free_pasid);
2601 default:
2602 return -EINVAL;
2603 }
2604
2605 } else if (cmd == VFIO_IOMMU_BIND) {
2606 struct vfio_iommu_type1_bind bind;
2607 u32 version;
2608 int data_size;
2609 void *gbind_data;
2610 int ret;
2611
2612 minsz = offsetofend(struct vfio_iommu_type1_bind, flags);
2613
2614 if (copy_from_user(&bind, (void __user *)arg, minsz))
2615 return -EFAULT;
2616
2617 if (bind.argsz < minsz)
2618 return -EINVAL;
2619
2620 /* Get the version of struct iommu_gpasid_bind_data */
2621 if (copy_from_user(&version,
2622 (void __user *) (arg + minsz),
2623 sizeof(version)))
2624 return -EFAULT;
2625
> 2626 data_size = iommu_uapi_get_data_size(
> 2627 IOMMU_UAPI_BIND_GPASID, version);
2628 gbind_data = kzalloc(data_size, GFP_KERNEL);
2629 if (!gbind_data)
2630 return -ENOMEM;
2631
2632 if (copy_from_user(gbind_data,
2633 (void __user *) (arg + minsz), data_size)) {
2634 kfree(gbind_data);
2635 return -EFAULT;
2636 }
2637
2638 switch (bind.flags & VFIO_IOMMU_BIND_MASK) {
2639 case VFIO_IOMMU_BIND_GUEST_PGTBL:
2640 ret = vfio_iommu_type1_bind_gpasid(iommu,
2641 gbind_data);
2642 break;
2643 case VFIO_IOMMU_UNBIND_GUEST_PGTBL:
2644 ret = vfio_iommu_type1_unbind_gpasid(iommu,
2645 gbind_data);
2646 break;
2647 default:
2648 ret = -EINVAL;
2649 break;
2650 }
2651 kfree(gbind_data);
2652 return ret;
2653 }
2654
2655 return -ENOTTY;
2656 }
2657
---
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: 46471 bytes --]
[-- Attachment #3: Type: text/plain, Size: 156 bytes --]
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: "Liu, Yi L" <yi.l.liu@intel.com>
Cc: kbuild-all@lists.01.org, alex.williamson@redhat.com,
eric.auger@redhat.com, kevin.tian@intel.com,
jacob.jun.pan@linux.intel.com, joro@8bytes.org,
ashok.raj@intel.com, yi.l.liu@intel.com, jun.j.tian@intel.com,
yi.y.sun@intel.com, jean-philippe@linaro.org, peterx@redhat.com,
iommu@lists.linux-foundation.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, hao.wu@intel.com
Subject: Re: [PATCH v1 6/8] vfio/type1: Bind guest page tables to host
Date: Mon, 23 Mar 2020 02:10:55 +0800 [thread overview]
Message-ID: <202003230231.zWRABTJF%lkp@intel.com> (raw)
In-Reply-To: <1584880325-10561-7-git-send-email-yi.l.liu@intel.com>
[-- Attachment #1: Type: text/plain, Size: 8974 bytes --]
Hi Yi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on vfio/next]
[also build test ERROR on v5.6-rc6 next-20200320]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Liu-Yi-L/vfio-expose-virtual-Shared-Virtual-Addressing-to-VMs/20200322-213259
base: https://github.com/awilliam/linux-vfio.git next
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/vfio/vfio_iommu_type1.c: In function 'vfio_iommu_get_stage1_format':
drivers/vfio/vfio_iommu_type1.c:2300:4: error: 'DOMAIN_ATTR_PASID_FORMAT' undeclared (first use in this function)
2300 | DOMAIN_ATTR_PASID_FORMAT, &format)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2300:4: note: each undeclared identifier is reported only once for each function it appears in
drivers/vfio/vfio_iommu_type1.c: In function 'vfio_iommu_type1_ioctl':
drivers/vfio/vfio_iommu_type1.c:2464:11: error: implicit declaration of function 'iommu_get_uapi_version' [-Werror=implicit-function-declaration]
2464 | return iommu_get_uapi_version();
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/vfio/vfio_iommu_type1.c:2626:15: error: implicit declaration of function 'iommu_uapi_get_data_size' [-Werror=implicit-function-declaration]
2626 | data_size = iommu_uapi_get_data_size(
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/vfio/vfio_iommu_type1.c:2627:5: error: 'IOMMU_UAPI_BIND_GPASID' undeclared (first use in this function)
2627 | IOMMU_UAPI_BIND_GPASID, version);
| ^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/iommu_uapi_get_data_size +2626 drivers/vfio/vfio_iommu_type1.c
2446
2447 static long vfio_iommu_type1_ioctl(void *iommu_data,
2448 unsigned int cmd, unsigned long arg)
2449 {
2450 struct vfio_iommu *iommu = iommu_data;
2451 unsigned long minsz;
2452
2453 if (cmd == VFIO_CHECK_EXTENSION) {
2454 switch (arg) {
2455 case VFIO_TYPE1_IOMMU:
2456 case VFIO_TYPE1v2_IOMMU:
2457 case VFIO_TYPE1_NESTING_IOMMU:
2458 return 1;
2459 case VFIO_DMA_CC_IOMMU:
2460 if (!iommu)
2461 return 0;
2462 return vfio_domains_have_iommu_cache(iommu);
2463 case VFIO_NESTING_IOMMU_UAPI:
2464 return iommu_get_uapi_version();
2465 default:
2466 return 0;
2467 }
2468 } else if (cmd == VFIO_IOMMU_GET_INFO) {
2469 struct vfio_iommu_type1_info info;
2470 struct vfio_info_cap caps = { .buf = NULL, .size = 0 };
2471 unsigned long capsz;
2472 int ret;
2473
2474 minsz = offsetofend(struct vfio_iommu_type1_info, iova_pgsizes);
2475
2476 /* For backward compatibility, cannot require this */
2477 capsz = offsetofend(struct vfio_iommu_type1_info, cap_offset);
2478
2479 if (copy_from_user(&info, (void __user *)arg, minsz))
2480 return -EFAULT;
2481
2482 if (info.argsz < minsz)
2483 return -EINVAL;
2484
2485 if (info.argsz >= capsz) {
2486 minsz = capsz;
2487 info.cap_offset = 0; /* output, no-recopy necessary */
2488 }
2489
2490 info.flags = VFIO_IOMMU_INFO_PGSIZES;
2491
2492 info.iova_pgsizes = vfio_pgsize_bitmap(iommu);
2493
2494 ret = vfio_iommu_iova_build_caps(iommu, &caps);
2495 if (ret)
2496 return ret;
2497
2498 ret = vfio_iommu_info_add_nesting_cap(iommu, &caps);
2499 if (ret)
2500 return ret;
2501
2502 if (caps.size) {
2503 info.flags |= VFIO_IOMMU_INFO_CAPS;
2504
2505 if (info.argsz < sizeof(info) + caps.size) {
2506 info.argsz = sizeof(info) + caps.size;
2507 } else {
2508 vfio_info_cap_shift(&caps, sizeof(info));
2509 if (copy_to_user((void __user *)arg +
2510 sizeof(info), caps.buf,
2511 caps.size)) {
2512 kfree(caps.buf);
2513 return -EFAULT;
2514 }
2515 info.cap_offset = sizeof(info);
2516 }
2517
2518 kfree(caps.buf);
2519 }
2520
2521 return copy_to_user((void __user *)arg, &info, minsz) ?
2522 -EFAULT : 0;
2523
2524 } else if (cmd == VFIO_IOMMU_MAP_DMA) {
2525 struct vfio_iommu_type1_dma_map map;
2526 uint32_t mask = VFIO_DMA_MAP_FLAG_READ |
2527 VFIO_DMA_MAP_FLAG_WRITE;
2528
2529 minsz = offsetofend(struct vfio_iommu_type1_dma_map, size);
2530
2531 if (copy_from_user(&map, (void __user *)arg, minsz))
2532 return -EFAULT;
2533
2534 if (map.argsz < minsz || map.flags & ~mask)
2535 return -EINVAL;
2536
2537 return vfio_dma_do_map(iommu, &map);
2538
2539 } else if (cmd == VFIO_IOMMU_UNMAP_DMA) {
2540 struct vfio_iommu_type1_dma_unmap unmap;
2541 long ret;
2542
2543 minsz = offsetofend(struct vfio_iommu_type1_dma_unmap, size);
2544
2545 if (copy_from_user(&unmap, (void __user *)arg, minsz))
2546 return -EFAULT;
2547
2548 if (unmap.argsz < minsz || unmap.flags)
2549 return -EINVAL;
2550
2551 ret = vfio_dma_do_unmap(iommu, &unmap);
2552 if (ret)
2553 return ret;
2554
2555 return copy_to_user((void __user *)arg, &unmap, minsz) ?
2556 -EFAULT : 0;
2557
2558 } else if (cmd == VFIO_IOMMU_PASID_REQUEST) {
2559 struct vfio_iommu_type1_pasid_request req;
2560 unsigned long offset;
2561
2562 minsz = offsetofend(struct vfio_iommu_type1_pasid_request,
2563 flags);
2564
2565 if (copy_from_user(&req, (void __user *)arg, minsz))
2566 return -EFAULT;
2567
2568 if (req.argsz < minsz ||
2569 !vfio_iommu_type1_pasid_req_valid(req.flags))
2570 return -EINVAL;
2571
2572 if (copy_from_user((void *)&req + minsz,
2573 (void __user *)arg + minsz,
2574 sizeof(req) - minsz))
2575 return -EFAULT;
2576
2577 switch (req.flags & VFIO_PASID_REQUEST_MASK) {
2578 case VFIO_IOMMU_PASID_ALLOC:
2579 {
2580 int ret = 0, result;
2581
2582 result = vfio_iommu_type1_pasid_alloc(iommu,
2583 req.alloc_pasid.min,
2584 req.alloc_pasid.max);
2585 if (result > 0) {
2586 offset = offsetof(
2587 struct vfio_iommu_type1_pasid_request,
2588 alloc_pasid.result);
2589 ret = copy_to_user(
2590 (void __user *) (arg + offset),
2591 &result, sizeof(result));
2592 } else {
2593 pr_debug("%s: PASID alloc failed\n", __func__);
2594 ret = -EFAULT;
2595 }
2596 return ret;
2597 }
2598 case VFIO_IOMMU_PASID_FREE:
2599 return vfio_iommu_type1_pasid_free(iommu,
2600 req.free_pasid);
2601 default:
2602 return -EINVAL;
2603 }
2604
2605 } else if (cmd == VFIO_IOMMU_BIND) {
2606 struct vfio_iommu_type1_bind bind;
2607 u32 version;
2608 int data_size;
2609 void *gbind_data;
2610 int ret;
2611
2612 minsz = offsetofend(struct vfio_iommu_type1_bind, flags);
2613
2614 if (copy_from_user(&bind, (void __user *)arg, minsz))
2615 return -EFAULT;
2616
2617 if (bind.argsz < minsz)
2618 return -EINVAL;
2619
2620 /* Get the version of struct iommu_gpasid_bind_data */
2621 if (copy_from_user(&version,
2622 (void __user *) (arg + minsz),
2623 sizeof(version)))
2624 return -EFAULT;
2625
> 2626 data_size = iommu_uapi_get_data_size(
> 2627 IOMMU_UAPI_BIND_GPASID, version);
2628 gbind_data = kzalloc(data_size, GFP_KERNEL);
2629 if (!gbind_data)
2630 return -ENOMEM;
2631
2632 if (copy_from_user(gbind_data,
2633 (void __user *) (arg + minsz), data_size)) {
2634 kfree(gbind_data);
2635 return -EFAULT;
2636 }
2637
2638 switch (bind.flags & VFIO_IOMMU_BIND_MASK) {
2639 case VFIO_IOMMU_BIND_GUEST_PGTBL:
2640 ret = vfio_iommu_type1_bind_gpasid(iommu,
2641 gbind_data);
2642 break;
2643 case VFIO_IOMMU_UNBIND_GUEST_PGTBL:
2644 ret = vfio_iommu_type1_unbind_gpasid(iommu,
2645 gbind_data);
2646 break;
2647 default:
2648 ret = -EINVAL;
2649 break;
2650 }
2651 kfree(gbind_data);
2652 return ret;
2653 }
2654
2655 return -ENOTTY;
2656 }
2657
---
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: 46471 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v1 6/8] vfio/type1: Bind guest page tables to host
Date: Mon, 23 Mar 2020 02:10:55 +0800 [thread overview]
Message-ID: <202003230231.zWRABTJF%lkp@intel.com> (raw)
In-Reply-To: <1584880325-10561-7-git-send-email-yi.l.liu@intel.com>
[-- Attachment #1: Type: text/plain, Size: 9236 bytes --]
Hi Yi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on vfio/next]
[also build test ERROR on v5.6-rc6 next-20200320]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Liu-Yi-L/vfio-expose-virtual-Shared-Virtual-Addressing-to-VMs/20200322-213259
base: https://github.com/awilliam/linux-vfio.git next
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=9.2.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/vfio/vfio_iommu_type1.c: In function 'vfio_iommu_get_stage1_format':
drivers/vfio/vfio_iommu_type1.c:2300:4: error: 'DOMAIN_ATTR_PASID_FORMAT' undeclared (first use in this function)
2300 | DOMAIN_ATTR_PASID_FORMAT, &format)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/vfio_iommu_type1.c:2300:4: note: each undeclared identifier is reported only once for each function it appears in
drivers/vfio/vfio_iommu_type1.c: In function 'vfio_iommu_type1_ioctl':
drivers/vfio/vfio_iommu_type1.c:2464:11: error: implicit declaration of function 'iommu_get_uapi_version' [-Werror=implicit-function-declaration]
2464 | return iommu_get_uapi_version();
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/vfio/vfio_iommu_type1.c:2626:15: error: implicit declaration of function 'iommu_uapi_get_data_size' [-Werror=implicit-function-declaration]
2626 | data_size = iommu_uapi_get_data_size(
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/vfio/vfio_iommu_type1.c:2627:5: error: 'IOMMU_UAPI_BIND_GPASID' undeclared (first use in this function)
2627 | IOMMU_UAPI_BIND_GPASID, version);
| ^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/iommu_uapi_get_data_size +2626 drivers/vfio/vfio_iommu_type1.c
2446
2447 static long vfio_iommu_type1_ioctl(void *iommu_data,
2448 unsigned int cmd, unsigned long arg)
2449 {
2450 struct vfio_iommu *iommu = iommu_data;
2451 unsigned long minsz;
2452
2453 if (cmd == VFIO_CHECK_EXTENSION) {
2454 switch (arg) {
2455 case VFIO_TYPE1_IOMMU:
2456 case VFIO_TYPE1v2_IOMMU:
2457 case VFIO_TYPE1_NESTING_IOMMU:
2458 return 1;
2459 case VFIO_DMA_CC_IOMMU:
2460 if (!iommu)
2461 return 0;
2462 return vfio_domains_have_iommu_cache(iommu);
2463 case VFIO_NESTING_IOMMU_UAPI:
2464 return iommu_get_uapi_version();
2465 default:
2466 return 0;
2467 }
2468 } else if (cmd == VFIO_IOMMU_GET_INFO) {
2469 struct vfio_iommu_type1_info info;
2470 struct vfio_info_cap caps = { .buf = NULL, .size = 0 };
2471 unsigned long capsz;
2472 int ret;
2473
2474 minsz = offsetofend(struct vfio_iommu_type1_info, iova_pgsizes);
2475
2476 /* For backward compatibility, cannot require this */
2477 capsz = offsetofend(struct vfio_iommu_type1_info, cap_offset);
2478
2479 if (copy_from_user(&info, (void __user *)arg, minsz))
2480 return -EFAULT;
2481
2482 if (info.argsz < minsz)
2483 return -EINVAL;
2484
2485 if (info.argsz >= capsz) {
2486 minsz = capsz;
2487 info.cap_offset = 0; /* output, no-recopy necessary */
2488 }
2489
2490 info.flags = VFIO_IOMMU_INFO_PGSIZES;
2491
2492 info.iova_pgsizes = vfio_pgsize_bitmap(iommu);
2493
2494 ret = vfio_iommu_iova_build_caps(iommu, &caps);
2495 if (ret)
2496 return ret;
2497
2498 ret = vfio_iommu_info_add_nesting_cap(iommu, &caps);
2499 if (ret)
2500 return ret;
2501
2502 if (caps.size) {
2503 info.flags |= VFIO_IOMMU_INFO_CAPS;
2504
2505 if (info.argsz < sizeof(info) + caps.size) {
2506 info.argsz = sizeof(info) + caps.size;
2507 } else {
2508 vfio_info_cap_shift(&caps, sizeof(info));
2509 if (copy_to_user((void __user *)arg +
2510 sizeof(info), caps.buf,
2511 caps.size)) {
2512 kfree(caps.buf);
2513 return -EFAULT;
2514 }
2515 info.cap_offset = sizeof(info);
2516 }
2517
2518 kfree(caps.buf);
2519 }
2520
2521 return copy_to_user((void __user *)arg, &info, minsz) ?
2522 -EFAULT : 0;
2523
2524 } else if (cmd == VFIO_IOMMU_MAP_DMA) {
2525 struct vfio_iommu_type1_dma_map map;
2526 uint32_t mask = VFIO_DMA_MAP_FLAG_READ |
2527 VFIO_DMA_MAP_FLAG_WRITE;
2528
2529 minsz = offsetofend(struct vfio_iommu_type1_dma_map, size);
2530
2531 if (copy_from_user(&map, (void __user *)arg, minsz))
2532 return -EFAULT;
2533
2534 if (map.argsz < minsz || map.flags & ~mask)
2535 return -EINVAL;
2536
2537 return vfio_dma_do_map(iommu, &map);
2538
2539 } else if (cmd == VFIO_IOMMU_UNMAP_DMA) {
2540 struct vfio_iommu_type1_dma_unmap unmap;
2541 long ret;
2542
2543 minsz = offsetofend(struct vfio_iommu_type1_dma_unmap, size);
2544
2545 if (copy_from_user(&unmap, (void __user *)arg, minsz))
2546 return -EFAULT;
2547
2548 if (unmap.argsz < minsz || unmap.flags)
2549 return -EINVAL;
2550
2551 ret = vfio_dma_do_unmap(iommu, &unmap);
2552 if (ret)
2553 return ret;
2554
2555 return copy_to_user((void __user *)arg, &unmap, minsz) ?
2556 -EFAULT : 0;
2557
2558 } else if (cmd == VFIO_IOMMU_PASID_REQUEST) {
2559 struct vfio_iommu_type1_pasid_request req;
2560 unsigned long offset;
2561
2562 minsz = offsetofend(struct vfio_iommu_type1_pasid_request,
2563 flags);
2564
2565 if (copy_from_user(&req, (void __user *)arg, minsz))
2566 return -EFAULT;
2567
2568 if (req.argsz < minsz ||
2569 !vfio_iommu_type1_pasid_req_valid(req.flags))
2570 return -EINVAL;
2571
2572 if (copy_from_user((void *)&req + minsz,
2573 (void __user *)arg + minsz,
2574 sizeof(req) - minsz))
2575 return -EFAULT;
2576
2577 switch (req.flags & VFIO_PASID_REQUEST_MASK) {
2578 case VFIO_IOMMU_PASID_ALLOC:
2579 {
2580 int ret = 0, result;
2581
2582 result = vfio_iommu_type1_pasid_alloc(iommu,
2583 req.alloc_pasid.min,
2584 req.alloc_pasid.max);
2585 if (result > 0) {
2586 offset = offsetof(
2587 struct vfio_iommu_type1_pasid_request,
2588 alloc_pasid.result);
2589 ret = copy_to_user(
2590 (void __user *) (arg + offset),
2591 &result, sizeof(result));
2592 } else {
2593 pr_debug("%s: PASID alloc failed\n", __func__);
2594 ret = -EFAULT;
2595 }
2596 return ret;
2597 }
2598 case VFIO_IOMMU_PASID_FREE:
2599 return vfio_iommu_type1_pasid_free(iommu,
2600 req.free_pasid);
2601 default:
2602 return -EINVAL;
2603 }
2604
2605 } else if (cmd == VFIO_IOMMU_BIND) {
2606 struct vfio_iommu_type1_bind bind;
2607 u32 version;
2608 int data_size;
2609 void *gbind_data;
2610 int ret;
2611
2612 minsz = offsetofend(struct vfio_iommu_type1_bind, flags);
2613
2614 if (copy_from_user(&bind, (void __user *)arg, minsz))
2615 return -EFAULT;
2616
2617 if (bind.argsz < minsz)
2618 return -EINVAL;
2619
2620 /* Get the version of struct iommu_gpasid_bind_data */
2621 if (copy_from_user(&version,
2622 (void __user *) (arg + minsz),
2623 sizeof(version)))
2624 return -EFAULT;
2625
> 2626 data_size = iommu_uapi_get_data_size(
> 2627 IOMMU_UAPI_BIND_GPASID, version);
2628 gbind_data = kzalloc(data_size, GFP_KERNEL);
2629 if (!gbind_data)
2630 return -ENOMEM;
2631
2632 if (copy_from_user(gbind_data,
2633 (void __user *) (arg + minsz), data_size)) {
2634 kfree(gbind_data);
2635 return -EFAULT;
2636 }
2637
2638 switch (bind.flags & VFIO_IOMMU_BIND_MASK) {
2639 case VFIO_IOMMU_BIND_GUEST_PGTBL:
2640 ret = vfio_iommu_type1_bind_gpasid(iommu,
2641 gbind_data);
2642 break;
2643 case VFIO_IOMMU_UNBIND_GUEST_PGTBL:
2644 ret = vfio_iommu_type1_unbind_gpasid(iommu,
2645 gbind_data);
2646 break;
2647 default:
2648 ret = -EINVAL;
2649 break;
2650 }
2651 kfree(gbind_data);
2652 return ret;
2653 }
2654
2655 return -ENOTTY;
2656 }
2657
---
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: 46471 bytes --]
next prev parent reply other threads:[~2020-03-22 18:11 UTC|newest]
Thread overview: 225+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-22 12:31 [PATCH v1 0/8] vfio: expose virtual Shared Virtual Addressing to VMs Liu, Yi L
2020-03-22 12:31 ` Liu, Yi L
2020-03-22 12:31 ` [PATCH v1 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) Liu, Yi L
2020-03-22 12:31 ` Liu, Yi L
2020-03-22 16:21 ` kbuild test robot
2020-03-22 16:21 ` kbuild test robot
2020-03-22 16:21 ` kbuild test robot
2020-03-30 8:32 ` Tian, Kevin
2020-03-30 8:32 ` Tian, Kevin
2020-03-30 14:36 ` Liu, Yi L
2020-03-30 14:36 ` Liu, Yi L
2020-03-31 5:40 ` Tian, Kevin
2020-03-31 5:40 ` Tian, Kevin
2020-03-31 13:22 ` Liu, Yi L
2020-03-31 13:22 ` Liu, Yi L
2020-04-01 5:43 ` Tian, Kevin
2020-04-01 5:43 ` Tian, Kevin
2020-04-01 5:48 ` Liu, Yi L
2020-04-01 5:48 ` Liu, Yi L
2020-03-31 7:53 ` Christoph Hellwig
2020-03-31 7:53 ` Christoph Hellwig
2020-03-31 8:17 ` Liu, Yi L
2020-03-31 8:17 ` Liu, Yi L
2020-03-31 8:32 ` Liu, Yi L
2020-03-31 8:32 ` Liu, Yi L
2020-03-31 8:36 ` Liu, Yi L
2020-03-31 8:36 ` Liu, Yi L
2020-03-31 9:15 ` Christoph Hellwig
2020-03-31 9:15 ` Christoph Hellwig
2020-04-02 13:52 ` Jean-Philippe Brucker
2020-04-02 13:52 ` Jean-Philippe Brucker
2020-04-03 11:56 ` Liu, Yi L
2020-04-03 11:56 ` Liu, Yi L
2020-04-03 12:39 ` Jean-Philippe Brucker
2020-04-03 12:39 ` Jean-Philippe Brucker
2020-04-03 12:44 ` Liu, Yi L
2020-04-03 12:44 ` Liu, Yi L
2020-04-02 17:50 ` Alex Williamson
2020-04-02 17:50 ` Alex Williamson
2020-04-03 5:58 ` Tian, Kevin
2020-04-03 5:58 ` Tian, Kevin
2020-04-03 15:14 ` Alex Williamson
2020-04-03 15:14 ` Alex Williamson
2020-04-07 4:42 ` Tian, Kevin
2020-04-07 4:42 ` Tian, Kevin
2020-04-07 15:14 ` Alex Williamson
2020-04-07 15:14 ` Alex Williamson
2020-04-03 13:12 ` Liu, Yi L
2020-04-03 13:12 ` Liu, Yi L
2020-04-03 17:50 ` Alex Williamson
2020-04-03 17:50 ` Alex Williamson
2020-04-07 4:52 ` Tian, Kevin
2020-04-07 4:52 ` Tian, Kevin
2020-04-08 0:52 ` Liu, Yi L
2020-04-08 0:52 ` Liu, Yi L
2020-03-22 12:31 ` [PATCH v1 2/8] vfio/type1: Add vfio_iommu_type1 parameter for quota tuning Liu, Yi L
2020-03-22 12:31 ` Liu, Yi L
2020-03-22 17:20 ` kbuild test robot
2020-03-22 17:20 ` kbuild test robot
2020-03-22 17:20 ` kbuild test robot
2020-03-30 8:40 ` Tian, Kevin
2020-03-30 8:40 ` Tian, Kevin
2020-03-30 8:52 ` Liu, Yi L
2020-03-30 8:52 ` Liu, Yi L
2020-03-30 9:19 ` Tian, Kevin
2020-03-30 9:19 ` Tian, Kevin
2020-03-30 9:26 ` Liu, Yi L
2020-03-30 9:26 ` Liu, Yi L
2020-03-30 11:44 ` Tian, Kevin
2020-03-30 11:44 ` Tian, Kevin
2020-04-02 17:58 ` Alex Williamson
2020-04-02 17:58 ` Alex Williamson
2020-04-03 8:15 ` Liu, Yi L
2020-04-03 8:15 ` Liu, Yi L
2020-03-22 12:32 ` [PATCH v1 3/8] vfio/type1: Report PASID alloc/free support to userspace Liu, Yi L
2020-03-22 12:32 ` Liu, Yi L
2020-03-30 9:43 ` Tian, Kevin
2020-03-30 9:43 ` Tian, Kevin
2020-04-01 7:46 ` Liu, Yi L
2020-04-01 7:46 ` Liu, Yi L
2020-04-01 9:41 ` Auger Eric
2020-04-01 9:41 ` Auger Eric
2020-04-01 13:13 ` Liu, Yi L
2020-04-01 13:13 ` Liu, Yi L
2020-04-02 18:01 ` Alex Williamson
2020-04-02 18:01 ` Alex Williamson
2020-04-03 8:17 ` Liu, Yi L
2020-04-03 8:17 ` Liu, Yi L
2020-04-03 17:28 ` Alex Williamson
2020-04-03 17:28 ` Alex Williamson
2020-04-04 11:36 ` Liu, Yi L
2020-04-04 11:36 ` Liu, Yi L
2020-03-22 12:32 ` [PATCH v1 4/8] vfio: Check nesting iommu uAPI version Liu, Yi L
2020-03-22 12:32 ` Liu, Yi L
2020-03-22 18:30 ` kbuild test robot
2020-03-22 18:30 ` kbuild test robot
2020-03-22 18:30 ` kbuild test robot
2020-03-22 12:32 ` [PATCH v1 5/8] vfio/type1: Report 1st-level/stage-1 format to userspace Liu, Yi L
2020-03-22 12:32 ` Liu, Yi L
2020-03-22 16:44 ` kbuild test robot
2020-03-22 16:44 ` kbuild test robot
2020-03-22 16:44 ` kbuild test robot
2020-03-30 11:48 ` Tian, Kevin
2020-03-30 11:48 ` Tian, Kevin
2020-04-01 7:38 ` Liu, Yi L
2020-04-01 7:38 ` Liu, Yi L
2020-04-01 7:56 ` Tian, Kevin
2020-04-01 7:56 ` Tian, Kevin
2020-04-01 8:06 ` Liu, Yi L
2020-04-01 8:06 ` Liu, Yi L
2020-04-01 8:08 ` Tian, Kevin
2020-04-01 8:08 ` Tian, Kevin
2020-04-01 8:09 ` Liu, Yi L
2020-04-01 8:09 ` Liu, Yi L
2020-04-01 8:51 ` Auger Eric
2020-04-01 8:51 ` Auger Eric
2020-04-01 12:51 ` Liu, Yi L
2020-04-01 12:51 ` Liu, Yi L
2020-04-01 13:01 ` Auger Eric
2020-04-01 13:01 ` Auger Eric
2020-04-03 8:23 ` Jean-Philippe Brucker
2020-04-03 8:23 ` Jean-Philippe Brucker
2020-04-07 9:43 ` Liu, Yi L
2020-04-07 9:43 ` Liu, Yi L
2020-04-08 1:02 ` Liu, Yi L
2020-04-08 1:02 ` Liu, Yi L
2020-04-08 10:27 ` Auger Eric
2020-04-08 10:27 ` Auger Eric
2020-04-09 8:14 ` Jean-Philippe Brucker
2020-04-09 8:14 ` Jean-Philippe Brucker
2020-04-09 9:01 ` Auger Eric
2020-04-09 9:01 ` Auger Eric
2020-04-09 12:47 ` Liu, Yi L
2020-04-09 12:47 ` Liu, Yi L
2020-04-10 3:28 ` Auger Eric
2020-04-10 3:28 ` Auger Eric
2020-04-10 3:48 ` Liu, Yi L
2020-04-10 3:48 ` Liu, Yi L
2020-04-10 12:30 ` Liu, Yi L
2020-04-10 12:30 ` Liu, Yi L
2020-04-02 19:20 ` Alex Williamson
2020-04-02 19:20 ` Alex Williamson
2020-04-03 11:59 ` Liu, Yi L
2020-04-03 11:59 ` Liu, Yi L
2020-03-22 12:32 ` [PATCH v1 6/8] vfio/type1: Bind guest page tables to host Liu, Yi L
2020-03-22 12:32 ` Liu, Yi L
2020-03-22 18:10 ` kbuild test robot [this message]
2020-03-22 18:10 ` kbuild test robot
2020-03-22 18:10 ` kbuild test robot
2020-03-30 12:46 ` Tian, Kevin
2020-03-30 12:46 ` Tian, Kevin
2020-04-01 9:13 ` Liu, Yi L
2020-04-01 9:13 ` Liu, Yi L
2020-04-02 2:12 ` Tian, Kevin
2020-04-02 2:12 ` Tian, Kevin
2020-04-02 8:05 ` Liu, Yi L
2020-04-02 8:05 ` Liu, Yi L
2020-04-03 8:34 ` Jean-Philippe Brucker
2020-04-03 8:34 ` Jean-Philippe Brucker
2020-04-07 10:33 ` Liu, Yi L
2020-04-07 10:33 ` Liu, Yi L
2020-04-09 8:28 ` Jean-Philippe Brucker
2020-04-09 8:28 ` Jean-Philippe Brucker
2020-04-09 9:15 ` Liu, Yi L
2020-04-09 9:15 ` Liu, Yi L
2020-04-09 9:38 ` Jean-Philippe Brucker
2020-04-09 9:38 ` Jean-Philippe Brucker
2020-04-02 19:57 ` Alex Williamson
2020-04-02 19:57 ` Alex Williamson
2020-04-03 13:30 ` Liu, Yi L
2020-04-03 13:30 ` Liu, Yi L
2020-04-03 18:11 ` Alex Williamson
2020-04-03 18:11 ` Alex Williamson
2020-04-04 10:28 ` Liu, Yi L
2020-04-04 10:28 ` Liu, Yi L
2020-04-11 5:52 ` Liu, Yi L
2020-04-11 5:52 ` Liu, Yi L
2020-03-22 12:32 ` [PATCH v1 7/8] vfio/type1: Add VFIO_IOMMU_CACHE_INVALIDATE Liu, Yi L
2020-03-22 12:32 ` Liu, Yi L
2020-03-30 12:58 ` Tian, Kevin
2020-03-30 12:58 ` Tian, Kevin
2020-04-01 7:49 ` Liu, Yi L
2020-04-01 7:49 ` Liu, Yi L
2020-03-31 7:56 ` Christoph Hellwig
2020-03-31 7:56 ` Christoph Hellwig
2020-03-31 10:48 ` Liu, Yi L
2020-03-31 10:48 ` Liu, Yi L
2020-04-02 20:24 ` Alex Williamson
2020-04-02 20:24 ` Alex Williamson
2020-04-03 6:39 ` Tian, Kevin
2020-04-03 6:39 ` Tian, Kevin
2020-04-03 15:31 ` Jacob Pan
2020-04-03 15:31 ` Jacob Pan
2020-04-03 15:34 ` Alex Williamson
2020-04-03 15:34 ` Alex Williamson
2020-04-08 2:28 ` Liu, Yi L
2020-04-08 2:28 ` Liu, Yi L
2020-04-16 10:40 ` Liu, Yi L
2020-04-16 10:40 ` Liu, Yi L
2020-04-16 12:09 ` Tian, Kevin
2020-04-16 12:09 ` Tian, Kevin
2020-04-16 12:42 ` Auger Eric
2020-04-16 12:42 ` Auger Eric
2020-04-16 13:28 ` Tian, Kevin
2020-04-16 13:28 ` Tian, Kevin
2020-04-16 15:12 ` Auger Eric
2020-04-16 15:12 ` Auger Eric
2020-04-16 14:40 ` Alex Williamson
2020-04-16 14:40 ` Alex Williamson
2020-04-16 14:48 ` Alex Williamson
2020-04-16 14:48 ` Alex Williamson
2020-04-17 6:03 ` Liu, Yi L
2020-04-17 6:03 ` Liu, Yi L
2020-03-22 12:32 ` [PATCH v1 8/8] vfio/type1: Add vSVA support for IOMMU-backed mdevs Liu, Yi L
2020-03-22 12:32 ` Liu, Yi L
2020-03-30 13:18 ` Tian, Kevin
2020-03-30 13:18 ` Tian, Kevin
2020-04-01 7:51 ` Liu, Yi L
2020-04-01 7:51 ` Liu, Yi L
2020-04-02 20:33 ` Alex Williamson
2020-04-02 20:33 ` Alex Williamson
2020-04-03 13:39 ` Liu, Yi L
2020-04-03 13:39 ` Liu, Yi L
2020-03-26 12:56 ` [PATCH v1 0/8] vfio: expose virtual Shared Virtual Addressing to VMs Liu, Yi L
2020-03-26 12:56 ` Liu, Yi L
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=202003230231.zWRABTJF%lkp@intel.com \
--to=lkp@intel.com \
--cc=alex.williamson@redhat.com \
--cc=ashok.raj@intel.com \
--cc=hao.wu@intel.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jean-philippe@linaro.org \
--cc=jun.j.tian@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yi.l.liu@intel.com \
--cc=yi.y.sun@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 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.