Commit Graph

127 Commits

Author SHA1 Message Date
msaitoh 6f3942e76a Decode Intel Hybrid Information Enumeration (CPUID Fn0000_001a). 2022-01-29 08:20:45 +00:00
msaitoh 4e642f75a7 Remove debug code and simplify. No functional change. 2022-01-27 09:53:43 +00:00
msaitoh a80eb31137 Add Alder Lake, Rocket Lake and Sapphire Rapids. From the latest Intel SDM. 2022-01-13 16:02:44 +00:00
msaitoh 9833ff7c7e Print 1GB TLB entry at the same leve's line.
Example:
  before:
    cpu0: ITLB: 128 4KB entries 8-way, 2M/4M: 8 entries
    cpu0: DTLB: 64 4KB entries 4-way
    cpu0: L2 STLB: 4K/2M: 1024 entries
    cpu0: L1 1GB page DTLB: 4 1GB entries 4-way

  after:
    cpu0: ITLB: 128 4KB entries 8-way, 2M/4M: 8 entries
    cpu0: DTLB: 64 4KB entries 4-way, 4 1GB entries 4-way
    cpu0: L2 STLB: 4K/2M: 1024 entries
2021-12-09 14:23:06 +00:00
mrg d626ccb00f decode SMT parts for AMD family >= 0x17, not just 0x17.
now zen3 systems are properly identified by cpu topology for the
scheduler and cpuctl identify.
2021-10-27 04:15:41 +00:00
msaitoh fae021bceb Move some common functions into x86/identcpu_subr.c. No functional change. 2021-10-07 13:04:18 +00:00
msaitoh a79b797b99 Improve variable sized TLB's output.
- Fix a bug that STLB is printed as DTLB.
 - If a TLB is variable sized, print the max size instead of error message.
   XXX This is temporary solution.
2021-09-27 17:05:58 +00:00
msaitoh 5bad7a59b6 Add Load Only TLB and Store Only TLB. 2021-09-27 16:52:15 +00:00
msaitoh ec1888b4e2 Fix a bug that some TLB related lines were not printed. 2021-09-27 16:47:15 +00:00
msaitoh bdd55414af Add ':' for readability. 2021-09-27 16:22:58 +00:00
msaitoh 1fdbc7c04d Add 0x96(Elkhart Lake) and 0x9c(Jasper Lake).
Not listed in SDM but listed in those spec update documents.
2021-07-12 12:56:52 +00:00
msaitoh 1f5dbb6eb2 0x6a and 0x6c are 3rd gen Xeon Scalable (Ice Lake). 2021-07-10 17:18:05 +00:00
msaitoh 1e34099b98 - Print CPUID 0x8000008 %ebx on Intel, too. Intel now supports WBNOINVD.
- Print CPUID leaf 7 subleaf 1.
2020-11-24 00:48:39 +00:00
maxv 60236c8c49 x86: fix several CPUID flags
- Rename: CPUID_PN      -> CPUID_PSN
           CPUID_CFLUSH  -> CPUID_CLFSH
           CPUID_SBF     -> CPUID_PBE
           CPUID_LZCNT   -> CPUID_ABM
           CPUID_P1GB    -> CPUID_PAGE1GB
           CPUID2_PCLMUL -> CPUID2_PCLMULQDQ
           CPUID2_CID    -> CPUID2_CNXTID
           CPUID2_xTPR   -> CPUID2_XTPR
           CPUID2_AES    -> CPUID2_AESNI
   To match the x86 specification and the other OSes.

 - Remove: CPUID_B10, CPUID_B20, CPUID_IA64. They do not exist.
2020-09-05 07:45:44 +00:00
msaitoh 774fa17d8b Add 0xa5 and 0xa6 for Comet Lake. 2020-06-01 08:33:40 +00:00
msaitoh 0360a7d374 Get TSC frequency from CPUID 0x15 and/or x16 for newer Intel processors.
- If the max CPUID leaf is >= 0x15, take TSC value from CPUID. Some processors
   can take TSC/core crystal clock ratio but core crystal clock frequency
   can't be taken. Intel SDM give us the values for some processors.
 - It also required to change lapic_per_second to make LAPIC timer correctly.
 - Add new file x86/x86/identcpu_subr.c to share common subroutines between
   kernel and userland. Some code in x86/x86/identcpu.c and cpuctl/arch/i386.c
   will be moved to this file in future.
 - Add comment to clarify.
2020-04-21 02:56:36 +00:00
msaitoh 7f2d01cb3a No functional change:
- Rename ci_cpuid_level to ci_max_cpuid and ci_cpuid_extlevel to
   ci_max_ext_cpuid to match x86/include/cpu.h though cpuctl/arch/i386.c added
   them first.
 - Sort some entries.
 - Add comment.
2020-04-16 01:52:34 +00:00
msaitoh 6ba9c2d85f Print CPUID 0x80000007 %edx on both Intel and AMD. 2020-04-06 09:48:44 +00:00
msaitoh db775ba90f Remove ci_max_ext_cpuid because it's the same as ci_cpuid_extlevel. 2020-04-06 09:46:21 +00:00
msaitoh de6a10c185 0x7d and 0x7e are for 10th generation Core (Ice Lake). 2019-11-17 15:32:00 +00:00
msaitoh 027d9892d8 - Add definitions of AMD's CPUID Fn8000_001f Encrypted Memory features.
- Add definition of AMD's CPUID Fn8000_000a %edx bit 11 "GMET".
- Define CPUID_AMD_SVM_PFThreshold correctly.
- Modify comment a bit for consistency.
2019-10-03 15:21:44 +00:00
msaitoh 5360c5e2f0 Call cpu_dcp_cacheinfo() only when the cpuid Topology Extension flag is set
on AMD prcessor.
2019-09-09 05:36:21 +00:00
msaitoh 87de9f9cf5 Decode AMD's CPUID Fn8000_0008 %ebx. 2019-08-30 13:12:24 +00:00
msaitoh e3b8d4c830 - AMD CPUID Fn8000_0001d Cache Topology Information leaf is almost the same as
Intel Deterministic Cache Parameter Leaf(0x04), so make new
  cpu_dcp_cacheinfo() and share it.
- AMD's L2 and L3's cache descriptor's definition is the same, so use one
  common definition.
- KNF.

XXX Split some common functions to new identcpu_subr.c or use #ifdef _KERNEK
... #endif in identcpu.c to share from both kernel and cpuctl?
2019-07-26 10:03:40 +00:00
msaitoh 7d31d31305 White space fix. No functional change. 2019-05-29 03:24:23 +00:00
msaitoh 6a22d242d0 Update from the latest Intel SDM:
- Add Cascade Lake, Copper Lake
- Add Future Xeon (Cannon Lake)
- Add 06_7DH for another Ice Lake
- Add Coffee Lake based Xeon E
2019-05-28 07:51:58 +00:00
msaitoh 15b4caa55c Revert previous (accidentally committed). 2019-05-28 07:44:14 +00:00
msaitoh 8375928380 Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*. 2019-05-28 07:41:46 +00:00
mlelstv 85b41b97dc All MSRs can only be read at privilege level 0. The exact APIC ID cannot
be determined on some AMD CPUs.
2019-05-21 05:29:21 +00:00
kre 17a7ea5b15 Undo previous. Not needed (and file included isn't installed anyway. 2019-05-11 17:21:07 +00:00
christos 11e52b4657 need cpufunc.h for rdmsr 2019-05-11 12:59:50 +00:00
mlelstv 138085ddce Get CPU topology data for AMD processors. 2019-05-10 16:42:57 +00:00
msaitoh 925078524d Add HAXM. 2019-03-24 04:43:54 +00:00
msaitoh 46074b985b s/TGC/TCG/. Not Tokyo Game Show but Tiny Code Generator. 2019-03-22 04:39:02 +00:00
msaitoh edc92999c8 - Dump CPUID leaf 0x40000000 if available (for -v option).
- Regard "TCGTCGTCGTCG" as QEMU(TGC).
2019-03-22 02:33:08 +00:00
msaitoh 77e25382c8 Add Ice Lake and Tremont from the latest Intel SDM. 2019-02-05 08:07:59 +00:00
maxv 3426341fca Handle the NVMM signature. 2019-01-06 16:13:51 +00:00
msaitoh 942ff4944d Print Intel CPUID Architectural Performance Monitoring leaf Fn0000000a. 2018-11-26 04:45:13 +00:00
msaitoh ee702c097f Decode Intel/AMD MONITOR/MWAIT leaf. 2018-11-22 06:15:06 +00:00
msaitoh 7c1e0af10e Decode package, core and SMT id if CPUID 0x0b is available on Intel processor.
If the value is different from the kernel value, we should fix the kernel code.

TODO: Use 0x1f if it's available.
2018-11-21 12:19:51 +00:00
msaitoh b430389aea - AMD also reports CPUID 7's highest subleaf. Print it.
- Use macro.
2018-11-21 10:34:53 +00:00
msaitoh ee8540f68c - Use ci_feat_val[7] as CPUID 7 %edx to match x86/cpu.h
- AMD also has CPUID 6.
- Remove unused code for coretemp.
- Consistently use descs[] instead of data[].
2018-11-21 06:10:25 +00:00
msaitoh d6138c5ea5 Whitespace fix. No functional change. 2018-06-20 04:04:50 +00:00
msaitoh d2213cce79 From the latest Intel SDM:
- Add Xeon Phi 7215, 7285 and 7295
- Add Coffee Lake
2018-03-30 09:24:40 +00:00
msaitoh 0a42effe43 Add yet another Shared L2 TLB (2M/4M pages).
XXX need redesign.
2018-03-09 08:49:32 +00:00
msaitoh c27ae56af8 Calculate way and number of entries correctly from CPUID leaf 18H. 2018-03-05 10:54:05 +00:00
msaitoh cfe5ab1fa2 - Parse the TLB info from `cpuid leaf 18H' on Intel processor. Currently,
this change doesn't decode perfectly.  Tested with Gemini Lake. It has
  two L2 Shared TLB. One is 4MB and another is 2MB/4MB but former isn't
  printed yet:

	cpu0: ITLB 1 4KB entries 48-way
	cpu0: DTLB 1 4KB entries 32-way
	cpu0: L2 STLB 8 4MB entries 4-way

  Need some rework for struct x86_cache_info.
- Use aprint_error_dev() for error output.
2018-03-05 05:50:37 +00:00
mrg 8ea873287d implement cpuctl identify for sparc and sparc64.
sparc:
- move enum vactype and struct cacheinfo into cpu.h
- move the cache flags from cpuinfo.flags into CACHEINFO.c_flags
  (this allows the new cache_printf_backend() to see them.)
  remove unused CPUFLG_CACHEIOMMUTABLES and CPUFLG_CACHEDVMA.
- align xmpsg to 64 bytes
- move cache_print() into cache_print.h so it can be shared with
  cpuctl.  it only depends upon a working printf().
- if found, store the CPU node's "name" into cpu_longname.  this
  changes the default output to show the local CPU not the
  generic CPU family.  eg:
  cpu0 at mainbus0: mid 8: Ross,RT625 @ 90 MHz, on-chip FPU
  vs the generic "RT620/625" previously shown.
- for each CPU export these things:
  - name
  - fpuname
  - mid
  - cloc
  - freq
  - psr impl and version
  - mmu impl, version, and number of contexts
  - cacheinfo structure (which changed for the first time ever
    with this commit.)

sparc64:
- add a minimal "cacheinfo" structure to export the i/d/e-cache
  size and linesize.
- store %ver, cpu node "name" and cacheinfo in cpu_info.
- set cpu_info ver, name and cacheinfo in cpu_attach(), and
  export them via sysctl, as well as CPU ID and clock freq

cpuctl:
- add identifycpu_bind() that returns false on !x86 as their
  identify routines do not need to run on a particular CPU to
  obtain its information, and use it to avoid trying to set
  affinity when not needed.
- add sparc and sparc64 cpu identify support using the newly
  exported values.
2018-01-16 08:23:17 +00:00
msaitoh 5bd8e5c45d Print Intel cpuid 7 %edx.
Example output of cpuctl -v identify 0:

+cpu0: 00000007: 00000000 000027ab 00000000 0c000000
(snip)
+cpu0: SEF edx 0xc000000<IBRS,STIBP>
2018-01-10 07:08:35 +00:00
msaitoh 4a84e4a57f Update from Intel SDM:
0x55: Xeon Scalable (Skylake)
 0x57: Xeon Phi [357]200 (Knights Landing)
 0x66: Future Core (Cannon Lake)
 0x85: Future Xeon Phi (Knights Mill)
2017-10-19 03:09:55 +00:00