From mboxrd@z Thu Jan 1 00:00:00 1970 From: Qing He Subject: [PATCH 03/16] vmx: nest: nested availability and status flags Date: Wed, 8 Sep 2010 23:22:11 +0800 Message-ID: <1283959344-3837-4-git-send-email-qing.he@intel.com> References: <1283959344-3837-1-git-send-email-qing.he@intel.com> Return-path: In-Reply-To: <1283959344-3837-1-git-send-email-qing.he@intel.com> 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 Cc: Qing He List-Id: xen-devel@lists.xenproject.org These are the vendor neutral availability and status flags of nested virtualization. The availability hvm parameter can be used to disable all reporting and functions of nested, improving guest security in certain circumstances. The per vcpu flag in_nesting is used to indicate fundamental status: the current mode. Signed-off-by: Qing He Signed-off-by: Eddie Dong --- diff -r 11c98ab76326 xen/include/asm-x86/hvm/hvm.h --- a/xen/include/asm-x86/hvm/hvm.h Wed Sep 08 20:35:38 2010 +0800 +++ b/xen/include/asm-x86/hvm/hvm.h Wed Sep 08 20:36:19 2010 +0800 @@ -250,6 +250,10 @@ #define is_viridian_domain(_d) \ (is_hvm_domain(_d) && ((_d)->arch.hvm_domain.params[HVM_PARAM_VIRIDIAN])) +#define is_nested_avail(_d) \ + (is_hvm_domain(_d) && ((_d)->arch.hvm_domain.params[HVM_PARAM_NESTEDHVM])) + + void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx); void hvm_migrate_timers(struct vcpu *v); diff -r 11c98ab76326 xen/include/asm-x86/hvm/vcpu.h --- a/xen/include/asm-x86/hvm/vcpu.h Wed Sep 08 20:35:38 2010 +0800 +++ b/xen/include/asm-x86/hvm/vcpu.h Wed Sep 08 20:36:19 2010 +0800 @@ -71,6 +71,8 @@ bool_t debug_state_latch; bool_t single_step; + bool_t in_nesting; + u64 asid_generation; u32 asid; diff -r 11c98ab76326 xen/include/public/hvm/params.h --- a/xen/include/public/hvm/params.h Wed Sep 08 20:35:38 2010 +0800 +++ b/xen/include/public/hvm/params.h Wed Sep 08 20:36:19 2010 +0800 @@ -113,6 +113,9 @@ #define HVM_PARAM_CONSOLE_PFN 17 #define HVM_PARAM_CONSOLE_EVTCHN 18 -#define HVM_NR_PARAMS 19 +/* Boolean: Enable nested virtualization (hvm only) */ +#define HVM_PARAM_NESTEDHVM 19 + +#define HVM_NR_PARAMS 20 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */