vmmcp: open up cr4; fix cpuid handling
authorRonald G. Minnich <rminnich@gmail.com>
Tue, 30 Jun 2015 23:26:15 +0000 (16:26 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 2 Nov 2015 23:24:25 +0000 (18:24 -0500)
This gets linux much further.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/vmm/intel/vmx.c

index 7d716da..adab626 100644 (file)
@@ -1142,7 +1142,7 @@ static void vmx_setup_vmcs(struct vmx_vcpu *vcpu)
        vmcs_write32(VM_ENTRY_CONTROLS, vmcs_config.vmentry_ctrl);
 
        vmcs_writel(CR0_GUEST_HOST_MASK, 0); // ~0ul);
        vmcs_write32(VM_ENTRY_CONTROLS, vmcs_config.vmentry_ctrl);
 
        vmcs_writel(CR0_GUEST_HOST_MASK, 0); // ~0ul);
-       vmcs_writel(CR4_GUEST_HOST_MASK, ~0ul);
+       vmcs_writel(CR4_GUEST_HOST_MASK, 0); // ~0ul);
 
        //kvm_write_tsc(&vmx->vcpu, 0);
        vmcs_writel(TSC_OFFSET, 0);
 
        //kvm_write_tsc(&vmx->vcpu, 0);
        vmcs_writel(TSC_OFFSET, 0);
@@ -1379,7 +1379,7 @@ static void vmx_handle_cpuid(struct vmx_vcpu *vcpu)
 
        eax = vcpu->regs.tf_rax;
        ecx = vcpu->regs.tf_rcx;
 
        eax = vcpu->regs.tf_rax;
        ecx = vcpu->regs.tf_rcx;
-       cpuid(0, 2, &eax, &ebx, &ecx, &edx);
+       cpuid(eax, ecx, &eax, &ebx, &ecx, &edx);
        vcpu->regs.tf_rax = eax;
        vcpu->regs.tf_rbx = ebx;
        vcpu->regs.tf_rcx = ecx;
        vcpu->regs.tf_rax = eax;
        vcpu->regs.tf_rbx = ebx;
        vcpu->regs.tf_rcx = ecx;