When starting a VM, just copy all registers in.
authorRonald G. Minnich <rminnich@gmail.com>
Wed, 11 Nov 2015 01:29:28 +0000 (17:29 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 13 Nov 2015 20:19:45 +0000 (15:19 -0500)
This allows the VMM to initialize registers, which we ought to do.

We need this anyway to pass in a bootparams pointer.

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 9278a77..bb80f15 100644 (file)
@@ -1818,6 +1818,7 @@ int vmx_launch(struct vmctl *v) {
                printd("REG_RSP_RIP_CR3\n");
                vmcs_writel(GUEST_RSP, v->regs.tf_rsp);
                vmcs_writel(GUEST_CR3, v->cr3);
+               vcpu->regs = v->regs;
 
                pir_kva = uva2kva(current_proc, (void *)v->pir);
                pir_physical = (uint64_t)PADDR(pir_kva);