From patchwork Tue Jun 23 00:08:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Stone X-Patchwork-Id: 6658461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D614EC05AC for ; Tue, 23 Jun 2015 00:11:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13EF52056C for ; Tue, 23 Jun 2015 00:11:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 04F0720567 for ; Tue, 23 Jun 2015 00:11:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z7BmT-0001SS-IR; Tue, 23 Jun 2015 00:09:37 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z7BmO-0001Ol-Tu for linux-arm-kernel@lists.infradead.org; Tue, 23 Jun 2015 00:09:33 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 94B84B6F3B; Tue, 23 Jun 2015 00:09:11 +0000 (UTC) Received: from moya.redhat.com (ovpn-113-167.phx2.redhat.com [10.3.113.167]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5N09BLo030143; Mon, 22 Jun 2015 20:09:11 -0400 From: Josh Stone To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: enable_irq before ret_fast_syscall tracing Date: Mon, 22 Jun 2015 17:08:54 -0700 Message-Id: <1435018134-9653-1-git-send-email-jistone@redhat.com> In-Reply-To: <20150604100625.GI7557@n2100.arm.linux.org.uk> References: <20150604100625.GI7557@n2100.arm.linux.org.uk> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150622_170932_983909_7FF6EDC7 X-CRM114-Status: GOOD ( 10.10 ) X-Spam-Score: -8.3 (--------) Cc: Josh Stone , Russell King X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When reached via the slow path __sys_trace, __sys_trace_return and its callees usually have interrupts still enabled. This is important if any will schedule, like for a ptrace syscall-exit-stop. In the rarer case where tracing was not enabled on syscall entry, and then ret_fast_syscall sees tracing was enabled mid-syscall, then it also ought to branch to __sys_trace_return with interrupts enabled. Cc: Russell King Signed-off-by: Josh Stone --- arch/arm/kernel/entry-common.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 4e7f40c577e6..5d8eb11b8571 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -35,7 +35,7 @@ ret_fast_syscall: disable_irq @ disable interrupts ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing tst r1, #_TIF_SYSCALL_WORK - bne __sys_trace_return + bne ret_fast_syscall_trace tst r1, #_TIF_WORK_MASK bne fast_work_pending asm_trace_hardirqs_on @@ -45,6 +45,10 @@ ret_fast_syscall: ct_user_enter restore_user_regs fast = 1, offset = S_OFF + +ret_fast_syscall_trace: + enable_irq @ enable interrupts + b __sys_trace_return UNWIND(.fnend ) /*