Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-03 Thread LIU Zhiwei
On 2023/4/4 10:13, liweiwei wrote: On 2023/4/4 09:58, LIU Zhiwei wrote: On 2023/4/1 20:49, Weiwei Li wrote: Add a base save_pc For PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. Sync pc before it's used or updated from tb related pc:

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-03 Thread liweiwei
On 2023/4/4 09:58, LIU Zhiwei wrote: On 2023/4/1 20:49, Weiwei Li wrote: Add a base save_pc For PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. Sync pc before it's used or updated from tb related pc:     real_pc = (old)env->pc + target_

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-03 Thread LIU Zhiwei
On 2023/4/1 20:49, Weiwei Li wrote: Add a base save_pc For PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. Sync pc before it's used or updated from tb related pc: real_pc = (old)env->pc + target_pc(from tb) - ctx->save_pc Use gen_get_

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-02 Thread liweiwei
On 2023/4/2 21:53, liweiwei wrote: On 2023/4/2 21:17, LIU Zhiwei wrote: On 2023/4/2 16:17, liweiwei wrote: On 2023/4/2 08:34, LIU Zhiwei wrote: On 2023/4/1 20:49, Weiwei Li wrote: Add a base save_pc For pc_save for PC-relative translation(CF_PCREL). Diable the directly sync pc from tb

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-02 Thread liweiwei
On 2023/4/3 02:00, Richard Henderson wrote: 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 o

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-02 Thread Richard Henderson
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

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-02 Thread liweiwei
On 2023/4/2 21:17, LIU Zhiwei wrote: On 2023/4/2 16:17, liweiwei wrote: On 2023/4/2 08:34, LIU Zhiwei wrote: On 2023/4/1 20:49, Weiwei Li wrote: Add a base save_pc For pc_save for PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. Sy

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-02 Thread LIU Zhiwei
On 2023/4/2 16:17, liweiwei wrote: On 2023/4/2 08:34, LIU Zhiwei wrote: On 2023/4/1 20:49, Weiwei Li wrote: Add a base save_pc For pc_save for PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. Sync pc before it's used or updated from

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-02 Thread liweiwei
On 2023/4/2 08:34, LIU Zhiwei wrote: On 2023/4/1 20:49, Weiwei Li wrote: Add a base save_pc For pc_save for PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. Sync pc before it's used or updated from tb related pc:     real_pc = (old)env

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-01 Thread LIU Zhiwei
On 2023/4/1 20:49, Weiwei Li wrote: Add a base save_pc For pc_save for PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. Sync pc before it's used or updated from tb related pc: real_pc = (old)env->pc + target_pc(from tb) - ctx->save_p

[RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation

2023-04-01 Thread Weiwei Li
Add a base save_pc For PC-relative translation(CF_PCREL). Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb. Sync pc before it's used or updated from tb related pc: real_pc = (old)env->pc + target_pc(from tb) - ctx->save_pc Use gen_get_target_pc to compute target address of au