From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 20 14:14:48 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A5E31065673 for ; Fri, 20 Aug 2010 14:14:48 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B01238FC1D for ; Fri, 20 Aug 2010 14:14:47 +0000 (UTC) Received: by bwz20 with SMTP id 20so3116929bwz.13 for ; Fri, 20 Aug 2010 07:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=DmGsCb0B0pTrw8XSHmoC/3zvTjZ1MdtMz00l+8Nf7R0=; b=Fdt5fcagUYSoa8/9M1sHGKWOJn5zVklK94m2GyKmiyJkCC3SvcrUrosaVJNth+gfUE s6XwlAWe/YnegHQLbkm/Ae0XMtwwY80sPq1sYpb6Zfu2t4ujITWftfG4b1TqmmNnuzOV kYJMoFeLgwHDorsSXN6GEr6BaACFp+F3S4ieQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=betYouiPwAv8S9xGYrjk+zPtXehbfPdBqnFPNHbrYv7EE0cyCY4DYRzUEJvuNHdWEI eH2Vzvuo3zEtBmlMJpBx6sqMfGz0MsZoP6/zwYNJqmziMXbx0qWpk6OrYiUH1Ds7Gk1X TNn9RAQd2/EV2WsQ8h4YdRnxiQZO98MWMRT1U= MIME-Version: 1.0 Received: by 10.204.68.10 with SMTP id t10mr1038132bki.77.1282313686521; Fri, 20 Aug 2010 07:14:46 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.204.82.6 with HTTP; Fri, 20 Aug 2010 07:14:46 -0700 (PDT) Date: Fri, 20 Aug 2010 07:14:46 -0700 X-Google-Sender-Auth: 6MvaYIqhCtMJo1bbqEcJQ6xUqNQ Message-ID: From: Garrett Cooper To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Question about printcpuinfo in sys/amd64/amd64/indentcpu.c X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2010 14:14:48 -0000 Hi, Currently the code in identcpu.c does a check for a specific cpu value extension. This is set to 0x80000004 (even though the corresponding code below iterates through 0x80000002:0x80000005): /* Check for extended CPUID information and a processor name. */ if (cpu_exthigh >= 0x80000004) { brand = cpu_brand; for (i = 0x80000002; i < 0x80000005; i++) { do_cpuid(i, regs); memcpy(brand, regs, sizeof(regs)); brand += sizeof(regs); } } Why was this done? Because some processors lie and state that they're newer than the processor version that they actually are? This was committed in CVS revision 1.80.2.14 with the following message: MFC: Precursors to simple hyperthreading support and sync with current: - Axe earlysetcpuclass() as it was OBE a long time ago. - Add cpu_exthigh to hold the highest supported extended cpuid. - Don't initialize cpu_class, the initial value isn't used anywhere. - Make the support for processor names in the extended cpuid information shared between the AMD and Transmeta sections and also perform it for Intel CPUs. - Support brand-indexed names for Intel CPUs. - Sync AMD 486 cpu_model's with current. - Remove duplicate and bogus docs for bits 28 and 29 of cpuid features. - Document bits 30 and 31 of cpuid features. - Display the number of logical cores on CPUs that support hyperthreading. - Make hw_instruction_sse static. - Move enable_sse()'s prototype to machine/md_var.h. - Add cpu_procinfo to hold information about this processor from cpuid 1 including count of HTT cores, brand index, local APIC ID, etc. Thanks, -Garrett