summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2017-05-19tweak the spllower asm so it is more straightforward.David Gwynne
this properly identifies the registers used as input and output operands to the code running in the trap handler, and passes them to the asm statement as such. this means we dont have to do an extra copy in the asm, or an extra clobber to keep the compiler away from the registers. it also lets gcc set up and use the input register nicely before it reaches the asm. ok kettenis@
2017-05-18Add a gap of 1MB between the stack and mmap spaces.Mark Kettenis
ok deraadt@, millert@, stefan@
2017-05-18Implement copyin32(9).Mark Kettenis
"your chicken scratches look fine to me" deraadt@
2017-05-18Grab the netlock in umb_state_task() and umb_decode_ip_configuration()Alexander Bluhm
when calling in_ioctl(). These ioctls modify the routing table, which is global. So they need the lock. Found with Zaur Molotnikov's static lock analyzer. OK gerhard@ mpi@
2017-05-18enable acpisbs on i386 for old MacBooksJoshua Stein
tested by Jan Stary
2017-05-18Merge the content of <netinet/tcpip.h> and <netinet6/tcpipv6.h> inMartin Pieuchot
<netinet/tcp_debug.h>. The IPv6 variant was always included and the IPv4 version is not present on all systems. Most of the offending ports are already fixed, thanks to sthen@!
2017-05-18The function name ip4_input() is confusing as it also handles IPv6Alexander Bluhm
packets. This is the IP in IP protocol input function, so call it ipip_input(). Rename the existing ipip_input() to ipip_input_gif() as it is the input function used by the gif interface. Pass the address family to make it consistent with pr_input. Use __func__ in debug print and panic messages. Move all ipip prototypes to the ip_ipip.h header file. OK dhill@ mpi@
2017-05-18Since copyin(9) already doeas access 32-bit quantities atomically, we canMark Kettenis
add copyin32(9) as a simple C wrapper around it. These wrappers do check alignment and return EFAULT if the userland pointer is misaligned. This is enough to guarantee that the access doesn't cross a cache line boundary which could make the access non-atomic. ok mpi@, visa@, tedu@
2017-05-18Add copyin32(9) prototype.Mark Kettenis
2017-05-18Fix a uvm fault in athn_clock_rate():Stefan Sperling
Don't deref an IEEE80211_CHAN_ANYC channel pointer. ok mpi@
2017-05-18Do not panic if we find ourself on the sleep queue while being SONPROC.Martin Pieuchot
If the rwlock passed to rwsleep(9) is contented, the CPU will call wakeup() between sleep_setup() and sleep_finish(). At this moment curproc is on the sleep queue but marked as SONPROC. Avoid panicing in this case. Problem reported by sthen@ ok kettenis@, visa@
2017-05-18AAPCS64 requires 16 byte stack alignment. Set the bits in the systemJonathan Gray
control register to enable alignment fault exceptions if the stack pointer is not correctly aligned when used as a base address in load or store instructions. drahn@ pointed out that FreeBSD made this change in svn rev 295270 and believes we should do the same.
2017-05-18Fix kernel build on armv7 and sh.Visa Hankala
Pointed out by deraadt@
2017-05-17Revert MI AES-XTS code back to T-tables amid poor performanceMike Belopuhov
Suffered by many, the revert tested by stsp@.
2017-05-17The large and nested GIF #ifdef in protosw made it hard to figureAlexander Bluhm
out what is going on. There were also some inconsistencies that seem to be oversights. Use more specific the #ifdefs. OK mpi@
2017-05-17Optimize multicast packet sending by using m_dup_pkt() instead ofRafael Zalamena
m_copym() for cloning packets. m_dup_pkt() creates a new mbuf with the whole packet content and also pre allocates the space for layer 2 headers (Ethernet/VLAN). ok mikeb@
2017-05-17Make IPL_MPSAFE effective on loongson.Visa Hankala
Testing help from fcambus@
2017-05-17Protect the global list of interfaces with the NET_LOCK().Martin Pieuchot
ok bluhm@
2017-05-17Remove useless splsoftnet().Martin Pieuchot
Outside of USB, no code is executed in a softnet interrupt context. So what's protecting NFS data structures is the KERNEL_LOCK(). But more importantly, since r1.114 of nfs_socket.c, the 'softnet' thread is no longer executing NFS code. ok visa@
2017-05-17Raise "uvm_map_entry_kmem_pool" IPL level to IPL_VM to prevent a deadlock.Martin Pieuchot
A deadlock can occur when the uvm_km_thread(), running without KERNEL_LOCK() is interrupted by and non-MPSAFE handler while holding the pool's mutex. At that moment if another CPU is holding the KERNEL_LOCK() and wants to grab the pool mutex, like in sys_kbind(), kaboom! This is a temporaty solution, a more generate approach regarding mutexes and un-KERNEL_LOCK()ed threads is beeing discussed. Deadlock reported by sthen@, ok kettenis@
2017-05-17regenJonathan Gray
2017-05-17add some devices from submitted dmesgsJonathan Gray
2017-05-16- percpu anchor stacksAlexandr Nedvedicky
we actually don't need to pre-allocate per_anchor_stack[], if we use a 'natural' recursion, when doing anchor tree traversal. O.K. mikeb@, mpi@
2017-05-16Implement copyin32(9).Mark Kettenis
ok mpi@, visa@
2017-05-16Using __aligned(8) to tag 'struct m_hdr' triggers warnings on landisk:Mark Kettenis
/usr/src/sys/dev/ic/re.c:1602: warning: ignoring alignment for stack allocated 'mh' So instead add explicit padding on ILP32 systems. ok deraadt@, mikeb@
2017-05-16use _mtx_init instead of __mtx_init inside mtx_init on !WITNESS kernelsDavid Gwynne
_mtx_init uses __MUTEX_IPL to wrap the ipl argument to __mtx_init. without this, mutexes were initted below the mp floor, which allowed deadlocks with the kernel lock to occur. reported by hrvoje popovski and pinpointed by mikeb@ tweaks from phessler@ ok mpi@ visa@
2017-05-16Sync three changes that were caught by IPv6 multicast routing review:Rafael Zalamena
* use a variable to allow disabling debugs on run-time * fix a potential memory leak on copyout() failure * don't just blindly use the first address provided by ifalist ok bluhm@
2017-05-16Make return values more meaningful by using errno instead of -1 or 1.Rafael Zalamena
ok bluhm@
2017-05-16Replace remaining splsoftassert(IPL_SOFTNET) by NET_ASSERT_LOCKED().Martin Pieuchot
ok visa@
2017-05-16Remove list member now that the global list is gone.Martin Pieuchot
2017-05-16Kill unused global list and protect global array by the NET_LOCK().Martin Pieuchot
ok bluhm@
2017-05-16Make the IPv6 multicast routing code use the OpenBSD routing tableRafael Zalamena
instead of implementing its own. This makes the IPv6 multicast routing code look more like the IPv4 version. ok bluhm@, mpi@
2017-05-16Let malloc() block when the caller of the add route function isRafael Zalamena
setsockopt(), otherwise use non-blocking malloc() for network stack calls. ok bluhm@
2017-05-16Call rtfree() after each use of routes and make sure the route is validRafael Zalamena
when finding one. Since rtfree() is being called and rt_llinfo being removed, add checks everywhere to make sure we are using a route that is not being removed. ok bluhm@
2017-05-16Remove references to /dev/soundN, which was removed last year.Alexandre Ratchov
From Jan Stary <hans at stare.cz>, thanks.
2017-05-16Tweak previous, s/int/unsigned/, since the format character is %u.YASUOKA Masahiko
2017-05-16Compare device pathes properly to find the booted disk.YASUOKA Masahiko
Work with and test by Michele Curti.
2017-05-16when allocating a new screen, only copy the current buffer contentsJoshua Stein
to it for visible screens (i.e., the console). initialize other virtual screens with just blank character cells. ok mpi
2017-05-15Add some SD/MMC controller-related clocks.Mark Kettenis
2017-05-15vioscsi: Fix allocation of segmentsStefan Fritsch
Port the logic to calculate the number of segments in virtqueue and dmamaps from vioblk. This fixes the virtqueue indirect descriptors being two entries too small the dmamaps being much larger than necessary. If the device does not support the required number of segments, refuse to use it.
2017-05-15Remove unused variable mobileip_softc_list.Alexander Bluhm
OK mpi@
2017-05-15Protect the gloal list of gre(4) interfaces by the NET_LOCK().Martin Pieuchot
ok bluhm@
2017-05-15if_input() doesn't need splnet().Martin Pieuchot
ok rzalamena@
2017-05-15so_splicelen needs to be protected by the socket lock. We are nowMartin Pieuchot
safe since we're always holding the KERNEL_LOCK() but we want to move away from that. Suggested by and ok bluhm@
2017-05-15bridge_ioctl() doesn't need to call splnet().Martin Pieuchot
All interface ioctl()s are executed with the NET_LOCK() held, which protects all soft states of the network stack. IPL_NET is only needed in drivers dealing with hardware and by extension the wireless stack.
2017-05-15Enable the NET_LOCK(), take 3.Martin Pieuchot
Recursions are still marked as XXXSMP. ok deraadt@, bluhm@
2017-05-15clang warns on unused static const variables. Remove one such unusedJonathan Gray
variable so the kernel will build on arm64 again.
2017-05-15Hook up FQ-CoDel to the tree and enable configuration in the pfctl(8)Mike Belopuhov
OK sthen, visa
2017-05-15Use splraise() rather than splsoftnet() which is going away.Martin Pieuchot
2017-05-15Replace remaining SPLUSBCHECK by a splsoftassert(IPL_SOFTUSB).Martin Pieuchot
USB is the last real user of IPL_SOFTNET.