Lines Matching refs:array
612 static struct kvm_cpuid_entry2 *do_host_cpuid(struct kvm_cpuid_array *array, in do_host_cpuid() argument
617 if (array->nent >= array->maxnent) in do_host_cpuid()
620 entry = &array->entries[array->nent++]; in do_host_cpuid()
649 static int __do_cpuid_func_emulated(struct kvm_cpuid_array *array, u32 func) in __do_cpuid_func_emulated() argument
653 if (array->nent >= array->maxnent) in __do_cpuid_func_emulated()
656 entry = &array->entries[array->nent]; in __do_cpuid_func_emulated()
664 ++array->nent; in __do_cpuid_func_emulated()
668 ++array->nent; in __do_cpuid_func_emulated()
675 ++array->nent; in __do_cpuid_func_emulated()
684 static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) in __do_cpuid_func() argument
694 entry = do_host_cpuid(array, function, 0); in __do_cpuid_func()
733 entry = do_host_cpuid(array, function, i); in __do_cpuid_func()
753 entry = do_host_cpuid(array, function, 1); in __do_cpuid_func()
809 entry = do_host_cpuid(array, function, i); in __do_cpuid_func()
822 entry = do_host_cpuid(array, function, 1); in __do_cpuid_func()
846 entry = do_host_cpuid(array, function, i); in __do_cpuid_func()
859 --array->nent; in __do_cpuid_func()
881 entry = do_host_cpuid(array, function, 1); in __do_cpuid_func()
905 if (!do_host_cpuid(array, function, i)) in __do_cpuid_func()
1037 static int do_cpuid_func(struct kvm_cpuid_array *array, u32 func, in do_cpuid_func() argument
1041 return __do_cpuid_func_emulated(array, func); in do_cpuid_func()
1043 return __do_cpuid_func(array, func); in do_cpuid_func()
1048 static int get_cpuid_func(struct kvm_cpuid_array *array, u32 func, in get_cpuid_func() argument
1058 r = do_cpuid_func(array, func, type); in get_cpuid_func()
1062 limit = array->entries[array->nent - 1].eax; in get_cpuid_func()
1064 r = do_cpuid_func(array, func, type); in get_cpuid_func()
1107 struct kvm_cpuid_array array = { in kvm_dev_ioctl_get_cpuid() local
1120 array.entries = vzalloc(array_size(sizeof(struct kvm_cpuid_entry2), in kvm_dev_ioctl_get_cpuid()
1122 if (!array.entries) in kvm_dev_ioctl_get_cpuid()
1125 array.maxnent = cpuid->nent; in kvm_dev_ioctl_get_cpuid()
1128 r = get_cpuid_func(&array, funcs[i], type); in kvm_dev_ioctl_get_cpuid()
1132 cpuid->nent = array.nent; in kvm_dev_ioctl_get_cpuid()
1134 if (copy_to_user(entries, array.entries, in kvm_dev_ioctl_get_cpuid()
1135 array.nent * sizeof(struct kvm_cpuid_entry2))) in kvm_dev_ioctl_get_cpuid()
1139 vfree(array.entries); in kvm_dev_ioctl_get_cpuid()