NODE_DATA(nid)->node_spanned_pages = spanned_pages;
 }
 
+static void __init find_possible_nodes(void)
+{
+       struct device_node *rtas;
+       u32 numnodes, i;
+
+       if (min_common_depth <= 0)
+               return;
+
+       rtas = of_find_node_by_path("/rtas");
+       if (!rtas)
+               return;
+
+       if (of_property_read_u32_index(rtas,
+                               "ibm,max-associativity-domains",
+                               min_common_depth, &numnodes))
+               goto out;
+
+       for (i = 0; i < numnodes; i++) {
+               if (!node_possible(i)) {
+                       setup_node_data(i, 0, 0);
+                       node_set(i, node_possible_map);
+               }
+       }
+
+out:
+       of_node_put(rtas);
+}
+
 void __init initmem_init(void)
 {
        int nid, cpu;
        memblock_dump_all();
 
        /*
-        * Reduce the possible NUMA nodes to the online NUMA nodes,
-        * since we do not support node hotplug. This ensures that  we
-        * lower the maximum NUMA node ID to what is actually present.
+        * Modify the set of possible NUMA nodes to reflect information
+        * available about the set of online nodes, and the set of nodes
+        * that we expect to make use of for this platform's affinity
+        * calculations.
         */
        nodes_and(node_possible_map, node_possible_map, node_online_map);
 
+       find_possible_nodes();
+
        for_each_online_node(nid) {
                unsigned long start_pfn, end_pfn;