From: kernel test robot <lkp@intel.com>
To: Sairaj Kodilkar <sarunkod@amd.com>
Cc: oe-kbuild-all@lists.linux.dev, 0day robot <lkp@intel.com>
Subject: arch/x86/kvm/svm/avic.c:984:50: error: implicit declaration of function 'kvm_cpu_get_apicid'; did you mean 'kvm_cpu_get_extint'?
Date: Mon, 10 Aug 2026 13:53:58 +0200 [thread overview]
Message-ID: <202608101324.p3oCfgNo-lkp@intel.com> (raw)
tree: https://github.com/intel-lab-lkp/linux/commits/Sairaj-Kodilkar/iommu-amd-kvm-svm-Improve-API-between-SVM-and-AMD-IOMMU/20260806-223438
head: 51c8e1a2e7e7a48f09a27b87014d46f6731728a3
commit: 6cb2b8d8101192002c42cc0fb5b16b5568d583e2 kvm/svm: Update the per-CPU wakeup-list during vCPU load and unload
date: 4 days ago
config: x86_64-rhel-9.4-bpf (https://download.01.org/0day-ci/archive/20260810/202608101324.p3oCfgNo-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260810/202608101324.p3oCfgNo-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/202608101324.p3oCfgNo-lkp@intel.com/
All errors (new ones prefixed by >>):
arch/x86/kvm/svm/avic.c: In function 'avic_pi_update_irte':
>> arch/x86/kvm/svm/avic.c:984:50: error: implicit declaration of function 'kvm_cpu_get_apicid'; did you mean 'kvm_cpu_get_extint'? [-Wimplicit-function-declaration]
984 | pi_data.apicid = kvm_cpu_get_apicid(svm->gappi_cpu);
| ^~~~~~~~~~~~~~~~~~
| kvm_cpu_get_extint
vim +984 arch/x86/kvm/svm/avic.c
931
932 int avic_pi_update_irte(struct kvm_kernel_irqfd *irqfd, struct kvm *kvm,
933 unsigned int host_irq, uint32_t guest_irq,
934 struct kvm_vcpu *vcpu, u32 vector)
935 {
936 /*
937 * If the IRQ was affined to a different vCPU, remove the IRTE metadata
938 * from the *previous* vCPU's list.
939 */
940 svm_ir_list_del(irqfd);
941
942 if (vcpu) {
943 /*
944 * Try to enable guest_mode in IRTE, unless AVIC is inhibited,
945 * in which case configure the IRTE for legacy mode, but track
946 * the IRTE metadata so that it can be converted to guest mode
947 * if AVIC is enabled/uninhibited in the future.
948 */
949 struct amd_iommu_pi_data pi_data = {
950 .ga_tag = AVIC_GATAG(to_kvm_svm(kvm)->avic_vm_id,
951 vcpu->vcpu_idx),
952 .is_guest_mode = kvm_vcpu_apicv_active(vcpu),
953 .vapic_addr = avic_get_backing_page_address(to_svm(vcpu)),
954 .vector = vector,
955 };
956 struct vcpu_svm *svm = to_svm(vcpu);
957 u64 entry;
958 int ret;
959 int posted_intr;
960 bool is_vcpu_waiting = false;
961
962 /*
963 * Prevent the vCPU from being scheduled out or migrated until
964 * the IRTE is updated and its metadata has been added to the
965 * list of IRQs being posted to the vCPU, to ensure the IRTE
966 * isn't programmed with stale pCPU/IsRunning information.
967 */
968 guard(raw_spinlock_irqsave)(&svm->ir_list_lock);
969
970 /*
971 * Update the target pCPU for IOMMU doorbells if the vCPU is
972 * running. If the vCPU is NOT running, i.e. is blocking or
973 * scheduled out, KVM will update the pCPU info when the vCPU
974 * is awakened and/or scheduled in. See also avic_vcpu_load().
975 */
976 entry = svm->avic_physical_id_entry;
977 if (entry & AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK) {
978 pi_data.apicid = entry & AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK;
979 pi_data.flags = AMD_IOMMU_FLAG_VCPU_RUNNING;
980 } else {
981 posted_intr = !!(entry & AVIC_PHYSICAL_ID_ENTRY_GA_LOG_INTR);
982 pi_data.flags = posted_intr << AMD_IOMMU_FLAG_POSTED_INTR_SHIFT;
983 if (amd_iommu_gappi) {
> 984 pi_data.apicid = kvm_cpu_get_apicid(svm->gappi_cpu);
985 if (list_empty(&svm->ir_list)) {
986 avic_add_vcpu_to_gappi_wakeup_list(svm, svm->gappi_cpu);
987 is_vcpu_waiting = true;
988 }
989 }
990 }
991
992 ret = irq_set_vcpu_affinity(host_irq, &pi_data);
993 if (ret)
994 goto gappi_err_out;
995
996 /*
997 * Revert to legacy mode if the IOMMU didn't provide metadata
998 * for the IRTE, which KVM needs to keep the IRTE up-to-date,
999 * e.g. if the vCPU is migrated or AVIC is disabled.
1000 */
1001 if (WARN_ON_ONCE(!pi_data.ir_data)) {
1002 irq_set_vcpu_affinity(host_irq, NULL);
1003 ret = -EIO;
1004 goto gappi_err_out;
1005 }
1006
1007 irqfd->irq_bypass_data = pi_data.ir_data;
1008 list_add(&irqfd->vcpu_list, &svm->ir_list);
1009 return 0;
1010 gappi_err_out:
1011 if (is_vcpu_waiting)
1012 avic_remove_vcpu_from_gappi_wakeup_list(svm, svm->gappi_cpu);
1013 return ret;
1014 }
1015 return irq_set_vcpu_affinity(host_irq, NULL);
1016 }
1017
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-08-10 11:54 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=202608101324.p3oCfgNo-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=sarunkod@amd.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.