Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/arch/arm/vfp Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/08010220c953
branches:  netbsd-7
changeset: 799131:08010220c953
user:      snj <snj%NetBSD.org@localhost>
date:      Sat Mar 21 17:51:21 2015 +0000

description:
Pull up following revision(s) (requested by martin in ticket #621):
        sys/arch/arm/vfp/vfp_init.c: revisions 1.43-1.46
If we own the FPU, don't take anymore undefined faults.  Instead generate
SIGILLs since we obviously don't understand the instruction.
--
Don't try to catch undefined VFP instructions if we own the the FPU.
Let them raise SIGILL.
--
Not only check to see if we own the VFP but that the VFP is enabled.
--
Remove extra )

diffstat:

 sys/arch/arm/vfp/vfp_init.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 82992fdc580d -r 08010220c953 sys/arch/arm/vfp/vfp_init.c
--- a/sys/arch/arm/vfp/vfp_init.c       Sat Mar 21 17:49:03 2015 +0000
+++ b/sys/arch/arm/vfp/vfp_init.c       Sat Mar 21 17:51:21 2015 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: vfp_init.c,v 1.41 2014/07/18 22:54:53 matt Exp $ */
+/*      $NetBSD: vfp_init.c,v 1.41.2.1 2015/03/21 17:51:21 snj Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -373,7 +373,8 @@
        install_coproc_handler(VFP_COPROC, vfp_handler);
        install_coproc_handler(VFP_COPROC2, vfp_handler);
 #ifdef CPU_CORTEX
-       install_coproc_handler(CORE_UNKNOWN_HANDLER, neon_handler);
+       if (cpu_neon_present)
+               install_coproc_handler(CORE_UNKNOWN_HANDLER, neon_handler);
 #endif
 }
 
@@ -396,6 +397,11 @@
         * If we are just changing/fetching FPSCR, don't bother loading it.
         */
        if (!vfp_fpscr_handler(address, insn, frame, fault_code))
+               return 1;
+
+       /* if we already own the FPU and it's enabled, raise SIGILL */
+       if (curcpu()->ci_pcu_curlwp[PCU_FPU] == curlwp
+           && (armreg_fpexc_read() & VFP_FPEXC_EN) != 0)
                return 0;
 
        /*
@@ -465,6 +471,11 @@
        if (fault_code != FAULT_USER)
                panic("NEON fault in non-user mode");
 
+       /* if we already own the FPU and it's enabled, raise SIGILL */
+       if (curcpu()->ci_pcu_curlwp[PCU_FPU] == curlwp
+           && (armreg_fpexc_read() & VFP_FPEXC_EN) != 0)
+               return 0;
+
        pcu_load(&arm_vfp_ops);
 
        /* Need to restart the faulted instruction.  */



Home | Main Index | Thread Index | Old Index