From 897addd938bcb5e0654aa6025f357b4c51aca42d Mon Sep 17 00:00:00 2001 From: kettenis Date: Sun, 2 May 2021 21:47:51 +0000 Subject: [PATCH] Initialize per-CPU pointer register earlier. ok patrick@ --- sys/arch/arm64/arm64/machdep.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/arch/arm64/arm64/machdep.c b/sys/arch/arm64/arm64/machdep.c index 11607572fe4..10f63a8d210 100644 --- a/sys/arch/arm64/arm64/machdep.c +++ b/sys/arch/arm64/arm64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.61 2021/03/17 12:03:40 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.62 2021/05/02 21:47:51 kettenis Exp $ */ /* * Copyright (c) 2014 Patrick Wildt * @@ -760,6 +760,13 @@ initarm(struct arm64_bootparams *abp) int (*map_func_save)(bus_space_tag_t, bus_addr_t, bus_size_t, int, bus_space_handle_t *); + /* + * Set the per-CPU pointer with a backup in tpidr_el1 to be + * loaded when entering the kernel from userland. + */ + __asm volatile("mov x18, %0\n" + "msr tpidr_el1, %0" :: "r"(&cpu_info_primary)); + pmap_map_early((paddr_t)config, PAGE_SIZE); if (!fdt_init(config) || fdt_get_size(config) == 0) panic("initarm: no FDT"); @@ -832,14 +839,6 @@ initarm(struct arm64_bootparams *abp) } } - /* - * Set the per-CPU pointer with a backup in tpidr_el1 to be - * loaded when entering the kernel from userland. - */ - __asm __volatile( - "mov x18, %0 \n" - "msr tpidr_el1, %0" :: "r"(&cpu_info_primary)); - cache_setup(); process_kernel_args(); -- 2.20.1