Lines Matching +full:used +full:- +full:by +full:- +full:rtas
1 // SPDX-License-Identifier: GPL-2.0-or-later
63 [0 ... MAX_NUMNODES - 1] = { [0 ... MAX_NUMNODES - 1] = -1 }
65 static int numa_id_index_table[MAX_NUMNODES] = { [0 ... MAX_NUMNODES - 1] = NUMA_NO_NODE };
141 numa_cpu_lookup_table[cpu] = -1; in reset_numa_cpu_lookup_table()
175 int index = primary_domain_index - 1; in __associativity_to_nid()
188 * Returns nid in the range [0..nr_node_ids], or -1 if no useful NUMA
270 * or -1 if not found.
291 if (nid != -1) in of_node_to_nid()
314 int index = be32_to_cpu(distance_ref_points[i]) - 1; in __initialize_form1_numa_distance()
338 * Used to update distance information w.r.t newly added node.
366 WARN(numa_distance_table[nid][nid] == -1, in update_numa_distance()
371 * ibm,numa-lookup-index-table= {N, domainid1, domainid2, ..... domainidN}
372 * ibm,numa-distance-table = { N, 1, 2, 4, 5, 1, 6, .... N elements}
386 root = of_find_node_by_path("/rtas"); in initialize_form2_numa_distance_lookup_table()
390 numa_lookup_index = of_get_property(root, "ibm,numa-lookup-index-table", NULL); in initialize_form2_numa_distance_lookup_table()
393 /* first element of the array is the size and is encode-int */ in initialize_form2_numa_distance_lookup_table()
394 form2_distances = of_get_property(root, "ibm,numa-distance-table", NULL); in initialize_form2_numa_distance_lookup_table()
454 root = of_find_node_by_path("/rtas"); in find_primary_domain_index()
459 * This property is a set of 32-bit integers, each representing in find_primary_domain_index()
471 "ibm,associativity-reference-points", in find_primary_domain_index()
475 pr_debug("ibm,associativity-reference-points not found.\n"); in find_primary_domain_index()
482 pr_warn("short ibm,associativity-reference-points\n"); in find_primary_domain_index()
509 return -1; in find_primary_domain_index()
529 while (n--) { in read_n_cells()
544 * memory from the ibm,associativity-lookup-arrays property of the
547 * The layout of the ibm,associativity-lookup-arrays property is a number N
548 * indicating the number of associativity arrays, followed by a number M
549 * indicating the size of each associativity array, followed by a list
558 memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); in of_get_assoc_arrays()
560 return -1; in of_get_assoc_arrays()
562 prop = of_get_property(memory, "ibm,associativity-lookup-arrays", &len); in of_get_assoc_arrays()
565 return -1; in of_get_assoc_arrays()
568 aa->n_arrays = of_read_number(prop++, 1); in of_get_assoc_arrays()
569 aa->array_sz = of_read_number(prop++, 1); in of_get_assoc_arrays()
576 if (len < (aa->n_arrays * aa->array_sz + 2) * sizeof(unsigned int)) in of_get_assoc_arrays()
577 return -1; in of_get_assoc_arrays()
579 aa->arrays = prop; in of_get_assoc_arrays()
598 !(lmb->flags & DRCONF_MEM_AI_INVALID) && lmb->aa_index < aa.n_arrays) { in get_nid_and_numa_distance()
601 index = lmb->aa_index * aa.array_sz; in get_nid_and_numa_distance()
617 * ibm,dynamic-reconfiguration-memory node.
634 !(lmb->flags & DRCONF_MEM_AI_INVALID) && lmb->aa_index < aa.n_arrays) { in of_drconf_to_nid_single()
637 index = lmb->aa_index * aa.array_sz; in of_drconf_to_nid_single()
670 return -1; in __vphn_get_associativity()
688 return -1; in __vphn_get_associativity()
699 * Return the id of the domain used.
713 * If a valid cpu-to-node mapping is already available, use it in numa_setup_cpu()
715 * the most recent mapping notified to us by the platform (eg: VPHN). in numa_setup_cpu()
717 * core. If a valid cpu-to-node mapping is already available, for in numa_setup_cpu()
825 return memblock_end_of_DRAM() - start; in numa_enforce_memory_limit()
830 * linux,drconf-usable-memory property
835 * For each lmb in ibm,dynamic-memory a corresponding in read_usm_ranges()
836 * entry in linux,drconf-usable-memory property contains in read_usm_ranges()
837 * a counter followed by that many (base, size) duple. in read_usm_ranges()
838 * read the counter from linux,drconf-usable-memory in read_usm_ranges()
844 * Extract NUMA information from the ibm,dynamic-reconfiguration-memory
859 if ((lmb->flags & DRCONF_MEM_RESERVED) in numa_setup_drmem_lmb()
860 || !(lmb->flags & DRCONF_MEM_ASSIGNED)) in numa_setup_drmem_lmb()
866 base = lmb->base_addr; in numa_setup_drmem_lmb()
889 } while (--ranges); in numa_setup_drmem_lmb()
902 pr_warn("disabled by user\n"); in parse_numa_properties()
903 return -1; in parse_numa_properties()
943 * Don't fall back to default_nid yet -- we will plug in parse_numa_properties()
974 "linux,usable-memory", &len); in parse_numa_properties()
983 /* these are order-sensitive, and modify the buffer pointer */ in parse_numa_properties()
1006 if (--ranges) in parse_numa_properties()
1012 * ibm,dynamic-memory property in the in parse_numa_properties()
1013 * ibm,dynamic-reconfiguration-memory node. in parse_numa_properties()
1015 memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); in parse_numa_properties()
1033 pr_debug("Memory hole size: %ldMB\n", (top_of_ram - total_ram) >> 20); in setup_nonnuma()
1038 PFN_PHYS(end_pfn - start_pfn), in setup_nonnuma()
1057 * If we used a CPU iterator here we would miss printing in dump_numa_cpu_topology()
1068 pr_cont("-%u", cpu - 1); in dump_numa_cpu_topology()
1074 pr_cont("-%u", nr_cpu_ids - 1); in dump_numa_cpu_topology()
1082 u64 spanned_pages = end_pfn - start_pfn; in setup_node_data()
1096 pr_info(" NODE_DATA [mem %#010Lx-%#010Lx]\n", in setup_node_data()
1097 nd_pa, nd_pa + nd_size - 1); in setup_node_data()
1104 NODE_DATA(nid)->node_id = nid; in setup_node_data()
1105 NODE_DATA(nid)->node_start_pfn = start_pfn; in setup_node_data()
1106 NODE_DATA(nid)->node_spanned_pages = spanned_pages; in setup_node_data()
1111 struct device_node *rtas; in find_possible_nodes() local
1119 rtas = of_find_node_by_path("/rtas"); in find_possible_nodes()
1120 if (!rtas) in find_possible_nodes()
1124 * ibm,current-associativity-domains is a fairly recent property. If in find_possible_nodes()
1125 * it doesn't exist, then fallback on ibm,max-associativity-domains. in find_possible_nodes()
1132 if (!of_get_property(of_root, "ibm,migratable-partition", NULL)) in find_possible_nodes()
1133 domains = of_get_property(rtas, in find_possible_nodes()
1134 "ibm,current-associativity-domains", in find_possible_nodes()
1137 domains = of_get_property(rtas, "ibm,max-associativity-domains", in find_possible_nodes()
1156 of_node_put(rtas); in find_possible_nodes()
1195 * Powerpc with CONFIG_NUMA always used to have a node 0, in mem_topology_setup()
1225 * _nocalls() + manual invocation is used because cpuhp is not yet in initmem_init()
1251 * memory represented in the device tree by the property
1252 * ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory.
1265 if ((lmb->flags & DRCONF_MEM_RESERVED) in hot_add_drconf_scn_to_nid()
1266 || !(lmb->flags & DRCONF_MEM_ASSIGNED)) in hot_add_drconf_scn_to_nid()
1269 if ((scn_addr < lmb->base_addr) in hot_add_drconf_scn_to_nid()
1270 || (scn_addr >= (lmb->base_addr + lmb_size))) in hot_add_drconf_scn_to_nid()
1303 while (ranges--) { in hot_add_node_scn_to_nid()
1336 memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); in hot_add_scn_to_nid()
1356 dn = of_find_node_by_path("/rtas"); in hot_add_drconf_memory_max()
1358 lrdr = of_get_property(dn, "ibm,lrdr-capacity", NULL); in hot_add_drconf_memory_max()
1364 memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); in hot_add_drconf_memory_max()
1373 * memory_hotplug_max - return max address of memory that may be added
1375 * This is currently only used on systems that support drconfig memory
1440 // Associate node <-> cpu, so cpu_up() calls in find_and_update_cpu_nid()
1453 return -1; in cpu_to_coregroup_id()
1466 return of_read_number(&associativity[index - 1], 1); in cpu_to_coregroup_id()