From: "Jan Beulich" Subject: [PATCH v2 2/5] VMX/Viridian: suppress MSR-based APIC suggestion when having APIC-V Date: Mon, 24 Jun 2013 08:04:50 +0100 Message-ID: <51C80BB202000078000DFDB2@nat28.tlf.novell.com> References: <51C8092A02000078000DFDA0@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part93A30882.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. --=__Part93A30882.3__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline When the CPU has the necessary capabilities, having Windows use synthetic MSR reads/writes is bogus, as this still requires emulation (which is pretty much guaranteed to be slower than having the hardware carry out the operation). Signed-off-by: Jan Beulich --- a/xen/arch/x86/hvm/viridian.c +++ b/xen/arch/x86/hvm/viridian.c @@ -87,8 +87,9 @@ int cpuid_viridian_leaves(unsigned int l if ( (d->arch.hvm_domain.viridian.guest_os_id.raw =3D=3D 0) || (d->arch.hvm_domain.viridian.guest_os_id.fields.os < 4) ) break; - *eax =3D (CPUID4A_MSR_BASED_APIC | - CPUID4A_RELAX_TIMER_INT); + *eax =3D CPUID4A_RELAX_TIMER_INT; + if ( !cpu_has_vmx_apic_reg_virt ) + *eax |=3D CPUID4A_MSR_BASED_APIC; *ebx =3D 2047; /* long spin count */ break; } --=__Part93A30882.3__= Content-Type: text/plain; name="x86-Viridian-CPUID-APICV.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-Viridian-CPUID-APICV.patch" VMX/Viridian: suppress MSR-based APIC suggestion when having APIC-V=0A=0AWh= en the CPU has the necessary capabilities, having Windows use=0Asynthetic = MSR reads/writes is bogus, as this still requires emulation=0A(which is = pretty much guaranteed to be slower than having the hardware=0Acarry out = the operation).=0A=0ASigned-off-by: Jan Beulich =0A=0A--= - a/xen/arch/x86/hvm/viridian.c=0A+++ b/xen/arch/x86/hvm/viridian.c=0A@@ = -87,8 +87,9 @@ int cpuid_viridian_leaves(unsigned int l=0A if ( = (d->arch.hvm_domain.viridian.guest_os_id.raw =3D=3D 0) ||=0A = (d->arch.hvm_domain.viridian.guest_os_id.fields.os < 4) )=0A = break;=0A- *eax =3D (CPUID4A_MSR_BASED_APIC |=0A- = CPUID4A_RELAX_TIMER_INT);=0A+ *eax =3D CPUID4A_RELAX_TIMER_INT;=0A+ = if ( !cpu_has_vmx_apic_reg_virt )=0A+ *eax |=3D = CPUID4A_MSR_BASED_APIC;=0A *ebx =3D 2047; /* long spin count */=0A = break;=0A }=0A --=__Part93A30882.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 --=__Part93A30882.3__=--