Via the kenv 'smbios.entry_point_type'.
Reviewed by: imp, markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49283
Rename HAS_SMBV3 to SMBIOS_64BIT_EP, as it will soon be externally
defined in some cases, and 'isv3' to 'is_64bit_ep'. These are more
accurate names for what they actually control/indicate.
No functional change.
Reviewed by: imp, markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49281
Move the comments so that lines stay of reasonable length.
Remove comments that state the obvious.
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49280
A REQUEST SENSE CDB was just copied into the cmd buffer, so testing for
INQUIRY will always fail. Remove the dead code.
This code was added, apparently by mistake in 2003. 8541fbec79
merged changes from NetBSD's umass_scsipi.c 1.8 to address some BBB
bulk-in clear problems. NetBSD had fixed a problem in the
FORCE_SHORT_INQUIRY quirk code they had ported from FreeBSD that FreeBSD
also needed. That merge also included the dead code, which was not in
NetBSD.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D49311
Currently dev.pcm.X.mode is calculated only once in pcm_sysinit(), which
is called by pcm_register() during attach, but this can result in
inconsistencies.
For some context, what pcm_mode_init() does is, it checks if "playcount"
is positive, in which case we assume the device supports playback. The
same is done for "reccount" for recording, and if "mixer_dev" is not
NULL, we know the device has a mixer.
The "playcount" and "reccount" variables correspond to the number of
_primary_ playback/recording channels, so we can assume that the primary
channels have been created before reaching pcm_mode_init(). However, for
the mixer that's not always the case. If the mixer is created _after_
pcm_register(), as is the case for snd_dummy(4) for example,
pcm_mode_init() will see that "mixer_dev" is NULL, and report that the
device does not have a mixer, whereas in reality we just created it
afterwards.
While this could be fixed by simply creating the mixers always before
pcm_register(), it is better to be robust and calculate the mode
dynamically.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D49024
This flag is redundant and essentially a no-op, as it is set when the
device supports at least playback or recording, which is almost always
the case. But even if the device is mixer-only (i.e., 0 channels), there
is no reason to keep this flag; it is only used to bail out of the vchan
sysctl handlers, but we already bail out anyway if we try to use the
sysctl in a vchan direction that is not supported.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D49021
Not used outside of pcm/dsp.c.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D49217
- Get rid of macro magic.
- Make feed_mixer_info handling similar to most feeders.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48394
It does what feed_matrix_apply() already does, so it is redundant.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48036
Turn the FEEDMATRIX_DECLARE macro into a single inline function
(feed_matrix_apply()). There is no reason to have this as a macro, it
only complicated the code. An advantage of this patch is that, because
we no longer call the functions created by the macro through function
pointers (apply field of feed_matrix_info), we can call
feed_matrix_apply() directly in feed_matrix_feed().
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48035
Turn the FEEDEQ_DECLARE macro into a single inline function
(feed_eq_biquad()). There is no reason to have this as a macro, and it
only complicates the code. An advantage of this patch is that, because
we no longer call the functions created by the macro through function
pointers (biquad_op), we can call feed_eq_biquad() directly in
feed_eq_feed().
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48032
This makes some subsequent feeder refactors easier to implement.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48421
Merge the PCM_READ|WRITE_* macros defined in pcm/pcm.h, as well as the
intpcm_read|write_* macros defined in pcm/feeder_format.c, into six
inline functions: pcm_sample_read|write[_norm|calc](). The absence of
macro magic makes the code significantly easier to read, use and modify.
Since these functions take the input/output format as a parameter, get
rid of the read() and write() function pointers defined in struct
feed_format_info, as well as the feeder_format_read|write_op()
functions, and use the new read/write functions directly.
Sponsored by: The FreeBSD Fondation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D47932
do not free the original mbuf, it is already freed by the
mb_unmapped_to_ext().
Reviewed by: glebius
Sponsored by: NVidia networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D49305
The top of the chain is supposed to be freed in mb_unmapped_to_ext(),
use m_freem(). The _mb_unmapped_to_ext() helper only needs to work on
the passed mbuf, use m_free().
Reviewed by: glebius
Sponsored by: NVidia networking
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D49305
The packageworld target requires NO_ROOT to be set (and there is a check
that this is the case). Remove the now-unused non-NO_ROOT cases.
Reviewed by: brooks, bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48590
M_NOWAIT is now only used for devclass_get_devices,
devclass_get_drivers, and device_get_children. Other functions are
generally called from sleepable contexts such as module event
handlers, attach/detach routines, and the ioctl handler for
/dev/devctl2.
Suggested by: mjg (devclass_add_device)
Differential Revision: https://reviews.freebsd.org/D49274
The lock is already not held while deleting child devices, and the
bus_topo_lock is already held when child devices are created.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D49272
Drop SDHCI_LOCK and instead acquire bus_topo_lock when adding and
removing new-bus devices.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D49271
Some drivers held regular mutexes across some new-bus calls; instead
depend on bus_topo_lock to protect the relevant softc members. This
also fixes the bus_topo_lock to be explicit in these drivers rather
than relying on the implicit Giant from taskqueue_swi_giant. It
avoids calling sleepable routines like device_probe_and_attach from an
swi context.
Differential Revision: https://reviews.freebsd.org/D49270
Use a system-wide taskqueue for hot-plug events. This avoids possibly
blocking unrelated events on the thread taskqueue without requiring
multiple driver-specific taskqueues.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D49268
In particular, don't invoke git to compute SOURCE_DATE_EPOCH for
unrelated targets like check-old or delete-old. If the git invocation
fails (e.g. when using a git worktree mounted over NFS) it can
generate a lot of irrelevant warning spam.
Reviewed by: emaste
Fixes: 8a3537aaf7 ("Makefile.inc1: Make package timestamps reproducible by default")
Differential Revision: https://reviews.freebsd.org/D49278
PR#284616 reported that --maxthreads did not
obey the 256 thread limit defined as MAXNFSDCNT in nfsd.c.
This is actually a feature and not a bug, since many NFS
servers will now want to run more than 256 threads and
--maxthreads can be used to set the upper bound on the
number of threads. (MAXNFSDCNT was used long ago to
define how many daemons would be forked, before daemons
were replaced by kernel threads.)
However, the nfsd.8 man page was misleading, since it
indicated that "-n" was the equivalent to setting both
--minthreads and --maxthreads to the same value.
This patch fixes the man page.
This is a content change.
PR: 284616
Reviewed by: 0mp (manpages)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D49102
This routine returns a monotonic count of the number of nanoseconds elapsed
since the previous call. On arm64 it uses the generic system timer. The
implementation multiplies the counter value by 10**9 then divides by the counter
frequency, but this multiplication can overflow. This can result in trace
records with non-monotonic timestamps, which breaks libdtrace's temporal
ordering algorithm.
An easy fix is to reverse the order of operations, since the counter frequency
will in general be smaller than 10**9. (In fact, it's mandated to be 1Ghz in
ARMv9, which makes life simple.) However, this can give a fair bit of error.
Adopt the calculation used on amd64, with tweaks to handle frequencies as low as
1MHz: the ARM generic timer documentation suggests that ARMv8 timers are
typically in the 1MHz-50MHz range, which is true on arm64 systems that I have
access to.
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D49244
The illumos-specific _SC_CPUID_MAX is the largest CPU ID in the system. This
was mapped to _SC_NPROCESSORS_CONF, which is the total number of CPUs recognized
by the kernel. If CPU IDs are contiguous, as is the case on amd64 and arm64,
this value is one greater than the maximum ID. As a result, when consuming
per-CPU dtrace buffers, libdtrace tries to fetch from a non-existent CPU. This
is mostly harmless in practice, but still wrong.
As we don't have a sysconf value for the maximum CPU ID, add a wrapper which
fetches it using the kern.smp.maxid sysctl.
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D49243
The zero'th index in the array is unused, so a priority queue of N elements
needs N+1 array slots. Fix the allocation.
Also fix the assertion in dt_pq_insert(): the assertion needs to be checked
after incrementing the count of items in the priority queue, otherwise it can
miss an overflow.
Reported by: CHERI
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D49242
Some ACPI wmi query is implemented by named object, not method,
ACPICA complains when non-method object is evaluated with one or more arguments.
Especially, almost all binary MOF object obtaining method is the case.
This commit will fix it.
PR: 284912
Reported by: Alexander Ziaee
Differential Revision: https://reviews.freebsd.org/D49129
Notable upstream pull request merges:
#17042ece35e0e6 zpool: allow relative vdev paths
#17046c43df8bbb vdev_file: unify FreeBSD and Linux implementations
#17064ee8803adc vdev_file: make FLUSH and TRIM asynchronous
#17066ecc44c45c include: move zio_priority_t into zfs.h
#17071ab3db6d15 arc: avoid possible deadlock in arc_read
#17079682c5f6a0 Fix wrong free function in arc_hdr_decrypt
#17080701093c44 Don't try to get mg of hole vdev in removal
#17081d7d274471 Better fill empty metaslabs
#17088a5fb5c55b spa: fix signature mismatch for spa_boot_init as
eventhandler required
#170897f05fface gcm_avx_init: zero the ghash state after hashing the IV
#17122fe674998b Check portable objset MAC even if local is zeroed
Obtained from: OpenZFS
OpenZFS commit: fe674998bb
PR #14161 made spa_do_crypt_objset_mac_abd() to ignore MAC errors
if local MAC can not be calculated at the time. But it does not
mean we should also ignore portable MAC errors there.
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes#17122
scsi_all.h started out life as a work by Julian Elischer to add SCSI
support to CMU Mach 2.5. It was 373 lines. Julian ported this to 386BSD,
included in the 386BSD patch kit and incorported into FreeBSD at its
creation. Justin used this file when writing CAM, and imported it with
the initial CAM import, but only 30% (100 lines) of the original
remained. Justin moved from bitfields to bytes in structures, dropped
the complex unions, and renamed many structures to have their length
appended. Only about 30 structure names and about 40 #defines remained
from the original. The define names were taken directly from the SCSI
standard with spaces replaced by '_', so had no creativity. Apart from
the license comment, there were no comments retained (all the comments
in the CAM import were written by Justin and Ken). Even at that time,
Justin and Ken could have put their copyrights and names and moved to an
acknowledgement of Julian.
In the almost 30 years since that original import, this file has grown
to 4500 lines. Kenneth Merry, Alexander Motin and Justin Gibbs write
85% of the file's lines, if mechanical commits are omitted. Other
contributors contributed less than %5 each of the file.
Replace the original license (which lacked a copyright even and has been
criticized as ambiguous) with FreeBSD's standard 2-clause license. Add
copyrights for Justin, Ken and Alexander, with the date ranges they
contributed to the file. Add a note about the origin of the file to
acknowledge Julian's original work upon which all this was built, though
it's become a ship of Theseus in the mean time, built and rebuild many
times.
On an absolute scale, there's less than 1% of the current file with
lines from the original, and those are named after the names in the SCSI
standards and likely wouldn't qualify for copyright protection.
Sponsored by: Netflix
Reviewed by: mav, ken
Differential Revision: https://reviews.freebsd.org/D49016
KERNBUILDDIR is used by kmod.mk to find the opt_*.h when matching a
kernel to the module. Usually one doesn't need this nob (since most
modules are option invariant or default to the default options everyone
uses), but there are times this generalization doesn't hold.
Sponsored by: Netflix
wg(4) can be compiled into the kernel (device wg), but the wg.4 manpage
does not document this. Adjust it to mention this like other drivers do.
MFC after: 3 days
Reviewed by: carlavilla, kevans, ziaee
Approved by: carlavilla (mentor)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1597
Previously, a two-finger horizontal scroll would result in a forwards/backwards
keyboard event being performed. This patch changes that functionality to be
specified via two new sysctls: horizontal_swipe_finger_count and
scroll_finger_count. The former specifies how many fingers are used to perform
the aforementioned forwards/backwards keyboard event, while the latter specifies
how many fingers are used to perform horizontal scrolling. 0 disables each of
them.
The threshold for scrolling has been coupled into a single tunable:
scr_threshold. This tunable is used for both scrolling and the horizontal swipe.
t_factor and t_invert tunables have been created in the same manner as their
z-axis counterparts.
Horizontal scrolling is disabled by default, as it requires the sysctl
hw.usb.wsp.t_factor to 3 (wsp mode). Horizontal swiping is enabled by default
with a three-finger tap.
Also rewrite much of, and improve, documentation.
Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
Neither the ums(4) nor psm(4) reporting can be used by the wsp(4)
driver, as they rely on static-length movements, while wsp(4) may need
to scroll in large amounts per evdev event push.
This style uses a false button-5 press as an indicator that the z-axis
movement is a horizontal scroll, otherwise a vertical scroll.
Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>