vmcs_write32(PIN_BASED_VM_EXEC_CONTROL, pin_based_ctrl);
}
-static void vmx_skip_emulated_instruction(unsigned int inst_len)
+void vcpu_skip_emulated_instruction(unsigned int inst_len)
{
vmcs_write64(GUEST_RIP, vmcs_read64(GUEST_RIP) + inst_len);
}
unsigned long arg_mask = ia32e_mode ? (u64)-1 : (u32)-1;
unsigned long code = guest_regs->rax;
- vmx_skip_emulated_instruction(X86_INST_LEN_VMCALL);
+ vcpu_skip_emulated_instruction(X86_INST_LEN_VMCALL);
if ((!ia32e_mode && vmcs_read64(GUEST_RFLAGS) & X86_RFLAGS_VM) ||
(vmcs_read16(GUEST_CS_SELECTOR) & 3) != 0) {
val = ((unsigned long *)guest_regs)[15 - reg];
if (cr == 0 || cr == 4) {
- vmx_skip_emulated_instruction(X86_INST_LEN_MOV_TO_CR);
+ vcpu_skip_emulated_instruction(X86_INST_LEN_MOV_TO_CR);
/* TODO: check for #GP reasons */
vmx_set_guest_cr(cr, val);
if (cr == 0 && val & X86_CR0_PG)
if (!inst_len)
break;
- vmx_skip_emulated_instruction(inst_len);
+ vcpu_skip_emulated_instruction(inst_len);
return true;
}
panic_printk("FATAL: Unhandled APIC access, "
result = i8042_access_handler(guest_regs, port, dir_in, size);
if (result == 1) {
- vmx_skip_emulated_instruction(
+ vcpu_skip_emulated_instruction(
vmcs_read64(VM_EXIT_INSTRUCTION_LEN));
return true;
}
if (result == 1) {
if (!is_write)
((unsigned long *)guest_regs)[access.reg] = val;
- vmx_skip_emulated_instruction(
+ vcpu_skip_emulated_instruction(
vmcs_read64(VM_EXIT_INSTRUCTION_LEN));
return true;
}
iommu_check_pending_faults(cpu_data);
return;
case EXIT_REASON_CPUID:
- vmx_skip_emulated_instruction(X86_INST_LEN_CPUID);
+ vcpu_skip_emulated_instruction(X86_INST_LEN_CPUID);
guest_regs->rax &= 0xffffffff;
guest_regs->rbx &= 0xffffffff;
guest_regs->rcx &= 0xffffffff;
cpu_data->stats[JAILHOUSE_CPU_STAT_VMEXITS_MSR]++;
if (guest_regs->rcx >= MSR_X2APIC_BASE &&
guest_regs->rcx <= MSR_X2APIC_END) {
- vmx_skip_emulated_instruction(X86_INST_LEN_RDMSR);
+ vcpu_skip_emulated_instruction(X86_INST_LEN_RDMSR);
x2apic_handle_read(guest_regs);
return;
}
guest_regs->rcx <= MSR_X2APIC_END) {
if (!x2apic_handle_write(guest_regs, cpu_data))
break;
- vmx_skip_emulated_instruction(X86_INST_LEN_WRMSR);
+ vcpu_skip_emulated_instruction(X86_INST_LEN_WRMSR);
return;
}
panic_printk("FATAL: Unhandled MSR write: %08x\n",
if (guest_regs->rax & X86_XCR0_FP &&
(guest_regs->rax & ~cpuid_eax(0x0d)) == 0 &&
guest_regs->rcx == 0 && guest_regs->rdx == 0) {
- vmx_skip_emulated_instruction(X86_INST_LEN_XSETBV);
+ vcpu_skip_emulated_instruction(X86_INST_LEN_XSETBV);
asm volatile(
"xsetbv"
: /* no output */