Enable partition migration in the kernel
cover Enable partition migration in the kernel
This set of patches implements partition migration capability in the kernel. With this patch partition migration is done by writing the stream id (generated by the HMC managing the system) to a new sysfs file. This then performs the migration of the partition and the necessary device tree updating and firmware activation required post-migration.
The first two patches simply export routines needed by the migration and device tree updating code. The third patch contains the implementation of migration and device tree updating.
-Nathan Fontenot
PATCH 1/3 Export pseries device tree updating routines
Export routines associated with adding and removing device tree nodes on pseries needed for device tree updating.
--- arch/powerpc/platforms/pseries/dlpar.c | 4 ++-- arch/powerpc/platforms/pseries/pseries.h | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-)
arch/powerpc/platforms/pseries/dlpar.c +2 -2
@@ -33,7 +33,7 @@ struct cc_workarea {u32 prop_offset; }; -static void dlpar_free_cc_property (struct property *prop) +void dlpar_free_cc_property (struct property *prop) {kfree (prop->name);kfree (prop->value);
@@ -102,7 +102,7 @@ static void dlpar_free_one_cc_node(struckfree (dn); } -static void dlpar_free_cc_nodes (struct device_node *dn) +void dlpar_free_cc_nodes (struct device_node *dn) {if (dn->child)dlpar_free_cc_nodes (dn->child);
arch/powerpc/platforms/pseries/pseries.h +9 -0
@@ -17,6 +17,8 @@ struct device_node;extern void request_event_sources_irqs (struct device_node *np,irq_handler_t handler,const char *name); +#include <linux/of.h> +extern void __init fw_feature_init (const char *hypertas,unsigned long len);struct pt_regs ;
@@ -47,4 +49,11 @@ extern unsigned long rtas_poweron_auto;extern void find_udbg_vterm (void ); +/* Dynamic logical Partitioning/Mobility */ +extern void dlpar_free_cc_nodes (struct device_node *); +extern void dlpar_free_cc_property (struct property *); +extern struct device_node *dlpar_configure_connector (u32 ); +extern int dlpar_attach_node (struct device_node *); +extern int dlpar_detach_node (struct device_node *); +#endif /* _PSERIES_PSERIES_H */
PATCH 2/3 Export rtas_ibm_suspend_me()
In reply to Nathan FontenotExport the rtas_ibm_suspend_me() routine. This is needed to perform partition migration in the kernel.
--- arch/powerpc/include/asm/rtas.h | 1 + arch/powerpc/kernel/rtas.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/powerpc/include/asm/rtas.h +1 -0
@@ -187,6 +187,7 @@ extern void rtas_progress(char *s, unsigextern void rtas_initialize (void );extern int rtas_suspend_cpu (struct rtas_suspend_me_data *data);extern int rtas_suspend_last_cpu (struct rtas_suspend_me_data *data); +extern int rtas_ibm_suspend_me (struct rtas_args *);struct rtc_time ;extern unsigned long rtas_get_boot_time (void );
arch/powerpc/kernel/rtas.c +2 -2
@@ -805,7 +805,7 @@ static void rtas_percpu_suspend_me(void__rtas_suspend_cpu ((struct rtas_suspend_me_data *)info,1 ); } -static int rtas_ibm_suspend_me (struct rtas_args *args) +int rtas_ibm_suspend_me (struct rtas_args *args) {long state;long rc;
@@ -855,7 +855,7 @@ static int rtas_ibm_suspend_me(struct rt return atomic_read(&data.error); }#else /* CONFIG_PPC_PSERIES */ -static int rtas_ibm_suspend_me (struct rtas_args *args) +int rtas_ibm_suspend_me (struct rtas_args *args) {return -ENOSYS ; }
PATCH 3/3 Partition migration in the kernel
In reply to Nathan FontenotEnable partition migration in the kernel. To do this a new sysfs file, /sys/kernel/mobility/migration, is created. In order to initiate a migration the stream id (generated by the HMC managing the system) is written to this file.
After a migration occurs, and what is the majority of this code, the device tree needs to be updated for the new system the partition is running on. This is done via the ibm,update-nodes and ibm,update-properties rtas calls which return information regarding which nodes and properties of the device tree are to be added/removed/updated.
--- arch/powerpc/platforms/pseries/Makefile | 2 arch/powerpc/platforms/pseries/mobility.c | 362 ++++++++++++++++++++++++++++++ 2 files changed, 363 insertions(+), 1 deletion(-)
arch/powerpc/platforms/pseries/Makefile +1 -1
@@ -8,7 +8,7 @@ endif obj-y := lpar.o hvCall.o nvram.o reconfig.o \ setup.o iommu.o event_sources.o ras.o \ - firmware.o power.o dlpar.o + firmware.o power.o dlpar.o mobility.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_XICS) += xics.o obj-$(CONFIG_SCANLOG) += scanlog.o
arch/powerpc/platforms/pseries/mobility.c new file +362 -0
362 lines not on this page · raw message