From: kernel test robot <lkp@intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [sean-jc:x86/unfudge_irq_bypass 76/108] arch/x86/kvm/irq.c:561:2: error: call to undeclared function 'trace_kvm_pi_irte_update'; ISO C99 and later do not support implicit function declarations
Date: Sat, 26 Apr 2025 06:27:12 +0800 [thread overview]
Message-ID: <202504260605.T6Rt9LPf-lkp@intel.com> (raw)
tree: https://github.com/sean-jc/linux x86/unfudge_irq_bypass
head: 720265d246a28570666f9b0e027983c4bb758136
commit: 1303b53ffcb5b4605471fab89174e0077d9e33d8 [76/108] KVM: x86: Move posted interrupt tracepoint to common code
config: i386-buildonly-randconfig-004-20250426 (https://download.01.org/0day-ci/archive/20250426/202504260605.T6Rt9LPf-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250426/202504260605.T6Rt9LPf-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/202504260605.T6Rt9LPf-lkp@intel.com/
All errors (new ones prefixed by >>):
arch/x86/kvm/irq.c:525:31: error: incomplete definition of type 'struct kvm_kernel_irqfd'
525 | unsigned int host_irq = irqfd->producer->irq;
| ~~~~~^
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:526:25: error: incomplete definition of type 'struct kvm_kernel_irqfd'
526 | struct kvm *kvm = irqfd->kvm;
| ~~~~~^
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:556:47: error: incomplete definition of type 'struct kvm_kernel_irqfd'
556 | r = kvm_x86_call(pi_update_irte)(irqfd, irqfd->kvm, host_irq, irqfd->gsi,
| ~~~~~^
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:556:69: error: incomplete definition of type 'struct kvm_kernel_irqfd'
556 | r = kvm_x86_call(pi_update_irte)(irqfd, irqfd->kvm, host_irq, irqfd->gsi,
| ~~~~~^
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
>> arch/x86/kvm/irq.c:561:2: error: call to undeclared function 'trace_kvm_pi_irte_update'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
561 | trace_kvm_pi_irte_update(host_irq, vcpu, irqfd->gsi, irq.vector, !!vcpu);
| ^
arch/x86/kvm/irq.c:561:48: error: incomplete definition of type 'struct kvm_kernel_irqfd'
561 | trace_kvm_pi_irte_update(host_irq, vcpu, irqfd->gsi, irq.vector, !!vcpu);
| ~~~~~^
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:569:3: error: incomplete definition of type 'struct kvm_kernel_irqfd'
569 | container_of(cons, struct kvm_kernel_irqfd, consumer);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/container_of.h:20:47: note: expanded from macro 'container_of'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
21 | __same_type(*(ptr), void), \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 | "pointer type mismatch in container_of()"); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:498:74: note: expanded from macro '__same_type'
498 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:569:3: error: offsetof of incomplete type 'struct kvm_kernel_irqfd'
569 | container_of(cons, struct kvm_kernel_irqfd, consumer);
| ^ ~~~~~~
include/linux/container_of.h:23:21: note: expanded from macro 'container_of'
23 | ((type *)(__mptr - offsetof(type, member))); })
| ^ ~~~~
include/linux/stddef.h:16:32: note: expanded from macro 'offsetof'
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^ ~~~~
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:570:25: error: incomplete definition of type 'struct kvm_kernel_irqfd'
570 | struct kvm *kvm = irqfd->kvm;
| ~~~~~^
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:573:33: error: incomplete definition of type 'struct kvm_kernel_irqfd'
573 | kvm_arch_start_assignment(irqfd->kvm);
| ~~~~~^
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:576:7: error: incomplete definition of type 'struct kvm_kernel_irqfd'
576 | irqfd->producer = prod;
| ~~~~~^
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:578:11: error: incomplete definition of type 'struct kvm_kernel_irqfd'
578 | if (irqfd->irq_entry.type == KVM_IRQ_ROUTING_MSI) {
| ~~~~~^
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:579:41: error: incomplete definition of type 'struct kvm_kernel_irqfd'
579 | ret = kvm_pi_update_irte(irqfd, &irqfd->irq_entry);
| ~~~~~^
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:581:33: error: incomplete definition of type 'struct kvm_kernel_irqfd'
581 | kvm_arch_end_assignment(irqfd->kvm);
| ~~~~~^
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
arch/x86/kvm/irq.c:592:3: error: incomplete definition of type 'struct kvm_kernel_irqfd'
592 | container_of(cons, struct kvm_kernel_irqfd, consumer);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/container_of.h:20:47: note: expanded from macro 'container_of'
20 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
21 | __same_type(*(ptr), void), \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 | "pointer type mismatch in container_of()"); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:498:74: note: expanded from macro '__same_type'
498 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
arch/x86/include/asm/kvm_host.h:299:8: note: forward declaration of 'struct kvm_kernel_irqfd'
299 | struct kvm_kernel_irqfd;
| ^
vim +/trace_kvm_pi_irte_update +561 arch/x86/kvm/irq.c
521
522 static int kvm_pi_update_irte(struct kvm_kernel_irqfd *irqfd,
523 struct kvm_kernel_irq_routing_entry *entry)
524 {
525 unsigned int host_irq = irqfd->producer->irq;
526 struct kvm *kvm = irqfd->kvm;
527 struct kvm_vcpu *vcpu = NULL;
528 struct kvm_lapic_irq irq;
529 int r;
530
531 if (!irqchip_in_kernel(kvm) ||
532 !kvm_arch_has_irq_bypass() ||
533 !kvm_arch_has_assigned_device(kvm))
534 return 0;
535
536 if (entry && entry->type == KVM_IRQ_ROUTING_MSI) {
537 kvm_set_msi_irq(kvm, entry, &irq);
538
539 /*
540 * Force remapped mode if hardware doesn't support posting the
541 * virtual interrupt to a vCPU. Only IRQs are postable (NMIs,
542 * SMIs, etc. are not), and neither AMD nor Intel IOMMUs support
543 * posting multicast/broadcast IRQs. If the interrupt can't be
544 * posted, the device MSI needs to be routed to the host so that
545 * the guest's desired interrupt can be synthesized by KVM.
546 *
547 * This means that KVM can only post lowest-priority interrupts
548 * if they have a single CPU as the destination, e.g. only if
549 * the guest has affined the interrupt to a single vCPU.
550 */
551 if (!kvm_intr_is_single_vcpu(kvm, &irq, &vcpu) ||
552 !kvm_irq_is_postable(&irq))
553 vcpu = NULL;
554 }
555
> 556 r = kvm_x86_call(pi_update_irte)(irqfd, irqfd->kvm, host_irq, irqfd->gsi,
557 vcpu, irq.vector);
558 if (r)
559 return r;
560
> 561 trace_kvm_pi_irte_update(host_irq, vcpu, irqfd->gsi, irq.vector, !!vcpu);
562 return 0;
563 }
564
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-04-25 22:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202504260605.T6Rt9LPf-lkp@intel.com \
--to=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=seanjc@google.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