summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-06-11vnode modificiations to support LOCKDOC tracinglockdoc-9.3-vfsMerlin Scholz
2023-06-02Add namecache_log to observed memoryMerlin Scholz
2023-06-01Fix v_interlock loggingMerlin Scholz
2023-05-31Fix logic errors in VFS subsys lockdoc memory logginlockdoc-9.3-vfs-0.2Merlin Scholz
2023-05-29Organize VFS loggingMerlin Scholz
2023-05-29Fix log_memory sizeof in VFS subsystemMerlin Scholz
2023-05-29Instruct vnode_impl alloc/deallocMerlin Scholz
2023-05-29Add file, line, func logging for memory allocs/freeslockdoc-9.3Merlin Scholz
2023-05-10Change asm logging to specify line -1 so that FAIL* doesn't replace it with NULLlockdoc-9.3-0.6Merlin Scholz
2023-05-01Fix incorrect IRQs for serial ports in the kernel configMerlin Scholz
2023-04-27Fix GENERIC build and add proper bootloader configMerlin Scholz
2023-04-27Fix wrong logged function name for asm calls and pointer sizeMerlin Scholz
2023-04-21Add tracing for interrupts/exceptionsMerlin Scholz
2023-04-19Code cleanup to prepare for proper interrupt handlingMerlin Scholz
2023-04-01Fix kmutexes in the same way we fixed rwlocks in the last commitlockdoc-9.3-0.5Merlin Scholz
2023-04-01Fix rwlock_exit logging order bugMerlin Scholz
2023-03-22Add IRQ tracingMerlin Scholz
2023-03-17Implement missing Mutex and RW logginglockdoc-9.3-0.4Merlin Scholz
2023-03-16Implement logging for rwlock_enter() and rwlock_exit(), move from do-while ↵Merlin Scholz
macros to dedicated functions to allow for return values.
2023-03-16Implement file and line logging for mutex locksMerlin Scholz
This commit implements proper file and line logging as a proof of concept for mutex locks. The previous versions only logged the location inside the mutex_enter function, which was useless. To get correct filenames, calls to mutex_enter (which usually go directly to ASM) are replaced through the macro defined in lockdoc.h. This logs the according information and passes on the function call to the old ASM code. Furthermore, some other things like apm.c or patch.c had to be modified, to keep the code compilable, even with this new replacement macro. Also, the old logging methods in lockdebug.h have been removed, since we can not get the proper file and line by going through there. This commit only implements these changes for mutex_enter, mutex_spin_enter, mutex_exit and mutex_spin_exit, and serves as a template for changes in the other lock functions and types.
2023-03-14Implement sending of LOCKDOC experiment information on startupMerlin Scholz
2023-03-08Fix broken wait-methods in lockdoc-testlockdoc-9.3-0.3Merlin Scholz
2023-03-01Implement stubbed out lockdoc functions; update lockdoc_event.hlockdoc-9.3-0.2Merlin Scholz
2023-02-28Remove tsleep timeout from lockdoc-test to adapt to the recent changes in ↵Merlin Scholz
the FreeBSD port
2023-02-27Ignore Carrier Detect on tty when runngin under LOCKDOC kernel to curcumvent ↵Merlin Scholz
Bochs's interesting implementation
2023-02-07Implement lockdoc_test kernel module; hook run-bench.sh in/etc/rc; add ↵lockdoc-9.3-0.1Merlin Scholz
network drivers to LOCKDOC config
2022-11-02Decouple LOCKDEBUG and LOCKDOC kernel flagsMerlin Scholz
2022-10-28First working lock logsMerlin Scholz
2022-10-27Undo previous log_lock functions only used for testingMerlin Scholz
2022-10-25Hook into lockdebug.hMerlin Scholz
2022-10-24Separate LOCKDEBUG and LOCKDOG kernel flagsMerlin Scholz
2022-10-24First proper lockdoc hooksMerlin Scholz
2022-10-19Fix memory padding by replacing char with enum in log_actionMerlin Scholz
2022-10-17Continue implementationMerlin Scholz
2022-10-17Port over code skeletonMerlin Scholz
2022-10-16Add sterilized LOCKDOC kernel configMerlin Scholz
2022-08-04Welcome to 9.3!martin
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1493):martin
sys/dev/usb/ucom.c: revision 1.129 ucom(4): Fix earlier mistake causing pipes not to be closed. In revision 1.123, mrg@ changed what he thought was a double-close, but was actually abort&close (as is appropriate) to just abort (which is not enough -- leaks the pipe). This restores the abort&close. The original `bug' was found by code inspection, whereas this bug was found by asserting in usb_subr.c that no pipes are open on device disconnection after detach; the asserts actually triggered with several ucom(4) devices, and no longer trigger with this change. XXX pullup-9
2022-08-03Tickets #1490 - #1495martin
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1495):martin
share/man/man4/tpm.4: revision 1.7 sys/dev/ic/tpm.c: revision 1.17 sys/dev/ic/tpmvar.h: revision 1.10 sys/dev/ic/tpm.c: revision 1.18 sys/dev/ic/tpm.c: revision 1.19 sys/dev/acpi/tpm_acpi.c: revision 1.14 sys/dev/ic/tpmreg.h: revision 1.10 sys/dev/ic/tpmreg.h: revision 1.11 sys/dev/ic/tpm.c: revision 1.21 sys/dev/ic/tpm.c: revision 1.22 sys/dev/ic/tpm.c: revision 1.23 sys/dev/ic/tpm.c: revision 1.24 sys/dev/ic/tpm.c: revision 1.25 sys/dev/ic/tpmreg.h: revision 1.7 sys/dev/ic/tpmreg.h: revision 1.8 sys/dev/ic/tpmreg.h: revision 1.9 sys/dev/ic/tpmvar.h: revision 1.8 sys/dev/ic/tpmvar.h: revision 1.9 dev/ic/tpm: Tidy up headers. - Add include guards. - Add necessary includes. - Sort includes. - Use _BYTE_ORDER, not BYTE_ORDER, for public header. dev/ic/tpm: Add missing line break in attach output. dev/ic/tpm: Take advantage of entropy source if available. If the tpm is deactivated, though, detach the entropy source so we don't continue to try polling it -- it can't be activated without a reboot anyway. Add note about enabling TPM and rnd(4) source. tpm(4): Handle TPM 2.0 random source too, and loop on short reads. Tested on ThinkPad T480. tpm(4): Preserve error if any on ending commands. This way we don't spuriously suppress an error, such as TPM_DEACTIVATED, in a loop where we rely on it. tpm@acpi: Require only one locality's worth of register space. We don't actually use the registers for the other localities, and some older TPMs only have the first locality exposed via ACPI. tpm(4): Fix disabling of rnd source if tpm is deactivated. Nothing prevents a second worker from being queued when the first one is about to do rnd_detach_source. Instead, just set a flag so future requests don't bother running a new thread; if there's a concurrent one that's already been scheduled on another CPU, well, too bad, we get a couple extra log messages but that's fine. A better way to do this would probably be to detect whether the tpm is deactivated at attach time, but that requires reading more of the tpm spec than I care to do when there are alternative ways to procrastinate like scrubbing the toilet. tpm(4): Fix suspend and rework I/O transaction lock. Use sc->sc_lock over individual I/O transactions, not open/close of the whole device. This way there is a bounded time before the tpm is unbusied even if userland is getting at it, so userland can't hold up suspend indefinitely. Of course, the tpm might be suspended and resumed in the middle of the user's session this way -- tough. This limits the response buffer to 1024 bytes -- which is already a bit hefty to have on the stack (but it's probably not very deep on the stack from userland so maybe not a big deal). If it turns out we need more, we can use kmem to allocate a buffer on the heap, with the caveat that it might fail. This is necessary so that suspend doesn't block indefinitely on uiomove in tpmread. tpm(4): Nix TPM_BE16/TPM_BE32. Just use sys/endian.h.
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1494):martin
external/cddl/osnet/sys/kern/kmem.c: revision 1.3 kmem_cache_create()'s "name" parameter can be on the stack, so make a copy of it rather than keeping a pointer to it.
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1492):martin
sys/dev/usb/ukbd.c: revision 1.154 ukbd(4): Wait for callouts and blinking to complete in detach. This detach routine (and whole driver) has got a lotta other problems, but let's fix 'em one at a time...
2022-08-03Apply patch, requested by riastradh in ticket #1491:martin
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h (apply patch) Fix newlines in i915 console messages
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1490):martin
sys/dev/acpi/thinkpad_acpi.c: revision 1.48 With the recent change of the EC address space handler, we no longer get an ACPI_INTEGER in host byte order but a byte sized buffer with little endian data. Extract only the low 8 bits from buffer to get the fan speed again.
2022-08-03Tickets #1484 - #1489martin
2022-08-03Apply patch, requested by riastradh in ticket #1487:martin
sys/compat/common/vfs_syscalls_20.c (apply patch) sys/compat: Memset zero before copyout. Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry.
2022-08-03Pull up following revision(s), all via patchmartin
(requested by riastradh in ticket #1487): sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168 sys/compat/sunos/sunos_misc.c: revision 1.177 sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52 sys/compat/common/kern_resource_43.c: revision 1.23 sys/compat/netbsd32/netbsd32_conv.h: revision 1.46 sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35 sys/compat/common/vfs_syscalls_12.c: revision 1.38 sys/compat/ultrix/ultrix_misc.c: revision 1.126 sys/compat/common/kern_sig_43.c: revision 1.37 sys/compat/linux/common/linux_mtio.c: revision 1.8 sys/compat/freebsd/freebsd_misc.c: revision 1.34 sys/compat/freebsd/freebsd_machdep.c: revision 1.5 sys/compat/linux/common/linux_olduname.c: revision 1.67 sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44 sys/compat/freebsd/freebsd_sched.c: revision 1.23 sys/compat/ossaudio/ossaudio.c: revision 1.84 sys/compat/sys/time_types.h: revision 1.6 sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51 sys/compat/common/ieee80211_20.c: revision 1.7 sys/compat/linux/common/linux_file.c: revision 1.119 sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34 sys/compat/netbsd32/netbsd32_wait.c: revision 1.25 sys/compat/linux32/common/linux32_time.c: revision 1.38 sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33 sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52 sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46 sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36 sys/compat/ultrix/ultrix_ioctl.c: revision 1.39 sys/compat/linux/common/linux_misc.c: revision 1.252 sys/compat/linux/common/linux_hdio.c: revision 1.19 sys/compat/sunos/sunos_ioctl.c: revision 1.71 sys/compat/linux/common/linux_sched.c: revision 1.79 sys/compat/common/kern_info_43.c: revision 1.40 sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20 sys/compat/linux/common/linux_socket.c: revision 1.153 sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60 sys/compat/common/vfs_syscalls_43.c: revision 1.68 sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25 sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9 sys/compat/common/kern_time_50.c: revision 1.37 sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42 sys/compat/linux/common/linux_cdrom.c: revision 1.28 sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43 sys/compat/common/kern_info_09.c: revision 1.22 sys/compat/linux32/common/linux32_resource.c: revision 1.12 sys/compat/linux/common/linux_oldolduname.c: revision 1.67 sys/compat/common/if_media_80.c: revision 1.4 sys/compat/linux/arch/alpha/linux_osf1.c: revision 1.5 sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8 sys/compat/linux32/common/linux32_signal.c: revision 1.21 sys/compat/common/kern_sig_13.c: revision 1.22 sys/compat/sunos32/sunos32_ioctl.c: revision 1.36 sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62 sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23 sys/compat/netbsd32/netbsd32_time.c: revision 1.56 sys/compat/linux/common/linux_signal.c: revision 1.84 sys/compat/netbsd32/netbsd32_signal.c: revision 1.52 sys/compat/sunos32/sunos32_misc.c: revision 1.85 sys/compat/linux/common/linux_time.c: revision 1.40 sys/compat/linux/common/linux_fdio.c: revision 1.14 sys/compat/common/vfs_syscalls_30.c: revision 1.43 sys/compat: Memset zero before copyout. Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry.
2022-08-03Pull up following revision(s), all via patchmartin
(requested by riastradh in ticket #1489): sys/compat/netbsd32/netbsd32_netbsd.c: revision 1.232 sys/compat/netbsd32/netbsd32_socket.c: revision 1.56 sys/compat/netbsd32/netbsd32_conv.h: revision 1.45 sys/compat/netbsd32/netbsd32_fs.c: revision 1.92 sys/compat/netbsd32/netbsd32.h: revision 1.137 The read/write/send/recv system calls return ssize_t because -1 is returned on error. Therefore we must restrict the lengths of any buffers to NETBSD32_SSIZE_MAX with compat32 to avoid garbage return values. Fixes ATF lib/libc/sys/t_write:write_err.
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1488):martin
sys/altq/altq_hfsc.c: revision 1.29 sys/altq/altq_priq.c: revision 1.27 sys/altq: Memset zero before copyout. Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry.
2022-08-03Pull up following revision(s) (requested by riastradh in ticket #1486):martin
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.7 compat_netbsd32: Copy out 32-bit version in nfssvc32_nsd_out.