From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: [PATCH 02/13] Nested Virtualization: data structure Date: Fri, 12 Nov 2010 19:40:58 +0100 Message-ID: <201011121940.58783.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_6oY3MS4V8qjnrWn" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_6oY3MS4V8qjnrWn Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline -- ---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 --Boundary-00=_6oY3MS4V8qjnrWn Content-Type: text/x-diff; charset="iso 8859-15"; name="xen_nh02_structdata.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_nh02_structdata.diff" Content-Description: xen_nh02_structdata.diff # HG changeset patch # User cegger # Date 1289574148 -3600 Data structures for Nested Virtualization Signed-off-by: Christoph Egger diff -r de4c5c587cb9 -r 0ffc80ffc6c5 xen/include/asm-x86/hvm/hvm.h --- a/xen/include/asm-x86/hvm/hvm.h +++ b/xen/include/asm-x86/hvm/hvm.h @@ -52,7 +52,8 @@ enum hvm_intblk { hvm_intblk_shadow, /* MOV-SS or STI shadow */ hvm_intblk_rflags_ie, /* RFLAGS.IE == 0 */ hvm_intblk_tpr, /* LAPIC TPR too high */ - hvm_intblk_nmi_iret /* NMI blocked until IRET */ + hvm_intblk_nmi_iret, /* NMI blocked until IRET */ + hvm_intblk_arch, /* SVM/VMX specific reason */ }; /* These happen to be the same as the VMX interrupt shadow definitions. */ diff -r de4c5c587cb9 -r 0ffc80ffc6c5 xen/include/asm-x86/hvm/vcpu.h --- a/xen/include/asm-x86/hvm/vcpu.h +++ b/xen/include/asm-x86/hvm/vcpu.h @@ -36,6 +36,33 @@ enum hvm_io_state { HVMIO_completed }; +struct nestedvcpu { + bool_t nv_guestmode; /* vcpu in guestmode? */ + void *nv_vmcx; /* l1 guest virtual VMCB/VMCS */ + + /* address of l1 guest virtual VMCB/VMCS, needed for VMEXIT */ + uint64_t nv_vmcxaddr; + + /* SVM/VMX arch specific */ + union { + } u; + + bool_t nv_flushp2m; /* True, when p2m table must be flushed */ + struct p2m_domain *nv_p2m; /* used p2m table for this vcpu */ + + union { + uint32_t bytes; + struct { + uint32_t vmentry_pending: 1; + uint32_t vmexit_pending: 1; + uint32_t vmswitch_in_progress: 1; /* true during vmentry/vmexit emulation */ + uint32_t reserved : 29; + } fields; + } nv_hostflags; +}; + +#define vcpu_nestedhvm(v) ((v)->arch.hvm_vcpu.nvcpu) + struct hvm_vcpu { /* Guest control-register and EFER values, just as the guest sees them. */ unsigned long guest_cr[5]; @@ -78,6 +105,8 @@ struct hvm_vcpu { struct tasklet assert_evtchn_irq_tasklet; + struct nestedvcpu nvcpu; + struct mtrr_state mtrr; u64 pat_cr; --Boundary-00=_6oY3MS4V8qjnrWn Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_6oY3MS4V8qjnrWn--