From 81a87170477ba97469f8b58ad71f0b493fbf98de Mon Sep 17 00:00:00 2001 From: Gordon Willem Klok Date: Sun, 30 Sep 2007 17:50:21 +0000 Subject: On i386, only call amd64_errata() on amd64 processors (family 0xf), tested by krw@. This diff by itself is insufficient to ensure that we are only running on an amd64: todd@'s machine is a mobile Athlon XP that has a cpuid family of 0xf but is not an amd64 processor so more must be done but this should prevent the vast majority of cases. ok tom@ --- sys/arch/i386/i386/machdep.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sys/arch/i386') diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 49962050f41..39b623bf62a 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.407 2007/09/07 15:00:19 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.408 2007/09/30 17:50:20 gwk Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -1308,6 +1308,7 @@ void amd_family6_setup(struct cpu_info *ci) { #if !defined(SMALL_KERNEL) && defined(I686_CPU) + int family = (ci->ci_signature >> 8) & 15; extern void (*pagezero)(void *, size_t); extern void sse2_pagezero(void *, size_t); extern void i686_pagezero(void *, size_t); @@ -1318,6 +1319,10 @@ amd_family6_setup(struct cpu_info *ci) pagezero = i686_pagezero; setperf_setup = amd_family6_setperf_setup; + + if (family == 0xf) { + amd64_errata(ci); + } #endif } @@ -1868,8 +1873,6 @@ identifycpu(struct cpu_info *ci) } else i386_use_fxsave = 0; - if (vendor == CPUVENDOR_AMD) - amd64_errata(ci); #endif /* I686_CPU */ } -- cgit v1.2.3