Lines Matching +full:locality +full:- +full:specific
1 // SPDX-License-Identifier: GPL-2.0
27 #include <linux/memory-tiers.h>
96 if (initiator->processor_pxm == cpu_pxm) in find_mem_initiator()
106 if (target->memory_pxm == mem_pxm) in find_mem_target()
118 uid_ptr = target->gen_port_device_handle + 8; in acpi_find_genport_target()
128 * acpi_get_genport_coordinates - Retrieve the access coordinates for a generic port
144 return -ENOENT; in acpi_get_genport_coordinates()
146 *coord = target->coord[NODE_ACCESS_CLASS_GENPORT_SINK]; in acpi_get_genport_coordinates()
167 initiator->processor_pxm = cpu_pxm; in alloc_memory_initiator()
168 initiator->has_cpu = node_state(pxm_to_node(cpu_pxm), N_CPU); in alloc_memory_initiator()
169 list_add_tail(&initiator->node, &initiators); in alloc_memory_initiator()
181 target->memory_pxm = mem_pxm; in alloc_target()
182 target->processor_pxm = PXM_INVAL; in alloc_target()
183 target->memregions = (struct resource) { in alloc_target()
186 .end = -1, in alloc_target()
189 list_add_tail(&target->node, &targets); in alloc_target()
190 INIT_LIST_HEAD(&target->caches); in alloc_target()
208 * in the per-target memregions resource tree. in alloc_memory_target()
210 if (!__request_region(&target->memregions, start, len, "memory target", in alloc_memory_target()
212 pr_warn("failed to reserve %#llx - %#llx in pxm: %d\n", in alloc_memory_target()
224 memcpy(target->gen_port_device_handle, handle, in alloc_genport_target()
304 target->coord[access].read_latency = value; in hmat_update_target_access()
305 target->coord[access].write_latency = value; in hmat_update_target_access()
308 target->coord[access].read_latency = value; in hmat_update_target_access()
311 target->coord[access].write_latency = value; in hmat_update_target_access()
314 target->coord[access].read_bandwidth = value; in hmat_update_target_access()
315 target->coord[access].write_bandwidth = value; in hmat_update_target_access()
318 target->coord[access].read_bandwidth = value; in hmat_update_target_access()
321 target->coord[access].write_bandwidth = value; in hmat_update_target_access()
334 pr_notice_once("Failed to allocate HMAT locality\n"); in hmat_add_locality()
338 loc->hmat_loc = hmat_loc; in hmat_add_locality()
339 list_add_tail(&loc->node, &localities); in hmat_add_locality()
341 switch (hmat_loc->data_type) { in hmat_add_locality()
375 if (target && target->processor_pxm == init_pxm) { in hmat_update_target()
394 if (hmat_loc->header.length < sizeof(*hmat_loc)) { in hmat_parse_locality()
395 pr_notice("Unexpected locality header length: %u\n", in hmat_parse_locality()
396 hmat_loc->header.length); in hmat_parse_locality()
397 return -EINVAL; in hmat_parse_locality()
400 type = hmat_loc->data_type; in hmat_parse_locality()
401 mem_hier = hmat_loc->flags & ACPI_HMAT_MEMORY_HIERARCHY; in hmat_parse_locality()
402 ipds = hmat_loc->number_of_initiator_Pds; in hmat_parse_locality()
403 tpds = hmat_loc->number_of_target_Pds; in hmat_parse_locality()
406 if (hmat_loc->header.length < total_size) { in hmat_parse_locality()
407 pr_notice("Unexpected locality header length:%u, minimum required:%u\n", in hmat_parse_locality()
408 hmat_loc->header.length, total_size); in hmat_parse_locality()
409 return -EINVAL; in hmat_parse_locality()
412 pr_info("Locality: Flags:%02x Type:%s Initiator Domains:%u Target Domains:%u Base:%lld\n", in hmat_parse_locality()
413 hmat_loc->flags, hmat_data_type(type), ipds, tpds, in hmat_parse_locality()
414 hmat_loc->entry_base_unit); in hmat_parse_locality()
423 hmat_loc->entry_base_unit, in hmat_parse_locality()
425 pr_info(" Initiator-Target[%u-%u]:%u%s\n", in hmat_parse_locality()
448 if (cache->header.length < sizeof(*cache)) { in hmat_parse_cache()
450 cache->header.length); in hmat_parse_cache()
451 return -EINVAL; in hmat_parse_cache()
454 attrs = cache->cache_attributes; in hmat_parse_cache()
456 cache->memory_PD, cache->cache_size, attrs, in hmat_parse_cache()
457 cache->number_of_SMBIOShandles); in hmat_parse_cache()
459 target = find_mem_target(cache->memory_PD); in hmat_parse_cache()
469 tcache->cache_attrs.size = cache->cache_size; in hmat_parse_cache()
470 tcache->cache_attrs.level = (attrs & ACPI_HMAT_CACHE_LEVEL) >> 4; in hmat_parse_cache()
471 tcache->cache_attrs.line_size = (attrs & ACPI_HMAT_CACHE_LINE_SIZE) >> 16; in hmat_parse_cache()
475 tcache->cache_attrs.indexing = NODE_CACHE_DIRECT_MAP; in hmat_parse_cache()
478 tcache->cache_attrs.indexing = NODE_CACHE_INDEXED; in hmat_parse_cache()
482 tcache->cache_attrs.indexing = NODE_CACHE_OTHER; in hmat_parse_cache()
488 tcache->cache_attrs.write_policy = NODE_CACHE_WRITE_BACK; in hmat_parse_cache()
491 tcache->cache_attrs.write_policy = NODE_CACHE_WRITE_THROUGH; in hmat_parse_cache()
495 tcache->cache_attrs.write_policy = NODE_CACHE_WRITE_OTHER; in hmat_parse_cache()
498 list_add_tail(&tcache->node, &target->caches); in hmat_parse_cache()
509 if (p->header.length != sizeof(*p)) { in hmat_parse_proximity_domain()
511 p->header.length); in hmat_parse_proximity_domain()
512 return -EINVAL; in hmat_parse_proximity_domain()
517 p->reserved3, p->reserved4, p->flags, p->processor_PD, in hmat_parse_proximity_domain()
518 p->memory_PD); in hmat_parse_proximity_domain()
521 p->flags, p->processor_PD, p->memory_PD); in hmat_parse_proximity_domain()
523 if ((hmat_revision == 1 && p->flags & ACPI_HMAT_MEMORY_PD_VALID) || in hmat_parse_proximity_domain()
525 target = find_mem_target(p->memory_PD); in hmat_parse_proximity_domain()
528 return -EINVAL; in hmat_parse_proximity_domain()
531 if (target && p->flags & ACPI_HMAT_PROCESSOR_PD_VALID) { in hmat_parse_proximity_domain()
532 int p_node = pxm_to_node(p->processor_PD); in hmat_parse_proximity_domain()
536 return -EINVAL; in hmat_parse_proximity_domain()
538 target->processor_pxm = p->processor_PD; in hmat_parse_proximity_domain()
550 return -EINVAL; in hmat_parse_subtable()
552 switch (hdr->type) { in hmat_parse_subtable()
560 return -EINVAL; in hmat_parse_subtable()
570 return -EINVAL; in srat_parse_mem_affinity()
571 if (!(ma->flags & ACPI_SRAT_MEM_ENABLED)) in srat_parse_mem_affinity()
573 alloc_memory_target(ma->proximity_domain, ma->base_address, ma->length); in srat_parse_mem_affinity()
583 return -EINVAL; in srat_parse_genport_affinity()
585 if (!(ga->flags & ACPI_SRAT_GENERIC_AFFINITY_ENABLED)) in srat_parse_genport_affinity()
589 if (ga->device_handle_type != 0) in srat_parse_genport_affinity()
592 alloc_genport_target(ga->proximity_domain, in srat_parse_genport_affinity()
593 (u8 *)ga->device_handle); in srat_parse_genport_affinity()
606 ipds = hmat_loc->number_of_initiator_Pds; in hmat_initiator_perf()
607 tpds = hmat_loc->number_of_target_Pds; in hmat_initiator_perf()
613 if (inits[i] == initiator->processor_pxm) { in hmat_initiator_perf()
623 if (targs[i] == target->memory_pxm) { in hmat_initiator_perf()
632 hmat_loc->entry_base_unit, in hmat_initiator_perf()
633 hmat_loc->data_type); in hmat_initiator_perf()
674 return ia->processor_pxm - ib->processor_pxm; in initiator_cmp()
682 return -ENXIO; in initiators_to_nodemask()
685 set_bit(initiator->processor_pxm, p_nodes); in initiators_to_nodemask()
701 !(*(u16 *)target->gen_port_device_handle)) in hmat_update_target_attrs()
710 if (target->processor_pxm != PXM_INVAL) { in hmat_update_target_attrs()
711 cpu_nid = pxm_to_node(target->processor_pxm); in hmat_update_target_attrs()
713 set_bit(target->processor_pxm, p_nodes); in hmat_update_target_attrs()
740 if (access == 1 && !initiator->has_cpu) { in hmat_update_target_attrs()
741 clear_bit(initiator->processor_pxm, p_nodes); in hmat_update_target_attrs()
744 if (!test_bit(initiator->processor_pxm, p_nodes)) in hmat_update_target_attrs()
747 value = hmat_initiator_perf(target, initiator, loc->hmat_loc); in hmat_update_target_attrs()
748 if (hmat_update_best(loc->hmat_loc->data_type, value, &best)) in hmat_update_target_attrs()
749 bitmap_clear(p_nodes, 0, initiator->processor_pxm); in hmat_update_target_attrs()
751 clear_bit(initiator->processor_pxm, p_nodes); in hmat_update_target_attrs()
754 hmat_update_target_access(target, loc->hmat_loc->data_type, best, access); in hmat_update_target_attrs()
765 mem_nid = pxm_to_node(target->memory_pxm); in __hmat_register_target_initiators()
791 unsigned mem_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_cache()
794 list_for_each_entry(tcache, &target->caches, node) in hmat_register_target_cache()
795 node_add_cache(mem_nid, &tcache->cache_attrs); in hmat_register_target_cache()
800 unsigned mem_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_perf()
801 node_set_perf_attrs(mem_nid, &target->coord[access], access); in hmat_register_target_perf()
815 for (res = target->memregions.child; res; res = res->sibling) { in hmat_register_target_devices()
816 int target_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_devices()
824 int nid = pxm_to_node(target->memory_pxm); in hmat_register_target()
837 if (*(u16 *)target->gen_port_device_handle) { in hmat_register_target()
839 target->registered = true; in hmat_register_target()
845 * marked EFI_MEMORY_SP, "specific purpose", is applied in hmat_register_target()
848 * memory-only "hotplug" node is offline. in hmat_register_target()
854 if (!target->registered) { in hmat_register_target()
859 target->registered = true; in hmat_register_target()
877 int pxm, nid = mnb->status_change_nid; in hmat_callback()
899 return -EIO; in hmat_set_default_dram_perf()
901 for_each_node_mask(nid, default_dram_type->nodes) { in hmat_set_default_dram_perf()
906 attrs = &target->coord[1]; in hmat_set_default_dram_perf()
933 perf = &target->coord[1]; in hmat_calculate_adistance()
956 list_for_each_entry_safe(tcache, cnext, &target->caches, node) { in hmat_free_structures()
957 list_del(&tcache->node); in hmat_free_structures()
961 list_del(&target->node); in hmat_free_structures()
962 res = target->memregions.child; in hmat_free_structures()
964 res_next = res->sibling; in hmat_free_structures()
965 __release_region(&target->memregions, res->start, in hmat_free_structures()
973 list_del(&initiator->node); in hmat_free_structures()
978 list_del(&loc->node); in hmat_free_structures()
1014 hmat_revision = tbl->revision; in hmat_init()