From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2 4/5] Viridian: populate CPUID leaf 6 Date: Thu, 4 Jul 2013 10:38:10 +0100 Message-ID: <51D54282.6080907@citrix.com> References: <51C8092A02000078000DFDA0@nat28.tlf.novell.com> <51C80C3102000078000DFDC6@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0670051718010348599==" Return-path: In-Reply-To: <51C80C3102000078000DFDC6@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Keir Fraser , George Dunlap , Eddie Dong , xen-devel , paul.durrant@citrix.com, Jun Nakajima , Yang Z Zhang List-Id: xen-devel@lists.xenproject.org --===============0670051718010348599== Content-Type: multipart/alternative; boundary="------------000208060403080200080605" --------------000208060403080200080605 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit On 24/06/13 08:06, Jan Beulich wrote: > Properly reporting hardware features we use can only help Windows in > making decisions towards its own performance tuning. > > Signed-off-by: Jan Beulich Does viridian allow for the possibility of these flags to change during runtime, e.g. migrating an HVM domain from hardware supporting HAP to hardware which can only manage shadow? ~Andrew > > --- a/xen/arch/x86/hvm/viridian.c > +++ b/xen/arch/x86/hvm/viridian.c > @@ -41,6 +41,11 @@ > #define CPUID4A_MSR_BASED_APIC (1 << 3) > #define CPUID4A_RELAX_TIMER_INT (1 << 5) > > +/* Viridian CPUID 4000006, Implementation HW features detected and in use. */ > +#define CPUID6A_APIC_OVERLAY (1 << 0) > +#define CPUID6A_MSR_BITMAPS (1 << 1) > +#define CPUID6A_NESTED_PAGING (1 << 3) > + > int cpuid_viridian_leaves(unsigned int leaf, unsigned int *eax, > unsigned int *ebx, unsigned int *ecx, > unsigned int *edx) > @@ -92,6 +97,15 @@ int cpuid_viridian_leaves(unsigned int l > *eax |= CPUID4A_MSR_BASED_APIC; > *ebx = 2047; /* long spin count */ > break; > + case 6: > + /* Detected and in use hardware features. */ > + if ( cpu_has_vmx_virtualize_apic_accesses ) > + *eax |= CPUID6A_APIC_OVERLAY; > + if ( cpu_has_vmx_msr_bitmap || (read_efer() & EFER_SVME) ) > + *eax |= CPUID6A_MSR_BITMAPS; > + if ( hap_enabled(d) ) > + *eax |= CPUID6A_NESTED_PAGING; > + break; > } > > return 1; > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel --------------000208060403080200080605 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit
On 24/06/13 08:06, Jan Beulich wrote:
Properly reporting hardware features we use can only help Windows in
making decisions towards its own performance tuning.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Does viridian allow for the possibility of these flags to change during runtime, e.g. migrating an HVM domain from hardware supporting HAP to hardware which can only manage shadow?

~Andrew


--- a/xen/arch/x86/hvm/viridian.c
+++ b/xen/arch/x86/hvm/viridian.c
@@ -41,6 +41,11 @@
 #define CPUID4A_MSR_BASED_APIC  (1 << 3)
 #define CPUID4A_RELAX_TIMER_INT (1 << 5)
 
+/* Viridian CPUID 4000006, Implementation HW features detected and in use. */
+#define CPUID6A_APIC_OVERLAY    (1 << 0)
+#define CPUID6A_MSR_BITMAPS     (1 << 1)
+#define CPUID6A_NESTED_PAGING   (1 << 3)
+
 int cpuid_viridian_leaves(unsigned int leaf, unsigned int *eax,
                           unsigned int *ebx, unsigned int *ecx,
                           unsigned int *edx)
@@ -92,6 +97,15 @@ int cpuid_viridian_leaves(unsigned int l
             *eax |= CPUID4A_MSR_BASED_APIC;
         *ebx = 2047; /* long spin count */
         break;
+    case 6:
+        /* Detected and in use hardware features. */
+        if ( cpu_has_vmx_virtualize_apic_accesses )
+            *eax |= CPUID6A_APIC_OVERLAY;
+        if ( cpu_has_vmx_msr_bitmap || (read_efer() & EFER_SVME) )
+            *eax |= CPUID6A_MSR_BITMAPS;
+        if ( hap_enabled(d) )
+            *eax |= CPUID6A_NESTED_PAGING;
+        break;
     }
 
     return 1;





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--------------000208060403080200080605-- --===============0670051718010348599== 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.xen.org http://lists.xen.org/xen-devel --===============0670051718010348599==--