qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alvin Chang via <qemu-devel@nongnu.org>
To: <qemu-riscv@nongnu.org>, <qemu-devel@nongnu.org>
Cc: <alistair.francis@wdc.com>, <bin.meng@windriver.com>,
	<liwei1518@gmail.com>, <dbarboza@ventanamicro.com>,
	<zhiwei_liu@linux.alibaba.com>, <vivahavey@gmail.com>,
	Alvin Chang <alvinga@andestech.com>,
	Yu-Ming Chang <yumin686@andestech.com>
Subject: [PATCH v3 1/2] target/riscv: Add "debug-1.0" to specify debug specification v1.0
Date: Mon, 1 Dec 2025 09:42:54 +0800	[thread overview]
Message-ID: <20251201014255.230069-2-alvinga@andestech.com> (raw)
In-Reply-To: <20251201014255.230069-1-alvinga@andestech.com>

Currently RISC-V CPU has a property "debug" which is equivalent to old
debug specification v0.13 version. Now we have ratified debug
specification v1.0 version. To support both versions, we add "debug-1.0"
as one of RISC-V CPU property to let user specify that debug v0.13 or
debug v1.0 is enabled. When debug-1.0=false CPU fallbacks to default
v0.13 version.

Note that "debug-1.0" depends on "debug" property ("debug" is default
true). Take "max" for example, the possible settings are:
* -cpu max                --> debug v0.13 is default enabled
* -cpu max,debug=false    --> debug is disabled
* -cpu max,debug-1.0=true --> debug is enabled and the version is v1.0

Signed-off-by: Alvin Chang <alvinga@andestech.com>
Reviewed-by: Yu-Ming Chang <yumin686@andestech.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
---
 target/riscv/cpu.c                | 1 +
 target/riscv/cpu_cfg_fields.h.inc | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 73d4280..082035b 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -2637,6 +2637,7 @@ RISCVCPUImpliedExtsRule *riscv_multi_ext_implied_rules[] = {
 
 static const Property riscv_cpu_properties[] = {
     DEFINE_PROP_BOOL("debug", RISCVCPU, cfg.debug, true),
+    DEFINE_PROP_BOOL("debug-1.0", RISCVCPU, cfg.debug_1_00, false),
 
     {.name = "pmu-mask", .info = &prop_pmu_mask},
     {.name = "pmu-num", .info = &prop_pmu_num}, /* Deprecated */
diff --git a/target/riscv/cpu_cfg_fields.h.inc b/target/riscv/cpu_cfg_fields.h.inc
index a154ecd..402b255 100644
--- a/target/riscv/cpu_cfg_fields.h.inc
+++ b/target/riscv/cpu_cfg_fields.h.inc
@@ -151,6 +151,7 @@ BOOL_FIELD(ext_XVentanaCondOps)
 BOOL_FIELD(mmu)
 BOOL_FIELD(pmp)
 BOOL_FIELD(debug)
+BOOL_FIELD(debug_1_00)
 BOOL_FIELD(misa_w)
 
 BOOL_FIELD(short_isa_string)
-- 
2.43.0



  reply	other threads:[~2025-12-01  1:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01  1:42 [PATCH v3 0/2] RISC-V: Initial support versioning of debug specification Alvin Chang via
2025-12-01  1:42 ` Alvin Chang via [this message]
2025-12-01  1:42 ` [PATCH v3 2/2] target/riscv: Simpily support versioning of debug trigger module Alvin Chang via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251201014255.230069-2-alvinga@andestech.com \
    --to=qemu-devel@nongnu.org \
    --cc=alistair.francis@wdc.com \
    --cc=alvinga@andestech.com \
    --cc=bin.meng@windriver.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=liwei1518@gmail.com \
    --cc=qemu-riscv@nongnu.org \
    --cc=vivahavey@gmail.com \
    --cc=yumin686@andestech.com \
    --cc=zhiwei_liu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).