From: oritw@il.ibm.com Subject: Nested VMX support v3 Date: Thu, 15 Oct 2009 16:41:41 +0200 Message-ID: <1255617706-13564-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, mdday@us.ibm.com To: kvm@vger.kernel.org Return-path: Received: from mtagate5.uk.ibm.com ([195.212.29.138]:51624 "EHLO mtagate5.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760995AbZJOOnd (ORCPT ); Thu, 15 Oct 2009 10:43:33 -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 n9FEfwCa305768 for ; Thu, 15 Oct 2009 14:42:03 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 n9FEfmUb2588826 for ; Thu, 15 Oct 2009 15:41:48 +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 n9FEfl3N027630 for ; Thu, 15 Oct 2009 15:41:47 +0100 Sender: kvm-owner@vger.kernel.org List-ID: Avi, We have addressed all of the comments, please apply. 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, mdday@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.