linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: LLVMLinux: Add missing abort() for AARCH64
@ 2014-09-05 23:21 behanw at converseincode.com
  2014-09-06 14:12 ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: behanw at converseincode.com @ 2014-09-05 23:21 UTC (permalink / raw)
  To: linux-arm-kernel

From: Mark Charlebois <charlebm@gmail.com>

Add missing abort for arch aarch64.

This patch makes the aarch64 kernel able to compile with gcc or clang.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
---
 arch/arm64/kernel/traps.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 02cd3f0..123cd6e 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -349,6 +349,15 @@ void __pgd_error(const char *file, int line, unsigned long val)
 	pr_crit("%s:%d: bad pgd %016lx.\n", file, line, val);
 }
 
+void abort(void)
+{
+	BUG();
+
+	/* if that doesn't kill us, halt */
+	panic("Oops failed to kill thread");
+}
+EXPORT_SYMBOL(abort);
+
 void __init trap_init(void)
 {
 	return;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] arm64: LLVMLinux: Add missing abort() for AARCH64
  2014-09-05 23:21 [PATCH] arm64: LLVMLinux: Add missing abort() for AARCH64 behanw at converseincode.com
@ 2014-09-06 14:12 ` Arnd Bergmann
  2014-09-07  2:49   ` Mark Charlebois
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2014-09-06 14:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 05 September 2014 16:21:42 behanw at converseincode.com wrote:
> From: Mark Charlebois <charlebm@gmail.com>
> 
> Add missing abort for arch aarch64.
> 
> This patch makes the aarch64 kernel able to compile with gcc or clang.
> 
> Signed-off-by: Mark Charlebois <charlebm@gmail.com>
> Signed-off-by: Behan Webster <behanw@converseincode.com>

You don't describe why this is needed. When does clang emit an abort()
call? Is that the expected behavior when not linking against a full
C library?

>  arch/arm64/kernel/traps.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
> index 02cd3f0..123cd6e 100644
> --- a/arch/arm64/kernel/traps.c
> +++ b/arch/arm64/kernel/traps.c
> @@ -349,6 +349,15 @@ void __pgd_error(const char *file, int line, unsigned long val)
>         pr_crit("%s:%d: bad pgd %016lx.\n", file, line, val);
>  }
>  
> +void abort(void)
> +{
> +       BUG();
> +
> +       /* if that doesn't kill us, halt */
> +       panic("Oops failed to kill thread");
> +}
> +EXPORT_SYMBOL(abort);

I don't see the point in doing both BUG() and panic(). Doesn't panic()
already print all the information you want in this case?

	Arnd

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] arm64: LLVMLinux: Add missing abort() for AARCH64
  2014-09-06 14:12 ` Arnd Bergmann
@ 2014-09-07  2:49   ` Mark Charlebois
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Charlebois @ 2014-09-07  2:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Sep 6, 2014 at 7:12 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 05 September 2014 16:21:42 behanw at converseincode.com wrote:
>> From: Mark Charlebois <charlebm@gmail.com>
>>
>> Add missing abort for arch aarch64.
>>
>> This patch makes the aarch64 kernel able to compile with gcc or clang.
>>
>> Signed-off-by: Mark Charlebois <charlebm@gmail.com>
>> Signed-off-by: Behan Webster <behanw@converseincode.com>
>
> You don't describe why this is needed. When does clang emit an abort()
> call? Is that the expected behavior when not linking against a full
> C library?

I just tried recompiling for vexpress64 without the abort call and it
seems the patch is no longer needed. When I added this I mimicked the
behavior of abort for arm which at the time was defined in the kernel
code.

Sorry for the churn.

-Mark

>
>>  arch/arm64/kernel/traps.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
>> index 02cd3f0..123cd6e 100644
>> --- a/arch/arm64/kernel/traps.c
>> +++ b/arch/arm64/kernel/traps.c
>> @@ -349,6 +349,15 @@ void __pgd_error(const char *file, int line, unsigned long val)
>>         pr_crit("%s:%d: bad pgd %016lx.\n", file, line, val);
>>  }
>>
>> +void abort(void)
>> +{
>> +       BUG();
>> +
>> +       /* if that doesn't kill us, halt */
>> +       panic("Oops failed to kill thread");
>> +}
>> +EXPORT_SYMBOL(abort);
>
> I don't see the point in doing both BUG() and panic(). Doesn't panic()
> already print all the information you want in this case?
>
>         Arnd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-07  2:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-05 23:21 [PATCH] arm64: LLVMLinux: Add missing abort() for AARCH64 behanw at converseincode.com
2014-09-06 14:12 ` Arnd Bergmann
2014-09-07  2:49   ` Mark Charlebois

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).