From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 05/27] nVMX: Introduce vmcs12: a VMCS structure for L1 Date: Sun, 17 Oct 2010 14:34:21 +0200 Message-ID: <4CBAED4D.3000301@redhat.com> References: <1287309814-nyh@il.ibm.com> <201010171006.o9HA68SE029324@rice.haifa.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, gleb@redhat.com To: "Nadav Har'El" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:29427 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752180Ab0JQMe0 (ORCPT ); Sun, 17 Oct 2010 08:34:26 -0400 In-Reply-To: <201010171006.o9HA68SE029324@rice.haifa.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/17/2010 12:06 PM, Nadav Har'El wrote: > An implementation of VMX needs to define a VMCS structure. This structure > is kept in guest memory, but is opaque to the guest (who can only read or > write it with VMX instructions). > > This patch starts to define the VMCS structure which our nested VMX > implementation will present to L1. We call it "vmcs12", as it is the VMCS > that L1 keeps for its L2 guests. We will add more content to this structure > in later patches. > > This patch also adds the notion (as required by the VMX spec) of L1's "current > VMCS", and finally includes utility functions for mapping the guest-allocated > VMCSs in host memory. > > > @@ -3467,6 +3521,11 @@ static int handle_vmoff(struct kvm_vcpu > > to_vmx(vcpu)->nested.vmxon = false; > > + if(to_vmx(vcpu)->nested.current_vmptr != -1ull){ Missing whitespace after if and before {. > + kunmap(to_vmx(vcpu)->nested.current_vmcs12_page); > + nested_release_page(to_vmx(vcpu)->nested.current_vmcs12_page); > + } > + > skip_emulated_instruction(vcpu); > return 1; > } > @@ -4170,6 +4229,10 @@ static void vmx_free_vcpu(struct kvm_vcp > struct vcpu_vmx *vmx = to_vmx(vcpu); > > free_vpid(vmx); > + if (vmx->nested.vmxon&& to_vmx(vcpu)->nested.current_vmptr != -1ull){ > + kunmap(to_vmx(vcpu)->nested.current_vmcs12_page); > + nested_release_page(to_vmx(vcpu)->nested.current_vmcs12_page); > + } Duplication - helper? -- error compiling committee.c: too many arguments to function