summaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271982-159/+4089
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* rw: fix runlock_hard when new readers show upMateusz Guzik2017-11-261-0/+5
| | | | | | | | | | | | | When waiters/writer spinner flags are set no new readers can show up unless they already have a different rw rock read locked. The change in r326195 failed to take that into account - in presence of new readers it would spin until they all drain, which would be lead to trouble if e.g. they go off cpu and can get scheduled because of this thread. Reported by: pho Notes: svn path=/head/; revision=326237
* Synchronize TLB1 mappings when createdJustin Hibbits2017-11-261-18/+47
| | | | | | | | | | | This allows modules creating mappings to be loaded post-boot, after SMP has started. Without this, the TLB1 mappings can become unsynchronized and lead to kernel page faults when accessed on the alternate CPUs. MFC after: 3 weeks Notes: svn path=/head/; revision=326236
* Move vm_phys_init_page() to vm_page.c.Mark Johnston2017-11-263-29/+28
| | | | | | | | | | Suggested by: kib Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13250 Notes: svn path=/head/; revision=326235
* Remove unneeded initializations from vm_phys_init_page().Mark Johnston2017-11-261-1/+1
| | | | | | | | | | | The page allocator always initializes the aflags and oflags fields. Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13242 Notes: svn path=/head/; revision=326234
* Add to ipfw support for sending an SCTP packet containing an ABORT chunk.Michael Tuexen2017-11-263-5/+269
| | | | | | | | | | | | | | | | This is similar to the TCP case. where a TCP RST segment can be sent. There is one limitation: When sending an ABORT in response to an incoming packet, it should be tested if there is no ABORT chunk in the received packet. Currently, it is only checked if the first chunk is an ABORT chunk to avoid parsing the whole packet, which could result in a DOS attack. Thanks to Timo Voelker for helping me to test this patch. Reviewed by: bcr@ (man page part), ae@ (generic, non-SCTP part) Differential Revision: https://reviews.freebsd.org/D13239 Notes: svn path=/head/; revision=326233
* Add a Saved Process Status Register bit for AArch32 execution mode.Ed Schouten2017-11-262-3/+3
| | | | | | | | | | | | | | | | | | The documentation on the Saved Process Status Register (SPSR) is a bit weird; the M[4] bit is documented separately from M[3:0]. The M[4] bit can be toggled to switch to 32-bit execution mode. This functionality is orthogonal to M[3:0]. Change the definition of PSR_M_MASK to no longer include M[4]. Add a new definition, PSR_AARCH32 that can be used to toggle 32-bit independently. This bit will be used by the cloudabi32 code to force execution of userspace code in 32-bit mode. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D13148 Notes: svn path=/head/; revision=326230
* Correct some more places where TO_PTR() should be used.Ed Schouten2017-11-262-2/+2
| | | | | | | | | These were missed in r326228. MFC after: 2 weeks Notes: svn path=/head/; revision=326229
* Use TO_PTR() to convert integers to pointers.Ed Schouten2017-11-265-6/+6
| | | | | | | | | | | For FreeBSD/arm64's cloudabi32 support, I'm going to need a TO_PTR() in this place. Also use it for all of the other source files, so that the difference remains as minimal as possible. MFC after: 2 weeks Notes: svn path=/head/; revision=326228
* Make 32-bit system calls end up in svc_handler().Ed Schouten2017-11-263-5/+7
| | | | | | | | | | | | | | The nice thing about ARM64 is that it's pretty elegant to install separate trap/exception handlers for 32-bit and 64-bit processes. That said, for all other architectures (e.g., i386 on amd64) we always let 32-bit counterparts go through the regular system call codepath. Let's do the same on ARM64. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D13146 Notes: svn path=/head/; revision=326227
* Make the arm64 pmap_invalidate functions static inline. This fixes buildingAndrew Turner2017-11-261-3/+3
| | | | | | | | | | | with DIAGNOSTIC. PR: 223874 Reported by: emaste MFC after: 1 week Notes: svn path=/head/; revision=326225
* Remove another extern int n_slbs made redundant by declaring this inNathan Whitehorn2017-11-261-2/+0
| | | | | | | | | mmu_oea64.h. MFC after: 3 weeks Notes: svn path=/head/; revision=326222
* Use the cookie now set by loader to determine whether the value passed toNathan Whitehorn2017-11-264-8/+25
| | | | | | | | | | | | | | | | PowerPC kernels in r6 is actually metadata from loader(8) or gibberish left in r6, which is not required to be anything under the PAPR/ePAPR/CHRP/OF standards, by another boot loader. Note that, as a result, systems need a new boot loader to boot PPC kernels after this revision without ending up at a mountroot prompt. New boot loaders are backwards compatible and can boot older kernels. Reviewed by: jhibbits MFC after: 2 months Notes: svn path=/head/; revision=326220
* Remove some, but not all, assumptions that the BSP is CPU 0 and that CPUsNathan Whitehorn2017-11-256-10/+25
| | | | | | | | | are numbered densely from there to n_cpus. MFC after: 1 month Notes: svn path=/head/; revision=326218
* Avoid assumptions about the BSP being CPU 0.Nathan Whitehorn2017-11-252-33/+33
| | | | | | | MFC after: 3 weeks Notes: svn path=/head/; revision=326217
* On AIM systems, it is not actually possible to stop the CPU timer, so weNathan Whitehorn2017-11-251-0/+3
| | | | | | | | | | | just set it to a large default value (and inherit any previously existing value), hoping it never turns over. Instead, silently allow spurious one-shots from rollovers. MFC after: 10 days Notes: svn path=/head/; revision=326216
* Return base IRQ of PIC when added and massively increase the number ofNathan Whitehorn2017-11-252-4/+6
| | | | | | | | | available IRQs per PIC for large systems. MFC after: 3 weeks Notes: svn path=/head/; revision=326215
* Missed gate on __powerpc64__ for setting LPCR in r326207.Nathan Whitehorn2017-11-251-0/+2
| | | | | | | | MFC after: 3 weeks X-MFC-with: r326207 Notes: svn path=/head/; revision=326214
* When booting from an FDT, make sure the FDT itself isn't included the rangeNathan Whitehorn2017-11-251-2/+13
| | | | | | | | | | of available memory. Boot loaders are supposed to add a reserved entry for it, but not all do. MFC after: 2 weeks Notes: svn path=/head/; revision=326213
* Allow platform modules to set the size of large pizes, as potentiallyNathan Whitehorn2017-11-251-5/+7
| | | | | | | | | | discovered from firmware, and better handle highly-discontiguous memory and CPU maps. MFC after: 3 weeks Notes: svn path=/head/; revision=326212
* Invalidate TLB at boot using the correct IS settings on newer-than-POWER5Nathan Whitehorn2017-11-251-2/+16
| | | | | | | | | CPUs. MFC after: 3 weeks Notes: svn path=/head/; revision=326211
* Definitions for registers and trap types found on new POWER CPUs.Nathan Whitehorn2017-11-252-0/+6
| | | | | | | MFC after: 3 weeks Notes: svn path=/head/; revision=326210
* Missed platform_smp_timebase_sync() in r326205.Nathan Whitehorn2017-11-251-1/+1
| | | | | | | | MFC after: 3 weeks X-MFC-With: r326205 Notes: svn path=/head/; revision=326209
* Make n_slbs public in a more straightforward way. Some platforms (likeNathan Whitehorn2017-11-252-1/+2
| | | | | | | | | | PowerNV) use firmware-assisted mechanisms to discover it and need access to the variable. MFC after: 3 weeks Notes: svn path=/head/; revision=326208
* Preserve the LPCR on new-ish (POWER7 and POWER8) CPUs, preventing exceptionsNathan Whitehorn2017-11-251-0/+7
| | | | | | | | | | | and such from ending on the wrong CPU on SMP systems. It would be good to have this be more generic somehow as POWER9s appear, but PPC does not have features bits, unfortunately. MFC after: 3 weeks Notes: svn path=/head/; revision=326207
* Yield while spinning on APs and avoid announcing all CPUs unless bootverboseNathan Whitehorn2017-11-251-1/+5
| | | | | | | | | | is set. These improve startup performance on massively multithreaded systems with 8-way SMT and dozens to hundreds of CPUs. MFC after: 3 weeks Notes: svn path=/head/; revision=326206
* Whether you can use mttb() or not is more complicated than whether PSL_HVNathan Whitehorn2017-11-257-23/+43
| | | | | | | | | | | is set and the right thing to do may be platform-dependent (it requires firmware on PowerNV, for instance). Make it a new platform method called platform_smp_timebase_sync(). MFC after: 3 weeks Notes: svn path=/head/; revision=326205
* Do not bind to CPUs with SMT, which use a different CPU numbering conventionNathan Whitehorn2017-11-251-0/+4
| | | | | | | | | that does not play well with this driver. MFC after: 2 weeks Notes: svn path=/head/; revision=326204
* Avoid emitting a PT_INTERP section for powerpc64 kernels and arrange forNathan Whitehorn2017-11-251-2/+5
| | | | | | | | | | the first instruction to be at the start of the text segment. This allows the kernel to be booted correctly by stock kexec-lite. MFC after: 2 weeks Notes: svn path=/head/; revision=326203
* Automatically use the ELFv2 ABI on powerpc64 if supported by the compiler.Nathan Whitehorn2017-11-251-1/+7
| | | | | | | | | | This has the same effects on DDB working as -mcall=aixdesc, but also is supported by clang and marginally improves kernel performance. MFC after: 2 weeks Notes: svn path=/head/; revision=326202
* Add the missing lockstat check for thread lock.Mateusz Guzik2017-11-251-0/+7
| | | | Notes: svn path=/head/; revision=326200
* Convert in-kernel thread_lock_flags calls to thread_lock when debug is disabledMateusz Guzik2017-11-251-0/+6
| | | | | | | The flags argument is not used in this case. Notes: svn path=/head/; revision=326199
* rwlock: fix up compilation of the previous changeMateusz Guzik2017-11-251-2/+2
| | | | | | | commmitted wrong version of the patch Notes: svn path=/head/; revision=326198
* rwlock: add __rw_try_{r,w}lock_intMateusz Guzik2017-11-251-8/+20
| | | | Notes: svn path=/head/; revision=326197
* sx: change sunlock to wake waiters up if it locked sleepqMateusz Guzik2017-11-251-19/+20
| | | | | | | | | | | sleepq is only locked if the curhtread is the last reader. By the time the lock gets acquired new ones could have arrived. The previous code would unlock and loop back. This results spurious relocking of sleepq. This is a step towards xadd-based unlock routine. Notes: svn path=/head/; revision=326196
* locks: retry turnstile/sleepq loops on failed cmpsetMateusz Guzik2017-11-252-44/+29
| | | | | | | | | | In order to go to sleep threads set waiter flags, but that can spuriously fail e.g. when a new reader arrives. Instead of unlocking everything and looping back, re-evaluate the new state while still holding the lock necessary to go to sleep. Notes: svn path=/head/; revision=326195
* rwlock: stop re-reading the owner when going to sleepMateusz Guzik2017-11-251-8/+11
| | | | Notes: svn path=/head/; revision=326194
* Allwinner a83t: enable USB supportKyle Evans2017-11-251-1/+10
| | | | | | | | | | | | | Originally a patch by Mark Millard, augmented with information from work done on NetBSD by jmcneill@. Submitted by: Mark Millard (markmi@dsl-only.net) Reviewed by: emaste, manu Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D13240 Notes: svn path=/head/; revision=326191
* Add r-ccu support for the Allwinner a83tKyle Evans2017-11-254-23/+37
| | | | | | | | | | | | | | The r-ccu on the a83t differs from the others only by what it names the ar100 parents. Export the _CCU macros (now converted to an enu) so that ccu_sun8i_r can differentiate between a83t r-ccu and the others, then add the compat string for the a83t r-ccu. Reviewed by: manu Approved by: emaste (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D13206 Notes: svn path=/head/; revision=326190
* Slightly fix bidirectional stream number allocation.Alexander Motin2017-11-251-2/+2
| | | | | | | | | | | | This logic is still imperfect, since it allows at most 15 bidirectional streams out of 30 allowed by specification, but at least now those should work better. On the other side I don't remember I ever saw controller supporting the bidirectional streams, so this is likely a nop change. MFC after: 1 month Notes: svn path=/head/; revision=326186
* Decode kevent structures logged via ktrace(2) in kdump.John Baldwin2017-11-256-80/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a new KTR_STRUCT_ARRAY ktrace record type which dumps an array of structures. The structure name in the record payload is preceded by a size_t containing the size of the individual structures. Use this to replace the previous code that dumped the kevent arrays dumped for kevent(). kdump is now able to decode the kevent structures rather than dumping their contents via a hexdump. One change from before is that the 'changes' and 'events' arrays are not marked with separate 'read' and 'write' annotations in kdump output. Instead, the first array is the 'changes' array, and the second array (only present if kevent doesn't fail with an error) is the 'events' array. For kevent(), empty arrays are denoted by an entry with an array containing zero entries rather than no record. - Move kevent decoding tables from truss to libsysdecode. This adds three new functions to decode members of struct kevent: sysdecode_kevent_filter, sysdecode_kevent_flags, and sysdecode_kevent_fflags. kdump uses these helper functions to pretty-print kevent fields. - Move structure definitions for freebsd11 and freebsd32 kevent structures to <sys/event.h> so that they can be shared with userland. The 32-bit structures are only exposed if _WANT_KEVENT32 is defined. The freebsd11 structures are only exposed if _WANT_FREEBSD11_KEVENT is defined. The 32-bit freebsd11 structure requires both. - Decode freebsd11 kevent structures in truss for the compat11.kevent() system call. - Log 32-bit kevent structures via ktrace for 32-bit compat kevent() system calls. - While here, constify the 'void *data' argument to ktrstruct(). Reviewed by: kib (earlier version) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12470 Notes: svn path=/head/; revision=326184
* Fix SPDX line as suggested by pfgMichael Tuexen2017-11-241-1/+1
| | | | Notes: svn path=/head/; revision=326180
* Temporarily disable VIMAGE on arm64Ed Maste2017-11-241-1/+1
| | | | | | | | | | Loading a kernel module with a static VNET_DEFINE'd variable (e.g. if_lagg) currently results in a kernel panic. PR: 223670 Notes: svn path=/head/; revision=326179
* Don't redefine _KERNEL.Mark Johnston2017-11-241-2/+0
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=326178
* Have lockstat:::sx-release fire only after the lock state has changed.Mark Johnston2017-11-241-2/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=326176
* Add a missing lockstat:::sx-downgrade probe.Mark Johnston2017-11-241-7/+6
| | | | | | | | | | We were returning without firing the probe when the lock had no shared waiters. MFC after: 1 week Notes: svn path=/head/; revision=326175
* bhnd(4): Add missing dependency on ofw_bus_if.hLandon J. Fuller2017-11-241-1/+1
| | | | | | | | Reported by: wma Approved by: adrian (mentor, implicit) Notes: svn path=/head/; revision=326174
* Switch the default firmware for npe(4) from the QOS_VLAN one to theNathan Whitehorn2017-11-242-798/+297
| | | | | | | | | | | | | plain-vanilla ETH microcode. The QOS_VLAN firmware added support in microcode for handling IEEE 802.1q tags, but the npe(4) driver did not actually support the relevant signalling. As a result, it was impossible to use VLANs with npe(4). Switching to the more basic microcode (same license) removes the on-NIC promisisng and makes vlan(4) work on both NPE interfaces. Ref: https://lists.freebsd.org/pipermail/freebsd-arm/2012-August/003826.html Notes: svn path=/head/; revision=326171
* RoCE/infiniband upgrade to Linux v4.9 for kernel and userspace.Hans Petter Selasky2017-11-24193-39955/+33003
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit merges projects/bsd_rdma_4_9 to head. List of kernel sources used: ============================ 1) kernel sources were cloned from git://github.com/torvalds/linux.git Top commit 69973b830859bc6529a7a0468ba0d80ee5117826 - tag: v4.9, linux-4.9 2) krping was cloned from https://github.com/larrystevenwise/krping Top commit 292a2f1abf0348285e678a82264740d52e4dcfe4 List of userspace sources used: =============================== 1) rdma-core was cloned from https://github.com/linux-rdma/rdma-core.git Top commit d65138ef93af30b3ea249f3a84aa6a24ba7f8a75 2) OpenSM was cloned from git://git.openfabrics.org/~halr/opensm.git Top commit 85f841cf209f791c89a075048a907020e924528d 3) libibmad was cloned from git://git.openfabrics.org/~iraweiny/libibmad.git Tag 1.3.13 with some additional patches from Mellanox. 4) infiniband-diags was cloned from git://git.openfabrics.org/~iraweiny/infiniband-diags.git Tag 1.6.7 with some additional patches from Mellanox. NOTES: ====== 1) The mthca driver has been removed in kernel and in userspace. 2) All GPLv2 only sources have been removed and where applicable rewritten from scratch under a BSD license. 3) List of fully supported drivers in userspace and kernel: a) iw_cxgbe (Chelsio) b) mlx4ib (Mellanox) c) mlx5ib (Mellanox) 4) WITH_OFED=YES is still required by make in order to build OFED userspace and kernel code. 5) Full support has been added for routable RoCE, RoCE v2. Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=326169
| * Merge ^/head r326132 through r326161.Hans Petter Selasky2017-11-2424-106/+120
| |\ | | | | | | | | | Notes: svn path=/projects/bsd_rdma_4_9/; revision=326162