aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* When copying types from one CTF container to another, ensure that weJonathan T. Looney2020-11-171-1/+22
| | | | | | | | | | | | | | | | | | | | always copy intrinsic data types before copying bitfields which are based on those types. This ensures the type ordering in the destination CTF container matches the assumption made elsewhere in the CTF code that instrinsic data types will always appear before bitfields based on those types. This resolves the following error message some users have seen after r366908: "/usr/lib/dtrace/ipfw.d", line 121: failed to copy type of 'ip6p': Conflicting type is already defined Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27213 Notes: svn path=/head/; revision=367763
* Add legacy debug/test interfaces for kvm unit tests.Peter Grehan2020-11-175-4/+344
| | | | | | | | | | | | | | | Implement the legacy debug/test interfaces expected by KVM-unit-tests' realmode, emulator, and ioapic tests. Submitted by: adam_fenn.io Reviewed by: markj, grehan Approved by: grehan (bhyve) MFC after: 3 weeks Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D27130 Notes: svn path=/head/; revision=367762
* [POWERPC] msun: fix incorrect flag in fesetexceptflagAlfredo Dal'Ava Junior2020-11-171-1/+1
| | | | | | | | | | | | Fix incorrect mask being used when FE_INVALID bit is wanted by user. The problem was noticed thanks to msun fenv tests. Reviewed by: jhibbits, luporl Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D27201 Notes: svn path=/head/; revision=367761
* [POWERPC] fix signal race conditionAlfredo Dal'Ava Junior2020-11-171-4/+3
| | | | | | | | | | | | | | r367416 should have called save_fpu() before kern_sigprocmask to avoid race condition Thanks jhibbits and bdragon for pointing it out Reviewed by: jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D27241 Notes: svn path=/head/; revision=367760
* Add an example for the -s flagMateusz Piotrowski2020-11-171-0/+6
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=367759
* [PowerPC] Don't overwrite vm.pmap sysctl nodeLeandro Lupori2020-11-174-13/+17
| | | | | | | | | | | | | | | | | | After r367417, both mmu_oea64 and mmu_radix were defining the vm.pmap sysctl node, resulting in the later definition hiding the properties of the previous one. Avoid this issue by defining vm.pmap in a common source file and declaring it where needed. This change also standardizes the tunable name used to enable superpages and change its default to disabled on radix MMU, because it still has some issues with superpages. Reviewed by: bdragon, jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D27156 Notes: svn path=/head/; revision=367758
* Improve readability of the lists of optionsMateusz Piotrowski2020-11-171-20/+20
| | | | | | | | | | | - Sort options alphabetically - Add missing arguments (e.g., "list" to -a) - Adjust the width of Bl MFC after: 1 week Notes: svn path=/head/; revision=367757
* Clean up the synopsis section & fix mandoc warningsMateusz Piotrowski2020-11-171-12/+6
| | | | | | | | | | | The synopsis section had two very similar entries. The flags documented by the first one were a strict subset of the second one. Let's just keep only the second entry for simplicity. MFC after: 1 week Notes: svn path=/head/; revision=367756
* Stop calling gic_v3_detach when we haven't called gic_v3_attachAndrew Turner2020-11-171-3/+4
| | | | | | | | | | | The former tries to dereference memory allocated by the latter. If counting the redistributor fails it may try to dereference memory that was never allocated. Sponsored by: Innovate UK Notes: svn path=/head/; revision=367755
* Allow the GICv3 ACPI driver to attach to a GICv4Andrew Turner2020-11-171-2/+9
| | | | | | | | | | | The same driver works on both, allow the driver to attach to a GICv4 controller with the ACPI attachment. Reported by: Andrey Fesenko <f0andrey_gmail.com> Sponsored by: Innovate UK Notes: svn path=/head/; revision=367754
* Fix !COMPAT_FREEBSD32 kernel buildKyle Evans2020-11-171-0/+2
| | | | | | | | | | | | One of the last shifts inadvertently moved these static assertions out of a COMPAT_FREEBSD32 block, which the relevant definitions are limited to. Fix it. Pointy hat: kevans Notes: svn path=/head/; revision=367746
* sys/proc.h: improve comment for new TDP2 flagKyle Evans2020-11-171-1/+1
| | | | | | | | This was suggested by kib and integrated locally, but somehow did not make it into the committed version. Notes: svn path=/head/; revision=367745
* umtx_op: reduce redundancy required for compat32Kyle Evans2020-11-176-396/+309
| | | | | | | | | | | | | | | | | | All of the compat32 variants are substantially the same, save for copyin/copyout (mostly). Apply the same kind of technique used with kevent here by having the syscall routines supply a umtx_copyops describing the operations needed. umtx_copyops carries the bare minimum needed- size of timespec and _umtx_time are used for determining if copyout is needed in the sem2_wait case. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27222 Notes: svn path=/head/; revision=367744
* _umtx_op: fix a compat32 bug in UMTX_OP_NWAKE_PRIVATEKyle Evans2020-11-173-3/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, if we're waking up some value n > BATCH_SIZE, then the copyin(9) is wrong on the second iteration due to upp being the wrong type. upp is currently a uint32_t**, so upp + pos advances it by twice as many elements as it should (host pointer size vs. compat32 pointer size). Fix it by just making upp a uint32_t*; it's still technically a double pointer, but the distinction doesn't matter all that much here since we're just doing arithmetic on it. Add a test case that demonstrates the problem, placed with the libthr tests since one messing with _umtx_op should be running these tests. Running under compat32, the new test case will hang as threads after the first 128 get missed in the wake. it's not immediately clear how to hit it in practice, since pthread_cond_broadcast() uses a smaller (sleepq batch?) size observed to be around ~50 -- I did not spend much time digging into it. The uintptr_t change makes no functional difference, but i've tossed it in since it's more accurate (semantically). Reported by: Andrew Gierth (andrew_tao173.riddles.org.uk, inspection) Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27231 Notes: svn path=/head/; revision=367743
* _umtx_op: document UMTX_OP_SEM2_WAIT copyout behaviorKyle Evans2020-11-171-1/+22
| | | | | | | | | | | This clever technique to get a time remaining back was added to support sem_clockwait_np. Reviewed by: kib, vangyzen MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27160 Notes: svn path=/head/; revision=367742
* vmem: trivial warning and style fixes.Konstantin Belousov2020-11-171-7/+5
| | | | | | | | | | | | | | Add __unused to some args. Change type of the iterator variables to match loop control. Remove excessive {}. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D27220 Notes: svn path=/head/; revision=367741
* cpuset: reorder so that cs_mask does not share cacheline with cs_refMateusz Guzik2020-11-171-4/+4
| | | | Notes: svn path=/head/; revision=367738
* cpuset: refcount-cleanMateusz Guzik2020-11-171-2/+2
| | | | Notes: svn path=/head/; revision=367737
* Introduce IOMMU support for arm64 platform.Ruslan Bukin2020-11-1610-0/+3530
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an arm64 iommu interface and a driver for Arm System Memory Management Unit version 3.2 (ARM SMMU v3.2) specified in ARM IHI 0070C document. Hardware overview is provided in the header of smmu.c file. The support is disabled by default. To enable add 'options IOMMU' to your kernel configuration file. The support was developed on Arm Neoverse N1 System Development Platform (ARM N1SDP), kindly provided by ARM Ltd. Currently, PCI-based devices and ACPI platforms are supported only. The support was tested on IOMMU-enabled Marvell SATA controller, Realtek Ethernet controller and a TI xHCI USB controller with a low to medium load only. Many thanks to Konstantin Belousov for help forming the generic IOMMU framework that is vital for this project; to Andrew Turner for adding IOMMU support to MSI interrupt code; to Mark Johnston for help with SMMU page management; to John Baldwin for explaining various IOMMU bits. Reviewed by: mmel Relnotes: yes Sponsored by: DARPA / AFRL Sponsored by: Innovate UK (Digital Security by Design programme) Differential Revision: https://reviews.freebsd.org/D24618 Notes: svn path=/head/; revision=367736
* Add a guard for broken SUBDIR.${MK_FOO} useBrooks Davis2020-11-161-0/+6
| | | | | | | | | | | | | | | Check for the variable SUBDIR. and error as it usually means someone forgot to include src.opts.mk. This guard from CheriBSD found the bugs in r367655 and r367728. Reviewed by: bdrewery, arichardson Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27211 Notes: svn path=/head/; revision=367735
* bsdiff: fix off-by-one errorMitchell Horne2020-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The program reads oldsize bytes from oldfile, and proceeds to initialize a suffix array of oldsize elements using divsufsort(). As per the function's API [1], array indices 0 through n-1 are initialized. Later, search() is called, but with index bounds [0, n]. Depending on the contents of the malloc'd buffer, accessing this uninitialized index at the end of can result in a segmentation fault. Fix this by passing oldsize-1 to search(), limiting the search bounds to [0, n-1]. This bug is a result of r303285, which introduced divsufsort() as an alternate suffix sorting function to the existing qsufsort(). It seems that qsufsort() did initialize the final empty element, meaning it could be safely accessed. This difference in the implementations was missed at the time. [1] https://github.com/y-256/libdivsufsort Discussed with: cperciva MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26911 Notes: svn path=/head/; revision=367734
* malloc: make malloc_large closer to standaloneMateusz Guzik2020-11-161-70/+62
| | | | | | | | | | | | | This moves entire large alloc handling out of all consumers, apart from deciding to go there. This is a step towards creating a fast path. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D27198 Notes: svn path=/head/; revision=367733
* Add missing includes of src.opts.mkBrooks Davis2020-11-162-0/+4
| | | | | | | | | | Without this "SUBDIR.${MK_TESTS}=tests" would always expand to "SUBDIR.=tests" resulting in the tests not being built. Sponsored by: DARPA Notes: svn path=/head/; revision=367728
* Fix a bug in assertion: entry flags also includes IOMMU_MAP_ENTRY_UNMAPPED.Ruslan Bukin2020-11-161-2/+4
| | | | | | | | | | | The entry->flags field is initialized in iommu_gas_init_domain(). Reviewed by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D27235 Notes: svn path=/head/; revision=367726
* Add device_t member to struct iommu.Ruslan Bukin2020-11-162-0/+2
| | | | | | | | | | | | This is needed on arm64 for the interface between iommu framework and iommu controller drivers. Reviewed by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D27229 Notes: svn path=/head/; revision=367725
* imx7gpc: Remove unused functionsEmmanuel Vadot2020-11-161-14/+0
| | | | Notes: svn path=/head/; revision=367722
* dwmmc: dwmmc_switch_vccq is only used in MMCCAM kernelEmmanuel Vadot2020-11-161-2/+2
| | | | | | | Silence the build for non MMCCAM kernel Notes: svn path=/head/; revision=367721
* Revert "When building on Ubuntu bootstrap bmake with bash as the default shell"Alex Richardson2020-11-161-8/+0
| | | | | | | | This reverts r365950 since the latest bmake update includes fixes for the test failures that prompted the change. Notes: svn path=/head/; revision=367720
* Make mlx5_cmd_exec_cb() a safe API in mlx5core.Hans Petter Selasky2020-11-165-19/+93
| | | | | | | | | | | | | | | | | | | | APIs that have deferred callbacks should have some kind of cleanup function that callers can use to fence the callbacks. Otherwise things like module unloading can lead to dangling function pointers, or worse. The IB MR code is the only place that calls this function and had a really poor attempt at creating this fence. Provide a good version in the core code as future patches will add more places that need this fence. Linux commit: e355477ed9e4f401e3931043df97325d38552d54 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367719
* Report EQE data upon CQ completion in mlx5core.Hans Petter Selasky2020-11-1611-20/+22
| | | | | | | | | | | | | Report EQE data upon CQ completion to let upper layers use this data. Linux commit: 4e0e2ea1886afe8c001971ff767f6670312a9b04 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367718
* Enhance the mlx5_core_create_cq() function in mlx5core.Hans Petter Selasky2020-11-164-6/+8
| | | | | | | | | | | | | | Enhance mlx5_core_create_cq() to get the command out buffer from the callers to let them use the output. Linux commit: 38164b771947be9baf06e78ffdfb650f8f3e908e MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367717
* Use mlx5core to create/destroy all Dynamically Connected Targets, DCTs.Hans Petter Selasky2020-11-162-6/+6
| | | | | | | | | | | | | | | To prevent a hardware memory leak when a DEVX DCT object is destroyed without calling drain DCT before, (e.g. under cleanup flow), need to manage its creation and destruction via mlx5 core. Linux commit: c5ae1954c47d3fd8815bd5a592aba18702c93f33 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367716
* Fix error handling order in create_kernel_qp in mlx5ib.Hans Petter Selasky2020-11-161-2/+2
| | | | | | | | | | | | | Make sure order of cleanup is exactly the opposite of initialization. Linux commit: f4044dac63e952ac1137b6df02b233d37696e2f5 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Notes: svn path=/head/; revision=367715
* select: call seltdfini on process and thread exitMateusz Guzik2020-11-162-1/+4
| | | | | | | | | | | Since thread_zone is marked NOFREE the thread_fini callback is never executed, meaning memory allocated by seltdinit is never released. Adding the call to thread_dtor is not sufficient as exiting processes cache the main thread. Notes: svn path=/head/; revision=367714
* select: replace reference counting with memory barriers in selfdMateusz Guzik2020-11-161-9/+9
| | | | | | | | | | | Refcounting was added to combat a race between selfdfree and doselwakup, but it adds avoidable overhead. selfdfree detects it can free the object by ->sf_si == NULL, thus we can ensure that the condition only holds after all accesses are completed. Notes: svn path=/head/; revision=367713
* Ensure make delete-old does not unlink the llvm-cxxfilt and its manpage,Dimitry Andric2020-11-151-2/+5
| | | | | | | | | | | after r367304 and r367324, when WITH_LLVM_CXXFILT is enabled. Noticed by: "Herbert J. Skuhra" <herbert@gojira.at> MFC after: 3 days X-MFC-With: r367304 Notes: svn path=/head/; revision=367712
* Revert the whole getlocalbase() set of changes while a different design isScott Long2020-11-1510-231/+11
| | | | | | | hashed out. Notes: svn path=/head/; revision=367711
* zfsboot: add prototype for main()Toomas Soome2020-11-151-0/+2
| | | | | | | | | | Some compilers are complaining about missing prototype. PR: 251150 Reported by: markiyan.kushnir@gmail.com Notes: svn path=/head/; revision=367710
* Fix regression in AHCI controller settings.Peter Grehan2020-11-151-3/+2
| | | | | | | | | | | | | | | | | When the AHCI code was reworked to use FreeBSD struct definitions, the valid element was mis-transcribed resulting in the UMDA capability being hidden. This prevented Illumos from using AHCI disk/cdrom drives. Fix by using definitions that match the code pre-rework. PR: 250924 Submitted by: Rolf Stalder Reported by: Rolf Stalder MFC after: 3 days Notes: svn path=/head/; revision=367709
* Fix the previous revision, it suffered from an incomplete change to theScott Long2020-11-153-5/+5
| | | | | | | | getlocalbase API. Also don't erroneously subtract the lenth from the buffer a second time. Notes: svn path=/head/; revision=367702
* Because getlocalbase() returns -1 on error, it needs to use a signed typeScott Long2020-11-151-5/+12
| | | | | | | | internally. Do that, and make sure that conversations between signed and unsigned don't overflow Notes: svn path=/head/; revision=367701
* sched: fix an incorrect comparison in sched_lend_user_prio_condMateusz Guzik2020-11-152-2/+2
| | | | | | | Compare with sched_lend_user_prio. Notes: svn path=/head/; revision=367700
* cred: annotate credbatch_process argument as unusedMateusz Guzik2020-11-141-1/+1
| | | | | | | Fixes libprocstat compilation as zfs defines _KERNEL. Notes: svn path=/head/; revision=367697
* zfs: disable periodic arc updatesMateusz Guzik2020-11-141-0/+2
| | | | | | | | | They are only there to provide less innacurate statistics for debuggers. However, this is quite heavy-weight and instead it would be better to teach debuggers how to obtain the necessary information. Notes: svn path=/head/; revision=367696
* thread: batch credential freeingMateusz Guzik2020-11-143-2/+102
| | | | Notes: svn path=/head/; revision=367695
* thread: batch resource limit free callsMateusz Guzik2020-11-143-1/+26
| | | | Notes: svn path=/head/; revision=367694
* thread: rework tid batch to use helpersMateusz Guzik2020-11-141-13/+66
| | | | Notes: svn path=/head/; revision=367693
* cred: reorder cr_audit to be closer to the lockMateusz Guzik2020-11-141-1/+1
| | | | | | | This makes cr_uid avoid sharing. Notes: svn path=/head/; revision=367692
* thread: pad tid lockMateusz Guzik2020-11-141-1/+1
| | | | | | | | On a kernel with other changes this bumps 104-way thread creation/destruction from 0.96 mln ops/s to 1.1 mln ops/s. Notes: svn path=/head/; revision=367691
* Change the default locale to C.UTF-8Baptiste Daroussin2020-11-141-2/+3
| | | | | | | | | | | | | The C.UTF-8 locales is the same as the actual C locale except it does support the unicode character set. But the collation etc are still the same as the C locale one. Reviewed by: many Approved by: many Differential Revision: https://reviews.freebsd.org/D26973 Notes: svn path=/head/; revision=367690