From: geoff@infradead.org (Geoff Levand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/5] arm64: Fix the soft_restart routine
Date: Mon, 16 Dec 2013 16:19:29 -0800 [thread overview]
Message-ID: <1387239569.1002.151.camel@smoke> (raw)
In-Reply-To: <cover.1386879684.git.geoff@infradead.org>
Change the soft_restart() routine to call cpu_reset() at its identity mapped
physical address.
The cpu_reset() routine must be called at its identity mapped physical address
so that when the MMU is turned off the instruction pointer will be at the correct
location in physical memory.
Signed-off-by: Geoff Levand <geoff@infradead.org> for Huawei, Linaro
---
v2: Use typecast and variable for call as in arm code.
arch/arm64/kernel/process.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index de17c89..88e50fc 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -71,8 +71,14 @@ static void setup_restart(void)
void soft_restart(unsigned long addr)
{
+ typedef void (*phys_reset_t)(unsigned long);
+ phys_reset_t phys_reset;
+
setup_restart();
- cpu_reset(addr);
+
+ /* Switch to the identity mapping. */
+ phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset);
+ phys_reset(addr);
}
/*
--
1.8.1.2
prev parent reply other threads:[~2013-12-17 0:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-12 20:39 [PATCH 0/5] a few small fixups for arm64 Geoff Levand
2013-12-12 20:39 ` [PATCH 1/5] arm64: Fix __data_loc value Geoff Levand
2013-12-13 17:46 ` Russell King - ARM Linux
2013-12-13 18:17 ` Catalin Marinas
2013-12-14 0:20 ` Geoff Levand
2013-12-12 20:39 ` [PATCH 4/5] arm64: Add missing AT() macros to vmlinux.lds.S Geoff Levand
2013-12-13 16:49 ` Will Deacon
2013-12-14 0:20 ` Geoff Levand
2013-12-12 20:39 ` [PATCH 5/5] arm64: Add LOAD_OFFSET symbol for linker scripts Geoff Levand
2013-12-13 16:45 ` Will Deacon
2013-12-14 0:20 ` Geoff Levand
2013-12-14 0:31 ` Jason Gunthorpe
2013-12-16 17:29 ` Will Deacon
2013-12-17 0:21 ` Geoff Levand
2013-12-12 20:39 ` [PATCH 2/5] arm64: Fix the soft_restart routine Geoff Levand
2013-12-13 16:46 ` Will Deacon
2013-12-17 0:20 ` Geoff Levand
2013-12-12 20:39 ` [PATCH 3/5] arm64: Fix include header order in vmlinux.lds.S Geoff Levand
2013-12-14 0:20 ` [PATCH v2 1/5] arm64: Remove unused __data_loc variable Geoff Levand
2013-12-20 12:05 ` Catalin Marinas
2013-12-17 0:19 ` Geoff Levand [this message]
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=1387239569.1002.151.camel@smoke \
--to=geoff@infradead.org \
--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