> From: Nadav Har'El > Sent: Tuesday, May 17, 2011 3:53 AM > > Implement the VMLAUNCH and VMRESUME instructions, allowing a guest > hypervisor to run its own guests. > > This patch does not include some of the necessary validity checks on > vmcs12 fields before the entry. These will appear in a separate patch > below. > > Signed-off-by: Nadav Har'El <nyh@xxxxxxxxxx> > --- [...] > +static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch) > +{ > + struct vmcs12 *vmcs12; > + struct vcpu_vmx *vmx = to_vmx(vcpu); > + int cpu; > + struct saved_vmcs *saved_vmcs02; > + > + if (!nested_vmx_check_permission(vcpu)) > + return 1; > + skip_emulated_instruction(vcpu); > + > + vmcs12 = get_vmcs12(vcpu); > + > + enter_guest_mode(vcpu); > + > + vmx->nested.vmcs01_tsc_offset = vmcs_read64(TSC_OFFSET); > + > + /* > + * Switch from L1's VMCS (vmcs01), to L2's VMCS (vmcs02). Remember > + * vmcs01, on which CPU it was last loaded, and whether it was launched > + * (we need all these values next time we will use L1). Then recall > + * these values from the last time vmcs02 was used. > + */ > + saved_vmcs02 = nested_get_current_vmcs02(vmx); > + if (!saved_vmcs02) > + return -ENOMEM; > + we shouldn't return error after the guest mode is updated. Or else move enter_guest_mode to a later place... Thanks Kevin -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html