From owner-svn-src-head@freebsd.org Thu Jul 30 13:59:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A739F9AEE2C; Thu, 30 Jul 2015 13:59:39 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9789EA30; Thu, 30 Jul 2015 13:59:39 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6UDxdOa054059; Thu, 30 Jul 2015 13:59:39 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6UDxdIx054058; Thu, 30 Jul 2015 13:59:39 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201507301359.t6UDxdIx054058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Thu, 30 Jul 2015 13:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286072 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2015 13:59:39 -0000 Author: zbb Date: Thu Jul 30 13:59:38 2015 New Revision: 286072 URL: https://svnweb.freebsd.org/changeset/base/286072 Log: Enable IRQ during syscalls on ARM64 FreeBSD provides a feature called Adaptive Mutexes, which allows a thread to spin for a while when the mutex is taken instead of immediately going to sleep. This causes issues when called from syscall handler if interrupts are masked. If every other core also attempts to access the same mutex there is a chance that all of them are spinning on the same lock at the same time. If interrupts are disabled, no kernel preemtion can occur and the system becomes unresponsive. This patch enables interrupts when syscall is being executed and masks them as soon as it is completed. Reviewed by: andrew Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3246 Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Thu Jul 30 13:45:34 2015 (r286071) +++ head/sys/arm64/arm64/trap.c Thu Jul 30 13:59:38 2015 (r286072) @@ -319,6 +319,12 @@ do_el0_sync(struct trapframe *frame) #endif break; case EXCP_SVC: + /* + * Ensure the svc_handler is being run with interrupts enabled. + * They will be automatically restored when returning from + * exception handler. + */ + intr_enable(); svc_handler(frame); break; case EXCP_INSN_ABORT_L: