From: grfstrm@users.sourceforge.net (Anders Grafström)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/11] Thumb-2: Implementation of the unified start-up and exceptions code
Date: Fri, 12 Mar 2010 18:30:36 +0100 [thread overview]
Message-ID: <4B9A7A3C.9000304@users.sourceforge.net> (raw)
In-Reply-To: <20090602130549.12732.15147.stgit@pc1117.cambridge.arm.com>
Catalin Marinas wrote:
> diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
> index b55cb03..9341b38 100644
> --- a/arch/arm/kernel/entry-common.S
> +++ b/arch/arm/kernel/entry-common.S
> @@ -33,14 +33,7 @@ ret_fast_syscall:
> /* perform architecture specific actions before user return */
> arch_ret_to_user r1, lr
>
> - @ fast_restore_user_regs
> - ldr r1, [sp, #S_OFF + S_PSR] @ get calling cpsr
> - ldr lr, [sp, #S_OFF + S_PC]! @ get pc
> - msr spsr_cxsf, r1 @ save in spsr_svc
> - ldmdb sp, {r1 - lr}^ @ get calling r1 - lr
> - mov r0, r0
> - add sp, sp, #S_FRAME_SIZE - S_PC
> - movs pc, lr @ return & move spsr_svc into cpsr
> + restore_user_regs fast = 1, offset = S_OFF
> UNWIND(.fnend )
>
> /*
> @@ -73,14 +66,7 @@ no_work_pending:
> /* perform architecture specific actions before user return */
> arch_ret_to_user r1, lr
>
> - @ slow_restore_user_regs
> - ldr r1, [sp, #S_PSR] @ get calling cpsr
> - ldr lr, [sp, #S_PC]! @ get pc
> - msr spsr_cxsf, r1 @ save in spsr_svc
> - ldmdb sp, {r0 - lr}^ @ get calling r0 - lr
> - mov r0, r0
> - add sp, sp, #S_FRAME_SIZE - S_PC
> - movs pc, lr @ return & move spsr_svc into cpsr
> + restore_user_regs fast = 0, offset = 0
> ENDPROC(ret_to_user)
>
> /*
> diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
> +
> + .macro restore_user_regs, fast = 0, offset = 0
> + ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr
> + ldr lr, [sp, #\offset + S_PC]! @ get pc
> + msr spsr_cxsf, r1 @ save in spsr_svc
> + .if \fast
> + ldmdb sp, {r1 - lr}^ @ get calling r1 - lr
> + .else
> + ldmdb sp, {r0 - lr}^ @ get calling r0 - lr
> + .endif
> + add sp, sp, #S_FRAME_SIZE - S_PC
> + movs pc, lr @ return & move spsr_svc into cpsr
> + .endm
This commit seems to have broken things for ARM720T and it looks like
the removal of the "mov r0, r0" instruction in restore_user_regs is what caused it.
The patch below makes it work again but why?
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index 7e9ed1e..516d14e 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -102,6 +102,7 @@
.else
ldmdb sp, {r0 - lr}^ @ get calling r0 - lr
.endif
+ mov r0, r0
add sp, sp, #S_FRAME_SIZE - S_PC
movs pc, lr @ return & move spsr_svc into cpsr
.endm
next parent reply other threads:[~2010-03-12 17:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090602130549.12732.15147.stgit@pc1117.cambridge.arm.com>
2010-03-12 17:30 ` Anders Grafström [this message]
2010-03-12 21:16 ` [PATCH 03/11] Thumb-2: Implementation of the unified start-up and exceptions code Russell King - ARM Linux
2010-03-12 21:44 ` Nicolas Pitre
2010-03-15 15:20 ` Anders Grafström
2010-03-15 15:43 ` Catalin Marinas
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=4B9A7A3C.9000304@users.sourceforge.net \
--to=grfstrm@users.sourceforge.net \
--cc=linux-arm-kernel@lists.infradead.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).