diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2024-03-29 21:12:59 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2024-03-29 21:12:59 +0000 |
commit | 709c24d53bd1b25332336c9d6719d717f5a911fb (patch) | |
tree | 94d9bd08e22b0daff9a01493e6a8f1ecf01f94ca /sys | |
parent | 43d316f59fac68678028c06a834ada4c9af8c774 (diff) |
Be sure to reset p->p_md.md_fpstate to NULL after freeing it in cpu_exit().
There should hopefully be no further faults on this proc causing an fpu
state to be handled, but better play safe than sorry.
ok claudio@ kettenis@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc64/sparc64/vm_machdep.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/sparc64/sparc64/vm_machdep.c b/sys/arch/sparc64/sparc64/vm_machdep.c index c5016aed0fd..ea8c23b71ef 100644 --- a/sys/arch/sparc64/sparc64/vm_machdep.c +++ b/sys/arch/sparc64/sparc64/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.43 2024/02/19 09:59:29 claudio Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.44 2024/03/29 21:12:58 miod Exp $ */ /* $NetBSD: vm_machdep.c,v 1.38 2001/06/30 00:02:20 eeh Exp $ */ /* @@ -252,7 +252,7 @@ fpusave_proc(struct proc *p, int save) continue; sparc64_send_ipi(ci->ci_itid, save ? ipi_save_fpstate : ipi_drop_fpstate, (vaddr_t)p, 0); - while(ci->ci_fpproc == p) + while (ci->ci_fpproc == p) membar_sync(); break; } @@ -275,6 +275,7 @@ cpu_exit(struct proc *p) if (p->p_md.md_fpstate != NULL) { fpusave_proc(p, 0); free(p->p_md.md_fpstate, M_SUBPROC, sizeof(struct fpstate)); + p->p_md.md_fpstate = NULL; } pmap_deactivate(p); |