summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2018-02-24Add bcmrng(4), a driver for the random number generator on the Raspberry Pi.Mark Kettenis
2018-02-24fix pastoMark Kettenis
2018-02-24Enable interrupts while running interrupt handlers like we do onJonathan Gray
agintc(4) and ampintc(4). ok kettenis@ patrick@
2018-02-24Declare ci_ipl volatile to prevent the compiler from optimizingVisa Hankala
or reordering accesses to the variable. Assume that the assembler preserves the correct sequence of instructions, which allows the removal of the explicit noreorder/reorder toggles from the C code. With ci_ipl being volatile, drop mips_sync() calls that follow the accesses of the variable. The sync is redundant as a compiler barrier. In addition, the MIPS64 CPU designs should not need the sync for pipeline or write buffer control. According to miod@, the use of the instruction is a carryover from code targeting early MIPS designs that lack tight integration with the cache and write buffer. Discussed with and testing help from miod@. Tested on CN5020, CN6120, CN7130, CN7360, Loongson 2F and 3A1000, R4400, R8000, R10000 and R16000.
2018-02-24Enable bcmtemp(4).Mark Kettenis
2018-02-24Add bcmtemp(4), a driver for the temperature sensor on the Raspberry Pi.Mark Kettenis
2018-02-24Make ncpusfound count the available processors even if they don't attach.Mark Kettenis
ok patrick@
2018-02-24when comparing nvgre entries, compare a with b, not a with itself.David Gwynne
2018-02-23Disable mailbox interrupts on all cores upon attach instead of enabling theMark Kettenis
mailbox 0 interrupt on all cores. Seems to make GENERIC.MP work on the rpi3.
2018-02-23Get rid of the cpu_on_fn hook and call the psci(4) functions directly insteadMark Kettenis
like we already do in the code that flushes the BTB. ok jsg@
2018-02-23Drop redundant bzero() calls. ses_ghash is allocated with M_ZERO, soVisa Hankala
it is unnecessary to zero the struct's fields right after allocation. OK mikeb@
2018-02-23regenDavid Gwynne
2018-02-23masanobu saitoh pointed out i had the wrong id for XXV710 SFP28 devsDavid Gwynne
2018-02-22Set the PG_G (global) bit on the special page table entries that are sharedPhilip Guenther
between the u-k and u+k tables, because they're actually in *all* tables. ok bluhm@ kettenis@ mlarkin@
2018-02-22The compile time assertion for cpu info did not work with gcc.Alexander Bluhm
Rephrase the condition in a way that both gcc and clang accept it. OK guenther@
2018-02-22The GNU assembler does not understand 1ULL, so replace the constantAlexander Bluhm
with 1. Then it compiles with gcc, sign and size do not matter here. OK mlarkin@
2018-02-22remove some debug code in nvgreDavid Gwynne
2018-02-22Always reallocate a new memory chunk when changing the gateway of aMartin Pieuchot
route entry. This makes sure we pass the correct size to free(9). Reproted by and ok dlg@
2018-02-22don't get in the way of setting the rdomain on gre(4)David Gwynne
2018-02-21implement nvgre(4) based on rfc7637 aka NVGREDavid Gwynne
NVGRE is short for Network Virtualization Using Generic Routing Encapsulation. it provides an overlay ethernet network with multiple ip peers, rather than a tunnel to a single peer like egre(4) provides. unlike egre the vnetid is mandantory and always 24 bits. it offers similar functionality to vxlan(4).
2018-02-21Mark VIA padlock as capable of dealing with ESNMike Belopuhov
There are no actual changes to the driver since the software crypto driver is called to handle authentication operations. This enabled padlock to be used when tunnels are setup with iked(8). Tested by and OK fcambus
2018-02-21Meltdown: implement user/kernel page table separation.Philip Guenther
On Intel CPUs which speculate past user/supervisor page permission checks, use a separate page table for userspace with only the minimum of kernel code and data required for the transitions to/from the kernel (still marked as supervisor-only, of course): - the IDT (RO) - three pages of kernel text in the .kutext section for interrupt, trap, and syscall trampoline code (RX) - one page of kernel data in the .kudata section for TLB flush IPIs (RW) - the lapic page (RW, uncachable) - per CPU: one page for the TSS+GDT (RO) and one page for trampoline stacks (RW) When a syscall, trap, or interrupt takes a CPU from userspace to kernel the trampoline code switches page tables, switches stacks to the thread's real kernel stack, then copies over the necessary bits from the trampoline stack. On return to userspace the opposite occurs: recreate the iretq frame on the trampoline stack, switch stack, switch page tables, and return to userspace. mlarkin@ implemented the pmap bits and did 90% of the debugging, diagnosing issues on MP in particular, and drove the final push to completion. Many rounds of testing by naddy@, sthen@, and others Thanks to Alex Wilson from Joyent for early discussions about trampolines and their data requirements. Per-CPU page layout mostly inspired by DragonFlyBSD. ok mlarkin@ deraadt@
2018-02-21Call socreate() before falloc() in sys_socket().Martin Pieuchot
This is similar to what we do in sys_socketpair() and will allow us to grab the KERNEL_LOCK() only after having created a socket. This time with correct non-blocking check. Tested by landry@, previous diff ok tedu@
2018-02-21if egre takes the packet, it's done, don't fall through to l3 processing.David Gwynne
2018-02-21whitespace fixesDavid Gwynne
2018-02-21match linux whitespace in ioctl listJonathan Gray
2018-02-20Add GENERIC.MP directory.Mark Kettenis
2018-02-20Add GENERIC.MP.Mark Kettenis
2018-02-20Release the secondary CPUs.Mark Kettenis
2018-02-20Make arm64 pmap (somewhat) mpsafe.Mark Kettenis
2018-02-20stop mixing bsd and c99 fixed width types and just use c99 types everywhereJonathan Gray
2018-02-20Convert key length from bits to bytesMike Belopuhov
Reported by Renaud Allard, fix tested by Renaud (i386) and fcambus@ (amd64). OK visa, fcambus
2018-02-20Make ddb's "show all locks" command show spinlocks in additionVisa Hankala
to sleeplocks. OK mpi@
2018-02-20Removing an RTF_CLONING route entry should not invalidate an RTF_CACHEDMartin Pieuchot
entry that has been cloned from a different RTF_CLONING route. Bug report & ok friehm@
2018-02-20Introduce enternewpgrp() & enterthispgrp(), from FreeBSD via guenther@.Martin Pieuchot
This code shuffling will ease the introduction of the proctree lock in sys_setsid() and sys_setpgid(). Extracted from a larger diff from guenther@, ok visa@
2018-02-20Set the chain_offset field (same as sgl_offset0, only in 16 byte units)Jonathan Matthew
in passthrough IO requests, which makes AEN processing work on SAS2208 controllers, and since AEN processing works now, enable it again. tested on SAS2208 (PERC H710P) and SAS3108 (PERC H730), SAS3.5 parts should work too. ok dlg@
2018-02-20cisco set the tos on their keepalive packets to ip precedenceDavid Gwynne
internet control, so we can too.
2018-02-20add support for vnetflowid.David Gwynne
when enabled, the 32bit key on gre a packet is split into a 24bit key and an 8 bit flow id. this allows better use of multipath links if the intermediate routers feed the gre key into their hashing algorithms. because gre can encapsulate pretty much anything, it can be non-trivial for a router to reach into a payload to harvest entropy for feeding into a hashing algorithm. having the endpoints do it and feed it into the gre header is a lot simpler. this allows interoperationg with cisco gre tunnels with key entropy enabled. this was tested against a csr1000v. also, this arrangement coincides with how nvgre works, so it paves the way for supporting that protocol. right now the driver relies on the flowid in mbufs to populate the packet field. this generally means that pf should be enabled to provide the flowid.
2018-02-20only allow root to use SIOCSVNETFLOWID.David Gwynne
2018-02-20add ioctls to toggle partitioning a vnetid into a netid and flowidDavid Gwynne
this maps to key entropy in cisco tunnel terminology, and will be used in gre and egre to interoperate with their tunnels.
2018-02-20add support for setting the tunnel df bit.David Gwynne
ok mpi@
2018-02-19Grab solock() inside soconnect2() instead of asserting for it to be held.Martin Pieuchot
ok millert@
2018-02-19Change some returns into gotos, will help keeping the unlocking pathMartin Pieuchot
simpler. No functional change. Extracted from a larger diff from guenther@, ok kettenis@
2018-02-19Add a default case to a usb_tap() switch statement which mpi@ says willJonathan Gray
never be called to convince compilers and static analysis tools a path that uses uninitialised memory does not exist. ok krw@ mpi@
2018-02-19Convert sparc64 to MI mutex.Martin Pieuchot
ok dlg@
2018-02-19Include <sys/mutex.h> directly instead of relying on other headers toMartin Pieuchot
include it.
2018-02-19Directly include sys/mplock.h when needed instead of depending onJonathan Gray
indirect inclusion. Fixes non-MULTIPROCESSOR WITNESS build. ok visa@ mpi@
2018-02-19Remove almost unused `flags' argument of suser().Martin Pieuchot
The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
2018-02-19tunneldf needs ifr_dfDavid Gwynne
2018-02-19support configuration of fragmentation of the tunnel trafficDavid Gwynne