Commit 711b5138 authored by Dan Streetman's avatar Dan Streetman Committed by Benjamin Herrenschmidt

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: default avatarDan Streetman <ddstreet@ieee.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reported-by: default avatarJimmy Pan <jipan@redhat.com>
Tested-by: default avatarJimmy Pan <jipan@redhat.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent de00b30d
...@@ -114,7 +114,9 @@ _GLOBAL(swsusp_arch_suspend) ...@@ -114,7 +114,9 @@ _GLOBAL(swsusp_arch_suspend)
SAVE_SPECIAL(MSR) SAVE_SPECIAL(MSR)
SAVE_SPECIAL(XER) SAVE_SPECIAL(XER)
#ifdef CONFIG_PPC_BOOK3S_64 #ifdef CONFIG_PPC_BOOK3S_64
BEGIN_FW_FTR_SECTION
SAVE_SPECIAL(SDR1) SAVE_SPECIAL(SDR1)
END_FW_FTR_SECTION_IFCLR(FW_FEATURE_LPAR)
#else #else
SAVE_SPR(TCR) SAVE_SPR(TCR)
...@@ -231,7 +233,9 @@ nothing_to_copy: ...@@ -231,7 +233,9 @@ nothing_to_copy:
/* can't use RESTORE_SPECIAL(MSR) */ /* can't use RESTORE_SPECIAL(MSR) */
ld r0, SL_MSR(r11) ld r0, SL_MSR(r11)
mtmsrd r0, 0 mtmsrd r0, 0
BEGIN_FW_FTR_SECTION
RESTORE_SPECIAL(SDR1) RESTORE_SPECIAL(SDR1)
END_FW_FTR_SECTION_IFCLR(FW_FEATURE_LPAR)
#else #else
/* Restore SPRG1, be used to save paca */ /* Restore SPRG1, be used to save paca */
ld r0, SL_SPRG1(r11) ld r0, SL_SPRG1(r11)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment