]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agopccard: Remove fdc(4) PC Card attachment point
Warner Losh [Thu, 7 Jan 2021 22:19:34 +0000 (15:19 -0700)]
pccard: Remove fdc(4) PC Card attachment point

Remove PC Card attachemnt point for fdc.

Relnotes: Yes

3 years agopccard: Remove an(4) PC Card attachment
Warner Losh [Thu, 7 Jan 2021 21:55:19 +0000 (14:55 -0700)]
pccard: Remove an(4) PC Card attachment

Remove pccard attachment for an driver since pccard support is being
removed.

Relnotes: Yes

3 years agoRegenerate syscall files after reallocation of aio_writev/aio_readv
Alan Somers [Tue, 5 Jan 2021 23:31:35 +0000 (16:31 -0700)]
Regenerate syscall files after reallocation of aio_writev/aio_readv

3 years agoReallocate syscall numbers for aio_writev and aio_readv
Alan Somers [Tue, 5 Jan 2021 23:28:23 +0000 (16:28 -0700)]
Reallocate syscall numbers for aio_writev and aio_readv

The originally chosen numbers interfere with downstream projects'
syscalls.  Move them to the end of the syscall table instead.

Reported by: jrtc27
Reviewed by: brooks
MFC-With: 022ca2fc7fe08d51f33a1d23a9be49e6d132914e
Differential Revision: 022ca2fc7fe08d51f33a1d23a9be49e6d132914e

3 years agoCorrect typo in ObsoleteFiles.inc comment
Ed Maste [Fri, 8 Jan 2021 02:07:18 +0000 (21:07 -0500)]
Correct typo in ObsoleteFiles.inc comment

Reported by: Oliver Pinter

3 years agoOpenZFS: Fix issues caused by reversed commits + rebase
Matt Macy [Fri, 8 Jan 2021 00:03:48 +0000 (16:03 -0800)]
OpenZFS: Fix issues caused by reversed commits + rebase

3 years agoOpenZFS merge main-gf11b09
Matt Macy [Thu, 7 Jan 2021 23:27:17 +0000 (15:27 -0800)]
OpenZFS merge main-gf11b09

- add dRAID support
- fix duplicate close handling
- fix memory leak in prefetch
- fix problem with SIMD benchmarking on FreeBSD boot
...

3 years agoObsoleteFiles.inc: add newlines between some recent entries
Ed Maste [Fri, 8 Jan 2021 00:27:15 +0000 (19:27 -0500)]
ObsoleteFiles.inc: add newlines between some recent entries

3 years agoaio_fsync(2): Support O_DSYNC.
Thomas Munro [Thu, 7 Jan 2021 11:11:38 +0000 (00:11 +1300)]
aio_fsync(2): Support O_DSYNC.

aio_fsync(O_DSYNC, ...) is the asynchronous version of fdatasync(2).

Reviewed by: kib, asomers, jhb
Differential Review: https://reviews.freebsd.org/D25071

3 years agoffs: Support O_DSYNC.
Thomas Munro [Thu, 7 Jan 2021 10:50:59 +0000 (23:50 +1300)]
ffs: Support O_DSYNC.

Respect the new IO_DATASYNC flag when performing synchronous writes.
Compared to O_SYNC, O_DSYNC lets us skip updating the inode in some
cases, matching the behaviour of fdatasync(2).

Reviewed by: kib
Differential Review: https://reviews.freebsd.org/D25160

3 years agoopen(2): Add O_DSYNC flag.
Thomas Munro [Thu, 7 Jan 2021 10:46:51 +0000 (23:46 +1300)]
open(2): Add O_DSYNC flag.

POSIX O_DSYNC means that writes include an implicit fdatasync(2), just
as O_SYNC implies fsync(2).

VOP_WRITE() functions that understand the new IO_DATASYNC flag can act
accordingly, but we'll still pass down IO_SYNC so that file systems that
don't understand it will continue to provide the stronger O_SYNC
behaviour.

Flag also applies to fcntl(2).

Reviewed by: kib, delphij
Differential Revision: https://reviews.freebsd.org/D25090

3 years agoSet current date in to placeholders.
Vladimir Kondratyev [Fri, 8 Jan 2021 00:13:11 +0000 (03:13 +0300)]
Set current date in to placeholders.

3 years agoBSD.usr.dist: remove aout
Ed Maste [Fri, 8 Jan 2021 00:14:01 +0000 (19:14 -0500)]
BSD.usr.dist: remove aout

Userland a.out support has been removed; kernel aout(5) is unchanged.

Sponsored by: The FreeBSD Foundation

3 years agoldd: Retire aout support
Ed Maste [Fri, 8 Jan 2021 00:14:01 +0000 (19:14 -0500)]
ldd: Retire aout support

Userland aout support has not been required since FreeBSD 2.x.
If someone needs to use FreeBSD 2 shared libraries they will be best
served by using a FreeBSD 2 ldd, perhaps as part of a jail with a full
FreeBSD 2.x install.

Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27478

3 years agopccard: remove pccbb_isa
Warner Losh [Thu, 7 Jan 2021 23:52:36 +0000 (16:52 -0700)]
pccard: remove pccbb_isa

It was never used and quite stale.

3 years agopccard: Move power_if.m from pccard to cardbus
Warner Losh [Fri, 8 Jan 2021 00:00:23 +0000 (17:00 -0700)]
pccard: Move power_if.m from pccard to cardbus

power_if.m is used by both pccard and cardbus. Move it into cardbus.

3 years agoRetire obsolete a.out rtld
Ed Maste [Thu, 7 Jan 2021 22:39:49 +0000 (17:39 -0500)]
Retire obsolete a.out rtld

This was disconnected from the build in 2001 in commit 66422f5b7a1a
with a comment that it was long overdue even then.

Sponsored by: The FreeBSD Foundation

3 years agofd: use seqc_read_notmodify when translating fds
Mateusz Guzik [Thu, 7 Jan 2021 06:34:14 +0000 (07:34 +0100)]
fd: use seqc_read_notmodify when translating fds

3 years agofd: make fd/fp mandatory
Mateusz Guzik [Wed, 23 Dec 2020 13:50:34 +0000 (13:50 +0000)]
fd: make fd/fp mandatory

They are both always passed anyway.

3 years agocache: stop checkpointing cn_flags
Mateusz Guzik [Thu, 7 Jan 2021 05:35:56 +0000 (06:35 +0100)]
cache: stop checkpointing cn_flags

They are only modified, if ever, for the last component.

3 years agocache: stop checkpointing cn_nameptr
Mateusz Guzik [Thu, 7 Jan 2021 04:40:05 +0000 (05:40 +0100)]
cache: stop checkpointing cn_nameptr

For aborts cn_nameptr is the same as cn_pnbuf. For partial results
the same cn_nameptr is to be used.

3 years agocache: stop manipulating pathlen
Mateusz Guzik [Fri, 1 Jan 2021 09:29:57 +0000 (10:29 +0100)]
cache: stop manipulating pathlen

It is a copy-pasto from regular lookup. Add debug to ensure the result
is the same.

3 years agoloader: really use bold font for vga text mode
Toomas Soome [Thu, 7 Jan 2021 18:11:31 +0000 (20:11 +0200)]
loader: really use bold font for vga text mode

8x16v turns out to be too thin and hard to read,
use bold font instead.

3 years agohid: Add UPDATING entry and bump __FreeBSD_version
Vladimir Kondratyev [Wed, 6 Jan 2021 13:44:11 +0000 (16:44 +0300)]
hid: Add UPDATING entry and bump __FreeBSD_version

Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D28019

3 years agohid: Import hidmap-based drivers written by Greg V
Vladimir Kondratyev [Wed, 14 Oct 2020 22:02:15 +0000 (01:02 +0300)]
hid: Import hidmap-based drivers written by Greg V

This change includes:

hpen    - Generic / MS Windows compatible HID pen tablet driver.
hgame   - Generic game controller and joystick driver.
xb360gp - Xbox360-compatible game controller driver.

Submitted by: Greg V <greg_unrelenting.technology>
Reviewed by: hselasky (as part of D27993)

3 years agohid: Import hidmap and bunch of drivers based on it
Vladimir Kondratyev [Wed, 14 Oct 2020 22:02:15 +0000 (01:02 +0300)]
hid: Import hidmap and bunch of drivers based on it

hidmap is a kernel module that maps HID input usages to evdev events.

Following dependent drivers is included in the commit:

hms       - HID mouse driver.
hcons     - Consumer page AKA Multimedia keys driver.
hsctrl    - System Controls page (Power/Sleep keys) driver.
ps4dshock - Sony DualShock 4 gamepad driver.

Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D27993

3 years agoevdev: Implement fuzz.
Vladimir Kondratyev [Mon, 30 Nov 2020 21:10:04 +0000 (00:10 +0300)]
evdev: Implement fuzz.

Fuzz is used to filter noise from the event stream.
Upcoming gamepad drivers use it.

Reviewed by: hselasky (as part of D27993)

3 years agohidraw(4): Add HIDRAW_MAKE_UHID_ALIAS kernel option
Vladimir Kondratyev [Sun, 13 Dec 2020 09:37:55 +0000 (12:37 +0300)]
hidraw(4): Add HIDRAW_MAKE_UHID_ALIAS kernel option

which installs /dev/uhid# alias to hidraw character device for
compatibility with some existing uhid(4) users like Firefox.
As side effect it renames traditional uhid(4) driver to hidraw
to make possible using of common unit number allocator.

Requested by: Greg V <greg_unrelenting.technology>
Reviewed by: hselasky (as part of D27992)

3 years agohid: Import hidraw(4) - driver for access to raw HID device data
Vladimir Kondratyev [Wed, 14 Oct 2020 00:52:47 +0000 (03:52 +0300)]
hid: Import hidraw(4) - driver for access to raw HID device data

This driver provides raw access to HID devices through uhid(4)-compatible
interface and is based on pre-8.x uhid(4) code. Unlike uhid(4) it does
not take devices in to monopoly ownership and allows parallel access
from other drivers.

hidraw supports Linux's hidraw-compatible interface as well.

Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D27992

3 years agohkbd(4): Split driver lock on interrupt and syscons locks
Vladimir Kondratyev [Mon, 9 Nov 2020 19:25:14 +0000 (22:25 +0300)]
hkbd(4): Split driver lock on interrupt and syscons locks

This allows to mark HID-device interrupt handlers as MP-SAFE.
Atomics-based lockless key event queue with swi_giant taskqueue is used
to pass key-press events into Giant-protected system console.

Reviewed by: hselasky (as part of D27991)

3 years agohid: Port ukbd to HID and attach to build
Vladimir Kondratyev [Mon, 12 Oct 2020 19:52:29 +0000 (22:52 +0300)]
hid: Port ukbd to HID and attach to build

Reviewed by: hselasky
Differential revision:  https://reviews.freebsd.org/D27991

3 years agohid: Copy ukbd(4) to HID subsystem.
Vladimir Kondratyev [Sun, 11 Oct 2020 22:36:35 +0000 (01:36 +0300)]
hid: Copy ukbd(4) to HID subsystem.

3 years agohid: Port multitouch hmt(4) driver to hidbus and attach to build
Vladimir Kondratyev [Sat, 10 Oct 2020 23:42:25 +0000 (02:42 +0300)]
hid: Port multitouch hmt(4) driver to hidbus and attach to build

Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D27990

3 years agohid: Copy wmt(4) to HID subsystem as a base to upcoming hmt(4) driver.
Vladimir Kondratyev [Sat, 10 Oct 2020 21:47:21 +0000 (00:47 +0300)]
hid: Copy wmt(4) to HID subsystem as a base to upcoming hmt(4) driver.

3 years agohid: Import hconf(4) - digitizer configuration top-level collection support.
Vladimir Kondratyev [Sat, 10 Oct 2020 21:45:17 +0000 (00:45 +0300)]
hid: Import hconf(4) - digitizer configuration top-level collection support.

Reviewed by: hselasky (as part of D27990)

3 years agohid: Import usbhid - USB transport backend for HID subsystem.
Vladimir Kondratyev [Thu, 8 Oct 2020 21:32:12 +0000 (00:32 +0300)]
hid: Import usbhid - USB transport backend for HID subsystem.

This change implements hid_if.m methods for HID-over-USB protocol [1].

Also, this change adds USBHID_ENABLED kernel option which changes
device_probe() priority and adds/removes PnP records to prefer usbhid
over ums, ukbd, wmt and other USB HID device drivers and vice-versa.

The module is based on uhid(4) driver.  It is disabled by default for
now due to conflicts with existing USB HID drivers.

[1] https://www.usb.org/sites/default/files/hid1_11.pdf

Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D27893

3 years agohid: Import iichid - I2C transport backend for HID subsystem
Vladimir Kondratyev [Tue, 6 Oct 2020 21:50:16 +0000 (00:50 +0300)]
hid: Import iichid - I2C transport backend for HID subsystem

This implements hid_if.m methods for HID-over-I2C protocol [1].

Following kernel options are added:

IICHID_SAMPLING - Enable support for a sampling mode as interrupt
                  resource acquisition is not always possible in a case
                  of GPIO interrupts.
IICHID_DEBUG    - Enable debug output.

The module is based on prior Marc Priggemeyer work (D16698).

[1] http://download.microsoft.com/download/7/d/d/7dd44bb7-2a7a-4505-ac1c-7227d3d96d5b/hid-over-i2c-protocol-spec-v1-0.docx

Differential revision: https://reviews.freebsd.org/D27892

3 years agohid: Import quirk subsystem.
Vladimir Kondratyev [Mon, 5 Oct 2020 10:42:53 +0000 (13:42 +0300)]
hid: Import quirk subsystem.

hidquirk(4) is derived from usb_quirk(4) and inherits all its HID-related
functionality. It does not support ioctl(2) interface yet.

Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D27890

3 years agohid: Import hidbus(4)
Vladimir Kondratyev [Fri, 9 Oct 2020 01:10:23 +0000 (04:10 +0300)]
hid: Import hidbus(4)

This driver provides support for multiple HID driver attachments
to single HID transport backend. This ability existed in Net/OpenBSD
(uhidev and ihidev drivers) but has never been ported to FreeBSD.
Unlike Net/OpenBSD we do not use report number alone to distinct report
source but we follow MS way and use a top level collection (TLC) usage
index that report belongs to as a location key.

The driver performs child device autodiscovery based on HID report
descriptor data, proxying of HID requests from child devices to parent
transport backends and broadcasting of interrupts in backward direction.

Differential revision: https://reviews.freebsd.org/D27888

3 years agohid: Import HID transport method definitions and helper functions.
Vladimir Kondratyev [Tue, 6 Oct 2020 19:42:22 +0000 (22:42 +0300)]
hid: Import HID transport method definitions and helper functions.

Create an abstract HID interface that provides hardware independent
access to HID capabilities and functions through the device tree.

hid_if.m resembles existing USBHID KPI and consist of next methods:

HID method USBHID variant
-----------------------------------------------------------------------
hid_intr_setup usbd_transfer_setup (INTERRUPT IN xfer)
hid_intr_unsetup usbd_transfer_unsetup (INTERRUPT IN xfer)
hid_intr_start usbd_transfer_start (INTERRUPT IN xfer)
hid_intr_stop usbd_transfer_drain (INTERRUPT IN xfer)
hid_intr_poll usbd_transfer_poll (INTERRUPT IN xfer)

hid_get_rdesc usbd_req_get_report_descriptor
hid_read No direct analog. Not intended for common use.
hid_write uhid(4) write()
hid_get_report usbd_req_get_report
hid_set_report usbd_req_set_report
hid_set_idle usbd_req_set_idle
hid_set_protocol usbd_req_set_protocol

This change is part of D27888

3 years agohid: Chase for HID function name changes in existing USB HID drivers
Vladimir Kondratyev [Fri, 1 Jan 2021 18:23:01 +0000 (21:23 +0300)]
hid: Chase for HID function name changes in existing USB HID drivers

Also hide shim code added in a previous commit under COMPAT_USBHID12.

Note: it is enough to add -DCOMPAT_USBHID12 to CFLAGS to compile old
code with new HID subsystem, but it is not enough to link it at runtime.
HID dependency has to be added explicitly with MODULE_DEPEND macro.

Reviewed by: manu, hselasky (as part of D27887)

3 years agohid: Import functions and constants required by new subsystem
Vladimir Kondratyev [Mon, 5 Oct 2020 09:38:11 +0000 (12:38 +0300)]
hid: Import functions and constants required by new subsystem

This does an import of quirk stubs, debugging macros from USB code and
numerous usage constants used by dependent drivers.

Besides, this change renames some functions to get a better matching
with userland library and NetBSD/OpenBSD HID code. Namely:

- Old hid_report_size() renamed to hid_report_size_max()
- New hid_report_size() calculates size of given report rather than
  maximum size of all reports.
- hid_get_data_unsigned() renamed to hid_get_udata()
- hid_put_data_unsigned() renamed to hid_put_udata()

Compat shim functions are provided in usbhid.h to make possible compile
of legacy code unmodified after this change.

Reviewed by: manu, hselasky
Differential revision: https://reviews.freebsd.org/D27887

3 years agoFactor-out hardware-independent part of USB HID support to new module
Vladimir Kondratyev [Sun, 4 Oct 2020 22:21:08 +0000 (01:21 +0300)]
Factor-out hardware-independent part of USB HID support to new module

It will be used by the upcoming HID-over-i2C implementation.  Should be
no-op, except hid.ko module dependency is to be added to affected drivers.

Reviewed by: hselasky, manu
Differential revision: https://reviews.freebsd.org/D27867

3 years agoCopy HID over USB support files to new sys/dev/hid directory
Vladimir Kondratyev [Tue, 6 Oct 2020 14:58:31 +0000 (17:58 +0300)]
Copy HID over USB support files to new sys/dev/hid directory

3 years agolibkern/strcasestr.c: Drop xlocale support and connect to build.
Vladimir Kondratyev [Tue, 6 Oct 2020 14:50:52 +0000 (17:50 +0300)]
libkern/strcasestr.c: Drop xlocale support and connect to build.

Reviewed by: markj, hselasky
Differential revision: https://reviews.freebsd.org/D27866

3 years agoCopy strcasestr.c from libc to libkern.
Vladimir Kondratyev [Tue, 21 Apr 2020 22:38:14 +0000 (01:38 +0300)]
Copy strcasestr.c from libc to libkern.

3 years agoevdev: Allow open() handler to be interrupted by a signal
Vladimir Kondratyev [Tue, 21 Apr 2020 22:38:14 +0000 (01:38 +0300)]
evdev: Allow open() handler to be interrupted by a signal

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)

3 years agoevdev: Make open(2) and close(3) handlers sleepable.
Vladimir Kondratyev [Tue, 21 Apr 2020 10:26:58 +0000 (13:26 +0300)]
evdev: Make open(2) and close(3) handlers sleepable.

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

3 years agoevdev: Remove useless "initial value" parameter from evdev_support_abs()
Vladimir Kondratyev [Mon, 30 Nov 2020 15:10:41 +0000 (18:10 +0300)]
evdev: Remove useless "initial value" parameter from evdev_support_abs()

It can not be used for setting of state of multitouch events.
If necessary, use evdev_push_event() instead of it.

3 years agoAllow HID report descriptor parser to return more then 1 usage per item
Vladimir Kondratyev [Thu, 24 Dec 2020 11:46:24 +0000 (14:46 +0300)]
Allow HID report descriptor parser to return more then 1 usage per item

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

3 years agohid_locate: do not ignore constant items.
Vladimir Kondratyev [Thu, 24 Dec 2020 11:46:24 +0000 (14:46 +0300)]
hid_locate: do not ignore constant items.

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

3 years agoRewrite the disk I/O management system in fsck_ffs(8). Other than
Kirk McKusick [Thu, 7 Jan 2021 01:37:08 +0000 (17:37 -0800)]
Rewrite the disk I/O management system in fsck_ffs(8). Other than
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

3 years agodu: tests: make H_flag tests more strict about output requirements
Kyle Evans [Tue, 5 Jan 2021 21:49:46 +0000 (15:49 -0600)]
du: tests: make H_flag tests more strict about output requirements

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

3 years agodu: tests: fix the H_flag test (primarily grep usage)
Kyle Evans [Tue, 5 Jan 2021 21:33:06 +0000 (15:33 -0600)]
du: tests: fix the H_flag test (primarily grep usage)

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

3 years agostand: remove bogus dependency from libsa32
Kyle Evans [Thu, 7 Jan 2021 22:02:55 +0000 (16:02 -0600)]
stand: remove bogus dependency from libsa32

libsa32 is independent of libsa, they can build in parallel if needed.

3 years agostand: avoid adding fdt SUBDIR_DEPEND if WITHOUT_FDT is set
Kyle Evans [Thu, 7 Jan 2021 21:59:38 +0000 (15:59 -0600)]
stand: avoid adding fdt SUBDIR_DEPEND if WITHOUT_FDT is set

This unbreaks the efi build if WITHOUT_FDT is set.

Reported by: peterj

3 years agopf: Copy kif flags to userspace
Kristof Provost [Thu, 7 Jan 2021 21:24:38 +0000 (22:24 +0100)]
pf: Copy kif flags to userspace

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

3 years agoiflib: ensure that tx interrupts enabled and cleanups
Matt Macy [Sat, 19 Dec 2020 01:08:33 +0000 (17:08 -0800)]
iflib: ensure that tx interrupts enabled and cleanups

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

3 years agovfs: fix rangelock range in vn_rdwr() for IO_APPEND
Chuck Silvers [Wed, 6 Jan 2021 20:04:25 +0000 (12:04 -0800)]
vfs: fix rangelock range in vn_rdwr() for IO_APPEND

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

3 years agoFix date
Mateusz Piotrowski [Thu, 7 Jan 2021 20:15:26 +0000 (21:15 +0100)]
Fix date

It's 2021 already.

Reported by: delphij

3 years agoarm64: enable build of the ipmi module
Mitchell Horne [Wed, 6 Jan 2021 20:27:40 +0000 (16:27 -0400)]
arm64: enable build of the ipmi module

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

3 years agoRefactor rt_addrmsg() and rt_routemsg().
Alexander V. Chernikov [Thu, 7 Jan 2021 19:13:52 +0000 (19:13 +0000)]
Refactor rt_addrmsg() and rt_routemsg().

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

3 years agoarmv8crypto: add AES-XTS support
Mitchell Horne [Thu, 7 Jan 2021 19:30:40 +0000 (15:30 -0400)]
armv8crypto: add AES-XTS support

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

3 years agoloader: do not update palette in text mode
Toomas Soome [Thu, 7 Jan 2021 07:07:59 +0000 (09:07 +0200)]
loader: do not update palette in text mode

Apparently palette update while in text mode, will cause
some adapters to end up with blank display.

3 years agoisci: use maxphys rather than 128KB to size s/g list
Andrew Gallatin [Thu, 7 Jan 2021 17:45:46 +0000 (12:45 -0500)]
isci: use maxphys rather than 128KB to size s/g list

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

3 years agoFix the bug in committers-ports.dot with my mentor.
Neel Chauhan [Thu, 7 Jan 2021 15:52:11 +0000 (07:52 -0800)]
Fix the bug in committers-ports.dot with my mentor.

Reviewed by:            0mp
Approved by:            0mp (mentor)
Differential Revision:  https://reviews.freebsd.org/D28022

3 years agosrc.conf.5: regenerate after MK_WERROR change
Alex Richardson [Thu, 7 Jan 2021 16:15:58 +0000 (16:15 +0000)]
src.conf.5: regenerate after MK_WERROR change

This was missed in 7fa2f2a62f04f095e1e27ad55aa22a8f59b1df8f.

3 years agoarm64 GENERIC: sort to match amd64, to ease comparison
Ed Maste [Wed, 6 Jan 2021 17:45:52 +0000 (12:45 -0500)]
arm64 GENERIC: sort to match amd64, to ease comparison

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

3 years agoAdd support for PL2303HXN to uplcom(4).
Hans Petter Selasky [Thu, 7 Jan 2021 14:34:26 +0000 (15:34 +0100)]
Add support for PL2303HXN to uplcom(4).

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

3 years agoAdd new PCI ID for XHCI(4).
Hans Petter Selasky [Thu, 7 Jan 2021 14:27:24 +0000 (15:27 +0100)]
Add new PCI ID for XHCI(4).

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoFix a typo
Mateusz Piotrowski [Thu, 7 Jan 2021 14:28:29 +0000 (15:28 +0100)]
Fix a typo

MFC after: 3 days

3 years agolibcompat: remove redundant path for ncurses
Baptiste Daroussin [Thu, 7 Jan 2021 14:14:52 +0000 (15:14 +0100)]
libcompat: remove redundant path for ncurses

Reported by: kevans

3 years agoprepare-commit-msg: Avoid warning on macOS and shellcheck fixes
Alex Richardson [Thu, 7 Jan 2021 14:00:32 +0000 (14:00 +0000)]
prepare-commit-msg: Avoid warning on macOS and shellcheck fixes

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

3 years agoDrop some unncessary stale code from Makefile.boot
Alex Richardson [Wed, 16 Dec 2020 16:57:09 +0000 (16:57 +0000)]
Drop some unncessary stale code from Makefile.boot

No longer required after 0e1e341b486cdf4769195ba1e5b3cb32e7387873.

3 years agotools/build/make.py: Fix macOS build after a920b9817
Alex Richardson [Tue, 22 Dec 2020 16:14:32 +0000 (17:14 +0100)]
tools/build/make.py: Fix macOS build after a920b9817

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.

3 years agoRename NO_WERROR -> MK_WERROR=no
Alex Richardson [Wed, 6 Jan 2021 17:55:06 +0000 (17:55 +0000)]
Rename NO_WERROR -> MK_WERROR=no

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

3 years agoStop passing MK_WARNS=no for bootstrap tools
Alex Richardson [Wed, 6 Jan 2021 17:52:02 +0000 (17:52 +0000)]
Stop passing MK_WARNS=no for bootstrap tools

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

3 years agoFix warnings during bootstrap phase on macOS
Alex Richardson [Mon, 14 Dec 2020 16:14:04 +0000 (16:14 +0000)]
Fix warnings during bootstrap phase on macOS

3 years agoFix warnings during bootstrap on Linux systems
Alex Richardson [Mon, 14 Dec 2020 10:52:15 +0000 (10:52 +0000)]
Fix warnings during bootstrap on Linux systems

Most warnings are currently off for the boostrap phase, but once D27598
lands they will be enabled again.

3 years agoFix all warnings emitted in `make kernel-toolchain`
Alex Richardson [Wed, 6 Jan 2021 17:51:03 +0000 (17:51 +0000)]
Fix all warnings emitted in `make kernel-toolchain`

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

3 years agoinclude: Use printf(1) instead of shell loops for header symlinks
Alex Richardson [Wed, 6 Jan 2021 17:46:36 +0000 (17:46 +0000)]
include: Use printf(1) instead of shell loops for header symlinks

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

3 years agoAdd mkimg to the list of bootstrap tools
Alex Richardson [Wed, 6 Jan 2021 17:08:52 +0000 (17:08 +0000)]
Add mkimg to the list of bootstrap tools

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

3 years agoFix -Wpointer-sign warnings in makefs and mkimg
Alex Richardson [Wed, 6 Jan 2021 17:05:29 +0000 (17:05 +0000)]
Fix -Wpointer-sign warnings in makefs and mkimg

Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D27175

3 years agoInstall dtrace.h and dependencies
Alex Richardson [Wed, 6 Jan 2021 15:39:10 +0000 (15:39 +0000)]
Install dtrace.h and dependencies

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

3 years agoReference newfs_msdos(8) from the newfs(8) manual
Mateusz Piotrowski [Thu, 7 Jan 2021 09:22:20 +0000 (10:22 +0100)]
Reference newfs_msdos(8) from the newfs(8) manual

PR: 252484
Reported by: Graham Perrin <grahamperrin@gmail.com>
MFC after: 3 days

3 years agonetmap: bridge: fix NS_MOREFRAG support
Vincenzo Maffione [Thu, 7 Jan 2021 07:00:43 +0000 (07:00 +0000)]
netmap: bridge: fix NS_MOREFRAG support

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

3 years agoAdd my name/handle/mentor to committers-ports.dot
Neel Chauhan [Thu, 7 Jan 2021 01:30:21 +0000 (17:30 -0800)]
Add my name/handle/mentor to committers-ports.dot

3 years agoFix bug in expanding lost+found direct blocks.
Kirk McKusick [Thu, 7 Jan 2021 00:31:33 +0000 (16:31 -0800)]
Fix bug in expanding lost+found direct blocks.

Reported by:  Peter Holm
Sponsored by: Netflix

3 years agocache: unengrish the comment in previous commit
Mateusz Guzik [Wed, 6 Jan 2021 23:44:05 +0000 (23:44 +0000)]
cache: unengrish the comment in previous commit

Reported by: rpokala, brd

3 years agopfctl: Fix NOCLEAN build
Kristof Provost [Wed, 6 Jan 2021 21:07:25 +0000 (22:07 +0100)]
pfctl: Fix NOCLEAN build

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

3 years agoarm64: QorIQ: gpio: return BUS_PROBE_DEFAULT
Marcin Wojtas [Wed, 6 Jan 2021 14:18:53 +0000 (15:18 +0100)]
arm64: QorIQ: gpio: return BUS_PROBE_DEFAULT

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

3 years agoarm64: QorIQ: gpio: Cleanup qoriq_gpio_* helpers
Marcin Wojtas [Wed, 6 Jan 2021 14:15:55 +0000 (15:15 +0100)]
arm64: QorIQ: gpio: Cleanup qoriq_gpio_* helpers

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

3 years agoarm64: QorIQ: gpio: Style cleanups
Marcin Wojtas [Wed, 6 Jan 2021 14:10:42 +0000 (15:10 +0100)]
arm64: QorIQ: gpio: Style cleanups

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

3 years agobectl(8): sync man page and help text
Robert Wing [Wed, 6 Jan 2021 19:38:25 +0000 (10:38 -0900)]
bectl(8): sync man page and help text

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

3 years agogstat(8): Bump .Dd
Fernando Apesteguía [Wed, 6 Jan 2021 18:03:06 +0000 (19:03 +0100)]
gstat(8): Bump .Dd

Forgotten in cfaa2958dc44c20f56a19fe490ee4d7c02f50bef

PR: 251313
Differential Revision: https://reviews.freebsd.org/D27815

3 years agogstat(8): Document interactive keyboard commands
Fernando Apesteguía [Tue, 29 Dec 2020 21:07:11 +0000 (22:07 +0100)]
gstat(8): Document interactive keyboard commands

gstat(8) allows for <, >, c, f, F and q while in interactive mode.

PR: 251313
Submitted by: bojan_petrovic@fastmail.fm
Approved by: manpages (0mp@)
Differential Revision: https://reviews.freebsd.org/D27815

3 years agoFix a couple of typos and formatting issues
Mateusz Piotrowski [Wed, 6 Jan 2021 15:19:15 +0000 (16:19 +0100)]
Fix a couple of typos and formatting issues

3 years agovtfontcvt is part of bootstrap toolset and should always be built
Toomas Soome [Wed, 6 Jan 2021 12:45:40 +0000 (14:45 +0200)]
vtfontcvt is part of bootstrap toolset and should always be built

Reported by: Peter Jeremy

3 years agoloader: instead of hw.vga.textmode, use screen.textmode
Toomas Soome [Wed, 6 Jan 2021 11:46:34 +0000 (13:46 +0200)]
loader: instead of hw.vga.textmode, use screen.textmode

hw.vga.textmode is directing VT VGA backend to use text mode.

The default screen mode for BIOS loader is text, and default
screen mode for VT VGA backend is graphics (unless we are running on
hypervisor or hw.vga.textmode is set to 1). Using hw.vga.textmode
for loader does remove possibility to have graphical mode VT VGA with
text mode loader.

screen.textmode can have possible values "0" to disable text mode,
and "1" to set text mode.

3 years agoloader: remove left over call to unsetenv()
Toomas Soome [Wed, 6 Jan 2021 11:56:48 +0000 (13:56 +0200)]
loader: remove left over call to unsetenv()

We do not touch kern.vt.fb.default_mode.