[kvm:queue 48/53] arch/x86/kvm/hyperv.c:1252:21: sparse: constant 0xffff00000000 is so big it is long

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
head:   7ece9aac9c5c3732258067d7c2c0ee4cc4904f81
commit: c818f0629897b9638e6f4501ad83fca05bb7248a [48/53] kvm: x86: hyperv: guest->host event signaling via eventfd
reproduce:
        # apt-get install sparse
        git checkout c818f0629897b9638e6f4501ad83fca05bb7248a
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> arch/x86/kvm/hyperv.c:1252:21: sparse: constant 0xffff00000000 is so big it is long

vim +1252 arch/x86/kvm/hyperv.c

  1229	
  1230	static u16 kvm_hvcall_signal_event(struct kvm_vcpu *vcpu, bool fast, u64 param)
  1231	{
  1232		struct eventfd_ctx *eventfd;
  1233	
  1234		if (unlikely(!fast)) {
  1235			int ret;
  1236			gpa_t gpa = param;
  1237	
  1238			if ((gpa & (__alignof__(param) - 1)) ||
  1239			    offset_in_page(gpa) + sizeof(param) > PAGE_SIZE)
  1240				return HV_STATUS_INVALID_ALIGNMENT;
  1241	
  1242			ret = kvm_vcpu_read_guest(vcpu, gpa, &param, sizeof(param));
  1243			if (ret < 0)
  1244				return HV_STATUS_INVALID_ALIGNMENT;
  1245		}
  1246	
  1247		/*
  1248		 * Per spec, bits 32-47 contain the extra "flag number".  However, we
  1249		 * have no use for it, and in all known usecases it is zero, so just
  1250		 * report lookup failure if it isn't.
  1251		 */
> 1252		if (param & 0xffff00000000)
  1253			return HV_STATUS_INVALID_PORT_ID;
  1254		/* remaining bits are reserved-zero */
  1255		if (param & ~KVM_HYPERV_CONN_ID_MASK)
  1256			return HV_STATUS_INVALID_HYPERCALL_INPUT;
  1257	
  1258		/* conn_to_evt is protected by vcpu->kvm->srcu */
  1259		eventfd = idr_find(&vcpu->kvm->arch.hyperv.conn_to_evt, param);
  1260		if (!eventfd)
  1261			return HV_STATUS_INVALID_PORT_ID;
  1262	
  1263		eventfd_signal(eventfd, 1);
  1264		return HV_STATUS_SUCCESS;
  1265	}
  1266	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux