On 03.12.20 02:52, Roman Bolshakov wrote:
On Wed, Dec 02, 2020 at 08:04:03PM +0100, Alexander Graf wrote:
When clearing internal state of a CPU, we should also make sure that HVF
knows about it and can push the new values down to vcpu state.

I'm sorry if I'm asking something dumb. But isn't
cpu_synchronize_all_post_reset() is supposed to push QEMU state into HVF
(or any other accel) after reset?

For x86 it used to work:

   static void do_hvf_cpu_synchronize_post_reset(CPUState *cpu,
                                                 run_on_cpu_data arg)
   {
       hvf_put_registers(cpu);                                                     
                                                                                   
                        cpu->vcpu_dirty = false;
   }


Yes, it works because after the reset is done, there is no other register modification happening. With the PSCI emulation code in QEMU, we still do modify CPU state after reset though.

Different question though: Why do we need the post_reset() call at all here to push state? We would just push it on the next run anyways, right? So if we don't set vcpu_dirty to false then, we wouldn't need this patch here I think.


Alex


Reply via email to