From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/9] arm64: kernel: use ordinary return/argument register for el2_setup()
Date: Wed, 24 Aug 2016 16:36:00 +0200 [thread overview]
Message-ID: <1472049366-10922-4-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1472049366-10922-1-git-send-email-ard.biesheuvel@linaro.org>
The function el2_setup() passes its return value in register w20, and
in the two cases where the caller actually cares about this return value,
it is passed into set_cpu_boot_mode_flag() [almost] directly, which
expects its input in w20 as well.
So there is no reason to use a 'special' callee saved register here, but
we can simply follow the PCS for return value and first argument,
respectively.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
arch/arm64/kernel/head.S | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index 219676253dbc..2871271123e7 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -210,7 +210,7 @@ efi_header_end:
ENTRY(stext)
bl preserve_boot_args
- bl el2_setup // Drop to EL1, w20=cpu_boot_mode
+ bl el2_setup // Drop to EL1, w0=cpu_boot_mode
adrp x24, __PHYS_OFFSET
and x23, x24, MIN_KIMG_ALIGN - 1 // KASLR offset, defaults to 0
bl set_cpu_boot_mode_flag
@@ -488,7 +488,7 @@ CPU_LE( bic x0, x0, #(1 << 25) ) // Clear the EE bit for EL2
CPU_BE( orr x0, x0, #(3 << 24) ) // Set the EE and E0E bits for EL1
CPU_LE( bic x0, x0, #(3 << 24) ) // Clear the EE and E0E bits for EL1
msr sctlr_el1, x0
- mov w20, #BOOT_CPU_MODE_EL1 // This cpu booted in EL1
+ mov w0, #BOOT_CPU_MODE_EL1 // This cpu booted in EL1
isb
ret
@@ -584,7 +584,7 @@ CPU_LE( movk x0, #0x30d0, lsl #16 ) // Clear EE and E0E on LE systems
cbz x2, install_el2_stub
- mov w20, #BOOT_CPU_MODE_EL2 // This CPU booted in EL2
+ mov w0, #BOOT_CPU_MODE_EL2 // This CPU booted in EL2
isb
ret
@@ -599,7 +599,7 @@ install_el2_stub:
PSR_MODE_EL1h)
msr spsr_el2, x0
msr elr_el2, lr
- mov w20, #BOOT_CPU_MODE_EL2 // This CPU booted in EL2
+ mov w0, #BOOT_CPU_MODE_EL2 // This CPU booted in EL2
eret
ENDPROC(el2_setup)
@@ -609,10 +609,10 @@ ENDPROC(el2_setup)
*/
set_cpu_boot_mode_flag:
adr_l x1, __boot_cpu_mode
- cmp w20, #BOOT_CPU_MODE_EL2
+ cmp w0, #BOOT_CPU_MODE_EL2
b.ne 1f
add x1, x1, #4
-1: str w20, [x1] // This CPU has booted in EL1
+1: str w0, [x1] // This CPU has booted in EL1
dmb sy
dc ivac, x1 // Invalidate potentially stale cache line
ret
@@ -637,7 +637,7 @@ ENTRY(__boot_cpu_mode)
* cores are held until we're ready for them to initialise.
*/
ENTRY(secondary_holding_pen)
- bl el2_setup // Drop to EL1, w20=cpu_boot_mode
+ bl el2_setup // Drop to EL1, w0=cpu_boot_mode
bl set_cpu_boot_mode_flag
mrs x0, mpidr_el1
mov_q x1, MPIDR_HWID_BITMASK
--
2.7.4
next prev parent reply other threads:[~2016-08-24 14:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-24 14:35 [PATCH v2 0/9] arm64: clean up early boot function calls Ard Biesheuvel
2016-08-24 14:35 ` [PATCH v2 1/9] arm64: kernel: get rid of x25 and x26 with 'global' scope Ard Biesheuvel
2016-08-24 14:35 ` [PATCH v2 2/9] arm64: kernel: fix style issues in sleep.S Ard Biesheuvel
2016-08-24 16:13 ` Mark Rutland
2016-08-24 14:36 ` Ard Biesheuvel [this message]
2016-08-24 16:20 ` [PATCH v2 3/9] arm64: kernel: use ordinary return/argument register for el2_setup() Mark Rutland
2016-08-24 14:36 ` [PATCH v2 4/9] arm64: head.S: move KASLR processing out of __enable_mmu() Ard Biesheuvel
2016-08-24 20:36 ` Mark Rutland
2016-08-24 20:44 ` Ard Biesheuvel
2016-08-24 20:46 ` Mark Rutland
2016-08-25 13:59 ` Ard Biesheuvel
2016-08-30 10:24 ` Mark Rutland
2016-08-30 13:45 ` Mark Rutland
2016-08-24 14:36 ` [PATCH v2 5/9] arm64: kernel: use x30 for __enable_mmu return address Ard Biesheuvel
2016-08-24 14:36 ` [PATCH v2 6/9] arm64: call __enable_mmu as an ordinary function for secondary/resume Ard Biesheuvel
2016-08-30 14:07 ` Mark Rutland
2016-08-24 14:36 ` [PATCH v2 7/9] arm64: kernel: drop use of x24 from primary boot path Ard Biesheuvel
2016-08-30 14:26 ` Mark Rutland
2016-08-24 14:36 ` [PATCH v2 8/9] arm64: head.S: use ordinary stack frame for __primary_switched() Ard Biesheuvel
2016-08-30 14:38 ` Mark Rutland
2016-08-24 14:36 ` [PATCH v2 9/9] arm64: head.S: document the use of callee saved registers Ard Biesheuvel
2016-08-30 14:43 ` Mark Rutland
2016-08-30 14:48 ` [PATCH v2 0/9] arm64: clean up early boot function calls Mark Rutland
2016-08-30 14:50 ` Ard Biesheuvel
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=1472049366-10922-4-git-send-email-ard.biesheuvel@linaro.org \
--to=ard.biesheuvel@linaro.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;
as well as URLs for NNTP newsgroup(s).