From: Laura Abbott <lauraa@codeaurora.org>
To: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, dave.martin@linaro.org,
nicolas.pitre@linaro.org, catalin.marinas@arm.com
Cc: linux-arm-msm@vger.kernel.org, Laura Abbott <lauraa@codeaurora.org>
Subject: [PATCH] arm: Add unwinding support for memset and memzero.
Date: Mon, 12 Mar 2012 10:40:27 -0700 [thread overview]
Message-ID: <1331574027-28542-1-git-send-email-lauraa@codeaurora.org> (raw)
Both memset and memzero lack unwinding annoations. If
an abort occurs trying to access the pointer, the backtrace
is incomplete. Add unwinding annotations to both functions
so we can actually get a useful backtrace.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
arch/arm/lib/memset.S | 7 +++++--
arch/arm/lib/memzero.S | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S
index 650d592..4379912 100644
--- a/arch/arm/lib/memset.S
+++ b/arch/arm/lib/memset.S
@@ -11,6 +11,7 @@
*/
#include <linux/linkage.h>
#include <asm/assembler.h>
+#include <asm/unwind.h>
.text
.align 5
@@ -29,6 +30,7 @@
*/
ENTRY(memset)
+UNWIND(.fnstart)
ands r3, r0, #3 @ 1 unaligned?
bne 1b @ 1
/*
@@ -41,7 +43,7 @@ ENTRY(memset)
blt 4f
#if ! CALGN(1)+0
-
+UNWIND(.save {lr})
/*
* We need an extra register for this loop - save the return address and
* use the LR
@@ -68,7 +70,7 @@ ENTRY(memset)
ldr lr, [sp], #4
#else
-
+UNWIND(.save {r4, r5, r6, r7, lr})
/*
* This version aligns the destination pointer in order to write
* whole cache lines at once.
@@ -124,4 +126,5 @@ ENTRY(memset)
tst r2, #1
strneb r1, [r0], #1
mov pc, lr
+UNWIND(.fnend)
ENDPROC(memset)
diff --git a/arch/arm/lib/memzero.S b/arch/arm/lib/memzero.S
index 3fbdef5..26f9ce8 100644
--- a/arch/arm/lib/memzero.S
+++ b/arch/arm/lib/memzero.S
@@ -9,6 +9,7 @@
*/
#include <linux/linkage.h>
#include <asm/assembler.h>
+#include <asm/unwind.h>
.text
.align 5
@@ -31,6 +32,7 @@
*/
ENTRY(__memzero)
+UNWIND(.fnstart)
mov r2, #0 @ 1
ands r3, r0, #3 @ 1 unaligned?
bne 1b @ 1
@@ -41,7 +43,7 @@ ENTRY(__memzero)
blt 4f @ 1 have < 16 bytes
#if ! CALGN(1)+0
-
+UNWIND(.save {lr})
/*
* We need an extra register for this loop - save the return address and
* use the LR
@@ -68,7 +70,7 @@ ENTRY(__memzero)
ldr lr, [sp], #4 @ 1
#else
-
+UNWIND(.save{r4, r5, r6, r7})
/*
* This version aligns the destination pointer in order to write
* whole cache lines at once.
@@ -122,4 +124,5 @@ ENTRY(__memzero)
tst r1, #1 @ 1 a byte left over
strneb r2, [r0], #1 @ 1
mov pc, lr @ 1
+UNWIND(.fnend)
ENDPROC(__memzero)
--
1.7.8.3
next reply other threads:[~2012-03-12 17:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-12 17:40 Laura Abbott [this message]
2012-03-13 20:47 ` [PATCH] arm: Add unwinding support for memset and memzero David Brown
2012-03-14 11:15 ` Dave Martin
2012-03-16 17:21 ` Laura Abbott
2012-03-19 10:53 ` Dave Martin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331574027-28542-1-git-send-email-lauraa@codeaurora.org \
--to=lauraa@codeaurora.org \
--cc=catalin.marinas@arm.com \
--cc=dave.martin@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.pitre@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).