History log of /netbsd-current/sys/arch/x86/x86/procfs_machdep.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.48 07-Aug-2023 msaitoh

Update /proc/cpuinfo.

- Move "ssbd" to an unused Linux mapping.
- Update unused Linux mappings.


# 1.47 11-Apr-2023 msaitoh

Add Intel lam and AMD vnmi.


# 1.46 30-Dec-2022 msaitoh

Add x2avic. Modify comment.


Revision tags: netbsd-10-base bouyer-sunxi-drm-base
# 1.45 20-Jun-2022 msaitoh

branches: 1.45.4;
Add tdx_guest, brs, hfi, ibt, amx_bf16, amx_tile and amx_int8.


# 1.44 31-Jan-2022 msaitoh

Fix procfs_machdep.c rev. 1.143. Print CPUID 0x00000007:1 %eax correctly.


# 1.43 14-Jan-2022 msaitoh

Update for cpuid flags:

- The table 11 was changed from CPUID 0x0f leaf 0 %edx to a Linux mapping.
- The table 12 was changed from CPUID 0x0f leaf 1 %edx to CPUID 0x07 leaf 1
%edx. Print avx_vnni and avx512_bf16.
- Print cppc, enqcmd and arch_lbr.
- Modify linux mapping. No used on NetBSD.


# 1.42 07-Oct-2021 msaitoh

KNF. No functional change.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.41 10-Jul-2021 msaitoh

Add v_spec_ctrl, avx512_fp16, sme, sev and sev_es. Tested by nonaka@.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.40 30-Nov-2020 msaitoh

branches: 1.40.4;
Add sgx, sgx_lc, serialize and tsxldtrk.


# 1.39 25-Apr-2020 bouyer

branches: 1.39.2;
Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor


Revision tags: bouyer-xenpvh-base2
# 1.38 24-Apr-2020 msaitoh

Lowercase ppin.


# 1.37 24-Apr-2020 msaitoh

Add AMD protected processor identification number (PPIN).


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.36 01-Apr-2020 msaitoh

branches: 1.36.2;
Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: is-mlppp-base ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.47 11-Apr-2023 msaitoh

Add Intel lam and AMD vnmi.


# 1.46 30-Dec-2022 msaitoh

Add x2avic. Modify comment.


Revision tags: netbsd-10-base bouyer-sunxi-drm-base
# 1.45 20-Jun-2022 msaitoh

branches: 1.45.4;
Add tdx_guest, brs, hfi, ibt, amx_bf16, amx_tile and amx_int8.


# 1.44 31-Jan-2022 msaitoh

Fix procfs_machdep.c rev. 1.143. Print CPUID 0x00000007:1 %eax correctly.


# 1.43 14-Jan-2022 msaitoh

Update for cpuid flags:

- The table 11 was changed from CPUID 0x0f leaf 0 %edx to a Linux mapping.
- The table 12 was changed from CPUID 0x0f leaf 1 %edx to CPUID 0x07 leaf 1
%edx. Print avx_vnni and avx512_bf16.
- Print cppc, enqcmd and arch_lbr.
- Modify linux mapping. No used on NetBSD.


# 1.42 07-Oct-2021 msaitoh

KNF. No functional change.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.41 10-Jul-2021 msaitoh

Add v_spec_ctrl, avx512_fp16, sme, sev and sev_es. Tested by nonaka@.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.40 30-Nov-2020 msaitoh

branches: 1.40.4;
Add sgx, sgx_lc, serialize and tsxldtrk.


# 1.39 25-Apr-2020 bouyer

branches: 1.39.2;
Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor


Revision tags: bouyer-xenpvh-base2
# 1.38 24-Apr-2020 msaitoh

Lowercase ppin.


# 1.37 24-Apr-2020 msaitoh

Add AMD protected processor identification number (PPIN).


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.36 01-Apr-2020 msaitoh

branches: 1.36.2;
Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: is-mlppp-base ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.46 30-Dec-2022 msaitoh

Add x2avic. Modify comment.


Revision tags: netbsd-10-base bouyer-sunxi-drm-base
# 1.45 20-Jun-2022 msaitoh

Add tdx_guest, brs, hfi, ibt, amx_bf16, amx_tile and amx_int8.


# 1.44 31-Jan-2022 msaitoh

Fix procfs_machdep.c rev. 1.143. Print CPUID 0x00000007:1 %eax correctly.


# 1.43 14-Jan-2022 msaitoh

Update for cpuid flags:

- The table 11 was changed from CPUID 0x0f leaf 0 %edx to a Linux mapping.
- The table 12 was changed from CPUID 0x0f leaf 1 %edx to CPUID 0x07 leaf 1
%edx. Print avx_vnni and avx512_bf16.
- Print cppc, enqcmd and arch_lbr.
- Modify linux mapping. No used on NetBSD.


# 1.42 07-Oct-2021 msaitoh

KNF. No functional change.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.41 10-Jul-2021 msaitoh

Add v_spec_ctrl, avx512_fp16, sme, sev and sev_es. Tested by nonaka@.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.40 30-Nov-2020 msaitoh

branches: 1.40.4;
Add sgx, sgx_lc, serialize and tsxldtrk.


# 1.39 25-Apr-2020 bouyer

branches: 1.39.2;
Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor


Revision tags: bouyer-xenpvh-base2
# 1.38 24-Apr-2020 msaitoh

Lowercase ppin.


# 1.37 24-Apr-2020 msaitoh

Add AMD protected processor identification number (PPIN).


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.36 01-Apr-2020 msaitoh

branches: 1.36.2;
Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: is-mlppp-base ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.45 20-Jun-2022 msaitoh

Add tdx_guest, brs, hfi, ibt, amx_bf16, amx_tile and amx_int8.


# 1.44 31-Jan-2022 msaitoh

Fix procfs_machdep.c rev. 1.143. Print CPUID 0x00000007:1 %eax correctly.


# 1.43 14-Jan-2022 msaitoh

Update for cpuid flags:

- The table 11 was changed from CPUID 0x0f leaf 0 %edx to a Linux mapping.
- The table 12 was changed from CPUID 0x0f leaf 1 %edx to CPUID 0x07 leaf 1
%edx. Print avx_vnni and avx512_bf16.
- Print cppc, enqcmd and arch_lbr.
- Modify linux mapping. No used on NetBSD.


# 1.42 07-Oct-2021 msaitoh

KNF. No functional change.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.41 10-Jul-2021 msaitoh

Add v_spec_ctrl, avx512_fp16, sme, sev and sev_es. Tested by nonaka@.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.40 30-Nov-2020 msaitoh

branches: 1.40.4;
Add sgx, sgx_lc, serialize and tsxldtrk.


# 1.39 25-Apr-2020 bouyer

branches: 1.39.2;
Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor


Revision tags: bouyer-xenpvh-base2
# 1.38 24-Apr-2020 msaitoh

Lowercase ppin.


# 1.37 24-Apr-2020 msaitoh

Add AMD protected processor identification number (PPIN).


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.36 01-Apr-2020 msaitoh

branches: 1.36.2;
Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: is-mlppp-base ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.44 31-Jan-2022 msaitoh

Fix procfs_machdep.c rev. 1.143. Print CPUID 0x00000007:1 %eax correctly.


# 1.43 14-Jan-2022 msaitoh

Update for cpuid flags:

- The table 11 was changed from CPUID 0x0f leaf 0 %edx to a Linux mapping.
- The table 12 was changed from CPUID 0x0f leaf 1 %edx to CPUID 0x07 leaf 1
%edx. Print avx_vnni and avx512_bf16.
- Print cppc, enqcmd and arch_lbr.
- Modify linux mapping. No used on NetBSD.


# 1.42 07-Oct-2021 msaitoh

KNF. No functional change.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.41 10-Jul-2021 msaitoh

Add v_spec_ctrl, avx512_fp16, sme, sev and sev_es. Tested by nonaka@.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.40 30-Nov-2020 msaitoh

branches: 1.40.4;
Add sgx, sgx_lc, serialize and tsxldtrk.


# 1.39 25-Apr-2020 bouyer

branches: 1.39.2;
Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor


Revision tags: bouyer-xenpvh-base2
# 1.38 24-Apr-2020 msaitoh

Lowercase ppin.


# 1.37 24-Apr-2020 msaitoh

Add AMD protected processor identification number (PPIN).


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.36 01-Apr-2020 msaitoh

branches: 1.36.2;
Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: is-mlppp-base ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.43 14-Jan-2022 msaitoh

Update for cpuid flags:

- The table 11 was changed from CPUID 0x0f leaf 0 %edx to a Linux mapping.
- The table 12 was changed from CPUID 0x0f leaf 1 %edx to CPUID 0x07 leaf 1
%edx. Print avx_vnni and avx512_bf16.
- Print cppc, enqcmd and arch_lbr.
- Modify linux mapping. No used on NetBSD.


# 1.42 07-Oct-2021 msaitoh

KNF. No functional change.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.41 10-Jul-2021 msaitoh

Add v_spec_ctrl, avx512_fp16, sme, sev and sev_es. Tested by nonaka@.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.40 30-Nov-2020 msaitoh

branches: 1.40.4;
Add sgx, sgx_lc, serialize and tsxldtrk.


# 1.39 25-Apr-2020 bouyer

branches: 1.39.2;
Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor


Revision tags: bouyer-xenpvh-base2
# 1.38 24-Apr-2020 msaitoh

Lowercase ppin.


# 1.37 24-Apr-2020 msaitoh

Add AMD protected processor identification number (PPIN).


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.36 01-Apr-2020 msaitoh

branches: 1.36.2;
Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: is-mlppp-base ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.42 07-Oct-2021 msaitoh

KNF. No functional change.


Revision tags: thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base thorpej-i2c-spi-conf-base
# 1.41 10-Jul-2021 msaitoh

Add v_spec_ctrl, avx512_fp16, sme, sev and sev_es. Tested by nonaka@.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-cfargs-base thorpej-futex-base
# 1.40 30-Nov-2020 msaitoh

branches: 1.40.4;
Add sgx, sgx_lc, serialize and tsxldtrk.


# 1.39 25-Apr-2020 bouyer

branches: 1.39.2;
Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor


Revision tags: bouyer-xenpvh-base2
# 1.38 24-Apr-2020 msaitoh

Lowercase ppin.


# 1.37 24-Apr-2020 msaitoh

Add AMD protected processor identification number (PPIN).


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.36 01-Apr-2020 msaitoh

branches: 1.36.2;
Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: is-mlppp-base ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.41 10-Jul-2021 msaitoh

Add v_spec_ctrl, avx512_fp16, sme, sev and sev_es. Tested by nonaka@.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.40 30-Nov-2020 msaitoh

Add sgx, sgx_lc, serialize and tsxldtrk.


# 1.39 25-Apr-2020 bouyer

branches: 1.39.2;
Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor


Revision tags: bouyer-xenpvh-base2
# 1.38 24-Apr-2020 msaitoh

Lowercase ppin.


# 1.37 24-Apr-2020 msaitoh

Add AMD protected processor identification number (PPIN).


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.36 01-Apr-2020 msaitoh

branches: 1.36.2;
Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: is-mlppp-base ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.40 30-Nov-2020 msaitoh

Add sgx, sgx_lc, serialize and tsxldtrk.


Revision tags: thorpej-futex-base
# 1.39 25-Apr-2020 bouyer

Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor


Revision tags: bouyer-xenpvh-base2
# 1.38 24-Apr-2020 msaitoh

Lowercase ppin.


# 1.37 24-Apr-2020 msaitoh

Add AMD protected processor identification number (PPIN).


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.36 01-Apr-2020 msaitoh

branches: 1.36.2;
Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: is-mlppp-base ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.39 25-Apr-2020 bouyer

Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
guests in GENERIC.
Xen support can be disabled at runtime with
boot -c
disable hypervisor


Revision tags: bouyer-xenpvh-base2
# 1.38 24-Apr-2020 msaitoh

Lowercase ppin.


# 1.37 24-Apr-2020 msaitoh

Add AMD protected processor identification number (PPIN).


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.36 01-Apr-2020 msaitoh

branches: 1.36.2;
Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: is-mlppp-base ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.38 24-Apr-2020 msaitoh

Lowercase ppin.


# 1.37 24-Apr-2020 msaitoh

Add AMD protected processor identification number (PPIN).


Revision tags: phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base phil-wifi-20200406
# 1.36 01-Apr-2020 msaitoh

Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: is-mlppp-base ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.36 01-Apr-2020 msaitoh

Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)


Revision tags: ad-namecache-base3 ad-namecache-base2 ad-namecache-base1
# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

branches: 1.34.2;
Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.35 17-Jan-2020 msaitoh

Add Fast Short Rep Mov(fsrm).


Revision tags: ad-namecache-base phil-wifi-20191119
# 1.34 17-Oct-2019 msaitoh

Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

branches: 1.33.2;
Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.34 17-Oct-2019 msaitoh

Add rdpru.


Revision tags: netbsd-9-base
# 1.33 24-Jul-2019 msaitoh

Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.33 24-Jul-2019 msaitoh

Add avx512ifma, cqm_mbm_total, cqm_mbm_local and waitpkg


Revision tags: phil-wifi-20190609
# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

branches: 1.23.2;
Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.32 28-May-2019 kamil

Avoid the 1<<31 construct

Shift unsigned int rather than signed one.

Detected with kUBSan when reading /proc/cpuinfo.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.31 16-May-2019 msaitoh

Revert rev. 1.29. Use current cpuid 7 edx value to print.


# 1.30 16-May-2019 msaitoh

Add md_clear.


# 1.29 16-May-2019 msaitoh

Use ci_feat_val[7] instead of directly getting cpuid 7 edx.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


Revision tags: isaki-audio2-base
# 1.28 18-Feb-2019 msaitoh

- Add wbnoinvd, virt_ssbd, tme, cldemote, movdiri, movdir64b and pconfig.
- Move AMD 0x80000008 ebx's ibpb, ibrs and stibp to x86_features[8] linux
mapping.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118
# 1.27 06-Jan-2019 christos

restore original now that weak symbols are gone


# 1.26 05-Jan-2019 christos

Comment out rcr0 use until the weak symbol mess is undone.


Revision tags: pgoyette-compat-1226 pgoyette-compat-1126
# 1.25 15-Nov-2018 msaitoh

- I misread ci_acpiid as ci_apicid... LAPIC ID is in ci_cpuid.
Print it correctly.
- ci_initapicid(Initial APIC ID) is uint32_t, so use %u.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.24 20-Aug-2018 msaitoh

OK'd by maxv:
- Add cpuid 7 edx L1D_FLUSH bit.
- Add IA32_ARCH_SKIP_L1DFL_VMENTRY bit.
- Add IA32_FLUSH_CMD MSR.


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.23 23-May-2018 msaitoh

Add SSBD bit for Intel.


Revision tags: pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.22 05-Mar-2018 msaitoh

branches: 1.22.2;
- Add AMD CPUID leaf 0x80000008 ebx's xsaveerptr, ibpb, ibrs, stibp.
- Add Intel CPUID leaf 7 ebx's umip, avx512_vbmi2, gfni, vaes, vpclmulqdq,
avx512_vnni and avx512_bitalg.
- Add Intel CPUID leaf 7 edx's avx512_4vnniw, avx512_4fmaps and
arch_capabilities.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.21 10-Jan-2018 msaitoh

Print intel_pt in /proc/cpuinfo.


Revision tags: tls-maxphys-base-20171202
# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.20 10-Oct-2017 msaitoh

Fix the location of AMD's smca(Scalable MCA) bit. Thanks Yasushi Oshima for
finding this bug.


# 1.19 09-Oct-2017 maya

GC i386_fpu_present. no FPU x86 is not supported.

Also delete newly unused send_sigill


# 1.18 05-Oct-2017 msaitoh

- Use per cpu ci->ci_max_cupid instead of global "cpuid_level" variable.
- Print AMD specific cpuid leafs:
0x80000008 ebx
0x8000000a edx
0x80000007 ebx


# 1.17 28-Sep-2017 msaitoh

Print the following cpuid bits:

0x0000000d:1 eax (xsaveopt, xsavec, xgetbv1, xsaves)
0x0000000f:0 edx (cqm_llc)
0x0000000f:1 edx (cqm_occup_llc)
0x00000006 eax (dtherm, ida, arat, pln, pts, hwp, hwp_notify,
hwp_act_window, hwp_epp, hwp_pkg_req)


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

branches: 1.15.2;
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.16 28-Aug-2017 msaitoh

Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.15 15-May-2017 msaitoh

- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

branches: 1.14.6;
- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.15 15-May-2017 msaitoh

- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.


Revision tags: prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.14 08-Dec-2016 msaitoh

- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

branches: 1.12.2;
Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.


# 1.14 08-Dec-2016 msaitoh

- Remove "pcommit".
- Add "rdt_a".


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914
# 1.13 08-Aug-2016 msaitoh

- Update VIA/Cyrix/Centaur-defined bits. Part of PR#39950
- Fix comment. x86_features[4] is not 0x80000001 but 0x00000001
- Update comment


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529
# 1.12 27-Apr-2016 msaitoh

Take some changes from the Linux's latest x86/include/asm/cpufeatures.h.
- Add ptsc, avx512dq, avx512bw and avx512vl
- Remove some Linux mappings.


Revision tags: nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.11 12-Feb-2016 msaitoh

Fix typo in comment.


# 1.10 18-Jan-2016 msaitoh

Add comments. Fix comments. No functional change.


# 1.9 13-Jan-2016 msaitoh

Use CPUID_TO_*() macros. This change fix a bug that /proc/cpuinfo's CPU model
was incorrect on many newer CPUs and CPU family was incorrect on some AMD
machines.


# 1.8 13-Jan-2016 msaitoh

PR#49246 "x86/x86/procfs_machdep.c (/proc/cpuinfo) is very old" related change
- Decode NetBSD's ci_feat_val[0-5]. The output order of the bits is the same as
linux. Before this commit, only ci_feat_val[0] was decoded.
- Linux defined feature words and some others are not decoded yet.
- procfs_getonecpufeatures() will be rewritten when all of linux entries are
decoded.


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606
# 1.7 16-Apr-2015 njoly

Always output 2 digits for the cpu frequency decimal part.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.6 05-Apr-2014 christos

branches: 1.6.4; 1.6.6;
make this compute the needed size instead of bailing.


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
# 1.5 27-Mar-2014 christos

correct/add protection against snprintf overflow.


# 1.4 24-Mar-2014 christos

use cpu_{g,s}etmodel


Revision tags: riastradh-drm2-base3
# 1.3 12-Feb-2014 dsl

Change i386 to use x86/fpu.c instead of i386/isa/npx.c
This changes the trap10 and trap13 code to call directly into fpu.c,
removing all the code for T_ARITHTRAP, T_XMM and T_FPUNDA from i386/trap.c
Not all of the code thate appeared to handle fpu traps was ever called!
Most of the changes just replace the include of machine/npx.h with x86/fpu.h
(or remove it entirely).


# 1.2 02-Feb-2014 dsl

Minor fpu initialisation cleanups:
Set default CR) so that the FPU is enabled (unset CR0_EM) and initialise
i386_fpu_present to 1.
No need to call the npx trap indirectly, rename to fpunda() to match amd64.
Remove the i386_fpu_exception variable and sysctl (It used to indicate
which irq was used for fpu exceptions, but we only support 'internal'
now). Hopefully no one cares.
fpuinit() now only needs to clear TS before the fninit(). Apart from the
checks for 486SX and the 'fdiv bug' this matches the amd64 version.
Exclude fpuinit() from XEN kernels, they don't call it - which rather begs
the question as to whether it is needed at all!


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 jym-xensuspend-base jym-xensuspend-nbase uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.1 08-Jul-2010 rmind

branches: 1.1.2; 1.1.4; 1.1.6; 1.1.12; 1.1.16; 1.1.26; 1.1.30;
Unify i386 and amd64 procfs MD code into x86.