Lines Matching +full:locality +full:- +full:specific
1 // SPDX-License-Identifier: GPL-2.0
88 if (initiator->processor_pxm == cpu_pxm) in find_mem_initiator()
98 if (target->memory_pxm == mem_pxm) in find_mem_target()
118 initiator->processor_pxm = cpu_pxm; in alloc_memory_initiator()
119 initiator->has_cpu = node_state(pxm_to_node(cpu_pxm), N_CPU); in alloc_memory_initiator()
120 list_add_tail(&initiator->node, &initiators); in alloc_memory_initiator()
133 target->memory_pxm = mem_pxm; in alloc_memory_target()
134 target->processor_pxm = PXM_INVAL; in alloc_memory_target()
135 target->memregions = (struct resource) { in alloc_memory_target()
138 .end = -1, in alloc_memory_target()
141 list_add_tail(&target->node, &targets); in alloc_memory_target()
142 INIT_LIST_HEAD(&target->caches); in alloc_memory_target()
147 * in the per-target memregions resource tree. in alloc_memory_target()
149 if (!__request_region(&target->memregions, start, len, "memory target", in alloc_memory_target()
151 pr_warn("failed to reserve %#llx - %#llx in pxm: %d\n", in alloc_memory_target()
231 target->hmem_attrs[access].read_latency = value; in hmat_update_target_access()
232 target->hmem_attrs[access].write_latency = value; in hmat_update_target_access()
235 target->hmem_attrs[access].read_latency = value; in hmat_update_target_access()
238 target->hmem_attrs[access].write_latency = value; in hmat_update_target_access()
241 target->hmem_attrs[access].read_bandwidth = value; in hmat_update_target_access()
242 target->hmem_attrs[access].write_bandwidth = value; in hmat_update_target_access()
245 target->hmem_attrs[access].read_bandwidth = value; in hmat_update_target_access()
248 target->hmem_attrs[access].write_bandwidth = value; in hmat_update_target_access()
261 pr_notice_once("Failed to allocate HMAT locality\n"); in hmat_add_locality()
265 loc->hmat_loc = hmat_loc; in hmat_add_locality()
266 list_add_tail(&loc->node, &localities); in hmat_add_locality()
268 switch (hmat_loc->data_type) { in hmat_add_locality()
304 if (hmat_loc->header.length < sizeof(*hmat_loc)) { in hmat_parse_locality()
305 pr_notice("HMAT: Unexpected locality header length: %u\n", in hmat_parse_locality()
306 hmat_loc->header.length); in hmat_parse_locality()
307 return -EINVAL; in hmat_parse_locality()
310 type = hmat_loc->data_type; in hmat_parse_locality()
311 mem_hier = hmat_loc->flags & ACPI_HMAT_MEMORY_HIERARCHY; in hmat_parse_locality()
312 ipds = hmat_loc->number_of_initiator_Pds; in hmat_parse_locality()
313 tpds = hmat_loc->number_of_target_Pds; in hmat_parse_locality()
316 if (hmat_loc->header.length < total_size) { in hmat_parse_locality()
317 pr_notice("HMAT: Unexpected locality header length:%u, minimum required:%u\n", in hmat_parse_locality()
318 hmat_loc->header.length, total_size); in hmat_parse_locality()
319 return -EINVAL; in hmat_parse_locality()
322 pr_info("HMAT: Locality: Flags:%02x Type:%s Initiator Domains:%u Target Domains:%u Base:%lld\n", in hmat_parse_locality()
323 hmat_loc->flags, hmat_data_type(type), ipds, tpds, in hmat_parse_locality()
324 hmat_loc->entry_base_unit); in hmat_parse_locality()
333 hmat_loc->entry_base_unit, in hmat_parse_locality()
335 pr_info(" Initiator-Target[%u-%u]:%u%s\n", in hmat_parse_locality()
341 if (target && target->processor_pxm == inits[init]) { in hmat_parse_locality()
365 if (cache->header.length < sizeof(*cache)) { in hmat_parse_cache()
367 cache->header.length); in hmat_parse_cache()
368 return -EINVAL; in hmat_parse_cache()
371 attrs = cache->cache_attributes; in hmat_parse_cache()
373 cache->memory_PD, cache->cache_size, attrs, in hmat_parse_cache()
374 cache->number_of_SMBIOShandles); in hmat_parse_cache()
376 target = find_mem_target(cache->memory_PD); in hmat_parse_cache()
386 tcache->cache_attrs.size = cache->cache_size; in hmat_parse_cache()
387 tcache->cache_attrs.level = (attrs & ACPI_HMAT_CACHE_LEVEL) >> 4; in hmat_parse_cache()
388 tcache->cache_attrs.line_size = (attrs & ACPI_HMAT_CACHE_LINE_SIZE) >> 16; in hmat_parse_cache()
392 tcache->cache_attrs.indexing = NODE_CACHE_DIRECT_MAP; in hmat_parse_cache()
395 tcache->cache_attrs.indexing = NODE_CACHE_INDEXED; in hmat_parse_cache()
399 tcache->cache_attrs.indexing = NODE_CACHE_OTHER; in hmat_parse_cache()
405 tcache->cache_attrs.write_policy = NODE_CACHE_WRITE_BACK; in hmat_parse_cache()
408 tcache->cache_attrs.write_policy = NODE_CACHE_WRITE_THROUGH; in hmat_parse_cache()
412 tcache->cache_attrs.write_policy = NODE_CACHE_WRITE_OTHER; in hmat_parse_cache()
415 list_add_tail(&tcache->node, &target->caches); in hmat_parse_cache()
426 if (p->header.length != sizeof(*p)) { in hmat_parse_proximity_domain()
428 p->header.length); in hmat_parse_proximity_domain()
429 return -EINVAL; in hmat_parse_proximity_domain()
434 p->reserved3, p->reserved4, p->flags, p->processor_PD, in hmat_parse_proximity_domain()
435 p->memory_PD); in hmat_parse_proximity_domain()
438 p->flags, p->processor_PD, p->memory_PD); in hmat_parse_proximity_domain()
440 if ((hmat_revision == 1 && p->flags & ACPI_HMAT_MEMORY_PD_VALID) || in hmat_parse_proximity_domain()
442 target = find_mem_target(p->memory_PD); in hmat_parse_proximity_domain()
445 return -EINVAL; in hmat_parse_proximity_domain()
448 if (target && p->flags & ACPI_HMAT_PROCESSOR_PD_VALID) { in hmat_parse_proximity_domain()
449 int p_node = pxm_to_node(p->processor_PD); in hmat_parse_proximity_domain()
453 return -EINVAL; in hmat_parse_proximity_domain()
455 target->processor_pxm = p->processor_PD; in hmat_parse_proximity_domain()
467 return -EINVAL; in hmat_parse_subtable()
469 switch (hdr->type) { in hmat_parse_subtable()
477 return -EINVAL; in hmat_parse_subtable()
487 return -EINVAL; in srat_parse_mem_affinity()
488 if (!(ma->flags & ACPI_SRAT_MEM_ENABLED)) in srat_parse_mem_affinity()
490 alloc_memory_target(ma->proximity_domain, ma->base_address, ma->length); in srat_parse_mem_affinity()
502 ipds = hmat_loc->number_of_initiator_Pds; in hmat_initiator_perf()
503 tpds = hmat_loc->number_of_target_Pds; in hmat_initiator_perf()
509 if (inits[i] == initiator->processor_pxm) { in hmat_initiator_perf()
519 if (targs[i] == target->memory_pxm) { in hmat_initiator_perf()
528 hmat_loc->entry_base_unit, in hmat_initiator_perf()
529 hmat_loc->data_type); in hmat_initiator_perf()
570 set_bit(ia->processor_pxm, p_nodes); in initiator_cmp()
571 set_bit(ib->processor_pxm, p_nodes); in initiator_cmp()
573 return ia->processor_pxm - ib->processor_pxm; in initiator_cmp()
586 mem_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_initiators()
592 if (target->processor_pxm != PXM_INVAL) { in hmat_register_target_initiators()
593 cpu_nid = pxm_to_node(target->processor_pxm); in hmat_register_target_initiators()
623 if (!test_bit(initiator->processor_pxm, p_nodes)) in hmat_register_target_initiators()
627 loc->hmat_loc); in hmat_register_target_initiators()
628 if (hmat_update_best(loc->hmat_loc->data_type, value, &best)) in hmat_register_target_initiators()
629 bitmap_clear(p_nodes, 0, initiator->processor_pxm); in hmat_register_target_initiators()
631 clear_bit(initiator->processor_pxm, p_nodes); in hmat_register_target_initiators()
634 hmat_update_target_access(target, loc->hmat_loc->data_type, in hmat_register_target_initiators()
657 if (!initiator->has_cpu) { in hmat_register_target_initiators()
658 clear_bit(initiator->processor_pxm, p_nodes); in hmat_register_target_initiators()
661 if (!test_bit(initiator->processor_pxm, p_nodes)) in hmat_register_target_initiators()
664 value = hmat_initiator_perf(target, initiator, loc->hmat_loc); in hmat_register_target_initiators()
665 if (hmat_update_best(loc->hmat_loc->data_type, value, &best)) in hmat_register_target_initiators()
666 bitmap_clear(p_nodes, 0, initiator->processor_pxm); in hmat_register_target_initiators()
668 clear_bit(initiator->processor_pxm, p_nodes); in hmat_register_target_initiators()
671 hmat_update_target_access(target, loc->hmat_loc->data_type, best, 1); in hmat_register_target_initiators()
681 unsigned mem_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_cache()
684 list_for_each_entry(tcache, &target->caches, node) in hmat_register_target_cache()
685 node_add_cache(mem_nid, &tcache->cache_attrs); in hmat_register_target_cache()
690 unsigned mem_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_perf()
691 node_set_perf_attrs(mem_nid, &target->hmem_attrs[access], access); in hmat_register_target_perf()
705 for (res = target->memregions.child; res; res = res->sibling) { in hmat_register_target_devices()
706 int target_nid = pxm_to_node(target->memory_pxm); in hmat_register_target_devices()
714 int nid = pxm_to_node(target->memory_pxm); in hmat_register_target()
724 * marked EFI_MEMORY_SP, "specific purpose", is applied in hmat_register_target()
727 * memory-only "hotplug" node is offline. in hmat_register_target()
733 if (!target->registered) { in hmat_register_target()
738 target->registered = true; in hmat_register_target()
756 int pxm, nid = mnb->status_change_nid; in hmat_callback()
785 list_for_each_entry_safe(tcache, cnext, &target->caches, node) { in hmat_free_structures()
786 list_del(&tcache->node); in hmat_free_structures()
790 list_del(&target->node); in hmat_free_structures()
791 res = target->memregions.child; in hmat_free_structures()
793 res_next = res->sibling; in hmat_free_structures()
794 __release_region(&target->memregions, res->start, in hmat_free_structures()
802 list_del(&initiator->node); in hmat_free_structures()
807 list_del(&loc->node); in hmat_free_structures()
836 hmat_revision = tbl->revision; in hmat_init()