nfscl: Add support for CB_RECALL_SLOT
The callback CB_RECALL_SLOT is required for NFSv4.1/4.2.
Fortunately, there does not appear to be any extant
NFSv4.1/4.2 servers that use it. Since commit b97a478896e9
fixed handling of session slot shrinking, this patch
adds support for CB_RECALL_SLOT, which shrinks the
number of session slots as well.
MFC after: 2 weeks
dtrace/arm64: Fix enumeration of FBT return probes
On arm64, the FBT provider treats tail calls as return probes. Ignoring
the question of whether this is really correct, the implementation is
wrong: instr is a pointer to uint32_t, so the removed multiplication by
the instruction size is wrong. As a result, FBT would create return
probes for intra-function branches.
MFC after: 2 weeks
Sponsored by: Innovate UK
(cherry picked from commit 4da070ce6c015a994ec4ecf3d31ee94810ea19f1)
Reinstate returning EOVERFLOW from stats_v1_blob_clone()
a0993376ec5f (from D43179) subtly changed stats_v1_blob_clone() to stop returning EOVERFLOW in the case where the user buffer is not large enough to receive the entire statsblob. This results in any consumers which are implemented to retry on receiving EOVERFLOW to instead give up after receiving an empty statsblob header.
Fix by latching any errors recorded prior to copyout.
Reviewed by: markj
Obtained from: Netflix, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44585
Fixes: a0993376ec5f ("stats: Check for errors from copyout()")
(cherry picked from commit 7eb92c502eb503d808a51296e426de625239a0d9)
geli tests: Use shorter passphrases in setkey_passphrase
There is an undocumented limit on the length of a GELI passphrase, and
the test exceeded that. Most of the time it worked because a nul
terminator would appear early enough in the string.
Reported by: Jenkins
Fixes: 2b7b09ac9675 ("geli tests: Add a regression test for geli setkey -J")
(cherry picked from commit c4b927c341e23eea17f75d139aafcf58545c5b0e)
libdtrace: Generalize handling of data models a bit
Make it easier to support data models other than ILP32 and LP64 by
avoiding constructs which assume that it must be one or the other.
No functional change intended.
MFC after: 2 weeks
Sponsored by: Innovate UK
(cherry picked from commit 096a5c6cd28c417456d5ce3598be15e6b656af5c)
libdtrace: Use designators to initialize the opcode array
No functional change intended.
MFC after: 2 weeks
Sponsored by: Innovate UK
(cherry picked from commit 51688136b161089b317edc34c3a3e9b40d54a18a)
clock: Use .balign to align ticksl
The .align directive has a different behaviour on 32-bit arm than on
other platforms. Use .balign instead, which has consistent behaviour on
all architectures.
Reported by: kib
Reviewed by: jrtc27, kib
Fixes: 6b82130e6c9a ("clock: Add a long ticks variable, ticksl")
Differential Revision: https://reviews.freebsd.org/D48430
(cherry picked from commit 159d29d3948294cdc9ee4cc3951d004de6797a32)
clock: Simplify subr_ticks and rename
- We can use builtin constants for the size of int and long to simplify
definitions.
- The file should have a .S prefix since we want to run it through the
preprocessor, though apparently this happens anyway with .s...
- Move ticks and ticksl from .data to .bss.
Reported by: jrtc27
Reviewed by: jrtc27, kib, emaste
Fixes: 6b82130e6c9a ("clock: Add a long ticks variable, ticksl")
Differential Revision: https://reviews.freebsd.org/D48420
(cherry picked from commit b2b974f7ef4cddff251d0de69d8da13232b25e4d)
arm64: Clean up usage of the dtrace invop handler
- Don't consume the breakpoint if all invop handlers returned a non-zero
value.
- Fix style nits.
MFC after: 2 weeks
Sponsored by: Innovate UK
(cherry picked from commit 853cd8723494ccc2e972aaa09e7d04ede1508c95)
clock: Add a long ticks variable, ticksl
For compatibility with Linux, it's useful to have a tick counter of
width sizeof(long), but our tick counter is an int. Currently the
linuxkpi tries paper over this difference, but this cannot really be
done reliably, so it's desirable to have a wider tick counter. This
change introduces ticksl, keeping the existing ticks variable.
Follow a suggestion from kib to avoid having to maintain two separate
counters and to avoid converting existing code to use ticksl: change
hardclock() to update ticksl instead of ticks, and then use assembler
directives to make ticks and ticksl overlap such that loading ticks
gives the bottom 32 bits. This makes it possible to use ticksl in the
linuxkpi without having to convert any native code, and without making
hardclock() more complicated or expensive. Then, the linuxkpi can be
modified to use ticksl instead of ticks.
Reviewed by: olce, kib, emaste
MFC after: 1 month
[3 lines not shown]
dtrace: Remove the noinline qualifier from dtrace_getarg()
It serves no purpose after commit 82283cad12a4. No functional change
intended.
Fixes: 82283cad12a4 ("dtrace: Avoid including dtrace_isa.c directly into dtrace.c")
MFC after: 2 weeks
(cherry picked from commit 494a2b14722e8955af54e306305f462e5765c1e4)
pf.conf.5: document how any matches any non-loopback interface
ok benno
Obtained from: OpenBSD, henning <henning at openbsd.org>, 527559b86a
Sponsored by: Rubicon Communications, LLC ("Netgate")
pfctl: relax the cfg file secrecy check slightly to allow group readability
default permissions and mtree NOT changed.
prodded by benno, ok phessler benno jmatthew theo pelikan florian
Obtained from: OpenBSD, henning <henning at openbsd.org>, 7140c133f0
Sponsored by: Rubicon Communications, LLC ("Netgate")
pfctl: if_item can be "any" now
Allows things like:
block out on $someif received-on any
to prevent packets to get forwarded to $someif.
Obtained from: OpenBSD, henning <henning at openbsd.org>, 5984d04852
Sponsored by: Rubicon Communications, LLC ("Netgate")
pf: use time_t for storing time_t values
No change to the underlying type, so no ABI change.
We define __time_t as uint64_t if __LP64__, otherwise uint32_t,
and only define __LP64__ if long is 64 bits.
In other words: __time_t == long.
ok henning@ deraadt@
Obtained from: OpenBSD, guenther <guenther at openbsd.org>, 6c1b69a0ff
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D48963
pf: introduce a way to match "any" interface, excluding loopback ones
pfi_kkif_attach() annotates the kif with a flag indicating it is the "any" match.
pfi_kif_match obeys() that flag.
ok benno
Obtained from: OpenBSD, henning <henning at openbsd.org>, 4be478ce5d
Sponsored by: Rubicon Communications, LLC ("Netgate")
limits tests: Try to fix spurious cputime test failures
I very occasionally see test failures caused by the total CPU time being
several milliseconds under 3s. The test runs "limits -t 3 time <busy
loop>" and verifies that the reported time elapsed is at least 3s (and
not too much more). In particular, any time spent executing time(1)
itself is counted against the limit but not recorded in the output.
I think it makes more sense to reverse the order, so that the CPU time
limit is not applied to time(1) itself. This also resolves the test
failures I was seeing, which were reproducible only under load (i.e.,
running many tests in parallel).
MFC after: 2 weeks
Sponsored by: Klara, Inc.
ktr: Use STAILQ_EMPTY_ATOMIC when checking for records in ktr_drain()
This is an unlocked check, and after commit 34740937f7a4 the debug
checks in STAILQ_EMPTY may spuriously fail here. In particular, the per
process queue is updated under the global ktrace mutex, not held in
ktr_drain(). If a record is enqueued concurrently, the recording thread
will schedule an AST to drain the queue again, so it should not be
possible for a race to leave records in the queue indefinitely.
Reviewed by: kib, olce
Reported by: syzbot+d67eddd8c4923ee28bb7 at syzkaller.appspotmail.com
MFC after: 2 weeks
Fixes: 34740937f7a4 ("queue: New debug macros for STAILQ")
Differential Revision: https://reviews.freebsd.org/D48899
queue: Add atomic variants for *_EMPTY
In some places, these macros are used without a lock, under the
assumption that they are naturally atomic. After commit
34740937f7a4 ("queue: New debug macros for STAILQ"), this assumption is
false.
Provide *_EMPTY_ATOMIC for such cases. This lets us include extra debug
checks for the non-atomic case, and gives us a way to explicitly
annotate unlocked checks, which generally deserve extra scrutiny and
might otherwise raise reports from KCSAN.
Reviewed by: kib, olce (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D48899
bhyve: Avoid holding /dev/pci open unnecessarily
Some device models, LPC in particular, will call pci_host_read_config()
when probing for devices. Currently this results in pcifd_init()
opening /dev/pci, and thus bhyve holds the fd open even when it's not
needed.
Modify pci_host_{read,write}_config() to open /dev/pci independent of
the global pcifd. This means that these routines can only be used
during VM initialization, as capsicum will prevent further opens
afterward. Introduce internal wrappers which use the global pcifd,
intended for the passthru code.
Reviewed by: jhb
MFC after: 3 weeks
Fixes: 563fd2240e13 ("bhyve: export funcs for read/write pci config")
Differential Revision: https://reviews.freebsd.org/D48908
pf: Log the intended action when a NAT rule matches a packet
When a packet matches a binat/nat/rdr rule, pf logs the match. The log
metadata includes the rule's action on the packet, e.g., PF_PASS. NAT
rules have their own actions: PF_BINAT, PF_NAT, PF_RDR.
Before commit 948e8413aba0 ("pflog: pass the action to pflog directly"),
pflog_packet() would obtain the action from the rule definition, whereas
after that commit the action is passed as a parameter. When a NAT rule
matches, we want to log the rule action, but after that commit, PF_PASS
is hard-coded. Restore the previous behaviour.
Add a regression test which installs a redirect, logs packets matching
the redirect rule, and verifies that the corresponding pflog entry
includes the correct action.
Reviewed by: kp
Fixes: 948e8413aba0 ("pflog: pass the action to pflog directly")
MFC after: 2 weeks
[3 lines not shown]
tools/fib_multibind: Remove a redundant calculation
No functional change intended.
Reported by: kevans
Fixes: 3fa552149885 ("tools: Add a small program to demonstrate FIB handling in bind(2)")
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
gve: Do minor cleanup and bump version
This commit fixes several minor issues:
- Removes an unnecessary function pointer parameter on gve_start_tx_ring
- Adds a presubmit check against style(9)
- Replaces mb() and rmb() macros with native
atomic_thread_fence_seq_cst() and atomic_thread_fence_acq()
respectively
- Fixes various typos throughout
- Increments the version number to 1.3.2
Co-authored-by: Vee Agarwal <veethebee at google.com>
Signed-off-by: Vee Agarwal <veethebee at google.com>
Signed-off-by: Jasper Tran O'Leary <jtranoleary at google.com>
Reviewed by: delphij, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D48969
gve: Fix qpl_buf_head being initialized improperly
Currently, for DQO QPL our MPASS assertion on qpl_buf_head for available
pending_pkts (i.e. not holding a packet) fails due to incorrect
initialization. The MPASS fails on the first run of packets through the
ring when INVARIANTS is on, and when INVARIANTS is off, things work
without a bug.
The MPASS guards against improper reaping of "pending_pkt" objects,
and thus was failing for the first run through the ring. By correctly
initializing the objects in this patch we make the MPASS not fail on the
first run too.
Signed-off-by: Vee Agarwal <veethebee at google.com>
Signed-off-by: Jasper Tran O'Leary <jtranoleary at google.com>
Reviewed by: delphij, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D48968
gve: Fix memory leak during reset
Before this change, during reset we were allocating new memory for
priv->ptype_lut_dqo, irq_db_array and the counter_array over the old
memory. This change ensures we do not allocate new memory during reset
and avoid memory leaks.
Signed-off-by: Vee Agarwal <veethebee at google.com>
Signed-off-by: Jasper Tran O'Leary <jtranoleary at google.com>
Reviewed by: delphij, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D48970