diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-01-01 18:52:38 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-01-01 18:52:38 +0000 |
commit | 60c991aae884d5e9e686df7df6c758a7ffecf9c9 (patch) | |
tree | aef1042695c342ea2af9cf738bf27560927c9015 /sys/arch/arm64/dev/efi.c | |
parent | 3d36a01a9717514d3c9ddd7c2a988e24eae501b5 (diff) |
Rewrite the kernel FPU handling code. The new code saves the FPU state
in cpu_switch() instead of at the kernel edge and gets rid of the FPU
state tracking in struct cpu_info and struct pcb. This fixes the random
crashes seen with SMP kernels on Apple M1.
ok patrick@
Diffstat (limited to 'sys/arch/arm64/dev/efi.c')
-rw-r--r-- | sys/arch/arm64/dev/efi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/arm64/dev/efi.c b/sys/arch/arm64/dev/efi.c index 078ab74a163..a4b41b0a97e 100644 --- a/sys/arch/arm64/dev/efi.c +++ b/sys/arch/arm64/dev/efi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efi.c,v 1.11 2021/10/24 17:52:28 mpi Exp $ */ +/* $OpenBSD: efi.c,v 1.12 2022/01/01 18:52:37 kettenis Exp $ */ /* * Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org> @@ -25,7 +25,7 @@ #include <machine/cpufunc.h> #include <machine/bus.h> #include <machine/fdt.h> -#include <machine/vfp.h> +#include <machine/fpu.h> #include <dev/ofw/openfirm.h> #include <dev/ofw/fdt.h> @@ -232,7 +232,7 @@ efi_enter(struct efi_softc *sc) __asm volatile("isb"); cpu_setttb(pm->pm_asid, pm->pm_pt0pa); - vfp_kernel_enter(); + fpu_kernel_enter(); } void @@ -240,7 +240,7 @@ efi_leave(struct efi_softc *sc) { struct pmap *pm = curcpu()->ci_curpm; - vfp_kernel_exit(); + fpu_kernel_exit(); WRITE_SPECIALREG(ttbr0_el1, pmap_kernel()->pm_pt0pa); __asm volatile("isb"); |