aboutsummaryrefslogtreecommitdiff
path: root/sys/mips
Commit message (Collapse)AuthorAgeFilesLines
...
* Include ktr.h in more compilation unitsConrad Meyer2019-05-213-1/+3
| | | | | | | | | | | | | | | | | | Similar to r348026, exhaustive search for uses of CTRn() and cross reference ktr.h includes. Where it was obvious that an OS compat header of some kind included ktr.h indirectly, .c files were left alone. Some of these files clearly got ktr.h via header pollution in some scenarios, or tinderbox would not be passing prior to this revision, but go ahead and explicitly include it in files using it anyway. Like r348026, these CUs did not show up in tinderbox as missing the include. Reported by: peterj (arm64/mp_machdep.c) X-MFC-With: r347984 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=348064
* Include eventhandler.h in more compilation unitsConrad Meyer2019-05-213-0/+3
| | | | | | | | | | | | | | | | This was enumerated with exhaustive search for sys/eventhandler.h includes, cross-referenced against EVENTHANDLER_* usage with the comm(1) utility. Manual checking was performed to avoid redundant includes in some drivers where a common os_bsd.h (for example) included sys/eventhandler.h indirectly, but it is possible some of these are redundant with driver-specific headers in ways I didn't notice. (These CUs did not show up as missing eventhandler.h in tinderbox.) X-MFC-With: r347984 Notes: svn path=/head/; revision=348026
* [mediatek] Add support for non-flash devices on the SPI bus of the Mediatek ↵Adrian Chadd2019-05-201-40/+103
| | | | | | | | | | | | | | SoCs. The existing SPI support only worked for directly attached flash chips. it didn't implement clock programming or chipselect. It also supports transfers with unbalanced tx/rx command sizes. Submitted by: <yamori813@yahoo.co.jp> Differential Revision: https://reviews.freebsd.org/D20101 Notes: svn path=/head/; revision=347998
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-202-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* mips: Implement basic pmap_kenter_device, pmap_kremove_deviceConrad Meyer2019-05-162-0/+40
| | | | | | | | | | | Unbreak mips.BERI_DE4_SDROOT build, which uses device xdma. Device xdma depends on the pmap_kenter_device APIs. Reported by: tinderbox (local) Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=347888
* [ar71xx_gpio] Add AR9341/AR9342 to the list of chips for programming ↵Adrian Chadd2019-05-151-1/+3
| | | | | | | | | | | | | function/output enable. This is reqired to use the gpiofunc behaviour for configuring GPIO pins at boot time. Submitted by: <yamori813@yahoo.co.jp> Differential Revision: https://reviews.freebsd.org/D20170 Notes: svn path=/head/; revision=347618
* Catch up with r347241.Mark Johnston2019-05-131-2/+2
| | | | | | | MFC with: r347241 Notes: svn path=/head/; revision=347515
* tun/tap: merge and rename to `tuntap`Kyle Evans2019-05-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tun(4) and tap(4) share the same general management interface and have a lot in common. Bugs exist in tap(4) that have been fixed in tun(4), and vice-versa. Let's reduce the maintenance requirements by merging them together and using flags to differentiate between the three interface types (tun, tap, vmnet). This fixes a couple of tap(4)/vmnet(4) issues right out of the gate: - tap devices may no longer be destroyed while they're open [0] - VIMAGE issues already addressed in tun by kp [0] emaste had removed an easy-panic-button in r240938 due to devdrn blocking. A naive glance over this leads me to believe that this isn't quite complete -- destroy_devl will only block while executing d_* functions, but doesn't block the device from being destroyed while a process has it open. The latter is the intent of the condvar in tun, so this is "fixed" (for certain definitions of the word -- it wasn't really broken in tap, it just wasn't quite ideal). ifconfig(8) also grew the ability to map an interface name to a kld, so that `ifconfig {tun,tap}0` can continue to autoload the correct module, and `ifconfig vmnet0 create` will now autoload the correct module. This is a low overhead addition. (MFC commentary) This may get MFC'd if many bugs in tun(4)/tap(4) are discovered after this, and how critical they are. Changes after this are likely easily MFC'd without taking this merge, but the merge will be easier. I have no plans to do this MFC as of now. Reviewed by: bcr (manpages), tuexen (testing, syzkaller/packetdrill) Input also from: melifaro Relnotes: yes Differential Revision: https://reviews.freebsd.org/D20044 Notes: svn path=/head/; revision=347241
* Add a COMPAT_FREEBSD12 kernel option.Conrad Meyer2019-05-024-0/+4
| | | | | | | | | | | Use it wherever COMPAT_FREEBSD11 is currently specified, like r309749. Reviewed by: imp, jhb, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20120 Notes: svn path=/head/; revision=347029
* random(4): Restore availability tradeoff prior to r346250Conrad Meyer2019-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in that commit message, it is a dangerous default. But the safe default causes enough pain on a variety of platforms that for now, restore the prior default. Some of this is self-induced pain we should/could do better about; for example, programmatic CI systems and VM managers should introduce entropy from the host for individual VM instances. This is considered a future work item. On modern x86 and Power9 systems, this may be wholly unnecessary after D19928 lands (even in the non-ideal case where early /boot/entropy is unavailable), because they have fast hardware random sources available early in boot. But D19928 is not yet landed and we have a host of architectures which do not provide fast random sources. This change adds several tunables and diagnostic sysctls, documented thoroughly in UPDATING and sys/dev/random/random_infra.c. PR: 230875 (reopens) Reported by: adrian, jhb, imp, and probably others Reviewed by: delphij, imp (earlier version), markm (earlier version) Discussed with: adrian Approved by: secteam(delphij) Relnotes: yeah Security: related Differential Revision: https://reviews.freebsd.org/D19944 Notes: svn path=/head/; revision=346358
* The Atheros AR7241 has 20 GPIO pinsAllan Jude2019-03-252-1/+4
| | | | | | | | | | | | AR724X_GPIO_PINS used for this family is defined as 18 The datasheet for the AR7241 describes 20 pins, allow all to be used. Submitted by: Hiroki Mori <yamori813@yahoo.co.jp> Reviewed by: mizhka Differential Revision: https://reviews.freebsd.org/D17580 Notes: svn path=/head/; revision=345492
* Remove duplicate options.Warner Losh2019-03-231-5/+0
| | | | Notes: svn path=/head/; revision=345456
* Add device xz. This was somehow missed in the last round.Warner Losh2019-03-231-0/+1
| | | | | | | Submitted by: Brandon Bergren Notes: svn path=/head/; revision=345455
* amd64 KPTI: add control from procctl(2).Konstantin Belousov2019-03-162-0/+12
| | | | | | | | | | | | | | | | | Add the infrastructure to allow MD procctl(2) commands, and use it to introduce amd64 PTI control and reporting. PTI mode cannot be modified for existing pmap, the knob controls PTI of the new vmspace created on exec. Requested by: jhb Reviewed by: jhb, markj (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D19514 Notes: svn path=/head/; revision=345228
* amd64: Add md process flags and first P_MD_PTI flag.Konstantin Belousov2019-03-161-0/+7
| | | | | | | | | | | | | | | | | | | | PTI mode for the process pmap on exec is activated iff P_MD_PTI is set. On exec, the existing vmspace can be reused only if pti mode of the pmap matches the P_MD_PTI flag of the process. Add MD cpu_exec_vmspace_reuse() callback for exec_new_vmspace() which can vetoed reuse of the existing vmspace. MFC note: md_flags change struct proc KBI. Reviewed by: jhb, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D19514 Notes: svn path=/head/; revision=345227
* Remove obsolete wrappers for 64-bit loads/stores which were only used by theJuli Mallett2019-03-162-85/+2
| | | | | | | | | removed (r342255) SiByte port. Reviewed by: imp Notes: svn path=/head/; revision=345221
* mips: remove dead comment and definitions.Konstantin Belousov2019-03-141-8/+0
| | | | | | | | | | Reviewed by: brooks, jhb Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D19584 Notes: svn path=/head/; revision=345141
* Style(9): add a missing space between argument declerations.Brooks Davis2019-03-141-1/+1
| | | | Notes: svn path=/head/; revision=345136
* Remove an unused struct proc *p1 in cpu_fork().Brooks Davis2019-03-141-3/+1
| | | | | | | | | | | The only reference to p1 after a dead store was in a comment so update the comment to refer to td1. Submitted by: sbruno Differential Revision: https://reviews.freebsd.org/D16226 Notes: svn path=/head/; revision=345135
* Remove sv_pagesize, originally introduced with r100384.Edward Tomasz Napierala2019-03-012-3/+0
| | | | | | | | | | | | | | | | In all of the architectures we have today, we always use PAGE_SIZE. While in theory one could define different things, none of the current architectures do, even the ones that have transitioned from 32-bit to 64-bit like i386 and arm. Some ancient mips binaries on other systems used 8k instead of 4k, but we don't support running those and likely never will due to their age and obscurity. Reviewed by: imp (who also contributed the commit message) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19280 Notes: svn path=/head/; revision=344705
* Modularize xz.Konstantin Belousov2019-02-2641-34/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | Embedded lzma decompression library becomes a module usable by other consumers, in addition to geom_uzip. Most important code changes are - removal of XZ_DEC_SINGLE define, we need the code to work with XZ_DEC_DYNALLOC; - xz_crc32_init() call is removed from geom_uzip, xz module handles initialization on its own. xz is no longer embedded into geom_uzip, instead the depend line for the module is provided, and corresponding kernel option is added to each MIPS kernel config file using geom_uzip. The commit also carries unrelated cleanup by removing excess "device geom_uzip" in places which were missed in r344479. Reviewed by: cem, hselasky, ray, slavash (previous versions) Sponsored by: Mellanox Technologies Differential revision: https://reviews.freebsd.org/D19266 MFC after: 3 weeks Notes: svn path=/head/; revision=344605
* o Get rid of silly comment which seems to have got life of its own viaMaxim Sobolev2019-02-236-6/+2
| | | | | | | | | | copy-and-paste process; o Return geom_uzip(4) usage back to how manual page prescribes it to be used while I am here. Notes: svn path=/head/; revision=344479
* Add kernel support for Intel userspace protection keys feature onKonstantin Belousov2019-02-201-0/+7
| | | | | | | | | | | | | | | | Skylake Xeons. See SDM rev. 68 Vol 3 4.6.2 Protection Keys and the description of the RDPKRU and WRPKRU instructions. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D18893 Notes: svn path=/head/; revision=344353
* Enable enabling ASLR on non-x86 architectures.Konstantin Belousov2019-02-141-2/+2
| | | | | | | | Discussed with: emaste Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=344121
* Performance improvements for octe(4):Nathan Whitehorn2019-02-103-19/+14
| | | | | | | | | | | | | | | | | | - Distribute RX load across multiple cores, if present. This reverts r217212, which is no longer relevant (I think because of the newer SDK). - Use newer APIs for pinning taskqueue entries to specific cores. - Deepen RX buffers. This more than doubles NAT forwarding throughput on my EdgeRouter Lite from, with typical packet mixture, 90 Mbps to over 200 Mbps. The result matches forwarding throughput in Linux without the UBNT hardware offload on the same hardware, and thus likely reflects hardware limits. Reviewed by: jhibbits Notes: svn path=/head/; revision=343969
* Remove a few stray "All Rights Reserved." declarations on stuff I'veWarner Losh2019-02-051-1/+1
| | | | | | | written. Notes: svn path=/head/; revision=343810
* Make iflib a loadable module.Konstantin Belousov2019-01-312-0/+3
| | | | | | | | | | | | | | | | iflib is already a module, but it is unconditionally compiled into the kernel. There are drivers which do not need iflib(4), and there are situations where somebody might not want iflib in kernel because of using the corresponding driver as module. Reviewed by: marius Discussed with: erj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19041 Notes: svn path=/head/; revision=343617
* [mips] Fix error condition check that always evaluates to falseOleksandr Tymoshenko2019-01-251-1/+1
| | | | | | | | | | | Use proper logical operand when checking the value of srcid PR: 200988 Submitted by: David Binderman <dcb314@hotmail.com> MFC after: 1 week Notes: svn path=/head/; revision=343452
* [mips] Unbreak kernel build for CI20Oleksandr Tymoshenko2019-01-251-15/+2
| | | | | | | | | - Include header required for boot_parse_XXX functions - Use boot_parse_args when parsing argc/argv style arguments - Remove unused function Notes: svn path=/head/; revision=343450
* [mips] Fix counter mask in jz4780 timer driverOleksandr Tymoshenko2019-01-251-1/+1
| | | | | | | | | | | | Fix dublicate value in what is apparent copypaste mistake. The last value in mask is supposed to be for counter 7, not counter 3. PR: 229790 Submitted by: David Binderman <dcb314@hotmail.com> MFC after: 1 week Notes: svn path=/head/; revision=343448
* [mips] remove check that is always false (unsinged < 0)Oleksandr Tymoshenko2019-01-251-1/+1
| | | | | | | | | | | | cpuid and local cpu variable are unsigned so checking if value is less than zero always yields false. PR: 211088 Submitted by: David Binderman <dcb314@hotmail.com> MFC after: 1 week Notes: svn path=/head/; revision=343446
* [mips] remove dublicate values in enable mask in nlm_usb_intr_enOleksandr Tymoshenko2019-01-251-2/+1
| | | | | | | | | PR: 230572 Submitted by: David Binderman <dcb314@hotmail.com> MFC after: 1 week Notes: svn path=/head/; revision=343443
* Garbage collect AH_SUPPORT_AR5416 config option.Andriy Voskoboinyk2019-01-254-4/+0
| | | | | | | It does nothing since r318857. Notes: svn path=/head/; revision=343427
* Remove IEEE80211_AMPDU_AGE config option.Andriy Voskoboinyk2019-01-202-2/+0
| | | | | | | It is noop since r297774. Notes: svn path=/head/; revision=343219
* Add note to 32-bit mips smp config files documenting the statusWarner Losh2018-12-192-0/+4
| | | | Notes: svn path=/head/; revision=342263
* 32-bit mips SMP is unsupportedWarner Losh2018-12-191-1/+2
| | | | | | | | | | | | | | | | | Per discussions on mips@, 32-bit mips SMP is now unsupported. The files in the tree will compile for a while longer, but when the atomic_swap_64 or similar atomic enters into the MI part of the tree, as currently foreseen sometime next year, these ports will start to no longer link. The JZ4780 is the only such system we have. The UP version of this chip is unaffected by this, and will remain supported. Discussed on: mips@ Relnotes: yes Notes: svn path=/head/; revision=342261
* Remove old config file for SENTRY5Warner Losh2018-12-192-98/+0
| | | | | | | | | | | | | This is an older broadcom part that implements the mips32 ISA. 32-bit FreeBSD/mips now requires mips32r2, so retire this config. Most of the broadcom port is shared with newer ports, so what little code may be unique to this part has not been GC'd at this time. Discussed on: freebsd-mips@ Differential Revision: https://reviews.freebsd.org/D18543 Notes: svn path=/head/; revision=342258
* Remove support for running 32-bit kernels on 64-bit hardware.Warner Losh2018-12-191-28/+0
| | | | | | | | | | | This was useful in bring up. However, it causes more issues than the support is worth (64-bit atomics being chief among them). Discussed on: freebsd-mips@ Differential Revision: https://reviews.freebsd.org/D18543 Notes: svn path=/head/; revision=342257
* Remove the GXEMUL support.Warner Losh2018-12-197-450/+0
| | | | | | | | | | | | gxemul was a nice stop-gap while qemu support for mips was firmed up. Now MALTA* + qemu is the platform of choice retire gxemul support. It's unknown when this was last confirmed working. Discussed on: freebsd-mips@ Differential Revision: https://reviews.freebsd.org/D18543 Notes: svn path=/head/; revision=342256
* Remove support for the now very old SiByte MIPS platform. It's notWarner Losh2018-12-1917-2232/+0
| | | | | | | | | | | | relevant and is unused. It's also getting in the way of progress in some admittedly minor ways. Better to retire it to reduce the burden on the project. Discussed on: freebsd-mips@ Differential Revision: https://reviews.freebsd.org/D18543 Notes: svn path=/head/; revision=342255
* Remove iBCS2, part2: general kernelMateusz Guzik2018-12-193-5/+0
| | | | | | | | Reviewed by: kib (previous version) Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=342243
* atomic_cmpset return value is also an int.Warner Losh2018-12-141-8/+8
| | | | Notes: svn path=/head/; revision=342095
* atomic_fcmpset* return int, not the type of *.Warner Losh2018-12-141-8/+8
| | | | | | | | | | | fcmpset returns true/false as a int, so make the return types and variables match the int to be consistent with other arch. Reviewed by: cognet@ Differential Revision: https://reviews.freebsd.org/D18557 Notes: svn path=/head/; revision=342094
* Correctly implemenet atomic_swap_long for mips64.Warner Losh2018-12-131-6/+9
| | | | | | | | | | | MIPS64 has 64-bit longs, so use uint64_t for it, otherwise uint32_t. sizeof(long) == sizeof(ptr) for all platforms, so define atomic_swap_ptr in terms of atomic_swap_long. Submitted by: hps@ Notes: svn path=/head/; revision=342022
* Remove stray hints files.Warner Losh2018-12-102-46/+0
| | | | Notes: svn path=/head/; revision=341801
* Implement atomic_swap_xxx() for all platforms.Hans Petter Selasky2018-12-101-0/+64
| | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D18450 Reviewed by: kib@ MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=341787
* Add CAPABILITIES to the ERL kernel config so that tools that have beenSean Bruno2018-11-281-0/+2
| | | | | | | | | modified with Capsicum work on this target platform. This came up after the conversion of wc(8). Notes: svn path=/head/; revision=341140
* Prevent kernel stack disclosure in getcontext/swapcontextEric van Gyzen2018-11-261-0/+2
| | | | | | | | | | | | Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc. MFC after: 2 days Security: FreeBSD-EN-18:12.mem Security: CVE-2018-17155 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=340994
* Fix access to cpu_model[] in mtk_soc_set_cpu_model()Stanislav Galabov2018-11-191-4/+8
| | | | | | | | | | There may be cases where cpu_model[] may not be 32bit aligned, so it is better to not try to access it as such in order to avoid unaligned access. Sponsored by: Smartcom - Bulgaria AD Notes: svn path=/head/; revision=340613
* Implement support for sysctl hw.model for Mediatek/Ralink SoCsStanislav Galabov2018-11-164-0/+35
| | | | | | | | | | | | | | | These SoCs have CHIPID registers, which store the Chip model, according to the manufacturer; make use of those in order to better identify the chip we're actually running on. If we're unable to read the CHIPID registers for some reason we will use the string "unknown " as a value for hw.model. Reported by: yamori813@yahoo.co.jp Sponsored by: Smartcom - Bulgaria AD Notes: svn path=/head/; revision=340476