From patchwork Wed Dec 16 00:18:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 7858251 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 584309F350 for ; Wed, 16 Dec 2015 00:40:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 603B1203C1 for ; Wed, 16 Dec 2015 00:40:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 87E57203A9 for ; Wed, 16 Dec 2015 00:40:21 +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 1a9072-0008Ag-Ve; Wed, 16 Dec 2015 00:38:36 +0000 Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a906z-00088i-VT for linux-arm-kernel@lists.infradead.org; Wed, 16 Dec 2015 00:38:34 +0000 Received: by mail-pa0-x22e.google.com with SMTP id wq6so13793290pac.1 for ; Tue, 15 Dec 2015 16:38:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Q+u6Z3XIF5iqCmxHH2S5FrmWPeFHR/AmGYpFBGLN5pc=; b=AyJLwEHbmR/WCnutRA1bSfICzNWrUNzZVk9/lUJhtHwDBfVsjU57yD63z+0CVohlSa x/bv8bd7jpckQj/2vEMKWX6naRyFmiavZIyCLMzXTp4QeSPSJmlr+wJ2aAcVn4OYRYPD bTs3vZhpc8MeqkivfFiQb8JfXCIaAUG6OZ8cc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Q+u6Z3XIF5iqCmxHH2S5FrmWPeFHR/AmGYpFBGLN5pc=; b=edqqfHSD1fBsUOwmI/IUBwpVtzCXq0Ltm2ExL0SmDm3ENh6KZt/mOnTYK2WTd0ntUi F8H9J+K/b6YSOqAOgE5ppp+m/YlEkjb7sscA/22wmSO+Sgeu2WcdUTSoTi3P5Mz35f/C XJbVMvM/Xgbo0GE90TQE+OQIpBFQvNIsNPrTCtwka5WBIVzucTDesRiTbNbuMSm6Wc5m 9kF/O9Ru7m1QCPdYxOiJXV2BhXE0c3P+T0tPdcmnXzdTYfkAmdgplM38Bf11xMCDGoti q/y/FS8trgdoKhpJPZvtVv8zzH+dLtG/Y5l6jeEbNTeoyvGJ/D3nJJeero1pyE7dY4F2 ENJA== X-Gm-Message-State: ALoCoQmnxZ4jxOCfw9gc1ZEcvBk25DPhK/YZKftIx8pxTmG4v0qYPFhjUayr+haa0+lDhC4dsPkfQbvvkn2SZhoaJF2n/87afw== X-Received: by 10.66.229.2 with SMTP id sm2mr59298294pac.28.1450226292527; Tue, 15 Dec 2015 16:38:12 -0800 (PST) Received: from yshi-Precision-T5600.corp.ad.wrs.com (unknown-216-82.windriver.com. [147.11.216.82]) by smtp.gmail.com with ESMTPSA id s62sm481381pfi.92.2015.12.15.16.38.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Dec 2015 16:38:11 -0800 (PST) From: Yang Shi To: Will.Deacon@arm.com, Catalin.Marinas@arm.com Subject: [PATCH] arm64: reenable interrupt when handling ptrace breakpoint Date: Tue, 15 Dec 2015 16:18:08 -0800 Message-Id: <1450225088-2456-1-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151215_163834_059842_2EB01228 X-CRM114-Status: GOOD ( 10.65 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yang.shi@linaro.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The kernel just send out a SIGTRAP signal when handling ptrace breakpoint in debug exception, so it sounds safe to have interrupt enabled if it is not disabled by the parent process. Signed-off-by: Yang Shi --- arch/arm64/kernel/debug-monitors.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index 8aee3ae..90d70e4 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c @@ -239,6 +239,9 @@ static int single_step_handler(unsigned long addr, unsigned int esr, return 0; if (user_mode(regs)) { + if (interrupts_enabled(regs)) + local_irq_enable(); + info.si_signo = SIGTRAP; info.si_errno = 0; info.si_code = TRAP_HWBKPT; @@ -310,6 +313,9 @@ static int brk_handler(unsigned long addr, unsigned int esr, siginfo_t info; if (user_mode(regs)) { + if (interrupts_enabled(regs)) + local_irq_enable(); + info = (siginfo_t) { .si_signo = SIGTRAP, .si_errno = 0, @@ -337,6 +343,10 @@ int aarch32_break_handler(struct pt_regs *regs) if (!compat_user_mode(regs)) return -EFAULT; + /* COMPAT_PSR_I_BIT has the same bit mask with non-compat one */ + if (interrupts_enabled(regs)) + local_irq_enable(); + if (compat_thumb_mode(regs)) { /* get 16-bit Thumb instruction */ get_user(thumb_instr, (u16 __user *)pc);