[kvm:queue 12/69] arch/x86/kvm/x86.c:2950:61: sparse: Using plain integer as NULL pointer

[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:   8c154ff6ee99d2d467c3c964ef6a478ca7614155
commit: adfc38573cf7a7058d4cc1163b239c087accfa3d [12/69] kvm: nVMX: Introduce KVM_CAP_NESTED_STATE
reproduce:
        # apt-get install sparse
        git checkout adfc38573cf7a7058d4cc1163b239c087accfa3d
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   arch/x86/kvm/x86.c:6982:34: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:6982:34: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:2208:38: sparse: incorrect type in argument 1 (different address spaces) @@    expected void const [noderef] <asn:1>*<noident> @@    got d const [noderef] <asn:1>*<noident> @@
   arch/x86/kvm/x86.c:2208:38:    expected void const [noderef] <asn:1>*<noident>
   arch/x86/kvm/x86.c:2208:38:    got unsigned char [usertype] *
>> arch/x86/kvm/x86.c:2950:61: sparse: Using plain integer as NULL pointer
   arch/x86/kvm/x86.c:4703:21: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:4723:21: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:4806:35: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:4806:35: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:4898:36: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:4898:36: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:5073:9: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:5189:31: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:7730:15: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:7758:17: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:7759:25: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:8632:27: sparse: expression using sizeof(void)
   arch/x86/kvm/x86.c:8918:16: sparse: incompatible types in comparison expression (different address spaces)
   include/linux/mm.h:572:13: sparse: undefined identifier '__builtin_mul_overflow'
   include/linux/mm.h:572:13: sparse: not a function <noident>
   arch/x86/include/asm/paravirt.h:788:9: sparse: context imbalance in 'vcpu_enter_guest' - unexpected unlock
   include/linux/mm.h:572:13: sparse: call with no type!

vim +2950 arch/x86/kvm/x86.c

  2845	
  2846	int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
  2847	{
  2848		int r = 0;
  2849	
  2850		switch (ext) {
  2851		case KVM_CAP_IRQCHIP:
  2852		case KVM_CAP_HLT:
  2853		case KVM_CAP_MMU_SHADOW_CACHE_CONTROL:
  2854		case KVM_CAP_SET_TSS_ADDR:
  2855		case KVM_CAP_EXT_CPUID:
  2856		case KVM_CAP_EXT_EMUL_CPUID:
  2857		case KVM_CAP_CLOCKSOURCE:
  2858		case KVM_CAP_PIT:
  2859		case KVM_CAP_NOP_IO_DELAY:
  2860		case KVM_CAP_MP_STATE:
  2861		case KVM_CAP_SYNC_MMU:
  2862		case KVM_CAP_USER_NMI:
  2863		case KVM_CAP_REINJECT_CONTROL:
  2864		case KVM_CAP_IRQ_INJECT_STATUS:
  2865		case KVM_CAP_IOEVENTFD:
  2866		case KVM_CAP_IOEVENTFD_NO_LENGTH:
  2867		case KVM_CAP_PIT2:
  2868		case KVM_CAP_PIT_STATE2:
  2869		case KVM_CAP_SET_IDENTITY_MAP_ADDR:
  2870		case KVM_CAP_XEN_HVM:
  2871		case KVM_CAP_VCPU_EVENTS:
  2872		case KVM_CAP_HYPERV:
  2873		case KVM_CAP_HYPERV_VAPIC:
  2874		case KVM_CAP_HYPERV_SPIN:
  2875		case KVM_CAP_HYPERV_SYNIC:
  2876		case KVM_CAP_HYPERV_SYNIC2:
  2877		case KVM_CAP_HYPERV_VP_INDEX:
  2878		case KVM_CAP_HYPERV_EVENTFD:
  2879		case KVM_CAP_HYPERV_TLBFLUSH:
  2880		case KVM_CAP_PCI_SEGMENT:
  2881		case KVM_CAP_DEBUGREGS:
  2882		case KVM_CAP_X86_ROBUST_SINGLESTEP:
  2883		case KVM_CAP_XSAVE:
  2884		case KVM_CAP_ASYNC_PF:
  2885		case KVM_CAP_GET_TSC_KHZ:
  2886		case KVM_CAP_KVMCLOCK_CTRL:
  2887		case KVM_CAP_READONLY_MEM:
  2888		case KVM_CAP_HYPERV_TIME:
  2889		case KVM_CAP_IOAPIC_POLARITY_IGNORED:
  2890		case KVM_CAP_TSC_DEADLINE_TIMER:
  2891		case KVM_CAP_ENABLE_CAP_VM:
  2892		case KVM_CAP_DISABLE_QUIRKS:
  2893		case KVM_CAP_SET_BOOT_CPU_ID:
  2894	 	case KVM_CAP_SPLIT_IRQCHIP:
  2895		case KVM_CAP_IMMEDIATE_EXIT:
  2896		case KVM_CAP_GET_MSR_FEATURES:
  2897			r = 1;
  2898			break;
  2899		case KVM_CAP_SYNC_REGS:
  2900			r = KVM_SYNC_X86_VALID_FIELDS;
  2901			break;
  2902		case KVM_CAP_ADJUST_CLOCK:
  2903			r = KVM_CLOCK_TSC_STABLE;
  2904			break;
  2905		case KVM_CAP_X86_DISABLE_EXITS:
  2906			r |=  KVM_X86_DISABLE_EXITS_HLT | KVM_X86_DISABLE_EXITS_PAUSE;
  2907			if(kvm_can_mwait_in_guest())
  2908				r |= KVM_X86_DISABLE_EXITS_MWAIT;
  2909			break;
  2910		case KVM_CAP_X86_SMM:
  2911			/* SMBASE is usually relocated above 1M on modern chipsets,
  2912			 * and SMM handlers might indeed rely on 4G segment limits,
  2913			 * so do not report SMM to be available if real mode is
  2914			 * emulated via vm86 mode.  Still, do not go to great lengths
  2915			 * to avoid userspace's usage of the feature, because it is a
  2916			 * fringe case that is not enabled except via specific settings
  2917			 * of the module parameters.
  2918			 */
  2919			r = kvm_x86_ops->has_emulated_msr(MSR_IA32_SMBASE);
  2920			break;
  2921		case KVM_CAP_VAPIC:
  2922			r = !kvm_x86_ops->cpu_has_accelerated_tpr();
  2923			break;
  2924		case KVM_CAP_NR_VCPUS:
  2925			r = KVM_SOFT_MAX_VCPUS;
  2926			break;
  2927		case KVM_CAP_MAX_VCPUS:
  2928			r = KVM_MAX_VCPUS;
  2929			break;
  2930		case KVM_CAP_NR_MEMSLOTS:
  2931			r = KVM_USER_MEM_SLOTS;
  2932			break;
  2933		case KVM_CAP_PV_MMU:	/* obsolete */
  2934			r = 0;
  2935			break;
  2936		case KVM_CAP_MCE:
  2937			r = KVM_MAX_MCE_BANKS;
  2938			break;
  2939		case KVM_CAP_XCRS:
  2940			r = boot_cpu_has(X86_FEATURE_XSAVE);
  2941			break;
  2942		case KVM_CAP_TSC_CONTROL:
  2943			r = kvm_has_tsc_control;
  2944			break;
  2945		case KVM_CAP_X2APIC_API:
  2946			r = KVM_X2APIC_API_VALID_FLAGS;
  2947			break;
  2948		case KVM_CAP_NESTED_STATE:
  2949			r = kvm_x86_ops->get_nested_state ?
> 2950				kvm_x86_ops->get_nested_state(NULL, 0, 0) : 0;
  2951			break;
  2952		default:
  2953			break;
  2954		}
  2955		return r;
  2956	

---
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