From: Richard Henderson <richard.henderson@linaro.org>
To: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>,
liweiwei <liweiwei@iscas.ac.cn>,
qemu-riscv@nongnu.org, qemu-devel@nongnu.org
Cc: palmer@dabbelt.com, alistair.francis@wdc.com,
bin.meng@windriver.com, dbarboza@ventanamicro.com,
wangjunqiang@iscas.ac.cn, lazyparser@gmail.com
Subject: Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation
Date: Sun, 2 Apr 2023 11:00:56 -0700 [thread overview]
Message-ID: <83dc4a04-1b26-dd72-63cb-940f8929b58f@linaro.org> (raw)
In-Reply-To: <e0dc20a2-1a93-6c3d-b3e1-f62c7d1d61c9@linux.alibaba.com>
On 4/2/23 06:17, LIU Zhiwei wrote:
>>> Why set pc_save here? IMHO, pc_save is a constant.
>>
>> pc_save is a value which is strictly related to the value of env->pc.
>> real_pc = (old)env->pc + target_pc(from tb) - ctx->pc_save
>
> In this formula, the meaning of target_pc(from tb) doesn't match with gen_get_target_pc in
> the code. Its meaning in the code matches the real_pc in the formula. I think we should
> rename the gen_get_target_pc to gen_get_real_pc.
Neither name is ideal, because it is also used for things that are not "pc".
See e.g. target/arm/, where this is called gen_pc_plus_diff.
This makes slightly more sense for uses like auipc and jalr.
r~
next prev parent reply other threads:[~2023-04-02 18:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-01 12:49 [RESEND PATCH v5 0/6] target/riscv: Fix pointer mask related support Weiwei Li
2023-04-01 12:49 ` [RESEND PATCH v5 1/6] target/riscv: Fix pointer mask transformation for vector address Weiwei Li
2023-04-01 12:49 ` [RESEND PATCH v5 2/6] target/riscv: Update cur_pmmask/base when xl changes Weiwei Li
2023-04-01 12:49 ` [RESEND PATCH v5 3/6] target/riscv: Fix target address to update badaddr Weiwei Li
2023-04-01 12:49 ` [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation Weiwei Li
2023-04-02 0:34 ` LIU Zhiwei
2023-04-02 8:17 ` liweiwei
2023-04-02 13:17 ` LIU Zhiwei
2023-04-02 13:53 ` liweiwei
2023-04-03 2:38 ` liweiwei
2023-04-02 18:00 ` Richard Henderson [this message]
2023-04-03 1:28 ` liweiwei
2023-04-04 1:58 ` LIU Zhiwei
2023-04-04 2:13 ` liweiwei
2023-04-04 2:38 ` LIU Zhiwei
2023-04-01 12:49 ` [RESEND PATCH v5 5/6] target/riscv: Enable PC-relative translation in system mode Weiwei Li
2023-04-01 12:49 ` [RESEND PATCH v5 6/6] target/riscv: Add pointer mask support for instruction fetch Weiwei Li
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=83dc4a04-1b26-dd72-63cb-940f8929b58f@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=dbarboza@ventanamicro.com \
--cc=lazyparser@gmail.com \
--cc=liweiwei@iscas.ac.cn \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=wangjunqiang@iscas.ac.cn \
--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).