diff mbox series

[RFC,3/4] asm/head.S: set POWER9 radix HID bit at entry

Message ID 20190302130626.19647-4-npiggin@gmail.com
State Superseded
Headers show
Series virtual memory for OPAL boot | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot fail Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Nicholas Piggin March 2, 2019, 1:06 p.m. UTC
When running in virtual memory mode, the radix MMU hid bit should not
be changed, so set this in the initial boot SPR setup.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 asm/head.S    | 3 +++
 core/cpu.c    | 2 +-
 core/init.c   | 3 ---
 include/cpu.h | 1 -
 4 files changed, 4 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/asm/head.S b/asm/head.S
index 0ed1acddd..916b22c51 100644
--- a/asm/head.S
+++ b/asm/head.S
@@ -766,9 +766,12 @@  init_shared_sprs:
 	mtspr	SPR_TSCR, %r3
 	/* HID0: Clear bit 5 (enable core recovery)
 	 *       Clear bit 4 (HILE)
+	 *       Set bit 8 (radix)
 	 */
 	mfspr	%r3,SPR_HID0
 	li	%r0,1
+	sldi	%r4,%r0,(63-8)
+	or	%r3,%r3,%r4
 	sldi	%r4,%r0,(63-5)
 	sldi	%r5,%r0,(63-4)
 	or	%r0,%r4,%r5
diff --git a/core/cpu.c b/core/cpu.c
index d9d471337..07dab90a9 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -1433,7 +1433,7 @@  static int64_t cpu_change_all_hid0(struct hid0_change_req *req)
 	return OPAL_SUCCESS;
 }
 
-void cpu_set_radix_mode(void)
+static void cpu_set_radix_mode(void)
 {
 	struct hid0_change_req req;
 
diff --git a/core/init.c b/core/init.c
index 6630a9250..5d427af0b 100644
--- a/core/init.c
+++ b/core/init.c
@@ -1271,9 +1271,6 @@  void __noreturn __nomcount main_cpu_entry(const void *fdt)
 
 	prd_register_reserved_memory();
 
-	/* On P9, switch to radix mode by default */
-	cpu_set_radix_mode();
-
 	checksum_romem();
 
 	load_and_boot_kernel(false);
diff --git a/include/cpu.h b/include/cpu.h
index 06d5c0d11..10515fff5 100644
--- a/include/cpu.h
+++ b/include/cpu.h
@@ -313,7 +313,6 @@  extern unsigned long __attrconst cpu_emergency_stack_top(unsigned int pir);
 extern void cpu_idle_job(void);
 extern void cpu_idle_delay(unsigned long delay);
 
-extern void cpu_set_radix_mode(void);
 extern void cpu_fast_reboot_complete(void);
 
 int dctl_set_special_wakeup(struct cpu_thread *t);