Lines Matching full:ms

31 static char *cpu_hierarchy_to_string(MachineState *ms)  in cpu_hierarchy_to_string()  argument
33 MachineClass *mc = MACHINE_GET_CLASS(ms); in cpu_hierarchy_to_string()
37 g_string_append_printf(s, "drawers (%u) * ", ms->smp.drawers); in cpu_hierarchy_to_string()
41 g_string_append_printf(s, "books (%u) * ", ms->smp.books); in cpu_hierarchy_to_string()
44 g_string_append_printf(s, "sockets (%u)", ms->smp.sockets); in cpu_hierarchy_to_string()
47 g_string_append_printf(s, " * dies (%u)", ms->smp.dies); in cpu_hierarchy_to_string()
51 g_string_append_printf(s, " * clusters (%u)", ms->smp.clusters); in cpu_hierarchy_to_string()
55 g_string_append_printf(s, " * modules (%u)", ms->smp.modules); in cpu_hierarchy_to_string()
58 g_string_append_printf(s, " * cores (%u)", ms->smp.cores); in cpu_hierarchy_to_string()
59 g_string_append_printf(s, " * threads (%u)", ms->smp.threads); in cpu_hierarchy_to_string()
85 void machine_parse_smp_config(MachineState *ms, in machine_parse_smp_config() argument
88 MachineClass *mc = MACHINE_GET_CLASS(ms); in machine_parse_smp_config()
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()
230 g_autofree char *topo_msg = cpu_hierarchy_to_string(ms); in machine_parse_smp_config()
239 g_autofree char *topo_msg = cpu_hierarchy_to_string(ms); in machine_parse_smp_config()
247 if (ms->smp.cpus < mc->min_cpus) { in machine_parse_smp_config()
250 ms->smp.cpus, in machine_parse_smp_config()
255 if (ms->smp.max_cpus > mc->max_cpus) { in machine_parse_smp_config()
258 ms->smp.max_cpus, in machine_parse_smp_config()
264 static bool machine_check_topo_support(MachineState *ms, in machine_check_topo_support() argument
268 MachineClass *mc = MACHINE_GET_CLASS(ms); in machine_check_topo_support()
285 bool machine_parse_smp_cache(MachineState *ms, in machine_parse_smp_cache() argument
289 MachineClass *mc = MACHINE_GET_CLASS(ms); in machine_parse_smp_cache()
304 machine_set_cache_topo_level(ms, node->value->cache, in machine_parse_smp_cache()
310 const SmpCacheProperties *props = &ms->smp_cache.props[i]; in machine_parse_smp_cache()
324 if (!machine_check_topo_support(ms, props->topology, errp)) { in machine_parse_smp_cache()
331 unsigned int machine_topo_get_cores_per_socket(const MachineState *ms) in machine_topo_get_cores_per_socket() argument
333 return ms->smp.cores * ms->smp.modules * ms->smp.clusters * ms->smp.dies; in machine_topo_get_cores_per_socket()
336 unsigned int machine_topo_get_threads_per_socket(const MachineState *ms) in machine_topo_get_threads_per_socket() argument
338 return ms->smp.threads * machine_topo_get_cores_per_socket(ms); in machine_topo_get_threads_per_socket()
341 CpuTopologyLevel machine_get_cache_topo_level(const MachineState *ms, in machine_get_cache_topo_level() argument
344 return ms->smp_cache.props[cache].topology; in machine_get_cache_topo_level()
347 void machine_set_cache_topo_level(MachineState *ms, CacheLevelAndType cache, in machine_set_cache_topo_level() argument
350 ms->smp_cache.props[cache].topology = level; in machine_set_cache_topo_level()
378 bool machine_check_smp_cache(const MachineState *ms, Error **errp) in machine_check_smp_cache() argument
380 if (smp_cache_topo_cmp(&ms->smp_cache, CACHE_LEVEL_AND_TYPE_L1D, in machine_check_smp_cache()
382 smp_cache_topo_cmp(&ms->smp_cache, CACHE_LEVEL_AND_TYPE_L1I, in machine_check_smp_cache()
390 if (smp_cache_topo_cmp(&ms->smp_cache, CACHE_LEVEL_AND_TYPE_L2, in machine_check_smp_cache()