From: "Jan Beulich" Subject: [PATCH v2 4/5] Viridian: populate CPUID leaf 6 Date: Mon, 24 Jun 2013 08:06:57 +0100 Message-ID: <51C80C3102000078000DFDC6@nat28.tlf.novell.com> References: <51C8092A02000078000DFDA0@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part0F3F9401.3__=" Return-path: In-Reply-To: <51C8092A02000078000DFDA0@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: xen-devel Cc: Keir Fraser , George Dunlap , Eddie Dong , paul.durrant@citrix.com, Jun Nakajima , Yang Z Zhang List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part0F3F9401.3__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Properly reporting hardware features we use can only help Windows in making decisions towards its own performance tuning. Signed-off-by: Jan Beulich --- 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) =20 +/* 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 |=3D CPUID4A_MSR_BASED_APIC; *ebx =3D 2047; /* long spin count */ break; + case 6: + /* Detected and in use hardware features. */ + if ( cpu_has_vmx_virtualize_apic_accesses ) + *eax |=3D CPUID6A_APIC_OVERLAY; + if ( cpu_has_vmx_msr_bitmap || (read_efer() & EFER_SVME) ) + *eax |=3D CPUID6A_MSR_BITMAPS; + if ( hap_enabled(d) ) + *eax |=3D CPUID6A_NESTED_PAGING; + break; } =20 return 1; --=__Part0F3F9401.3__= Content-Type: text/plain; name="x86-Viridian-CPUID-leaf6.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-Viridian-CPUID-leaf6.patch" Viridian: populate CPUID leaf 6=0A=0AProperly reporting hardware features = we use can only help Windows in=0Amaking decisions towards its own = performance tuning.=0A=0ASigned-off-by: Jan Beulich =0A= =0A--- a/xen/arch/x86/hvm/viridian.c=0A+++ b/xen/arch/x86/hvm/viridian.c=0A= @@ -41,6 +41,11 @@=0A #define CPUID4A_MSR_BASED_APIC (1 << 3)=0A #define = CPUID4A_RELAX_TIMER_INT (1 << 5)=0A =0A+/* Viridian CPUID 4000006, = Implementation HW features detected and in use. */=0A+#define CPUID6A_APIC_= OVERLAY (1 << 0)=0A+#define CPUID6A_MSR_BITMAPS (1 << 1)=0A+#define = CPUID6A_NESTED_PAGING (1 << 3)=0A+=0A int cpuid_viridian_leaves(unsigned = int leaf, unsigned int *eax,=0A unsigned int = *ebx, unsigned int *ecx,=0A unsigned int = *edx)=0A@@ -92,6 +97,15 @@ int cpuid_viridian_leaves(unsigned int l=0A = *eax |=3D CPUID4A_MSR_BASED_APIC;=0A *ebx =3D 2047; /* = long spin count */=0A break;=0A+ case 6:=0A+ /* Detected = and in use hardware features. */=0A+ if ( cpu_has_vmx_virtualize_api= c_accesses )=0A+ *eax |=3D CPUID6A_APIC_OVERLAY;=0A+ if = ( cpu_has_vmx_msr_bitmap || (read_efer() & EFER_SVME) )=0A+ = *eax |=3D CPUID6A_MSR_BITMAPS;=0A+ if ( hap_enabled(d) )=0A+ = *eax |=3D CPUID6A_NESTED_PAGING;=0A+ break;=0A }=0A =0A = return 1;=0A --=__Part0F3F9401.3__= 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 --=__Part0F3F9401.3__=--