Home
last modified time | relevance | path

Searched refs:nr_vcpus (Results 1 – 25 of 30) sorted by relevance

12

/linux/tools/testing/selftests/kvm/
H A Daccess_tracking_perf_test.c76 int nr_vcpus; member
262 static void run_iteration(struct kvm_vm *vm, int nr_vcpus, const char *description) in run_iteration() argument
274 for (i = 0; i < nr_vcpus; i++) in run_iteration()
282 static void access_memory(struct kvm_vm *vm, int nr_vcpus, in access_memory() argument
287 run_iteration(vm, nr_vcpus, description); in access_memory()
290 static void mark_memory_idle(struct kvm_vm *vm, int nr_vcpus) in mark_memory_idle() argument
300 run_iteration(vm, nr_vcpus, "Mark memory idle"); in mark_memory_idle()
307 int nr_vcpus = params->nr_vcpus; in run_test() local
309 vm = memstress_create_vm(mode, nr_vcpus, params->vcpu_memory_bytes, 1, in run_test()
312 memstress_start_vcpu_threads(nr_vcpus, vcpu_thread_main); in run_test()
[all …]
H A Dmax_guest_memory_test.c36 static int nr_vcpus; variable
95 threads = malloc(nr_vcpus * sizeof(*threads)); in spawn_workers()
98 info = malloc(nr_vcpus * sizeof(*info)); in spawn_workers()
101 nr_bytes = ((end_gpa - start_gpa) / nr_vcpus) & in spawn_workers()
103 TEST_ASSERT(nr_bytes, "C'mon, no way you have %d CPUs", nr_vcpus); in spawn_workers()
105 for (i = 0, gpa = start_gpa; i < nr_vcpus; i++, gpa += nr_bytes) { in spawn_workers()
134 atomic_set(&rendezvous, -nr_vcpus - 1); in rendezvous_with_vcpus()
136 atomic_set(&rendezvous, nr_vcpus + 1); in rendezvous_with_vcpus()
148 nr_vcpus = CPU_COUNT(&possible_mask) * 3/4; in calc_default_nr_vcpus()
149 TEST_ASSERT(nr_vcpus > 0, "Uh, no CPUs?"); in calc_default_nr_vcpus()
[all …]
H A Ddirty_log_perf_test.c28 static void arch_setup_vm(struct kvm_vm *vm, unsigned int nr_vcpus) in arch_setup_vm() argument
34 gic_fd = vgic_v3_setup(vm, nr_vcpus, 64); in arch_setup_vm()
45 static void arch_setup_vm(struct kvm_vm *vm, unsigned int nr_vcpus) in arch_setup_vm() argument
58 static int nr_vcpus = 1; variable
152 vm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, in run_test()
158 guest_num_pages = (nr_vcpus * guest_percpu_mem_size) >> vm->page_shift; in run_test()
169 arch_setup_vm(vm, nr_vcpus); in run_test()
176 for (i = 0; i < nr_vcpus; i++) in run_test()
188 memstress_start_vcpu_threads(nr_vcpus, vcpu_worker); in run_test()
192 for (i = 0; i < nr_vcpus; i++) { in run_test()
[all …]
H A Ddemand_paging_test.c26 static int nr_vcpus = 1; variable
164 vm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1, in run_test()
175 num_uffds = p->single_uffd ? 1 : nr_vcpus; in run_test()
184 num_uffds = p->single_uffd ? 1 : nr_vcpus; in run_test()
185 uffd_region_size = nr_vcpus * guest_percpu_mem_size / num_uffds; in run_test()
212 memstress_start_vcpu_threads(nr_vcpus, vcpu_worker); in run_test()
215 memstress_join_vcpu_threads(nr_vcpus); in run_test()
233 vcpu_paging_rate * nr_vcpus); in run_test()
310 nr_vcpus = atoi_positive("Number of vCPUs", optarg); in main()
311 TEST_ASSERT(nr_vcpus <= max_vcpus, in main()
[all …]
H A Darch_timer.c32 .nr_vcpus = NR_VCPUS_DEF,
128 for (n_done = 0, i = 0; i < test_args.nr_vcpus; i++) { in test_vcpu_migration()
140 } while (test_args.nr_vcpus != n_done); in test_vcpu_migration()
152 vcpu_done_map = bitmap_zalloc(test_args.nr_vcpus); in test_run()
155 for (i = 0; i < (unsigned long)test_args.nr_vcpus; i++) { in test_run()
171 for (i = 0; i < test_args.nr_vcpus; i++) in test_run()
206 test_args.nr_vcpus = atoi_positive("Number of vCPUs", optarg); in parse_args()
207 if (test_args.nr_vcpus > KVM_MAX_VCPUS) { in parse_args()
H A Dkvm_page_table_test.c66 static uint32_t nr_vcpus = 1; variable
255 vm = __vm_create_with_vcpus(VM_SHAPE(mode), nr_vcpus, guest_num_pages, in pre_init_before_test()
311 pr_info("Number of testing vCPUs: %d\n", nr_vcpus); in pre_init_before_test()
322 for (vcpus = 0; vcpus < nr_vcpus; vcpus++) { in vcpus_complete_new_stage()
329 for (vcpus = 0; vcpus < nr_vcpus; vcpus++) { in vcpus_complete_new_stage()
352 vcpu_threads = malloc(nr_vcpus * sizeof(*vcpu_threads)); in run_test()
358 for (i = 0; i < nr_vcpus; i++) in run_test()
402 for (i = 0; i < nr_vcpus; i++) { in run_test()
407 for (i = 0; i < nr_vcpus; i++) in run_test()
460 nr_vcpus = atoi_positive("Number of vCPUs", optarg); in main()
[all …]
H A Dmemslot_modification_stress_test.c31 static int nr_vcpus = 1; variable
90 vm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1, in run_test()
103 memstress_start_vcpu_threads(nr_vcpus, vcpu_worker); in run_test()
109 memstress_join_vcpu_threads(nr_vcpus); in run_test()
161 nr_vcpus = atoi_positive("Number of vCPUs", optarg); in main()
162 TEST_ASSERT(nr_vcpus <= max_vcpus, in main()
/linux/tools/testing/selftests/kvm/lib/
H A Dmemstress.c88 void memstress_setup_vcpus(struct kvm_vm *vm, int nr_vcpus, in memstress_setup_vcpus() argument
97 for (i = 0; i < nr_vcpus; i++) { in memstress_setup_vcpus()
111 vcpu_args->pages = (nr_vcpus * vcpu_memory_bytes) / in memstress_setup_vcpus()
124 struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus, in memstress_create_vm() argument
148 (nr_vcpus * vcpu_memory_bytes) / args->guest_page_size); in memstress_create_vm()
163 slot0_pages += memstress_nested_pages(nr_vcpus); in memstress_create_vm()
170 vm = __vm_create_with_vcpus(VM_SHAPE(mode), nr_vcpus, in memstress_create_vm()
195 guest_num_pages, region_end_gfn - 1, nr_vcpus, vcpu_memory_bytes); in memstress_create_vm()
220 memstress_setup_vcpus(vm, nr_vcpus, vcpus, vcpu_memory_bytes, in memstress_create_vm()
225 memstress_setup_nested(vm, nr_vcpus, vcpus); in memstress_create_vm()
[all …]
/linux/arch/arm64/kvm/hyp/nvhe/
H A Dpkvm.c311 if (!hyp_vm || hyp_vm->nr_vcpus <= vcpu_idx) in pkvm_load_hyp_vcpu()
396 unsigned int nr_vcpus) in unpin_host_vcpus() argument
400 for (i = 0; i < nr_vcpus; i++) in unpin_host_vcpus()
405 unsigned int nr_vcpus) in init_pkvm_hyp_vm() argument
408 hyp_vm->kvm.created_vcpus = nr_vcpus; in init_pkvm_hyp_vm()
517 static size_t pkvm_get_hyp_vm_size(unsigned int nr_vcpus) in pkvm_get_hyp_vm_size() argument
520 size_mul(sizeof(struct pkvm_hyp_vcpu *), nr_vcpus)); in pkvm_get_hyp_vm_size()
592 unsigned int nr_vcpus; in __pkvm_init_vm() local
600 nr_vcpus = READ_ONCE(host_kvm->created_vcpus); in __pkvm_init_vm()
601 if (nr_vcpus < 1) { in __pkvm_init_vm()
[all …]
/linux/tools/testing/selftests/kvm/lib/aarch64/
H A Dvgic.c33 int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs) in vgic_v3_setup() argument
40 TEST_ASSERT(nr_vcpus, "Number of vCPUs cannot be empty"); in vgic_v3_setup()
48 TEST_ASSERT(nr_vcpus == nr_vcpus_created, in vgic_v3_setup()
50 nr_vcpus, nr_vcpus_created); in vgic_v3_setup()
69 attr = REDIST_REGION_ATTR_ADDR(nr_vcpus, GICR_BASE_GPA, 0, 0); in vgic_v3_setup()
73 KVM_VGIC_V3_REDIST_SIZE * nr_vcpus); in vgic_v3_setup()
/linux/tools/testing/selftests/kvm/aarch64/
H A Darch_timer.c148 gic_init(GIC_V3, test_args.nr_vcpus); in guest_code()
185 int nr_vcpus = test_args.nr_vcpus; in test_vm_create() local
187 vm = vm_create_with_vcpus(nr_vcpus, guest_code, vcpus); in test_vm_create()
203 for (i = 0; i < nr_vcpus; i++) in test_vm_create()
207 gic_fd = vgic_v3_setup(vm, nr_vcpus, 64); in test_vm_create()
H A Dvgic_lpi_stress.c301 u32 nr_vcpus = test_data.nr_cpus; in run_test() local
303 pthread_t *vcpu_threads = malloc(nr_vcpus * sizeof(pthread_t)); in run_test()
309 pthread_barrier_init(&test_setup_barrier, NULL, nr_vcpus + nr_devices + 1); in run_test()
311 for (i = 0; i < nr_vcpus; i++) in run_test()
327 for (i = 0; i < nr_vcpus; i++) in run_test()
H A Dvgic_init.c74 uint32_t nr_vcpus, in vm_gic_create_with_vcpus() argument
80 v.vm = vm_create_with_vcpus(nr_vcpus, guest_code, vcpus); in vm_gic_create_with_vcpus()
519 static struct vm_gic vm_gic_v3_create_with_vcpuids(int nr_vcpus, in vm_gic_v3_create_with_vcpuids() argument
525 v.vm = vm_create(nr_vcpus); in vm_gic_v3_create_with_vcpuids()
526 for (i = 0; i < nr_vcpus; i++) in vm_gic_v3_create_with_vcpuids()
/linux/tools/testing/selftests/kvm/lib/x86_64/
H A Dmemstress.c52 uint64_t memstress_nested_pages(int nr_vcpus) in memstress_nested_pages() argument
59 return 513 + 10 * nr_vcpus; in memstress_nested_pages()
80 void memstress_setup_nested(struct kvm_vm *vm, int nr_vcpus, struct kvm_vcpu *vcpus[]) in memstress_setup_nested() argument
90 for (vcpu_id = 0; vcpu_id < nr_vcpus; vcpu_id++) { in memstress_setup_nested()
/linux/tools/testing/selftests/kvm/riscv/
H A Darch_timer.c83 int nr_vcpus = test_args.nr_vcpus; in test_vm_create() local
85 vm = vm_create_with_vcpus(nr_vcpus, guest_code, vcpus); in test_vm_create()
92 for (int i = 0; i < nr_vcpus; i++) in test_vm_create()
/linux/tools/testing/selftests/kvm/include/
H A Dmemstress.h58 struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus,
71 uint64_t memstress_nested_pages(int nr_vcpus);
72 void memstress_setup_nested(struct kvm_vm *vm, int nr_vcpus, struct kvm_vcpu *vcpus[]);
H A Dtimer_test.h21 uint32_t nr_vcpus; member
H A Dkvm_util.h915 struct kvm_vm *__vm_create_with_vcpus(struct vm_shape shape, uint32_t nr_vcpus,
919 static inline struct kvm_vm *vm_create_with_vcpus(uint32_t nr_vcpus, in vm_create_with_vcpus() argument
923 return __vm_create_with_vcpus(VM_SHAPE_DEFAULT, nr_vcpus, 0, in vm_create_with_vcpus()
963 int nr_vcpus);
/linux/tools/testing/selftests/kvm/x86_64/
H A Dprivate_mem_conversions_test.c369 static void test_mem_conversions(enum vm_mem_backing_src_type src_type, uint32_t nr_vcpus, in test_mem_conversions() argument
378 const size_t memfd_size = per_cpu_size * nr_vcpus; in test_mem_conversions()
393 vm = __vm_create_with_vcpus(shape, nr_vcpus, 0, guest_code, vcpus); in test_mem_conversions()
404 for (i = 0; i < nr_vcpus; i++) { in test_mem_conversions()
420 for (i = 0; i < nr_vcpus; i++) in test_mem_conversions()
457 uint32_t nr_vcpus = 1; in main() local
468 nr_vcpus = atoi_positive("nr_vcpus", optarg); in main()
480 test_mem_conversions(src_type, nr_vcpus, nr_memslots); in main()
H A Dset_boot_cpu_id.c89 static struct kvm_vm *create_vm(uint32_t nr_vcpus, uint32_t bsp_vcpu_id, in create_vm() argument
95 vm = vm_create(nr_vcpus); in create_vm()
101 for (i = 0; i < nr_vcpus; i++) in create_vm()
/linux/arch/riscv/kvm/
H A Daia_device.c330 int nr_vcpus, r = -ENXIO; in aia_set_attr() local
349 nr_vcpus = atomic_read(&dev->kvm->online_vcpus); in aia_set_attr()
353 else if (type < KVM_DEV_RISCV_AIA_ADDR_IMSIC(nr_vcpus)) in aia_set_attr()
397 int nr_vcpus, r = -ENXIO; in aia_get_attr() local
420 nr_vcpus = atomic_read(&dev->kvm->online_vcpus); in aia_get_attr()
424 else if (type < KVM_DEV_RISCV_AIA_ADDR_IMSIC(nr_vcpus)) in aia_get_attr()
470 int nr_vcpus; in aia_has_attr() local
486 nr_vcpus = atomic_read(&dev->kvm->online_vcpus); in aia_has_attr()
489 else if (attr->attr < KVM_DEV_RISCV_AIA_ADDR_IMSIC(nr_vcpus)) in aia_has_attr()
/linux/drivers/virt/nitro_enclaves/
H A Dne_pci_dev.h247 u64 nr_vcpus; member
272 u64 nr_vcpus; member
H A Dne_misc_dev.h76 unsigned int nr_vcpus; member
/linux/arch/arm64/kvm/vgic/
H A Dvgic-v4.c243 int nr_vcpus, ret; in vgic_v4_init() local
254 nr_vcpus = atomic_read(&kvm->online_vcpus); in vgic_v4_init()
256 dist->its_vm.vpes = kcalloc(nr_vcpus, sizeof(*dist->its_vm.vpes), in vgic_v4_init()
261 dist->its_vm.nr_vpes = nr_vcpus; in vgic_v4_init()
/linux/tools/testing/selftests/kvm/include/aarch64/
H A Dvgic.h19 int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs);

12