From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: Kexec: BE kernel on ARM VE TC2
Date: Thu, 8 Aug 2013 09:36:22 +0100 [thread overview]
Message-ID: <20130808083622.GI23006@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CALicx6u4cOLCzia8oxKKCrC=d+pxJmWWvLH++ZXVkvNVWV65DA@mail.gmail.com>
On Thu, Aug 08, 2013 at 11:46:03AM +0530, Vijay Kilari wrote:
> Yes, you are right. I see that memcpy() works. However I see strange issue
> with Kexec on BE kernel. If I put debug print in arch/arm/kernel/head.S code
> before turning on MMU, KEXEC works. if I remove the debug print kexec
> boot hangs.
> So I could not relate how calling printascii is solving the problem
>
> Any suggestion?
>
> If printascii is called after turning on mmu, kexec hangs. Below is my
> debug code
>
> diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
> index 5b391a6..15d4504 100644
> --- a/arch/arm/kernel/head-common.S
> +++ b/arch/arm/kernel/head-common.S
> @@ -175,6 +175,15 @@ __lookup_processor_type_data:
> .long __proc_info_end
> .size __lookup_processor_type_data, . - __lookup_processor_type_data
>
> +__print_debug:
> + stmfd sp!, {r0 - r6, r9, lr}
> + adr r0, str_p3
> + bl printascii
> + ldmfd sp!, {r0 - r6, r9, pc}
> +str_p3: .asciz "\nHere"
> + .align
> +ENDPROC(__print_debug)
> +
This is rather broken. Who says you have a stack here to store those
registers? The answer is - you generally won't have a stack. So this
is going to scribble on whatever memory 'sp' happens to be pointing at
at the time the kernel is entered.
printascii is designed to avoid disrupting as many registers as possible.
It will only modify r0-r3 and of course lr. I'm sure you can temporarily
move r1/r2 to a different register pair, and move the above inline, and
then move these back. The comment just after where you place it documents
the 'live' registers.
I'm not saying anything about the problem you're reporting; I'm trying
to teach you how to use the early debug correctly.
next prev parent reply other threads:[~2013-08-08 8:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-05 12:12 Kexec: BE kernel on ARM VE TC2 Vijay Kilari
2013-08-05 15:28 ` Ben Dooks
2013-08-08 6:16 ` Vijay Kilari
2013-08-08 8:36 ` Russell King - ARM Linux [this message]
2013-08-08 21:50 ` Will Deacon
2013-08-12 9:59 ` Vijay Kilari
2013-08-13 11:15 ` Will Deacon
2013-08-13 22:52 ` Nicolas Pitre
2013-08-14 5:46 ` Vijay Kilari
2013-08-14 15:19 ` Nicolas Pitre
2013-08-19 7:31 ` Vijay Kilari
2013-08-19 12:17 ` Vijay Kilari
2013-08-20 10:31 ` Vijay Kilari
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=20130808083622.GI23006@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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).