Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Aug 2010 07:14:46 -0700
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        hackers@freebsd.org
Subject:   Question about printcpuinfo in sys/amd64/amd64/indentcpu.c
Message-ID:  <AANLkTi=CB4eyZPsj%2BNdFfYo3bhQ-P=1icnxAHx3VaT%2Bn@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=CB4eyZPsj%2BNdFfYo3bhQ-P=1icnxAHx3VaT%2Bn>