[arm-platforms:kvm-arm64/vcpu-xarray 4/5] arch/x86/kvm/vmx/posted_intr.c:261:50: error: expected ')' before 'return'

kernel test robot lkp at intel.com
Sun Jan 3 12:11:54 EST 2021


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git kvm-arm64/vcpu-xarray
head:   2d43b1f9f180c47a7aaf2683eaec4f092e5f4cf2
commit: 136398dc1ad6a4b1711e43545bae09596c2fda3a [4/5] KVM: x86: Use kvm_get_vcpu() instead of open-coded access
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?id=136398dc1ad6a4b1711e43545bae09596c2fda3a
        git remote add arm-platforms https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
        git fetch --no-tags arm-platforms kvm-arm64/vcpu-xarray
        git checkout 136398dc1ad6a4b1711e43545bae09596c2fda3a
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All errors (new ones prefixed by >>):

   arch/x86/kvm/vmx/posted_intr.c: In function 'pi_update_irte':
>> arch/x86/kvm/vmx/posted_intr.c:261:50: error: expected ')' before 'return'
     261 |      !kvm_vcpu_apicv_active(kvm_get_vcpu(kvm, 0))
         |                                                  ^
         |                                                  )
     262 |   return 0;
         |   ~~~~~~                                          
   arch/x86/kvm/vmx/posted_intr.c:259:5: note: to match this '('
     259 |  if (!kvm_arch_has_assigned_device(kvm) ||
         |     ^
>> arch/x86/kvm/vmx/posted_intr.c:332:1: error: expected expression before '}' token
     332 | }
         | ^
   arch/x86/kvm/vmx/posted_intr.c:257:11: warning: unused variable 'ret' [-Wunused-variable]
     257 |  int idx, ret = 0;
         |           ^~~
   arch/x86/kvm/vmx/posted_intr.c:257:6: warning: unused variable 'idx' [-Wunused-variable]
     257 |  int idx, ret = 0;
         |      ^~~
   arch/x86/kvm/vmx/posted_intr.c:256:19: warning: unused variable 'vcpu_info' [-Wunused-variable]
     256 |  struct vcpu_data vcpu_info;
         |                   ^~~~~~~~~
   arch/x86/kvm/vmx/posted_intr.c:255:19: warning: unused variable 'vcpu' [-Wunused-variable]
     255 |  struct kvm_vcpu *vcpu;
         |                   ^~~~
   arch/x86/kvm/vmx/posted_intr.c:254:23: warning: unused variable 'irq' [-Wunused-variable]
     254 |  struct kvm_lapic_irq irq;
         |                       ^~~
   arch/x86/kvm/vmx/posted_intr.c:253:32: warning: unused variable 'irq_rt' [-Wunused-variable]
     253 |  struct kvm_irq_routing_table *irq_rt;
         |                                ^~~~~~
   arch/x86/kvm/vmx/posted_intr.c:252:39: warning: unused variable 'e' [-Wunused-variable]
     252 |  struct kvm_kernel_irq_routing_entry *e;
         |                                       ^
   arch/x86/kvm/vmx/posted_intr.c:332:1: error: control reaches end of non-void function [-Werror=return-type]
     332 | }
         | ^
   cc1: some warnings being treated as errors


vim +261 arch/x86/kvm/vmx/posted_intr.c

   238	
   239	
   240	/*
   241	 * pi_update_irte - set IRTE for Posted-Interrupts
   242	 *
   243	 * @kvm: kvm
   244	 * @host_irq: host irq of the interrupt
   245	 * @guest_irq: gsi of the interrupt
   246	 * @set: set or unset PI
   247	 * returns 0 on success, < 0 on failure
   248	 */
   249	int pi_update_irte(struct kvm *kvm, unsigned int host_irq, uint32_t guest_irq,
   250			   bool set)
   251	{
   252		struct kvm_kernel_irq_routing_entry *e;
   253		struct kvm_irq_routing_table *irq_rt;
   254		struct kvm_lapic_irq irq;
   255		struct kvm_vcpu *vcpu;
   256		struct vcpu_data vcpu_info;
   257		int idx, ret = 0;
   258	
   259		if (!kvm_arch_has_assigned_device(kvm) ||
   260		    !irq_remapping_cap(IRQ_POSTING_CAP) ||
 > 261		    !kvm_vcpu_apicv_active(kvm_get_vcpu(kvm, 0))
   262			return 0;
   263	
   264		idx = srcu_read_lock(&kvm->irq_srcu);
   265		irq_rt = srcu_dereference(kvm->irq_routing, &kvm->irq_srcu);
   266		if (guest_irq >= irq_rt->nr_rt_entries ||
   267		    hlist_empty(&irq_rt->map[guest_irq])) {
   268			pr_warn_once("no route for guest_irq %u/%u (broken user space?)\n",
   269				     guest_irq, irq_rt->nr_rt_entries);
   270			goto out;
   271		}
   272	
   273		hlist_for_each_entry(e, &irq_rt->map[guest_irq], link) {
   274			if (e->type != KVM_IRQ_ROUTING_MSI)
   275				continue;
   276			/*
   277			 * VT-d PI cannot support posting multicast/broadcast
   278			 * interrupts to a vCPU, we still use interrupt remapping
   279			 * for these kind of interrupts.
   280			 *
   281			 * For lowest-priority interrupts, we only support
   282			 * those with single CPU as the destination, e.g. user
   283			 * configures the interrupts via /proc/irq or uses
   284			 * irqbalance to make the interrupts single-CPU.
   285			 *
   286			 * We will support full lowest-priority interrupt later.
   287			 *
   288			 * In addition, we can only inject generic interrupts using
   289			 * the PI mechanism, refuse to route others through it.
   290			 */
   291	
   292			kvm_set_msi_irq(kvm, e, &irq);
   293			if (!kvm_intr_is_single_vcpu(kvm, &irq, &vcpu) ||
   294			    !kvm_irq_is_postable(&irq)) {
   295				/*
   296				 * Make sure the IRTE is in remapped mode if
   297				 * we don't handle it in posted mode.
   298				 */
   299				ret = irq_set_vcpu_affinity(host_irq, NULL);
   300				if (ret < 0) {
   301					printk(KERN_INFO
   302					   "failed to back to remapped mode, irq: %u\n",
   303					   host_irq);
   304					goto out;
   305				}
   306	
   307				continue;
   308			}
   309	
   310			vcpu_info.pi_desc_addr = __pa(&to_vmx(vcpu)->pi_desc);
   311			vcpu_info.vector = irq.vector;
   312	
   313			trace_kvm_pi_irte_update(host_irq, vcpu->vcpu_id, e->gsi,
   314					vcpu_info.vector, vcpu_info.pi_desc_addr, set);
   315	
   316			if (set)
   317				ret = irq_set_vcpu_affinity(host_irq, &vcpu_info);
   318			else
   319				ret = irq_set_vcpu_affinity(host_irq, NULL);
   320	
   321			if (ret < 0) {
   322				printk(KERN_INFO "%s: failed to update PI IRTE\n",
   323						__func__);
   324				goto out;
   325			}
   326		}
   327	
   328		ret = 0;
   329	out:
   330		srcu_read_unlock(&kvm->irq_srcu, idx);
   331		return ret;
 > 332	}

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 45918 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210104/7615b7ad/attachment-0001.gz>


More information about the linux-arm-kernel mailing list