x86: vmm: Track state for handling vmexits as KERNEL When we vmexited, we didn't set the cpu state to KERNEL, keeping it as USER. This would show up in mpstat as higher USER time. Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
diff --git a/kern/arch/x86/trap.c b/kern/arch/x86/trap.c index 0c24cad..9f168fa 100644 --- a/kern/arch/x86/trap.c +++ b/kern/arch/x86/trap.c
@@ -1130,6 +1130,7 @@ tf->tf_guest_pa = vmcs_read(GUEST_PHYSICAL_ADDRESS); set_current_ctx_vm(pcpui, tf); + __set_cpu_state(pcpui, CPU_STATE_KERNEL); tf = &pcpui->cur_ctx->tf.vm_tf; vmexit_dispatch(tf); /* We're either restarting a partial VM ctx (vmcs was launched, loaded on