qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v6 13/25] target/riscv: Introduce mmuidx_priv


From: LIU Zhiwei
Subject: Re: [PATCH v6 13/25] target/riscv: Introduce mmuidx_priv
Date: Tue, 28 Mar 2023 09:33:00 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0


On 2023/3/28 0:29, Richard Henderson wrote:
On 3/26/23 19:07, LIU Zhiwei wrote:
+static inline int mmuidx_priv(int mmu_idx)
+{
+    int ret = mmu_idx & 3;
+    if (ret == MMUIdx_S_SUM) {
+        ret = PRV_S;
+    }
+    return ret;
+}
+

Can we remove the PRIV from the tb flags after we have this function?

No, because this is the priv of the memory operation as modified by e.g. MPRV, not the true cpu priv.

For this implementation, we explicitly use the tb flags for mmu index. I think it is the reason why we have to maintain the redundant privilege in tb flags. It may be better to only store machine states into tb flags. Can we just pass everything that we need, for example, the priv and sum, and then implicitly
calculate the ctx->mem_idx in disas_init_fn?

I remember that you give the similar suggestion in the comment process

https://mail.gnu.org/archive/html/qemu-riscv/2023-03/msg00566.html

Best Regards,
Zhiwei



r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]