--- initial
+++ final
@@ -1,86 +1,86 @@
 void __init smp_setup_cpu_maps(void) {
   struct device_node *dn;
   int cpu = 0;
   int nthreads = 1;
   DBG("smp_setup_cpu_maps()\n");
-  cpu_to_phys_id = __va(memblock_alloc(nr_cpu_ids * sizeof(u32), __alignof__(u32)));
+  cpu_to_phys_id = __va(memblock_phys_alloc(nr_cpu_ids * sizeof(u32), __alignof__(u32)));
   memset(cpu_to_phys_id, 0, nr_cpu_ids * sizeof(u32));
   for_each_node_by_type(dn, "cpu") {
     const __be32 *intserv;
     __be32 cpu_be;
     int j, len;
     DBG("  * %pOF...\n", dn);
     intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len);
     if (intserv) {
       DBG("    ibm,ppc-interrupt-server#s -> %d threads\n", nthreads);
     } else {
       DBG("    no ibm,ppc-interrupt-server#s -> 1 thread\n");
       intserv = of_get_property(dn, "reg", &len);
       if (!intserv) {
         cpu_be = cpu_to_be32(cpu);
         /* XXX: what is this? uninitialized?? */
         intserv = &cpu_be; /* assume logical == phys */
         len = 4;
       }
     }
     nthreads = len / sizeof(int);
     for (j = 0; j < nthreads && cpu < nr_cpu_ids; j++) {
       bool avail;
       DBG("    thread %d -> cpu %d (hard id %d)\n", j, cpu, be32_to_cpu(intserv[j]));
       avail = of_device_is_available(dn);
       if (!avail) avail = !of_property_match_string(dn, "enable-method", "spin-table");
       set_cpu_present(cpu, avail);
       set_cpu_possible(cpu, true);
       cpu_to_phys_id[cpu] = be32_to_cpu(intserv[j]);
       cpu++;
     }
     if (cpu >= nr_cpu_ids) {
       of_node_put(dn);
       break;
     }
   }
   /* If no SMT supported, nthreads is forced to 1 */
   if (!cpu_has_feature(CPU_FTR_SMT)) {
     DBG("  SMT disabled ! nthreads forced to 1\n");
     nthreads = 1;
   }
 #ifdef CONFIG_PPC64
   /*
    * On pSeries LPAR, we need to know how many cpus
    * could possibly be added to this partition.
    */
   if (firmware_has_feature(FW_FEATURE_LPAR) && (dn = of_find_node_by_path("/rtas"))) {
     int num_addr_cell, num_size_cell, maxcpus;
     const __be32 *ireg;
     num_addr_cell = of_n_addr_cells(dn);
     num_size_cell = of_n_size_cells(dn);
     ireg = of_get_property(dn, "ibm,lrdr-capacity", NULL);
     if (!ireg) goto out;
     maxcpus = be32_to_cpup(ireg + num_addr_cell + num_size_cell);
     /* Double maxcpus for processors which have SMT capability */
     if (cpu_has_feature(CPU_FTR_SMT)) maxcpus *= nthreads;
     if (maxcpus > nr_cpu_ids) {
       printk(KERN_WARNING "Partition configured for %d cpus, "
                           "operating system maximum is %u.\n",
              maxcpus, nr_cpu_ids);
       maxcpus = nr_cpu_ids;
     } else
       printk(KERN_INFO "Partition configured for %d cpus.\n", maxcpus);
     for (cpu = 0; cpu < maxcpus; cpu++)
       set_cpu_possible(cpu, true);
   out:
     of_node_put(dn);
   }
   vdso_data->processorCount = num_present_cpus();
 #endif /* CONFIG_PPC64 */
        /* Initialize CPU <=> thread mapping/
         *
         * WARNING: We assume that the number of threads is the same for
         * every CPU in the system. If that is not the case, then some code
         * here will have to be reworked
         */
   cpu_init_thread_core_maps(nthreads);
   /* Now that possible cpus are set, set nr_cpu_ids for later use */
   setup_nr_cpu_ids();
   free_unused_pacas();
 }<sep>@@
expression e1, e2, e3;
@@
(
- memblock_alloc(e1, e2)
+ memblock_phys_alloc(e1, e2)
|
- memblock_alloc_nid(e1, e2, e3)
+ memblock_phys_alloc_nid(e1, e2, e3)
|
- memblock_alloc_try_nid(e1, e2, e3)
+ memblock_phys_alloc_try_nid(e1, e2, e3)
)