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
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)
show more ...
kernel: Rename BUILDING_WITH_KERNEL to KERNBUILDDIR.Fits better with e.g. KERNCONFDIR.Add a small paragraph in kmod.mk which was taken from FreeBSD.
kernel - Rejigger random number generator to be per-cpu 1/2* Refactor all the kernel random number generation code to operate on a per-cpu basis. The csprng, ibaa, and l15 structures are now p
kernel - Rejigger random number generator to be per-cpu 1/2* Refactor all the kernel random number generation code to operate on a per-cpu basis. The csprng, ibaa, and l15 structures are now per-cpu.* RDRAND now runs a periodic timer callback on all available cpus rather than just on cpu 0, allowing rdrand data to mix on each cpu's rng independently.* The nrandom helper thread now chains state with an iteration between cpus, injecting a random data buffer generated from the previous cpu into the mix of the current.
kernel - Optimize bcopy, bzero, memset* Use __builtin_memset() for bzero() and __builtin_memmove() for bcopy(). - Must use _bcopy in a few places where GCC complains about structural punni
kernel - Optimize bcopy, bzero, memset* Use __builtin_memset() for bzero() and __builtin_memmove() for bcopy(). - Must use _bcopy in a few places where GCC complains about structural punning. Even casting doesn't help. - GCC's __builtin_memset() and __builtin_memmove() has a side effect where it assumes that the pointer arguments cannot be NULL. In fact, they can be NULL when the byte count is 0. This assumption by GCC causes later unrelated conditionals on the pointers against NULL to be improperly optimized-out. We had to fix one place where this blew the system up.* Implement memset() in assembly (remove from libkern).* Implement memmove() in assembly (remove from libkern).
build - Rewire secure, remove conflicts from libmd, libcrypt* Remove /usr/src/secure, folding all of its subsystems into /usr/src. There's no point having a /usr/src/secure any more, the syste
build - Rewire secure, remove conflicts from libmd, libcrypt* Remove /usr/src/secure, folding all of its subsystems into /usr/src. There's no point having a /usr/src/secure any more, the system won't run without the secure stuff, the idea that some foreign actor could segregate it in order to legally download code without crypto is absurd on the modern internet, and the U.S. government stopped caring decades ago.* Remove conflicts from libmd and libcrypt. Essentially this removes the SHA*_*() and MD5_*() APIs from libmd because these APIs already exist in lib[re]ssl. The older SHA*() and MD5*() APIs are partially retained for legacy base code, but will be removed in a later stage (moved to direct-linking the needed support source). Conflicting routines in libcrypt have been renamed and internalized to be libcrypt-only.* Major rewiring of the Makefile's to support the changes.
kernel: Move us to using M_NOWAIT and M_WAITOK for mbuf functions.The main reason is that our having to use the MB_WAIT and MB_DONTWAITflags was a recurring issue when porting drivers from FreeBSD
kernel: Move us to using M_NOWAIT and M_WAITOK for mbuf functions.The main reason is that our having to use the MB_WAIT and MB_DONTWAITflags was a recurring issue when porting drivers from FreeBSD becauseit tended to get forgotten and the code would compile anyway with thewrong constants. And since MB_WAIT and MB_DONTWAIT ended up as ocflagsfor an objcache_get() or objcache_reclaimlist call (which use M_WAITOKand M_NOWAIT), it was just one big converting back and forth with somesanitization in between.This commit allows M_* again for the mbuf functions and keeps thesanitizing as it was before: when M_WAITOK is among the passed flags,objcache functions will be called with M_WAITOK and when it is absent,they will be called with M_NOWAIT. All other flags are scrubbed by theMB_OCFLAG() macro which does the same as the former MBTOM().Approved-by: dillon
kern_nrandom, rnd drivers: update for new CSPRNG * Identify each source of entropy with an identifier, so that for example the Fortuna CSPRNG can manage the pool index for each source. * Ad
kern_nrandom, rnd drivers: update for new CSPRNG * Identify each source of entropy with an identifier, so that for example the Fortuna CSPRNG can manage the pool index for each source. * Add a new sysctl, kern.rand_mode, which can be used to select which generator is used for /dev/random; valid values are: - csprng (to use only the Fortuna-based CSPRNG) - ibaa (to use only IBAA) - mixed (to XOR both csprng and ibaa in the output stream It defaults to "mixed".
kernel - Use add_buffer_randomness()* Use add_buffer_randomness() instead of add_true_randomness(). It will do a better job on the char array and also does a quick IBAA mix when it is through
kernel - Use add_buffer_randomness()* Use add_buffer_randomness() instead of add_true_randomness(). It will do a better job on the char array and also does a quick IBAA mix when it is through adding the buffer.
kernel: Use DEVMETHOD_END in the drivers.
kernel: Remove newlines from the panic messages that have one.panic() itself will add a newline.
kernel: Use ${.TARGET} in module Makefiles.
kernel: Remove opt_bus.h references where they are not needed.It only defines BUS_DEBUG (if set) and BUS_DEBUG is only used insubr_bus.c, so it doesn't need to be included anywhere else.
ubsec - Fix & update * Fix ubsec(4) to work with our updated opencrypto. The main problem was that the argument to newsession, freesession, process and kprocess changed from an arbitrary arg
ubsec - Fix & update * Fix ubsec(4) to work with our updated opencrypto. The main problem was that the argument to newsession, freesession, process and kprocess changed from an arbitrary arg (set to softc) to a device_t. * Update bits and pieces from FreeBSD, such as cleaning up the code a bit and adding support for bcm5825.Tested with a BCM5821 PCI-x card.
kernel: Use NULL for DRIVER_MODULE()'s evh & arg (which are pointers).This is just cosmetics for easier reading.
Fix LINT build.
kernel: Fix some printf format warnings on x86_64.
Remove useless .PATH targets from kernel module Makefiles.All these came in from FreeBSD which keeps their module Makefiles insys/modules (that is, separate from the source). We don't, so they are
Remove useless .PATH targets from kernel module Makefiles.All these came in from FreeBSD which keeps their module Makefiles insys/modules (that is, separate from the source). We don't, so they arenot needed.
ubsec(4): Silence some 'unused variable' warnings.
opencrypto - Finish porting* Fix all remaining porting issues from the original opencrypto WIP commit.* Remove clashes due to rebase.
WIP crypto/opencrypto update
AMD64 - Fix format conversions and other warnings.
Sync sys/queue.h with FreeBSD:* Introduce REMOVE_NEXT() macro's for SLIST and STAILQ.* Add sanity checking for QUEUE(3) TAILQs and LISTs underINVARIANTS. Races may lead to list corruption, whic
Sync sys/queue.h with FreeBSD:* Introduce REMOVE_NEXT() macro's for SLIST and STAILQ.* Add sanity checking for QUEUE(3) TAILQs and LISTs underINVARIANTS. Races may lead to list corruption, which can bedifficult to unravel in a post-mortem analysis. These checks verifythat the prev and next pointers are consistent when inserting orremoving elements, thus catching any corruption earlier.* Use TRASHIT to break LIST and SLIST link pointers on element removal.* Add more _FOREACH_MUTABLEs. Note: FreeBSD and NetBSD call these _SAFE,but _MUTABLE is a better name, so that's what we're using.* Add a macro for SLIST traversal 'SLIST_FOREACH_PREVPTR',this macro keeps a pointer to the previous element's nextpointer to allow for search and O(1) removal.* Remove CIRCLEQs and replace them with TAILQs.
Rename printf -> kprintf in sys/ and add some defines where necessary(files which are used in userland, too).
Do a major clean-up of the BUSDMA architecture. A large number ofessentially machine-independant drivers use the structures and definitionsin machine-dependant directories that are really machine-
Do a major clean-up of the BUSDMA architecture. A large number ofessentially machine-independant drivers use the structures and definitionsin machine-dependant directories that are really machine-independant innature.Split <machine/bus_dma.h> into machine-depdendant and machine-independant partsand make the primary access run through <sys/bus_dma.h>.Remove <machine/bus.h>, <machine/bus_memio.h> and <machine/bus_pio.h>. Theoptimizations related to bus_memio.h and bus_pio.h made a huge mess,introduced machine-specific knowledge into essentially machine-independantdrivers, and required specific #include file orderings to do their job.They may be reintroduced in some other form later on.Move <machine/resource.h> to <sys/bus_resource.h>. The contents of the fileis machine-independant or can be made a superset across many platforms.Make <sys/bus.h> include <sys/bus_dma.h> and <sys/bus_resource.h> andinclude <sys/bus.h> where necessary. Remove all #include's of<machine/resource.h> and <machine/bus.h>. That is, make the BUSDMAinfrastructure integral to I/O-mapped and memory-mapped accesses to devicesand remove a large chunk of machine-specific dependancies from drivers.bus_if.h and device_if.h are now required to be present when using <sys/bus.h>.
Rename malloc->kmalloc, free->kfree, and realloc->krealloc. Pass 2
12