linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Russell King <linux@armlinux.org.uk>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Arnd Bergmann <arnd@arndb.de>, Nicolas Pitre <nico@fluxnic.net>,
	Linus Walleij <linus.walleij@linaro.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] RFC: ARM: head: Save lr in r11 while setting up page tables
Date: Fri,  4 Sep 2020 10:19:48 +0200	[thread overview]
Message-ID: <20200904081949.5594-3-linus.walleij@linaro.org> (raw)
In-Reply-To: <20200904081949.5594-1-linus.walleij@linaro.org>

We might need to use lr as we want to be able to call
the debug print functions, so save lr to r11 and restore
lr from r11 in __create_page_tables.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/kernel/head.S | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 2bfdf33aa74c..8b089c4c0d17 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -171,10 +171,11 @@ ENDPROC(stext)
  * r8 = phys_offset, r9 = cpuid, r10 = procinfo
  *
  * Returns:
- *  r0, r3, r5-r7 corrupted
+ *  r0, r3, r5-r7, r11 corrupted
  *  r4 = physical page table address
  */
 __create_page_tables:
+	mov	r11, lr				@ we need to be able to call prints
 	pgtbl	r4, r8				@ page table address
 
 	/*
@@ -350,6 +351,7 @@ __create_page_tables:
 #ifdef CONFIG_ARM_LPAE
 	sub	r4, r4, #0x1000		@ point to the PGD table
 #endif
+	mov	lr, r11
 	ret	lr
 ENDPROC(__create_page_tables)
 	.ltorg
-- 
2.26.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-09-04  8:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04  8:19 [PATCH 0/3] RFC: ARM section mapping debug prints Linus Walleij
2020-09-04  8:19 ` [PATCH 1/3] RFC: ARM: head: Use non-conditional instructions Linus Walleij
2020-09-04  8:19 ` Linus Walleij [this message]
2020-09-04 14:53   ` [PATCH 2/3] RFC: ARM: head: Save lr in r11 while setting up page tables Nicolas Pitre
2020-09-04  8:19 ` [PATCH 3/3] RFC: ARM: head: Debug prints for section mappings Linus Walleij
2020-09-04 15:51   ` Nicolas Pitre
2020-09-04 18:33     ` Nicolas Pitre

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=20200904081949.5594-3-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=geert+renesas@glider.be \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=nico@fluxnic.net \
    /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).