aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Copy strcasestr.c from libc to libkern.Vladimir Kondratyev2021-01-071-0/+74
|
* evdev: Allow open() handler to be interrupted by a signalVladimir Kondratyev2021-01-072-5/+15
| | | | | | | It is possible that the client list lock is taken by other process for too long due to e.g. IO timeouts. Allow user to terminate open() in this case. Reviewed by: markj (as part of D27865)
* evdev: Make open(2) and close(3) handlers sleepable.Vladimir Kondratyev2021-01-074-67/+156
| | | | | | | | | | | | | | | | | | | | At the beginning of evdev there was a LOR between hardware driver's and evdev client list locks as they were taken in different order at driver's interrupt and evdev open()/close() handlers. The LOR was fixed with introduction of evdev_register_mtx() function which allowed to use a hardware driver's lock as evdev client list lock. While this works good with PS/2 and USB, this does not work with I2C. Unlike PS/2 and USB, I2C open()/close() handlers do unbound sleeps while waiting for I2C bus to release and while performing IO. This change uses epoch(9) for traversing evdev client list in interrupt handler to avoid the LOR thus making possible to convert evdev client list lock to sleepable sx. While here add brief locking protocol description. Reviewed by: markj Differential revision: https://reviews.freebsd.org/D27865
* evdev: Remove useless "initial value" parameter from evdev_support_abs()Vladimir Kondratyev2021-01-0710-28/+25
| | | | | It can not be used for setting of state of multitouch events. If necessary, use evdev_push_event() instead of it.
* Allow HID report descriptor parser to return more then 1 usage per itemVladimir Kondratyev2021-01-072-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This handles parsing of following descriptor, containing array of usages: 0x05, 0x01, // Usage Page (Generic Desktop Ctrls) 0x09, 0x80, // Usage (Sys Control) 0xA1, 0x01, // Collection (Application) 0x75, 0x02, // Report Size (2) 0x95, 0x01, // Report Count (1) 0x15, 0x01, // Logical Minimum (1) 0x25, 0x03, // Logical Maximum (3) 0x09, 0x82, // Usage (Sys Sleep) 0x09, 0x81, // Usage (Sys Power Down) 0x09, 0x83, // Usage (Sys Wake Up) 0x81, 0x60, // Input (Data,Array,Abs) 0x75, 0x06, // Report Size (6) 0x81, 0x03, // Input (Const,Var,Abs) 0xC0, // End Collection Our current parser returns only first usage (Sys Sleep) and loses next two. Set HID_ITEM_MAXUSAGE limit relatively low as existing code usually allocates hid_item on stack. Also tweak hid_locate() to support hid items with multiple usages. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D27748
* hid_locate: do not ignore constant items.Vladimir Kondratyev2021-01-071-1/+1
| | | | | | | | | | | | | | | | | | | hid_locate() currently ignores all HID items which tagged as constant, i.e. bit 0 of main item data is set to 1. See p.6.2.2.4 of hid1_11.pdf [1]. Such an items are unconditionally treated as byte-alignment padding. While that may be right decision for input and output reports that is wrong for features reports. Feature reports can contain constant capabilities e.g. 'Contact Count Maximum'. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=232040 Remove check for constant from hid_locate() to make possible parsing of such a reports. [1] https://www.usb.org/sites/default/files/documents/hid1_11.pdf Reviewed by: hselasky Obtained from: sysutils/iichid Differential Revision: https://reviews.freebsd.org/D27747
* Rewrite the disk I/O management system in fsck_ffs(8). Other thanKirk McKusick2021-01-0717-1384/+1215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | making fsck_ffs(8) run faster, there should be no functional change. The original fsck_ffs(8) had its own disk I/O management system. When gjournal(8) was added to FreeBSD 7, code was added to fsck_ffs(8) to do the necessary gjournal rollback. Rather than use the existing fsck_ffs(8) disk I/O system, it wrote its own from scratch. Similarly when journalled soft updates were added in FreeBSD 9, code was added to fsck_ffs(8) to do the necessary journal rollback. And once again, rather than using either of the existing fsck_ffs(8) disk I/O systems, it wrote its own from scratch. Lastly the fsdb(8) utility uses the fsck_ffs(8) disk I/O management system. In preparation for making the changes necessary to enable snapshots to be taken when using journalled soft updates, it was necessary to have a single disk I/O system used by all the various subsystems in fsck_ffs(8). This commit merges the functionality required by all the different subsystems into a single disk I/O system that supports all of their needs. In so doing it picks up optimizations from each of them with the results that each of the subsystems does fewer reads and writes than it did with its own customized I/O system. It also greatly simplifies making changes to fsck_ffs(8) since everything goes through a single place. For example the ginode() function fetches an inode from the disk. When inode check hashes were added, they previously had to be checked in the code implementing inode fetch in each of the three different disk I/O systems. Now they need only be checked in ginode(). Tested by: Peter Holm Sponsored by: Netflix
* du: tests: make H_flag tests more strict about output requirementsKyle Evans2021-01-071-4/+12
| | | | | | | | | | | | | | The current version of this test will effectively pass as long as one of the specified paths is in the output, and it could even be a subset of one of the paths. Strengthen up the test a little bit: * Specify beginning/end anchors for each path * Add egrep -v checks to make sure we don't have any *additional* paths * Ratchet down paths2 to exactly the two paths we expect to appear Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D27984
* du: tests: fix the H_flag test (primarily grep usage)Kyle Evans2021-01-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test attempts to use \t (tab intended) in a grep expression. With the former /usr/bin/grep (i.e. gnugrep), this was interpreted as a literal 't'. The expression would work anyways because the tr(1) usage would ultimately replace all of the spaces with a single newline, and they would match the paths whether they were correctly fromatted or not. Current /usr/bin/grep (i.e. bsdgrep) is less-tolerant of ordinary-escapes, a property of the underlying regex(3) engine, to make it easier to identify when stuff like this happens. In-fact, this expression broke after the switch happened. This revision does the bare basics to fix the usage by using a printf to get a literal tab character to insert into the expression. It also swaps out the manual insertion of the line prefix into the grep expression by pulling that part out of $sep and reusing it for the leading path. The secondary issue was the tr(1) usage, since tr would only replace the first character of string1 with the first character of string2. This has instead been replaced by a sed expression, which similary understands \n to be a newline on all supported versions of FreeBSD. Each path now gets prefixed with the appropriate context that should be there (i.e. numeric sequence followed by a tab). PR: 252446 Reviewed by: emaste, ngie Differential Revision: https://reviews.freebsd.org/D27983
* stand: remove bogus dependency from libsa32Kyle Evans2021-01-071-2/+0
| | | | libsa32 is independent of libsa, they can build in parallel if needed.
* stand: avoid adding fdt SUBDIR_DEPEND if WITHOUT_FDT is setKyle Evans2021-01-071-0/+2
| | | | | | This unbreaks the efi build if WITHOUT_FDT is set. Reported by: peterj
* pf: Copy kif flags to userspaceKristof Provost2021-01-071-0/+1
| | | | | | | | This was overlooked in the pfi_kkif/pfi_kif splitup and as a result userspace could no longer tell which interfaces had the skip flag applied. MFC after: 2 weeks
* iflib: ensure that tx interrupts enabled and cleanupsMatt Macy2021-01-0711-41/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing a 'dd' over iscsi will reliably cause stalls. Tx cleaning _should_ reliably happen as data is sent. However, currently if the transmit queue fills it will wait until the iflib timer (hz/2) runs. This change causes the the tx taskq thread to be run if there are completed descriptors. While here: - make timer interrupt delay a sysctl - simplify txd_db_check handling - comment on INTR types Background on the change: Initially doorbell updates were minimized by only writing to the register on every fourth packet. If txq_drain would return without writing to the doorbell it scheduled a callout on the next tick to do the doorbell write to ensure that the write otherwise happened "soon". At that time a sysctl was added for users to avoid the potential added latency by simply writing to the doorbell register on every packet. This worked perfectly well for e1000 and ixgbe ... and appeared to work well on ixl. However, as it turned out there was a race to this approach that would lockup the ixl MAC. It was possible for a lower producer index to be written after a higher one. On e1000 and ixgbe this was harmless - on ixl it was fatal. My initial response was to add a lock around doorbell writes - fixing the problem but adding an unacceptable amount of lock contention. The next iteration was to use transmit interrupts to drive delayed doorbell writes. If there were no packets in the queue all doorbell writes would be immediate as the queue started to fill up we could delay doorbell writes further and further. At the start of drain if we've cleaned any packets we know we've moved the state machine along and we write the doorbell (an obvious missing optimization was to skip that doorbell write if db_pending is zero). This change required that tx interrupts be scheduled periodically as opposed to just when the hardware txq was full. However, that just leads to our next problem. Initially dedicated msix vectors were used for both tx and rx. However, it was often possible to use up all available vectors before we set up all the queues we wanted. By having rx and tx share a vector for a given queue we could halve the number of vectors used by a given configuration. The problem here is that with this change only e1000 passed the necessary value to have the fast interrupt drive tx when appropriate. Reported by: mav@ Tested by: mav@ Reviewed by: gallatin@ MFC after: 1 month Sponsored by: iXsystems Differential Revision: https://reviews.freebsd.org/D27683
* vfs: fix rangelock range in vn_rdwr() for IO_APPENDChuck Silvers2021-01-071-0/+2
| | | | | | | | | vn_rdwr() must lock the entire file range for IO_APPEND just like vn_io_fault() does for O_APPEND. Reviewed by: kib, imp, mckusick Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28008
* Fix dateMateusz Piotrowski2021-01-071-1/+1
| | | | | | It's 2021 already. Reported by: delphij
* arm64: enable build of the ipmi moduleMitchell Horne2021-01-073-5/+17
| | | | | | | | | Only ACPI attachment is supported for now, some others depend on the presence of smbios(4) support, which we lack on arm64. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28009
* Refactor rt_addrmsg() and rt_routemsg().Alexander V. Chernikov2021-01-079-50/+78
| | | | | | | | | | | | | | Summary: * Refactor rt_addrmsg(): make V_rt_add_addr_allfibs decision locally. * Fix rt_routemsg() and multipath by accepting nexthop instead of interface pointer. * Refactor rtsock_routemsg(): avoid accessing rtentry fields directly. * Simplify in_addprefix() by moving prefix search to a separate function. Reviewers: #network Subscribers: imp, ae, bz Differential Revision: https://reviews.freebsd.org/D28011
* armv8crypto: add AES-XTS supportMitchell Horne2021-01-073-11/+138
| | | | | | | | | | | A straightforward(ish) port from aesni(4). This implementation does not perform loop unrolling on the input blocks, so this is left as a future performance improvement. Submitted by: Greg V <greg AT unrelenting.technology> Looks good: jhb, jmg Tested by: mhorne Differential Revision: https://reviews.freebsd.org/D21017
* loader: do not update palette in text modeToomas Soome2021-01-071-1/+1
| | | | | Apparently palette update while in text mode, will cause some adapters to end up with blank display.
* isci: use maxphys rather than 128KB to size s/g listAndrew Gallatin2021-01-071-1/+1
| | | | | | | | | | | | | | | | In the conversion into a tunable, we converted the size of the s/g list used by the driver to be based off of a hardcoded size of 128k rather than maxphys, this caused performance problems for us. Revert this to use the maxphys tunable. Note that this constant is used to size dynamically allocated things, and not static data structs, so this is safe. Reviewed By: imp, kib, mav Tested By:i dhw Differential Revision: https://reviews.freebsd.org/D28023 Sponsored by: Netflix
* Fix the bug in committers-ports.dot with my mentor.Neel Chauhan2021-01-071-1/+1
| | | | | | Reviewed by: 0mp Approved by: 0mp (mentor) Differential Revision: https://reviews.freebsd.org/D28022
* src.conf.5: regenerate after MK_WERROR changeAlex Richardson2021-01-071-1/+5
| | | | This was missed in 7fa2f2a62f04f095e1e27ad55aa22a8f59b1df8f.
* arm64 GENERIC: sort to match amd64, to ease comparisonEd Maste2021-01-071-99/+102
| | | | | | | | | | No functional change - only moved lines, changed whitespace, and updated comments. Reviewed by: allanjude MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28001
* Add support for PL2303HXN to uplcom(4).Hans Petter Selasky2021-01-073-12/+92
| | | | | | | | | | | Code changes in this commit were obtained from straight from OpenBSD's uplcom.c with almost no modification, the list of chip names and USB IDs was obtained from Linux. Differential Revision: https://reviews.freebsd.org/D27952 Submitted by: tomli_tomli.me (Yifeng Li) MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Add new PCI ID for XHCI(4).Hans Petter Selasky2021-01-071-0/+2
| | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
* Fix a typoMateusz Piotrowski2021-01-071-2/+2
| | | | MFC after: 3 days
* libcompat: remove redundant path for ncursesBaptiste Daroussin2021-01-071-1/+1
| | | | Reported by: kevans
* prepare-commit-msg: Avoid warning on macOS and shellcheck fixesAlex Richardson2021-01-071-5/+5
| | | | | | | | | The macOS /bin/sh complains about using return outside of functions. Replace `return 0` with `exit 0` to fix this. While editing this files I've also fixed all the shellcheck warnings that were displayed by my IDE. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D28016
* Drop some unncessary stale code from Makefile.bootAlex Richardson2021-01-071-9/+0
| | | | No longer required after 0e1e341b486cdf4769195ba1e5b3cb32e7387873.
* tools/build/make.py: Fix macOS build after a920b9817Alex Richardson2021-01-071-4/+21
| | | | | | If we set STRIPBIN, we also have to set XSTRIPBIN since we otherwise use the host /usr/bin/strip during buildworld. However, this does not work on macOS since /usr/bin/strip doesn't handle ELF binaries.
* Rename NO_WERROR -> MK_WERROR=noAlex Richardson2021-01-0725-33/+40
| | | | | | | | As suggested in D27598. This also supports MK_WERROR.clang=no and MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D27601
* Stop passing MK_WARNS=no for bootstrap toolsAlex Richardson2021-01-073-7/+7
| | | | | | | | | | | | | | | | | I got annoyed by the number of warnings that the CheriBSD build was emitting. It turns out that we are emitting lots of warnings during bootstrap because bootstrap tools are built with the default compiler flags and ignore the warnings flags that are set in bsd.sys.mk. Looking at git blame, it appears that MK_WARNS=no has been passed since rS112869, replacing the -DNO_WERROR option that was added in rS87775. This commit changes MK_WARNS=no back to -DNO_WERROR. We need to pass -DNO_WERROR, since the system compiler might have new warnings that we don't know about yet, and we shouldn't fail the build in that case. Reviewed By: imp, brooks Differential Revision: https://reviews.freebsd.org/D27598
* Fix warnings during bootstrap phase on macOSAlex Richardson2021-01-071-1/+1
|
* Fix warnings during bootstrap on Linux systemsAlex Richardson2021-01-0712-64/+74
| | | | | Most warnings are currently off for the boostrap phase, but once D27598 lands they will be enabled again.
* Fix all warnings emitted in `make kernel-toolchain`Alex Richardson2021-01-072-4/+8
| | | | | | | | With this change and D27598 make kernel-toolchain no longer emits any warnings for me. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D27599
* include: Use printf(1) instead of shell loops for header symlinksAlex Richardson2021-01-071-97/+52
| | | | | | | | | | | | | | Using a shell for loop means we have to spawn a separate install(1) process for each header that is symlinked. This patch uses printf(1) to generate an argument list that has been prefixed with the correct number of ../ and then uses a single install(1) invocation. This reduces the number of execve() calls during make includes from 2442 (with D27622) to 1382. Running `make symlinks` in include/ now spawns 214 processes instead of 1276 without this patch. Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D27723
* Add mkimg to the list of bootstrap toolsAlex Richardson2021-01-071-0/+9
| | | | | | | | | | | Having this as part of the bootstrap tools is useful to build disk images to boot in QEMU (especially when building on a Linux/macOS host where mkimg is not available). We have been bootstrapping mkimg in CheriBSD for a long time (using LOCAL_XTOOL_DIRS) but I believe this is also useful upstream. Reviewed By: emaste, brooks Differential Revision: https://reviews.freebsd.org/D27602
* Fix -Wpointer-sign warnings in makefs and mkimgAlex Richardson2021-01-077-94/+62
| | | | | Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D27175
* Install dtrace.h and dependenciesAlex Richardson2021-01-072-2/+19
| | | | | | | | | | | | | This makes the minimum amount of changes to allow inclusion of dtrace.h without all the solaris compatibility headers. Installing dtrace.h allows compiling consumers of libdtrace (e.g. https://github.com/tmetsch/python-dtrace) without requiring a copy of the source tree. For python-dtrace I worked around this in https://github.com/tmetsch/python-dtrace/commit/58019c9a12022203a9ffda286dd8b41f1a5ace42 but being able to build the library without installed sources would be extremely useful. Reviewed By: gnn Differential Revision: https://reviews.freebsd.org/D27884
* Reference newfs_msdos(8) from the newfs(8) manualMateusz Piotrowski2021-01-071-1/+2
| | | | | | PR: 252484 Reported by: Graham Perrin <grahamperrin@gmail.com> MFC after: 3 days
* netmap: bridge: fix NS_MOREFRAG supportVincenzo Maffione2021-01-071-5/+7
| | | | | | | | | | | Support for NS_MOREFRAG is broken, as NS_MOREFRAG is copied from the TX slot to the RX slot rather than the other way around. Also, the NS_MOREFRAG must be copied also in case of packet copy (no zerocopy). Reported by: rajesh1.kumar_amd.com MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D27980
* Add my name/handle/mentor to committers-ports.dotNeel Chauhan2021-01-071-0/+3
|
* Fix bug in expanding lost+found direct blocks.Kirk McKusick2021-01-071-1/+1
| | | | | Reported by: Peter Holm Sponsored by: Netflix
* cache: unengrish the comment in previous commitMateusz Guzik2021-01-061-1/+1
| | | | Reported by: rpokala, brd
* pfctl: Fix NOCLEAN buildKristof Provost2021-01-061-0/+8
| | | | | | | | | We've created a new pf_ruleset.c file for pfctl and no longer use the kernel vrsion, but the build system doesn't handle this dependency change correctly. Delete the dependency file if it contains the kernel version of the file. MFC after: 2 weeks
* arm64: QorIQ: gpio: return BUS_PROBE_DEFAULTMarcin Wojtas2021-01-061-1/+1
| | | | | | | | | | There is no reason this driver can't return default probe value. Submitted by: Artur Rojek <ar@semihalf.com> Reviewed by: emaste, mmel Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D26869
* arm64: QorIQ: gpio: Cleanup qoriq_gpio_* helpersMarcin Wojtas2021-01-061-79/+12
| | | | | | | | | | | Replace various hw reg bit set/clear helpers with a universal `qoriq_gpio_set` function. Submitted by: Artur Rojek <ar@semihalf.com> Reviewed by: mmel Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D26868
* arm64: QorIQ: gpio: Style cleanupsMarcin Wojtas2021-01-061-71/+51
| | | | | | | | | | | | | Make the code more conformant to style(9) and improve the general readability. This patch does not alter the driver logic. Submitted by: Artur Rojek <ar@semihalf.com> Reviewed by: mmel Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D26867
* bectl(8): sync man page and help textRobert Wing2021-01-062-11/+9
| | | | | | | | | | | | | | Sync man page with behavior of bectl(8). Sync help text with man page. PR: 246697 Reported by: olgeni Submitted by: olgeni (with changes) Reviewed by: kevans, olgeni Approved by: kevans (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27482
* gstat(8): Bump .DdFernando ApesteguĂ­a2021-01-061-1/+1
| | | | | | | Forgotten in cfaa2958dc44c20f56a19fe490ee4d7c02f50bef PR: 251313 Differential Revision: https://reviews.freebsd.org/D27815