Lines Matching +full:multi +full:- +full:cluster

1 // SPDX-License-Identifier: GPL-2.0
3 * pptt.c - parsing of Processor Properties Topology Table (PPTT)
33 if (pptt_ref + sizeof(struct acpi_subtable_header) > table_hdr->length) in fetch_pptt_subtable()
38 if (entry->length == 0) in fetch_pptt_subtable()
41 if (pptt_ref + entry->length > table_hdr->length) in fetch_pptt_subtable()
65 if (resource >= node->number_of_priv_resources) in acpi_get_pptt_resource()
81 * acpi_pptt_walk_cache() - Attempt to find the requested acpi_pptt_cache
109 if (res->type != ACPI_PPTT_TYPE_CACHE) in acpi_pptt_walk_cache()
117 cache->flags & ACPI_PPTT_CACHE_TYPE_VALID && in acpi_pptt_walk_cache()
118 acpi_pptt_match_type(cache->attributes, type)) { in acpi_pptt_walk_cache()
130 cache = fetch_pptt_cache(table_hdr, cache->next_level_of_cache); in acpi_pptt_walk_cache()
168 * acpi_count_levels() - Given a PPTT table, and a CPU node, count the caches
187 cpu_node = fetch_pptt_node(table_hdr, cpu_node->parent); in acpi_count_levels()
194 * acpi_pptt_leaf_node() - Given a processor node, determine if its a leaf
213 if (table_hdr->revision > 1) in acpi_pptt_leaf_node()
214 return (node->flags & ACPI_PPTT_ACPI_LEAF_NODE); in acpi_pptt_leaf_node()
216 table_end = (unsigned long)table_hdr + table_hdr->length; in acpi_pptt_leaf_node()
224 if (entry->type == ACPI_PPTT_TYPE_PROCESSOR && in acpi_pptt_leaf_node()
225 cpu_node->parent == node_entry) in acpi_pptt_leaf_node()
227 if (entry->length == 0) in acpi_pptt_leaf_node()
230 entry->length); in acpi_pptt_leaf_node()
237 * acpi_find_processor_node() - Given a PPTT table find the requested processor
258 table_end = (unsigned long)table_hdr + table_hdr->length; in acpi_find_processor_node()
267 if (entry->length == 0) { in acpi_find_processor_node()
271 if (entry->type == ACPI_PPTT_TYPE_PROCESSOR && in acpi_find_processor_node()
272 acpi_cpu_id == cpu_node->acpi_processor_id && in acpi_find_processor_node()
278 entry->length); in acpi_find_processor_node()
339 cpu_node = fetch_pptt_node(table_hdr, cpu_node->parent); in acpi_find_cache_node()
346 * update_cache_properties() - Update cacheinfo for the given processor
365 this_leaf->fw_token = cpu_node; in update_cache_properties()
366 if (found_cache->flags & ACPI_PPTT_SIZE_PROPERTY_VALID) in update_cache_properties()
367 this_leaf->size = found_cache->size; in update_cache_properties()
368 if (found_cache->flags & ACPI_PPTT_LINE_SIZE_VALID) in update_cache_properties()
369 this_leaf->coherency_line_size = found_cache->line_size; in update_cache_properties()
370 if (found_cache->flags & ACPI_PPTT_NUMBER_OF_SETS_VALID) in update_cache_properties()
371 this_leaf->number_of_sets = found_cache->number_of_sets; in update_cache_properties()
372 if (found_cache->flags & ACPI_PPTT_ASSOCIATIVITY_VALID) in update_cache_properties()
373 this_leaf->ways_of_associativity = found_cache->associativity; in update_cache_properties()
374 if (found_cache->flags & ACPI_PPTT_WRITE_POLICY_VALID) { in update_cache_properties()
375 switch (found_cache->attributes & ACPI_PPTT_MASK_WRITE_POLICY) { in update_cache_properties()
377 this_leaf->attributes = CACHE_WRITE_THROUGH; in update_cache_properties()
380 this_leaf->attributes = CACHE_WRITE_BACK; in update_cache_properties()
384 if (found_cache->flags & ACPI_PPTT_ALLOCATION_TYPE_VALID) { in update_cache_properties()
385 switch (found_cache->attributes & ACPI_PPTT_MASK_ALLOCATION_TYPE) { in update_cache_properties()
387 this_leaf->attributes |= CACHE_READ_ALLOCATE; in update_cache_properties()
390 this_leaf->attributes |= CACHE_WRITE_ALLOCATE; in update_cache_properties()
394 this_leaf->attributes |= in update_cache_properties()
409 if (this_leaf->type == CACHE_TYPE_NOCACHE && in update_cache_properties()
410 found_cache->flags & ACPI_PPTT_CACHE_TYPE_VALID) in update_cache_properties()
411 this_leaf->type = CACHE_TYPE_UNIFIED; in update_cache_properties()
413 if (revision >= 3 && (found_cache->flags & ACPI_PPTT_CACHE_ID_VALID)) { in update_cache_properties()
416 this_leaf->id = found_cache_v1->cache_id; in update_cache_properties()
417 this_leaf->attributes |= CACHE_ID; in update_cache_properties()
431 while (index < get_cpu_cacheinfo(cpu)->num_leaves) { in cache_setup_acpi_cpu()
432 this_leaf = this_cpu_ci->info_list + index; in cache_setup_acpi_cpu()
434 this_leaf->type, in cache_setup_acpi_cpu()
435 this_leaf->level, in cache_setup_acpi_cpu()
441 table->revision); in cache_setup_acpi_cpu()
453 if (table_hdr->revision < 2) in flag_identical()
457 if (cpu->flags & ACPI_PPTT_ACPI_IDENTICAL) { in flag_identical()
458 next = fetch_pptt_node(table_hdr, cpu->parent); in flag_identical()
459 if (!(next && next->flags & ACPI_PPTT_ACPI_IDENTICAL)) in flag_identical()
480 } else if (cpu->flags & flag) in acpi_find_processor_tag()
483 prev_node = fetch_pptt_node(table_hdr, cpu->parent); in acpi_find_processor_tag()
487 level--; in acpi_find_processor_tag()
498 * topology_get_acpi_cpu_tag() - Find a unique topology value for a feature
508 * Return: Unique value, or -ENOENT if unable to locate CPU
527 cpu_node->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID) in topology_get_acpi_cpu_tag()
528 return cpu_node->acpi_processor_id; in topology_get_acpi_cpu_tag()
533 return -ENOENT; in topology_get_acpi_cpu_tag()
562 return -ENOENT; in find_acpi_cpu_topology_tag()
572 * check_acpi_cpu_flag() - Determine if CPU node has a flag set
579 * Return: -ENOENT if the PPTT doesn't exist, the CPU cannot be found or
589 int ret = -ENOENT; in check_acpi_cpu_flag()
593 return -ENOENT; in check_acpi_cpu_flag()
595 if (table->revision >= rev) in check_acpi_cpu_flag()
599 ret = (cpu_node->flags & flag) != 0; in check_acpi_cpu_flag()
605 * acpi_find_last_cache_level() - Determines the number of cache levels for a PE
622 return -ENOENT; in acpi_find_last_cache_level()
634 * cache_setup_acpi() - Override CPU cache topology with data from the PPTT
644 * Return: -ENOENT on failure to find table, or 0 on success
652 return -ENOENT; in cache_setup_acpi()
662 * acpi_pptt_cpu_is_thread() - Determine if CPU is a thread
667 * -ENOENT ,if the PPTT doesn't exist, the CPU cannot be found or
676 * find_acpi_cpu_topology() - Determine a unique topology value for a given CPU
680 * Determine a topology unique ID for each thread/core/cluster/mc_grouping
690 * Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found.
699 * find_acpi_cpu_topology_package() - Determine a unique CPU package value
708 * Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found.
718 * find_acpi_cpu_topology_cluster() - Determine a unique CPU cluster value
721 * Determine a topology unique cluster ID for the given CPU/thread.
724 * The cluster, if present is the level of topology above CPUs. In a
725 * multi-thread CPU, it will be the level above the CPU, not the thread.
726 * It may not exist in single CPU systems. In simple multi-CPU systems,
729 * Return: -ENOENT if the PPTT doesn't exist, the CPU cannot be found
744 return -ENOENT; in find_acpi_cpu_topology_cluster()
748 if (!cpu_node || !cpu_node->parent) in find_acpi_cpu_topology_cluster()
749 return -ENOENT; in find_acpi_cpu_topology_cluster()
751 is_thread = cpu_node->flags & ACPI_PPTT_ACPI_PROCESSOR_IS_THREAD; in find_acpi_cpu_topology_cluster()
752 cluster_node = fetch_pptt_node(table, cpu_node->parent); in find_acpi_cpu_topology_cluster()
754 return -ENOENT; in find_acpi_cpu_topology_cluster()
757 if (!cluster_node->parent) in find_acpi_cpu_topology_cluster()
758 return -ENOENT; in find_acpi_cpu_topology_cluster()
760 cluster_node = fetch_pptt_node(table, cluster_node->parent); in find_acpi_cpu_topology_cluster()
762 return -ENOENT; in find_acpi_cpu_topology_cluster()
764 if (cluster_node->flags & ACPI_PPTT_ACPI_PROCESSOR_ID_VALID) in find_acpi_cpu_topology_cluster()
765 retval = cluster_node->acpi_processor_id; in find_acpi_cpu_topology_cluster()
773 * find_acpi_cpu_topology_hetero_id() - Get a core architecture tag
788 * Return: -ENOENT if the PPTT doesn't exist, or the CPU cannot be found.