/qemu/hw/core/ |
H A D | machine-smp.c | 215 ms->smp.cpus = cpus; in machine_parse_smp_config() 216 ms->smp.drawers = drawers; in machine_parse_smp_config() 217 ms->smp.books = books; in machine_parse_smp_config() 218 ms->smp.sockets = sockets; in machine_parse_smp_config() 219 ms->smp.dies = dies; in machine_parse_smp_config() 220 ms->smp.clusters = clusters; in machine_parse_smp_config() 221 ms->smp.modules = modules; in machine_parse_smp_config() 222 ms->smp.cores = cores; in machine_parse_smp_config() 223 ms->smp.threads = threads; in machine_parse_smp_config() 224 ms->smp.max_cpus = maxcpus; in machine_parse_smp_config() [all …]
|
H A D | machine.c | 889 .has_cpus = true, .cpus = ms->smp.cpus, in machine_get_smp() 1165 ms->smp.cpus = mc->default_cpus; in machine_initfn() 1166 ms->smp.max_cpus = mc->default_cpus; in machine_initfn() 1167 ms->smp.drawers = 1; in machine_initfn() 1168 ms->smp.books = 1; in machine_initfn() 1169 ms->smp.sockets = 1; in machine_initfn() 1170 ms->smp.dies = 1; in machine_initfn() 1171 ms->smp.clusters = 1; in machine_initfn() 1172 ms->smp.modules = 1; in machine_initfn() 1173 ms->smp.cores = 1; in machine_initfn() [all …]
|
/qemu/include/hw/s390x/ |
H A D | cpu-topology.h | 66 static inline int s390_std_socket(int n, CpuTopology *smp) in s390_std_socket() argument 68 return (n / smp->cores) % smp->sockets; in s390_std_socket() 71 static inline int s390_std_book(int n, CpuTopology *smp) in s390_std_book() argument 73 return (n / (smp->cores * smp->sockets)) % smp->books; in s390_std_book() 76 static inline int s390_std_drawer(int n, CpuTopology *smp) in s390_std_drawer() argument 78 return (n / (smp->cores * smp->sockets * smp->books)) % smp->drawers; in s390_std_drawer()
|
/qemu/hw/s390x/ |
H A D | cpu-topology.c | 50 return (drawer_id * current_machine->smp.books + book_id) * in s390_socket_nb_from_ids() 51 current_machine->smp.sockets + socket_id; in s390_socket_nb_from_ids() 89 CpuTopology *smp = &ms->smp; in s390_topology_init() local 92 smp->books * smp->drawers); in s390_topology_init() 184 CpuTopology *smp = ¤t_machine->smp; in s390_topology_cpu_default() local 198 env->book_id = s390_std_book(env->core_id, smp); in s390_topology_cpu_default() 237 CpuTopology *smp = ¤t_machine->smp; in s390_topology_check() local 239 if (socket_id >= smp->sockets) { in s390_topology_check() 243 if (book_id >= smp->books) { in s390_topology_check() 247 if (drawer_id >= smp->drawers) { in s390_topology_check() [all …]
|
/qemu/hw/riscv/ |
H A D | numa.c | 40 int i, first_hartid = ms->smp.cpus; in riscv_socket_first_hartid() 46 for (i = 0; i < ms->smp.cpus; i++) { in riscv_socket_first_hartid() 55 return (first_hartid < ms->smp.cpus) ? first_hartid : -1; in riscv_socket_first_hartid() 63 return (!socket_id) ? ms->smp.cpus - 1 : -1; in riscv_socket_last_hartid() 66 for (i = 0; i < ms->smp.cpus; i++) { in riscv_socket_last_hartid() 75 return (last_hartid < ms->smp.cpus) ? last_hartid : -1; in riscv_socket_last_hartid() 83 return (!socket_id) ? ms->smp.cpus : -1; in riscv_socket_hart_count() 210 if (ms->numa_state->num_nodes > ms->smp.cpus) { in riscv_numa_get_default_cpu_node_id() 213 ms->numa_state->num_nodes, ms->smp.cpus); in riscv_numa_get_default_cpu_node_id() 217 nidx = idx / (ms->smp.cpus / ms->numa_state->num_nodes); in riscv_numa_get_default_cpu_node_id() [all …]
|
H A D | sifive_e.c | 184 object_property_set_int(OBJECT(&s->cpus), "num-harts", ms->smp.cpus, in type_init() 212 (char *)SIFIVE_E_PLIC_HART_CONFIG, ms->smp.cpus, 0, in sifive_e_soc_realize() 223 0, ms->smp.cpus, false); in sifive_e_soc_realize() 226 RISCV_ACLINT_DEFAULT_MTIMER_SIZE, 0, ms->smp.cpus, in sifive_e_soc_realize()
|
H A D | sifive_u.c | 170 for (cpu = ms->smp.cpus - 1; cpu >= 0; cpu--) { in create_fdt() 199 cells = g_new0(uint32_t, ms->smp.cpus * 4); in create_fdt() 200 for (cpu = 0; cpu < ms->smp.cpus; cpu++) { in create_fdt() 219 cells, ms->smp.cpus * sizeof(uint32_t) * 4); in create_fdt() 250 cells = g_new0(uint32_t, ms->smp.cpus * 4 - 2); in create_fdt() 251 for (cpu = 0; cpu < ms->smp.cpus; cpu++) { in create_fdt() 275 cells, (ms->smp.cpus * 4 - 2) * sizeof(uint32_t)); in create_fdt() 827 plic_hart_config = riscv_plic_hart_config_string(ms->smp.cpus); in sifive_u_soc_realize() 831 plic_hart_config, ms->smp.cpus, 0, in sifive_u_soc_realize() 847 ms->smp.cpus, false); in sifive_u_soc_realize() [all …]
|
H A D | microchip_pfsoc.c | 167 qdev_prop_set_uint32(DEVICE(&s->u_cpus), "num-harts", ms->smp.cpus - 1); in microchip_pfsoc_soc_instance_init() 251 0, ms->smp.cpus, false); in microchip_pfsoc_soc_realize() 254 RISCV_ACLINT_DEFAULT_MTIMER_SIZE, 0, ms->smp.cpus, in microchip_pfsoc_soc_realize() 278 plic_hart_config = riscv_plic_hart_config_string(ms->smp.cpus); in microchip_pfsoc_soc_realize() 282 plic_hart_config, ms->smp.cpus, 0, in microchip_pfsoc_soc_realize()
|
/qemu/target/s390x/kvm/ |
H A D | stsi-topology.c | 143 sysib->mag[S390_TOPOLOGY_MAG4] = current_machine->smp.drawers; in setup_stsi() 144 sysib->mag[S390_TOPOLOGY_MAG3] = current_machine->smp.books; in setup_stsi() 145 sysib->mag[S390_TOPOLOGY_MAG2] = current_machine->smp.sockets; in setup_stsi() 146 sysib->mag[S390_TOPOLOGY_MAG1] = current_machine->smp.cores; in setup_stsi() 149 sysib->mag[S390_TOPOLOGY_MAG3] = current_machine->smp.drawers * in setup_stsi() 150 current_machine->smp.books; in setup_stsi() 151 sysib->mag[S390_TOPOLOGY_MAG2] = current_machine->smp.sockets; in setup_stsi() 152 sysib->mag[S390_TOPOLOGY_MAG1] = current_machine->smp.cores; in setup_stsi() 156 current_machine->smp.books * in setup_stsi() 157 current_machine->smp.sockets; in setup_stsi() [all …]
|
/qemu/hw/i386/ |
H A D | x86-common.c | 113 for (i = 0; i < ms->smp.cpus; i++) { in x86_cpus_init() 251 unsigned int smp_cores = ms->smp.cores; in x86_cpu_pre_plug() 252 unsigned int smp_threads = ms->smp.threads; in x86_cpu_pre_plug() 274 if (ms->smp.modules > 1) { in x86_cpu_pre_plug() 275 env->nr_modules = ms->smp.modules; in x86_cpu_pre_plug() 279 if (ms->smp.dies > 1) { in x86_cpu_pre_plug() 280 env->nr_dies = ms->smp.dies; in x86_cpu_pre_plug() 293 if (cpu->die_id < 0 && ms->smp.dies == 1) { in x86_cpu_pre_plug() 301 if (cpu->module_id < 0 && ms->smp.modules == 1) { in x86_cpu_pre_plug() 316 } else if (cpu->die_id > ms->smp.dies - 1) { in x86_cpu_pre_plug() [all …]
|
H A D | x86.c | 47 topo_info->dies_per_pkg = ms->smp.dies; in init_topo_info() 54 topo_info->modules_per_die = ms->smp.modules; in init_topo_info() 55 topo_info->cores_per_module = ms->smp.cores; in init_topo_info() 56 topo_info->threads_per_core = ms->smp.threads; in init_topo_info() 104 unsigned int max_cpus = ms->smp.max_cpus; in x86_possible_cpu_arch_ids() 134 if (ms->smp.dies > 1) { in x86_possible_cpu_arch_ids() 138 if (ms->smp.modules > 1) { in x86_possible_cpu_arch_ids()
|
/qemu/docs/system/s390x/ |
H A D | cpu-topology.rst | 54 with the ``-smp`` or the ``-device`` QEMU command arguments. 57 and the ``-smp`` command line argument accepts only ``threads=1``. 60 specified for the ``-smp`` flag, the number of these containers 67 -smp cpus=5,drawer=1,books=1,sockets=8,cores=4,maxcpus=32 73 -smp cpus=5,sockets=8,cores=4,maxcpus=32 75 When a CPU is defined by the ``-smp`` command argument, its position 103 on the ``-smp`` argument. 139 -smp cpus=5,sockets=8,cores=4,maxcpus=32 \ 153 * There are 5 CPUs provided to the guest with the ``-smp`` command line 220 with the exception of CPU 0 which must be defined with the -smp [all …]
|
/qemu/hw/arm/ |
H A D | mps3r.c | 270 qdev_prop_set_uint32(gicdev, "num-cpu", machine->smp.cpus); in create_gic() 273 qlist_append_int(redist_region_count, machine->smp.cpus); in create_gic() 285 for (int i = 0; i < machine->smp.cpus; i++) { in create_gic() 317 sysbus_connect_irq(gicsbd, i + machine->smp.cpus, in create_gic() 319 sysbus_connect_irq(gicsbd, i + 2 * machine->smp.cpus, in create_gic() 321 sysbus_connect_irq(gicsbd, i + 3 * machine->smp.cpus, in create_gic() 370 assert(machine->smp.cpus <= MPS3R_CPU_MAX); in mps3r_common_init() 371 for (int i = 0; i < machine->smp.cpus; i++) { in mps3r_common_init() 412 for (int i = 0; i < machine->smp.cpus; i++) { in mps3r_common_init()
|
H A D | virt.c | 403 int smp_cpus = ms->smp.cpus; in fdt_add_cpu_nodes() 490 if (ms->smp.threads > 1) { in fdt_add_cpu_nodes() 493 cpu / (ms->smp.clusters * ms->smp.cores * ms->smp.threads), in fdt_add_cpu_nodes() 494 (cpu / (ms->smp.cores * ms->smp.threads)) % ms->smp.clusters, in fdt_add_cpu_nodes() 495 (cpu / ms->smp.threads) % ms->smp.cores, in fdt_add_cpu_nodes() 500 cpu / (ms->smp.clusters * ms->smp.cores), in fdt_add_cpu_nodes() 501 (cpu / ms->smp.cores) % ms->smp.clusters, in fdt_add_cpu_nodes() 2730 n / (ms->smp.clusters * ms->smp.cores * ms->smp.threads); in virt_possible_cpu_arch_ids() 2733 (n / (ms->smp.cores * ms->smp.threads)) % ms->smp.clusters; in virt_possible_cpu_arch_ids() 2736 (n / ms->smp.threads) % ms->smp.cores; in virt_possible_cpu_arch_ids() [all …]
|
/qemu/hw/loongarch/ |
H A D | virt.c | 325 int smp_cpus = ms->smp.cpus; in fdt_add_cpu_nodes() 358 if (ms->smp.threads > 1) { in fdt_add_cpu_nodes() 361 num / (ms->smp.cores * ms->smp.threads), in fdt_add_cpu_nodes() 362 (num / ms->smp.threads) % ms->smp.cores, in fdt_add_cpu_nodes() 363 num % ms->smp.threads); in fdt_add_cpu_nodes() 367 num / ms->smp.cores, in fdt_add_cpu_nodes() 368 num % ms->smp.cores); in fdt_add_cpu_nodes() 804 for (cpu = 0; cpu < ms->smp.cpus; cpu++) { in virt_irq_init() 1338 unsigned int max_cpus = ms->smp.max_cpus; in virt_possible_cpu_arch_ids() 1354 n / (ms->smp.cores * ms->smp.threads); in virt_possible_cpu_arch_ids() [all …]
|
H A D | fw_cfg.c | 23 int max_cpus = ms->smp.max_cpus; in virt_fw_cfg_init() 24 int smp_cpus = ms->smp.cpus; in virt_fw_cfg_init()
|
/qemu/docs/system/ppc/ |
H A D | ppce500.rst | 36 * The number of subnodes under /cpus node should match QEMU's ``-smp`` option 103 $ qemu-system-ppc64 -M ppce500 -cpu e5500 -smp 4 -m 2G \ 117 $ qemu-system-ppc64 -M ppce500 -cpu e500mc -smp 4 -m 2G \ 158 $ qemu-system-ppc64 -M ppce500 -smp 4 -m 2G \ 179 $ qemu-system-ppc64 -M ppce500 -cpu e500mc -smp 4 -m 2G \ 190 $ qemu-system-ppc64 -M ppce500 -cpu e500mc -smp 4 -m 2G \
|
H A D | powernv.rst | 77 $ qemu-system-ppc64 -m 2G -machine powernv9 -smp 2,cores=2,threads=1 \ 114 $ qemu-system-ppc64 -m 2G -machine powernv9 -smp 2,cores=2,threads=1 -accel tcg,thread=single \ 149 number of cores. ``-smp 2,cores=1`` will define a machine with 2 150 sockets of 1 core, whereas ``-smp 2,cores=2`` will define a machine 151 with 1 socket of 2 cores. ``-smp 8,cores=2``, 4 sockets of 2 cores.
|
/qemu/hw/ppc/ |
H A D | mac_newworld.c | 160 for (i = 0; i < machine->smp.cpus; i++) { in ppc_core99_init() 257 openpic_irqs = g_new0(IrqLines, machine->smp.cpus); in ppc_core99_init() 259 for (i = 0; i < machine->smp.cpus; i++) { in ppc_core99_init() 397 for (i = 0; i < machine->smp.cpus; i++) { in ppc_core99_init() 476 fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); in ppc_core99_init() 477 fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpus); in ppc_core99_init()
|
H A D | mac_oldworld.c | 112 for (i = 0; i < machine->smp.cpus; i++) { in ppc_heathrow_init() 265 for (i = 0; i < machine->smp.cpus; i++) { in ppc_heathrow_init() 318 fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); in ppc_heathrow_init() 319 fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpus); in ppc_heathrow_init()
|
/qemu/hw/sparc/ |
H A D | leon3.c | 278 for (i = 0; i < machine->smp.cpus; i++) { in leon3_generic_hw_init() 310 object_property_set_int(OBJECT(irqmpdev), "ncpus", machine->smp.cpus, in leon3_generic_hw_init() 314 for (i = 0; i < machine->smp.cpus; i++) { in leon3_generic_hw_init() 400 for (i = 0; i < machine->smp.cpus; i++) { in leon3_generic_hw_init()
|
/qemu/docs/system/riscv/ |
H A D | sifive_u.rst | 51 of subnodes should match QEMU's ``-smp`` option 129 $ qemu-system-riscv64 -M sifive_u -smp 5 -m 2G \ 154 $ qemu-system-riscv64 -M sifive_u -smp 5 -m 8G \ 200 $ qemu-system-riscv64 -M sifive_u -smp 5 -m 2G \ 293 $ qemu-system-riscv64 -M sifive_u,msel=11 -smp 5 -m 8G \ 302 $ qemu-system-riscv64 -M sifive_u,msel=6 -smp 5 -m 8G \ 310 the real hardware, ie: 5 cores (-smp 5) and 8 GiB memory (-m 8G). 340 $ qemu-system-riscv64 -M sifive_u -smp 5 -m 2G \ 362 $ qemu-system-riscv32 -M sifive_u -smp 5 -m 2G \
|
/qemu/tests/unit/ |
H A D | test-smp-parse.c | 719 output_topo_str = cpu_topology_to_string(&ms->smp, in check_parse() 727 (ms->smp.cpus == expect_topo->cpus) && in check_parse() 728 (ms->smp.drawers == expect_topo->drawers) && in check_parse() 729 (ms->smp.books == expect_topo->books) && in check_parse() 730 (ms->smp.sockets == expect_topo->sockets) && in check_parse() 731 (ms->smp.dies == expect_topo->dies) && in check_parse() 732 (ms->smp.clusters == expect_topo->clusters) && in check_parse() 733 (ms->smp.cores == expect_topo->cores) && in check_parse() 734 (ms->smp.threads == expect_topo->threads) && in check_parse() 735 (ms->smp.max_cpus == expect_topo->max_cpus) && in check_parse()
|
/qemu/system/ |
H A D | dirtylimit.c | 157 int max_cpus = ms->smp.max_cpus; in vcpu_dirty_rate_stat_initialize() 202 int max_cpus = ms->smp.max_cpus; in dirtylimit_state_initialize() 239 cpu_index >= ms->smp.max_cpus); in dirtylimit_vcpu_index_valid() 401 int max_cpus = ms->smp.max_cpus; in dirtylimit_set_all()
|
/qemu/hw/mips/ |
H A D | loongson3_bootp.c | 43 c->nr_cpus = cpu_to_le32(current_machine->smp.cpus); in init_cpu_info() 44 c->total_node = cpu_to_le32(DIV_ROUND_UP(current_machine->smp.cpus, in init_cpu_info()
|