fd13f23b8c
Kernel commit c4f55198c7c2 ("kvm: x86: Introduce KVM_CAP_EXCEPTION_PAYLOAD") introduced a new KVM capability which allows userspace to correctly distinguish between pending and injected exceptions. This distinguish is important in case of nested virtualization scenarios because a L2 pending exception can still be intercepted by the L1 hypervisor while a L2 injected exception cannot. Furthermore, when an exception is attempted to be injected by QEMU, QEMU should specify the exception payload (CR2 in case of #PF or DR6 in case of #DB) instead of having the payload already delivered in the respective vCPU register. Because in case exception is injected to L2 guest and is intercepted by L1 hypervisor, then payload needs to be reported to L1 intercept (VMExit handler) while still preserving respective vCPU register unchanged. This commit adds support for QEMU to properly utilise this new KVM capability (KVM_CAP_EXCEPTION_PAYLOAD). Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com> Signed-off-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20190619162140.133674-10-liran.alon@oracle.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> |
||
---|---|---|
.. | ||
hvf-i386.h | ||
hvf.c | ||
Makefile.objs | ||
panic.h | ||
README.md | ||
vmcs.h | ||
vmx.h | ||
x86_cpuid.c | ||
x86_decode.c | ||
x86_decode.h | ||
x86_descr.c | ||
x86_descr.h | ||
x86_emu.c | ||
x86_emu.h | ||
x86_flags.c | ||
x86_flags.h | ||
x86_mmu.c | ||
x86_mmu.h | ||
x86_task.c | ||
x86_task.h | ||
x86.c | ||
x86.h | ||
x86hvf.c | ||
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:
- Adapt to our current QEMU's
CPUState
structure andaddress_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. - Removal of
apic_page
and hyperv-related functionality. - More relaxed use of
qemu_mutex_lock_iothread
.