Lines Matching full:target
95 struct memory_target *target; in find_mem_target() local
97 list_for_each_entry(target, &targets, node) in find_mem_target()
98 if (target->memory_pxm == mem_pxm) in find_mem_target()
99 return target; in find_mem_target()
126 struct memory_target *target; in alloc_memory_target() local
128 target = find_mem_target(mem_pxm); in alloc_memory_target()
129 if (!target) { in alloc_memory_target()
130 target = kzalloc(sizeof(*target), GFP_KERNEL); in alloc_memory_target()
131 if (!target) in alloc_memory_target()
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()
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()
226 static void hmat_update_target_access(struct memory_target *target, in hmat_update_target_access() argument
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()
298 struct memory_target *target; in hmat_parse_locality() local
322 pr_info("HMAT: Locality: Flags:%02x Type:%s Initiator Domains:%u Target Domains:%u Base:%lld\n", in hmat_parse_locality()
335 pr_info(" Initiator-Target[%u-%u]:%u%s\n", in hmat_parse_locality()
340 target = find_mem_target(targs[targ]); in hmat_parse_locality()
341 if (target && target->processor_pxm == inits[init]) { in hmat_parse_locality()
342 hmat_update_target_access(target, type, value, 0); in hmat_parse_locality()
345 hmat_update_target_access(target, type, value, 1); in hmat_parse_locality()
361 struct memory_target *target; in hmat_parse_cache() local
376 target = find_mem_target(cache->memory_PD); in hmat_parse_cache()
377 if (!target) in hmat_parse_cache()
415 list_add_tail(&tcache->node, &target->caches); in hmat_parse_cache()
424 struct memory_target *target = NULL; in hmat_parse_proximity_domain() local
442 target = find_mem_target(p->memory_PD); in hmat_parse_proximity_domain()
443 if (!target) { in hmat_parse_proximity_domain()
448 if (target && p->flags & ACPI_HMAT_PROCESSOR_PD_VALID) { in hmat_parse_proximity_domain()
455 target->processor_pxm = p->processor_PD; in hmat_parse_proximity_domain()
494 static u32 hmat_initiator_perf(struct memory_target *target, in hmat_initiator_perf() argument
519 if (targs[i] == target->memory_pxm) { in hmat_initiator_perf()
576 static void hmat_register_target_initiators(struct memory_target *target) in hmat_register_target_initiators() argument
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()
626 value = hmat_initiator_perf(target, initiator, in hmat_register_target_initiators()
634 hmat_update_target_access(target, loc->hmat_loc->data_type, in hmat_register_target_initiators()
664 value = hmat_initiator_perf(target, initiator, loc->hmat_loc); in hmat_register_target_initiators()
671 hmat_update_target_access(target, loc->hmat_loc->data_type, best, 1); in hmat_register_target_initiators()
679 static void hmat_register_target_cache(struct memory_target *target) in hmat_register_target_cache() argument
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()
688 static void hmat_register_target_perf(struct memory_target *target, int access) in hmat_register_target_perf() argument
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()
694 static void hmat_register_target_devices(struct memory_target *target) in hmat_register_target_devices() argument
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()
712 static void hmat_register_target(struct memory_target *target) in hmat_register_target() argument
714 int nid = pxm_to_node(target->memory_pxm); in hmat_register_target()
720 hmat_register_target_devices(target); in hmat_register_target()
733 if (!target->registered) { in hmat_register_target()
734 hmat_register_target_initiators(target); in hmat_register_target()
735 hmat_register_target_cache(target); in hmat_register_target()
736 hmat_register_target_perf(target, 0); in hmat_register_target()
737 hmat_register_target_perf(target, 1); in hmat_register_target()
738 target->registered = true; in hmat_register_target()
745 struct memory_target *target; in hmat_register_targets() local
747 list_for_each_entry(target, &targets, node) in hmat_register_targets()
748 hmat_register_target(target); in hmat_register_targets()
754 struct memory_target *target; in hmat_callback() local
762 target = find_mem_target(pxm); in hmat_callback()
763 if (!target) in hmat_callback()
766 hmat_register_target(target); in hmat_callback()
777 struct memory_target *target, *tnext; in hmat_free_structures() local
782 list_for_each_entry_safe(target, tnext, &targets, node) { in hmat_free_structures()
785 list_for_each_entry_safe(tcache, cnext, &target->caches, node) { in hmat_free_structures()
790 list_del(&target->node); in hmat_free_structures()
791 res = target->memregions.child; in hmat_free_structures()
794 __release_region(&target->memregions, res->start, in hmat_free_structures()
798 kfree(target); in hmat_free_structures()