From: "Jan Beulich" Subject: [PATCH] x86: set ARAT feature flag for non-buggy AMD CPUs Date: Fri, 29 Apr 2011 11:20:58 +0100 Message-ID: <4DBAAD2A020000780003EDE8@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part1438EE1A.0__=" Return-path: 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" 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. --=__Part1438EE1A.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This is the equivalent of a recent Linux change. Signed-off-by: Jan Beulich --- a/xen/arch/x86/cpu/amd.c +++ b/xen/arch/x86/cpu/amd.c @@ -474,6 +474,10 @@ static void __devinit init_amd(struct cp } #endif =20 + /* As a rule processors have APIC timer running in deep C states = */ + if (c->x86 >=3D 0xf && !cpu_has_amd_erratum(c, AMD_ERRATUM_400)) + set_bit(X86_FEATURE_ARAT, c->x86_capability); + /* Prevent TSC drift in non single-processor, single-core = platforms. */ if ((smp_processor_id() =3D=3D 1) && c1_ramping_may_cause_clock_dri= ft(c)) disable_c1_ramping(); --- a/xen/include/asm-x86/amd.h +++ b/xen/include/asm-x86/amd.h @@ -134,6 +134,10 @@ AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf), \ AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0x1, 0x0)) =20 +#define AMD_ERRATUM_400 \ + AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf), \ + AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf)) + struct cpuinfo_x86; int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...); =20 --=__Part1438EE1A.0__= Content-Type: text/plain; name="x86-AMD-ARAT.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-AMD-ARAT.patch" This is the equivalent of a recent Linux change.=0A=0ASigned-off-by: Jan = Beulich =0A=0A--- a/xen/arch/x86/cpu/amd.c=0A+++ = b/xen/arch/x86/cpu/amd.c=0A@@ -474,6 +474,10 @@ static void __devinit = init_amd(struct cp=0A }=0A #endif=0A =0A+ /* As a rule processors = have APIC timer running in deep C states */=0A+ if (c->x86 >=3D 0xf && = !cpu_has_amd_erratum(c, AMD_ERRATUM_400))=0A+ set_bit(X86_FEATURE= _ARAT, c->x86_capability);=0A+=0A /* Prevent TSC drift in non = single-processor, single-core platforms. */=0A if ((smp_processor_id() = =3D=3D 1) && c1_ramping_may_cause_clock_drift(c))=0A disable_c1_= ramping();=0A--- a/xen/include/asm-x86/amd.h=0A+++ b/xen/include/asm-x86/am= d.h=0A@@ -134,6 +134,10 @@=0A AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10,= 0x2, 0x1, 0xff, 0xf), \=0A AMD_MODEL_RANGE(0x12, 0x0, = 0x0, 0x1, 0x0))=0A =0A+#define AMD_ERRATUM_400 = \=0A+ AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, = 0x41, 0x2, 0xff, 0xf), \=0A+ AMD_MODEL_RANGE(0x1= 0, 0x2, 0x1, 0xff, 0xf))=0A+=0A struct cpuinfo_x86;=0A int cpu_has_amd_erra= tum(const struct cpuinfo_x86 *, int, ...);=0A =0A --=__Part1438EE1A.0__= 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.xensource.com http://lists.xensource.com/xen-devel --=__Part1438EE1A.0__=--