From patchwork Sun Oct 17 10:04:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nadav Har'El X-Patchwork-Id: 259721 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9HA4EI5013780 for ; Sun, 17 Oct 2010 10:04:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932310Ab0JQKEM (ORCPT ); Sun, 17 Oct 2010 06:04:12 -0400 Received: from mtagate7.de.ibm.com ([195.212.17.167]:52418 "EHLO mtagate7.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932281Ab0JQKEL (ORCPT ); Sun, 17 Oct 2010 06:04:11 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.1/8.13.1) with ESMTP id o9HA47qc019696 for ; Sun, 17 Oct 2010 10:04:07 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9HA47oO4137082 for ; Sun, 17 Oct 2010 12:04:07 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o9HA47dO018899 for ; Sun, 17 Oct 2010 12:04:07 +0200 Received: from rice.haifa.ibm.com (rice.haifa.ibm.com [9.148.8.112]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id o9HA46Zr018893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 17 Oct 2010 12:04:06 +0200 Received: from rice.haifa.ibm.com (lnx-nyh.haifa.ibm.com [127.0.0.1]) by rice.haifa.ibm.com (8.14.4/8.14.4) with ESMTP id o9HA45LA029270; Sun, 17 Oct 2010 12:04:05 +0200 Received: (from nyh@localhost) by rice.haifa.ibm.com (8.14.4/8.14.4/Submit) id o9HA45vY029268; Sun, 17 Oct 2010 12:04:05 +0200 Date: Sun, 17 Oct 2010 12:04:05 +0200 Message-Id: <201010171004.o9HA45vY029268@rice.haifa.ibm.com> X-Authentication-Warning: rice.haifa.ibm.com: nyh set sender to "Nadav Har'El" using -f Cc: gleb@redhat.com, avi@redhat.com To: kvm@vger.kernel.org From: "Nadav Har'El" References: <1287309814-nyh@il.ibm.com> Subject: [PATCH 01/27] nVMX: Add "nested" module option to vmx.c Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 17 Oct 2010 10:04:14 +0000 (UTC) --- .before/arch/x86/kvm/vmx.c 2010-10-17 11:51:59.000000000 +0200 +++ .after/arch/x86/kvm/vmx.c 2010-10-17 11:51:59.000000000 +0200 @@ -69,6 +69,14 @@ module_param(emulate_invalid_guest_state static int __read_mostly vmm_exclusive = 1; module_param(vmm_exclusive, bool, S_IRUGO); +/* + * If nested=1, nested virtualization is supported, i.e., the guest may use + * VMX and be a hypervisor for its own guests. If nested=0, the guest may not + * use VMX instructions. + */ +static int nested = 0; +module_param(nested, int, S_IRUGO); + #define KVM_GUEST_CR0_MASK_UNRESTRICTED_GUEST \ (X86_CR0_WP | X86_CR0_NE | X86_CR0_NW | X86_CR0_CD) #define KVM_GUEST_CR0_MASK \