From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@kernel.org>,
Nipun Gupta <nipun.gupta@amd.com>,
Nikhil Agarwal <nikhil.agarwal@amd.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
"Thomas Gleixner" <tglx@linutronix.de>,
"Marc Zyngier" <maz@kernel.org>, "Arnd Bergmann" <arnd@arndb.de>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Thomas Weißschuu" <linux@weissschuh.net>,
"Qiu-ji Chen" <chenqiuji666@gmail.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Rob Herring (Arm)" <robh@kernel.org>,
"Robin Murphy" <robin.murphy@arm.com>,
"Abhijit Gangurde" <abhijit.gangurde@amd.com>,
"Nathan Chancellor" <nathan@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cdx: don't select CONFIG_GENERIC_MSI_IRQ
Date: Thu, 7 Aug 2025 03:44:47 +0800 [thread overview]
Message-ID: <202508070308.opy5dIFX-lkp@intel.com> (raw)
In-Reply-To: <20250805161059.4006484-1-arnd@kernel.org>
Hi Arnd,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on next-20250806]
[cannot apply to soc/for-next v6.16]
[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/Arnd-Bergmann/cdx-don-t-select-CONFIG_GENERIC_MSI_IRQ/20250806-121343
base: linus/master
patch link: https://lore.kernel.org/r/20250805161059.4006484-1-arnd%40kernel.org
patch subject: [PATCH] cdx: don't select CONFIG_GENERIC_MSI_IRQ
config: hexagon-randconfig-002-20250807 (https://download.01.org/0day-ci/archive/20250807/202508070308.opy5dIFX-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 7b8dea265e72c3037b6b1e54d5ab51b7e14f328b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250807/202508070308.opy5dIFX-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/202508070308.opy5dIFX-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/vfio/cdx/intr.c:41:8: error: call to undeclared function 'msi_domain_alloc_irqs'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
41 | ret = msi_domain_alloc_irqs(dev, MSI_DEFAULT_DOMAIN, nvec);
| ^
drivers/vfio/cdx/intr.c:41:8: note: did you mean 'msi_domain_get_virq'?
include/linux/msi_api.h:58:14: note: 'msi_domain_get_virq' declared here
58 | unsigned int msi_domain_get_virq(struct device *dev, unsigned int domid, unsigned int index);
| ^
>> drivers/vfio/cdx/intr.c:135:2: error: call to undeclared function 'msi_domain_free_irqs_all'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
135 | msi_domain_free_irqs_all(dev, MSI_DEFAULT_DOMAIN);
| ^
2 errors generated.
vim +/msi_domain_alloc_irqs +41 drivers/vfio/cdx/intr.c
848e447e000c418 Nipun Gupta 2024-04-23 23
848e447e000c418 Nipun Gupta 2024-04-23 24 static int vfio_cdx_msi_enable(struct vfio_cdx_device *vdev, int nvec)
848e447e000c418 Nipun Gupta 2024-04-23 25 {
848e447e000c418 Nipun Gupta 2024-04-23 26 struct cdx_device *cdx_dev = to_cdx_device(vdev->vdev.dev);
848e447e000c418 Nipun Gupta 2024-04-23 27 struct device *dev = vdev->vdev.dev;
848e447e000c418 Nipun Gupta 2024-04-23 28 int msi_idx, ret;
848e447e000c418 Nipun Gupta 2024-04-23 29
848e447e000c418 Nipun Gupta 2024-04-23 30 vdev->cdx_irqs = kcalloc(nvec, sizeof(struct vfio_cdx_irq), GFP_KERNEL);
848e447e000c418 Nipun Gupta 2024-04-23 31 if (!vdev->cdx_irqs)
848e447e000c418 Nipun Gupta 2024-04-23 32 return -ENOMEM;
848e447e000c418 Nipun Gupta 2024-04-23 33
848e447e000c418 Nipun Gupta 2024-04-23 34 ret = cdx_enable_msi(cdx_dev);
848e447e000c418 Nipun Gupta 2024-04-23 35 if (ret) {
848e447e000c418 Nipun Gupta 2024-04-23 36 kfree(vdev->cdx_irqs);
848e447e000c418 Nipun Gupta 2024-04-23 37 return ret;
848e447e000c418 Nipun Gupta 2024-04-23 38 }
848e447e000c418 Nipun Gupta 2024-04-23 39
848e447e000c418 Nipun Gupta 2024-04-23 40 /* Allocate cdx MSIs */
848e447e000c418 Nipun Gupta 2024-04-23 @41 ret = msi_domain_alloc_irqs(dev, MSI_DEFAULT_DOMAIN, nvec);
848e447e000c418 Nipun Gupta 2024-04-23 42 if (ret) {
848e447e000c418 Nipun Gupta 2024-04-23 43 cdx_disable_msi(cdx_dev);
848e447e000c418 Nipun Gupta 2024-04-23 44 kfree(vdev->cdx_irqs);
848e447e000c418 Nipun Gupta 2024-04-23 45 return ret;
848e447e000c418 Nipun Gupta 2024-04-23 46 }
848e447e000c418 Nipun Gupta 2024-04-23 47
848e447e000c418 Nipun Gupta 2024-04-23 48 for (msi_idx = 0; msi_idx < nvec; msi_idx++)
848e447e000c418 Nipun Gupta 2024-04-23 49 vdev->cdx_irqs[msi_idx].irq_no = msi_get_virq(dev, msi_idx);
848e447e000c418 Nipun Gupta 2024-04-23 50
848e447e000c418 Nipun Gupta 2024-04-23 51 vdev->msi_count = nvec;
848e447e000c418 Nipun Gupta 2024-04-23 52 vdev->config_msi = 1;
848e447e000c418 Nipun Gupta 2024-04-23 53
848e447e000c418 Nipun Gupta 2024-04-23 54 return 0;
848e447e000c418 Nipun Gupta 2024-04-23 55 }
848e447e000c418 Nipun Gupta 2024-04-23 56
848e447e000c418 Nipun Gupta 2024-04-23 57 static int vfio_cdx_msi_set_vector_signal(struct vfio_cdx_device *vdev,
848e447e000c418 Nipun Gupta 2024-04-23 58 int vector, int fd)
848e447e000c418 Nipun Gupta 2024-04-23 59 {
848e447e000c418 Nipun Gupta 2024-04-23 60 struct eventfd_ctx *trigger;
848e447e000c418 Nipun Gupta 2024-04-23 61 int irq_no, ret;
848e447e000c418 Nipun Gupta 2024-04-23 62
848e447e000c418 Nipun Gupta 2024-04-23 63 if (vector < 0 || vector >= vdev->msi_count)
848e447e000c418 Nipun Gupta 2024-04-23 64 return -EINVAL;
848e447e000c418 Nipun Gupta 2024-04-23 65
848e447e000c418 Nipun Gupta 2024-04-23 66 irq_no = vdev->cdx_irqs[vector].irq_no;
848e447e000c418 Nipun Gupta 2024-04-23 67
848e447e000c418 Nipun Gupta 2024-04-23 68 if (vdev->cdx_irqs[vector].trigger) {
848e447e000c418 Nipun Gupta 2024-04-23 69 free_irq(irq_no, vdev->cdx_irqs[vector].trigger);
848e447e000c418 Nipun Gupta 2024-04-23 70 kfree(vdev->cdx_irqs[vector].name);
848e447e000c418 Nipun Gupta 2024-04-23 71 eventfd_ctx_put(vdev->cdx_irqs[vector].trigger);
848e447e000c418 Nipun Gupta 2024-04-23 72 vdev->cdx_irqs[vector].trigger = NULL;
848e447e000c418 Nipun Gupta 2024-04-23 73 }
848e447e000c418 Nipun Gupta 2024-04-23 74
848e447e000c418 Nipun Gupta 2024-04-23 75 if (fd < 0)
848e447e000c418 Nipun Gupta 2024-04-23 76 return 0;
848e447e000c418 Nipun Gupta 2024-04-23 77
848e447e000c418 Nipun Gupta 2024-04-23 78 vdev->cdx_irqs[vector].name = kasprintf(GFP_KERNEL, "vfio-msi[%d](%s)",
848e447e000c418 Nipun Gupta 2024-04-23 79 vector, dev_name(vdev->vdev.dev));
848e447e000c418 Nipun Gupta 2024-04-23 80 if (!vdev->cdx_irqs[vector].name)
848e447e000c418 Nipun Gupta 2024-04-23 81 return -ENOMEM;
848e447e000c418 Nipun Gupta 2024-04-23 82
848e447e000c418 Nipun Gupta 2024-04-23 83 trigger = eventfd_ctx_fdget(fd);
848e447e000c418 Nipun Gupta 2024-04-23 84 if (IS_ERR(trigger)) {
848e447e000c418 Nipun Gupta 2024-04-23 85 kfree(vdev->cdx_irqs[vector].name);
848e447e000c418 Nipun Gupta 2024-04-23 86 return PTR_ERR(trigger);
848e447e000c418 Nipun Gupta 2024-04-23 87 }
848e447e000c418 Nipun Gupta 2024-04-23 88
848e447e000c418 Nipun Gupta 2024-04-23 89 ret = request_irq(irq_no, vfio_cdx_msihandler, 0,
848e447e000c418 Nipun Gupta 2024-04-23 90 vdev->cdx_irqs[vector].name, trigger);
848e447e000c418 Nipun Gupta 2024-04-23 91 if (ret) {
848e447e000c418 Nipun Gupta 2024-04-23 92 kfree(vdev->cdx_irqs[vector].name);
848e447e000c418 Nipun Gupta 2024-04-23 93 eventfd_ctx_put(trigger);
848e447e000c418 Nipun Gupta 2024-04-23 94 return ret;
848e447e000c418 Nipun Gupta 2024-04-23 95 }
848e447e000c418 Nipun Gupta 2024-04-23 96
848e447e000c418 Nipun Gupta 2024-04-23 97 vdev->cdx_irqs[vector].trigger = trigger;
848e447e000c418 Nipun Gupta 2024-04-23 98
848e447e000c418 Nipun Gupta 2024-04-23 99 return 0;
848e447e000c418 Nipun Gupta 2024-04-23 100 }
848e447e000c418 Nipun Gupta 2024-04-23 101
848e447e000c418 Nipun Gupta 2024-04-23 102 static int vfio_cdx_msi_set_block(struct vfio_cdx_device *vdev,
848e447e000c418 Nipun Gupta 2024-04-23 103 unsigned int start, unsigned int count,
848e447e000c418 Nipun Gupta 2024-04-23 104 int32_t *fds)
848e447e000c418 Nipun Gupta 2024-04-23 105 {
848e447e000c418 Nipun Gupta 2024-04-23 106 int i, j, ret = 0;
848e447e000c418 Nipun Gupta 2024-04-23 107
848e447e000c418 Nipun Gupta 2024-04-23 108 if (start >= vdev->msi_count || start + count > vdev->msi_count)
848e447e000c418 Nipun Gupta 2024-04-23 109 return -EINVAL;
848e447e000c418 Nipun Gupta 2024-04-23 110
848e447e000c418 Nipun Gupta 2024-04-23 111 for (i = 0, j = start; i < count && !ret; i++, j++) {
848e447e000c418 Nipun Gupta 2024-04-23 112 int fd = fds ? fds[i] : -1;
848e447e000c418 Nipun Gupta 2024-04-23 113
848e447e000c418 Nipun Gupta 2024-04-23 114 ret = vfio_cdx_msi_set_vector_signal(vdev, j, fd);
848e447e000c418 Nipun Gupta 2024-04-23 115 }
848e447e000c418 Nipun Gupta 2024-04-23 116
848e447e000c418 Nipun Gupta 2024-04-23 117 if (ret) {
848e447e000c418 Nipun Gupta 2024-04-23 118 for (--j; j >= (int)start; j--)
848e447e000c418 Nipun Gupta 2024-04-23 119 vfio_cdx_msi_set_vector_signal(vdev, j, -1);
848e447e000c418 Nipun Gupta 2024-04-23 120 }
848e447e000c418 Nipun Gupta 2024-04-23 121
848e447e000c418 Nipun Gupta 2024-04-23 122 return ret;
848e447e000c418 Nipun Gupta 2024-04-23 123 }
848e447e000c418 Nipun Gupta 2024-04-23 124
848e447e000c418 Nipun Gupta 2024-04-23 125 static void vfio_cdx_msi_disable(struct vfio_cdx_device *vdev)
848e447e000c418 Nipun Gupta 2024-04-23 126 {
848e447e000c418 Nipun Gupta 2024-04-23 127 struct cdx_device *cdx_dev = to_cdx_device(vdev->vdev.dev);
848e447e000c418 Nipun Gupta 2024-04-23 128 struct device *dev = vdev->vdev.dev;
848e447e000c418 Nipun Gupta 2024-04-23 129
848e447e000c418 Nipun Gupta 2024-04-23 130 vfio_cdx_msi_set_block(vdev, 0, vdev->msi_count, NULL);
848e447e000c418 Nipun Gupta 2024-04-23 131
848e447e000c418 Nipun Gupta 2024-04-23 132 if (!vdev->config_msi)
848e447e000c418 Nipun Gupta 2024-04-23 133 return;
848e447e000c418 Nipun Gupta 2024-04-23 134
848e447e000c418 Nipun Gupta 2024-04-23 @135 msi_domain_free_irqs_all(dev, MSI_DEFAULT_DOMAIN);
848e447e000c418 Nipun Gupta 2024-04-23 136 cdx_disable_msi(cdx_dev);
848e447e000c418 Nipun Gupta 2024-04-23 137 kfree(vdev->cdx_irqs);
848e447e000c418 Nipun Gupta 2024-04-23 138
848e447e000c418 Nipun Gupta 2024-04-23 139 vdev->cdx_irqs = NULL;
848e447e000c418 Nipun Gupta 2024-04-23 140 vdev->msi_count = 0;
848e447e000c418 Nipun Gupta 2024-04-23 141 vdev->config_msi = 0;
848e447e000c418 Nipun Gupta 2024-04-23 142 }
848e447e000c418 Nipun Gupta 2024-04-23 143
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-08-06 19:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 16:10 Arnd Bergmann
2025-08-06 12:37 ` Robin Murphy
2025-08-06 12:42 ` Krzysztof Kozlowski
2025-08-06 19:44 ` kernel test robot [this message]
2025-08-11 10:02 ` Agarwal, Nikhil
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=202508070308.opy5dIFX-lkp@intel.com \
--to=lkp@intel.com \
--cc=abhijit.gangurde@amd.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=chenqiuji666@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=llvm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=nathan@kernel.org \
--cc=nikhil.agarwal@amd.com \
--cc=nipun.gupta@amd.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=peterz@infradead.org \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®