]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoRemove 'make update'.
John Baldwin [Fri, 11 Jun 2021 21:56:28 +0000 (14:56 -0700)]
Remove 'make update'.

In the CVS days this used be a wrapper around either CVS or CVSup and
used to support updating src, doc, and ports checkouts.  With the move
to subversion this only supported updating src and was itself a
wrapper around 'svn update'.  With Git, users are probably better off
using appropriate Git commands directly to update without needing an
explicit make target as a wrapper.

Reviewed by: bcr, imp, emaste
Differential Revision: https://reviews.freebsd.org/D30736

3 years agoRemove an manpage
Warner Losh [Fri, 11 Jun 2021 20:40:13 +0000 (14:40 -0600)]
Remove an manpage

3 years agomtk: Add printing of CPU model
Warner Losh [Fri, 11 Jun 2021 20:13:31 +0000 (14:13 -0600)]
mtk: Add printing of CPU model

Add the line that's in other foo_machdep.c file where the CPU model is
reported.

This was part of github pull request 459, but in a different way. The
rest of that pull request was either committed or not relevant. I did it
in a more correct way.

Submitted by: Priit Trees
Sponsored by: Netflix

3 years agomtk: Initialize mask correctly.
Priit Trees [Fri, 11 Jun 2021 20:12:08 +0000 (14:12 -0600)]
mtk: Initialize mask correctly.

Initialization of mask is missing. Fixes a compile issue.

Reviewed by: imp@
Pull Request: https://github.com/freebsd/freebsd-src/pull/459

3 years agoChange "compiled" to "assembled"
Warner Losh [Fri, 11 Jun 2021 19:58:51 +0000 (13:58 -0600)]
Change "compiled" to "assembled"

Assembly files are assembled, not compiled.

Submitted by: github user gAlfonso-bit
Pull Request: https://github.com/freebsd/freebsd-src/pull/474

Sponsored by: Netflix

3 years agobsdinstall: Allow automation in jails
eoli3n [Mon, 7 Jun 2021 20:49:02 +0000 (22:49 +0200)]
bsdinstall: Allow automation in jails

Set SCRIPT=/path/to/script env var to be able to automate bsdinstall to
a jail.

Pull Request: https://github.com/freebsd/freebsd-src/pull/473
Reviewed by: allanjude

3 years agoancontrol: Remove an(4) utility
Emmanuel Vadot [Mon, 7 Jun 2021 16:48:57 +0000 (18:48 +0200)]
ancontrol: Remove an(4) utility

Last an(4) devices have been End Of Life and End Of Sale in 2007.
Time to remove this driver.

Differential Revision: https://reviews.freebsd.org/D30680
Reviewed by: imp (earlier version), emaste (earlier version)
Sponsored by: Diablotin Systems

3 years agoan: Remove driver
Emmanuel Vadot [Mon, 7 Jun 2021 16:48:00 +0000 (18:48 +0200)]
an: Remove driver

Last an(4) devices have been End Of Life and End Of Sale in 2007.
Time to remove this driver.

Differential Revision: https://reviews.freebsd.org/D30679
Reviewed by: imp (earlier version), emaste (earlier version)
Sponsored by: Diablotin Systems

3 years agoan: Deprecate the driver
Emmanuel Vadot [Mon, 7 Jun 2021 16:45:58 +0000 (18:45 +0200)]
an: Deprecate the driver

Last an(4) devices have been End Of Life and End Of Sale in 2007.
Time to remove this driver.

Differential Revision: https://reviews.freebsd.org/D30678
Reviewed by: imp (earlier version), adrian (earlier version)
MFC after: 3 days
Sponsored by: Diablotin Systems

3 years agoarm64: allwinner: Add i2s and codec support
Oleksandr Tymoshenko [Thu, 13 May 2021 19:10:38 +0000 (21:10 +0200)]
arm64: allwinner: Add i2s and codec support

Differential Revision: https://reviews.freebsd.org/D27830

3 years agoarm64: Add Soc audio framework
Oleksandr Tymoshenko [Thu, 13 May 2021 19:09:50 +0000 (21:09 +0200)]
arm64: Add Soc audio framework

This framework is initial implementation of the simple-audio-card compatible
audio driver framework. It provides glue for CPU/codec/aux device.

Differential Revision: https://reviews.freebsd.org/D27830

3 years agotcp: remove debug output from RACK
Michael Tuexen [Fri, 11 Jun 2021 13:43:38 +0000 (15:43 +0200)]
tcp: remove debug output from RACK

Reported by: iron.udjin@gmail.com, Marek Zarychta
Reviewed by: rrs
PR: 256538
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D30723
Sponsored by: Netflix, Inc.

3 years agostyle: Relax 80 column rule
Warner Losh [Fri, 11 Jun 2021 16:37:36 +0000 (10:37 -0600)]
style: Relax 80 column rule

Note that the 80 column rule has been relaxed for some time when things
are clearer when a little longer. Add in that things that people grep
for, such as error messages, shouldn't be broken up which is the most
common reason people exceed 80 columns intentionally.

Reviewed by: jhb, domagoj.stolfa@gmail.com
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30255

3 years agostyle: tweak tab after #define advice
Warner Losh [Fri, 11 Jun 2021 16:33:04 +0000 (10:33 -0600)]
style: tweak tab after #define advice

Once upon a time, #define<tab> was cultural thing. However, even when it
was promulgated, it was a minority usage. 20 years ago the split was
30k/69k (tab/space) and today the split is 80k/546k (tab/space). Update
guidance to allow either with the usual suggestion to be consistent
within a file.

Reviewed by: sef, allenjude, 0mp (prior rev), jhb
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30254

3 years agolibnv: optimize nvlist size calculation
Mariusz Zaborski [Fri, 11 Jun 2021 15:35:36 +0000 (17:35 +0200)]
libnv: optimize nvlist size calculation

If we had a multiple nvlist, during nvlist_pack, we calculated the size
of every nvlist separately. For example, if we had a nvlist with three
nodes each containing another (A contains B, and B contains C), we first
calculated the size of nvlist A (which contains B, C), then we calculate
the size of B (which contains C, notice that we already did the
calculation of B, when we calculate A), and finally C. This means that
this calculation was O(N!). This was done because each time we pack
nvlist, we have to put its size in the header
(the separate header for A, B, and C).

To not break the ABI and to reduce the complexity of nvlist_size,
instead of calculating the nvlist size when requested,
we track the size of each nvlist.

Reported by: pjd, kp
Tested by: kp

3 years agotcp: Missing mfree in rack and bbr
Randall Stewart [Fri, 11 Jun 2021 15:38:08 +0000 (11:38 -0400)]
tcp: Missing mfree in rack and bbr

Recently (Nov) we added logic that protects against a peer negotiating a timestamp, and
then not including a timestamp. This involved in the input path doing a goto done_with_input
label. Now I suspect the code was cribbed from one in Rack that has to do with the SYN.
This had a bug, i.e. it should have a m_freem(m) before going to the label (bbr had this
missing m_freem() but rack did not). This then caused the missing m_freem to show
up in both BBR and Rack. Also looking at the code referencing m->m_pkthdr.lro_nsegs
later (after processing) is not a good idea, even though its only for logging. Best to
copy that off before any frees can take place.

Reviewed by: mtuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30727

3 years agoImprove handling of USB device re-open in the LibUSB v1.x API.
Hans Petter Selasky [Fri, 11 Jun 2021 15:06:10 +0000 (17:06 +0200)]
Improve handling of USB device re-open in the LibUSB v1.x API.

Make sure the "device_is_gone" flag is cleared after every successful open,
so that the "device_is_gone" flag doesn't persist forever.

Found by: sergii.dmytruk@3mdeb.com
PR: 256296
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agotcp: fix two bugs in new reno
Michael Tuexen [Fri, 11 Jun 2021 13:37:39 +0000 (15:37 +0200)]
tcp: fix two bugs in new reno

* Completely initialise the CC module specific data
* Use beta_ecn in case of an ECN event whenever ABE is enabled
  or it is requested by the stack.

Reviewed by: rscheff, rrs
MFC after: 3 days
Sponsored by: Netflix, Inc.

3 years agoAdd new USB ID to u3g(4).
Hans Petter Selasky [Fri, 11 Jun 2021 10:53:22 +0000 (12:53 +0200)]
Add new USB ID to u3g(4).

Submitted by: pierre-jean.gineste@nuabee.fr
PR: 231909
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agotcp: fix compilation of IPv4-only builds
Michael Tuexen [Fri, 11 Jun 2021 07:50:46 +0000 (09:50 +0200)]
tcp: fix compilation of IPv4-only builds

PR: 256538
Reported by: iron.udjin@gmail.com
MFC after: 3 days
Sponsored by: Netflix, Inc.

3 years agospl: Fix gcc6 build
Warner Losh [Fri, 11 Jun 2021 03:28:52 +0000 (21:28 -0600)]
spl: Fix gcc6 build

-Wno-error= is only a clang flag, restrict its use to only clang.

Sponsored by: Netflix

3 years agotools: Remove obsolete svn information.
Warner Losh [Fri, 11 Jun 2021 00:50:46 +0000 (18:50 -0600)]
tools: Remove obsolete svn information.

Reviewed by: jhb@
Differential Revision: https://reviews.freebsd.org/D30720
Sponsored by: Netflix

3 years agotests/sys/netpfil: Move common tests out from behind MK_PF.
Brad Davis [Thu, 10 Jun 2021 23:01:53 +0000 (17:01 -0600)]
tests/sys/netpfil: Move common tests out from behind MK_PF.

Approved by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agozfs: unbreak build with clang 12
Martin Matuska [Thu, 10 Jun 2021 23:31:56 +0000 (01:31 +0200)]
zfs: unbreak build with clang 12

Change -Wno-error-atomic-alignment to -Wno-error=atomic-alignment
in the Makefile of libspl.

Reported by: Ed Maste <emaste@FreeBSD.org>
Fix by: Alexander Richardson <arichardson@FreeBSD.org>

3 years agolibalias: tidy up housekeeping
Lutz Donnerhacke [Sat, 15 May 2021 15:35:36 +0000 (17:35 +0200)]
libalias: tidy up housekeeping

Replace current expensive, but sparsly called housekeeping
by a single, repetive action.

This is part of a larger restructure of libalias in order to switch to
more efficient data structures.  The whole restructure process is
split into 15 reviews to ease reviewing.  All those steps will be
squashed into a single commit for MFC in order to hide the
intermediate states from production systems.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30277

3 years agolinuxkpi: Add list_for_each_entry_lockless() macro
Neel Chauhan [Thu, 10 Jun 2021 15:14:20 +0000 (08:14 -0700)]
linuxkpi: Add list_for_each_entry_lockless() macro

This is needed by the drm-kmod 5.7 update.

Approved by: hselasky (src)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D30708

3 years agommc(4), mmcsc(4): Remove missing Xref
Fernando Apesteguía [Thu, 10 Jun 2021 13:11:22 +0000 (15:11 +0200)]
mmc(4), mmcsc(4): Remove missing Xref

There is no evidence of at91_mci in the code whatsoever. Most of the at91
drivers where removed in 802baf0ba66c18ca52aeaf4a3e7b05e85d8e4d3b

PR: 218970
Reported by: reezer@reezer.org

Approved by: imp@
Differential Revision: https://reviews.freebsd.org/D29193

3 years agoports(7): Add install-missing-packages to target list
Fernando Apesteguía [Fri, 30 Apr 2021 10:39:04 +0000 (12:39 +0200)]
ports(7): Add install-missing-packages to target list

It is already used in the EXAMPLES section.

Approved by: bcr@ (manpages)
Differential Revision: https://reviews.freebsd.org/D30044

3 years agotcp: Mbuf leak while holding a socket buffer lock.
Randall Stewart [Thu, 10 Jun 2021 12:33:57 +0000 (08:33 -0400)]
tcp: Mbuf leak while holding a socket buffer lock.

When running at NF the current Rack and BBR changes with the recent
commits from Richard that cause the socket buffer lock to be held over
the ip_output() call and then finally culminating in a call to tcp_handle_wakeup()
we get a lot of leaked mbufs. I don't think that this leak is actually caused
by holding the lock or what Richard has done, but is exposing some other
bug that has probably been lying dormant for a long time. I will continue to
look (using his changes) at what is going on to try to root cause out the issue.

In the meantime I can't leave the leaks out for everyone else. So this commit
will revert all of Richards changes and move both Rack and BBR back to just
doing the old sorwakeup_locked() calls after messing with the so_rcv buffer.

We may want to look at adding back in Richards changes after I have pinpointed
the root cause of the mbuf leak and fixed it.

Reviewed by: mtuexen,rscheff
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30704

3 years agopf: use M_WAITOK where possible
Kristof Provost [Wed, 9 Jun 2021 12:00:07 +0000 (14:00 +0200)]
pf: use M_WAITOK where possible

In the ioctl path use M_WAITOK allocations whereever possible. These are
less sensitive to memory pressure, and ioctl requests have no hard
deadlines.

Reviewed by: donner
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30702

3 years agolinux(4): Regen for ppoll_time64 system call.
Dmitry Chagin [Thu, 10 Jun 2021 12:19:12 +0000 (15:19 +0300)]
linux(4): Regen for ppoll_time64 system call.

MFC after: 2 weeks

3 years agolinux(4): Implement ppoll_time64 system call.
Dmitry Chagin [Thu, 10 Jun 2021 12:18:46 +0000 (15:18 +0300)]
linux(4): Implement ppoll_time64 system call.

MFC after: 2 weeks

3 years agoSplit kern_poll() on two counterparts.
Dmitry Chagin [Thu, 10 Jun 2021 12:11:25 +0000 (15:11 +0300)]
Split kern_poll() on two counterparts.

The kern_poll_kfds() operates on clear kernel data, kfds points to an
array in the kernel, while kern_poll() operates on user supplied pollfd.
Move nfds check to kern_poll_maxfds().

No functional changes, it's for future use in the Linux emulation layer.

Reviewd by: kib
Differential Revision: https://reviews.freebsd.org/D30690
MFC after: 2 weeks

3 years agolinux(4): Regen for pselect6_time64 system call.
Dmitry Chagin [Thu, 10 Jun 2021 12:04:37 +0000 (15:04 +0300)]
linux(4): Regen for pselect6_time64 system call.

MFC after: 2 weeks

3 years agolinux(4): Implement pselect6_time64 system call.
Dmitry Chagin [Thu, 10 Jun 2021 12:03:30 +0000 (15:03 +0300)]
linux(4): Implement pselect6_time64 system call.

MFC after: 2 weeks

3 years agolinux(4): Regen for rt_sigtimedwait_time64 system call.
Dmitry Chagin [Thu, 10 Jun 2021 11:52:43 +0000 (14:52 +0300)]
linux(4): Regen for rt_sigtimedwait_time64 system call.

MFC after: 2 weeks

3 years agolinux(4): Implement rt_sigtimedwait_time64 system call.
Dmitry Chagin [Thu, 10 Jun 2021 11:51:30 +0000 (14:51 +0300)]
linux(4): Implement rt_sigtimedwait_time64 system call.

It still does not work as intended, awaits D30675.

MFC after: 2 weeks

3 years agolinux(4): Regen for futex_time64 system call.
Dmitry Chagin [Thu, 10 Jun 2021 11:28:25 +0000 (14:28 +0300)]
linux(4): Regen for futex_time64 system call.

MFC after: 2 weeks

3 years agolinux(4): Implement futex_time64 system call.
Dmitry Chagin [Thu, 10 Jun 2021 11:27:06 +0000 (14:27 +0300)]
linux(4): Implement futex_time64 system call.

MFC after: 2 weeks

3 years agolinux(4): Prevent integer overflow in futex_requeue.
Dmitry Chagin [Thu, 10 Jun 2021 11:23:11 +0000 (14:23 +0300)]
linux(4): Prevent integer overflow in futex_requeue.

To prevent a signed integer overflow in futex_requeue add a sanity check
to catch negative values of nrwake or nrrequeue.

MFC after: 2 weeks

3 years agolinux(4): Regen for futex system call.
Dmitry Chagin [Thu, 10 Jun 2021 11:16:40 +0000 (14:16 +0300)]
linux(4): Regen for futex system call.

MFC after: 2 weeks

3 years agolinux(4): Change Linux futex syscall definition to match Linux actual one.
Dmitry Chagin [Thu, 10 Jun 2021 11:00:00 +0000 (14:00 +0300)]
linux(4): Change Linux futex syscall definition to match Linux actual one.

MFC after: 2 weeks

3 years agolibcasper: fix descriptors numbers
Mariusz Zaborski [Wed, 9 Jun 2021 21:46:51 +0000 (23:46 +0200)]
libcasper: fix descriptors numbers

Casper services expect that the first 3 descriptors (stdin/stdout/stderr)
will point to /dev/null. Which Casper will ensure later. The Casper
services are forked from the original process. If the initial process
closes one of those descriptors, Casper may reuse one of them for it on
purpose. If this is the case, then renumarate the descriptors used by
Casper to higher numbers. This is done already after the fork, so it
doesn't break the parent process.

PR: 225343
Reported by: Borja Marcos <borjam (at) sarenet.es>
Tested by: jkim@

3 years agostress2: Exclude new syzkaller tests
Peter Holm [Thu, 10 Jun 2021 02:30:12 +0000 (04:30 +0200)]
stress2: Exclude new syzkaller tests

3 years agoinsetad -> instead
Warner Losh [Thu, 10 Jun 2021 02:17:22 +0000 (20:17 -0600)]
insetad -> instead

3 years agomk: WITH_FOO=no now generates a warning
Warner Losh [Thu, 10 Jun 2021 00:10:12 +0000 (18:10 -0600)]
mk: WITH_FOO=no now generates a warning

Many people are used to gnu configure's behavior of changing
--with-foo=no to --without-foo. At the same time, several folks have
WITH_FOO=no in their config files to enable this ironic form of the
option because of an old meme from IRC, a mailing list or the forums (I
forget which). Add a warning to allow to alert people w/o breaking POLA.

Reviewed by: allanjude, bdrewery, manu
MFC After: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30684

3 years agoLinuxKPI: add fault_flag_allow_retry_first
Greg V [Wed, 9 Jun 2021 23:09:16 +0000 (19:09 -0400)]
LinuxKPI: add fault_flag_allow_retry_first

Used by drm 5.7.

Reviewed by: bz, hselasky, nc
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30673

3 years agolinuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock()
Neel Chauhan [Wed, 9 Jun 2021 21:38:52 +0000 (14:38 -0700)]
linuxkpi: Add macros for might_lock_nested() and lockdep_(re/un/)pin_lock()

In Linux, these are macros to locks in the kernel for scheduling purposes.
But as with other macros in this header, we aren't doing anything with them
so we are doing `do {} while (0)` for now.

This is needed by the drm-kmod 5.7 update.

Approved by: hselasky (src)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D30710

3 years agolinuxkpi: Add _RET_IP_ macro in kernel.h
Neel Chauhan [Wed, 9 Jun 2021 21:34:58 +0000 (14:34 -0700)]
linuxkpi: Add _RET_IP_ macro in kernel.h

This is needed by the drm-kmod 5.7 update.

Approved by: hselasky (src)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D30707

3 years agofreebsd-tips: Add fortune on kern.tty_info_kstacks
Michael Gmelin [Fri, 21 May 2021 16:10:26 +0000 (18:10 +0200)]
freebsd-tips: Add fortune on kern.tty_info_kstacks

Add fortune explaining how to use `sysctl kern.tty_info_kstacks' to
alter the output of ^T (tty info).

Reviewed by: ceri
Differential Revision: https://reviews.freebsd.org/D30388

3 years agotcp: LRO timestamps have lost their previous precision
Randall Stewart [Wed, 9 Jun 2021 17:58:54 +0000 (13:58 -0400)]
tcp: LRO timestamps have lost their previous precision

Recently we had a rewrite to tcp_lro.c that was tested but one subtle change
was the move to a less precise timestamp. This causes all kinds of chaos
in tcp's that do pacing and needs to be fixed to use the more precise
time that was there before.

Reviewed by: mtuexen, gallatin, hselasky
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D30695

3 years agonfscl: Add a "has acquired a delegation" flag for delegations
Rick Macklem [Wed, 9 Jun 2021 15:00:43 +0000 (08:00 -0700)]
nfscl: Add a "has acquired a delegation" flag for delegations

A problem was reported via email, where a large (130000+) accumulation
of NFSv4 opens on an NFSv4 mount caused significant lock contention
on the mutex used to protect the client mount's open/lock state.
Although the root cause for the accumulation of opens was not
resolved, it is obvious that the NFSv4 client is not designed to
handle 100000+ opens efficiently.

For a common case where delegations are not being issued by the
NFSv4 server, the code acquires the mutex lock for open/lock state,
finds the delegation list empty and just unlocks the mutex and returns.
This patch adds an NFS mount point flag that is set when a delegation
is issued for the mount.  Then the patched code checks for this flag
before acquiring the open/lock mutex, avoiding the need to acquire
the lock for the case where delegations are not being issued by the
NFSv4 server.
This change appears to be performance neutral for a small number
of opens, but should reduce lock contention for a large number of opens
for the common case where server is not issuing delegations.

This commit should not affect the high level semantics of delegation
handling.

MFC after:      2 weeks

3 years agoi386: Add "options HYPERV" to NOTES
Mark Johnston [Wed, 9 Jun 2021 12:58:45 +0000 (08:58 -0400)]
i386: Add "options HYPERV" to NOTES

This unbreaks the LINT build.

Fixes: 97993d1ebf
Reported by: mjg
MFC after: 13 days

3 years agotests/netgraph: Tests for ng_vlan_rotate
Lutz Donnerhacke [Sun, 6 Jun 2021 23:56:12 +0000 (01:56 +0200)]
tests/netgraph: Tests for ng_vlan_rotate

Test functionality of ng_vlan_rotate(4):
 - Rotate 1 to 9 stagged vlans in any possible direction and length
 - Rotate random combinations of ethertypes (8100, 88a8, 9100)
 - Automatic reverse rotating for backward data flow
 - Test too many and to few vlans

Reviewed by: kp (earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30670

3 years agotests/netgraph: Tests for ng_hub
Lutz Donnerhacke [Thu, 3 Jun 2021 22:22:29 +0000 (00:22 +0200)]
tests/netgraph: Tests for ng_hub

Test functionality of ng_hub(4):
 - replicting traffic to anything but the sending hook
 - persistence
 - an unrestricted loop
 - implementation limits with many hooks.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30633

3 years agotests/netgraph: Factor out univeral data counter functions
Lutz Donnerhacke [Tue, 8 Jun 2021 19:45:20 +0000 (21:45 +0200)]
tests/netgraph: Factor out univeral data counter functions

Factor out the data counter helpers for other tests to use.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30699

3 years agotests/netgraph: Fix style
Lutz Donnerhacke [Tue, 8 Jun 2021 08:46:18 +0000 (10:46 +0200)]
tests/netgraph: Fix style

Indent all files correctly

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30692

3 years agoFix syscall kld example
Fernando Apesteguía [Thu, 27 May 2021 12:09:39 +0000 (14:09 +0200)]
Fix syscall kld example

PR: 255936
Reported by: splitface@mailfence.com
Approved by: gbe (mentor), imp@, jilles@
Differential Revision: https://reviews.freebsd.org/D30498

3 years agork3328_cru: fix a typo in the SCLK_I2S2 gate definition
Andriy Gapon [Wed, 9 Jun 2021 07:44:41 +0000 (10:44 +0300)]
rk3328_cru: fix a typo in the SCLK_I2S2 gate definition

MFC after: 4 days

3 years agorc.d: liberate powerd from ACPI dependency
Andriy Gapon [Tue, 8 Jun 2021 17:08:10 +0000 (20:08 +0300)]
rc.d: liberate powerd from ACPI dependency

For instance, many non-ACPI ARM systems have CPU power / frequency
levels.

Discussed with: manu
MFC after: 1 week

3 years agoUPDATING: correct typo
Ed Maste [Wed, 9 Jun 2021 00:46:16 +0000 (20:46 -0400)]
UPDATING: correct typo

Sponsored by: The FreeBSD Foundation

3 years agolibspl: fix NO_CLEAN build
Warner Losh [Tue, 8 Jun 2021 23:56:15 +0000 (17:56 -0600)]
libspl: fix NO_CLEAN build

atomic.S moved to atomic.c, update the cleaup script to remove stale
dependencies for this.

Sponsored by: Netflix

3 years agozfs: unbreak build broken in 160388166
Martin Matuska [Tue, 8 Jun 2021 17:02:21 +0000 (19:02 +0200)]
zfs: unbreak build broken in 160388166

3 years agotip: Fix pointer-vs-integer confusion
Jessica Clarke [Tue, 8 Jun 2021 17:30:59 +0000 (18:30 +0100)]
tip: Fix pointer-vs-integer confusion

Currently IREMOTE assumes that every value is (initially) a pointer to a
long. This is true for NUMBERs, but false for STRINGs, which are instead
pointers to pointers, though on ILP32 and LP64 systems these happen to
have the same representation, but this is still a strict aliasing
violation, and of course breaks on systems where the representations are
not the same, such as CHERI. We do not currently have any BOOLs (short,
curiously) or CHARs used with IREMOTE, though the code should not be
relying on that.

This removes the unused setaddress macro, and the now-unused address
macro due to the above issue.

Reviewed by: imp, kib
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D30697

3 years agotip: Cast via intptr_t not long when casting between pointer and int
Jessica Clarke [Tue, 8 Jun 2021 17:30:59 +0000 (18:30 +0100)]
tip: Cast via intptr_t not long when casting between pointer and int

Whilst all FreeBSD architectures have the same representation for
intptr_t and long (even if the former is int on ILP32 architectures),
this is more general and correct, and on CHERI they are not the same so
warnings are generated by default for integer-to-pointer casts that
aren't via (u)intptr_t.

Reviewed by: imp, kib
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D30696

3 years agotests/netgraph: Attribute errors to the caller
Lutz Donnerhacke [Tue, 8 Jun 2021 17:19:35 +0000 (19:19 +0200)]
tests/netgraph: Attribute errors to the caller

Errors raised in the common util functions should raise the location
of their caller to be useful and include the errno description.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30671

3 years agoAdd ofw interface support to PCI
Marcin Wojtas [Thu, 27 May 2021 08:09:04 +0000 (10:09 +0200)]
Add ofw interface support to PCI

Some arm64 SoCs have nodes in their fdts that describe devices
connected to the internal PCI bus. One such SoC is Freescale LS1028A.
In order to access information stored in them we need to add ofw bus
support to pci. Pass devinfo request up to our parent, which
is responsible for parsing all the information.
It allows to use ofw interface on PCI devices that support it.
This method is similar to sys/dev/acpica/acpi_pci.c.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30181

3 years agopci_host_generic_fdt.c: Add support for mapping dts nodes to PCI devices
Marcin Wojtas [Thu, 27 May 2021 08:07:19 +0000 (10:07 +0200)]
pci_host_generic_fdt.c: Add support for mapping dts nodes to PCI devices

Some arm64 SoCs have nodes in their fdts that describe devices
connected to the internal PCI bus. One such SoC is Freescale LS1028A.
It expects the nodes to be mapped to devices enumerated using the standard
PCI method. Mapping is done by reading device and function ids from "reg"
property. Information is dts is used to describe MDIO/PHY connected
to a given interface.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30180

3 years agoRemove ThunderX PCIe FDT quirks from pci_host_generic_fdt.c
Marcin Wojtas [Thu, 27 May 2021 08:05:35 +0000 (10:05 +0200)]
Remove ThunderX PCIe FDT quirks from pci_host_generic_fdt.c

ThunderX is the only board known to use them.
Move them to the ThunderX PCIe driver.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30179

3 years agoupdating: add note about vendor/openzfs branch rename
Warner Losh [Tue, 8 Jun 2021 14:57:42 +0000 (08:57 -0600)]
updating: add note about vendor/openzfs branch rename

Add a pointer to
https://lists.freebsd.org/archives/freebsd-current/2021-June/000153.html
to explain how to pull a new tree due to the vendor/openzfs branch
being renamed.

Reviewed by: lwhsu@
Sponsored by: Netflix

3 years agozfs: merge openzfs/zfs@75b4cbf62 (master) into main
Martin Matuska [Tue, 8 Jun 2021 14:48:37 +0000 (16:48 +0200)]
zfs: merge openzfs/zfs@75b4cbf62 (master) into main

Notable upstream pull request merges:
  #11710 Allow zfs to send replication streams with missing snapshots
  #11751 Avoid taking global lock to destroy zfsdev state
  #11786 Ratelimit deadman zevents as with delay zevents
  #11803 ZFS traverse_visitbp optimization to limit prefetch
  #11813 Allow pool names that look like Solaris disk names
  #11822 Atomically check and set dropped zevent count
  #11822 Don't scale zfs_zevent_len_max by CPU count
  #11833 Refactor zfsdev state init/destroy to share common code
  #11837 zfs get -p only outputs 3 columns if "clones" property is empty
  #11843 libzutil: zfs_isnumber(): return false if input empty
  #11849 Use dsl_scan_setup_check() to setup a scrub
  #11861 Improvements to the 'compatibility' property
  #11862 cmd/zfs receive: allow dry-run (-n) to check property args
  #11864 receive: don't fail inheriting (-x) properties on wrong dataset type
  #11877 Combine zio caches if possible
  #11881 FreeBSD: use vnlru_free_vfsops if available
  #11883 FreeBSD: add support for lockless symlink lookup
  #11884 FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr
  #11896 Fix crash in zio_done error reporting
  #11905 zfs-send(8): Restore sorting of flags
  #11926 FreeBSD: damage control racing .. lookups in face of mkdir/rmdir
  #11930 vdev_mirror: don't scrub/resilver devices that can't be read
  #11938 Fix AVX512BW Fletcher code on AVX512-but-not-BW machines
  #11955 zfs get: don't lookup mount options when using "-s local"
  #11956 libzfs: add keylocation=https://, backed by fetch(3) or libcurl
  #11959 vdev_id: variable not getting expanded under map_slot()
  #11966 Scale worker threads and taskqs with number of CPUs
  #11994 Clean up use of zfs_log_create in zfs_dir
  #11997 FreeBSD: Don't force xattr mount option
  #11997 FreeBSD: Implement xattr=sa
  #11997 FreeBSD: Use SET_ERROR to trace xattr name errors
  #11998 Simplify/fix dnode_move() for dn_zfetch
  #12003 FreeBSD: Initialize/destroy zp->z_lock
  #12010 Fix dRAID self-healing short columns
  #12033 Revert "Fix raw sends on encrypted datasets when copying back snapshots"
  #12040 Reinstate the old zpool read label logic as a fallback
  #12046 Improve scrub maxinflight_bytes math
  #12049 FreeBSD: avoid memory allocation in arc_prune_async
  #12052 FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI
  #12061 Fix dRAID sequential resilver silent damage handling
  #12072 Let zfs diff be more permissive
  #12077 FreeBSD: Retry OCF ENOMEM errors.
  #12088 Propagate vdev state due to invalid label corruption
  #12091 libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat
  #12097 FreeBSD: Update dataset_kstats for zvols in dev mode
  #12104 FreeBSD boot code reminder after zpool upgrade
  #12114 Introduce write-mostly sums

Obtained from: OpenZFS
OpenZFS commit: 75b4cbf62590c23fac3667537961a2a75fdc2cc3

3 years agozfs: merge openzfs/zfs@3522f57b6 (master) to main
Martin Matuska [Tue, 8 Jun 2021 14:23:50 +0000 (16:23 +0200)]
zfs: merge openzfs/zfs@3522f57b6 (master) to main

This changes branch tracking of sys/contrib/openzfs to a new
direct-import branch vendor/openzfs/master.

No functional changes.

OpenZFS tag: 2.1.0-rc1

3 years agohyperv: Fix vmbus after the i386 4/4 split
Mark Johnston [Tue, 8 Jun 2021 13:40:30 +0000 (09:40 -0400)]
hyperv: Fix vmbus after the i386 4/4 split

The vmbus ISR needs to live in a trampoline.  Dynamically allocating a
trampoline at driver initialization time poses some difficulties due to
the fact that the KENTER macro assumes that the offset relative to
tramp_idleptd is fixed at static link time.  Another problem is that
native_lapic_ipi_alloc() uses setidt(), which assumes a fixed trampoline
offset.

Rather than fight this, move the Hyper-V ISR to i386/exception.s.  Add a
new HYPERV kernel option to make this optional, and configure it by
default on i386.  This is sufficient to make use of vmbus(4) after the
4/4 split.  Note that vmbus cannot be loaded dynamically and both the
HYPERV option and device must be configured together.  I think this is
not too onerous a requirement, since vmbus(4) was previously
non-functional.

Reported by: Harry Schmalzbauer <freebsd@omnilan.de>
Tested by: Harry Schmalzbauer <freebsd@omnilan.de>
Reviewed by: whu, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30577

3 years agolibzfs: On FreeBSD, use MNT_NOWAIT with getfsstat
Alan Somers [Tue, 8 Jun 2021 13:36:43 +0000 (07:36 -0600)]
libzfs: On FreeBSD, use MNT_NOWAIT with getfsstat

`getfsstat(2)` is used to retrieve the list of mounted file systems,
which libzfs uses when fetching properties like mountpoint, atime,
setuid, etc.  The `mode` parameter may be `MNT_NOWAIT`, which uses
information in the VFS's cache, or `MNT_WAIT`, which effectively does a
`statfs` on every single mounted file system in order to fetch the most
up-to-date information.  As far as I can tell, the only fields that
libzfs cares about are the filesystem's name, mountpoint, fstypename,
and mount flags.  Those things are always updated on mount and unmount,
so they will always be accurate in the VFS's mount cache except in two
circumstances:

1) When a file system is busy unmounting
2) When a ZFS file system changes the value of a mount-overridable
   property like atime or setuid, but doesn't remount the file system.
   Right now that only happens when the property is changed by an
   unprivileged user who has delegated authority to change the property
   but not to mount the dataset.  But perhaps libzfs could choose to do
   it for other reasons in the future.

Switching to `MNT_NOWAIT` will greatly improve speed with no downside,
as long as we explicitly update the mount cache whenever we change a
mount-overridable property.

For comparison, Illumos gets this information using the native
`getmntany` and `getmntent` functions, which also use cached
information.  The illumos function that would refresh the cache,
`resetmnttab`, is never called by libzfs.

And on GNU/Linux, `getmntany` and `getmntent` don't even communicate
with the kernel directly.  They simply parse the file they are given,
which is usually /etc/mtab or /proc/mounts.  Perhaps the implementation
of /proc/mounts is synchronous, ala MNT_WAIT; I don't know.

Sponsored-by: Axcient
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alan Somers <asomers@gmail.com>
Closes: #12091
3 years agotests/netgraph: Tests for ng_bridge
Lutz Donnerhacke [Fri, 4 Jun 2021 10:59:00 +0000 (12:59 +0200)]
tests/netgraph: Tests for ng_bridge

Test functionality of ng_bridge(4):
 - replicating traffic to anything but the sending hook
 - persistence
 - detect loops
 - unicast to only one link of many
 - stretch to implementation limits on broadcast

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30647

3 years agoAdd a virtio-input device emulation.
Corvin Köhne [Tue, 8 Jun 2021 08:56:43 +0000 (18:56 +1000)]
Add a virtio-input device emulation.

This will be used to inject keyboard/mouse input events into a guest.
The command line syntax is:
   -s <slot>,virtio-input,/dev/input/eventX

Reviewed by: jhb (bhyve), grehan
Obtained from: Corvin Köhne <C.Koehne@beckhoff.com>
MFC after: 3 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D30020

3 years agotests/netgraph: Allow receiving answers to messages
Lutz Donnerhacke [Sat, 5 Jun 2021 22:37:22 +0000 (00:37 +0200)]
tests/netgraph: Allow receiving answers to messages

Add msg_handler in order to receive messages from netgraph nodes to be
tested.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30657

3 years agolinux: make sure to zero the l_siginfo structure for ptrace(2)
Edward Tomasz Napierala [Tue, 8 Jun 2021 09:18:29 +0000 (10:18 +0100)]
linux: make sure to zero the l_siginfo structure for ptrace(2)

Reported By: dchagin
Sponsored By: EPSRC

3 years agolinux: implement statx(2)
Philippe Michaud-Boudreault [Tue, 8 Jun 2021 08:24:10 +0000 (09:24 +0100)]
linux: implement statx(2)

PR: 252106
Reviewed By: dchagin
Differential Revision: https://reviews.freebsd.org/D30466

3 years agoFix copyright, remove "all rights reserved".
Dmitry Chagin [Tue, 8 Jun 2021 05:18:00 +0000 (08:18 +0300)]
Fix copyright, remove "all rights reserved".

The eventfd code was written by me, rdivacky@ copyrigth applicable only
to epoll part of the Linuxulator code. Roman is ok to retire his copyright
from sys/kern/sys_eventfd.c and 'All rights reserved.' lines from
sys/compat/linux/linux_event.[c|h] and sys/kern/sys_eventfd.c files.

Reviewed by: kib, emaste
Approved by: rdivacky
Differential Revision: https://reviews.freebsd.org/D30677
MFC after: 2 weeks

3 years agotests/file_check: remove unused variable
наб [Thu, 3 Jun 2021 16:33:37 +0000 (18:33 +0200)]
tests/file_check: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

3 years agomodule/zfs: vdev_removal: spa_vdev_remove_thread: remove unused variable
наб [Thu, 3 Jun 2021 16:33:01 +0000 (18:33 +0200)]
module/zfs: vdev_removal: spa_vdev_remove_thread: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

3 years agomodule/zfs: vdev_indirect: vdev_indirect_repair: remove unused variable
наб [Thu, 3 Jun 2021 16:32:38 +0000 (18:32 +0200)]
module/zfs: vdev_indirect: vdev_indirect_repair: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

3 years agomodule/zfs: dbuf: dbuf_read_impl: remove unused variable
наб [Thu, 3 Jun 2021 16:31:58 +0000 (18:31 +0200)]
module/zfs: dbuf: dbuf_read_impl: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

3 years agomodule/zfs: arc: arc_hdr_realloc_crypt: remove unused variables
наб [Thu, 3 Jun 2021 16:31:21 +0000 (18:31 +0200)]
module/zfs: arc: arc_hdr_realloc_crypt: remove unused variables

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

3 years agolibzfs: zfs_send: remove unused variable
наб [Thu, 3 Jun 2021 16:30:23 +0000 (18:30 +0200)]
libzfs: zfs_send: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

3 years agozdb: zdb_decompress_block: don't needlessly set buf
наб [Thu, 3 Jun 2021 16:29:45 +0000 (18:29 +0200)]
zdb: zdb_decompress_block: don't needlessly set buf

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

3 years agolibzutil: zpool_find_config: remove unused variable
наб [Thu, 3 Jun 2021 15:10:41 +0000 (17:10 +0200)]
libzutil: zpool_find_config: remove unused variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12187

3 years agolinuxkpi: Fix build from redefined pr_err_once()
Neel Chauhan [Mon, 7 Jun 2021 23:37:21 +0000 (16:37 -0700)]
linuxkpi: Fix build from redefined pr_err_once()

3 years agolinuxkpi: Include pr_err_once() in printk.h
Neel Chauhan [Mon, 7 Jun 2021 22:52:37 +0000 (15:52 -0700)]
linuxkpi: Include pr_err_once() in printk.h

Approved by: bz (src), hselasky (src)
Differential Reivison: https://reviews.freebsd.org/D30687

3 years agolinuxkpi: Add rom and romlen to struct pci_dev
Neel Chauhan [Mon, 7 Jun 2021 22:50:46 +0000 (15:50 -0700)]
linuxkpi: Add rom and romlen to struct pci_dev

Approved by: bz (src), hselasky (src)
Differential Reivison: https://reviews.freebsd.org/D30686

3 years agoCirrus-CI: Use the default Git history depth
Fedor Korotkov [Fri, 29 Jan 2021 14:22:54 +0000 (09:22 -0500)]
Cirrus-CI: Use the default Git history depth

Which is `50`.  I saw a few errors like
`Failed to force reset to SHA: object not found!` which seems is
happening because the SHA is not available because there were two
commits pushed almost simultaneously and the second from the top fails
with this error because the SHA is not in the history.

Pull Request: https://github.com/freebsd/freebsd-src/pull/454

Comments on re-commit from emaste:

Originally committed as fcb4797c90f3 and reverted in 80a840b8ba03 due
to the clone operation taking significantly longer.  However, I have
seen many failures due to the "object not found" issue recently.
7 of 37 recent runs failed because of this, and intermittent failures
like this makes CI much less useful.

Prefer longer-running runs to intermittent failures.

3 years agonfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems
Rick Macklem [Mon, 7 Jun 2021 20:48:25 +0000 (13:48 -0700)]
nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems

Pre-r318997 the code looked like:
if (vp->v_mount->mnt_stat.f_fsid.val[0] != (uint32_t)np->n_vattr.na_filesid[0])
         vap->va_fsid = (uint32_t)np->n_vattr.na_filesid[0];
Doing this assignment got lost by r318997 and, as such, NFSv4 mounts
of servers with trees of file systems on the server is broken, due to duplicate
fileno values for the same st_dev/va_fsid.

Although I could have re-introduced the assignment, since the value of
na_filesid[0] is not guaranteed to be unique across the server file systems,
I felt it was better to always do the hash for na_filesid[0,1].
Since dev_t (st_dev/va_fsid) is now 64bits, I switched to a 64bit hash.

There is a slight chance of a hash conflict where 2 different na_filesid
values map to same va_fsid, which will be documented in the BUGS
section of the man page for mount_nfs(8).  Using a table to keep track
of mappings to catch conflicts would not easily scale to 10,000+ server file
systems and, when the conflict occurs, it only results in fts(3) reporting
a "directory cycle" under certain circumstances.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D30660

3 years agoFix handling of D_GIANTOK
Mark Johnston [Mon, 7 Jun 2021 18:25:26 +0000 (14:25 -0400)]
Fix handling of D_GIANTOK

It was meant to suppress only the printf(), not the subsequent injection
of Giant-protected thunks for various file operations.

Fixes: fbeb4ccac9
Reported by: pho
Tested by: pho
MFC after: 6 days
Pointy hat: markj

3 years agoModernise/fix/rewrite unlinted manpages
наб [Mon, 7 Jun 2021 19:41:54 +0000 (21:41 +0200)]
Modernise/fix/rewrite unlinted manpages

zpool-destroy.8: flatten, fix description
zfs-wait.8: flatten, fix description, use list for events
zpool-reguid.8: flatten, fix description
zpool-history.8: flatten, fix description
zpool-export.8: flatten, fix description, remove -f "unmount" reference
  AFAICT no such command exists even in Illumos (as of today, anyway),
  and we definitely don't call it
zpool-labelclear.8: flatten, fix description
zpool-features.5: modernise
spl-module-parameters.5: modernise
zfs-mount-generator.8: rewrite
zfs-module-parameters.5: modernise

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12169

3 years agoForce --enable-debug on FreeBSD if INVARIANTS is set
Rich Ercolani [Mon, 7 Jun 2021 19:29:27 +0000 (15:29 -0400)]
Force --enable-debug on FreeBSD if INVARIANTS is set

There's already logic to force INVARIANTS on for building if it's
present in the running kernel; however, not having DEBUG enabled
when DEBUG and INVARIANTS are can cause strange panics.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12185
Closes #12163

3 years agoLivelist logic should handle dedup blkptrs
Serapheim Dimitropoulos [Mon, 7 Jun 2021 19:09:07 +0000 (12:09 -0700)]
Livelist logic should handle dedup blkptrs

Update the logic to handle the dedup-case of consecutive
FREEs in the livelist code. The logic still ensures that
all the FREE entries are matched up with a respective
ALLOC by keeping a refcount for each FREE blkptr that we
encounter and ensuring that this refcount gets to zero
by the time we are done processing the livelist.

zdb -y no longer panics when encountering double frees

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Don Brady <don.brady@delphix.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #11480
Closes #12177

3 years agoMore aggsum optimizations
Alexander Motin [Mon, 7 Jun 2021 16:02:47 +0000 (12:02 -0400)]
More aggsum optimizations

- Avoid atomic_add() when updating as_lower_bound/as_upper_bound.
Previous code was excessively strong on 64bit systems while not
strong enough on 32bit ones.  Instead introduce and use real
atomic_load() and atomic_store() operations, just an assignments
on 64bit machines, but using proper atomics on 32bit ones to avoid
torn reads/writes.

 - Reduce number of buckets on large systems.  Extra buckets not as
much improve add speed, as hurt reads.  Unlike wmsum for aggsum
reads are still important.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #12145

3 years agoLinuxKPI: add pr_err_once
Greg V [Mon, 7 Jun 2021 14:30:18 +0000 (10:30 -0400)]
LinuxKPI: add pr_err_once

Reviewed by: hselasky, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30672

3 years agousr.bin/calendar: do not treat // in text as comment
Stefan Eßer [Mon, 7 Jun 2021 13:46:24 +0000 (15:46 +0200)]
usr.bin/calendar: do not treat // in text as comment

The C++-style comment marker "//" has been added with the rewrite of
the preprocessor features. Since this character sequence occurs in
ULRS, the reminder of the URL was considered a comment and stripped
from the calendar line.

Change parsing of "//" to only start a comment at the begin of a line
or when preceeded by a white-space character.

PR: 256455
Reported by: Philippe Michel (philippe.michel7 at free.fr)
MFC after: 3 days