Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/vmm/intel/vmx.c
Show First 20 Lines • Show All 3,398 Lines • ▼ Show 20 Lines | vmx_getreg(void *vcpui, int reg, uint64_t *retval) | ||||
struct vmx_vcpu *vcpu = vcpui; | struct vmx_vcpu *vcpu = vcpui; | ||||
struct vmx *vmx = vcpu->vmx; | struct vmx *vmx = vcpu->vmx; | ||||
running = vcpu_is_running(vcpu->vcpu, &hostcpu); | running = vcpu_is_running(vcpu->vcpu, &hostcpu); | ||||
if (running && hostcpu != curcpu) | if (running && hostcpu != curcpu) | ||||
panic("vmx_getreg: %s%d is running", vm_name(vmx->vm), | panic("vmx_getreg: %s%d is running", vm_name(vmx->vm), | ||||
vcpu->vcpuid); | vcpu->vcpuid); | ||||
if (reg == VM_REG_GUEST_INTR_SHADOW) | switch (reg) { | ||||
case VM_REG_GUEST_INTR_SHADOW: | |||||
return (vmx_get_intr_shadow(vcpu, running, retval)); | return (vmx_get_intr_shadow(vcpu, running, retval)); | ||||
case VM_REG_GUEST_KGS_BASE: | |||||
*retval = vcpu->guest_msrs[IDX_MSR_KGSBASE]; | |||||
return (0); | |||||
case VM_REG_GUEST_TPR: | |||||
*retval = vlapic_get_cr8(vm_lapic(vcpu->vcpu)); | |||||
return (0); | |||||
} | |||||
if (vmxctx_getreg(&vcpu->ctx, reg, retval) == 0) | if (vmxctx_getreg(&vcpu->ctx, reg, retval) == 0) | ||||
return (0); | return (0); | ||||
return (vmcs_getreg(vcpu->vmcs, running, reg, retval)); | return (vmcs_getreg(vcpu->vmcs, running, reg, retval)); | ||||
} | } | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 869 Lines • Show Last 20 Lines |