Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp949810imm; Sat, 14 Jul 2018 17:39:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdYLWLPhPCmjvxFNT97fk4xPrnQApwQG2y4RFsmPtJLRw3WuEenkcvLiEtnu4tivD5Udwn6 X-Received: by 2002:a65:428b:: with SMTP id j11-v6mr10720696pgp.200.1531615179837; Sat, 14 Jul 2018 17:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531615179; cv=none; d=google.com; s=arc-20160816; b=DN5j1x3ih/ze6+lkhjMYaUUEIWQh+nL76rlqUbJE3g7aWAm/yq6rvUeDEqUFgzaiD2 Q02gx4xTcbLnFJmRHeieLo4k4Tm5s1D5o5l48NqN2WVV6GqnTVjbsTs/oHizpWCVOP0H hJIGUii+ypQeW04RlubO5y0ShiQ2vo5eVfHQFzqtqb/Akg8Zs+NBNv4AJYLWSllMOFKc e6uLvnnz9Eo7/KtCKpx1LnJm39f93/iqEfWY2zuCvWAVQk1Q5Sj70by/Fmbstqc8hnzV OmTJC07yWHC4FUetBGNE5E5GFnnfbfp5a3YI+P/wOklUJ7dapilcV8/M1H1Unw5bEFe7 G1sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=LLi7oDyVUmGwjn4VbSGEb9paGFsJxF2mdUuOAQXcgKU=; b=V8KnS6Tew7zeT3hMgr3682Lm6H96dNqo/eUUjFXGE7VEgeLPHAF0JYB6bCGF78LMlq a5LBU9yQU9xzyWb++VNI3nRWDiY1WfhOyhCYi4ODsoisO6aM3HZWKOwsgC+JX+FnUrbW TTXVpTOXc/FijArDYAWPYKMPLfoTafoHvVh7E1CZv5arlFRxx+GvGSDRRI8zqZqQg+3r GdXNQkdCR/4DEigwNr3wJgGnjpVakLW/BgVn2nykpGzM0Qdt2Vyr2WzXH6ogro8ZiX4H Y3ypXzgwJV240kO9WSwP9DwytHANBKBNy13zl3WYuUXGflwiVlx0nCYxuefPXtL/d5U7 8oIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=i6MdIUa8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f200-v6si29662349pfa.164.2018.07.14.17.38.50; Sat, 14 Jul 2018 17:39:39 -0700 (PDT) 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; dkim=pass header.i=@sifive.com header.s=google header.b=i6MdIUa8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731955AbeGOA6L (ORCPT + 99 others); Sat, 14 Jul 2018 20:58:11 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:44507 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731877AbeGOA6L (ORCPT ); Sat, 14 Jul 2018 20:58:11 -0400 Received: by mail-pf0-f195.google.com with SMTP id j3-v6so24542971pfh.11 for ; Sat, 14 Jul 2018 17:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id; bh=LLi7oDyVUmGwjn4VbSGEb9paGFsJxF2mdUuOAQXcgKU=; b=i6MdIUa8e0su7yIcfzBqVBEG1AI+9lFhBYkXpryoj6ak3nS86g553jOsnz1YGg6CnR t8e6+0fdEh0m4iilnynYXKyDWZUcQUgGXUKtuNJF5K3biVa3LdoJOyPYkBt9kVXqDZzr 2XcvqaiwfyoHnvsHVv8jl8YLdFzWrWVRGcapw/5GVrqSJq0Ss5k/D3J/cuN6t85+SQaZ AQXuCbVLYf3Zjk930vDVSBPESeV3PRRzRxbDsmJR91MNFLI0GJeeaCU3dww0rfobSOqh 5XIyDN/FJnfCZ3g1XpK0/Iz7nZL89A+g5uGJLOno7TVWNBZC1wG+O3wk/AivQiWZi9mS JiJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LLi7oDyVUmGwjn4VbSGEb9paGFsJxF2mdUuOAQXcgKU=; b=uEcIDm1oZ3XNmn9ha+0vNIuDZojVHs4k9Ty/NIp58yjQ2oVxevhtXI1B6vfMRZWp+f RIZr9vGqrBQNzhNjL0orqfYCR4HmLIBLw9q2b2Jksxv1OVCnxhDLzJ/P9ytHbZsWTHBS q/i2028sOqHjcgKnQ71y7vtqy2m9APgJ22hIoyS8CuZstX2SaL0k3foh2qF/Wms6w5t1 xSVpa/KWDzY2kjOh1Eafoq4mg4l8GNI1twAIdIIdQ8lKUqxr+l/ErtaAp2U+MNL0Tytn IP4dadqgRZcK9lwQhkXeMCbF1uh8UpICI8i6omFE4R5l0pnNPXWJ+SrOK2DRxA/IrBvC g4ZQ== X-Gm-Message-State: AOUpUlEl1byBngOZBPtQHFOilmjGbaVl5BLyFTM0DFuHU9I2d6p6mB20 45axe/oSnwtjwdbs5aurpgcTjw== X-Received: by 2002:a65:448a:: with SMTP id l10-v6mr10916967pgq.382.1531615037886; Sat, 14 Jul 2018 17:37:17 -0700 (PDT) Received: from rohan.hsd1.ca.comcast.net ([2601:646:c103:8ec:512d:ce75:aa80:7b73]) by smtp.gmail.com with ESMTPSA id r25-v6sm14114672pfj.117.2018.07.14.17.37.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Jul 2018 17:37:16 -0700 (PDT) From: Jim Wilson To: linux-riscv@lists.infradead.org Cc: Jim Wilson , Palmer Dabbelt , Albert Ou , Atish Patra , Luc Van Oostenryck , linux-kernel@vger.kernel.org Subject: [PATCH] RISC-V: Don't increment sepc after breakpoint. Date: Sat, 14 Jul 2018 17:34:39 -0700 Message-Id: <20180715003442.32216-1-jimw@sifive.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding 4 to sepc is pointless, and is wrong if we executed a 2-byte compressed breakpoint. This plus a corresponding gdb patch allows compressed breakpoints to work in gdb. Gdb maintainers have already agreed that this is the right approach. Signed-off-by: Jim Wilson --- arch/riscv/kernel/traps.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 14fcec5bdd24..ae323071c786 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -150,7 +150,6 @@ asmlinkage void do_trap_break(struct pt_regs *regs) #endif /* CONFIG_GENERIC_BUG */ do_trap_siginfo(SIGTRAP, TRAP_BRKPT, regs->sepc, current); - regs->sepc += 0x4; } #ifdef CONFIG_GENERIC_BUG -- 2.17.1