qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: liweiwei <liweiwei@iscas.ac.cn>
To: Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
	qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com,
	bmeng@tinylab.org, zhiwei_liu@linux.alibaba.com
Subject: Re: [PATCH 1/4] target/riscv/csr.c: use env_archcpu() in ctr()
Date: Sat, 25 Feb 2023 14:40:52 +0800	[thread overview]
Message-ID: <e40e75ff-37e0-94d3-e9e2-c159b0e2da68@iscas.ac.cn> (raw)
In-Reply-To: <20230224174520.92490-2-dbarboza@ventanamicro.com>


On 2023/2/25 01:45, Daniel Henrique Barboza wrote:
> We don't need to use env_cpu() and CPUState().
>
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> ---
>   target/riscv/csr.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/target/riscv/csr.c b/target/riscv/csr.c
> index 75a540bfcb..3692617d13 100644
> --- a/target/riscv/csr.c
> +++ b/target/riscv/csr.c
> @@ -108,8 +108,7 @@ static RISCVException vs(CPURISCVState *env, int csrno)
>   static RISCVException ctr(CPURISCVState *env, int csrno)
>   {
>   #if !defined(CONFIG_USER_ONLY)
> -    CPUState *cs = env_cpu(env);
> -    RISCVCPU *cpu = RISCV_CPU(cs);
> +    RISCVCPU *cpu = env_archcpu(env);
>       int ctr_index;
>       target_ulong ctr_mask;
>       int base_csrno = CSR_CYCLE;

This has been done by previous patchset from Bin Meng:

https://lists.nongnu.org/archive/html/qemu-riscv/2023-02/msg00276.html

Regards,

Weiwei Li



  reply	other threads:[~2023-02-25  6:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 17:45 [PATCH 0/4] RISCVCPUConfig related cleanups Daniel Henrique Barboza
2023-02-24 17:45 ` [PATCH 1/4] target/riscv/csr.c: use env_archcpu() in ctr() Daniel Henrique Barboza
2023-02-25  6:40   ` liweiwei [this message]
2023-02-24 17:45 ` [PATCH 2/4] target/riscv/csr.c: simplify mctr() Daniel Henrique Barboza
2023-02-25  6:42   ` liweiwei
2023-02-24 17:45 ` [PATCH 3/4] target/riscv/csr.c: use riscv_cpu_cfg() to avoid env_cpu() pointers Daniel Henrique Barboza
2023-02-25  6:43   ` liweiwei
2023-02-24 17:45 ` [PATCH 4/4] target/riscv/csr.c: avoid env_archcpu() usages when reading RISCVCPUConfig Daniel Henrique Barboza
2023-02-25  6:44   ` liweiwei
2023-02-24 21:34 ` [PATCH 0/4] RISCVCPUConfig related cleanups Richard Henderson
2023-02-24 21:36 ` Richard Henderson
2023-02-25  6:47 ` liweiwei
2023-02-26 17:39   ` Daniel Henrique Barboza
2023-03-02  2:07 ` Palmer Dabbelt
2023-03-02  2:24   ` Bin Meng
2023-03-02  8:10     ` Daniel Henrique Barboza

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=e40e75ff-37e0-94d3-e9e2-c159b0e2da68@iscas.ac.cn \
    --to=liweiwei@iscas.ac.cn \
    --cc=alistair.francis@wdc.com \
    --cc=bmeng@tinylab.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.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).