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: 58481 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp382064lbb; Tue, 15 Dec 2015 16:38:33 -0800 (PST) X-Received: by 10.98.80.1 with SMTP id e1mr1235188pfb.121.1450226313804; Tue, 15 Dec 2015 16:38:33 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3si5135277pas.116.2015.12.15.16.38.33; Tue, 15 Dec 2015 16:38:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933839AbbLPAiP (ORCPT + 29 others); Tue, 15 Dec 2015 19:38:15 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:36589 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932992AbbLPAiN (ORCPT ); Tue, 15 Dec 2015 19:38:13 -0500 Received: by mail-pa0-f42.google.com with SMTP id nt2so3979572pab.3 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=M8FFKGK4GDkGJc0lOdXFf3HpOAD/rUxicvYfWTdgPES6LRC3HqGymCZYYY+UCAd3d3 +imvW2gK+RCRIWNI8bQ6+meD3YFmI4nKmsjW6T64EEpxZDDk3hq78vwHDdpxMmx2zwzM UeinxswEqfMFVmEQaAe3L3pQ/Gp/WhBdVuviCWsWaYdK4A4wHBsqN39RrTC4Errsoq8s X68EGRGY57OMhHv3cwOGkzN1/nrCHrVvTxa3X4PJTktPMgMYhKFC1aIUBdf9XtuUjHRo UV77/gM/elPqvLNOgZp28c324jwhvf3Auk1qZ1knSr91//ESCS78UpLKfJ5/glSI/Sg9 7WtA== X-Gm-Message-State: ALoCoQlAaEF+wbQsZP4T43q6RYg/wEZeG/llgrvhlZmHbzKv/T7cWfjTLUrRO73NalqL79TGI2NBf0j6tNr92fIjSKleBfGejw== 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, yang.shi@linaro.org 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ 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);