1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * pseries Memory Hotplug infrastructure.
5 * Copyright (C) 2008 Badari Pulavarty, IBM Corporation
8 #define pr_fmt(fmt) "pseries-hotplug-mem: " fmt
11 #include <linux/of_address.h>
12 #include <linux/memblock.h>
13 #include <linux/memory.h>
14 #include <linux/memory_hotplug.h>
15 #include <linux/slab.h>
17 #include <asm/firmware.h>
18 #include <asm/machdep.h>
20 #include <asm/sparsemem.h>
21 #include <asm/fadump.h>
22 #include <asm/drmem.h>
25 static bool rtas_hp_event;
27 unsigned long pseries_memory_block_size(void)
29 struct device_node *np;
30 unsigned int memblock_size = MIN_MEMORY_BLOCK_SIZE;
33 np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
37 size = of_get_property(np, "ibm,lmb-size", NULL);
39 memblock_size = be64_to_cpup(size);
41 } else if (machine_is(pseries)) {
42 /* This fallback really only applies to pseries */
43 unsigned int memzero_size = 0;
45 np = of_find_node_by_path("/memory@0");
47 if (!of_address_to_resource(np, 0, &r))
48 memzero_size = resource_size(&r);
53 /* We now know the size of memory@0, use this to find
54 * the first memoryblock and get its size.
58 sprintf(buf, "/memory@%x", memzero_size);
59 np = of_find_node_by_path(buf);
61 if (!of_address_to_resource(np, 0, &r))
62 memblock_size = resource_size(&r);
70 static void dlpar_free_property(struct property *prop)
77 static struct property *dlpar_clone_property(struct property *prop,
80 struct property *new_prop;
82 new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL);
86 new_prop->name = kstrdup(prop->name, GFP_KERNEL);
87 new_prop->value = kzalloc(prop_size, GFP_KERNEL);
88 if (!new_prop->name || !new_prop->value) {
89 dlpar_free_property(new_prop);
93 memcpy(new_prop->value, prop->value, prop->length);
94 new_prop->length = prop_size;
96 of_property_set_flag(new_prop, OF_DYNAMIC);
100 static bool find_aa_index(struct device_node *dr_node,
101 struct property *ala_prop,
102 const u32 *lmb_assoc, u32 *aa_index)
104 u32 *assoc_arrays, new_prop_size;
105 struct property *new_prop;
106 int aa_arrays, aa_array_entries, aa_array_sz;
110 * The ibm,associativity-lookup-arrays property is defined to be
111 * a 32-bit value specifying the number of associativity arrays
112 * followed by a 32-bitvalue specifying the number of entries per
113 * array, followed by the associativity arrays.
115 assoc_arrays = ala_prop->value;
117 aa_arrays = be32_to_cpu(assoc_arrays[0]);
118 aa_array_entries = be32_to_cpu(assoc_arrays[1]);
119 aa_array_sz = aa_array_entries * sizeof(u32);
121 for (i = 0; i < aa_arrays; i++) {
122 index = (i * aa_array_entries) + 2;
124 if (memcmp(&assoc_arrays[index], &lmb_assoc[1], aa_array_sz))
131 new_prop_size = ala_prop->length + aa_array_sz;
132 new_prop = dlpar_clone_property(ala_prop, new_prop_size);
136 assoc_arrays = new_prop->value;
138 /* increment the number of entries in the lookup array */
139 assoc_arrays[0] = cpu_to_be32(aa_arrays + 1);
141 /* copy the new associativity into the lookup array */
142 index = aa_arrays * aa_array_entries + 2;
143 memcpy(&assoc_arrays[index], &lmb_assoc[1], aa_array_sz);
145 of_update_property(dr_node, new_prop);
148 * The associativity lookup array index for this lmb is
149 * number of entries - 1 since we added its associativity
150 * to the end of the lookup array.
152 *aa_index = be32_to_cpu(assoc_arrays[0]) - 1;
156 static int update_lmb_associativity_index(struct drmem_lmb *lmb)
158 struct device_node *parent, *lmb_node, *dr_node;
159 struct property *ala_prop;
160 const u32 *lmb_assoc;
164 parent = of_find_node_by_path("/");
168 lmb_node = dlpar_configure_connector(cpu_to_be32(lmb->drc_index),
174 lmb_assoc = of_get_property(lmb_node, "ibm,associativity", NULL);
176 dlpar_free_cc_nodes(lmb_node);
180 dr_node = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
182 dlpar_free_cc_nodes(lmb_node);
186 ala_prop = of_find_property(dr_node, "ibm,associativity-lookup-arrays",
189 of_node_put(dr_node);
190 dlpar_free_cc_nodes(lmb_node);
194 found = find_aa_index(dr_node, ala_prop, lmb_assoc, &aa_index);
196 of_node_put(dr_node);
197 dlpar_free_cc_nodes(lmb_node);
200 pr_err("Could not find LMB associativity\n");
204 lmb->aa_index = aa_index;
208 static struct memory_block *lmb_to_memblock(struct drmem_lmb *lmb)
210 unsigned long section_nr;
211 struct mem_section *mem_sect;
212 struct memory_block *mem_block;
214 section_nr = pfn_to_section_nr(PFN_DOWN(lmb->base_addr));
215 mem_sect = __nr_to_section(section_nr);
217 mem_block = find_memory_block(mem_sect);
221 static int get_lmb_range(u32 drc_index, int n_lmbs,
222 struct drmem_lmb **start_lmb,
223 struct drmem_lmb **end_lmb)
225 struct drmem_lmb *lmb, *start, *end;
226 struct drmem_lmb *last_lmb;
229 for_each_drmem_lmb(lmb) {
230 if (lmb->drc_index == drc_index) {
239 end = &start[n_lmbs - 1];
241 last_lmb = &drmem_info->lmbs[drmem_info->n_lmbs - 1];
250 static int dlpar_change_lmb_state(struct drmem_lmb *lmb, bool online)
252 struct memory_block *mem_block;
255 mem_block = lmb_to_memblock(lmb);
259 if (online && mem_block->dev.offline)
260 rc = device_online(&mem_block->dev);
261 else if (!online && !mem_block->dev.offline)
262 rc = device_offline(&mem_block->dev);
266 put_device(&mem_block->dev);
271 static int dlpar_online_lmb(struct drmem_lmb *lmb)
273 return dlpar_change_lmb_state(lmb, true);
276 #ifdef CONFIG_MEMORY_HOTREMOVE
277 static int dlpar_offline_lmb(struct drmem_lmb *lmb)
279 return dlpar_change_lmb_state(lmb, false);
282 static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size)
284 unsigned long block_sz, start_pfn;
285 int sections_per_block;
288 start_pfn = base >> PAGE_SHIFT;
290 lock_device_hotplug();
292 if (!pfn_valid(start_pfn))
295 block_sz = pseries_memory_block_size();
296 sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE;
297 nid = memory_add_physaddr_to_nid(base);
299 for (i = 0; i < sections_per_block; i++) {
300 __remove_memory(nid, base, MIN_MEMORY_BLOCK_SIZE);
301 base += MIN_MEMORY_BLOCK_SIZE;
305 /* Update memory regions for memory remove */
306 memblock_remove(base, memblock_size);
307 unlock_device_hotplug();
311 static int pseries_remove_mem_node(struct device_node *np)
315 unsigned int lmb_size;
319 * Check to see if we are actually removing memory
321 if (!of_node_is_type(np, "memory"))
325 * Find the base address and size of the memblock
327 regs = of_get_property(np, "reg", NULL);
331 base = be64_to_cpu(*(unsigned long *)regs);
332 lmb_size = be32_to_cpu(regs[3]);
334 pseries_remove_memblock(base, lmb_size);
338 static bool lmb_is_removable(struct drmem_lmb *lmb)
340 int i, scns_per_block;
342 unsigned long pfn, block_sz;
345 if (!(lmb->flags & DRCONF_MEM_ASSIGNED))
348 block_sz = memory_block_size_bytes();
349 scns_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE;
350 phys_addr = lmb->base_addr;
352 #ifdef CONFIG_FA_DUMP
354 * Don't hot-remove memory that falls in fadump boot memory area
355 * and memory that is reserved for capturing old kernel memory.
357 if (is_fadump_memory_area(phys_addr, block_sz))
361 for (i = 0; i < scns_per_block; i++) {
362 pfn = PFN_DOWN(phys_addr);
363 if (!pfn_present(pfn))
366 rc &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
367 phys_addr += MIN_MEMORY_BLOCK_SIZE;
370 return rc ? true : false;
373 static int dlpar_add_lmb(struct drmem_lmb *);
375 static int dlpar_remove_lmb(struct drmem_lmb *lmb)
377 unsigned long block_sz;
380 if (!lmb_is_removable(lmb))
383 rc = dlpar_offline_lmb(lmb);
387 block_sz = pseries_memory_block_size();
389 __remove_memory(lmb->nid, lmb->base_addr, block_sz);
391 /* Update memory regions for memory remove */
392 memblock_remove(lmb->base_addr, block_sz);
394 invalidate_lmb_associativity_index(lmb);
396 lmb->flags &= ~DRCONF_MEM_ASSIGNED;
401 static int dlpar_memory_remove_by_count(u32 lmbs_to_remove)
403 struct drmem_lmb *lmb;
404 int lmbs_removed = 0;
405 int lmbs_available = 0;
408 pr_info("Attempting to hot-remove %d LMB(s)\n", lmbs_to_remove);
410 if (lmbs_to_remove == 0)
413 /* Validate that there are enough LMBs to satisfy the request */
414 for_each_drmem_lmb(lmb) {
415 if (lmb_is_removable(lmb))
418 if (lmbs_available == lmbs_to_remove)
422 if (lmbs_available < lmbs_to_remove) {
423 pr_info("Not enough LMBs available (%d of %d) to satisfy request\n",
424 lmbs_available, lmbs_to_remove);
428 for_each_drmem_lmb(lmb) {
429 rc = dlpar_remove_lmb(lmb);
433 /* Mark this lmb so we can add it later if all of the
434 * requested LMBs cannot be removed.
436 drmem_mark_lmb_reserved(lmb);
439 if (lmbs_removed == lmbs_to_remove)
443 if (lmbs_removed != lmbs_to_remove) {
444 pr_err("Memory hot-remove failed, adding LMB's back\n");
446 for_each_drmem_lmb(lmb) {
447 if (!drmem_lmb_reserved(lmb))
450 rc = dlpar_add_lmb(lmb);
452 pr_err("Failed to add LMB back, drc index %x\n",
455 drmem_remove_lmb_reservation(lmb);
460 for_each_drmem_lmb(lmb) {
461 if (!drmem_lmb_reserved(lmb))
464 dlpar_release_drc(lmb->drc_index);
465 pr_info("Memory at %llx was hot-removed\n",
468 drmem_remove_lmb_reservation(lmb);
476 static int dlpar_memory_remove_by_index(u32 drc_index)
478 struct drmem_lmb *lmb;
482 pr_info("Attempting to hot-remove LMB, drc index %x\n", drc_index);
485 for_each_drmem_lmb(lmb) {
486 if (lmb->drc_index == drc_index) {
488 rc = dlpar_remove_lmb(lmb);
490 dlpar_release_drc(lmb->drc_index);
500 pr_info("Failed to hot-remove memory at %llx\n",
503 pr_info("Memory at %llx was hot-removed\n", lmb->base_addr);
508 static int dlpar_memory_readd_by_index(u32 drc_index)
510 struct drmem_lmb *lmb;
514 pr_info("Attempting to update LMB, drc index %x\n", drc_index);
517 for_each_drmem_lmb(lmb) {
518 if (lmb->drc_index == drc_index) {
520 rc = dlpar_remove_lmb(lmb);
522 rc = dlpar_add_lmb(lmb);
524 dlpar_release_drc(lmb->drc_index);
534 pr_info("Failed to update memory at %llx\n",
537 pr_info("Memory at %llx was updated\n", lmb->base_addr);
542 static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)
544 struct drmem_lmb *lmb, *start_lmb, *end_lmb;
545 int lmbs_available = 0;
548 pr_info("Attempting to hot-remove %u LMB(s) at %x\n",
549 lmbs_to_remove, drc_index);
551 if (lmbs_to_remove == 0)
554 rc = get_lmb_range(drc_index, lmbs_to_remove, &start_lmb, &end_lmb);
558 /* Validate that there are enough LMBs to satisfy the request */
559 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
560 if (lmb->flags & DRCONF_MEM_RESERVED)
566 if (lmbs_available < lmbs_to_remove)
569 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
570 if (!(lmb->flags & DRCONF_MEM_ASSIGNED))
573 rc = dlpar_remove_lmb(lmb);
577 drmem_mark_lmb_reserved(lmb);
581 pr_err("Memory indexed-count-remove failed, adding any removed LMBs\n");
584 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
585 if (!drmem_lmb_reserved(lmb))
588 rc = dlpar_add_lmb(lmb);
590 pr_err("Failed to add LMB, drc index %x\n",
593 drmem_remove_lmb_reservation(lmb);
597 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
598 if (!drmem_lmb_reserved(lmb))
601 dlpar_release_drc(lmb->drc_index);
602 pr_info("Memory at %llx (drc index %x) was hot-removed\n",
603 lmb->base_addr, lmb->drc_index);
605 drmem_remove_lmb_reservation(lmb);
613 static inline int pseries_remove_memblock(unsigned long base,
614 unsigned int memblock_size)
618 static inline int pseries_remove_mem_node(struct device_node *np)
622 static inline int dlpar_memory_remove(struct pseries_hp_errorlog *hp_elog)
626 static int dlpar_remove_lmb(struct drmem_lmb *lmb)
630 static int dlpar_memory_remove_by_count(u32 lmbs_to_remove)
634 static int dlpar_memory_remove_by_index(u32 drc_index)
638 static int dlpar_memory_readd_by_index(u32 drc_index)
643 static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)
647 #endif /* CONFIG_MEMORY_HOTREMOVE */
649 static int dlpar_add_lmb(struct drmem_lmb *lmb)
651 unsigned long block_sz;
654 if (lmb->flags & DRCONF_MEM_ASSIGNED)
657 rc = update_lmb_associativity_index(lmb);
659 dlpar_release_drc(lmb->drc_index);
664 block_sz = memory_block_size_bytes();
667 rc = __add_memory(lmb->nid, lmb->base_addr, block_sz);
669 invalidate_lmb_associativity_index(lmb);
673 rc = dlpar_online_lmb(lmb);
675 __remove_memory(lmb->nid, lmb->base_addr, block_sz);
676 invalidate_lmb_associativity_index(lmb);
679 lmb->flags |= DRCONF_MEM_ASSIGNED;
685 static int dlpar_memory_add_by_count(u32 lmbs_to_add)
687 struct drmem_lmb *lmb;
688 int lmbs_available = 0;
692 pr_info("Attempting to hot-add %d LMB(s)\n", lmbs_to_add);
694 if (lmbs_to_add == 0)
697 /* Validate that there are enough LMBs to satisfy the request */
698 for_each_drmem_lmb(lmb) {
699 if (!(lmb->flags & DRCONF_MEM_ASSIGNED))
702 if (lmbs_available == lmbs_to_add)
706 if (lmbs_available < lmbs_to_add)
709 for_each_drmem_lmb(lmb) {
710 if (lmb->flags & DRCONF_MEM_ASSIGNED)
713 rc = dlpar_acquire_drc(lmb->drc_index);
717 rc = dlpar_add_lmb(lmb);
719 dlpar_release_drc(lmb->drc_index);
723 /* Mark this lmb so we can remove it later if all of the
724 * requested LMBs cannot be added.
726 drmem_mark_lmb_reserved(lmb);
729 if (lmbs_added == lmbs_to_add)
733 if (lmbs_added != lmbs_to_add) {
734 pr_err("Memory hot-add failed, removing any added LMBs\n");
736 for_each_drmem_lmb(lmb) {
737 if (!drmem_lmb_reserved(lmb))
740 rc = dlpar_remove_lmb(lmb);
742 pr_err("Failed to remove LMB, drc index %x\n",
745 dlpar_release_drc(lmb->drc_index);
747 drmem_remove_lmb_reservation(lmb);
751 for_each_drmem_lmb(lmb) {
752 if (!drmem_lmb_reserved(lmb))
755 pr_info("Memory at %llx (drc index %x) was hot-added\n",
756 lmb->base_addr, lmb->drc_index);
757 drmem_remove_lmb_reservation(lmb);
765 static int dlpar_memory_add_by_index(u32 drc_index)
767 struct drmem_lmb *lmb;
770 pr_info("Attempting to hot-add LMB, drc index %x\n", drc_index);
773 for_each_drmem_lmb(lmb) {
774 if (lmb->drc_index == drc_index) {
776 rc = dlpar_acquire_drc(lmb->drc_index);
778 rc = dlpar_add_lmb(lmb);
780 dlpar_release_drc(lmb->drc_index);
791 pr_info("Failed to hot-add memory, drc index %x\n", drc_index);
793 pr_info("Memory at %llx (drc index %x) was hot-added\n",
794 lmb->base_addr, drc_index);
799 static int dlpar_memory_add_by_ic(u32 lmbs_to_add, u32 drc_index)
801 struct drmem_lmb *lmb, *start_lmb, *end_lmb;
802 int lmbs_available = 0;
805 pr_info("Attempting to hot-add %u LMB(s) at index %x\n",
806 lmbs_to_add, drc_index);
808 if (lmbs_to_add == 0)
811 rc = get_lmb_range(drc_index, lmbs_to_add, &start_lmb, &end_lmb);
815 /* Validate that the LMBs in this range are not reserved */
816 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
817 if (lmb->flags & DRCONF_MEM_RESERVED)
823 if (lmbs_available < lmbs_to_add)
826 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
827 if (lmb->flags & DRCONF_MEM_ASSIGNED)
830 rc = dlpar_acquire_drc(lmb->drc_index);
834 rc = dlpar_add_lmb(lmb);
836 dlpar_release_drc(lmb->drc_index);
840 drmem_mark_lmb_reserved(lmb);
844 pr_err("Memory indexed-count-add failed, removing any added LMBs\n");
846 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
847 if (!drmem_lmb_reserved(lmb))
850 rc = dlpar_remove_lmb(lmb);
852 pr_err("Failed to remove LMB, drc index %x\n",
855 dlpar_release_drc(lmb->drc_index);
857 drmem_remove_lmb_reservation(lmb);
861 for_each_drmem_lmb_in_range(lmb, start_lmb, end_lmb) {
862 if (!drmem_lmb_reserved(lmb))
865 pr_info("Memory at %llx (drc index %x) was hot-added\n",
866 lmb->base_addr, lmb->drc_index);
867 drmem_remove_lmb_reservation(lmb);
874 int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
876 u32 count, drc_index;
879 lock_device_hotplug();
881 switch (hp_elog->action) {
882 case PSERIES_HP_ELOG_ACTION_ADD:
883 if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_COUNT) {
884 count = hp_elog->_drc_u.drc_count;
885 rc = dlpar_memory_add_by_count(count);
886 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_INDEX) {
887 drc_index = hp_elog->_drc_u.drc_index;
888 rc = dlpar_memory_add_by_index(drc_index);
889 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_IC) {
890 count = hp_elog->_drc_u.ic.count;
891 drc_index = hp_elog->_drc_u.ic.index;
892 rc = dlpar_memory_add_by_ic(count, drc_index);
898 case PSERIES_HP_ELOG_ACTION_REMOVE:
899 if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_COUNT) {
900 count = hp_elog->_drc_u.drc_count;
901 rc = dlpar_memory_remove_by_count(count);
902 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_INDEX) {
903 drc_index = hp_elog->_drc_u.drc_index;
904 rc = dlpar_memory_remove_by_index(drc_index);
905 } else if (hp_elog->id_type == PSERIES_HP_ELOG_ID_DRC_IC) {
906 count = hp_elog->_drc_u.ic.count;
907 drc_index = hp_elog->_drc_u.ic.index;
908 rc = dlpar_memory_remove_by_ic(count, drc_index);
914 case PSERIES_HP_ELOG_ACTION_READD:
915 drc_index = hp_elog->_drc_u.drc_index;
916 rc = dlpar_memory_readd_by_index(drc_index);
919 pr_err("Invalid action (%d) specified\n", hp_elog->action);
925 rtas_hp_event = true;
926 rc = drmem_update_dt();
927 rtas_hp_event = false;
930 unlock_device_hotplug();
934 static int pseries_add_mem_node(struct device_node *np)
938 unsigned int lmb_size;
942 * Check to see if we are actually adding memory
944 if (!of_node_is_type(np, "memory"))
948 * Find the base and size of the memblock
950 regs = of_get_property(np, "reg", NULL);
954 base = be64_to_cpu(*(unsigned long *)regs);
955 lmb_size = be32_to_cpu(regs[3]);
958 * Update memory region to represent the memory add
960 ret = memblock_add(base, lmb_size);
961 return (ret < 0) ? -EINVAL : 0;
964 static int pseries_update_drconf_memory(struct of_reconfig_data *pr)
966 struct of_drconf_cell_v1 *new_drmem, *old_drmem;
967 unsigned long memblock_size;
975 memblock_size = pseries_memory_block_size();
982 p = (__be32 *) pr->old_prop->value;
986 /* The first int of the property is the number of lmb's described
987 * by the property. This is followed by an array of of_drconf_cell
988 * entries. Get the number of entries and skip to the array of
991 entries = be32_to_cpu(*p++);
992 old_drmem = (struct of_drconf_cell_v1 *)p;
994 p = (__be32 *)pr->prop->value;
996 new_drmem = (struct of_drconf_cell_v1 *)p;
998 for (i = 0; i < entries; i++) {
999 if ((be32_to_cpu(old_drmem[i].flags) & DRCONF_MEM_ASSIGNED) &&
1000 (!(be32_to_cpu(new_drmem[i].flags) & DRCONF_MEM_ASSIGNED))) {
1001 rc = pseries_remove_memblock(
1002 be64_to_cpu(old_drmem[i].base_addr),
1005 } else if ((!(be32_to_cpu(old_drmem[i].flags) &
1006 DRCONF_MEM_ASSIGNED)) &&
1007 (be32_to_cpu(new_drmem[i].flags) &
1008 DRCONF_MEM_ASSIGNED)) {
1009 rc = memblock_add(be64_to_cpu(old_drmem[i].base_addr),
1011 rc = (rc < 0) ? -EINVAL : 0;
1018 static int pseries_memory_notifier(struct notifier_block *nb,
1019 unsigned long action, void *data)
1021 struct of_reconfig_data *rd = data;
1025 case OF_RECONFIG_ATTACH_NODE:
1026 err = pseries_add_mem_node(rd->dn);
1028 case OF_RECONFIG_DETACH_NODE:
1029 err = pseries_remove_mem_node(rd->dn);
1031 case OF_RECONFIG_UPDATE_PROPERTY:
1032 if (!strcmp(rd->prop->name, "ibm,dynamic-memory"))
1033 err = pseries_update_drconf_memory(rd);
1036 return notifier_from_errno(err);
1039 static struct notifier_block pseries_mem_nb = {
1040 .notifier_call = pseries_memory_notifier,
1043 static int __init pseries_memory_hotplug_init(void)
1045 if (firmware_has_feature(FW_FEATURE_LPAR))
1046 of_reconfig_notifier_register(&pseries_mem_nb);
1050 machine_device_initcall(pseries, pseries_memory_hotplug_init);