Thank you for your review and feedback, Richard.
As Eric mentioned, this is the first time contribution. I have been exploring Qemu for some time and try to understand main flow, internals, ..etc.
> You cannot manipulate env like this during translation.
> Neither the write to env->pc_next nor the read from env->pending_rvc here will
> be in any synchronization with the execution of write_misa.
Does this applies for translated code in a single translation block only or for different TBs also ?
So should I manipulate "env" from translation context through helpers only ? for example:
while the helper function definition like that:
void helper_next_pc(CPURISCVState *env, target_ulong pc_next)
env->pc_next = pc_next;
and the same to read "env->pending_rvc"
I'm thinking of a way to add 'C' extension at run time through waiting the correct aligned instruction, which I believe it might be after branch something quite similar to switching between ARM and THUMB states in ARM, for misa 'RVC' enable to take effect since it will be no possibility to check alignment with 'C' extension.