aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/rtas.c
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2009-08-28 08:06:29 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-09-02 02:19:01 -0400
commit46db2f86a3b2a94e0b33e0b4548fb7b7b6bdff66 (patch)
tree6aef8ab146a54d04dd207b0f85f362a4aee3ef5d /arch/powerpc/kernel/rtas.c
parentb8e4a7dae53760b9791aca96e74366078692d90f (diff)
powerpc/pseries: Fix to handle slb resize across migration
The SLB can change sizes across a live migration, which was not being handled, resulting in possible machine crashes during migration if migrating to a machine which has a smaller max SLB size than the source machine. Fix this by first reducing the SLB size to the minimum possible value, which is 32, prior to migration. Then during the device tree update which occurs after migration, we make the call to ensure the SLB gets updated. Also add the slb_size to the lparcfg output so that the migration tools can check to make sure the kernel has this capability before allowing migration in scenarios where the SLB size will change. BenH: Fixed #include <asm/mmu-hash64.h> -> <asm/mmu.h> to avoid breaking ppc32 build Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/rtas.c')
-rw-r--r--arch/powerpc/kernel/rtas.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index c434823b8c83..bf90361bb70f 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -39,6 +39,7 @@
39#include <asm/smp.h> 39#include <asm/smp.h>
40#include <asm/atomic.h> 40#include <asm/atomic.h>
41#include <asm/time.h> 41#include <asm/time.h>
42#include <asm/mmu.h>
42 43
43struct rtas_t rtas = { 44struct rtas_t rtas = {
44 .lock = __RAW_SPIN_LOCK_UNLOCKED 45 .lock = __RAW_SPIN_LOCK_UNLOCKED
@@ -713,6 +714,7 @@ static void rtas_percpu_suspend_me(void *info)
713{ 714{
714 long rc = H_SUCCESS; 715 long rc = H_SUCCESS;
715 unsigned long msr_save; 716 unsigned long msr_save;
717 u16 slb_size = mmu_slb_size;
716 int cpu; 718 int cpu;
717 struct rtas_suspend_me_data *data = 719 struct rtas_suspend_me_data *data =
718 (struct rtas_suspend_me_data *)info; 720 (struct rtas_suspend_me_data *)info;
@@ -735,13 +737,16 @@ static void rtas_percpu_suspend_me(void *info)
735 /* All other cpus are in H_JOIN, this cpu does 737 /* All other cpus are in H_JOIN, this cpu does
736 * the suspend. 738 * the suspend.
737 */ 739 */
740 slb_set_size(SLB_MIN_SIZE);
738 printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n", 741 printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n",
739 smp_processor_id()); 742 smp_processor_id());
740 data->error = rtas_call(data->token, 0, 1, NULL); 743 data->error = rtas_call(data->token, 0, 1, NULL);
741 744
742 if (data->error) 745 if (data->error) {
743 printk(KERN_DEBUG "ibm,suspend-me returned %d\n", 746 printk(KERN_DEBUG "ibm,suspend-me returned %d\n",
744 data->error); 747 data->error);
748 slb_set_size(slb_size);
749 }
745 } else { 750 } else {
746 printk(KERN_ERR "H_JOIN on cpu %i failed with rc = %ld\n", 751 printk(KERN_ERR "H_JOIN on cpu %i failed with rc = %ld\n",
747 smp_processor_id(), rc); 752 smp_processor_id(), rc);