From: oritw@il.ibm.com Subject: Nested VMX support v2 Date: Wed, 30 Sep 2009 15:32:07 +0200 Message-ID: <1254317532-26123-1-git-send-email-oritw@il.ibm.com> Cc: oritw@il.ibm.com, benami@il.ibm.com, abelg@il.ibm.com, muli@il.ibm.com, aliguori@us.ibm.com, -mday@us.ibm.com To: kvm@vger.kernel.org Return-path: Received: from mtagate5.uk.ibm.com ([195.212.29.138]:41034 "EHLO mtagate5.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754450AbZI3NdM (ORCPT ); Wed, 30 Sep 2009 09:33:12 -0400 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate5.uk.ibm.com (8.14.3/8.13.8) with ESMTP id n8UDWP2H741222 for ; Wed, 30 Sep 2009 13:32:30 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n8UDWFaF3227750 for ; Wed, 30 Sep 2009 14:32:15 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n8UDWFma005175 for ; Wed, 30 Sep 2009 14:32:15 +0100 Sender: kvm-owner@vger.kernel.org List-ID: The following patches implement nested VMX support. The patches enable a guest to use the VMX APIs in order to run its own nested guest (i.e., enable running other hypervisors which use VMX under KVM). The current patches support running Linux under a nested KVM using shadow page table (with bypass_guest_pf disabled). SMP support was fixed. Reworking EPT support to mesh cleanly with the current shadow paging design per Avi's comments is a work-in-progress. The current patches only support a single nested hypervisor, which can only run a single guest (multiple guests are work in progress). Only 64-bit nested hypervisors are supported. Additional patches for running Windows under nested KVM, and Linux under nested VMware server(!), are currently running in the lab. We are in the process of forward-porting those patches to -tip. This patches were written by: Orit Wasserman, oritw@il.ibm.com Ben-Ami Yassor, benami@il.ibm.com Abel Gordon, abelg@il.ibm.com Muli Ben-Yehuda, muli@il.ibm.com With contributions by: Anthony Liguori, aliguori@us.ibm.com Mike Day, mday@us.ibm.com This work was inspired by the nested SVM support by Alexander Graf and Joerg Roedel. Changes since v2: Added check to nested_vmx_get_msr. Static initialization of the vmcs_field_to_offset_table array. Use the memory allocated by L1 for VMCS12 to store the shadow vmcs. Some optimization to the prepare_vmcs_12 function. vpid allocation will be updated with the multiguest support (work in progress). We are working on fixing the cr0.TS handling, it works for nested kvm by not for vmware server.