Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 x86: Call fpuinit_mxcsr_mask only once.



details:   https://anonhg.NetBSD.org/src/rev/c23c760d5b2a
branches:  trunk
changeset: 373814:c23c760d5b2a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Mar 03 14:40:00 2023 +0000

description:
x86: Call fpuinit_mxcsr_mask only once.

No need to call it again and again on the secondary CPUs to compute
what should be the same mxcsr mask.  (If it's not, we have deeper
problems!)

diffstat:

 sys/arch/x86/x86/cpu.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r dadbf401a5ed -r c23c760d5b2a sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c    Fri Mar 03 14:32:48 2023 +0000
+++ b/sys/arch/x86/x86/cpu.c    Fri Mar 03 14:40:00 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.207 2023/02/25 00:31:40 riastradh Exp $      */
+/*     $NetBSD: cpu.c,v 1.208 2023/03/03 14:40:00 riastradh Exp $      */
 
 /*
  * Copyright (c) 2000-2020 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.207 2023/02/25 00:31:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.208 2023/03/03 14:40:00 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"                /* for MPDEBUG */
@@ -701,7 +701,8 @@
                ci->ci_feat_val[1] = descs[2];
        }
 
-       if (x86_fpu_save >= FPU_SAVE_FXSAVE) {
+       if (CPU_IS_PRIMARY(ci) &&
+           x86_fpu_save >= FPU_SAVE_FXSAVE) {
                fpuinit_mxcsr_mask();
        }
 



Home | Main Index | Thread Index | Old Index