Author: cognet
Date: Mon Feb 26 13:12:51 2018
New Revision: 330018
URL: https://svnweb.freebsd.org/changeset/base/330018

Log:
  In do_ast, make sure the interrupts are enabled before calling ast().
  We can reach that point with IRQs disabled, and calling ast() with IRQs 
  disabled can lead to a deadlock.
  This should fix the freezes on arm64 under load.
  
  Reviewed by:  andrew

Modified:
  head/sys/arm64/arm64/exception.S

Modified: head/sys/arm64/arm64/exception.S
==============================================================================
--- head/sys/arm64/arm64/exception.S    Mon Feb 26 12:01:42 2018        
(r330017)
+++ head/sys/arm64/arm64/exception.S    Mon Feb 26 13:12:51 2018        
(r330018)
@@ -26,6 +26,7 @@
  */
 
 #include <machine/asm.h>
+#include <machine/armreg.h>
 __FBSDID("$FreeBSD$");
 
 #include "assym.s"
@@ -114,9 +115,11 @@ __FBSDID("$FreeBSD$");
 .endm
 
 .macro do_ast
-       /* Disable interrupts */
        mrs     x19, daif
+       /* Make sure the IRQs are enabled before calling ast() */
+       bic     x19, x19, #PSR_I
 1:
+       /* Disable interrupts */
        msr     daifset, #2
 
        /* Read the current thread flags */
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to