[Top][All Lists]

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

Re: [PATCH v6 06/11] hvf: Simplify post reset/init/loadvm hooks

From: Alexander Graf
Subject: Re: [PATCH v6 06/11] hvf: Simplify post reset/init/loadvm hooks
Date: Wed, 10 Feb 2021 22:34:20 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:86.0) Gecko/20100101 Thunderbird/86.0

On 28.01.21 16:28, Peter Maydell wrote:
On Wed, 20 Jan 2021 at 22:44, Alexander Graf <agraf@csgraf.de> wrote:
The hooks we have that call us after reset, init and loadvm really all
just want to say "The reference of all register state is in the QEMU
vcpu struct, please push it".

We already have a working pushing mechanism though called cpu->vcpu_dirty,
so we can just reuse that for all of the above, syncing state properly the
next time we actually execute a vCPU.

This fixes PSCI resets on ARM, as they modify CPU state even after the
post init call has completed, but before we execute the vCPU again.

To also make the scheme work for x86, we have to make sure we don't
move stale eflags into our env when the vcpu state is dirty.

Signed-off-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
What's the difference between HVF and KVM that means this code
doesn't have the same structure the KVM code does here?

The main reason is that with KVM, responsibility of register reset is shared between kernel and user space. With HVF, user space has everything under full control, so all we need to say is "user space is your reference now". While with KVM, we may need to still say "KVM state is your reference, because it will do the register reset on behalf of us".


reply via email to

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