qemu/target/i386/hvf
Alexander Graf 106f91d59c hvf: Fetch cr4 before evaluating CPUID(1)
The CPUID function 1 has a bit called OSXSAVE which tells user space the
status of the CR4.OSXSAVE bit. Our generic CPUID function injects that bit
based on the status of CR4.

With Hypervisor.framework, we do not synchronize full CPU state often enough
for this function to see the CR4 update before guest user space asks for it.

To be on the save side, let's just always synchronize it when we receive a
CPUID(1) request. That way we can set the bit with real confidence.

Reported-by: Asad Ali <asad@osaro.com>
Signed-off-by: Alexander Graf <agraf@csgraf.de>
Message-Id: <20210123004129.6364-1-agraf@csgraf.de>
[RB: resolved conflict with another CPUID change]
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-02-16 17:15:39 +01:00
..
hvf-accel-ops.c accel: replace struct CpusAccel with AccelOpsClass 2021-02-05 10:24:15 -10:00
hvf-accel-ops.h accel: replace struct CpusAccel with AccelOpsClass 2021-02-05 10:24:15 -10:00
hvf-i386.h hvf: x86: Remove unused definitions 2021-02-16 17:15:39 +01:00
hvf.c hvf: Fetch cr4 before evaluating CPUID(1) 2021-02-16 17:15:39 +01:00
meson.build accel: replace struct CpusAccel with AccelOpsClass 2021-02-05 10:24:15 -10:00
panic.h x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
README.md i386: Compile CPUX86State xsave_buf only when support KVM or HVF 2018-10-02 19:09:12 +02:00
vmcs.h Clean up ill-advised or unusual header guards 2019-05-13 08:58:55 +02:00
vmx.h x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
x86_cpuid.c hvf: Guard xgetbv call 2021-02-16 17:15:39 +01:00
x86_decode.c x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
x86_decode.h x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
x86_descr.c x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
x86_descr.h x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
x86_emu.c target/i386/hvf: add rdmsr 35H MSR_CORE_THREAD_COUNT 2021-02-16 17:15:39 +01:00
x86_emu.h x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
x86_flags.c x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
x86_flags.h x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
x86_mmu.c x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
x86_mmu.h x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
x86_task.c accel: extend AccelState and AccelClass to user-mode 2021-02-05 10:24:15 -10:00
x86_task.h Clean up header guards that don't match their file name 2019-05-13 08:58:55 +02:00
x86.c x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00
x86.h hvf: Fix segment selector format 2020-11-18 09:32:17 +01:00
x86hvf.c accel: replace struct CpusAccel with AccelOpsClass 2021-02-05 10:24:15 -10:00
x86hvf.h x86 hvf cpus: Fix Lesser GPL version number 2020-11-15 16:45:27 +01:00

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.