qemu-e2k/target/i386/hvf
Alexander Graf bac969ef30 hvf: Simplify post reset/init/loadvm hooks
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>
Reviewed-by: Sergio Lopez <slp@redhat.com>
Message-id: 20210519202253.76782-13-agraf@csgraf.de
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2021-06-03 16:43:27 +01:00
..
hvf-cpu.c
hvf-i386.h
hvf.c hvf: Introduce hvf vcpu struct 2021-06-03 16:43:27 +01:00
meson.build
panic.h
README.md
vmcs.h
vmx.h hvf: Introduce hvf vcpu struct 2021-06-03 16:43:27 +01:00
x86_cpuid.c
x86_decode.c
x86_decode.h
x86_descr.c hvf: Introduce hvf vcpu struct 2021-06-03 16:43:27 +01:00
x86_descr.h
x86_emu.c hvf: Introduce hvf vcpu struct 2021-06-03 16:43:27 +01:00
x86_emu.h
x86_flags.c
x86_flags.h
x86_mmu.c hvf: Introduce hvf vcpu struct 2021-06-03 16:43:27 +01:00
x86_mmu.h
x86_task.c hvf: Introduce hvf vcpu struct 2021-06-03 16:43:27 +01:00
x86_task.h
x86.c hvf: Introduce hvf vcpu struct 2021-06-03 16:43:27 +01:00
x86.h
x86hvf.c hvf: Simplify post reset/init/loadvm hooks 2021-06-03 16:43:27 +01:00
x86hvf.h

OS X Hypervisor.framework support in QEMU

These sources (and ../hvf-all.c) are adapted from Veertu Inc's vdhh (Veertu Desktop Hosted Hypervisor) (last known location: https://github.com/veertuinc/vdhh) with some minor changes, the most significant of which were:

  1. Adapt to our current QEMU's CPUState structure and address_space_rw API; many struct members have been moved around (emulated x86 state, xsave_buf) due to historical differences + QEMU needing to handle more emulation targets.
  2. Removal of apic_page and hyperv-related functionality.
  3. More relaxed use of qemu_mutex_lock_iothread.