]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoelfctl: style(9): use C99 uintX_t types
emaste [Wed, 4 Mar 2020 16:53:49 +0000 (16:53 +0000)]
elfctl: style(9): use C99 uintX_t types

Sponsored by: The FreeBSD Foundation

4 years agoWhen using automatically generated flow labels and using TCP SYN
tuexen [Wed, 4 Mar 2020 16:41:25 +0000 (16:41 +0000)]
When using automatically generated flow labels and using TCP SYN
cookies, use the same flow label for the segments sent during the
handshake and after the handshake.
This fixes a bug by making sure that sc_flowlabel is always stored in
network byte order.

Reviewed by: bz@
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D23957

4 years agoAdd new ICMPv6 counters for Anti-DoS limits.
bz [Wed, 4 Mar 2020 16:20:59 +0000 (16:20 +0000)]
Add new ICMPv6 counters for Anti-DoS limits.

Add four new counters for ND6 related Anti-DoS measures.
We split these out into a separate upfront commit so that we only
change the struct size one time.  Implementations using them will
follow.

PR: 157410
Reviewed by: melifaro
MFC after: 2 weeks
X-MFC: cannot really MFC this without breaking netstat
Sponsored by: Netflix (initially)
Differential Revision: https://reviews.freebsd.org/D22711

4 years agoUpdate ismt(4) man page for r358595.
jhibbits [Wed, 4 Mar 2020 14:56:32 +0000 (14:56 +0000)]
Update ismt(4) man page for r358595.

Submitted by: Dmitry Luhtionov
X-MFC-With: r358595
Sponsored by: Juniper Networks, Inc

4 years agoDon't send an uninitilised traffic class in the IPv6 header, when
tuexen [Wed, 4 Mar 2020 12:22:53 +0000 (12:22 +0000)]
Don't send an uninitilised traffic class in the IPv6 header, when
sending a TCP segment from the TCP SYN cache (like a SYN-ACK).
This fix initialises it to zero. This is correct for the ECN bits,
but is does not honor the DSCP what an application might have set via
the IPPROTO_IPV6 level socket options IPV6_TCLASS. That will be
fixed separately.

Reviewed by: Richard Scheffenegger
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D23900

4 years ago[aacraid] Add missing unmap call for SYNC mode
luporl [Wed, 4 Mar 2020 12:21:38 +0000 (12:21 +0000)]
[aacraid] Add missing unmap call for SYNC mode

This issue was observed on a PowerPC64 machine with an Adaptec RAID Controller
with PCI device ID 0x028d. After several read/write operations, the kernel was
panic'ing in bus_dmamap_sync(). This was due to a missing aac_unmap_command()
in the SYNC path.

PR: 237463
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D23668

4 years agoRestart the USB keyboard repeat timer at every valid key-press.
hselasky [Wed, 4 Mar 2020 09:46:42 +0000 (09:46 +0000)]
Restart the USB keyboard repeat timer at every valid key-press.

This fixes a regression issue after r357861.

Reported by: James Wright <james.wright@jigsawdezign.com>
PR: 224592
PR: 233884
MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoif vm_pager_get_pages_async() returns an error, release the sfio->nios
chs [Wed, 4 Mar 2020 00:22:50 +0000 (00:22 +0000)]
if vm_pager_get_pages_async() returns an error, release the sfio->nios
refcount that we took earlier that represents the I/O that ended up
not being started.

Reviewed by: glebius
Approved by: imp (mentor)
Sponsored by: Netflix

4 years agosys/signalvar.h: Fix opposite boolean sense in comment
cem [Tue, 3 Mar 2020 23:15:30 +0000 (23:15 +0000)]
sys/signalvar.h: Fix opposite boolean sense in comment

Correct the sense of the comment describing sigsetmasked() to match the
code.  It was exactly backwards.

While here, convert the type/values of the predicate from pre-C99 int/1/0 to
bool/true/false.  No functional change.

4 years agoAdd Atom C3000 (Denverton) SMT PCI ID
jhibbits [Tue, 3 Mar 2020 22:23:56 +0000 (22:23 +0000)]
Add Atom C3000 (Denverton) SMT PCI ID

MFC after: 3 days
Sponsored by: Juniper Networks, Inc

4 years agodumpon: skip size check if using zstd
vangyzen [Tue, 3 Mar 2020 22:14:23 +0000 (22:14 +0000)]
dumpon: skip size check if using zstd

As with gzip, let the dump device be smaller than physical memory
when using zstd and full dumps.

Also print the error message if the size check fails, even if -v
is not specified.  Failing silently is not friendly.

Reviewed by: cem markj
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D23923

4 years agoUse ifr_data_get_ptr() consistently.
brooks [Tue, 3 Mar 2020 18:58:43 +0000 (18:58 +0000)]
Use ifr_data_get_ptr() consistently.

4 years agoExpose ifr_buffer_get_(buffer|length) outside if.c.
brooks [Tue, 3 Mar 2020 18:05:11 +0000 (18:05 +0000)]
Expose ifr_buffer_get_(buffer|length) outside if.c.

This is a preparatory commit for D23933.

Reviewed by: jhb

4 years agoGet rid of silly /* FALLTHROUGH */ lines
imp [Tue, 3 Mar 2020 17:40:29 +0000 (17:40 +0000)]
Get rid of silly /* FALLTHROUGH */ lines

Consistently omit /* FALLTHROUGH */ when we have a case statement that does
nothing. Since compilers don't warn about stacked case statements, and we were
inconsistent, resolve by removing extras.

4 years agoSkip if_epair regression test if module doesn't exist
olivier [Tue, 3 Mar 2020 17:35:15 +0000 (17:35 +0000)]
Skip if_epair regression test if module doesn't exist

Approved by: kp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D23876

4 years agoWhen closing a LinuxKPI file always use the real release function to avoid
hselasky [Tue, 3 Mar 2020 15:49:34 +0000 (15:49 +0000)]
When closing a LinuxKPI file always use the real release function to avoid
resource leakage when destroying a LinuxKPI character device.

Submitted by: Andrew Boyer <aboyer@pensando.io>
Reviewed by: kib@
PR: 244572
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoFix dynamic redrects by adding forgotten RTF_HOST flag.
melifaro [Tue, 3 Mar 2020 15:33:43 +0000 (15:33 +0000)]
Fix dynamic redrects by adding forgotten RTF_HOST flag.
Improve tests to verify the generated route flags.

Reported by: jtl
MFC after: 2 weeks

4 years agoFix the spelling of aliasing.
andrew [Tue, 3 Mar 2020 15:31:40 +0000 (15:31 +0000)]
Fix the spelling of aliasing.

Sponsored by: Innovate UK

4 years agoMove the arm64 cache identification to identcpu.c
andrew [Tue, 3 Mar 2020 15:25:01 +0000 (15:25 +0000)]
Move the arm64 cache identification to identcpu.c

This allows us to call it on a per-CPU basis and to warn if the details
are different across CPUs.

While here read the L1 I-Cache type and store this for use later by pmap.

Sponsored by: Innovate UK

4 years agoIncrease number of write completion threads, matching ZoL.
mav [Tue, 3 Mar 2020 15:05:13 +0000 (15:05 +0000)]
Increase number of write completion threads, matching ZoL.

Our iSCSI benchmarks on a large 80-core system show that previous limit
of 8 threads can be a bottleneck.  At some points this change increases
write IOPS by as much as 50%.  I am still not sure that so many threads
is really required, but we tested lower amounts and got no significant
benefits, while latencies were a bit worse, so decided to not diverge.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

4 years agotcp_hpts: make RSS kernel compile again.
bz [Tue, 3 Mar 2020 14:15:30 +0000 (14:15 +0000)]
tcp_hpts: make RSS kernel compile again.

Add proper #includes, and #ifdefs and some style fixes to make RSS
kernels compile again.  There are still possible issues with uin16_t
vs. uint_t cpuid which I am not going near.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D23726

4 years agoupic_ktrls: make RSS compile again here
bz [Tue, 3 Mar 2020 14:07:44 +0000 (14:07 +0000)]
upic_ktrls: make RSS compile again here

The results of ktls_get_cpu() are stored in u_int and NETISR_CPUID_NONE
requires u_int.  Adjust uint16_t to uint_t in order to make RSS kernels
compile some more again.

HPTS still has to be fixed, which is a bit more complicated.

Reviewed by: jhb, gallatin, rrs
Differential Revision: https://reviews.freebsd.org/D23726

4 years agoip6: retire in6_selectroute_fib() as promised 8 years ago
bz [Tue, 3 Mar 2020 13:48:12 +0000 (13:48 +0000)]
ip6: retire in6_selectroute_fib() as promised 8 years ago

In r231852 I added in6_selectroute_fib() as a compat function with the
fibnum as an extra argument compared to in6_selectroute() to keep the
KPI stable.
Way too late retire this function again and add the fib to in6_selectroute()
which also only has a single consumer now and was an orphan function before.

4 years agopowerd.8: Improve style & fix typos
0mp [Tue, 3 Mar 2020 13:25:08 +0000 (13:25 +0000)]
powerd.8: Improve style & fix typos

- Sort options.
- Do not use macros (like .Ar) to specify width for Bl (macros within that
  string are not expanded).
- Use Cm instead of Ar for mode names.
- Fix some typos reported by mandoc.
- Move the documentation of the PID file from the -P flag description to
  the FILES section.

Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D23941

4 years agoFix the spelling of the VIPT cache type field
andrew [Tue, 3 Mar 2020 12:50:45 +0000 (12:50 +0000)]
Fix the spelling of the VIPT cache type field

Sponsored by: Innovate UK

4 years agoip6_output: use new routing KPI when not passed a cached route
bz [Tue, 3 Mar 2020 11:32:47 +0000 (11:32 +0000)]
ip6_output: use new routing KPI when not passed a cached route

Implement the equivalent of r347375 (IPv4) for the IPv6 output path.
In IPv6 we get passed a cached route (and inp) by udp6_output()
depending on whether we acquired a write lock on the INP.
In case we neither bind nor connect a first UDP packet would come in
with a cached route (wlocked) and all further packets would not.
In case we bind and do not connect we never write-lock the inp.

When we do not pass in a cached route, rather than providing the
storage for a route locally and pass it over the old lookup code
and down the stack, use the new route lookup KPI and acquire all
details we need to send the packet.

Compared to the IPv4 code the IPv6 code has a couple of possible
complications: given an option with a routing hdr/caching route there,
and path mtu (ro_pmtu) case which now equally has to deal with the
possibility of having a route which is NULL passed in, and the
fwd_tag in case a firewall changes the next hop (something to
factor out in the future).

Sponsored by: Netflix
Reviewed by: glebius
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23886

4 years agothr_self.2: Fix some typos in the thread identifier range
0mp [Tue, 3 Mar 2020 09:51:53 +0000 (09:51 +0000)]
thr_self.2: Fix some typos in the thread identifier range

Reported by: kaktus
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D23936

4 years agoin6_fib: return nh_ia in the ext interface as we do for IPv4
bz [Tue, 3 Mar 2020 09:50:33 +0000 (09:50 +0000)]
in6_fib: return nh_ia in the ext interface as we do for IPv4

Like for IPv4 add nh_ia to the ext interface and return rt_ifa
in order to be used for, e.g., packet/octets accounting purposes.

Reviewed by: melifaro
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D23873

4 years agofib6_rte_to_nh_*: return a link-local gw address with scope embedded
bz [Tue, 3 Mar 2020 09:45:16 +0000 (09:45 +0000)]
fib6_rte_to_nh_*: return a link-local gw address with scope embedded

In fib6_rte_to_nh_* when returning a link-local gateway address
currently we do clear the scope. That could be recovered using
the ifp returned as well, but the code in general seems to
expect a link-local address with scope embeedded as otherwise
the "dst" (gw) passed to the output routines will not include
scope and not send the packet out (the right interface).

Do not clear the scope when returning a link-local address and
allow packets to go out (the right interface).

Remove the (now) extra scope recovery in the IPv6 fast-fwd code.

Sponsored by: Netflix
Reviewed by: melifaro, ae
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23872

4 years agoStore the boot exception level on arm64 so it can be queried later
andrew [Tue, 3 Mar 2020 08:28:16 +0000 (08:28 +0000)]
Store the boot exception level on arm64 so it can be queried later

A hypervisor, e.g. bhyve, will need to know what exception levelthe kernel
was in when it started booting. If it was EL2 we can then enable said
hypervisor.

Store the boot exception level and allow the kernel to later query it.

Obtained from: https://github.com/FreeBSD-UPB/freebsd (earlier version)
Sponsored by: Innovate UK

4 years agopowerpc/powernv: powernv_node_numa_domain() fix non-NUMA case
jhibbits [Tue, 3 Mar 2020 03:22:00 +0000 (03:22 +0000)]
powerpc/powernv: powernv_node_numa_domain() fix non-NUMA case

If NUMA is not enabled in the kernel config, or is disabled at boot, this
function should just return domain 0 regardless of what's in the device
tree.

Fixes a panic in iflib with NUMA disabled.

Reported by: luporl

4 years agoIn r358471, we interrupted the case block that would eventually lead
csjp [Tue, 3 Mar 2020 01:46:35 +0000 (01:46 +0000)]
In r358471, we interrupted the case block that would eventually lead
to the path related tokens not being processed. Restore this behavior and
and move AUE_JAIL_SET in this block, as it may conditionally contain a
path token.

Discovered by: kevans
PR: 244537
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D23929

4 years agoFix the malloc type used in sys_shm_unlink() after r354808.
markj [Tue, 3 Mar 2020 00:28:37 +0000 (00:28 +0000)]
Fix the malloc type used in sys_shm_unlink() after r354808.

PR: 244563
Reported by: swills

4 years agoAdd extremely useful calendar(1) application to FreeBSD
cem [Tue, 3 Mar 2020 00:20:08 +0000 (00:20 +0000)]
Add extremely useful calendar(1) application to FreeBSD

It does extremely useful things like execute sendmail and spew dubiously
accurate factoids.

From the feedback, it seems like it is an essential utility in a modern unix
and not at all a useless bikeshed.  How do those Linux people live without it?
Reverts r358561.

4 years agoFix typo in r278616
cem [Mon, 2 Mar 2020 23:37:47 +0000 (23:37 +0000)]
Fix typo in r278616

FreeBSD isn't an encyclopedia.

4 years agoRetire macros:
cy [Mon, 2 Mar 2020 23:25:02 +0000 (23:25 +0000)]
Retire macros:

BSD_GE_YEAR
BSD_GT_YEAR
BSD_LT_YEAR

MFC after: 3 days

4 years agoRemove the now unused FREEBSD_GE_REV, FREEBSD_GT_REV, and FREEBSD_LT_REV
cy [Mon, 2 Mar 2020 23:24:58 +0000 (23:24 +0000)]
Remove the now unused FREEBSD_GE_REV, FREEBSD_GT_REV, and FREEBSD_LT_REV
macros.

MFC after: 3 days

4 years agoContinuing the effort started in r343701, #ifdef cleanup, checking for
cy [Mon, 2 Mar 2020 23:24:53 +0000 (23:24 +0000)]
Continuing the effort started in r343701, #ifdef cleanup, checking for
__FreeBSD_version > 3.0 and 5.0 is redundant.

MFC after: 3 days

4 years agoAdd support for the TFTP windowsize option described in RFC 7440.
jhb [Mon, 2 Mar 2020 22:19:30 +0000 (22:19 +0000)]
Add support for the TFTP windowsize option described in RFC 7440.

The windowsize option permits multiple blocks to be transmitted
before the receiver sends an ACK improving throughput for larger
files.

Reviewed by: asomers
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D23836

4 years agocpufreq_dt: Improve multiple opp support
manu [Mon, 2 Mar 2020 21:19:51 +0000 (21:19 +0000)]
cpufreq_dt: Improve multiple opp support

When looking for cpu with the same OPP starts from the root /cpus node
so each instance of cpufreq_dt will now each cpu with the same operating
point.
Also test that the node we are testing have the property "device_type" set
to be equal to "cpu".
While here add more debug printfs (off by defaults).

MFC after: 2 weeks

4 years agoAdd deprecation notices to ctau and cx drivers
emaste [Mon, 2 Mar 2020 20:14:27 +0000 (20:14 +0000)]
Add deprecation notices to ctau and cx drivers

These support outdated or obsolete ISA WAN (T1/E1) sync serial cards,
and these drivers haven't really been touched (other than in tree-wide
sweeps to keep them building) for 15+ years.

Related PCI devices ce and cp are still in the tree, with deprecation
proposed in D23928.

MFC after: 1 week
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

4 years agohexdump: tests: take into account byte order
kevans [Mon, 2 Mar 2020 18:40:34 +0000 (18:40 +0000)]
hexdump: tests: take into account byte order

Hexdump test was failling on big endian systems when testing decimal, octal
and hexa outputs as the tests were designed on a little endian system. This
revision adds the two distinct flavors of output expected and determines at
runtime which to compare against.

Submitted by: Renato Riolino <renato.riolino_eldorado.org.br>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23191

4 years ago[aacraid] Prevent sense data from causing a buffer overflow
luporl [Mon, 2 Mar 2020 16:11:25 +0000 (16:11 +0000)]
[aacraid] Prevent sense data from causing a buffer overflow

This issue was observed on a PowerPC64 machine with an Adaptec RAID
Controller with PCI device ID 0x028d, where sense data was causing a
buffer overflow because of wrong max sense length logic.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D23667

4 years agopkgbase: remove logic for _profile packages
kevans [Mon, 2 Mar 2020 15:58:50 +0000 (15:58 +0000)]
pkgbase: remove logic for _profile packages

We don't produce these anymore as of r356797, remove the remnant in
generate-ucl.sh that accounted for them. This isn't strictly necessary, but
future work is needed for the various packages that can be generated on a
lib build.

Namely, we may produce -development packages for private/internal libs that
should be installed but won't have the base FreeBSD-libfoo pkg to depend on
because it's internal (e.g. liby, libpmcstat, libifconfig) but we want the
headers installed. It may be a better move to just shove these into
-runtime-development instead, but if not then we've just simplified the
cases that need to take private/internal libs into account.

4 years agosys/: Document few more sysctls.
kaktus [Mon, 2 Mar 2020 15:30:52 +0000 (15:30 +0000)]
sys/: Document few more sysctls.

Submitted by: Antranig Vartanian <antranigv@freebsd.am>
Reviewed by: kaktus
Commented by: jhb
Approved by: kib (mentor)
Sponsored by: illuria security
Differential Revision: https://reviews.freebsd.org/D23759

4 years agoAdd a space missed in r358545
andrew [Mon, 2 Mar 2020 14:36:15 +0000 (14:36 +0000)]
Add a space missed in r358545

Sponsored by: Innovate UK

4 years agoelfctl: tiny style(9) cleanup, use bool where appropriate
emaste [Mon, 2 Mar 2020 14:34:26 +0000 (14:34 +0000)]
elfctl: tiny style(9) cleanup, use bool where appropriate

4 years agoGenerate the offsets for struct arm64_bootparams and use it in locore.S
andrew [Mon, 2 Mar 2020 14:06:50 +0000 (14:06 +0000)]
Generate the offsets for struct arm64_bootparams and use it in locore.S

This removes one place with hard coded offsets in locore.S

Sponsored by: Innovate UK

4 years agoRemove old contrib/libstdc++, unused since r358454
emaste [Mon, 2 Mar 2020 14:04:09 +0000 (14:04 +0000)]
Remove old contrib/libstdc++, unused since r358454

Sponsored by: The FreeBSD Foundation

4 years agoExpose the ACPI power button, sleep button and LID state as evdev's.
hselasky [Mon, 2 Mar 2020 09:45:06 +0000 (09:45 +0000)]
Expose the ACPI power button, sleep button and LID state as evdev's.

This allows libinput to disable touchpads when the lid is closed and
various desktop environments can show power-off dialogs when the power
button is pressed. While the latter is doable with devd a
cross-platform solution is nicer.

Submitted by: Greg V <greg@unrelenting.technology>
Differential Revision: https://reviews.freebsd.org/D23863
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoMFV r358511,r358532:
mm [Mon, 2 Mar 2020 08:44:58 +0000 (08:44 +0000)]
MFV r358511,r358532:

Sync libarchive with vendor.

Relevant vendor changes:
  Issue #1257: Add testcase for ZIPX files with LZMA_STREAM_END marker
  PR #1331: cpio.5: fix hard link description
  Issue #1335: archive_read.c: fix UBSan warning about undefined behavior
  Issue #1338: XAR reader: fix UBSan warning about undefined behavior
  Issue #1339: bsdcpio_test: fix datatype in from_hex()
  Issue #1341: Safe writes: delete temporary file if rename fails.
  Issue #1341: Safe writes: improve error handling

MFC after: 1 week

4 years agoelfctl: initialize features
kevans [Mon, 2 Mar 2020 04:22:38 +0000 (04:22 +0000)]
elfctl: initialize features

GCC points out a couple levels down in convert_to_features that this may be
used uninitialized. Indeed, this is true- initialize it to NULL so that we
at least deref a null pointer.

4 years agoif_edsc: generate an arbitrary MAC address
kevans [Mon, 2 Mar 2020 02:45:57 +0000 (02:45 +0000)]
if_edsc: generate an arbitrary MAC address

When generating an cloned interface instance in edsc_clone_create(),
generate a MAC address from the FF OUI with ether_gen_addr(). This allows us
to have unique local-link addresses. Previously, the MAC address was zero.

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Differential Revision: https://reviews.freebsd.org/D23842

4 years agoMove ELF feature note tool to usr.bin/elfctl
emaste [Mon, 2 Mar 2020 02:36:41 +0000 (02:36 +0000)]
Move ELF feature note tool to usr.bin/elfctl

elfctl is a tool for modifying the NT_FREEBSD_FEATURE_CTL ELF note,
which contains a set of flags for enabling or disabling vulnerability
mitigations and other features.

Reviewed by: csjp, kib
MFC after: 2 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23910

4 years agoUpdate vendor/libarchive/dist to git 85b9f665b6a2d4397fdd38992152d011265e374b
mm [Mon, 2 Mar 2020 02:12:53 +0000 (02:12 +0000)]
Update vendor/libarchive/dist to git 85b9f665b6a2d4397fdd38992152d011265e374b

Relevant vendor changes:
  Issue #1257: Add testcase for ZIPX files with LZMA_STREAM_END marker
  PR #1331: cpio.5: fix hard link description
  Issue #1335: archive_read.c: fix UBSan warning about undefined behavior
  Issue #1338: XAR reader: fix UBSan warning about undefined behavior
  Issue #1339: bsdcpio_test: fix datatype in from_hex()
  Issue #1341: Safe writes: delete temporary file if rename fails

4 years agoRemove BROOKTREE_ALLOC_PAGES now that bktr is now gone.
imp [Mon, 2 Mar 2020 00:23:31 +0000 (00:23 +0000)]
Remove BROOKTREE_ALLOC_PAGES now that bktr is now gone.

4 years agoRemove obsolete old-freebsd version compat shim.
imp [Sun, 1 Mar 2020 23:01:51 +0000 (23:01 +0000)]
Remove obsolete old-freebsd version compat shim.

4 years agoRemove pre-FreeBSD 11 compat code.
imp [Sun, 1 Mar 2020 23:01:47 +0000 (23:01 +0000)]
Remove pre-FreeBSD 11 compat code.

4 years agoRemove stale FreeBSD_version checks.
imp [Sun, 1 Mar 2020 23:01:37 +0000 (23:01 +0000)]
Remove stale FreeBSD_version checks.

4 years agoRemove comment about Blackthorn winds, apparently imported from 4.4BSD
grog [Sun, 1 Mar 2020 22:10:37 +0000 (22:10 +0000)]
Remove comment about Blackthorn winds, apparently imported from 4.4BSD
Lite.  Nowadays it's trivial to find the explanation, such as at
https://www.deseret.com/2000/2/27/19493013/blackthorn-winds-make-bushes-bud.
It doesn't seem appropriate to replace it with an explanation.

4 years agoAvoid doubly wiring a newly allocated page in vm_page_grab_valid().
markj [Sun, 1 Mar 2020 22:09:11 +0000 (22:09 +0000)]
Avoid doubly wiring a newly allocated page in vm_page_grab_valid().

This fixes a regression from r358363.

Reported by: manu, jbeich
Tested by: jbeich

4 years agovfs: stop taking additional refs on root vnode during lookup
mjg [Sun, 1 Mar 2020 21:54:28 +0000 (21:54 +0000)]
vfs: stop taking additional refs on root vnode during lookup

They are spurious since introduction of struct pwd, which provides them
implicitly.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23885

4 years agofd: move vnodes out of filedesc into a dedicated structure
mjg [Sun, 1 Mar 2020 21:53:46 +0000 (21:53 +0000)]
fd: move vnodes out of filedesc into a dedicated structure

The new structure is copy-on-write. With the assumption that path lookups are
significantly more frequent than chdirs and chrooting this is a win.

This provides stable root and jail root vnodes without the need to reference
them on lookup, which in turn means less work on globally shared structures.
Note this also happens to fix a bug where jail vnode was never referenced,
meaning subsequent access on lookup could run into use-after-free.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23884

4 years agofd: make fgetvp_rights work without the filedesc lock
mjg [Sun, 1 Mar 2020 21:50:13 +0000 (21:50 +0000)]
fd: make fgetvp_rights work without the filedesc lock

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23883

4 years agovm: add debug to uma_zone_set_smr
mjg [Sun, 1 Mar 2020 21:49:16 +0000 (21:49 +0000)]
vm: add debug to uma_zone_set_smr

Reviewed by: markj, rlibby
Differential Revision: https://reviews.freebsd.org/D23902

4 years agoFinish removal of bktr
imp [Sun, 1 Mar 2020 20:37:42 +0000 (20:37 +0000)]
Finish removal of bktr

Remove the old ioctl .h files
Remove copying/linking ioctl .h files in instasllworld
Remove bktr from lint
Add now-removed files with ObsoleteFiles

4 years agoreadelf: add PROTMAX_DISABLE and STKGAP_DISABLE
emaste [Sun, 1 Mar 2020 20:25:57 +0000 (20:25 +0000)]
readelf: add PROTMAX_DISABLE and STKGAP_DISABLE

From r349609 (PROTMAX_DISABLE) and r354790 (STKGAP_DISABLE).  Commited
upstream (in a slightly different form) as r3831.

Sponsored by: The FreeBSD Foundation

4 years agocontrolelf: fix indentation for larger flags
emaste [Sun, 1 Mar 2020 20:19:38 +0000 (20:19 +0000)]
controlelf: fix indentation for larger flags

Sponsored by: The FreeBSD Foundation

4 years agoRemove bktr(4)
imp [Sun, 1 Mar 2020 19:15:03 +0000 (19:15 +0000)]
Remove bktr(4)

Remove the brooktree driver as discussed on arch@. Bump FreeBSD version to
1300082, though I doubt anything will care.

Relnote: yes

4 years agoFix build.
delphij [Sun, 1 Mar 2020 18:55:59 +0000 (18:55 +0000)]
Fix build.

4 years agoRemove noise that once upon a time allowed netback to build on FreeBSD 6. The
imp [Sun, 1 Mar 2020 18:18:11 +0000 (18:18 +0000)]
Remove noise that once upon a time allowed netback to build on FreeBSD 6. The
network layer has evolved since then, and this won't compile there.

4 years agoRemove FreeBSD 8 support from virtio.
imp [Sun, 1 Mar 2020 18:18:07 +0000 (18:18 +0000)]
Remove FreeBSD 8 support from virtio.

The sbuf API has evolved since 8, as have many others. The other API sweeps
didn't make the changes conditional, so this is now noise.

4 years agoRemove support for FreeBSD 4-7 from the iscsi initiator.
imp [Sun, 1 Mar 2020 18:18:01 +0000 (18:18 +0000)]
Remove support for FreeBSD 4-7 from the iscsi initiator.

Also, inline/remove now empty or trivial macros. CAM has evolved enough this
code couldn't work there anyway, and the API sweeep commits made since then were
made unconditional.

4 years agoRemove conditional code for FreeBSD 8 and earlier frmo cxgb.
imp [Sun, 1 Mar 2020 18:17:56 +0000 (18:17 +0000)]
Remove conditional code for FreeBSD 8 and earlier frmo cxgb.

4 years agoFinish removing support from old versions
imp [Sun, 1 Mar 2020 18:17:51 +0000 (18:17 +0000)]
Finish removing support from old versions

Eliminate code for old versions, inline pci_find_cap instead of relying on
compat ifdef.

This commit should have been combined with r358488 before pushing it in.

4 years agoRemove FreeBSD 7-10 support from bxe driver.
imp [Sun, 1 Mar 2020 17:46:28 +0000 (17:46 +0000)]
Remove FreeBSD 7-10 support from bxe driver.

Use new PCIER and PCIEM names in the driver rather than relying on old, compat
shims.

4 years agoRemove support for FreeBSD 8 systems. These workarounds and ways of rescanning
imp [Sun, 1 Mar 2020 17:27:35 +0000 (17:27 +0000)]
Remove support for FreeBSD 8 systems. These workarounds and ways of rescanning
devices are no longer done.

4 years agoRemove all the compatibility hacks for systems that predate FreeBSD 8. Some of
imp [Sun, 1 Mar 2020 17:27:30 +0000 (17:27 +0000)]
Remove all the compatibility hacks for systems that predate FreeBSD 8. Some of
these look to be cut and pasted from other drivers since this driver was
committed to FreeBSD 7-current and MFC'd to FreeBSD 6. The ones for FreeBSD 4
and 5 likely never were working...

4 years agoRemove compatibility code for changing sysctl definitions for pre FreeBSD 9
imp [Sun, 1 Mar 2020 17:27:25 +0000 (17:27 +0000)]
Remove compatibility code for changing sysctl definitions for pre FreeBSD 9
versions. These are just noise these days.

4 years agoRemove FreeBSD 7 conditional code... We've had a lot of other changes since then
imp [Sun, 1 Mar 2020 16:45:54 +0000 (16:45 +0000)]
Remove FreeBSD 7 conditional code... We've had a lot of other changes since then
and al_eth appears only in the Annapurna ARM designs which arrived in the tree
after that.

4 years agolinuxulator: Map scheduler priorities to Linux priorities.
tijl [Sun, 1 Mar 2020 13:12:04 +0000 (13:12 +0000)]
linuxulator: Map scheduler priorities to Linux priorities.

On Linux the valid range of priorities for the SCHED_FIFO and SCHED_RR
scheduling policies is [1,99].  For SCHED_OTHER the single valid priority is
0.  On FreeBSD it is [0,31] for all policies.  Programs are supposed to
query the valid range using sched_get_priority_(min|max), but of course some
programs assume the Linux values are valid.

This commit adds a tunable compat.linux.map_sched_prio.  When enabled
sched_get_priority_(min|max) return the Linux values and sched_setscheduler
and sched_(get|set)param translate between FreeBSD and Linux values.

Because there are more Linux levels than FreeBSD levels, multiple Linux
levels map to a single FreeBSD level, which means pre-emption might not
happen as it does on Linux, so the tunable allows to disable this behaviour.
It is enabled by default because I think it is unlikely that anyone runs
real-time software under Linux emulation on FreeBSD that critically relies
on correct pre-emption.

This fixes FMOD, a commercial sound library used by several games.

PR: 240043
Tested by: Alex S <iwtcex@gmail.com>
Reviewed by: dchagin
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23790

4 years agoRemove stale definitions. The removed definitions are not used right
tuexen [Sun, 1 Mar 2020 12:34:27 +0000 (12:34 +0000)]
Remove stale definitions. The removed definitions are not used right
now and are incompatible with the correct ones in RFC 3168.

Submitted by: Richard Scheffenegger
Differential Revision: https://reviews.freebsd.org/D23903

4 years agoAdd -N option to powerd(8) to ignore "nice" time.
cperciva [Sat, 29 Feb 2020 22:31:23 +0000 (22:31 +0000)]
Add -N option to powerd(8) to ignore "nice" time.

With powerd_flags="-N", this makes powerd(8) exclude "nice" time when
computing the CPU utilization.  This makes it possible to prevent
CPU-intensive "background" processes from spinning up the CPU.

Note that only *userland* CPU usage belonging to "nice" processes is
excluded; we do not track whether time spent in the kernel is on behalf
of nice or non-nice processes, so kernel-intensive nice processes can
still result in the CPU being sped up.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23868

4 years agoRemove support for varios versions from FreeBSD 4 to 8.
imp [Sat, 29 Feb 2020 22:16:27 +0000 (22:16 +0000)]
Remove support for varios versions from FreeBSD 4 to 8.

There's no way arcmsr will still work on those versions. Cleanup really old code
that's no longer needed.

4 years agoadd deprecation notice for bktr driver.
imp [Sat, 29 Feb 2020 21:50:08 +0000 (21:50 +0000)]
add deprecation notice for bktr driver.

We plan to remove bktr(4) in FreeBSD 13. Document that here.

Relnotes: yes

4 years agoCI: print wired page count on boot
emaste [Sat, 29 Feb 2020 19:59:21 +0000 (19:59 +0000)]
CI: print wired page count on boot

This is a first step in tracking kernel memory use over time.

4 years agoCurrently kernel audit events for jail_set(2), jail_get(2), jail_attach(2),
csjp [Sat, 29 Feb 2020 19:17:24 +0000 (19:17 +0000)]
Currently kernel audit events for jail_set(2), jail_get(2), jail_attach(2),
jail_remove(2) and finally setloginclass(2) are not being converted and
committed into userspace. Add the cases for these syscalls and make sure
they are being converted properly.

Reviewed by: bz, kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23882

4 years agoEnsure that arm64 thread structures are allocated from the direct map.
markj [Sat, 29 Feb 2020 18:41:48 +0000 (18:41 +0000)]
Ensure that arm64 thread structures are allocated from the direct map.

Otherwise we can fail to handle translation faults on curthread, leading
to a panic.

Reviewed by: alc, rlibby
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23895

4 years agoregen src.conf.5 for r358468, GPL_DTC removal
emaste [Sat, 29 Feb 2020 17:24:02 +0000 (17:24 +0000)]
regen src.conf.5 for r358468, GPL_DTC removal

4 years agoretire in-tree GPL dtc devicetree compiler
emaste [Sat, 29 Feb 2020 17:10:54 +0000 (17:10 +0000)]
retire in-tree GPL dtc devicetree compiler

Now that we no longer have GCC 4.2.1 in the tree and can assume FreeBSD
is being built with a C++11 compiler available, we can use BSDL dtc
unconditionally and retire the GPL dtc.

GPL dtc now has FreeBSD CI support via Cirrus-CI to help ensure it
continues to build/work on FreeBSD and is available in the ports tree
if needed.

The copy of (copyfree licensed) libfdt that we actually use is in
sys/contrib/libfdt so the extra copy under contrib/dtc/libfdt can be
removed along with the rest of the GPL dtc.

Reviewed by: kevans, ian, imp, manu, theraven
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23192

4 years agoFix the following -Werror warning from clang 10.0.0:
dim [Sat, 29 Feb 2020 14:11:27 +0000 (14:11 +0000)]
Fix the following -Werror warning from clang 10.0.0:

sys/arm64/arm64/identcpu.c:1170:5: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                                break;
                                ^
sys/arm64/arm64/identcpu.c:1168:4: note: previous statement is here
                        if (fv[j].desc[0] != '\0')
                        ^

The break should be after the if statement, indented one level less.

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D23871

4 years agoremove contrib/gperf
emaste [Sat, 29 Feb 2020 13:25:38 +0000 (13:25 +0000)]
remove contrib/gperf

gperf was used only as a build tool for GCC, and is not needed after
r358454.

Sponsored by: The FreeBSD Foundation

4 years agoFix test cases after r358448
lwhsu [Sat, 29 Feb 2020 13:24:41 +0000 (13:24 +0000)]
Fix test cases after r358448

sbin.pfctl.pfctl_test.pf0087
sbin.pfctl.pfctl_test.selfpf0087

MFC with: r358448
Sponsored by: The FreeBSD Foundation

4 years agosrc.opts.mk: simplify Clang and lld bootstrap defaults
emaste [Sat, 29 Feb 2020 13:15:01 +0000 (13:15 +0000)]
src.opts.mk: simplify Clang and lld bootstrap defaults

With the retirement of GCC 4.2.1 we can assume the host compiler supports
C++11, and can simplify the Clang and LLD defaults.  Clang and lld are now
enabled by default everywhere, and are used as the bootstrap compiler and
linker for all targets except MIPS.

Sponsored by: The FreeBSD Foundation

4 years agoregen src.conf.5 after r358460, LLVM_LIBUNWIND option retirement
emaste [Sat, 29 Feb 2020 12:46:02 +0000 (12:46 +0000)]
regen src.conf.5 after r358460, LLVM_LIBUNWIND option retirement

4 years agoretire the LLVM_LIBUNWIND option
emaste [Sat, 29 Feb 2020 12:43:43 +0000 (12:43 +0000)]
retire the LLVM_LIBUNWIND option

LLVM's libunwind is used on all FreeBSD-supported CPU architectures and
is a required component.

Reviewed by: brooks (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23123

4 years agoRemove contrib/gcc and contrib/gcclibs
emaste [Sat, 29 Feb 2020 12:40:27 +0000 (12:40 +0000)]
Remove contrib/gcc and contrib/gcclibs

GCC 4.2.1 was disconnected from FreeBSD in r358454.

Sponsored by: The FreeBSD Foundation

4 years agoregen src.conf.5 after r358454, GCC 4.2.1 retirement
emaste [Sat, 29 Feb 2020 03:43:18 +0000 (03:43 +0000)]
regen src.conf.5 after r358454, GCC 4.2.1 retirement

4 years agoremove GCC 4.2.1 build infrastructure
emaste [Sat, 29 Feb 2020 03:25:51 +0000 (03:25 +0000)]
remove GCC 4.2.1 build infrastructure

As described in Warner's email message[1] to the FreeBSD-arch mailing
list we have reached GCC 4.2.1's retirement date.  At this time all
supported architectures either use in-tree Clang, or rely on external
toolchain (i.e., a contemporary GCC version from ports).

GCC 4.2.1 was released July 18, 2007 and was imported into FreeBSD later
that year, in r171825.  GCC has served us well, but version 4.2.1 is
obsolete and not used by default on any architecture in FreeBSD.  It
does not support modern C and does not support arm64 or RISC-V.

Thanks to everyone responsible for maintaining, updating, and testing
GCC in the FreeBSD base system over the years.

So long, and thanks for all the fish.

[1] https://lists.freebsd.org/pipermail/freebsd-arch/2020-January/019823.html

PR: 228919
Reviewed by: brooks, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23124

4 years agoProvide a lock free alternative to resolve bogus pages. This is not likely
jeff [Fri, 28 Feb 2020 21:42:48 +0000 (21:42 +0000)]
Provide a lock free alternative to resolve bogus pages.  This is not likely
to be much of a perf win, just a nice code simplification.

Reviewed by: markj, kib
Differential Revision: https://reviews.freebsd.org/D23866