/linux-6.6.21/tools/testing/selftests/kvm/ |
D | access_tracking_perf_test.c | 76 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 …]
|
D | max_guest_memory_test.c | 37 static int nr_vcpus; variable 100 threads = malloc(nr_vcpus * sizeof(*threads)); in spawn_workers() 103 info = malloc(nr_vcpus * sizeof(*info)); in spawn_workers() 106 nr_bytes = ((end_gpa - start_gpa) / nr_vcpus) & in spawn_workers() 108 TEST_ASSERT(nr_bytes, "C'mon, no way you have %d CPUs", nr_vcpus); in spawn_workers() 110 for (i = 0, gpa = start_gpa; i < nr_vcpus; i++, gpa += nr_bytes) { in spawn_workers() 139 atomic_set(&rendezvous, -nr_vcpus - 1); in rendezvous_with_vcpus() 141 atomic_set(&rendezvous, nr_vcpus + 1); in rendezvous_with_vcpus() 153 nr_vcpus = CPU_COUNT(&possible_mask) * 3/4; in calc_default_nr_vcpus() 154 TEST_ASSERT(nr_vcpus > 0, "Uh, no CPUs?"); in calc_default_nr_vcpus() [all …]
|
D | dirty_log_perf_test.c | 30 static void arch_setup_vm(struct kvm_vm *vm, unsigned int nr_vcpus) in arch_setup_vm() argument 36 gic_fd = vgic_v3_setup(vm, nr_vcpus, 64, GICD_BASE_GPA, GICR_BASE_GPA); in arch_setup_vm() 47 static void arch_setup_vm(struct kvm_vm *vm, unsigned int nr_vcpus) in arch_setup_vm() argument 60 static int nr_vcpus = 1; variable 155 vm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, in run_test() 163 guest_num_pages = (nr_vcpus * guest_percpu_mem_size) >> vm->page_shift; in run_test() 174 arch_setup_vm(vm, nr_vcpus); in run_test() 181 for (i = 0; i < nr_vcpus; i++) in run_test() 193 memstress_start_vcpu_threads(nr_vcpus, vcpu_worker); in run_test() 197 for (i = 0; i < nr_vcpus; i++) { in run_test() [all …]
|
D | demand_paging_test.c | 29 static int nr_vcpus = 1; variable 139 vm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1, in run_test() 150 for (i = 0; i < nr_vcpus; i++) { in run_test() 158 uffd_descs = malloc(nr_vcpus * sizeof(struct uffd_desc *)); in run_test() 160 for (i = 0; i < nr_vcpus; i++) { in run_test() 181 memstress_start_vcpu_threads(nr_vcpus, vcpu_worker); in run_test() 184 memstress_join_vcpu_threads(nr_vcpus); in run_test() 190 for (i = 0; i < nr_vcpus; i++) in run_test() 197 memstress_args.vcpu_args[0].pages * nr_vcpus / in run_test() 265 nr_vcpus = atoi_positive("Number of vCPUs", optarg); in main() [all …]
|
D | memslot_modification_stress_test.c | 34 static int nr_vcpus = 1; variable 98 vm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1, in run_test() 104 memstress_start_vcpu_threads(nr_vcpus, vcpu_worker); in run_test() 110 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()
|
D | kvm_page_table_test.c | 68 static uint32_t nr_vcpus = 1; variable 257 vm = __vm_create_with_vcpus(mode, nr_vcpus, guest_num_pages, in pre_init_before_test() 313 pr_info("Number of testing vCPUs: %d\n", nr_vcpus); in pre_init_before_test() 324 for (vcpus = 0; vcpus < nr_vcpus; vcpus++) { in vcpus_complete_new_stage() 331 for (vcpus = 0; vcpus < nr_vcpus; vcpus++) { in vcpus_complete_new_stage() 354 vcpu_threads = malloc(nr_vcpus * sizeof(*vcpu_threads)); in run_test() 360 for (i = 0; i < nr_vcpus; i++) in run_test() 404 for (i = 0; i < nr_vcpus; i++) { in run_test() 409 for (i = 0; i < nr_vcpus; i++) in run_test() 462 nr_vcpus = atoi_positive("Number of vCPUs", optarg); in main() [all …]
|
/linux-6.6.21/tools/testing/selftests/kvm/lib/ |
D | memstress.c | 89 void memstress_setup_vcpus(struct kvm_vm *vm, int nr_vcpus, in memstress_setup_vcpus() argument 98 for (i = 0; i < nr_vcpus; i++) { in memstress_setup_vcpus() 112 vcpu_args->pages = (nr_vcpus * vcpu_memory_bytes) / in memstress_setup_vcpus() 125 struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus, in memstress_create_vm() argument 149 (nr_vcpus * vcpu_memory_bytes) / args->guest_page_size); in memstress_create_vm() 164 slot0_pages += memstress_nested_pages(nr_vcpus); in memstress_create_vm() 171 vm = __vm_create_with_vcpus(mode, nr_vcpus, slot0_pages + guest_num_pages, 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 …]
|
D | kvm_util.c | 403 struct kvm_vm *__vm_create_with_vcpus(enum vm_guest_mode mode, uint32_t nr_vcpus, in __vm_create_with_vcpus() argument 410 TEST_ASSERT(!nr_vcpus || vcpus, "Must provide vCPU array"); in __vm_create_with_vcpus() 412 vm = __vm_create(mode, nr_vcpus, extra_mem_pages); in __vm_create_with_vcpus() 414 for (i = 0; i < nr_vcpus; ++i) in __vm_create_with_vcpus() 519 int nr_vcpus) in kvm_parse_vcpu_pinning() argument 535 for (i = 0; i < nr_vcpus; i++) { in kvm_parse_vcpu_pinning()
|
/linux-6.6.21/tools/testing/selftests/kvm/aarch64/ |
D | arch_timer.c | 45 int nr_vcpus; member 53 .nr_vcpus = NR_VCPUS_DEF, 207 gic_init(GIC_V3, test_args.nr_vcpus, in guest_code() 304 for (n_done = 0, i = 0; i < test_args.nr_vcpus; i++) { in test_vcpu_migration() 316 } while (test_args.nr_vcpus != n_done); in test_vcpu_migration() 328 vcpu_done_map = bitmap_zalloc(test_args.nr_vcpus); in test_run() 331 for (i = 0; i < (unsigned long)test_args.nr_vcpus; i++) { in test_run() 347 for (i = 0; i < test_args.nr_vcpus; i++) in test_run() 376 int nr_vcpus = test_args.nr_vcpus; in test_vm_create() local 378 vm = vm_create_with_vcpus(nr_vcpus, guest_code, vcpus); in test_vm_create() [all …]
|
D | vgic_init.c | 75 uint32_t nr_vcpus, in vm_gic_create_with_vcpus() argument 81 v.vm = vm_create_with_vcpus(nr_vcpus, guest_code, vcpus); in vm_gic_create_with_vcpus() 474 static struct vm_gic vm_gic_v3_create_with_vcpuids(int nr_vcpus, in vm_gic_v3_create_with_vcpuids() argument 480 v.vm = vm_create(nr_vcpus); in vm_gic_v3_create_with_vcpuids() 481 for (i = 0; i < nr_vcpus; i++) in vm_gic_v3_create_with_vcpuids()
|
/linux-6.6.21/arch/arm64/kvm/hyp/nvhe/ |
D | pkvm.c | 267 if (!hyp_vm || hyp_vm->nr_vcpus <= vcpu_idx) in pkvm_load_hyp_vcpu() 293 unsigned int nr_vcpus) in unpin_host_vcpus() argument 297 for (i = 0; i < nr_vcpus; i++) in unpin_host_vcpus() 302 unsigned int nr_vcpus) in init_pkvm_hyp_vm() argument 305 hyp_vm->kvm.created_vcpus = nr_vcpus; in init_pkvm_hyp_vm() 397 static size_t pkvm_get_hyp_vm_size(unsigned int nr_vcpus) in pkvm_get_hyp_vm_size() argument 400 size_mul(sizeof(struct pkvm_hyp_vcpu *), nr_vcpus)); in pkvm_get_hyp_vm_size() 471 unsigned int nr_vcpus; in __pkvm_init_vm() local 479 nr_vcpus = READ_ONCE(host_kvm->created_vcpus); in __pkvm_init_vm() 480 if (nr_vcpus < 1) { in __pkvm_init_vm() [all …]
|
/linux-6.6.21/tools/testing/selftests/kvm/lib/aarch64/ |
D | vgic.c | 33 int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs, in vgic_v3_setup() argument 41 TEST_ASSERT(nr_vcpus, "Number of vCPUs cannot be empty\n"); in vgic_v3_setup() 49 TEST_ASSERT(nr_vcpus == nr_vcpus_created, in vgic_v3_setup() 51 nr_vcpus, nr_vcpus_created); in vgic_v3_setup() 69 redist_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-6.6.21/tools/testing/selftests/kvm/lib/x86_64/ |
D | memstress.c | 52 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-6.6.21/tools/testing/selftests/kvm/include/ |
D | memstress.h | 58 struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus, 72 uint64_t memstress_nested_pages(int nr_vcpus); 73 void memstress_setup_nested(struct kvm_vm *vm, int nr_vcpus, struct kvm_vcpu *vcpus[]);
|
D | kvm_util_base.h | 730 struct kvm_vm *__vm_create_with_vcpus(enum vm_guest_mode mode, uint32_t nr_vcpus, 734 static inline struct kvm_vm *vm_create_with_vcpus(uint32_t nr_vcpus, in vm_create_with_vcpus() argument 738 return __vm_create_with_vcpus(VM_MODE_DEFAULT, nr_vcpus, 0, in vm_create_with_vcpus() 761 int nr_vcpus);
|
/linux-6.6.21/tools/testing/selftests/kvm/x86_64/ |
D | set_boot_cpu_id.c | 76 static struct kvm_vm *create_vm(uint32_t nr_vcpus, uint32_t bsp_vcpu_id, in create_vm() argument 82 vm = vm_create(nr_vcpus); in create_vm() 86 for (i = 0; i < nr_vcpus; i++) in create_vm()
|
/linux-6.6.21/arch/riscv/kvm/ |
D | aia_device.c | 329 int nr_vcpus, r = -ENXIO; in aia_set_attr() local 348 nr_vcpus = atomic_read(&dev->kvm->online_vcpus); in aia_set_attr() 352 else if (type < KVM_DEV_RISCV_AIA_ADDR_IMSIC(nr_vcpus)) in aia_set_attr() 396 int nr_vcpus, r = -ENXIO; in aia_get_attr() local 419 nr_vcpus = atomic_read(&dev->kvm->online_vcpus); in aia_get_attr() 423 else if (type < KVM_DEV_RISCV_AIA_ADDR_IMSIC(nr_vcpus)) in aia_get_attr() 469 int nr_vcpus; in aia_has_attr() local 485 nr_vcpus = atomic_read(&dev->kvm->online_vcpus); in aia_has_attr() 488 else if (attr->attr < KVM_DEV_RISCV_AIA_ADDR_IMSIC(nr_vcpus)) in aia_has_attr()
|
/linux-6.6.21/drivers/virt/nitro_enclaves/ |
D | ne_pci_dev.h | 247 u64 nr_vcpus; member 272 u64 nr_vcpus; member
|
D | ne_misc_dev.h | 76 unsigned int nr_vcpus; member
|
/linux-6.6.21/arch/arm64/kvm/vgic/ |
D | vgic-v4.c | 243 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()
|
D | vgic-mmio-v2.c | 124 int nr_vcpus = atomic_read(&source_vcpu->kvm->online_vcpus); in vgic_mmio_write_sgir() local 135 targets = (1U << nr_vcpus) - 1; /* all, ... */ in vgic_mmio_write_sgir()
|
D | vgic-mmio-v3.c | 883 int nr_vcpus = atomic_read(&kvm->online_vcpus); in vgic_v3_alloc_redist_region() local 885 : nr_vcpus * KVM_VGIC_V3_REDIST_SIZE; in vgic_v3_alloc_redist_region()
|
/linux-6.6.21/arch/arm64/kvm/hyp/include/nvhe/ |
D | pkvm.h | 44 unsigned int nr_vcpus; member
|
/linux-6.6.21/tools/testing/selftests/kvm/include/aarch64/ |
D | vgic.h | 19 int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs,
|
/linux-6.6.21/arch/s390/kvm/ |
D | vsie.c | 1330 int nr_vcpus; in get_vsie_page() local 1345 nr_vcpus = atomic_read(&kvm->online_vcpus); in get_vsie_page() 1348 if (kvm->arch.vsie.page_count < nr_vcpus) { in get_vsie_page() 1365 kvm->arch.vsie.next %= nr_vcpus; in get_vsie_page()
|