Bug 260868 - possible i386 regression after ce35a3bc852d25cb989bc1f3dc4ddb723d7d5117
Summary: possible i386 regression after ce35a3bc852d25cb989bc1f3dc4ddb723d7d5117
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Johnston
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-01-01 21:06 UTC by mike
Modified: 2022-01-06 13:48 UTC (History)
2 users (show)

See Also:


Attachments
sysctl -A | grep -i timer and dmesg for working and non working images (17.84 KB, text/plain)
2022-01-01 21:06 UTC, mike
no flags Details
boot -v and pciconf (19.39 KB, text/plain)
2022-01-01 21:52 UTC, mike
no flags Details
proposed patch (565 bytes, patch)
2022-01-02 16:16 UTC, Mark Johnston
no flags Details | Diff
boot verbose with first patch applied (14.75 KB, text/plain)
2022-01-02 20:12 UTC, mike
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mike 2022-01-01 21:06:39 UTC
Created attachment 230609 [details]
sysctl -A | grep -i timer and dmesg for working and non working images

For some deployments, we are still using some legacy PC Engine's Alix devices. These are GEODE processors, running i386 FreeBSD 13.  I noticed on a latest build as of Jan 1, boot times because impossibly slow (approx 10x times the normal amount to boot) and I cant seem to run the watchdog with an interval below 10 seconds as it does not get processed fast enough. 

If I rewind to a commit just prior to 
https://cgit.freebsd.org/src/commit/?h=stable/13&id=1e40acb545391169b8e13fd27724e3699d6824c3
all works as normal


Also seemingly related is that I had been using a kernel definition that did not include SMP nor APIC.  If I checkout to 
1a305490732cdd30d19627b49847ebe09009a8f7 

I can no longer compile said kernel as it fails with 

--- vers.c ---
MAKE="make" sh /usr/src/sys/conf/newvers.sh  ALIX_DSK
--- vers.o ---
cc -target i386-unknown-freebsd13.0 --sysroot=/usr/obj/nanobsd.alix2b/usr/src/i386.i386/tmp -B/usr/obj/nanobsd.alix2b/usr/src/i386.i386/tmp/usr/bin -c -O2 -pipe  -fno-strict-aliasing   -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common     -fdebug-prefix-map=./machine=/usr/src/sys/i386/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -mno-mmx -mno-sse -msoft-float -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-error=unused-but-set-variable -Wno-format-zero-length   -mno-aes -mno-avx  -std=iso9899:1999 -Werror  vers.c
ctfconvert -L VERSION vers.o
ERROR: ctfconvert: vers.o doesn't have type data to convert
--- kernel ---
linking kernel
ld: error: undefined symbol: apic_ops
>>> referenced by clock.c
>>>               clock.o:(cpu_initclocks)
*** [kernel] Error code 1

make[2]: stopped in /usr/obj/nanobsd.alix2b/usr/src/i386.i386/sys/alix
1 error

make[2]: stopped in /usr/obj/nanobsd.alix2b/usr/src/i386.i386/sys/alix

make[1]: stopped in /usr/src

make: stopped in /usr/src


Adding in 
device          apic                    
to the kernel config allows me to compile, but the resultant kernel is dead slow / unusable. 

Attached is a working and non working dmesg and output of sysctl -A | grep time (in case that helps)
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2022-01-01 21:17:19 UTC
I think I see the problem.  We're calibrating using the i8254 timer, and the corresponding timecounter has a pretty narrow mask so wraparound can occur multiple times.  I wonder if we should just skip late calibration if the i8254 is the only reference clock.

Could you please show a verbose dmesg from the broken kernel?
Comment 2 mike 2022-01-01 21:52:49 UTC
Created attachment 230612 [details]
boot -v and pciconf
Comment 3 mike 2022-01-02 02:22:00 UTC
Even though the box is up 2hrs, the uptime shows 2 min


Type '?' for a list of commands, 'help' for more detailed help.
OK boot -v
---<<BOOT>>---
Copyright (c) 1992-2021 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.0-STABLE #0 stable/13-1a3054907: Sat Jan  1 15:35:26 EST 2022
    mdtancsa@nano13-i386.sentex.ca:/usr/obj/nanobsd.alix2b/usr/src/i386.i386/sys/alix i386
FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
VT(vga): resolution 640x480
Preloaded elf kernel "/boot/kernel/kernel" at 0x12a3000.
Preloaded elf module "/boot/kernel/u3g.ko" at 0x12ab8ac.
Preloaded boot_entropy_cache "/boot/entropy" at 0x12abcf4.
Early TSC frequency 498072600Hz calibrated from 8254 PIT
CPU: Geode(TM) Integrated Processor by AMD PCS (498.07-MHz 586-class CPU)
  Origin="AuthenticAMD"  Id=0x5a2  Family=0x5  Model=0xa  Stepping=2
  Features=0x88a93d<FPU,DE,PSE,TSC,MSR,CX8,SEP,PGE,CMOV,CLFLUSH,MMX>
  AMD Features=0xc0400000<MMX+,3DNow!+,3DNow!>
L1 2MB data TLB: 0 entries, 0-way associative
L1 2MB instruction TLB: 0 entries, 0-way associative
L1 4KB data TLB: 16 entries, fully associative
L1 4KB instruction TLB: 16 entries, fully associative
L1 data cache: 64 kbytes, 32 bytes/line, 1 lines/tag, 16-way associative
L1 instruction cache: 64 kbytes, 32 bytes/line, 1 lines/tag, 16-way associative
L2 2MB unified TLB: 4 entries, disabled/not present
L2 4KB unified TLB: 0 entries, disabled/not present
L2 unified cache: 128 kbytes, 32 bytes/line, 1 lines/tag, 4-way associative
Write Allocate Disable
real memory  = 268435456 (256 MB)
Physical memory chunk(s):
0x0000000000001000 - 0x000000000009ffff, 651264 bytes (159 pages)
0x0000000000100000 - 0x00000000007fffff, 7340032 bytes (1792 pages)
0x0000000001429000 - 0x000000000fbb4fff, 242794496 bytes (59276 pages)
avail memory = 249569280 (238 MB)
bios32: Found BIOS32 Service Directory header at 0x4fd110
bios32: Entry = 0xfd0e4 (4fd0e4)  Rev = 0  Len = 1
pcibios: PCI BIOS entry at 0xf0000+0xcf35
pnpbios: Bad PnP BIOS data checksum
Other BIOS signatures found:
random: read 4096 bytes from preloaded cache
random: unblocking device.
hostuuid: using 00000000-0000-0000-0000-000000000000
ULE: setup cpu 0
random: entropy device external interface
null: <full device, null device, zero device>
io: <I/O>
crypto: <crypto core>
kbd0 at kbdmux0
mem: <memory>
K6-family MTRR support enabled (2 registers)
vtvga0: <VT VGA driver>
crypto: assign cryptosoft0 driver id 0, flags 0x6000000
pci_open(1):    mode 1 addr port (0x0cf8) is 0x00000000
pci_open(1a):   mode1res=0x80000000 (0x80000000)
pci_cfgcheck:   device 0 1 [class=060000] [hdr=80] is there (id=20801022)
pcibios: BIOS version 2.10
pcib0 pcibus 0
pci0: <PCI bus> on pcib0
pci0: domain=0, physical bus=0
found-> vendor=0x1022, dev=0x2080, revid=0x33
        domain=0, bus=0, slot=1, func=0
        class=06-00-00, hdrtype=0x00, mfdev=1
        cmdreg=0x0005, statreg=0x0220, cachelnsz=8 (dwords)
        lattimer=0xf8 (7440 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        map[10]: type I/O Port, range 32, base rxac1c, size  2, enabled
found-> vendor=0x1022, dev=0x2082, revid=0x00
        domain=0, bus=0, slot=1, func=2
        class=10-10-00, hdrtype=0x00, mfdev=0
        cmdreg=0x0006, statreg=0x02a0, cachelnsz=8 (dwords)
        lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        intpin=a, irq=9
        map[10]: type Memory, range 32, base rxefff4000, size 14, enabled
found-> vendor=0x1106, dev=0x3053, revid=0x96
        domain=0, bus=0, slot=9, func=0
        class=02-00-00, hdrtype=0x00, mfdev=0
        cmdreg=0x0097, statreg=0x0210, cachelnsz=8 (dwords)
        lattimer=0x20 (960 ns), mingnt=0x03 (750 ns), maxlat=0x08 (2000 ns)
        intpin=a, irq=10
        powerspec 2  supports D0 D1 D2 D3  current D0
        map[10]: type I/O Port, range 32, base rx1000, size  8, enabled
        map[14]: type Memory, range 32, base rxe0000000, size  8, enabled
found-> vendor=0x1106, dev=0x3053, revid=0x96
        domain=0, bus=0, slot=10, func=0
        class=02-00-00, hdrtype=0x00, mfdev=0
        cmdreg=0x0097, statreg=0x0210, cachelnsz=8 (dwords)
        lattimer=0x20 (960 ns), mingnt=0x03 (750 ns), maxlat=0x08 (2000 ns)
        intpin=a, irq=11
        powerspec 2  supports D0 D1 D2 D3  current D0
        map[10]: type I/O Port, range 32, base rx1400, size  8, enabled
        map[14]: type Memory, range 32, base rxe0040000, size  8, enabled
found-> vendor=0x1106, dev=0x3053, revid=0x96
        domain=0, bus=0, slot=11, func=0
        class=02-00-00, hdrtype=0x00, mfdev=0
        cmdreg=0x0097, statreg=0x0210, cachelnsz=8 (dwords)
        lattimer=0x20 (960 ns), mingnt=0x03 (750 ns), maxlat=0x08 (2000 ns)
        intpin=a, irq=15
        powerspec 2  supports D0 D1 D2 D3  current D0
        map[10]: type I/O Port, range 32, base rx1800, size  8, enabled
        map[14]: type Memory, range 32, base rxe0080000, size  8, enabled
found-> vendor=0x1022, dev=0x2090, revid=0x03
        domain=0, bus=0, slot=15, func=0
        class=06-01-00, hdrtype=0x00, mfdev=1
        cmdreg=0x0009, statreg=0x02a0, cachelnsz=8 (dwords)
        lattimer=0x40 (1920 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        map[10]: type I/O Port, range 32, base rx6000, size  3, enabled
        map[14]: type I/O Port, range 32, base rx6100, size  8, enabled
        map[18]: type I/O Port, range 32, base rx6200, size  6, enabled
        map[20]: type I/O Port, range 32, base rx9d00, size  7, enabled
        map[24]: type I/O Port, range 32, base rx9c00, size  6, enabled
found-> vendor=0x1022, dev=0x209a, revid=0x01
        domain=0, bus=0, slot=15, func=2
        class=01-01-80, hdrtype=0x00, mfdev=0
        cmdreg=0x0005, statreg=0x02a0, cachelnsz=8 (dwords)
        lattimer=0xf8 (7440 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        map[20]: type I/O Port, range 32, base rxff00, size  4, enabled
found-> vendor=0x1022, dev=0x2094, revid=0x02
        domain=0, bus=0, slot=15, func=4
        class=0c-03-10, hdrtype=0x00, mfdev=0
        cmdreg=0x0006, statreg=0x0230, cachelnsz=8 (dwords)
        lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        intpin=d, irq=12
        powerspec 2  supports D0 D3  current D0
        map[10]: type Memory, range 32, base rxefffe000, size 12, enabled
found-> vendor=0x1022, dev=0x2095, revid=0x02
        domain=0, bus=0, slot=15, func=5
        class=0c-03-20, hdrtype=0x00, mfdev=0
        cmdreg=0x0006, statreg=0x0230, cachelnsz=8 (dwords)
        lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        intpin=d, irq=12
        powerspec 2  supports D0 D3  current D0
        map[10]: type Memory, range 32, base rxefffd000, size 12, enabled
Geode LX: PC Engines ALIX.2 v0.99m tinyBIOS V1.4a (C)1997-2007
MFGPT bar: f00100006200
pci0: <encrypt/decrypt, entertainment crypto> at device 1.2 (no driver attached)
vr0: <VIA VT6105M Rhine III 10/100BaseTX> port 0x1000-0x10ff mem 0xe0000000-0xe00000ff irq 10 at device 9.0 on pci0
vr0: Quirks: 0x2
vr0: Revision: 0x96
miibus0: <MII bus> on vr0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0: OUI 0x0002c6, model 0x0034, rev. 3
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow
vr0: bpf attached
vr0: Ethernet address: 00:0d:b9:36:c3:1c
vr1: <VIA VT6105M Rhine III 10/100BaseTX> port 0x1400-0x14ff mem 0xe0040000-0xe00400ff irq 11 at device 10.0 on pci0
vr1: Quirks: 0x2
vr1: Revision: 0x96
miibus1: <MII bus> on vr1
ukphy1: <Generic IEEE 802.3u media interface> PHY 1 on miibus1
ukphy1: OUI 0x0002c6, model 0x0034, rev. 3
ukphy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow
vr1: bpf attached
vr1: Ethernet address: 00:0d:b9:36:c3:1d
vr2: <VIA VT6105M Rhine III 10/100BaseTX> port 0x1800-0x18ff mem 0xe0080000-0xe00800ff irq 15 at device 11.0 on pci0
vr2: Quirks: 0x2
vr2: Revision: 0x96
miibus2: <MII bus> on vr2
ukphy2: <Generic IEEE 802.3u media interface> PHY 1 on miibus2
ukphy2: OUI 0x0002c6, model 0x0034, rev. 3
ukphy2:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow
vr2: bpf attached
vr2: Ethernet address: 00:0d:b9:36:c3:1e
isab0: <PCI-ISA bridge> port 0x6000-0x6007,0x6100-0x61ff,0x6200-0x623f,0x9d00-0x9d7f,0x9c00-0x9c3f at device 15.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <AMD CS5536 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xff00-0xff0f at device 15.2 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
ohci0: <OHCI (generic) USB controller> mem 0xefffe000-0xefffefff irq 12 at device 15.4 on pci0
usbus0 on ohci0
ohci0: usbpf: Attached
ehci0: <AMD CS5536 (Geode) USB 2.0 controller> mem 0xefffd000-0xefffdfff irq 12 at device 15.5 on pci0
usbus1: EHCI version 1.0
usbus1 on ehci0
ehci0: usbpf: Attached
cpu0
pnp_identify: Trying Read_Port at 203
pnp_identify: Trying Read_Port at 243
pnp_identify: Trying Read_Port at 283
pnp_identify: Trying Read_Port at 2c3
pnp_identify: Trying Read_Port at 303
pnp_identify: Trying Read_Port at 343
pnp_identify: Trying Read_Port at 383
pnp_identify: Trying Read_Port at 3c3
PNP Identify complete
isa_probe_children: disabling PnP devices
ata: ata0 already exists; skipping it
ata: ata1 already exists; skipping it
sc: sc0 already exists; skipping it
isa_probe_children: probing non-PnP devices
orm0: <ISA Option ROM> at iomem 0xe0000-0xea7ff pnpid ORM0000 on isa0
sc0 failed to probe on isa0
vga0 failed to probe on isa0
atkbdc0 failed to probe at port 0x60 on isa0
atrtc0: <AT realtime clock> at port 0x70 irq 8 on isa0
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
attimer0: <AT timer> at port 0x40 on isa0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
fdc0 failed to probe at port 0x3f0 irq 6 drq 2 on isa0
ppc0 failed to probe at irq 7 on isa0
uart0: <16550 or compatible> at port 0x3f8 irq 4 flags 0x10 on isa0
uart0: console (115200,n,8,1)
uart0: fast interrupt
uart0: PPS capture mode: DCD
uart1: <16550 or compatible> at port 0x2f8 irq 3 on isa0
uart1: fast interrupt
uart1: PPS capture mode: DCD
isa_probe_children: probing PnP devices
Device configuration finished.
Timecounter "TSC" frequency 43797127726 Hz quality 800
Timecounters tick every 1.000 msec
vlan: initialized, using hash tables with chaining
lo0: bpf attached
crypto: <crypto device>
IPsec: Initialized Security Association Processing.
tcp_init: net.inet.tcp.tcbhashsize auto tuned to 2048
pflog0: bpf attached
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 480Mbps High Speed USB v2.0
ata0: reset tp1 mask=03 ostat0=50 ostat1=00
ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00
ata0: stat1=0x00 err=0x01 lsb=0x00 msb=0x00
ata0: reset tp2 stat0=50 stat1=00 devices=0x1
ugen0.1: <AMD OHCI root HUB> at usbus0
uhub0 on usbus0
uhub0: <AMD OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <AMD EHCI root HUB> at usbus1
uhub1 on usbus1
uhub1: <AMD EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
Trying to mount root from ufs:/dev/ada0s1a [ro]...
Root mount waiting for: CAM usbus0 usbus1
ata1: reset tp1 mask=00 ostat0=ff ostat1=ff
ada0 at ata0 bus 0 scbus0 target 0 lun 0
ada0: <CF 2GB 20110221> ATA-7 device
ada0: Serial Number TSS50037130117092408
ada0: 100.000MB/s transfers (UDMA5, PIO 512bytes)
ada0: 1919MB (3931200 512 byte sectors)
GEOM: new disk ada0
pass0 at ata0 bus 0 scbus0 target 0 lun 0
pass0: <CF 2GB 20110221> ATA-7 device
pass0: Serial Number TSS50037130117092408
pass0: 100.000MB/s transfers (UDMA5, PIO 512bytes)
uhub0: 4 ports with 4 removable, self powered
Root mount waiting for: usbus1
uhub1: 4 ports with 4 removable, self powered
Root mount waiting for: usbus1
ugen1.2: <Sierra Wireless, Incorporated MC7700> at usbus1
u3g0 on uhub1
u3g0: <Sierra Wireless, Incorporated MC7700, class 0/0, rev 2.00/0.06, addr 2> on usbus1
u3g0: port 3 supports modem control
u3g0: port 4 supports modem control
u3g0: port 5 supports modem control
u3g0: Found 6 ports.
mountroot: waiting for device /dev/ada0s1a...
atrtc0: providing initial system time
start_init: trying /sbin/init
Starting file system checks:
/dev/ada0s1a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ada0s1a: clean, 363611 free (1883 frags, 45216 blocks, 0.1% fragmentation)
/dev/ada0s3: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ada0s3: clean, 2829 free (21 frags, 351 blocks, 0.7% fragmentation)
/etc/rc: WARNING: hostid: unable to figure out a UUID from DMI data, generating a new one
Setting hostuuid: b38cd3e3-6b54-11ec-bc9f-000db936c31c.
Setting hostid: 0x8a729d84.
Mounting local filesystems:.
Setting hostname: badkernel.sentex.ca.
Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding entropy: dd: /boot/entropy: Read-only file system
.
ELF ldconfig path: /lib /usr/lib /usr/local/lib /usr/local/lib/ipsec /usr/local/lib/perl5/5.32/mach/CORE
/etc/rc: WARNING: $swapfile is obsolete.  Ignored.
lo0: link state changed to UP
vr0: link state changed to DOWN
vr1: link state changed to DOWN
vr2: link state changed to DOWN
vr0: link state changed to UP
Starting Network: lo0 vr0 vr1 vr2.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8280b<RXCSUM,TXCSUM,VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:0d:b9:36:c3:1c
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
vr1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8280b<RXCSUM,TXCSUM,VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:0d:b9:36:c3:1d
        inet 192.168.241.129 netmask 0xffffff00 broadcast 192.168.241.255
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
vr2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8280b<RXCSUM,TXCSUM,VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:0d:b9:36:c3:1e
        inet 192.168.1.51 netmask 0xffffff00 broadcast 192.168.1.255
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
Starting dhclient.
DHCPDISCOVER on vr0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.0.12
DHCPREQUEST on vr0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.12
arp: 00:0d:b9:20:f6:b4 is using my IP address 192.168.254.2 on vr0!
bound to 192.168.0.90 -- renewal in 1800 seconds.
Starting pflog.
pflog0: promiscuous mode enabled
stray irq7
2022-01-01T17:46:51.624523-05:00 badkernel.sentex.ca pflogd 556 - - [priv]: msg PRIV_OPEN_LOG received
add host 127.0.0.1: gateway lo0 fib 0: route already in table
Additional inet routing options: gateway=YES.
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Enabling pf.
Clearing /tmp (X related).
Creating and/or trimming log files.
Updating /var/run/os-release done.
Updating motd:.
Starting syslogd.
Jan  1 17:46:51 badkernel syslogd: /var/log/all.log: No such file or directory
Jan  1 17:46:51 badkernel syslogd: /var/log/modem.log: No such file or directory
Jan  1 17:46:51 badkernel syslogd: /var/log/modem.log: No such file or directory
Jan  1 17:46:51 badkernel syslogd: /var/log/modem.log: No such file or directory
Local package initialization: (skipping /usr/local/etc/rc.d/00-date.sh, not executable) (skipping /usr/local/etc/rc.d/000-syslog.sh, not executable) (skipping /usr/local/etc/rc.d/01-dsl.sh, not executable) (skipping /usr/local/etc/rc.d/01-huawei.sh, not executable) (skipping /usr/local/etc/rc.d/01_openvpn.sh, not executable) (skipping /usr/local/etc/rc.d/02-zebra.sh, not executable) (skipping /usr/local/etc/rc.d/03-dog.sh, not executable) (skipping /usr/local/etc/rc.d/04-arpwatch.sh, not executable) (skipping /usr/local/etc/rc.d/09-dhcpd.sh, not executable) (skipping /usr/local/etc/rc.d/09-monitor.sh, not executable) (skipping /usr/local/etc/rc.d/09-sendmail.sh, not executable) (skipping /usr/local/etc/rc.d/99_argus.sh, not executable) (skipping /usr/local/etc/rc.d/99_openvpn-parkland.sh, not executable) (skipping /usr/local/etc/rc.d/openvpn-tor2.sh, not executable).
Mounting late filesystems:.
Starting inetd.
Configuring vt: blanktime.
Starting sendmail_submit.
Starting sendmail_msp_queue.
Starting cron.

Sat Jan  1 17:46:51 EST 2022

FreeBSD/i386 (badkernel.sentex.ca) (ttyu0)

login: root
Password:


0(badkernel)# w
 5:49PM  up 2 mins, 1 user, load averages: 0.20, 0.28, 0.14
USER       TTY      FROM    LOGIN@  IDLE WHAT
root       u0       -       5:49PM     - w
0(badkernel)#
Comment 4 Mark Johnston freebsd_committer freebsd_triage 2022-01-02 16:16:48 UTC
Created attachment 230628 [details]
proposed patch

Could you please give this patch a try?
Comment 5 mike 2022-01-02 19:50:16 UTC
(In reply to Mark Johnston from comment #4)

Not too much luck unfortunately.  Boot time is still very slow although maybe not quite as slow ? I can benchmark to get an measured difference if you think that would help.  Maybe a good idea regardless to set a baseline?
Comment 6 Mark Johnston freebsd_committer freebsd_triage 2022-01-02 20:00:43 UTC
(In reply to mike from comment #5)
Could you show a verbose dmesg with the patch applied, please?
Comment 7 mike 2022-01-02 20:12:32 UTC
Created attachment 230635 [details]
boot verbose with first patch applied

boot verbose with patch applied
Comment 8 Mark Johnston freebsd_committer freebsd_triage 2022-01-02 20:17:13 UTC
(In reply to mike from comment #7)
Are you certain the patch was applied and the right kernel is being tested?  If so, can you show output of "sysctl kern.timecounter" from a working revision of the kernel?
Comment 9 mike 2022-01-02 20:32:18 UTC
(In reply to Mark Johnston from comment #8)
Pretty sure I did it right. Just rebuilding now once more

0{nano13-i386}# git pull --ff-only
Already up to date.
0{nano13-i386}# git restore sys/x86/x86/tsc.c
0{nano13-i386}# 
0{nano13-i386}# git pull --ff-only
Already up to date.
0{nano13-i386}# patch -p1 < p
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- a/sys/x86/x86/tsc.c
|+++ b/sys/x86/x86/tsc.c
--------------------------
Patching file sys/x86/x86/tsc.c using Plan A...
Hunk #1 succeeded at 709 (offset -2 lines).
Hunk #2 succeeded at 739 (offset -2 lines).
done
0{nano13-i386}# cd /usr/src/tools/tools/nanobsd/
0{nano13-i386}# sh ./nanobsd.sh -c alix2-lite.conf
00:00:00 ### Exporting NanoBSD variables
00:00:00 ### Setting variable: MAKEOBJDIRPREFIX="/usr/obj/nanobsd.alix2b-lite"
00:00:00 ### Setting variable: NANO_ARCH="i386"
....

On the broken kernel from the previous compile
sysctl.name: Format:N Length:1 Dump:0x00...
sysctl.next: Format:N Length:8 Dump:0x0000000001000000...
sysctl.oidfmt: Format:N Length:6 Dump:0x018004804e00...
sysctl.oiddescr: Format:N Length:1 Dump:0x00...
sysctl.nextnoskip: Format:N Length:4 Dump:0x00000000...
kern.timecounter.tsc_shift: 1
kern.timecounter.invariant_tsc: 0
kern.timecounter.fast_gettime: 1
kern.timecounter.tick: 1
kern.timecounter.choice: TSC(800) i8254(0) dummy(-1000000)
kern.timecounter.hardware: TSC
kern.timecounter.alloweddeviation: 5
kern.timecounter.timehands_count: 2
kern.timecounter.stepwarnings: 0
kern.timecounter.tc.TSC.quality: 800
kern.timecounter.tc.TSC.frequency: 43797106710
kern.timecounter.tc.TSC.counter: 1501354553
kern.timecounter.tc.TSC.mask: 4294967295
kern.timecounter.tc.i8254.quality: 0
kern.timecounter.tc.i8254.frequency: 1193182
kern.timecounter.tc.i8254.counter: 45976
kern.timecounter.tc.i8254.mask: 65535

From a couple of boxes in the field (kernel from mid october)

 sysctl -a kern.timecounter
kern.timecounter.tsc_shift: 1
kern.timecounter.invariant_tsc: 0
kern.timecounter.fast_gettime: 1
kern.timecounter.tick: 1
kern.timecounter.choice: i8254(0) TSC(800) dummy(-1000000)
kern.timecounter.hardware: TSC
kern.timecounter.alloweddeviation: 5
kern.timecounter.timehands_count: 2
kern.timecounter.stepwarnings: 0
kern.timecounter.tc.i8254.quality: 0
kern.timecounter.tc.i8254.frequency: 1193182
kern.timecounter.tc.i8254.counter: 60550
kern.timecounter.tc.i8254.mask: 65535
kern.timecounter.tc.TSC.quality: 800
kern.timecounter.tc.TSC.frequency: 498060517
kern.timecounter.tc.TSC.counter: 2030169375
kern.timecounter.tc.TSC.mask: 4294967295

sysctl -A kern.timecounter
kern.timecounter.tsc_shift: 1
kern.timecounter.invariant_tsc: 0
kern.timecounter.fast_gettime: 1
kern.timecounter.tick: 1
kern.timecounter.choice: i8254(0) TSC(800) dummy(-1000000)
kern.timecounter.hardware: TSC
kern.timecounter.alloweddeviation: 5
kern.timecounter.timehands_count: 2
kern.timecounter.stepwarnings: 0
kern.timecounter.tc.i8254.quality: 0
kern.timecounter.tc.i8254.frequency: 1193182
kern.timecounter.tc.i8254.counter: 872
kern.timecounter.tc.i8254.mask: 65535
kern.timecounter.tc.TSC.quality: 800
kern.timecounter.tc.TSC.frequency: 498060589
kern.timecounter.tc.TSC.counter: 2959254008
kern.timecounter.tc.TSC.mask: 4294967295

 sysctl -a kern.timecounter
kern.timecounter.tsc_shift: 1
kern.timecounter.invariant_tsc: 0
kern.timecounter.fast_gettime: 1
kern.timecounter.tick: 1
kern.timecounter.choice: i8254(0) TSC(800) dummy(-1000000)
kern.timecounter.hardware: TSC
kern.timecounter.alloweddeviation: 5
kern.timecounter.timehands_count: 2
kern.timecounter.stepwarnings: 0
kern.timecounter.tc.i8254.quality: 0
kern.timecounter.tc.i8254.frequency: 1193182
kern.timecounter.tc.i8254.counter: 49583
kern.timecounter.tc.i8254.mask: 65535
kern.timecounter.tc.TSC.quality: 800
kern.timecounter.tc.TSC.frequency: 498060817
kern.timecounter.tc.TSC.counter: 666829629
kern.timecounter.tc.TSC.mask: 4294967295



Could it also have something to do with having to add device apic in order for the kernel to compile now ? I didnt have that before.

I am booting the 2nd image I made just now with the above steps and its slow as well. Will post the verbose dmesg and sysctl output once its fully booted in a sec
Comment 10 mike 2022-01-02 20:35:21 UTC
Hang on, this might be my issue when burning the image :( 2 secs
Comment 11 mike 2022-01-02 20:35:39 UTC
Hang on, this might be my issue when burning the image :( 2 secs
Comment 12 mike 2022-01-02 21:07:30 UTC
Arggg, very sorry. My fault, I was not paying attention to !scp this AM as I was sending the built image to the wrong location to burn the resultant image. Anyways, I can confirm the boot looks good with your patch!

OK boot -v
---<<BOOT>>---
Copyright (c) 1992-2021 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.0-STABLE #1 stable/13-682886d11-dirty: Sun Jan  2 15:52:05 EST 2022
    mdtancsa@nano13-i386.sentex.ca:/usr/obj/nanobsd.alix2b/usr/src/i386.i386/sys/alix i386
FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
VT(vga): resolution 640x480
Preloaded elf kernel "/boot/kernel/kernel" at 0x132c000.
Preloaded elf module "/boot/kernel/u3g.ko" at 0x13348ac.
Preloaded boot_entropy_cache "/boot/entropy" at 0x1334cf4.
Preloaded TSLOG data "TSLOG" at 0x1334d40.
Early TSC frequency 498077420Hz calibrated from 8254 PIT
CPU: Geode(TM) Integrated Processor by AMD PCS (498.08-MHz 586-class CPU)
  Origin="AuthenticAMD"  Id=0x5a2  Family=0x5  Model=0xa  Stepping=2
  Features=0x88a93d<FPU,DE,PSE,TSC,MSR,CX8,SEP,PGE,CMOV,CLFLUSH,MMX>
  AMD Features=0xc0400000<MMX+,3DNow!+,3DNow!>
L1 2MB data TLB: 0 entries, 0-way associative
L1 2MB instruction TLB: 0 entries, 0-way associative
L1 4KB data TLB: 16 entries, fully associative
L1 4KB instruction TLB: 16 entries, fully associative
L1 data cache: 64 kbytes, 32 bytes/line, 1 lines/tag, 16-way associative
L1 instruction cache: 64 kbytes, 32 bytes/line, 1 lines/tag, 16-way associative
L2 2MB unified TLB: 4 entries, disabled/not present
L2 4KB unified TLB: 0 entries, disabled/not present
L2 unified cache: 128 kbytes, 32 bytes/line, 1 lines/tag, 4-way associative
Write Allocate Disable
real memory  = 268435456 (256 MB)
Physical memory chunk(s):
0x0000000000001000 - 0x000000000009ffff, 651264 bytes (159 pages)
0x0000000000100000 - 0x00000000007fffff, 7340032 bytes (1792 pages)
0x0000000001429000 - 0x000000000fbb4fff, 242794496 bytes (59276 pages)
avail memory = 249569280 (238 MB)
bios32: Found BIOS32 Service Directory header at 0x4fd110
bios32: Entry = 0xfd0e4 (4fd0e4)  Rev = 0  Len = 1
pcibios: PCI BIOS entry at 0xf0000+0xcf35
pnpbios: Bad PnP BIOS data checksum
Other BIOS signatures found:
random: read 4096 bytes from preloaded cache
random: unblocking device.
hostuuid: using 00000000-0000-0000-0000-000000000000
ULE: setup cpu 0
random: entropy device external interface
null: <full device, null device, zero device>
io: <I/O>
crypto: <crypto core>
kbd0 at kbdmux0
mem: <memory>
K6-family MTRR support enabled (2 registers)
vtvga0: <VT VGA driver>
crypto: assign cryptosoft0 driver id 0, flags 0x6000000
pci_open(1):    mode 1 addr port (0x0cf8) is 0x00000000
pci_open(1a):   mode1res=0x80000000 (0x80000000)
pci_cfgcheck:   device 0 1 [class=060000] [hdr=80] is there (id=20801022)
pcibios: BIOS version 2.10
pcib0 pcibus 0
pci0: <PCI bus> on pcib0
pci0: domain=0, physical bus=0
found-> vendor=0x1022, dev=0x2080, revid=0x33
        domain=0, bus=0, slot=1, func=0
        class=06-00-00, hdrtype=0x00, mfdev=1
        cmdreg=0x0005, statreg=0x0220, cachelnsz=8 (dwords)
        lattimer=0xf8 (7440 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        map[10]: type I/O Port, range 32, base rxac1c, size  2, enabled
found-> vendor=0x1022, dev=0x2082, revid=0x00
        domain=0, bus=0, slot=1, func=2
        class=10-10-00, hdrtype=0x00, mfdev=0
        cmdreg=0x0006, statreg=0x02a0, cachelnsz=8 (dwords)
        lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        intpin=a, irq=9
        map[10]: type Memory, range 32, base rxefff4000, size 14, enabled
found-> vendor=0x1106, dev=0x3053, revid=0x96
        domain=0, bus=0, slot=9, func=0
        class=02-00-00, hdrtype=0x00, mfdev=0
        cmdreg=0x0097, statreg=0x0210, cachelnsz=8 (dwords)
        lattimer=0x20 (960 ns), mingnt=0x03 (750 ns), maxlat=0x08 (2000 ns)
        intpin=a, irq=10
        powerspec 2  supports D0 D1 D2 D3  current D0
        map[10]: type I/O Port, range 32, base rx1000, size  8, enabled
        map[14]: type Memory, range 32, base rxe0000000, size  8, enabled
found-> vendor=0x1106, dev=0x3053, revid=0x96
        domain=0, bus=0, slot=10, func=0
        class=02-00-00, hdrtype=0x00, mfdev=0
        cmdreg=0x0097, statreg=0x0210, cachelnsz=8 (dwords)
        lattimer=0x20 (960 ns), mingnt=0x03 (750 ns), maxlat=0x08 (2000 ns)
        intpin=a, irq=11
        powerspec 2  supports D0 D1 D2 D3  current D0
        map[10]: type I/O Port, range 32, base rx1400, size  8, enabled
        map[14]: type Memory, range 32, base rxe0040000, size  8, enabled
found-> vendor=0x1106, dev=0x3053, revid=0x96
        domain=0, bus=0, slot=11, func=0
        class=02-00-00, hdrtype=0x00, mfdev=0
        cmdreg=0x0097, statreg=0x0210, cachelnsz=8 (dwords)
        lattimer=0x20 (960 ns), mingnt=0x03 (750 ns), maxlat=0x08 (2000 ns)
        intpin=a, irq=15
        powerspec 2  supports D0 D1 D2 D3  current D0
        map[10]: type I/O Port, range 32, base rx1800, size  8, enabled
        map[14]: type Memory, range 32, base rxe0080000, size  8, enabled
found-> vendor=0x1022, dev=0x2090, revid=0x03
        domain=0, bus=0, slot=15, func=0
        class=06-01-00, hdrtype=0x00, mfdev=1
        cmdreg=0x0009, statreg=0x02a0, cachelnsz=8 (dwords)
        lattimer=0x40 (1920 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        map[10]: type I/O Port, range 32, base rx6000, size  3, enabled
        map[14]: type I/O Port, range 32, base rx6100, size  8, enabled
        map[18]: type I/O Port, range 32, base rx6200, size  6, enabled
        map[20]: type I/O Port, range 32, base rx9d00, size  7, enabled
        map[24]: type I/O Port, range 32, base rx9c00, size  6, enabled
found-> vendor=0x1022, dev=0x209a, revid=0x01
        domain=0, bus=0, slot=15, func=2
        class=01-01-80, hdrtype=0x00, mfdev=0
        cmdreg=0x0005, statreg=0x02a0, cachelnsz=8 (dwords)
        lattimer=0xf8 (7440 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        map[20]: type I/O Port, range 32, base rxff00, size  4, enabled
found-> vendor=0x1022, dev=0x2094, revid=0x02
        domain=0, bus=0, slot=15, func=4
        class=0c-03-10, hdrtype=0x00, mfdev=0
        cmdreg=0x0006, statreg=0x0230, cachelnsz=8 (dwords)
        lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        intpin=d, irq=12
        powerspec 2  supports D0 D3  current D0
        map[10]: type Memory, range 32, base rxefffe000, size 12, enabled
found-> vendor=0x1022, dev=0x2095, revid=0x02
        domain=0, bus=0, slot=15, func=5
        class=0c-03-20, hdrtype=0x00, mfdev=0
        cmdreg=0x0006, statreg=0x0230, cachelnsz=8 (dwords)
        lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        intpin=d, irq=12
        powerspec 2  supports D0 D3  current D0
        map[10]: type Memory, range 32, base rxefffd000, size 12, enabled
Geode LX: PC Engines ALIX.2 v0.99m tinyBIOS V1.4a (C)1997-2007
MFGPT bar: f00100006200
pci0: <encrypt/decrypt, entertainment crypto> at device 1.2 (no driver attached)
vr0: <VIA VT6105M Rhine III 10/100BaseTX> port 0x1000-0x10ff mem 0xe0000000-0xe00000ff irq 10 at device 9.0 on pci0
vr0: Quirks: 0x2
vr0: Revision: 0x96
miibus0: <MII bus> on vr0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0: OUI 0x0002c6, model 0x0034, rev. 3
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow
vr0: bpf attached
vr0: Ethernet address: 00:0d:b9:36:c3:1c
vr1: <VIA VT6105M Rhine III 10/100BaseTX> port 0x1400-0x14ff mem 0xe0040000-0xe00400ff irq 11 at device 10.0 on pci0
vr1: Quirks: 0x2
vr1: Revision: 0x96
miibus1: <MII bus> on vr1
ukphy1: <Generic IEEE 802.3u media interface> PHY 1 on miibus1
ukphy1: OUI 0x0002c6, model 0x0034, rev. 3
ukphy1:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow
vr1: bpf attached
vr1: Ethernet address: 00:0d:b9:36:c3:1d
vr2: <VIA VT6105M Rhine III 10/100BaseTX> port 0x1800-0x18ff mem 0xe0080000-0xe00800ff irq 15 at device 11.0 on pci0
vr2: Quirks: 0x2
vr2: Revision: 0x96
miibus2: <MII bus> on vr2
ukphy2: <Generic IEEE 802.3u media interface> PHY 1 on miibus2
ukphy2: OUI 0x0002c6, model 0x0034, rev. 3
ukphy2:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow
vr2: bpf attached
vr2: Ethernet address: 00:0d:b9:36:c3:1e
isab0: <PCI-ISA bridge> port 0x6000-0x6007,0x6100-0x61ff,0x6200-0x623f,0x9d00-0x9d7f,0x9c00-0x9c3f at device 15.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <AMD CS5536 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xff00-0xff0f at device 15.2 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
ohci0: <OHCI (generic) USB controller> mem 0xefffe000-0xefffefff irq 12 at device 15.4 on pci0
usbus0 on ohci0
ohci0: usbpf: Attached
ehci0: <AMD CS5536 (Geode) USB 2.0 controller> mem 0xefffd000-0xefffdfff irq 12 at device 15.5 on pci0
usbus1: EHCI version 1.0
usbus1 on ehci0
ehci0: usbpf: Attached
cpu0
pnp_identify: Trying Read_Port at 203
pnp_identify: Trying Read_Port at 243
pnp_identify: Trying Read_Port at 283
pnp_identify: Trying Read_Port at 2c3
pnp_identify: Trying Read_Port at 303
pnp_identify: Trying Read_Port at 343
pnp_identify: Trying Read_Port at 383
pnp_identify: Trying Read_Port at 3c3
PNP Identify complete
isa_probe_children: disabling PnP devices
ata: ata0 already exists; skipping it
ata: ata1 already exists; skipping it
sc: sc0 already exists; skipping it
isa_probe_children: probing non-PnP devices
orm0: <ISA Option ROM> at iomem 0xe0000-0xea7ff pnpid ORM0000 on isa0
sc0 failed to probe on isa0
vga0 failed to probe on isa0
atkbdc0 failed to probe at port 0x60 on isa0
atrtc0: <AT realtime clock> at port 0x70 irq 8 on isa0
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
attimer0: <AT timer> at port 0x40 on isa0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
fdc0 failed to probe at port 0x3f0 irq 6 drq 2 on isa0
ppc0 failed to probe at irq 7 on isa0
uart0: <16550 or compatible> at port 0x3f8 irq 4 flags 0x10 on isa0
uart0: console (115200,n,8,1)
uart0: fast interrupt
uart0: PPS capture mode: DCD
uart1: <16550 or compatible> at port 0x2f8 irq 3 on isa0
uart1: fast interrupt
uart1: PPS capture mode: DCD
isa_probe_children: probing PnP devices
Device configuration finished.
Timecounter "TSC" frequency 498077420 Hz quality 800
Timecounters tick every 1.000 msec
vlan: initialized, using hash tables with chaining
lo0: bpf attached
stray irq7
crypto: <crypto device>
IPsec: Initialized Security Association Processing.
tcp_init: net.inet.tcp.tcbhashsize auto tuned to 2048
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 480Mbps High Speed USB v2.0
pflog0: bpf attached
ugen1.1: <AMD EHCI root HUB> at usbus1
uhub0 on usbus1
uhub0: <AMD EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
ugen0.1: <AMD OHCI root HUB> at usbus0
uhub1 on usbus0
uhub1: <AMD OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ata0: reset tp1 mask=03 ostat0=50 ostat1=00
ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00
ata0: stat1=0x00 err=0x01 lsb=0x00 msb=0x00
ata0: reset tp2 stat0=50 stat1=00 devices=0x1
Trying to mount root from ufs:/dev/ada0s1a [ro]...
ata1: reset tp1 mask=00 ostat0=ff ostat1=ff
Root mount waiting for: CAM usbus0 usbus1
ada0 at ata0 bus 0 scbus0 target 0 lun 0
ada0: <CF 2GB 20110221> ATA-7 device
ada0: Serial Number TSS50037130117092408
ada0: 100.000MB/s transfers (UDMA5, PIO 512bytes)
ada0: 1919MB (3931200 512 byte sectors)
GEOM: new disk ada0
pass0 at ata0 bus 0 scbus0 target 0 lun 0
pass0: <CF 2GB 20110221> ATA-7 device
pass0: Serial Number TSS50037130117092408
pass0: 100.000MB/s transfers (UDMA5, PIO 512bytes)
uhub1: 4 ports with 4 removable, self powered
Root mount waiting for: usbus1
uhub0: 4 ports with 4 removable, self powered
Root mount waiting for: usbus1
ugen1.2: <Sierra Wireless, Incorporated MC7700> at usbus1
u3g0 on uhub0
u3g0: <Sierra Wireless, Incorporated MC7700, class 0/0, rev 2.00/0.06, addr 2> on usbus1
u3g0: port 3 supports modem control
u3g0: port 4 supports modem control
u3g0: port 5 supports modem control
u3g0: Found 6 ports.
mountroot: waiting for device /dev/ada0s1a...
atrtc0: providing initial system time
start_init: trying /sbin/init
Starting file system checks:
/dev/ada0s1a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ada0s1a: clean, 362308 free (1844 frags, 45058 blocks, 0.1% fragmentation)
/dev/ada0s3: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/ada0s3: clean, 2829 free (21 frags, 351 blocks, 0.7% fragmentation)
/etc/rc: WARNING: hostid: unable to figure out a UUID from DMI data, generating a new one
Setting hostuuid: b9fd83f3-6c0e-11ec-8cdb-000db936c31c.
Setting hostid: 0xd68a03f8.
Mounting local filesystems:.
Setting hostname: kernpatch2.sentex.ca.
Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding entropy: dd: /boot/entropy: Read-only file system
.
ELF ldconfig path: /lib /usr/lib /usr/local/lib /usr/local/lib/ipsec /usr/local/lib/perl5/5.32/mach/CORE
/etc/rc: WARNING: $swapfile is obsolete.  Ignored.
lo0: link state changed to UP
vr0: link state changed to DOWN
vr1: link state changed to DOWN
vr2: link state changed to DOWN
Starting Network: lo0 vr0 vr1 vr2.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        ndvr0: link state changed to UP
6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8280b<RXCSUM,TXCSUM,VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:0d:b9:36:c3:1c
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
vr1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8280b<RXCSUM,TXCSUM,VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:0d:b9:36:c3:1d
        inet 192.168.241.129 netmask 0xffffff00 broadcast 192.168.241.255
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
vr2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8280b<RXCSUM,TXCSUM,VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:0d:b9:36:c3:1e
        inet 192.168.1.51 netmask 0xffffff00 broadcast 192.168.1.255
        media: Ethernet autoselect (none)
        status: no carrier
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
Starting dhclient.
DHCPDISCOVER on vr0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on vr0 to 255.255.255.255 port 67 interval 13
DHCPOFFER from 192.168.0.12
DHCPREQUEST on vr0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.12
arp: 00:0d:b9:20:f6:b4 is using my IP address 192.168.254.2 on vr0!
bound to 192.168.0.90 -- renewal in 1800 seconds.
Starting pflog.
pflog0: promiscuous mode enabled
add host 127.0.0.1: gateway lo0 fib 0: route already in table
2022-01-02T15:58:42.765039-05:00 kernpatch2.sentex.ca pflogd 556 - - [priv]: msg PRIV_OPEN_LOG received
Additional inet routing options: gateway=YES.
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Enabling pf.
Clearing /tmp (X related).
Creating and/or trimming log files.
Updating /var/run/os-release done.
Updating motd:.
Starting syslogd.
Mounting late filesystems:.
Starting inetd.
Configuring vt: blanktime.
Starting sendmail_submit.
Starting sendmail_msp_queue.
Starting cron.

Sun Jan  2 15:59:08 EST 2022

FreeBSD/i386 (kernpatch2.sentex.ca) (ttyu0)

login: 


0(kernpatch2)# sysctl -a kern.timecounter
kern.timecounter.tsc_shift: 1
kern.timecounter.invariant_tsc: 0
kern.timecounter.fast_gettime: 1
kern.timecounter.tick: 1
kern.timecounter.choice: TSC(800) i8254(0) dummy(-1000000)
kern.timecounter.hardware: TSC
kern.timecounter.alloweddeviation: 5
kern.timecounter.timehands_count: 2
kern.timecounter.stepwarnings: 0
kern.timecounter.tc.TSC.quality: 800
kern.timecounter.tc.TSC.frequency: 498077420
kern.timecounter.tc.TSC.counter: 168552419
kern.timecounter.tc.TSC.mask: 4294967295
kern.timecounter.tc.i8254.quality: 0
kern.timecounter.tc.i8254.frequency: 1193182
kern.timecounter.tc.i8254.counter: 47506
kern.timecounter.tc.i8254.mask: 65535
0(kernpatch2)#
Comment 13 commit-hook freebsd_committer freebsd_triage 2022-01-03 18:02:26 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=0e494a9e3fd86ef54899dcbe0268866629096c1e

commit 0e494a9e3fd86ef54899dcbe0268866629096c1e
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-01-03 15:14:41 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-01-03 18:00:50 +0000

    x86: Skip late calibration if our reference timer has low quality

    Some AMD Geode-based systems end up using the 8254 PIT to calibrate the
    TSC during late calibration, which doesn't work because that
    timecounter's mask (65535) is much smaller than its frequency (1193182).
    Moreover, early calibration is done against the 8254 timer anyway.

    Work around the problem by simply using early calibration results if no
    high-quality timecounters exist.

    PR:             260868
    Fixes:          22875f88799e ("x86: Implement deferred TSC calibration")
    Reported and tested by: mike@sentex.net, Stefan Hegnauer <stefan.hegnauer@gmx.ch>
    Reviewed by:    imp, kib
    MFC after:      3 days
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D33730

 sys/x86/x86/tsc.c | 7 +++++++
 1 file changed, 7 insertions(+)
Comment 14 commit-hook freebsd_committer freebsd_triage 2022-01-06 13:47:11 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=08161fd3b207105847bdd1dd8729ea4cbda6e537

commit 08161fd3b207105847bdd1dd8729ea4cbda6e537
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-01-03 15:14:41 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-01-06 13:46:33 +0000

    x86: Skip late calibration if our reference timer has low quality

    Some AMD Geode-based systems end up using the 8254 PIT to calibrate the
    TSC during late calibration, which doesn't work because that
    timecounter's mask (65535) is much smaller than its frequency (1193182).
    Moreover, early calibration is done against the 8254 timer anyway.

    Work around the problem by simply using early calibration results if no
    high-quality timecounters exist.

    PR:             260868
    Fixes:          22875f88799e ("x86: Implement deferred TSC calibration")
    Reported and tested by: mike@sentex.net, Stefan Hegnauer <stefan.hegnauer@gmx.ch>
    Reviewed by:    imp, kib
    Sponsored by:   The FreeBSD Foundation

    (cherry picked from commit 0e494a9e3fd86ef54899dcbe0268866629096c1e)

 sys/x86/x86/tsc.c | 7 +++++++
 1 file changed, 7 insertions(+)
Comment 15 Mark Johnston freebsd_committer freebsd_triage 2022-01-06 13:48:09 UTC
Thanks for the report and quick followups.