qemu-riscv
[Top][All Lists]
Advanced

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

Re: [PATCH 1/1] target/riscv: Clear vstart_qe_zero flag


From: Richard Henderson
Subject: Re: [PATCH 1/1] target/riscv: Clear vstart_qe_zero flag
Date: Sat, 17 Feb 2024 09:34:54 -1000
User-agent: Mozilla Thunderbird

On 2/17/24 00:53, Daniel Henrique Barboza wrote:
This patch is replacing mark_vs_dirty() with finalize(), that does call 
mark_vs_dirty() and
set start_eq_zero = true, but it's missing the start_eq_zero update for store 
functions
because of these ifs.

We could just remove these ifs and finalize() all the time. To keep the 
existing logic
(i.e. not set vs_dirty for writes) I would do, in this same patch:


      if (!is_store) {
          mark_vs_dirty(s);
      }
+     s->start_eq_zero = true;


This would make these load/stores functions different from the rest, without a 
finalize()
call, but given that they're already difference sine vs_dirty() is conditional 
I guess
it's fine.


What do you think?

I think it's required to have stores set dirty unconditionally, before the 
operation.

Consider a store that traps on the 2nd element, leaving vstart = 2, and exiting to the main loop via exception. The exception enters the kernel page fault handler. The kernel may need to fault in the page for the process, and in the meantime task switch.

If vs dirty is not already set, the kernel won't know to save vector state on 
task switch.


r~



reply via email to

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