summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
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@
2015-06-25Re-enable memory above 256mb now that uvm_pmr_get1page() has been fixed.Jonathan Matthew
From Visa Hankala.
2015-06-25Properly deliver broadcast-like packets to the network stack.Martin Pieuchot
In bridge(4) speak, broadcast-like packets are Ethernet Multicast frames or Unicast for which the destination is unknown. It makes sense to not retransmit broadcast-like packets on the interface they were received but they still must be delivered to the network stack. Problem reported by and ok jasper@
2015-06-25No more NBRIDGE in the Ethernet layer. Fewer layer violation, say yeah!Martin Pieuchot
2015-06-25Move brige(4)'s output hook outside of ether_output().Martin Pieuchot
This fix some weird bridge(4) configurations involving pseudo-drivers stacked on top of interfaces in a bridge. Also simplifies the loop prevention logic to match bridge's input path. Instead of using a tag per port/bridge simply flag output mbufs to make sure only one copy per bridge go through bridge_output(). ok bluhm@, claudio@
2015-06-25Check for correct rdomain in if_output() rather than in ether_output().Martin Pieuchot
Not all drivers make use of ether_output() and there's no real reason to call it when no ARP resolution is needed. But in this case we still want to make sure we're sending packets in the correct rdomain. ok bluhm@, claudio@ as part of a larger diff.
2015-06-25Use a single event counter for IPIs like other archs do.Martin Pieuchot
Even if this counter is subject to trashing it is a simple solution and gives an proximation "good enough" of the number of IPIs on Quad CPUs machine. ok deraadt@
2015-06-25Reimplement the audio driver in a simpler way, removing unused/unusableAlexandre Ratchov
functionality. Same API and ABI except for the removed bits and no behaviour change for programs using libsndio. With help from armani@ and mpi@, thanks.
2015-06-25you need to include ddb/db_output.h so you know how to call db_printfDavid Gwynne
inside MP_LOCKDEBUG.
2015-06-25fix format string in MP_LOCKDEBUG codeDavid Gwynne