busdma - Remove filter functionality - Remove filtfunc and filtarg arguments from bus_dma_tag_create() and fix all callers. All callers use NULL today for both filterfunc and filterarg with one exception: if_jme. - Remove filter functionality internally and parent tag tracking. Without filter functions, we do not need to keep track of tag ancestry. All inheritance of the parent tag's parameters occurs when creating the new child tag. - rename run_filter() to addr_needs_bounce(). - FreeBSD keeps the filtfunc and filtarg arguments but requires them to be NULL. - Drop filterfunc usage from if_jme. In case of "JMC260 chip full mask revision 2", which has a hardware bug when it comes to DMA transfers crossing the 4 GB bounday, the parent buffer tag already limits DMA memory to 32bit address space. As such it should be safe to drop the filterfunc. The filterfunc was checking if the lower 32bits of the physical address used for DMA are all 0. In case of a 32bit address space, the only address where all lower 32-bits are all zero is 0 itself and I am here assuming that the physical address 0 is not used for DMA transfers! Mainly obtained from: FreeBSD (commits 7cb028de, 900907f4, 1228b93b, 3933ff56)
libkern: Remove karc4rand() in favor of karc4random_buf() The latter karc4random_buf()/arc4random_buf() sees more adoptions in other BSDs as well as the userland. So only reserve the latter and remove the former. Update the kernel code accordingly to use karc4random_buf() only.
kernel/pvscsi: Port pvscsi(4) over to DragonFly. * Currently, MSI-X support is missing. * If loaded as a module, it has to be in loader.conf. I don't know if that is different on FreeBSD. Reported-by: Georg Bege <georg@bege.email> Tested-by: Georg Bege <georg@bege.email> (on a VPS from IONOS) Pierre-Alain TORET <pierre-alain.toret@protonmail.com> (on Linux Workstation Pro 17) myself (on Windows Workstation 17 Player)
kernel - Rename vm_map_wire() and vm_map_unwire() * These names are mutant throwbacks to an earlier age and no longer mean what is implied. * Rename vm_map_wire() to vm_map_kernel_wiring(). This function can wire and unwire VM ranges in a vm_map under kernel control. Userland has no say. * Rename vm_map_unwire() to vm_map_user_wiring(). This function can wire and unwire VM ranges in a vm_map under user control. Userland can adjust the user wiring state for pages.
nvmm: Fix building nvmm into kernel * Remove 'DIAGNOSTIC' define from 'nvmm_os.h'. First, 'DIAGNOSTIC' and 'INVARIANTS' are different options. Secondly, 'DIAGNOSTIC' should be defined in kernel configs, e.g., LINT64 defines it. * Remove 'LOCORE' define from 'nvmm_x86_{svmfunc,vmxfunc}.S'. It's already defined on the command line, when compiling ASM source files with the kernel (i.e., building the module into the kernel). * Manually define 'LOCORE' for 'nvmm_x86_{svmfunc,vmxfunc}.o' compilation in the Makefile, fixing building as a standalone module. This fixes building nvmm into kernel, like LINT64. Thanks swildner for reporting the issue and helping with the fix.
nvmm: Fix comm page unmapping issue by doing it on userland side Previously, we're mapping and unmapping the comm page for userland process both on the kernel side. The unmapping was called at the point of closing the fd. However, the kernel may destroy process' vmspace before or after closing the fd, so there is no guarantee that kernel can get the correct address space to unmap the comm page for the userland process. Therefore, do the comm page unmapping on the userland side in libnvmm to fix the above issue. In addition, add the 'comm_size' member to 'struct nvmm_capability' to expose the comm page size to userland, which is required for the unmapping operation. This breaks ABI, so bump NVMM_KERN_VERSION. Update nvmmctl(8) accordingly to print the comm page size. This commit partially reverts: "nvmm: Add missing comm page unmapping"
nvmm: Add back NetBSD bits Bring back the NetBSD bits lost during the porting. One minor change is required: MODULE_CLASS_MISC -> MODULE_CLASS_DRIVER. Otherwise, loading nvmm.kmod would fail with error: module error: incompatible module class 1 for `nvmm' (wanted 3) Now the same code builds and works on NetBSD (of course, NetBSD requires a different set of Makefiles).
nvmm: Move DragonFly module code in nvmm.c to nvmm_dragonfly.c Move the OS-specific DragonFly module code in nvmm.c to nvmm_dragonfly.c, making nvmm.c source file more OS-independent. Adjust several static functions and variables for this purpose.
nvmm: Reorganize OS-specific code in nvmm_os.c Split the OS-specific code in 'nvmm_os.c' into two separate source files: nvmm_dragonfly.c and nvmm_netbsd.c, one for each supported OS. Update Makefile and sys/conf/files accordingly.