summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2015-07-03Rename mtx_cpu to mtx_owner for consistency with the other platforms.Miod Vallat
2015-07-03Fix cast in atomic_swap_ptr()Miod Vallat
2015-07-03Correctly restore ipl in fpusave_proc() when we have to busy loop.Miod Vallat
2015-07-02most of the destinations for mbufs in ether_input are mpsafe except forDavid Gwynne
pipex and bridge. this puts KERNEL_LOCK/KERNEL_UNLOCK around the pipex chunk till we can give it some mp love. ok yasuoka@ mpi@
2015-07-02tweak MUTEX_ASSERT_LOCKED and MUTEX_ASSERT_UNLOCKED to only lookDavid Gwynne
at the owner. every other arch does it the same, so this is to reduce differences between our platforms. ok miod@
2015-07-02Make the i386 pmap (almost) mpsafe by protecting the pmap itself, the pvMark Kettenis
lists and the apte with a mutex. Rearrange some code to avoid sleeping/spinning with one of these locks held. This should make pmap_enter(9), pmap_remove(9) and pmap_page_protect(9) safe to use without holding the kernel lock. Unfortunately there still seems to be an issue that causes deadlocks under pressure. That shouldn't be an issue as long as uvm still calls the pmap functions with the kernel lock held. Hopefully committed this will help finding the last bugs. ok mlarkin@, deraadt@
2015-07-02Move back rdomain's check into ether_output() otherwise it triggersMartin Pieuchot
if a pseudo-interface is on a different rdomain than its parent. Sorry for the inconvenience, I hope you'll fly again with us. Regression reported by and ok semarie@, ok phessler@
2015-07-02Unify the check for up & running between all pseudo-drivers.Martin Pieuchot
2015-07-02By design if_input_process() needs to hold a reference on the receivingMartin Pieuchot
ifp in order to access its ifih handlers. So get rid of if_get() in the various ifih handlers we know the ifp is live at this point. ok dlg@
2015-07-02copy MUTEX_ASSERT_LOCKED and MUTEX_ASSERT_UNLOCKED from alpha.David Gwynne
the previous asserts checked if the mutex was locked by any cpu or not when they should have been checking if the current cpu has the lock or not. found by miod after i enabled pool_gc again. ok miod@
2015-07-02introduce srp, which according to the manpage i wrote is short forDavid Gwynne
"shared reference pointers". srp allows concurrent access to a data structure by multiple cpus while avoiding interlocking cpu opcodes. it manages its own reference counts and the garbage collection of those data structure to avoid use after frees. internally srp is a twisted version of hazard pointers, which are a relative of RCU. jmatthew wrote the bulk of a hazard pointer implementation and changed bpf to use it to allow mpsafe access to bpfilters. however, at s2k15 we were trying to apply it to other data structures but the memory overhead of every hazard pointer would have blown out significantly in several uses cases. a bulk of our time at s2k15 was spent reworking hazard pointers into srp. this diff adds the srp api and adds the necessary metadata to struct cpuinfo on our MP architectures. srp on uniprocessor platforms has alternate code that is optimised because it knows there'll be no concurrent access to data by multiple cpus. srp is made available to the system via param.h, so it should be available everywhere in the kernel. the docs likely need improvement cos im too close to the implementation. ok mpi@
2015-06-30Get rid of the undocumented & temporary* m_copy() macro added forMartin Pieuchot
compatibility with 4.3BSD in September 1989. *Pick your own definition for "temporary". ok bluhm@, claudio@, dlg@
2015-06-30Rename if_output() into if_enqueue() to avoid confusion with commentsMartin Pieuchot
talking about (*ifp->if_output)(). ok claudio@, dlg@
2015-06-30Move the specialized m_copym2() preserving the alignment of the payloadMartin Pieuchot
after the Ethernet header in its own function and use it in bridge_input(). This should fix alignment issues kettenis@ is seeing. ok bluhm@, claudio@
2015-06-30Clean up a needless check in an if statement.Mike Larkin
ok kettenis@
2015-06-30Add "sd" to be specifiedit as "rootdev=" boot parameter.YASUOKA Masahiko
ok jmatthew
2015-06-29Hide ETHER_ALIGN mbuf adjustment under "#ifdef __STRICT_ALIGNMENT"Mike Belopuhov
for now to get jumbo frames working. oce(4) will need the same treatment as ix(4) when sparc64 support will be implemented. Tested by Pedro Caetano <pedrocaetano at binaryflows ! com>, thanks!
2015-06-29Clear root hub's "port link state".Martin Pieuchot
Allow to re-plug USB3 devices on the root hub withtout going through a suspend/resume cycle (or rebooting) with Intel ICH7 xHCI as found the hardway by sobrado@. Debugging help from M.A.R. Osorio, tested by sobrado@
2015-06-29Move the logic to handle a "connect status change" from uhub_explore()Martin Pieuchot
into its own functions. Needed for upcoming "port link state" change handling. Tested by sobrado@
2015-06-29Never cache a RTF_GATEWAY route as next hop for a gateway route.Martin Pieuchot
This prevents rtentry loops when rt->rt_gwroute points to rt leading to an infamous "rtentry leak" panic, easily triggered by dhclient(8) trying to remove a route after resuming a machine. This bug is at least 20 years old! 4.4BSD-Lite2 had a fix for it in its X.25 output routine but apparently it never made it into OpenBSD. ok claudio@
2015-06-29Add missing definition of "usb_interface_assoc_descriptor" needed to forMartin Pieuchot
a tool parsing device descriptors. Use the same name as DragonFly/FreeBSD since they export it to userland. From Ludovic Coues.
2015-06-29count if_ibytes in if_input like we do for if_ipackets.David Gwynne
tweaks and ok mpi@
2015-06-29dont double count if_ibytes here, it gets done by something insideDavid Gwynne
if_input. from and ok mpi@
2015-06-29enable vexpressJonathan Gray
2015-06-29Implement membar_* for armv7 with the dmb instruction. The previousJonathan Gray
sys/sys/atomic.h default of __sync_synchronize() resulted in "dmb sy", a full system barrier for all memory operations. With this change membar_producer() switches to "dmb st" (StoreStore). earlier version ok rapha@
2015-06-29Fix trap setup for double faults; error pointed out by Wei Liu a few monthsMike Larkin
ago and I forgot to commit this until now. From Wei Liu <wei.liu2 at citrix.com> ok mikeb@, guenther@, ratchov@
2015-06-29Remove some unused #definesMike Larkin
ok guenther@, millert@
2015-06-28Force the return to userspace from execve to go through iretq to get allPhilip Guenther
registers. This lets us kill the special handling of pid 1 in fork and merge {proc,child}_trampoline(). Do the same if ptrace(PT_SETREGS) is used to modify registers. ok mlarkin@ kettenis@
2015-06-28Read the lower 16-bits of the GCFGC "double word". Potentially fixes issuesMark Kettenis
with some modes on machines with the 915GM chipset. discussed with jsg@
2015-06-28enable octdwctwo and add umassJonathan Matthew
2015-06-28Convert list_head lists into TAILQs and LISTs and fix up header includesJonathan Matthew
so we can build dwc2 without extra stuff. tested by several edgerouter lite owners, ok jasper@
2015-06-28LDT is gone and not coming backPhilip Guenther
2015-06-28Split AST handling from trap() into ast() and get rid of T_ASTFLT.Philip Guenther
Don't skip the AST check when returning from *fork() in the child. Make sure to count interrupts even when they're deferred or stray. testing by krw@, and then many via snapshots
2015-06-28Split AST handling from trap() into ast() and get rid of T_ASTFLTPhilip Guenther
testing by krw@, and then many via snapshots
2015-06-27uvm_pmr_get1page() should return psize_t, not int; dhill@Miod Vallat
2015-06-27Pass bus_space tag and handles to the QE_{WR,RD}CR macros, instead of assumingMiod Vallat
there's an `sc' local variable. This allows us to no longer have to fake a softc at match time.
2015-06-27Memory leak in attach if uballoc() fails; Brainy/Maxime VillardMiod Vallat
2015-06-27MP_LOCKDEBUG code should only be compiled if MULTIPROCESSOR is definedDavid Gwynne
too.
2015-06-26Completely skip entries for disabled LAPICs so they don't overwritePhilip Guenther
legit enabled ones problem reported by Pedro Caetano (pedrocaetano (at) binaryflows.com) ok kettenis@
2015-06-26Add Linux completion API and use it.Mark Kettenis
ok jsg@
2015-06-26remove __cpu_cas and use atomic_cas_ulong instead.David Gwynne
ok mpi@
2015-06-26There is no excuse for using dma_alloc(9) when a bus_dma_tag_t is available.Mark Kettenis
deraadt@ thinks this isn't worth it, but reyk@ and mlarkin@ tested it anyway
2015-06-26rename the guard #define from _MACHINE_MPLOCK_H_ to _POWERPC_MPLOCK_H_David Gwynne
2015-06-26Revert previous. uvideo checks the transfered length of every frame andMartin Pieuchot
this break some devices. As found the hardway by Hugo Sastre via sobrado@
2015-06-26move the ppc mplock implementation from macppc to powerpc.David Gwynne
ok mpi@
2015-06-26Do not compare against a null string. When ofw_find_keyboard() is runMartin Pieuchot
hw_prod is not initialized. While here simply use "PowerBook" as model name, there's no "iBook" model in Apple device-trees. ok miod@ (who's cleaning one of his forests after 3 years)
2015-06-26Adapt to the removal of the symbolic input and output port names fromMiod Vallat
<sys/audioio.h>
2015-06-25Cards with revision < 10 (qemu rev is 0), have no ad1848 chip andAlexandre Ratchov
don't attach the ad1848 driver. But the "malloc" method of gus_hw_if is ad1848_malloc() which assumes a ad1848 is attached (and expect the softc pointer to be a struct ad1848_softc, but get a gus_softc pointer instead). Implement, the missing gus_{malloc,free,mappage,...} routines. Add the missing mtx_{enter,leave} calls, as we're at it. Found by mlarkin. ok mlarkin
2015-06-25Ensure the setup block is DMA reachable.Theo de Raadt
tested by reyk, mlarkin, others
2015-06-25OF_getprop() returns an int, so comparing its return value against sizeof castsMiod Vallat
it to unsigned, and we need to also check for negative values. All users of OF_getprop() did this but that one. ok mpi@