qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Chao Liu" <chao.liu@openatom.club>
To: "Conor Dooley" <conor@kernel.org>, "Chao Liu" <chao.liu@zevorn.cn>
Cc: <richard.henderson@linaro.org>, <paolo.savini@embecosm.com>,
	 <npiggin@gmail.com>, <ebiggers@kernel.org>,
	<dbarboza@ventanamicro.com>,  <palmer@dabbelt.com>,
	<alistair.francis@wdc.com>, <liwei1518@gmail.com>,
	 <zhiwei_liu@linux.alibaba.com>, <qemu-riscv@nongnu.org>,
	 <qemu-devel@nongnu.org>,
	<hust-os-kernel-patches@googlegroups.com>
Subject: Re: [PATCH v1 1/5] target/riscv: add thead-c908 cpu support
Date: Thu, 4 Dec 2025 10:59:47 +0800	[thread overview]
Message-ID: <20499d8c-cc75-4354-9eee-4d2e7023bd4c@openatom.club> (raw)
In-Reply-To: <20251203-huskiness-manhandle-6925834ee8f0@spud>

On 12/4/2025 1:13 AM, Conor Dooley wrote:
> On Wed, Dec 03, 2025 at 05:12:37PM +0000, Conor Dooley wrote:
>> On Sun, Nov 30, 2025 at 05:21:06PM +0800, Chao Liu wrote:
>>> The C908 processor is based on the RV64GCB[V] instruction
>>> set, compatible to RVA22 Profile and implements the XIE
>>> (XuanTie Instruction Extension) technology.
>>>
>>> Signed-off-by: Chao Liu <chao.liu@zevorn.cn>
>>> Suggested-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
>>> ---
>>>  target/riscv/cpu-qom.h |   2 +
>>>  target/riscv/cpu.c     |  43 +++++
>>>  target/riscv/th_csr.c  | 380 ++++++++++++++++++++++++++++++++++++++++-
>>>  3 files changed, 424 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h
>>> index 75f4e43408..1ddb5a6a6c 100644
>>> --- a/target/riscv/cpu-qom.h
>>> +++ b/target/riscv/cpu-qom.h
>>> @@ -52,6 +52,8 @@
>>>  #define TYPE_RISCV_CPU_SIFIVE_U34       RISCV_CPU_TYPE_NAME("sifive-u34")
>>>  #define TYPE_RISCV_CPU_SIFIVE_U54       RISCV_CPU_TYPE_NAME("sifive-u54")
>>>  #define TYPE_RISCV_CPU_THEAD_C906       RISCV_CPU_TYPE_NAME("thead-c906")
>>> +#define TYPE_RISCV_CPU_THEAD_C908       RISCV_CPU_TYPE_NAME("thead-c908")
>>> +#define TYPE_RISCV_CPU_THEAD_C908V      RISCV_CPU_TYPE_NAME("thead-c908v")
>>>  #define TYPE_RISCV_CPU_VEYRON_V1        RISCV_CPU_TYPE_NAME("veyron-v1")
>>>  #define TYPE_RISCV_CPU_TT_ASCALON       RISCV_CPU_TYPE_NAME("tt-ascalon")
>>>  #define TYPE_RISCV_CPU_XIANGSHAN_NANHU  RISCV_CPU_TYPE_NAME("xiangshan-nanhu")
>>> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
>>> index d055ddf462..202ff130ee 100644
>>> --- a/target/riscv/cpu.c
>>> +++ b/target/riscv/cpu.c
>>> @@ -3091,6 +3091,49 @@ static const TypeInfo riscv_cpu_type_infos[] = {
>>>  #endif
>>>      ),
>>>  
>>> +    DEFINE_RISCV_CPU(TYPE_RISCV_CPU_THEAD_C908, TYPE_RISCV_VENDOR_CPU,
>>> +        .misa_mxl_max = MXL_RV64,
>>> +        .misa_ext = RVI | RVM | RVA | RVF | RVD | RVC | RVS | RVU,
>>> +        .priv_spec = PRIV_VERSION_1_12_0,
>>> +
>>> +        /* ISA extensions */
>>> +        .cfg.ext_xtheadba = true,
>>> +        .cfg.ext_xtheadbb = true,
>>> +        .cfg.ext_xtheadbs = true,
>>> +        .cfg.ext_xtheadcmo = true,
>>> +        .cfg.ext_xtheadcondmov = true,
>>> +        .cfg.ext_xtheadmac = true,
>>> +        .cfg.ext_xtheadmemidx = true,
>>> +        .cfg.ext_xtheadmempair = true,
>>> +        .cfg.ext_xtheadsync = true,
>>> +        .cfg.ext_zba = true,
>>> +        .cfg.ext_zbb = true,
>>> +        .cfg.ext_zbc = true,
>>> +        .cfg.ext_zbs = true,
>>> +        .cfg.ext_zkt = true,
>>> +        .cfg.ext_zbkc = true,
>>> +        .cfg.ext_zicsr = true,
>>> +        .cfg.ext_zifencei = true,
>>> +        .cfg.ext_zihintpause = true,
>>> +        .cfg.ext_zicbom = true,
>>> +        .cfg.ext_zicboz = true,
>>> +        .cfg.ext_zfh = true,
>>> +        .cfg.ext_xtheadfmv = true,
>>> +        .cfg.ext_xtheadfmemidx = true,
>>> +        .cfg.pmp = true,
>>
>> I think Svpbmt is missing here, both it and the T-Head MAEE stuff are
>> supported on the k230. What I will end up merging into mainline for the
> 
> Whoops, should have specified that I meant the mainline linux kernel.
> 
You're right, I will enable the Svpbmt extension in PATCH v2.

Thanks,
Chao
>> k230 uses Svpbmt instead of MAEE.
> 


  reply	other threads:[~2025-12-04  3:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-30  9:21 [PATCH v1 0/5] Add K230 board and thead-c908 CPU support Chao Liu
2025-11-30  9:21 ` [PATCH v1 1/5] target/riscv: add thead-c908 cpu support Chao Liu
2025-12-03 16:33   ` Daniel Henrique Barboza
2025-12-03 17:12   ` Conor Dooley
2025-12-03 17:13     ` Conor Dooley
2025-12-04  2:59       ` Chao Liu [this message]
2025-11-30  9:21 ` [PATCH v1 2/5] hw/riscv: add k230 board initial support Chao Liu
2025-12-03 17:02   ` Daniel Henrique Barboza
2025-12-04  1:12     ` Chao Liu
2025-11-30  9:21 ` [PATCH v1 3/5] hw/watchdog: add k230 watchdog " Chao Liu
2025-12-03 17:07   ` Daniel Henrique Barboza
2025-11-30  9:21 ` [PATCH v1 4/5] tests/qtest: add test for K230 watchdog Chao Liu
2025-12-03 17:08   ` Daniel Henrique Barboza
2025-11-30  9:21 ` [PATCH v1 5/5] docs/system/riscv: add documentation for k230 machine Chao Liu
2025-12-03 17:19   ` Daniel Henrique Barboza
2025-12-04  3:03     ` Chao Liu

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=20499d8c-cc75-4354-9eee-4d2e7023bd4c@openatom.club \
    --to=chao.liu@openatom.club \
    --cc=alistair.francis@wdc.com \
    --cc=chao.liu@zevorn.cn \
    --cc=conor@kernel.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=ebiggers@kernel.org \
    --cc=hust-os-kernel-patches@googlegroups.com \
    --cc=liwei1518@gmail.com \
    --cc=npiggin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=paolo.savini@embecosm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --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).