From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1745C43331 for ; Fri, 3 Apr 2020 10:12:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9EF8720757 for ; Fri, 3 Apr 2020 10:12:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ceSA2yTJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zDi0W/4z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EF8720757 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To :Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fxWD5xD1kw2v28yDVrvDJkghPKBx/ATy5cWQRGW6rXI=; b=ceSA2yTJ/Q/v0Id6GLiWO+kRu 5A08+KFO7LCqNYW0jrrXhjhXQlJBmZWmZiUjezWeKEQIsLQaoqvHZ5IStQyp56riQrsfK9GnSnUav tTeXkS/NoxV2VvuMiiVTAxjtGFBvVxd1BwEXWU8fev+s7upfj32SainKv0SJdS5NYByj01nxiOiQa +Mq7xiDQGKAMPQm9VVoEyPPdCamUBree9WwQ0BGO73qM+KpIC5UMqPD69ngvVzVcr0ZT8gbqW19BZ QcxlArkDiEAtmEsfJfBQ2K26fSVr+lBWsQVi/omm4NAyB+z14kKYWwBdAOnZtCbiqs3Eojo9Sce0J PNqbysRbA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jKJJT-0007Os-GQ; Fri, 03 Apr 2020 10:12:35 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jKJJP-0007OC-OK for linux-riscv@lists.infradead.org; Fri, 03 Apr 2020 10:12:33 +0000 Received: by mail-wr1-x444.google.com with SMTP id j17so7747315wru.13 for ; Fri, 03 Apr 2020 03:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fxWD5xD1kw2v28yDVrvDJkghPKBx/ATy5cWQRGW6rXI=; b=zDi0W/4zhSRQ0MrYET/k3kVIY1ln6S7n48qg1chJSVbqXW9yM/0IO5KFqJXYvy1ui9 nf9YRLVhQbIaWBmc9xUvv0qn1pILp21V0Fdf304KGSTUUKZ8FW58CvJxyaK4ZkvvKKEC FqTepxF7OruGicK7sanOHdsTPgd7RleiokbMA85TIq0s/k+HMXj8Vefvh7EvHhFETjlF 7bx4WyTujIZq6muwzmH/ZsMWFf30gYKlBzBA+hpbXC27ypEy4NeuDQiRaE7F1aYV4b5x O8wIfqx+i8bpYDygsJsBJ7RjVAs+fxX+ry5Y28U63bvqtCMFuQNGenb/yvNYXMbn7Gmk NoSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fxWD5xD1kw2v28yDVrvDJkghPKBx/ATy5cWQRGW6rXI=; b=EWPOxNCdmDlzMJGaawp7Bbytg4rvv/C5p/Faax52iNNxckrajJccd5+YzTnr3RXxF/ qZN3pq0mqZLLTnPzJBHDYawhOUc+unfTsgH9B5aojmUxOcidvKfcydhOV7fHa95CYNnX vyXRr8L9yhD2lO6oOCyakCq74bDrHy65LTwTBUbpiQ+oh5BAZMRGP7ihQFivpTyw+L1Y BRMIc7hNr5LHmbR7LRiNwZFzoo3zUNF4Zy5KXuaY0lAMftA++gkosPqA/gDUojUOiloq 5Np9uIvwt+o8nUbmP5ARd6ZR3RC8eeKtcmlUdnsphrcUMqFidKnoHXqV5HYwJ1wsgxFN uPlg== X-Gm-Message-State: AGi0PuYSxpvQVMjtnpn4BYVxU41GcDdoR3mecMb7YoHePhEz75r/ehhj S7NcDHm0GuGbOZxC1h3gJhsrag== X-Google-Smtp-Source: APiQypIsfyXgVfhNO1vKd2FVpsPOslYIorcaKsbXxLEGP23BeSTs1ok53J13wfnFfwKRwXOL1o63ZQ== X-Received: by 2002:adf:a48d:: with SMTP id g13mr8758646wrb.38.1585908750118; Fri, 03 Apr 2020 03:12:30 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id 98sm11779642wrk.52.2020.04.03.03.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 03:12:29 -0700 (PDT) Date: Fri, 3 Apr 2020 11:12:27 +0100 From: Daniel Thompson To: Vincent Chen Subject: Re: [PATCH v2 0/5] riscv: Add KGDB and KDB support Message-ID: <20200403101227.74abwoyxzx4rlake@holly.lan> References: <1585668191-16287-1-git-send-email-vincent.chen@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1585668191-16287-1-git-send-email-vincent.chen@sifive.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200403_031231_862747_696C5318 X-CRM114-Status: GOOD ( 16.76 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kgdb-bugreport@lists.sourceforge.net, jason.wessel@windriver.com, dianders@chromium.org, palmer@dabbelt.com, paul.walmsley@sifive.com, linux-riscv@lists.infradead.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, Mar 31, 2020 at 11:23:06PM +0800, Vincent Chen wrote: > This patch set implements required ports to enable RISC-V kernel to support > KGDB and KDB features. Because there is no immediate value in the RISC-V > trap instruction, the kernel cannot identify the purpose of each trap > exception through the opcode. This makes the existing identification > schemes in other architecture unsuitable for the RISC-V kernel. In order > to solve this problem, this patch adds the kgdb_has_hit_break() to kgdb.c > to help the RISC-V kernel identify the KGDB trap exception. In addition, > the XML target description was introduced in this patch set to enable KGDB > to report the contents of the status, cause and steal registers. > > This patchset has passed the kgdbts test suite provided by Linux kernel on > HiFive unleashed board and QEMU. Can you share the defconfig and qemu boot lines used for testing. I'd like to see if they can easily be integrated into kgdbtest. Normally figuring out the qemu boot line is the hardest bit of adding support for an architecture one is not familar with. Daniel. PS At the moment it helps kgdbtest a lot if qemu is configured with two serial ports but I really should get round to relaxing that! > > Changes since v1: > 1. Replace the magic number with macro when filling the gdb_regs[]. > 2. Only support GDB XML packet instead of all query packets. > 3. Move the macros used to parse instrcuton to parse_asm.h > > > Vincent Chen (5): > kgdb: Add kgdb_has_hit_break function > riscv: Add KGDB support > kgdb: enable arch to support XML packet support. > riscv: Use the XML target descriptions to report 3 system registers > riscv: Add SW single-step support for KDB > > arch/riscv/Kconfig | 2 + > arch/riscv/include/asm/Kbuild | 1 - > arch/riscv/include/asm/gdb_xml.h | 117 ++++++++++++ > arch/riscv/include/asm/kdebug.h | 12 ++ > arch/riscv/include/asm/kgdb.h | 113 +++++++++++ > arch/riscv/include/asm/parse_asm.h | 214 +++++++++++++++++++++ > arch/riscv/kernel/Makefile | 1 + > arch/riscv/kernel/kgdb.c | 382 +++++++++++++++++++++++++++++++++++++ > arch/riscv/kernel/traps.c | 5 + > include/linux/kgdb.h | 9 + > kernel/debug/debug_core.c | 12 ++ > kernel/debug/gdbstub.c | 13 ++ > lib/Kconfig.kgdb | 5 + > 13 files changed, 885 insertions(+), 1 deletion(-) > create mode 100644 arch/riscv/include/asm/gdb_xml.h > create mode 100644 arch/riscv/include/asm/kdebug.h > create mode 100644 arch/riscv/include/asm/kgdb.h > create mode 100644 arch/riscv/include/asm/parse_asm.h > create mode 100644 arch/riscv/kernel/kgdb.c > > -- > 2.7.4 >