All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Egger <Christoph.Egger@amd.com>
To: xen-devel@lists.xensource.com
Cc: "Dong, Eddie" <eddie.dong@intel.com>, "He, Qing" <qing.he@intel.com>
Subject: Re: [PATCH 04/16] vmx: nest: nested control structure
Date: Wed, 15 Sep 2010 15:17:42 +0200	[thread overview]
Message-ID: <201009151517.43855.Christoph.Egger@amd.com> (raw)
In-Reply-To: <1A42CE6F5F474C41B63392A5F80372B22A8C237B@shsmsx501.ccr.corp.intel.com>

On Wednesday 15 September 2010 15:06:03 Dong, Eddie wrote:
> Christoph Egger wrote:
> > On Wednesday 08 September 2010 17:22:12 Qing He wrote:
> >> v->arch.hvm_vmx.nest as control structure
> >>
> >> Signed-off-by: Qing He <qing.he@intel.com>
> >> Signed-off-by: Eddie Dong <eddie.dong@intel.com>
> >>
> >> ---
> >> 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@intel.com>
> >> + *
> >> + * 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 {
> >
> > Is it ok to name it 'struct nestedvmx' ?
>
> Fine, renamed to nested_vmx.
>
> >> +    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;
> >
> > I think, the structure should be allocated in the
> > nestedhvm_vcpu_initialise() function hook and assigned to the nh_arch
> > pointer in struct nestedhvm.
>
> Well, the structure itself is pretty small, so dynamic allocation is really
> not a good idea. Instead, the internal field such as vvmcs/svmcs are big
> and thus we use a pointer, but they are allocated on demand. This follows
> the style of arch_vmx_struct in vcpu data structure.
>
> I am fine with your nestedhvm_vcpu_initialise "design", but VMX doesn't
> need to use the wrapper so far.

It should be implemented good enough that vcpu creation doesn't fail.

Christoph


-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

  reply	other threads:[~2010-09-15 13:17 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-08 15:22 [PATCH 00/16] Nested virtualization for VMX Qing He
2010-09-08 15:22 ` [PATCH 01/16] vmx: nest: rename host_vmcs Qing He
2010-09-10 13:27   ` Christoph Egger
2010-09-08 15:22 ` [PATCH 02/16] vmx: nest: wrapper for control update Qing He
2010-09-10 13:29   ` Christoph Egger
2010-09-08 15:22 ` [PATCH 03/16] vmx: nest: nested availability and status flags Qing He
2010-09-15 11:43   ` Christoph Egger
2010-09-15 14:18     ` Dong, Eddie
2010-09-08 15:22 ` [PATCH 04/16] vmx: nest: nested control structure Qing He
2010-09-09  6:13   ` Dong, Eddie
2010-09-15 11:27   ` Christoph Egger
2010-09-15 13:06     ` Dong, Eddie
2010-09-15 13:17       ` Christoph Egger [this message]
2010-09-15 13:31         ` Christoph Egger
2010-09-15 13:46           ` Dong, Eddie
2010-09-15 14:02             ` Christoph Egger
2010-09-08 15:22 ` [PATCH 05/16] vmx: nest: virtual vmcs layout Qing He
2010-09-13 10:29   ` Tim Deegan
2010-09-08 15:22 ` [PATCH 06/16] vmx: nest: handling VMX instruction exits Qing He
2010-09-10  7:05   ` Dong, Eddie
2010-09-13 11:11     ` Tim Deegan
2010-09-13 14:29       ` Dong, Eddie
2010-09-13 14:46         ` Tim Deegan
2010-09-13 11:10   ` Tim Deegan
2010-09-15  4:55     ` Dong, Eddie
2010-09-15  6:40       ` Keir Fraser
2010-09-15  6:49         ` Dong, Eddie
2010-09-15  7:31           ` Keir Fraser
2010-09-15  8:15             ` Christoph Egger
2010-09-15  8:23               ` Keir Fraser
2010-09-15  9:08                 ` Dong, Eddie
2010-09-15 11:39                   ` Keir Fraser
2010-09-15 12:36                     ` Dong, Eddie
2010-09-15 13:12                       ` Keir Fraser
2010-09-20  3:13                         ` Dong, Eddie
2010-09-20  8:08                           ` Keir Fraser
2010-09-20  9:33                             ` Dong, Eddie
2010-09-20  9:41                               ` Keir Fraser
2010-09-20 13:10                                 ` Dong, Eddie
2010-09-20  9:41                             ` Christoph Egger
2010-09-20 13:14                               ` Dong, Eddie
2010-09-15  7:17         ` Qing He
2010-09-15  7:38           ` Keir Fraser
2010-09-15  7:56             ` Dong, Eddie
2010-09-15  8:15               ` Keir Fraser
2010-09-15  9:26                 ` Tim Deegan
2010-09-15  9:56                   ` Dong, Eddie
2010-09-15 11:46                     ` Keir Fraser
2010-09-08 15:22 ` [PATCH 07/16] vmx: nest: switch current vmcs Qing He
2010-09-08 15:22 ` [PATCH 08/16] vmx: nest: vmresume/vmlaunch Qing He
2010-09-15  9:52   ` Christoph Egger
2010-09-15 11:30     ` Christoph Egger
2010-09-20  5:19       ` Dong, Eddie
2010-09-08 15:22 ` [PATCH 09/16] vmx: nest: shadow controls Qing He
2010-09-08 15:22 ` [PATCH 10/16] vmx: nest: L1 <-> L2 context switch Qing He
2010-09-08 15:22 ` [PATCH 11/16] vmx: nest: interrupt handling Qing He
2010-09-08 15:22 ` [PATCH 12/16] vmx: nest: VMExit handler in L2 Qing He
2010-09-08 15:22 ` [PATCH 13/16] vmx: nest: L2 tsc Qing He
2010-09-08 15:22 ` [PATCH 14/16] vmx: nest: CR0.TS and #NM Qing He
2010-09-08 15:22 ` [PATCH 15/16] vmx: nest: capability reporting MSRs Qing He
2010-09-13 12:45   ` Tim Deegan
2010-09-15 10:05   ` Christoph Egger
2010-09-15 14:28     ` Dong, Eddie
2010-09-15 14:45       ` Christoph Egger
2010-09-16 14:10         ` Dong, Eddie
2010-09-08 15:22 ` [PATCH 16/16] vmx: nest: expose cpuid and CR4.VMXE Qing He
2010-09-15  9:43   ` Christoph Egger
2010-09-13 13:10 ` [PATCH 00/16] Nested virtualization for VMX Tim Deegan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201009151517.43855.Christoph.Egger@amd.com \
    --to=christoph.egger@amd.com \
    --cc=eddie.dong@intel.com \
    --cc=qing.he@intel.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.