From owner-svn-src-head@freebsd.org Tue Sep 22 18:30:07 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 B5DADA062D9; Tue, 22 Sep 2015 18:30:07 +0000 (UTC) (envelope-from kib@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 A70C9189E; Tue, 22 Sep 2015 18:30:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8MIU7a0074900; Tue, 22 Sep 2015 18:30:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8MIU7c8074899; Tue, 22 Sep 2015 18:30:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201509221830.t8MIU7c8074899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 22 Sep 2015 18:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288123 - 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: Tue, 22 Sep 2015 18:30:07 -0000 Author: kib Date: Tue Sep 22 18:30:06 2015 New Revision: 288123 URL: https://svnweb.freebsd.org/changeset/base/288123 Log: Call ast when handling irq from userspace, otherwise we could miss reschedule. Right now arm_cpu_intr() does critical_exit() as the last action, so the impact is not serious. Remove duplicated interrupt disable in restore_registers macro, when returning to usermode. The do_ast macro disabled interrupts for us. Reviewed by: andrew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3714 Modified: head/sys/arm64/arm64/exception.S Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Tue Sep 22 18:16:52 2015 (r288122) +++ head/sys/arm64/arm64/exception.S Tue Sep 22 18:30:06 2015 (r288123) @@ -63,8 +63,13 @@ __FBSDID("$FreeBSD$"); .endm .macro restore_registers el - msr daifset, #2 /* Disable interrupts, x18 may change - * in the interrupt exception handler */ +.if \el == 1 + msr daifset, #2 + /* + * Disable interrupts, x18 may change in the interrupt exception + * handler. For EL0 exceptions, do_ast already did this. + */ +.endif ldp x18, lr, [sp], #16 ldp x10, x11, [sp], #16 .if \el == 0 @@ -155,6 +160,7 @@ handle_el0_irq: save_registers 0 mov x0, sp bl arm_cpu_intr + do_ast restore_registers 0 eret