From 9cb4fdbd3d2a12afb5b5889944814ef58dec8371 Mon Sep 17 00:00:00 2001 From: Mike Larkin Date: Wed, 12 Aug 2015 05:31:42 +0000 Subject: Incorrect comparison when accessing cpuid extended function 0x80000007. ok kettenis@, guenther@ --- sys/arch/amd64/amd64/identcpu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c index e074300642b..c0aa9409028 100644 --- a/sys/arch/amd64/amd64/identcpu.c +++ b/sys/arch/amd64/amd64/identcpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: identcpu.c,v 1.63 2015/07/21 03:38:22 reyk Exp $ */ +/* $OpenBSD: identcpu.c,v 1.64 2015/08/12 05:31:41 mlarkin Exp $ */ /* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */ /* @@ -544,11 +544,12 @@ identifycpu(struct cpu_info *ci) #ifndef SMALL_KERNEL if (ci->ci_flags & CPUF_PRIMARY) { - if (pnfeatset > 0x80000007) { + if (!strcmp(cpu_vendor, "AuthenticAMD") && + pnfeatset >= 0x80000007) { CPUID(0x80000007, dummy, dummy, dummy, pnfeatset); if (pnfeatset & 0x06) { - if ((ci->ci_signature & 0xF00) == 0xf00) + if ((ci->ci_signature & 0xF00) == 0xF00) setperf_setup = k8_powernow_init; } if (ci->ci_family >= 0x10) -- cgit v1.2.3