On 26/5/26 11:35, Bibo Mao wrote:


On 2026/5/26 下午5:11, Philippe Mathieu-Daudé wrote:
On 26/5/26 08:50, Bibo Mao wrote:
Here new structure CPUSysState is added in CPULoongArchState, CSR
registers are move in CPUSysState. In later with LVZ supported, there will be two copied of CSR registers, so it is simply to add CPUSysState array.

Also new field curState is added which points to CPUSysState at
beginning, and it can be changed during VM exit/enter entry. There is no
function change, all is code movement or variable rename.

Isn't curState misleading? What about:

-    CPUSysState *cur = get_current_state(env);
+    CSRState *csr = env_csr(env);

get_current_state() actually is misleading. In future "QEMUTimer timer" will be added in structure CPUSysState(). It is not only CSR registers. How about something like this which is copied for yours :)
   -    CPUSysState *cur = get_current_state(env);
   +    SysState *sys = env_sys(env);

LGTM!


Reply via email to