WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 16/16] vmx: nest: expose cpuid and CR4.VMXE

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH 16/16] vmx: nest: expose cpuid and CR4.VMXE
From: Christoph Egger <Christoph.Egger@xxxxxxx>
Date: Wed, 15 Sep 2010 11:43:28 +0200
Cc: Qing He <qing.he@xxxxxxxxx>
Delivery-date: Wed, 15 Sep 2010 02:44:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1283959344-3837-17-git-send-email-qing.he@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1283959344-3837-1-git-send-email-qing.he@xxxxxxxxx> <1283959344-3837-17-git-send-email-qing.he@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.10
On Wednesday 08 September 2010 17:22:24 Qing He wrote:
> expose VMX cpuid and allow guest to enable VMX.
>
> Signed-off-by: Qing He <qing.he@xxxxxxxxx>
> Signed-off-by: Eddie Dong <eddie.dong@xxxxxxxxx>
>
> ---
>
> diff -r 3f40a1f79cf8 tools/libxc/xc_cpuid_x86.c
> --- a/tools/libxc/xc_cpuid_x86.c      Wed Sep 08 19:47:39 2010 +0800
> +++ b/tools/libxc/xc_cpuid_x86.c      Wed Sep 08 19:49:06 2010 +0800
> @@ -128,8 +128,17 @@
>      const unsigned int *input, unsigned int *regs,
>      int is_pae)
>  {
> +    unsigned long nest;
> +
>      switch ( input[0] )
>      {
> +    case 0x00000001:
> +        /* ECX[5] is availability of VMX */
> +        xc_get_hvm_param(xch, domid, HVM_PARAM_NESTEDHVM, &nest);
> +        if (nest)
> +            regs[2] |= 0x20;
> +        break;
> +

I merged this part into my tools patch this way:

              /* ECX[5] is availability of VMX */
              if (is_nstedhvm)
                  set_bit(X86_FEATURE_VMXE, regs[2]);
              break;


>      case 0x00000004:
>          /*
>           * EAX[31:26] is Maximum Cores Per Package (minus one).
> diff -r 3f40a1f79cf8 xen/include/asm-x86/hvm/hvm.h
> --- a/xen/include/asm-x86/hvm/hvm.h   Wed Sep 08 19:47:39 2010 +0800
> +++ b/xen/include/asm-x86/hvm/hvm.h   Wed Sep 08 19:49:06 2010 +0800
> @@ -295,7 +295,8 @@
>          X86_CR4_DE  | X86_CR4_PSE | X86_CR4_PAE |       \
>          X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE |       \
>          X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT |           \
> -        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))))
> +        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0)   |       \
> +        X86_CR4_VMXE)))


I changed this to

         (cpu_has_vmx ? X86_CR4_VMXE : 0))))

where cpu_has vmx is in <asm/cpufeature.h> defined as

 #define cpu_has_vmx  boot_cpu_has(X86_FEATURE_VMXE)

Christoph

>  /* These exceptions must always be intercepted. */
>  #define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U <<
> TRAP_invalid_op))
>



-- 
---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


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

<Prev in Thread] Current Thread [Next in Thread>