summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2017-02-08elf{32,64}_check_brand() isn't used; delete itPhilip Guenther
ok jca@
2017-02-08Provide size-generic ELF_NO_ADDR in <sys/exec_elf.h> and use that insteadPhilip Guenther
of ELFDEFNNAME(NO_ADDR) ok jca@
2017-02-08Use ELF_ST_{BIND,TYPE} instead of ELFDEFNNAME(ST_{BIND,TYPE})Philip Guenther
ok jca@
2017-02-08Retry BS->ExitBootServices() if it fails.YASUOKA Masahiko
Reported by Ryan, pulse.purge at gmail.com
2017-02-08Move a pointer deref to after a NULL test.Jonathan Gray
ok krw@
2017-02-08Test for NULL before dereferencing a pointer not after.Jonathan Gray
ok krw@
2017-02-08Remove an uneeded NULL test which was after a deref.Jonathan Gray
ok mpi@ henning@ sashan@
2017-02-07Since the instruction cache does not in any way snoop the data cachePatrick Wildt
we need to make sure to clean the data and invalidate the instruction cache upon entering a page with pmap_enter(). Since it is possible that pmap_enter() does not directly enter the page, we need to do the same dance in the pmap fault fixup code. Every new writeable mapping or write removes a page's flag to mark it unflushed. The next time pmap_enter() is called or a fault happens on that VA, it has to be flushed and invalidated again. This was heavily discussed with Dale Rahn. On the Pine64 and Raspberry Pi 3 we have been very lucky to not run into any cache issues, especially with the instruction cache. The AMD Seattle seems to be a different kind of beast where we actually have to care about these things. This finally brings the machine into userland.
2017-02-07Use percpu counters for icmpJonathan Matthew
ok dlg@ a while ago some input from jca@ who wrote the same diff
2017-02-07Error propagation does neither make sense for ip input path nor forAlexander Bluhm
asynchronous callbacks. Make the IPsec functions void, there is already a counter in the error path. OK mpi@
2017-02-07For consistency sake, apply the inner shareable attribute to the bootstrapPatrick Wildt
pagetables as well. Also replace the number for write-back with a proper define.
2017-02-07The default frequency we chose for the generic timer does not always ringPatrick Wildt
true. Instead, unless overwritten by the device tree, we should ask the generic timer for its frequency. This fixes time on my AMD Seattle and should improve time management on QEMU as well.
2017-02-07There are 1023 possible values for the interrupts, but our masks limitPatrick Wildt
these currently to 255. Thus making it impossible to use higher IRQs than that. The AMD Seattle SoC though seems to provide 448 IRQs, which is kind of out of bounds, so raise them to the proper values. This makes interrupts work on that machine.
2017-02-07IPsec packets could be dropped unaccounted if output after cryptoAlexander Bluhm
failed. Add a counter for that case. OK dhill@
2017-02-07Reduce the per-packet allocation costs for crypto operations (cryptop)Patrick Wildt
by pre-allocating two cryptodesc objects and storing them in an array instead of a linked list. If more than two cryptodesc objects are required use mallocarray to fetch them. Adapt the drivers to the new API. This change results in one pool-get per ESP packet instead of three. It also simplifies softraid crypto where more cryptodesc objects are allocated than used. From, with and ok markus@, ok bluhm@ "looks sane" mpi@
2017-02-07No longer need to unlock the netlock since the upper layer is doing it.Martin Pieuchot
Found by Hrvoje Popovski.
2017-02-07The return code of crp_callback is never checked, so it is notAlexander Bluhm
useful to propagate the error. When an error occurs in an asynchronous network path, incrementing a counter is the right thing. There are four places where an error is not accounted, just add a comment for now. OK mpi@ visa@
2017-02-07Enable the short slot time feature in 802.11n mode.Stefan Sperling
ok mpi@
2017-02-07Make the 'incomplete header' message debug onlyMike Belopuhov
2017-02-07Release the NET_LOCK() before entering per-driver ioctl() routine.Martin Pieuchot
This prevents a deadlock with the X server and some wireless drivers. The real fix is to take unix domain socket code out of the NET_LOCK(). Issue reported by pirofti@ and ajacoutot@ ok tb@, stsp@, pirofti@
2017-02-07pull struct mfi_evtarg_pd_state out of struct mfi_evt_detail.David Gwynne
this lets me pass the specific argument to an aen handler in mfii. it also unbreaks the tree. found by jmatthew@
2017-02-07enable per cpu caches on the mbuf pools.David Gwynne
this didnt make sense previously since the mbuf pools had item limits that meant the cpus had to coordinate via a single counter to make sure the limit wasnt exceeded. mbufs are now limited by how much memory can be allocated for pages from the system. individual pool items are no longer counted and therefore do not have to be coordinated. ok bluhm@ as part of a larger diff.
2017-02-07move the mbuf pools to m_pool_init and a single global memory limitDavid Gwynne
this replaces individual calls to pool_init, pool_set_constraints, and pool_sethardlimit with calls to m_pool_init. m_pool_init inits the mbuf pools with the mbuf pool allocator, and because of that doesnt set per pool limits. ok bluhm@ as part of a larger diff
2017-02-07add m_pool_init(), a wrapper around pool_init for mbuf clusters.David Gwynne
m_pool_init is basically a call to pool_init with everythign except the size and alignment specified, and a call to pool_set_constraints so the memroy is always dma reachable. it also wires up the memory with the custom mbuf pool allocator. ok bluhm@ as part of a larger diff
2017-02-07provide a custom pool page allocator for mbufs, but dont use it yet.David Gwynne
the custom allocator is basically a wrapper around the multi page pool allocator, but it has a single global memory limit managed by the wrapper. currently each of the mbuf pools has their own memory limit (or none in the case of the myx pool) independent of the other pools. this means each pool can allocate up to nmbclust worth of mbufs, rather than all of them sharing the one limit. wrapping the allocator like this means we can move to a single memory limit for all mbufs in the system. ok bluhm@ as part of a larger diff
2017-02-07export the multi page allocator so other things can explicitly use it.David Gwynne
2017-02-07Test for NULL before dereferencing a pointer not after.Jonathan Gray
2017-02-07handle physical disk state changes.David Gwynne
more specificially we probe the disk if it goes from UNCONFIGURED_GOOD to a SYSTEM disk, and detach it if goes from being a SYSTEM disk to anything else. this semantic comes from the lsi^Wavago code in the illumos mr_sas driver. seems to work fine. i think this covers all the ways a passthru disk can transition on these boards.
2017-02-07i got the MFII_TASK_MGMT flags round the wrong way.David Gwynne
2017-02-07support hotplug of physical disks.David Gwynne
this only handles MFI_EVT_PD_INSERTED_EXT and MFI_EVT_PD_REMOVED_EXT so far. if this code is to be reused in mfi, it should probably change to use MFI_EVT_PD_INSERTED and MFI_EVT_PD_REMOVED instead. unlike mpii and mpi, it looks like the firmware aborts outstanding commands against a disk when it's physically removed, so we dont have to explicitly abort them. this is probably a carry over from mfi generation boards which dont have an explicit abort command they can use.
2017-02-07add the framework around asynchronous event notifications.David Gwynne
this submits MR_DCMD_CTRL_EVENT_WAIT commands via the async dcmd path to read all events from boot onward, and eventually ends up waiting after the boot messages are consumed. right now none of the events are handled, but this can be added now this framework is in place. the board does generate human readable log messages for every event. we can send them somewhere (dmesg or syslog for example), but for now theyre masked by #if 0.
2017-02-07provide support for submitting async dcmd frames.David Gwynne
async dcmds are submitted via an mpii request (like the scsi commands are) which uses the ccb_request buffer, meaning that the dcmd itself has to go somewhere else. this reuses the sense buffer on the ccb for the dcmd, and provides wrappers for accessing that space and submitting a dcmd via the passthru command.
2017-02-07whitespace fixes. no functional change.David Gwynne
2017-02-06Add proper locking for the interrupt source listMike Belopuhov
Now that we can attach and detach devices, we need to make sure we can do so while interrupts are running. Thankfully, in the meantime the refcnt_init(9) API came around to help us out.
2017-02-06XST_POLL turned out to be pretty useless since it's only set when coldMike Belopuhov
2017-02-06Fixup a few errors, make detaching more robustMike Belopuhov
2017-02-06Use separate compile time debug flags for xen, xnf and xbfMike Belopuhov
2017-02-06Move cache and tlb flush functions, which were mostly inline assembly,Patrick Wildt
into separate functions. This makes them reusable from other parts in the kernel. Assembly and header are taken from FreeBSD, but modified to fit our requirements and with some unnecessary stuff removed. While there remove micro optimization for uniprocessor kernels.
2017-02-06Make ip6_input() more like ipv4_input() and introduce ip6_ours().Alexander Bluhm
OK mpi@
2017-02-06Mark ehci_intr() as MP-safe on octeon.Visa Hankala
OK mpi@
2017-02-06Sync a comment with i386.Martin Pieuchot
2017-02-06Implement Dynamic Profiling, a ddb(4) based & gprof compatible kernelMartin Pieuchot
profiling framework, for i386. Code patching is used to enable probes when entering functions. The probes will call a mcount()-like function to match the behavior of a GPROF kernel. A new sysctl knob, ddb.profile, need to be set to 1 in securelevel 0 to be able to use this feature. ok jasper@, guenther@, mlarkin@
2017-02-06Change the pmap_pmap_pool ipl from IPL_VM to IPL_NONE. Matches theJonathan Gray
other archs. ok patrick@
2017-02-06implement scsi command timeouts.David Gwynne
there's a struct timeout in scsi_xfer for this purpose, which is used to schedule a timeout of the command in the future. the timeout adds the xs to a list in mfii_softc of outstanding commands that are to be aborted. this list is processed in a task so we can sleep for an mfii_ccb. the new ccb is used to issue an abort against the specific command that timed out. to avoid having a timeout complete at the same time as a command on the chip, a refcnt is added to ccbs. the chip and the timeout get a ref each. the mfii completion path will attempt to timeout_del, and if that's succesful it will subtract the timeouts ref as well as its own. if it fails, the abort path owns the ccb and becomes responsible for calling scsi_done on behalf of the mfii completion path.
2017-02-06megaraid sas fusion chips have their own command for aborting tasksDavid Gwynne
2017-02-06patrick@ tells me this is mostly mine tooDavid Gwynne
2017-02-06add a license for the code in here, all of which i seem to have written.David Gwynne
this has been pointed out to me by a couple of people now.
2017-02-06When determining whether or not to hatch into PAE mode, use the cpu_paeMike Larkin
flag variable instead of checking some pointer assignment made earlier in pae_bootstrap. ok guenther
2017-02-05Since we expect to never do binary compat with other OSes again,Philip Guenther
delete the no-longer-used probe hook support. ok mpi@ jca@
2017-02-05Always allocate counters memory using type M_COUNTERS.Jeremie Courreges-Anglas
This makes the API simpler, and is probably more useful than spreading counters memory other several types, making it harder to track. Prodded by mpi, ok mpi@ stsp@