[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] [PATCH 04/16] vmx: nest: nested control structure



Qing He wrote:
> v->arch.hvm_vmx.nest as control structure
> 
> Signed-off-by: Qing He <qing.he@xxxxxxxxx>
> Signed-off-by: Eddie Dong <eddie.dong@xxxxxxxxx>
> 
> ---
> diff -r fc4de5eedd1d xen/include/asm-x86/hvm/vmx/nest.h
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/xen/include/asm-x86/hvm/vmx/nest.h      Wed Sep 08 21:03:41 2010
> +0800 @@ -0,0 +1,45 @@
> +/*
> + * nest.h: nested virtualization for VMX.
> + *
> + * Copyright (c) 2010, Intel Corporation.
> + * Author: Qing He <qing.he@xxxxxxxxx>
> + *
> + * This program is free software; you can redistribute it and/or
> modify it + * under the terms and conditions of the GNU General
> Public License, + * version 2, as published by the Free Software
> Foundation. + *
> + * This program is distributed in the hope it will be useful, but
> WITHOUT + * ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> General Public License for + * more details.
> + *
> + * You should have received a copy of the GNU General Public License
> along with + * this program; if not, write to the Free Software
> Foundation, Inc., 59 Temple + * Place - Suite 330, Boston, MA
> 02111-1307 USA. + *
> + */
> +#ifndef __ASM_X86_HVM_NEST_H__
> +#define __ASM_X86_HVM_NEST_H__
> +
> +struct vmcs_struct;
> +
> +struct vmx_nest_struct {
> +    paddr_t              guest_vmxon_pa;
> +
> +    /* Saved host vmcs for vcpu itself */
> +    struct vmcs_struct  *hvmcs;
> +
> +    /*
> +     * Guest's `current vmcs' of vcpu
> +     *  - gvmcs_pa: guest VMCS region physical address
> +     *  - vvmcs:    (guest) virtual vmcs
> +     *  - svmcs:    effective vmcs for the guest of this vcpu
> +     *  - valid:    launch state: invalid on clear, valid on ld
> +     */
> +    paddr_t              gvmcs_pa;
> +    void                *vvmcs;
> +    struct vmcs_struct  *svmcs;
> +    int                  vmcs_valid;
> +};
> +
> +#endif /* __ASM_X86_HVM_NEST_H__ */
> diff -r fc4de5eedd1d xen/include/asm-x86/hvm/vmx/vmcs.h
> --- a/xen/include/asm-x86/hvm/vmx/vmcs.h      Wed Sep 08 21:00:00 2010
> +0800 +++ b/xen/include/asm-x86/hvm/vmx/vmcs.h        Wed Sep 08 21:03:41
> 2010 +0800 @@ -22,6 +22,7 @@
>  #include <asm/config.h>
>  #include <asm/hvm/io.h>
>  #include <asm/hvm/vpmu.h>
> +#include <asm/hvm/vmx/nest.h>
> 
>  extern void vmcs_dump_vcpu(struct vcpu *v);
>  extern void setup_vmcs_dump(void);
> @@ -99,6 +100,9 @@
>      u32                  secondary_exec_control;
>      u32                  exception_bitmap;
> 
> +    /* nested virtualization */
> +    struct vmx_nest_struct nest;
> +
>  #ifdef __x86_64__
>      struct vmx_msr_state msr_state;
>      unsigned long        shadow_gs;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

Hi, 

This one remind me something when I was reviewing other VMM side patch.
The terminology here is pretty hard. One naming solution from nested 
virtualization layer point of view is to use subscript (IBM guys uses this in 
their to-be-coming OSDI paper as well). Here is an example:

L2 guest
L1 guest (VMM)
L0 VMM

vmcs01 is the VMCS that L0 VMM uses for L1 guest, like vmcs in single layer 
virtualization.   (hvmcs in current patch)
vmcs12 is the VMCS that L1 VMM uses for L2 guest. But this vmcs12 is visible to 
L0 VMM. (vvmcs in current patch)
vmcs02 is the VMCS that L0 VMM uses for L2 guest when L2 guest is executing. It 
is a kind of shadow of vmcs12. (svmcs in current patch)

Will this be more clear? Appreciate for your comments (except Qing and me).

Thx, Eddie

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.