Lines Matching +full:1 +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()
83 * be directly set as 1 if they are omitted (e.g. dies for PC since 4.1).
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()
122 * not be set to a value greater than 1. in machine_parse_smp_config()
125 config->has_modules && config->modules > 1) { in machine_parse_smp_config()
127 "modules > 1 not supported by this machine's CPU topology"); in machine_parse_smp_config()
130 modules = modules > 0 ? modules : 1; in machine_parse_smp_config()
133 config->has_clusters && config->clusters > 1) { in machine_parse_smp_config()
135 "clusters > 1 not supported by this machine's CPU topology"); in machine_parse_smp_config()
138 clusters = clusters > 0 ? clusters : 1; in machine_parse_smp_config()
141 config->has_dies && config->dies > 1) { in machine_parse_smp_config()
143 "dies > 1 not supported by this machine's CPU topology"); in machine_parse_smp_config()
146 dies = dies > 0 ? dies : 1; in machine_parse_smp_config()
149 config->has_books && config->books > 1) { in machine_parse_smp_config()
151 "books > 1 not supported by this machine's CPU topology"); in machine_parse_smp_config()
154 books = books > 0 ? books : 1; in machine_parse_smp_config()
157 config->has_drawers && config->drawers > 1) { in machine_parse_smp_config()
159 "drawers > 1 not supported by this machine's CPU topology"); in machine_parse_smp_config()
162 drawers = drawers > 0 ? drawers : 1; in machine_parse_smp_config()
166 sockets = sockets > 0 ? sockets : 1; in machine_parse_smp_config()
167 cores = cores > 0 ? cores : 1; in machine_parse_smp_config()
168 threads = threads > 0 ? threads : 1; in machine_parse_smp_config()
175 cores = cores > 0 ? cores : 1; in machine_parse_smp_config()
176 threads = threads > 0 ? threads : 1; in machine_parse_smp_config()
181 threads = threads > 0 ? threads : 1; in machine_parse_smp_config()
189 sockets = sockets > 0 ? sockets : 1; in machine_parse_smp_config()
190 threads = threads > 0 ? threads : 1; in machine_parse_smp_config()
195 threads = threads > 0 ? threads : 1; 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()