From: Dan Streetman Date: Wed, 30 Oct 2013 02:25:14 +0000 (-0400) Subject: powerpc: Only save/restore SDR1 if in hypervisor mode X-Git-Tag: upstream/snapshot3+hdmi~3909^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=711b5138d54fcfd5e312cea895d6e706a46eff19;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git powerpc: Only save/restore SDR1 if in hypervisor mode Currently, when not in hypervisor mode the kernel Oopses during suspend or hibernation when accessing the SDR1 register, because it is only available in hypervisor mode. Access to it needs to be protected in BEGIN/END_FW_FTR_SECTION. Signed-off-by: Dan Streetman Cc: Benjamin Herrenschmidt Reported-by: Jimmy Pan Tested-by: Jimmy Pan Signed-off-by: Benjamin Herrenschmidt --- diff --git a/arch/powerpc/kernel/swsusp_asm64.S b/arch/powerpc/kernel/swsusp_asm64.S index 2204598..988f38d 100644 --- a/arch/powerpc/kernel/swsusp_asm64.S +++ b/arch/powerpc/kernel/swsusp_asm64.S @@ -114,7 +114,9 @@ _GLOBAL(swsusp_arch_suspend) SAVE_SPECIAL(MSR) SAVE_SPECIAL(XER) #ifdef CONFIG_PPC_BOOK3S_64 +BEGIN_FW_FTR_SECTION SAVE_SPECIAL(SDR1) +END_FW_FTR_SECTION_IFCLR(FW_FEATURE_LPAR) #else SAVE_SPR(TCR) @@ -231,7 +233,9 @@ nothing_to_copy: /* can't use RESTORE_SPECIAL(MSR) */ ld r0, SL_MSR(r11) mtmsrd r0, 0 +BEGIN_FW_FTR_SECTION RESTORE_SPECIAL(SDR1) +END_FW_FTR_SECTION_IFCLR(FW_FEATURE_LPAR) #else /* Restore SPRG1, be used to save paca */ ld r0, SL_SPRG1(r11)