Tue Apr 30 19:35:29 2024 UTC (19d)
viac7temp(4): rewrite temperature sensor to read value from MSR instead of using
documented cpuid instruction and eax register.

This approach is adapted from linux via-cputemp.c, no official documentation is
currently available. However, msr value seems to work on all tested CPUs while
documented cpuid instruction typically reports 0, even for my C7-D CPU.
msr value seems to have temperature in Celsius in lower 24-bits without fraction
(thus "msr & 0xffffff;" is used).

Tested on my personal systems based on CPUs below (i386 and amd64):
C7-D 1.6GHz (i386 only), Nano X2 L4350E, Nano X2 U4300, U2300 Nano, KX-U6580.
Also got one response via email which was based on Nano X2 L4050 (VE-900).
Nano reports independent values for each core.
KX-U6580 seems to show the same value for all cores but more testing is needed.

Since it works on amd64 capable CPUs, adding driver to GENERIC kernel config.
Also moving viac7temp man page to x86 instead of i386 (with updates).
In theory the change should add support for all VIA Nano CPUs and Zhaoxin CPUs
 at least up to KX-6000(G) series.

In the future I may need to introduce amd64 kernel module as well.

Plan to pullup to at least netbsd-10.

Patch mainly reviewed by riastradh.


(andvar)
diff -r1.1772 -r1.1773 src/distrib/sets/lists/man/mi
diff -r1.1 -r1.2 src/distrib/sets/lists/manhtml/mi
diff -r1.80 -r1.81 src/share/man/man4/man4.i386/Makefile
diff -r1.3 -r0 src/share/man/man4/man4.i386/viac7temp.4
diff -r1.23 -r1.24 src/share/man/man4/man4.x86/Makefile
diff -r0 -r1.1 src/share/man/man4/man4.x86/viac7temp.4
diff -r1.187 -r1.188 src/sys/arch/amd64/conf/ALL
diff -r1.611 -r1.612 src/sys/arch/amd64/conf/GENERIC
diff -r1.518 -r1.519 src/sys/arch/i386/conf/ALL
diff -r1.1255 -r1.1256 src/sys/arch/i386/conf/GENERIC
diff -r1.10 -r1.11 src/sys/arch/x86/x86/viac7temp.c
Wed May 1 04:35:29 2024
Sat Dec 17 02:39:19 2022
src/share/man/man4/man4.i386/viac7temp.4,v

anoncvs not yet been updated

cvs diff -r1.1772 -r1.1773 src/distrib/sets/lists/man/mi (expand / switch to unified diff)

--- src/distrib/sets/lists/man/mi 2024/04/09 15:17:24 1.1772
+++ src/distrib/sets/lists/man/mi 2024/04/30 19:35:28 1.1773
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: mi,v 1.1772 2024/04/09 15:17:24 nia Exp $ 1# $NetBSD: mi,v 1.1773 2024/04/30 19:35:28 andvar Exp $
2# 2#
3# Note: don't delete entries from here - mark them as "obsolete" instead. 3# Note: don't delete entries from here - mark them as "obsolete" instead.
4# 4#
5./etc/mtree/set.man man-sys-root 5./etc/mtree/set.man man-sys-root
6./usr/share/info/am-utils.info man-amd-info info 6./usr/share/info/am-utils.info man-amd-info info
7./usr/share/info/as.info man-computil-info binutils,info 7./usr/share/info/as.info man-computil-info binutils,info
8./usr/share/info/awk.info man-util-info info 8./usr/share/info/awk.info man-util-info info
9./usr/share/info/bfd.info man-computil-info binutils,info 9./usr/share/info/bfd.info man-computil-info binutils,info
10./usr/share/info/binutils.info man-computil-info binutils,info 10./usr/share/info/binutils.info man-computil-info binutils,info
11./usr/share/info/bzip2.info man-obsolete obsolete 11./usr/share/info/bzip2.info man-obsolete obsolete
12./usr/share/info/cpp.info man-util-info gcccmds,info 12./usr/share/info/cpp.info man-util-info gcccmds,info
13./usr/share/info/cvs.info man-cvs-info cvs,info 13./usr/share/info/cvs.info man-cvs-info cvs,info
14./usr/share/info/cvsclient.info man-cvs-info cvs,info 14./usr/share/info/cvsclient.info man-cvs-info cvs,info
@@ -1330,27 +1330,27 @@ @@ -1330,27 +1330,27 @@
1330./usr/share/man/cat4/i386/opms.0 man-obsolete obsolete 1330./usr/share/man/cat4/i386/opms.0 man-obsolete obsolete
1331./usr/share/man/cat4/i386/pcibios.0 man-sys-catman .cat 1331./usr/share/man/cat4/i386/pcibios.0 man-sys-catman .cat
1332./usr/share/man/cat4/i386/pcmb.0 man-sys-catman .cat 1332./usr/share/man/cat4/i386/pcmb.0 man-sys-catman .cat
1333./usr/share/man/cat4/i386/pcvt.0 man-obsolete obsolete 1333./usr/share/man/cat4/i386/pcvt.0 man-obsolete obsolete
1334./usr/share/man/cat4/i386/pms.0 man-obsolete obsolete 1334./usr/share/man/cat4/i386/pms.0 man-obsolete obsolete
1335./usr/share/man/cat4/i386/pnpbios.0 man-sys-catman .cat 1335./usr/share/man/cat4/i386/pnpbios.0 man-sys-catman .cat
1336./usr/share/man/cat4/i386/rdcide.0 man-sys-catman .cat 1336./usr/share/man/cat4/i386/rdcide.0 man-sys-catman .cat
1337./usr/share/man/cat4/i386/rdcpcib.0 man-sys-catman .cat 1337./usr/share/man/cat4/i386/rdcpcib.0 man-sys-catman .cat
1338./usr/share/man/cat4/i386/sony.0 man-obsolete obsolete 1338./usr/share/man/cat4/i386/sony.0 man-obsolete obsolete
1339./usr/share/man/cat4/i386/speaker.0 man-obsolete obsolete 1339./usr/share/man/cat4/i386/speaker.0 man-obsolete obsolete
1340./usr/share/man/cat4/i386/spic.0 man-sys-catman .cat 1340./usr/share/man/cat4/i386/spic.0 man-sys-catman .cat
1341./usr/share/man/cat4/i386/vald.0 man-obsolete obsolete 1341./usr/share/man/cat4/i386/vald.0 man-obsolete obsolete
1342./usr/share/man/cat4/i386/vesafb.0 man-obsolete obsolete 1342./usr/share/man/cat4/i386/vesafb.0 man-obsolete obsolete
1343./usr/share/man/cat4/i386/viac7temp.0 man-sys-catman .cat 1343./usr/share/man/cat4/i386/viac7temp.0 man-obsolete obsolete
1344./usr/share/man/cat4/i4b.0 man-obsolete obsolete 1344./usr/share/man/cat4/i4b.0 man-obsolete obsolete
1345./usr/share/man/cat4/i4bctl.0 man-obsolete obsolete 1345./usr/share/man/cat4/i4bctl.0 man-obsolete obsolete
1346./usr/share/man/cat4/i4bipr.0 man-obsolete obsolete 1346./usr/share/man/cat4/i4bipr.0 man-obsolete obsolete
1347./usr/share/man/cat4/i4bisp.0 man-obsolete obsolete 1347./usr/share/man/cat4/i4bisp.0 man-obsolete obsolete
1348./usr/share/man/cat4/i4bisppp.0 man-obsolete obsolete 1348./usr/share/man/cat4/i4bisppp.0 man-obsolete obsolete
1349./usr/share/man/cat4/i4brbch.0 man-obsolete obsolete 1349./usr/share/man/cat4/i4brbch.0 man-obsolete obsolete
1350./usr/share/man/cat4/i4btel.0 man-obsolete obsolete 1350./usr/share/man/cat4/i4btel.0 man-obsolete obsolete
1351./usr/share/man/cat4/i4btrc.0 man-obsolete obsolete 1351./usr/share/man/cat4/i4btrc.0 man-obsolete obsolete
1352./usr/share/man/cat4/i915drm.0 man-sys-catman .cat 1352./usr/share/man/cat4/i915drm.0 man-sys-catman .cat
1353./usr/share/man/cat4/iavc.0 man-obsolete obsolete 1353./usr/share/man/cat4/iavc.0 man-obsolete obsolete
1354./usr/share/man/cat4/iavf.0 man-sys-catman .cat 1354./usr/share/man/cat4/iavf.0 man-sys-catman .cat
1355./usr/share/man/cat4/ibmcd.0 man-sys-catman .cat 1355./usr/share/man/cat4/ibmcd.0 man-sys-catman .cat
1356./usr/share/man/cat4/ibmhawk.0 man-sys-catman .cat 1356./usr/share/man/cat4/ibmhawk.0 man-sys-catman .cat
@@ -2148,26 +2148,27 @@ @@ -2148,26 +2148,27 @@
2148./usr/share/man/cat4/x86/imcsmb.0 man-sys-catman .cat 2148./usr/share/man/cat4/x86/imcsmb.0 man-sys-catman .cat
2149./usr/share/man/cat4/x86/ioapic.0 man-sys-catman .cat 2149./usr/share/man/cat4/x86/ioapic.0 man-sys-catman .cat
2150./usr/share/man/cat4/x86/kmem.0 man-sys-catman .cat 2150./usr/share/man/cat4/x86/kmem.0 man-sys-catman .cat
2151./usr/share/man/cat4/x86/lapic.0 man-sys-catman .cat 2151./usr/share/man/cat4/x86/lapic.0 man-sys-catman .cat
2152./usr/share/man/cat4/x86/lpa.0 man-sys-catman .cat 2152./usr/share/man/cat4/x86/lpa.0 man-sys-catman .cat
2153./usr/share/man/cat4/x86/lpt.0 man-sys-catman .cat 2153./usr/share/man/cat4/x86/lpt.0 man-sys-catman .cat
2154./usr/share/man/cat4/x86/mem.0 man-sys-catman .cat 2154./usr/share/man/cat4/x86/mem.0 man-sys-catman .cat
2155./usr/share/man/cat4/x86/odcm.0 man-sys-catman .cat 2155./usr/share/man/cat4/x86/odcm.0 man-sys-catman .cat
2156./usr/share/man/cat4/x86/powernow.0 man-sys-catman .cat 2156./usr/share/man/cat4/x86/powernow.0 man-sys-catman .cat
2157./usr/share/man/cat4/x86/soekrisgpio.0 man-sys-catman .cat 2157./usr/share/man/cat4/x86/soekrisgpio.0 man-sys-catman .cat
2158./usr/share/man/cat4/x86/tco.0 man-sys-catman .cat 2158./usr/share/man/cat4/x86/tco.0 man-sys-catman .cat
2159./usr/share/man/cat4/x86/tprof_amdpmi.0 man-obsolete obsolete 2159./usr/share/man/cat4/x86/tprof_amdpmi.0 man-obsolete obsolete
2160./usr/share/man/cat4/x86/tprof_pmi.0 man-obsolete obsolete 2160./usr/share/man/cat4/x86/tprof_pmi.0 man-obsolete obsolete
 2161./usr/share/man/cat4/x86/viac7temp.0 man-sys-catman .cat
2161./usr/share/man/cat4/x86/vmt.0 man-obsolete obsolete 2162./usr/share/man/cat4/x86/vmt.0 man-obsolete obsolete
2162./usr/share/man/cat4/x86/vmx.0 man-obsolete obsolete 2163./usr/share/man/cat4/x86/vmx.0 man-obsolete obsolete
2163./usr/share/man/cat4/xbd.0 man-sys-catman .cat 2164./usr/share/man/cat4/xbd.0 man-sys-catman .cat
2164./usr/share/man/cat4/xbdback.0 man-sys-catman .cat 2165./usr/share/man/cat4/xbdback.0 man-sys-catman .cat
2165./usr/share/man/cat4/xbox.0 man-sys-catman .cat 2166./usr/share/man/cat4/xbox.0 man-sys-catman .cat
2166./usr/share/man/cat4/xc3028.0 man-sys-catman .cat 2167./usr/share/man/cat4/xc3028.0 man-sys-catman .cat
2167./usr/share/man/cat4/xc5k.0 man-sys-catman .cat 2168./usr/share/man/cat4/xc5k.0 man-sys-catman .cat
2168./usr/share/man/cat4/xenbus.0 man-sys-catman .cat 2169./usr/share/man/cat4/xenbus.0 man-sys-catman .cat
2169./usr/share/man/cat4/xennet.0 man-sys-catman .cat 2170./usr/share/man/cat4/xennet.0 man-sys-catman .cat
2170./usr/share/man/cat4/xge.0 man-sys-catman .cat 2171./usr/share/man/cat4/xge.0 man-sys-catman .cat
2171./usr/share/man/cat4/xhci.0 man-sys-catman .cat 2172./usr/share/man/cat4/xhci.0 man-sys-catman .cat
2172./usr/share/man/cat4/xi.0 man-sys-catman .cat 2173./usr/share/man/cat4/xi.0 man-sys-catman .cat
2173./usr/share/man/cat4/xirc.0 man-sys-catman .cat 2174./usr/share/man/cat4/xirc.0 man-sys-catman .cat
@@ -4825,27 +4826,27 @@ @@ -4825,27 +4826,27 @@
4825./usr/share/man/man4/i386/opms.4 man-obsolete obsolete 4826./usr/share/man/man4/i386/opms.4 man-obsolete obsolete
4826./usr/share/man/man4/i386/pcibios.4 man-sys-man .man 4827./usr/share/man/man4/i386/pcibios.4 man-sys-man .man
4827./usr/share/man/man4/i386/pcmb.4 man-sys-man .man 4828./usr/share/man/man4/i386/pcmb.4 man-sys-man .man
4828./usr/share/man/man4/i386/pcvt.4 man-obsolete obsolete 4829./usr/share/man/man4/i386/pcvt.4 man-obsolete obsolete
4829./usr/share/man/man4/i386/pms.4 man-obsolete obsolete 4830./usr/share/man/man4/i386/pms.4 man-obsolete obsolete
4830./usr/share/man/man4/i386/pnpbios.4 man-sys-man .man 4831./usr/share/man/man4/i386/pnpbios.4 man-sys-man .man
4831./usr/share/man/man4/i386/rdcide.4 man-sys-man .man 4832./usr/share/man/man4/i386/rdcide.4 man-sys-man .man
4832./usr/share/man/man4/i386/rdcpcib.4 man-sys-man .man 4833./usr/share/man/man4/i386/rdcpcib.4 man-sys-man .man
4833./usr/share/man/man4/i386/sony.4 man-obsolete obsolete 4834./usr/share/man/man4/i386/sony.4 man-obsolete obsolete
4834./usr/share/man/man4/i386/speaker.4 man-obsolete obsolete 4835./usr/share/man/man4/i386/speaker.4 man-obsolete obsolete
4835./usr/share/man/man4/i386/spic.4 man-sys-man .man 4836./usr/share/man/man4/i386/spic.4 man-sys-man .man
4836./usr/share/man/man4/i386/vald.4 man-obsolete obsolete 4837./usr/share/man/man4/i386/vald.4 man-obsolete obsolete
4837./usr/share/man/man4/i386/vesafb.4 man-obsolete obsolete 4838./usr/share/man/man4/i386/vesafb.4 man-obsolete obsolete
4838./usr/share/man/man4/i386/viac7temp.4 man-sys-man .man 4839./usr/share/man/man4/i386/viac7temp.4 man-obsolete obsolete
4839./usr/share/man/man4/i4b.4 man-obsolete obsolete 4840./usr/share/man/man4/i4b.4 man-obsolete obsolete
4840./usr/share/man/man4/i4bctl.4 man-obsolete obsolete 4841./usr/share/man/man4/i4bctl.4 man-obsolete obsolete
4841./usr/share/man/man4/i4bipr.4 man-obsolete obsolete 4842./usr/share/man/man4/i4bipr.4 man-obsolete obsolete
4842./usr/share/man/man4/i4bisp.4 man-obsolete obsolete 4843./usr/share/man/man4/i4bisp.4 man-obsolete obsolete
4843./usr/share/man/man4/i4bisppp.4 man-obsolete obsolete 4844./usr/share/man/man4/i4bisppp.4 man-obsolete obsolete
4844./usr/share/man/man4/i4brbch.4 man-obsolete obsolete 4845./usr/share/man/man4/i4brbch.4 man-obsolete obsolete
4845./usr/share/man/man4/i4btel.4 man-obsolete obsolete 4846./usr/share/man/man4/i4btel.4 man-obsolete obsolete
4846./usr/share/man/man4/i4btrc.4 man-obsolete obsolete 4847./usr/share/man/man4/i4btrc.4 man-obsolete obsolete
4847./usr/share/man/man4/i915drm.4 man-sys-man .man 4848./usr/share/man/man4/i915drm.4 man-sys-man .man
4848./usr/share/man/man4/iavc.4 man-obsolete obsolete 4849./usr/share/man/man4/iavc.4 man-obsolete obsolete
4849./usr/share/man/man4/iavf.4 man-sys-man .man 4850./usr/share/man/man4/iavf.4 man-sys-man .man
4850./usr/share/man/man4/ibmcd.4 man-sys-man .man 4851./usr/share/man/man4/ibmcd.4 man-sys-man .man
4851./usr/share/man/man4/ibmhawk.4 man-sys-man .man 4852./usr/share/man/man4/ibmhawk.4 man-sys-man .man
@@ -5643,26 +5644,27 @@ @@ -5643,26 +5644,27 @@
5643./usr/share/man/man4/x86/imcsmb.4 man-sys-man .man 5644./usr/share/man/man4/x86/imcsmb.4 man-sys-man .man
5644./usr/share/man/man4/x86/ioapic.4 man-sys-man .man 5645./usr/share/man/man4/x86/ioapic.4 man-sys-man .man
5645./usr/share/man/man4/x86/kmem.4 man-sys-man .man 5646./usr/share/man/man4/x86/kmem.4 man-sys-man .man
5646./usr/share/man/man4/x86/lapic.4 man-sys-man .man 5647./usr/share/man/man4/x86/lapic.4 man-sys-man .man
5647./usr/share/man/man4/x86/lpa.4 man-sys-man .man 5648./usr/share/man/man4/x86/lpa.4 man-sys-man .man
5648./usr/share/man/man4/x86/lpt.4 man-sys-man .man 5649./usr/share/man/man4/x86/lpt.4 man-sys-man .man
5649./usr/share/man/man4/x86/mem.4 man-sys-man .man 5650./usr/share/man/man4/x86/mem.4 man-sys-man .man
5650./usr/share/man/man4/x86/odcm.4 man-sys-man .man 5651./usr/share/man/man4/x86/odcm.4 man-sys-man .man
5651./usr/share/man/man4/x86/powernow.4 man-sys-man .man 5652./usr/share/man/man4/x86/powernow.4 man-sys-man .man
5652./usr/share/man/man4/x86/soekrisgpio.4 man-sys-man .man 5653./usr/share/man/man4/x86/soekrisgpio.4 man-sys-man .man
5653./usr/share/man/man4/x86/tco.4 man-sys-man .man 5654./usr/share/man/man4/x86/tco.4 man-sys-man .man
5654./usr/share/man/man4/x86/tprof_amdpmi.4 man-obsolete obsolete 5655./usr/share/man/man4/x86/tprof_amdpmi.4 man-obsolete obsolete
5655./usr/share/man/man4/x86/tprof_pmi.4 man-obsolete obsolete 5656./usr/share/man/man4/x86/tprof_pmi.4 man-obsolete obsolete
 5657./usr/share/man/man4/x86/viac7temp.4 man-sys-man .man
5656./usr/share/man/man4/x86/vmt.4 man-obsolete obsolete 5658./usr/share/man/man4/x86/vmt.4 man-obsolete obsolete
5657./usr/share/man/man4/x86/vmx.4 man-obsolete obsolete 5659./usr/share/man/man4/x86/vmx.4 man-obsolete obsolete
5658./usr/share/man/man4/xbd.4 man-sys-man .man 5660./usr/share/man/man4/xbd.4 man-sys-man .man
5659./usr/share/man/man4/xbdback.4 man-sys-man .man 5661./usr/share/man/man4/xbdback.4 man-sys-man .man
5660./usr/share/man/man4/xbox.4 man-sys-man .man 5662./usr/share/man/man4/xbox.4 man-sys-man .man
5661./usr/share/man/man4/xc3028.4 man-sys-man .man 5663./usr/share/man/man4/xc3028.4 man-sys-man .man
5662./usr/share/man/man4/xc5k.4 man-sys-man .man 5664./usr/share/man/man4/xc5k.4 man-sys-man .man
5663./usr/share/man/man4/xenbus.4 man-sys-man .man 5665./usr/share/man/man4/xenbus.4 man-sys-man .man
5664./usr/share/man/man4/xennet.4 man-sys-man .man 5666./usr/share/man/man4/xennet.4 man-sys-man .man
5665./usr/share/man/man4/xge.4 man-sys-man .man 5667./usr/share/man/man4/xge.4 man-sys-man .man
5666./usr/share/man/man4/xhci.4 man-sys-man .man 5668./usr/share/man/man4/xhci.4 man-sys-man .man
5667./usr/share/man/man4/xi.4 man-sys-man .man 5669./usr/share/man/man4/xi.4 man-sys-man .man
5668./usr/share/man/man4/xirc.4 man-sys-man .man 5670./usr/share/man/man4/xirc.4 man-sys-man .man

cvs diff -r1.1 -r1.2 src/distrib/sets/lists/manhtml/mi (expand / switch to unified diff)

--- src/distrib/sets/lists/manhtml/mi 2024/04/09 15:17:24 1.1
+++ src/distrib/sets/lists/manhtml/mi 2024/04/30 19:35:28 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: mi,v 1.1 2024/04/09 15:17:24 nia Exp $ 1# $NetBSD: mi,v 1.2 2024/04/30 19:35:28 andvar Exp $
2# 2#
3# Note: don't delete entries from here - mark them as "obsolete" instead. 3# Note: don't delete entries from here - mark them as "obsolete" instead.
4# 4#
5./etc/mtree/set.manhtml man-sys-root 5./etc/mtree/set.manhtml man-sys-root
6./usr/share/man/html1/Mail.html man-obsolete obsolete 6./usr/share/man/html1/Mail.html man-obsolete obsolete
7./usr/share/man/html1/[.html man-util-htmlman html 7./usr/share/man/html1/[.html man-util-htmlman html
8./usr/share/man/html1/agrep.html man-util-htmlman html 8./usr/share/man/html1/agrep.html man-util-htmlman html
9./usr/share/man/html1/aiomixer.html man-audio-htmlman html 9./usr/share/man/html1/aiomixer.html man-audio-htmlman html
10./usr/share/man/html1/alias.html man-util-htmlman html 10./usr/share/man/html1/alias.html man-util-htmlman html
11./usr/share/man/html1/altqstat.html man-router-htmlman html 11./usr/share/man/html1/altqstat.html man-router-htmlman html
12./usr/share/man/html1/apply.html man-util-htmlman html 12./usr/share/man/html1/apply.html man-util-htmlman html
13./usr/share/man/html1/apropos.html man-man-htmlman html 13./usr/share/man/html1/apropos.html man-man-htmlman html
14./usr/share/man/html1/arpaname.html man-bind-htmlman html 14./usr/share/man/html1/arpaname.html man-bind-htmlman html
@@ -1191,27 +1191,27 @@ @@ -1191,27 +1191,27 @@
1191./usr/share/man/html4/i386/lpt.html man-obsolete obsolete 1191./usr/share/man/html4/i386/lpt.html man-obsolete obsolete
1192./usr/share/man/html4/i386/mem.html man-obsolete obsolete 1192./usr/share/man/html4/i386/mem.html man-obsolete obsolete
1193./usr/share/man/html4/i386/mms.html man-sys-htmlman html 1193./usr/share/man/html4/i386/mms.html man-sys-htmlman html
1194./usr/share/man/html4/i386/ndis.html man-obsolete obsolete 1194./usr/share/man/html4/i386/ndis.html man-obsolete obsolete
1195./usr/share/man/html4/i386/npx.html man-obsolete obsolete 1195./usr/share/man/html4/i386/npx.html man-obsolete obsolete
1196./usr/share/man/html4/i386/pcibios.html man-sys-htmlman html 1196./usr/share/man/html4/i386/pcibios.html man-sys-htmlman html
1197./usr/share/man/html4/i386/pcmb.html man-sys-htmlman html 1197./usr/share/man/html4/i386/pcmb.html man-sys-htmlman html
1198./usr/share/man/html4/i386/pnpbios.html man-sys-htmlman html 1198./usr/share/man/html4/i386/pnpbios.html man-sys-htmlman html
1199./usr/share/man/html4/i386/rdcide.html man-sys-htmlman html 1199./usr/share/man/html4/i386/rdcide.html man-sys-htmlman html
1200./usr/share/man/html4/i386/rdcpcib.html man-sys-htmlman html 1200./usr/share/man/html4/i386/rdcpcib.html man-sys-htmlman html
1201./usr/share/man/html4/i386/spic.html man-sys-htmlman html 1201./usr/share/man/html4/i386/spic.html man-sys-htmlman html
1202./usr/share/man/html4/i386/vald.html man-obsolete obsolete 1202./usr/share/man/html4/i386/vald.html man-obsolete obsolete
1203./usr/share/man/html4/i386/vesafb.html man-obsolete obsolete 1203./usr/share/man/html4/i386/vesafb.html man-obsolete obsolete
1204./usr/share/man/html4/i386/viac7temp.html man-sys-htmlman html 1204./usr/share/man/html4/i386/viac7temp.html man-obsolete obsolete
1205./usr/share/man/html4/i915drm.html man-sys-htmlman html 1205./usr/share/man/html4/i915drm.html man-sys-htmlman html
1206./usr/share/man/html4/iavc.html man-obsolete obsolete 1206./usr/share/man/html4/iavc.html man-obsolete obsolete
1207./usr/share/man/html4/iavf.html man-sys-htmlman html 1207./usr/share/man/html4/iavf.html man-sys-htmlman html
1208./usr/share/man/html4/ibmcd.html man-sys-htmlman html 1208./usr/share/man/html4/ibmcd.html man-sys-htmlman html
1209./usr/share/man/html4/ibmhawk.html man-sys-htmlman html 1209./usr/share/man/html4/ibmhawk.html man-sys-htmlman html
1210./usr/share/man/html4/ichlpcib.html man-obsolete obsolete 1210./usr/share/man/html4/ichlpcib.html man-obsolete obsolete
1211./usr/share/man/html4/ichsmb.html man-sys-htmlman html 1211./usr/share/man/html4/ichsmb.html man-sys-htmlman html
1212./usr/share/man/html4/icmp.html man-sys-htmlman html 1212./usr/share/man/html4/icmp.html man-sys-htmlman html
1213./usr/share/man/html4/icmp6.html man-sys-htmlman html 1213./usr/share/man/html4/icmp6.html man-sys-htmlman html
1214./usr/share/man/html4/icp.html man-sys-htmlman html 1214./usr/share/man/html4/icp.html man-sys-htmlman html
1215./usr/share/man/html4/icpsp.html man-sys-htmlman html 1215./usr/share/man/html4/icpsp.html man-sys-htmlman html
1216./usr/share/man/html4/icsphy.html man-sys-htmlman html 1216./usr/share/man/html4/icsphy.html man-sys-htmlman html
1217./usr/share/man/html4/iee.html man-sys-htmlman html 1217./usr/share/man/html4/iee.html man-sys-htmlman html
@@ -1951,26 +1951,27 @@ @@ -1951,26 +1951,27 @@
1951./usr/share/man/html4/x86/imcsmb.html man-sys-htmlman html 1951./usr/share/man/html4/x86/imcsmb.html man-sys-htmlman html
1952./usr/share/man/html4/x86/ioapic.html man-sys-htmlman html 1952./usr/share/man/html4/x86/ioapic.html man-sys-htmlman html
1953./usr/share/man/html4/x86/kmem.html man-sys-htmlman html 1953./usr/share/man/html4/x86/kmem.html man-sys-htmlman html
1954./usr/share/man/html4/x86/lapic.html man-sys-htmlman html 1954./usr/share/man/html4/x86/lapic.html man-sys-htmlman html
1955./usr/share/man/html4/x86/lpa.html man-sys-htmlman html 1955./usr/share/man/html4/x86/lpa.html man-sys-htmlman html
1956./usr/share/man/html4/x86/lpt.html man-sys-htmlman html 1956./usr/share/man/html4/x86/lpt.html man-sys-htmlman html
1957./usr/share/man/html4/x86/mem.html man-sys-htmlman html 1957./usr/share/man/html4/x86/mem.html man-sys-htmlman html
1958./usr/share/man/html4/x86/odcm.html man-sys-htmlman html 1958./usr/share/man/html4/x86/odcm.html man-sys-htmlman html
1959./usr/share/man/html4/x86/powernow.html man-sys-htmlman html 1959./usr/share/man/html4/x86/powernow.html man-sys-htmlman html
1960./usr/share/man/html4/x86/soekrisgpio.html man-sys-htmlman html 1960./usr/share/man/html4/x86/soekrisgpio.html man-sys-htmlman html
1961./usr/share/man/html4/x86/tco.html man-sys-htmlman html 1961./usr/share/man/html4/x86/tco.html man-sys-htmlman html
1962./usr/share/man/html4/x86/tprof_amdpmi.html man-obsolete obsolete 1962./usr/share/man/html4/x86/tprof_amdpmi.html man-obsolete obsolete
1963./usr/share/man/html4/x86/tprof_pmi.html man-obsolete obsolete 1963./usr/share/man/html4/x86/tprof_pmi.html man-obsolete obsolete
 1964./usr/share/man/html4/x86/viac7temp.html man-sys-htmlman html
1964./usr/share/man/html4/x86/vmt.html man-obsolete obsolete 1965./usr/share/man/html4/x86/vmt.html man-obsolete obsolete
1965./usr/share/man/html4/x86/vmx.html man-obsolete obsolete 1966./usr/share/man/html4/x86/vmx.html man-obsolete obsolete
1966./usr/share/man/html4/xbd.html man-sys-htmlman html 1967./usr/share/man/html4/xbd.html man-sys-htmlman html
1967./usr/share/man/html4/xbdback.html man-sys-htmlman html 1968./usr/share/man/html4/xbdback.html man-sys-htmlman html
1968./usr/share/man/html4/xbox.html man-sys-htmlman html 1969./usr/share/man/html4/xbox.html man-sys-htmlman html
1969./usr/share/man/html4/xc3028.html man-sys-htmlman html 1970./usr/share/man/html4/xc3028.html man-sys-htmlman html
1970./usr/share/man/html4/xc5k.html man-sys-htmlman html 1971./usr/share/man/html4/xc5k.html man-sys-htmlman html
1971./usr/share/man/html4/xenbus.html man-sys-htmlman html 1972./usr/share/man/html4/xenbus.html man-sys-htmlman html
1972./usr/share/man/html4/xennet.html man-sys-htmlman html 1973./usr/share/man/html4/xennet.html man-sys-htmlman html
1973./usr/share/man/html4/xge.html man-sys-htmlman html 1974./usr/share/man/html4/xge.html man-sys-htmlman html
1974./usr/share/man/html4/xhci.html man-sys-htmlman html 1975./usr/share/man/html4/xhci.html man-sys-htmlman html
1975./usr/share/man/html4/xi.html man-sys-htmlman html 1976./usr/share/man/html4/xi.html man-sys-htmlman html
1976./usr/share/man/html4/xirc.html man-sys-htmlman html 1977./usr/share/man/html4/xirc.html man-sys-htmlman html

cvs diff -r1.80 -r1.81 src/share/man/man4/man4.i386/Makefile (expand / switch to unified diff)

--- src/share/man/man4/man4.i386/Makefile 2021/08/01 21:56:27 1.80
+++ src/share/man/man4/man4.i386/Makefile 2024/04/30 19:35:28 1.81
@@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
1# $NetBSD: Makefile,v 1.80 2021/08/01 21:56:27 andvar Exp $ 1# $NetBSD: Makefile,v 1.81 2024/04/30 19:35:28 andvar Exp $
2# from: @(#)Makefile 8.1 (Berkeley) 6/5/93 2# from: @(#)Makefile 8.1 (Berkeley) 6/5/93
3 3
4MAN= apm.4 \ 4MAN= apm.4 \
5 cmos.4 \ 5 cmos.4 \
6 elanpar.4 elanpex.4 elansc.4 \ 6 elanpar.4 elanpex.4 elansc.4 \
7 gcscide.4 gcscpcib.4 geodewdog.4 geodecntr.4 glxsb.4 gscpcib.4 \ 7 gcscide.4 gcscpcib.4 geodewdog.4 geodecntr.4 glxsb.4 gscpcib.4 \
8 intro.4 io.4 lms.4 mms.4 \ 8 intro.4 io.4 lms.4 mms.4 \
9 pcibios.4 pcmb.4 pnpbios.4 rdcide.4 rdcpcib.4 spic.4 viac7temp.4 9 pcibios.4 pcmb.4 pnpbios.4 rdcide.4 rdcpcib.4 spic.4
10MLINKS+=pcibios.4 PCIBIOS.4 10MLINKS+=pcibios.4 PCIBIOS.4
11MANSUBDIR=/i386 11MANSUBDIR=/i386
12 12
13.include <bsd.man.mk> 13.include <bsd.man.mk>

File Deleted: src/share/man/man4/man4.i386/viac7temp.4

cvs diff -r1.23 -r1.24 src/share/man/man4/man4.x86/Makefile (expand / switch to unified diff)

--- src/share/man/man4/man4.x86/Makefile 2021/07/25 07:35:55 1.23
+++ src/share/man/man4/man4.x86/Makefile 2024/04/30 19:35:29 1.24
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1# $NetBSD: Makefile,v 1.23 2021/07/25 07:35:55 nia Exp $ 1# $NetBSD: Makefile,v 1.24 2024/04/30 19:35:29 andvar Exp $
2 2
3MAN= amdccp.4 amdpcib.4 apic.4 autoconf.4 balloon.4 console.4 coretemp.4 \ 3MAN= amdccp.4 amdpcib.4 apic.4 autoconf.4 balloon.4 console.4 coretemp.4 \
4 est.4 fdc.4 fwhrng.4 hpet.4 ichlpcib.4 imcsmb.4 lpt.4 mem.4 odcm.4 \ 4 est.4 fdc.4 fwhrng.4 hpet.4 ichlpcib.4 imcsmb.4 lpt.4 mem.4 odcm.4 \
5 powernow.4 soekrisgpio.4 tco.4 amdsmn.4 amdzentemp.4 5 powernow.4 soekrisgpio.4 tco.4 amdsmn.4 amdzentemp.4 viac7temp.4
6 6
7MLINKS+=apic.4 ioapic.4 \ 7MLINKS+=apic.4 ioapic.4 \
8 apic.4 lapic.4 8 apic.4 lapic.4
9MLINKS+=console.4 cons.4 9MLINKS+=console.4 cons.4
10MLINKS+=lpt.4 lpa.4 10MLINKS+=lpt.4 lpa.4
11MLINKS+=mem.4 kmem.4 11MLINKS+=mem.4 kmem.4
12 12
13MANSUBDIR=/x86 13MANSUBDIR=/x86
14 14
15.include <bsd.man.mk> 15.include <bsd.man.mk>

File Added: src/share/man/man4/man4.x86/viac7temp.4
.\" $NetBSD: viac7temp.4,v 1.1 2024/04/30 19:35:29 andvar Exp $
.\"
.\" Copyright (c) 2011 Jukka Ruohonen <jruohonen@iki.fi>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Neither the name of the author nor the names of any
.\"    contributors may be used to endorse or promote products derived
.\"    from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd April 30, 2024
.Dt VIAC7TEMP 4
.Os
.Sh NAME
.Nm viac7temp
.Nd VIA C7, VIA Nano and Zhaoxin CPU temperature sensor
.Sh SYNOPSIS
.Cd "viac7temp* at cpu?"
.Sh DESCRIPTION
The
.Nm
driver supports temperature sensors found in
.Tn VIA
.Tn C7,
.Tn VIA
.Tn Nano
and 
.Tn Zhaoxin
processors.
The available information is available through the
.Xr envsys 4
.Tn API
and the
.Xr envstat 8
command.
.Sh SEE ALSO
.Xr coretemp 4
.Sh AUTHORS
.An Jared D. McNeill Aq Mt jmcneill@invisible.ca

cvs diff -r1.187 -r1.188 src/sys/arch/amd64/conf/ALL (expand / switch to unified diff)

--- src/sys/arch/amd64/conf/ALL 2024/04/02 22:30:03 1.187
+++ src/sys/arch/amd64/conf/ALL 2024/04/30 19:35:29 1.188
@@ -1,54 +1,54 @@ @@ -1,54 +1,54 @@
1# $NetBSD: ALL,v 1.187 2024/04/02 22:30:03 charlotte Exp $ 1# $NetBSD: ALL,v 1.188 2024/04/30 19:35:29 andvar Exp $
2# From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp 2# From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
3# 3#
4# ALL machine description file 4# ALL machine description file
5# 5#
6# This machine description includes all devices and options and it is 6# This machine description includes all devices and options and it is
7# used to compile-test the source and does not necessarily produce a 7# used to compile-test the source and does not necessarily produce a
8# bootable or useful kernel. 8# bootable or useful kernel.
9# 9#
10# For further information on hardware support for this architecture, see 10# For further information on hardware support for this architecture, see
11# the intro(4) man page. For further information about kernel options 11# the intro(4) man page. For further information about kernel options
12# for this architecture, see the options(4) man page. For an explanation 12# for this architecture, see the options(4) man page. For an explanation
13# of each device driver in this file see the section 4 man page for the 13# of each device driver in this file see the section 4 man page for the
14# device. 14# device.
15 15
16include "arch/amd64/conf/std.amd64" 16include "arch/amd64/conf/std.amd64"
17 17
18options INCLUDE_CONFIG_FILE # embed config file in kernel binary 18options INCLUDE_CONFIG_FILE # embed config file in kernel binary
19 19
20#ident "ALL-$Revision: 1.187 $" 20#ident "ALL-$Revision: 1.188 $"
21 21
22maxusers 64 # estimated number of users 22maxusers 64 # estimated number of users
23 23
24makeoptions USE_SSP=yes 24makeoptions USE_SSP=yes
25 25
26# CPU-related options. 26# CPU-related options.
27options USER_LDT # User-settable LDT, used by Wine 27options USER_LDT # User-settable LDT, used by Wine
28options X86EMU # 386 Real Mode emulator 28options X86EMU # 386 Real Mode emulator
29#options PAE # PAE mode (36 bits physical addressing) 29#options PAE # PAE mode (36 bits physical addressing)
30makeoptions SPECTRE_V2_GCC_MITIGATION=1 # GCC Spectre variant 2 30makeoptions SPECTRE_V2_GCC_MITIGATION=1 # GCC Spectre variant 2
31 # migitation 31 # migitation
32options PCPU_IDT # Per CPU IDT 32options PCPU_IDT # Per CPU IDT
33 33
34# CPU features 34# CPU features
35acpicpu* at cpu? # ACPI CPU (including frequency scaling) 35acpicpu* at cpu? # ACPI CPU (including frequency scaling)
36coretemp* at cpu? # Intel on-die thermal sensor 36coretemp* at cpu? # Intel on-die thermal sensor
37est0 at cpu0 # Intel Enhanced SpeedStep (non-ACPI) 37est0 at cpu0 # Intel Enhanced SpeedStep (non-ACPI)
38odcm0 at cpu0 # On-demand clock modulation 38odcm0 at cpu0 # On-demand clock modulation
39padlock0 at cpu0 # VIA PadLock 39padlock0 at cpu0 # VIA PadLock
40powernow0 at cpu0 # AMD PowerNow! and Cool'n'Quiet (non-ACPI) 40powernow0 at cpu0 # AMD PowerNow! and Cool'n'Quiet (non-ACPI)
41viac7temp* at cpu? # VIA C7 temperature sensor 41viac7temp* at cpu? # VIA C7, Nano and Zhaoxin temperature sensor
42vmt0 at cpu0 # VMware Tools 42vmt0 at cpu0 # VMware Tools
43 43
44# Beep when it is safe to power down the system (requires sysbeep) 44# Beep when it is safe to power down the system (requires sysbeep)
45options BEEP_ONHALT 45options BEEP_ONHALT
46# Some tunable details of the above feature (default values used below) 46# Some tunable details of the above feature (default values used below)
47options BEEP_ONHALT_COUNT=3 # Times to beep 47options BEEP_ONHALT_COUNT=3 # Times to beep
48options BEEP_ONHALT_PITCH=1500 # Default frequency (in Hz) 48options BEEP_ONHALT_PITCH=1500 # Default frequency (in Hz)
49options BEEP_ONHALT_PERIOD=250 # Default duration (in msecs) 49options BEEP_ONHALT_PERIOD=250 # Default duration (in msecs)
50 50
51options MULTIBOOT # Multiboot support (see multiboot(8)) 51options MULTIBOOT # Multiboot support (see multiboot(8))
52 52
53# delay between "rebooting ..." message and hardware reset, in milliseconds 53# delay between "rebooting ..." message and hardware reset, in milliseconds
54options CPURESET_DELAY=2000 54options CPURESET_DELAY=2000

cvs diff -r1.611 -r1.612 src/sys/arch/amd64/conf/GENERIC (expand / switch to unified diff)

--- src/sys/arch/amd64/conf/GENERIC 2024/04/21 14:11:12 1.611
+++ src/sys/arch/amd64/conf/GENERIC 2024/04/30 19:35:29 1.612
@@ -1,38 +1,38 @@ @@ -1,38 +1,38 @@
1# $NetBSD: GENERIC,v 1.611 2024/04/21 14:11:12 riastradh Exp $ 1# $NetBSD: GENERIC,v 1.612 2024/04/30 19:35:29 andvar Exp $
2# 2#
3# GENERIC machine description file 3# GENERIC machine description file
4# 4#
5# This machine description file is used to generate the default NetBSD 5# This machine description file is used to generate the default NetBSD
6# kernel. The generic kernel does not include all options, subsystems 6# kernel. The generic kernel does not include all options, subsystems
7# and device drivers, but should be useful for most applications. 7# and device drivers, but should be useful for most applications.
8# 8#
9# The machine description file can be customised for your specific 9# The machine description file can be customised for your specific
10# machine to reduce the kernel size and improve its performance. 10# machine to reduce the kernel size and improve its performance.
11# 11#
12# For further information on compiling NetBSD kernels, see the config(8) 12# For further information on compiling NetBSD kernels, see the config(8)
13# man page. 13# man page.
14# 14#
15# For further information on hardware support for this architecture, see 15# For further information on hardware support for this architecture, see
16# the intro(4) man page. For further information about kernel options 16# the intro(4) man page. For further information about kernel options
17# for this architecture, see the options(4) man page. For an explanation 17# for this architecture, see the options(4) man page. For an explanation
18# of each device driver in this file see the section 4 man page for the 18# of each device driver in this file see the section 4 man page for the
19# device. 19# device.
20 20
21include "arch/amd64/conf/std.amd64" 21include "arch/amd64/conf/std.amd64"
22 22
23options INCLUDE_CONFIG_FILE # embed config file in kernel binary 23options INCLUDE_CONFIG_FILE # embed config file in kernel binary
24 24
25#ident "GENERIC-$Revision: 1.611 $" 25#ident "GENERIC-$Revision: 1.612 $"
26 26
27maxusers 64 # estimated number of users 27maxusers 64 # estimated number of users
28 28
29# delay between "rebooting ..." message and hardware reset, in milliseconds 29# delay between "rebooting ..." message and hardware reset, in milliseconds
30#options CPURESET_DELAY=2000 30#options CPURESET_DELAY=2000
31 31
32# This option allows you to force a serial console at the specified 32# This option allows you to force a serial console at the specified
33# I/O address. see console(4) for details. 33# I/O address. see console(4) for details.
34#options CONSDEVNAME="\"com\"",CONADDR=0x2f8,CONSPEED=57600 34#options CONSDEVNAME="\"com\"",CONADDR=0x2f8,CONSPEED=57600
35# you don't want the option below ON iff you are using the 35# you don't want the option below ON iff you are using the
36# serial console option of the new boot strap code. 36# serial console option of the new boot strap code.
37#options CONS_OVERRIDE # Always use above! independent of boot info 37#options CONS_OVERRIDE # Always use above! independent of boot info
38 38
@@ -79,26 +79,27 @@ options SVS # Separate Virtual Space @@ -79,26 +79,27 @@ options SVS # Separate Virtual Space
79options PCPU_IDT # Per CPU IDTs 79options PCPU_IDT # Per CPU IDTs
80 80
81# GCC Spectre variant 2 mitigation 81# GCC Spectre variant 2 mitigation
82makeoptions SPECTRE_V2_GCC_MITIGATION=1 82makeoptions SPECTRE_V2_GCC_MITIGATION=1
83options SPECTRE_V2_GCC_MITIGATION 83options SPECTRE_V2_GCC_MITIGATION
84 84
85# CPU features 85# CPU features
86acpicpu* at cpu? # ACPI CPU (including frequency scaling) 86acpicpu* at cpu? # ACPI CPU (including frequency scaling)
87coretemp* at cpu? # Intel on-die thermal sensor 87coretemp* at cpu? # Intel on-die thermal sensor
88est0 at cpu0 # Intel Enhanced SpeedStep (non-ACPI) 88est0 at cpu0 # Intel Enhanced SpeedStep (non-ACPI)
89hyperv0 at cpu0 # Microsoft Hyper-V 89hyperv0 at cpu0 # Microsoft Hyper-V
90#odcm0 at cpu0 # On-demand clock modulation 90#odcm0 at cpu0 # On-demand clock modulation
91powernow0 at cpu0 # AMD PowerNow! and Cool'n'Quiet (non-ACPI) 91powernow0 at cpu0 # AMD PowerNow! and Cool'n'Quiet (non-ACPI)
 92viac7temp* at cpu? # VIA C7, Nano and Zhaoxin temperature sensor
92vmt0 at cpu0 # VMware Tools 93vmt0 at cpu0 # VMware Tools
93 94
94#Xen PV support for PVH and HVM guests 95#Xen PV support for PVH and HVM guests
95options XENPVHVM 96options XENPVHVM
96options XEN 97options XEN
97hypervisor* at mainbus? # Xen hypervisor 98hypervisor* at mainbus? # Xen hypervisor
98xenbus* at hypervisor? # Xen virtual bus 99xenbus* at hypervisor? # Xen virtual bus
99xencons* at hypervisor? # Xen virtual console 100xencons* at hypervisor? # Xen virtual console
100xennet* at xenbus? # Xen virtual network interface 101xennet* at xenbus? # Xen virtual network interface
101xbd* at xenbus? # Xen virtual block device 102xbd* at xenbus? # Xen virtual block device
102# experimental: PVH dom0 support 103# experimental: PVH dom0 support
103#options DOM0OPS 104#options DOM0OPS
104#pseudo-device xenevt 105#pseudo-device xenevt

cvs diff -r1.518 -r1.519 src/sys/arch/i386/conf/ALL (expand / switch to unified diff)

--- src/sys/arch/i386/conf/ALL 2024/04/02 22:30:03 1.518
+++ src/sys/arch/i386/conf/ALL 2024/04/30 19:35:28 1.519
@@ -1,54 +1,54 @@ @@ -1,54 +1,54 @@
1# $NetBSD: ALL,v 1.518 2024/04/02 22:30:03 charlotte Exp $ 1# $NetBSD: ALL,v 1.519 2024/04/30 19:35:28 andvar Exp $
2# From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp 2# From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
3# 3#
4# ALL machine description file 4# ALL machine description file
5# 5#
6# This machine description includes all devices and options and it is 6# This machine description includes all devices and options and it is
7# used to compile-test the source and does not necessarily produce a 7# used to compile-test the source and does not necessarily produce a
8# bootable or useful kernel. 8# bootable or useful kernel.
9# 9#
10# For further information on hardware support for this architecture, see 10# For further information on hardware support for this architecture, see
11# the intro(4) man page. For further information about kernel options 11# the intro(4) man page. For further information about kernel options
12# for this architecture, see the options(4) man page. For an explanation 12# for this architecture, see the options(4) man page. For an explanation
13# of each device driver in this file see the section 4 man page for the 13# of each device driver in this file see the section 4 man page for the
14# device. 14# device.
15 15
16include "arch/i386/conf/std.i386" 16include "arch/i386/conf/std.i386"
17 17
18options INCLUDE_CONFIG_FILE # embed config file in kernel binary 18options INCLUDE_CONFIG_FILE # embed config file in kernel binary
19 19
20#ident "ALL-$Revision: 1.518 $" 20#ident "ALL-$Revision: 1.519 $"
21 21
22maxusers 64 # estimated number of users 22maxusers 64 # estimated number of users
23 23
24makeoptions USE_SSP=yes 24makeoptions USE_SSP=yes
25 25
26# CPU-related options. 26# CPU-related options.
27options USER_LDT # user-settable LDT; used by WINE 27options USER_LDT # user-settable LDT; used by WINE
28options X86EMU # 386 Real Mode emulator 28options X86EMU # 386 Real Mode emulator
29options PAE # PAE mode (36 bits physical addressing) 29options PAE # PAE mode (36 bits physical addressing)
30makeoptions SPECTRE_V2_GCC_MITIGATION=1 # GCC Spectre variant 2 30makeoptions SPECTRE_V2_GCC_MITIGATION=1 # GCC Spectre variant 2
31 # migitation 31 # migitation
32options PCPU_IDT # Per CPU IDT 32options PCPU_IDT # Per CPU IDT
33 33
34# CPU features 34# CPU features
35acpicpu* at cpu? # ACPI CPU (including frequency scaling) 35acpicpu* at cpu? # ACPI CPU (including frequency scaling)
36coretemp* at cpu? # Intel on-die thermal sensor 36coretemp* at cpu? # Intel on-die thermal sensor
37est0 at cpu0 # Intel Enhanced SpeedStep (non-ACPI) 37est0 at cpu0 # Intel Enhanced SpeedStep (non-ACPI)
38odcm0 at cpu0 # On-demand clock modulation 38odcm0 at cpu0 # On-demand clock modulation
39padlock0 at cpu0 # VIA PadLock 39padlock0 at cpu0 # VIA PadLock
40powernow0 at cpu0 # AMD PowerNow! and Cool'n'Quiet (non-ACPI) 40powernow0 at cpu0 # AMD PowerNow! and Cool'n'Quiet (non-ACPI)
41viac7temp* at cpu? # VIA C7 temperature sensor 41viac7temp* at cpu? # VIA C7, Nano and Zhaoxin temperature sensor
42vmt0 at cpu0 # VMware Tools 42vmt0 at cpu0 # VMware Tools
43 43
44options MTRR # memory-type range register syscall support 44options MTRR # memory-type range register syscall support
45 45
46options MULTIBOOT # Multiboot support (see multiboot(8)) 46options MULTIBOOT # Multiboot support (see multiboot(8))
47 47
48# delay between "rebooting ..." message and hardware reset, in milliseconds 48# delay between "rebooting ..." message and hardware reset, in milliseconds
49options CPURESET_DELAY=2000 49options CPURESET_DELAY=2000
50 50
51# This option allows you to force a serial console at the specified 51# This option allows you to force a serial console at the specified
52# I/O address. see console(4) for details. 52# I/O address. see console(4) for details.
53options CONSDEVNAME="\"com\"",CONADDR=0x2f8,CONSPEED=57600 53options CONSDEVNAME="\"com\"",CONADDR=0x2f8,CONSPEED=57600
54# you don't want the option below ON iff you are using the 54# you don't want the option below ON iff you are using the

cvs diff -r1.1255 -r1.1256 src/sys/arch/i386/conf/GENERIC (expand / switch to unified diff)

--- src/sys/arch/i386/conf/GENERIC 2024/04/21 14:11:12 1.1255
+++ src/sys/arch/i386/conf/GENERIC 2024/04/30 19:35:28 1.1256
@@ -1,57 +1,57 @@ @@ -1,57 +1,57 @@
1# $NetBSD: GENERIC,v 1.1255 2024/04/21 14:11:12 riastradh Exp $ 1# $NetBSD: GENERIC,v 1.1256 2024/04/30 19:35:28 andvar Exp $
2# 2#
3# GENERIC machine description file 3# GENERIC machine description file
4# 4#
5# This machine description file is used to generate the default NetBSD 5# This machine description file is used to generate the default NetBSD
6# kernel. The generic kernel does not include all options, subsystems 6# kernel. The generic kernel does not include all options, subsystems
7# and device drivers, but should be useful for most applications. 7# and device drivers, but should be useful for most applications.
8# 8#
9# The machine description file can be customised for your specific 9# The machine description file can be customised for your specific
10# machine to reduce the kernel size and improve its performance. 10# machine to reduce the kernel size and improve its performance.
11# 11#
12# For further information on compiling NetBSD kernels, see the config(8) 12# For further information on compiling NetBSD kernels, see the config(8)
13# man page. 13# man page.
14# 14#
15# For further information on hardware support for this architecture, see 15# For further information on hardware support for this architecture, see
16# the intro(4) man page. For further information about kernel options 16# the intro(4) man page. For further information about kernel options
17# for this architecture, see the options(4) man page. For an explanation 17# for this architecture, see the options(4) man page. For an explanation
18# of each device driver in this file see the section 4 man page for the 18# of each device driver in this file see the section 4 man page for the
19# device. 19# device.
20 20
21include "arch/i386/conf/std.i386" 21include "arch/i386/conf/std.i386"
22 22
23options INCLUDE_CONFIG_FILE # embed config file in kernel binary 23options INCLUDE_CONFIG_FILE # embed config file in kernel binary
24 24
25#ident "GENERIC-$Revision: 1.1255 $" 25#ident "GENERIC-$Revision: 1.1256 $"
26 26
27maxusers 64 # estimated number of users 27maxusers 64 # estimated number of users
28 28
29# CPU-related options. 29# CPU-related options.
30options USER_LDT # user-settable LDT; used by WINE 30options USER_LDT # user-settable LDT; used by WINE
31#options PAE # PAE mode (36 bits physical addressing) 31#options PAE # PAE mode (36 bits physical addressing)
32makeoptions SPECTRE_V2_GCC_MITIGATION=1 # GCC Spectre variant 2 32makeoptions SPECTRE_V2_GCC_MITIGATION=1 # GCC Spectre variant 2
33 # migitation 33 # migitation
34options SPECTRE_V2_GCC_MITIGATION 34options SPECTRE_V2_GCC_MITIGATION
35 35
36# CPU features 36# CPU features
37acpicpu* at cpu? # ACPI CPU (including frequency scaling) 37acpicpu* at cpu? # ACPI CPU (including frequency scaling)
38coretemp* at cpu? # Intel on-die thermal sensor 38coretemp* at cpu? # Intel on-die thermal sensor
39est0 at cpu0 # Intel Enhanced SpeedStep (non-ACPI) 39est0 at cpu0 # Intel Enhanced SpeedStep (non-ACPI)
40hyperv0 at cpu0 # Microsoft Hyper-V 40hyperv0 at cpu0 # Microsoft Hyper-V
41#odcm0 at cpu0 # On-demand clock modulation 41#odcm0 at cpu0 # On-demand clock modulation
42#padlock0 at cpu0 # VIA PadLock 42#padlock0 at cpu0 # VIA PadLock
43powernow0 at cpu0 # AMD PowerNow! and Cool'n'Quiet (non-ACPI) 43powernow0 at cpu0 # AMD PowerNow! and Cool'n'Quiet (non-ACPI)
44viac7temp* at cpu? # VIA C7 temperature sensor 44viac7temp* at cpu? # VIA C7, Nano and Zhaoxin temperature sensor
45vmt0 at cpu0 # VMware Tools 45vmt0 at cpu0 # VMware Tools
46 46
47#Xen PV support for HVM guests 47#Xen PV support for HVM guests
48options XENPVHVM 48options XENPVHVM
49options XEN 49options XEN
50hypervisor* at mainbus? # Xen hypervisor 50hypervisor* at mainbus? # Xen hypervisor
51xenbus* at hypervisor? # Xen virtual bus 51xenbus* at hypervisor? # Xen virtual bus
52xencons* at hypervisor? # Xen virtual console 52xencons* at hypervisor? # Xen virtual console
53xennet* at xenbus? # Xen virtual network interface 53xennet* at xenbus? # Xen virtual network interface
54xbd* at xenbus? # Xen virtual block device 54xbd* at xenbus? # Xen virtual block device
55 55
56options MTRR # memory-type range register syscall support 56options MTRR # memory-type range register syscall support
57 57

cvs diff -r1.10 -r1.11 src/sys/arch/x86/x86/viac7temp.c (expand / switch to unified diff)

--- src/sys/arch/x86/x86/viac7temp.c 2024/04/13 09:12:09 1.10
+++ src/sys/arch/x86/x86/viac7temp.c 2024/04/30 19:35:29 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: viac7temp.c,v 1.10 2024/04/13 09:12:09 andvar Exp $ */ 1/* $NetBSD: viac7temp.c,v 1.11 2024/04/30 19:35:29 andvar Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2009 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2009 Jared D. McNeill <jmcneill@invisible.ca>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,116 +17,117 @@ @@ -17,116 +17,117 @@
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.10 2024/04/13 09:12:09 andvar Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: viac7temp.c,v 1.11 2024/04/30 19:35:29 andvar Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/device.h> 33#include <sys/device.h>
34#include <sys/kmem.h> 34#include <sys/kmem.h>
35#include <sys/module.h> 35#include <sys/module.h>
36#include <sys/xcall.h> 36#include <sys/xcall.h>
37 37
38#include <dev/sysmon/sysmonvar.h> 38#include <dev/sysmon/sysmonvar.h>
39 39
40#include <machine/cpuvar.h> 40#include <machine/cpuvar.h>
41#include <machine/cpufunc.h> 41#include <machine/cpufunc.h>
42#include <machine/cputypes.h> 42#include <machine/cputypes.h>
43#include <machine/specialreg.h> 43#include <machine/specialreg.h>
44 44
 45#define MSR_TEMP_NANO 0x1423 /* VIA Nano and Zhaoxin CPUs */
 46#define MSR_TEMP_C7 0x1169 /* VIA C7 CPUs */
 47
45struct viac7temp_softc { 48struct viac7temp_softc {
46 device_t sc_dev; 49 device_t sc_dev;
47 struct cpu_info *sc_ci; 50 struct cpu_info *sc_ci;
48 struct sysmon_envsys *sc_sme; 51 struct sysmon_envsys *sc_sme;
49 envsys_data_t sc_sensor; 52 envsys_data_t sc_sensor;
 53 uint32_t sc_temp_msr;
50}; 54};
51 55
52static int viac7temp_match(device_t, cfdata_t, void *); 56static int viac7temp_match(device_t, cfdata_t, void *);
53static void viac7temp_attach(device_t, device_t, void *); 57static void viac7temp_attach(device_t, device_t, void *);
54static int viac7temp_detach(device_t, int); 58static int viac7temp_detach(device_t, int);
55static void viac7temp_refresh(struct sysmon_envsys *, envsys_data_t *); 59static void viac7temp_refresh(struct sysmon_envsys *, envsys_data_t *);
56static void viac7temp_refresh_xcall(void *, void *); 60static void viac7temp_refresh_xcall(void *, void *);
 61static uint32_t viac7temp_msr_register(struct cpu_info *ci);
57 62
58CFATTACH_DECL_NEW(viac7temp, sizeof(struct viac7temp_softc), 63CFATTACH_DECL_NEW(viac7temp, sizeof(struct viac7temp_softc),
59 viac7temp_match, viac7temp_attach, viac7temp_detach, NULL); 64 viac7temp_match, viac7temp_attach, viac7temp_detach, NULL);
60 65
61static int 66static int
62viac7temp_match(device_t parent, cfdata_t cf, void *aux) 67viac7temp_match(device_t parent, cfdata_t cf, void *aux)
63{ 68{
64 struct cpufeature_attach_args *cfaa = aux; 69 struct cpufeature_attach_args *cfaa = aux;
65 struct cpu_info *ci = cfaa->ci; 70 struct cpu_info *ci = cfaa->ci;
66 uint32_t family, model; 71 uint32_t temp_msr;
67 uint32_t descs[4]; 72 uint64_t val;
68 73
69 if (strcmp(cfaa->name, "temperature") != 0) 74 if (strcmp(cfaa->name, "temperature") != 0)
70 return 0; 75 return 0;
71 76
72 if (cpu_vendor != CPUVENDOR_IDT) 77 if (cpu_vendor != CPUVENDOR_IDT)
73 return 0; 78 return 0;
74 79
75 model = CPUID_TO_MODEL(ci->ci_signature); 80 temp_msr = viac7temp_msr_register(ci);
76 family = CPUID_TO_FAMILY(ci->ci_signature); 
77 81
78 if (family != 0x06 || model < 0x09) 82 if (!temp_msr || rdmsr_safe(temp_msr, &val) == EFAULT)
79 return 0; 83 return 0;
80 84
81 x86_cpuid(0xc0000000, descs); 85 return 1;
82 
83 if (descs[0] >= 0xc0000002) 
84 return 1; 
85 
86 return 0; 
87} 86}
88 87
89static void 88static void
90viac7temp_attach(device_t parent, device_t self, void *aux) 89viac7temp_attach(device_t parent, device_t self, void *aux)
91{ 90{
92 struct viac7temp_softc *sc = device_private(self); 91 struct viac7temp_softc *sc = device_private(self);
93 struct cpufeature_attach_args *cfaa = aux; 92 struct cpufeature_attach_args *cfaa = aux;
94 struct cpu_info *ci = cfaa->ci; 93 struct cpu_info *ci = cfaa->ci;
95 94
96 sc->sc_ci = ci; 95 sc->sc_ci = ci;
97 sc->sc_dev = self; 96 sc->sc_dev = self;
98 97
99 sc->sc_sensor.units = ENVSYS_STEMP; 98 sc->sc_sensor.units = ENVSYS_STEMP;
100 sc->sc_sensor.flags = ENVSYS_FMONLIMITS|ENVSYS_FHAS_ENTROPY; 99 sc->sc_sensor.flags = ENVSYS_FMONLIMITS|ENVSYS_FHAS_ENTROPY;
101 sc->sc_sensor.state = ENVSYS_SINVALID; 100 sc->sc_sensor.state = ENVSYS_SINVALID;
102 101
 102 sc->sc_temp_msr = viac7temp_msr_register(ci);
 103
103 (void)strlcpy(sc->sc_sensor.desc, "temperature", 104 (void)strlcpy(sc->sc_sensor.desc, "temperature",
104 sizeof(sc->sc_sensor.desc)); 105 sizeof(sc->sc_sensor.desc));
105 106
106 sc->sc_sme = sysmon_envsys_create(); 107 sc->sc_sme = sysmon_envsys_create();
107 108
108 if (sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor) != 0) 109 if (sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor) != 0)
109 goto fail; 110 goto fail;
110 111
111 sc->sc_sme->sme_cookie = sc; 112 sc->sc_sme->sme_cookie = sc;
112 sc->sc_sme->sme_name = device_xname(self); 113 sc->sc_sme->sme_name = device_xname(self);
113 sc->sc_sme->sme_refresh = viac7temp_refresh; 114 sc->sc_sme->sme_refresh = viac7temp_refresh;
114 115
115 if (sysmon_envsys_register(sc->sc_sme) != 0) 116 if (sysmon_envsys_register(sc->sc_sme) != 0)
116 goto fail; 117 goto fail;
117 118
118 aprint_naive("\n"); 119 aprint_naive("\n");
119 aprint_normal(": VIA C7 temperature sensor\n"); 120 aprint_normal(": VIA C7/Nano temperature sensor\n");
120 121
121 (void)pmf_device_register(self, NULL, NULL); 122 (void)pmf_device_register(self, NULL, NULL);
122 123
123 return; 124 return;
124 125
125fail: 126fail:
126 sysmon_envsys_destroy(sc->sc_sme); 127 sysmon_envsys_destroy(sc->sc_sme);
127 sc->sc_sme = NULL; 128 sc->sc_sme = NULL;
128} 129}
129 130
130static int 131static int
131viac7temp_detach(device_t self, int flags) 132viac7temp_detach(device_t self, int flags)
132{ 133{
@@ -143,37 +144,61 @@ viac7temp_detach(device_t self, int flag @@ -143,37 +144,61 @@ viac7temp_detach(device_t self, int flag
143static void 144static void
144viac7temp_refresh(struct sysmon_envsys *sme, envsys_data_t *edata) 145viac7temp_refresh(struct sysmon_envsys *sme, envsys_data_t *edata)
145{ 146{
146 struct viac7temp_softc *sc = sme->sme_cookie; 147 struct viac7temp_softc *sc = sme->sme_cookie;
147 uint64_t xc; 148 uint64_t xc;
148 149
149 xc = xc_unicast(0, viac7temp_refresh_xcall, sc, edata, sc->sc_ci); 150 xc = xc_unicast(0, viac7temp_refresh_xcall, sc, edata, sc->sc_ci);
150 xc_wait(xc); 151 xc_wait(xc);
151} 152}
152 153
153static void 154static void
154viac7temp_refresh_xcall(void *arg0, void *arg1) 155viac7temp_refresh_xcall(void *arg0, void *arg1)
155{ 156{
 157 struct viac7temp_softc *sc = arg0;
156 envsys_data_t *edata = arg1; 158 envsys_data_t *edata = arg1;
157 uint32_t descs[4]; 159 uint64_t msr;
158 160
159 x86_cpuid(0xc0000002, descs); 161 if (rdmsr_safe(sc->sc_temp_msr, &msr) == EFAULT) {
 162 edata->value_cur = 0;
 163 edata->state = ENVSYS_SINVALID;
 164 aprint_error_dev(sc->sc_dev, "Reading temperature failed\n");
 165 return;
 166 }
160 167
161 edata->value_cur = descs[0] >> 8; 168 /* Lower 24-bits hold value in Celsius */
 169 edata->value_cur = msr & 0xffffff;
162 edata->value_cur *= 1000000; 170 edata->value_cur *= 1000000;
163 edata->value_cur += 273150000; 171 edata->value_cur += 273150000;
164 edata->state = ENVSYS_SVALID; 172 edata->state = ENVSYS_SVALID;
165} 173}
166 174
 175static uint32_t viac7temp_msr_register(struct cpu_info *ci)
 176{
 177 uint32_t family, model;
 178 uint32_t reg;
 179
 180 reg = 0;
 181 model = CPUID_TO_MODEL(ci->ci_signature);
 182 family = CPUID_TO_FAMILY(ci->ci_signature);
 183
 184 if (family == 0x07 || (family == 0x06 && model >= 0x0f))
 185 reg = MSR_TEMP_NANO;
 186 else if (family == 0x06 && model > 0x09)
 187 reg = MSR_TEMP_C7;
 188
 189 return reg;
 190}
 191
167MODULE(MODULE_CLASS_DRIVER, viac7temp, NULL); 192MODULE(MODULE_CLASS_DRIVER, viac7temp, NULL);
168 193
169#ifdef _MODULE 194#ifdef _MODULE
170#include "ioconf.c" 195#include "ioconf.c"
171#endif 196#endif
172 197
173static int 198static int
174viac7temp_modcmd(modcmd_t cmd, void *arg __unused) 199viac7temp_modcmd(modcmd_t cmd, void *arg __unused)
175{ 200{
176 int error = 0; 201 int error = 0;
177 202
178 switch (cmd) { 203 switch (cmd) {
179 case MODULE_CMD_INIT: 204 case MODULE_CMD_INIT: