]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vmm: Use struct vcpu in the instruction emulation code.
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 18 Nov 2022 18:02:09 +0000 (10:02 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 26 Jan 2023 21:47:39 +0000 (13:47 -0800)
commit3762293b30f3c8467c1dfdc375b7602cf778f801
tree503034d0c51a14e70ca7403915ad2f83bf553d08
parent6cedf47c177b7afe730a2276064da4f8e8110f5f
vmm: Use struct vcpu in the instruction emulation code.

This passes struct vcpu down in place of struct vm and and integer
vcpu index through the in-kernel instruction emulation code.  To
minimize userland disruption, helper macros are used for the vCPU
arguments passed into and through the shared instruction emulation
code.

A few other APIs used by the instruction emulation code have also been
updated to accept struct vcpu in the kernel including
vm_get/set_register and vm_inject_fault.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37161

(cherry picked from commit d3956e46736ffaee5060c9baf0a40f428bc34ec3)
21 files changed:
lib/libvmmapi/vmmapi.c
lib/libvmmapi/vmmapi.h
sys/amd64/include/vmm.h
sys/amd64/include/vmm_instruction_emul.h
sys/amd64/vmm/amd/svm.c
sys/amd64/vmm/amd/svm_msr.c
sys/amd64/vmm/intel/vmx.c
sys/amd64/vmm/intel/vmx_msr.c
sys/amd64/vmm/io/vhpet.c
sys/amd64/vmm/io/vhpet.h
sys/amd64/vmm/io/vioapic.c
sys/amd64/vmm/io/vioapic.h
sys/amd64/vmm/io/vlapic.c
sys/amd64/vmm/io/vlapic.h
sys/amd64/vmm/vmm.c
sys/amd64/vmm/vmm_dev.c
sys/amd64/vmm/vmm_instruction_emul.c
sys/amd64/vmm/vmm_ioport.c
sys/amd64/vmm/vmm_lapic.c
sys/amd64/vmm/vmm_lapic.h
sys/amd64/vmm/x86.c