diff mbox

[3/5] arm64: kdump: do not go into EL2 before starting a crash dump kernel

Message ID 1427358533-3754-4-git-send-email-takahiro.akashi@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

AKASHI Takahiro March 26, 2015, 8:28 a.m. UTC
Unlike normal kexec case, we don't have a chance to reset EL2 context in
a generic way because bad exceptions may directly invoke crash_kexec().
(See die().)
Kvm is not useful on crash dump kernel anyway, and so we let it
un-initialized across rebooting.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 arch/arm64/kernel/process.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Geoff Levand March 26, 2015, 10:29 p.m. UTC | #1
On Thu, 2015-03-26 at 17:28 +0900, AKASHI Takahiro wrote:
> @@ -64,7 +65,11 @@ void soft_restart(unsigned long addr)
>  	setup_mm_for_reboot();
>  
>  	cpu_soft_restart(virt_to_phys(cpu_reset),
> -		is_hyp_mode_available(), addr);
> +#ifdef CONFIG_KEXEC
> +		!in_crash_kexec &&
> +#endif

Why not define in_crash_kexec without condition on CONFIG_KEXEC, say
here in process.c and then avoid these preprocessor conditionals.

> +		is_hyp_mode_available(),
> +		addr);
>  
>  	/* Should never get here */
>  	BUG();
AKASHI Takahiro March 30, 2015, 3:21 a.m. UTC | #2
On 03/27/2015 07:29 AM, Geoff Levand wrote:
> On Thu, 2015-03-26 at 17:28 +0900, AKASHI Takahiro wrote:
>> @@ -64,7 +65,11 @@ void soft_restart(unsigned long addr)
>>   	setup_mm_for_reboot();
>>
>>   	cpu_soft_restart(virt_to_phys(cpu_reset),
>> -		is_hyp_mode_available(), addr);
>> +#ifdef CONFIG_KEXEC
>> +		!in_crash_kexec &&
>> +#endif
>
> Why not define in_crash_kexec without condition on CONFIG_KEXEC, say
> here in process.c and then avoid these preprocessor conditionals.

Well, I thought of that, but as its name suggested, the variable should
be basically part of kdump code.
Moreover, I suspect that some one might reject a whole idea of patch #3.

-Takahiro AKASHI

>> +		is_hyp_mode_available(),
>> +		addr);
>>
>>   	/* Should never get here */
>>   	BUG();
>
>
>
diff mbox

Patch

diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index d894d3e..9859f5c 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -48,6 +48,7 @@ 
 #include <asm/compat.h>
 #include <asm/cacheflush.h>
 #include <asm/fpsimd.h>
+#include <asm/kexec.h>
 #include <asm/mmu_context.h>
 #include <asm/processor.h>
 #include <asm/stacktrace.h>
@@ -64,7 +65,11 @@  void soft_restart(unsigned long addr)
 	setup_mm_for_reboot();
 
 	cpu_soft_restart(virt_to_phys(cpu_reset),
-		is_hyp_mode_available(), addr);
+#ifdef CONFIG_KEXEC
+		!in_crash_kexec &&
+#endif
+		is_hyp_mode_available(),
+		addr);
 
 	/* Should never get here */
 	BUG();