Commit graph

268789 commits

Author SHA1 Message Date
Stefan Eßer
98d3422e5e usr.bin/stat: honour locale for "-t %+"
The man page states that "-t %+" prints time information in the same
format as date with no format specifier.

This was not the case, the format used was always that of date for the
POSIX locale.

The fix suggested by the reporter leads to output that matches the
documentation.

(cherry picked from commit 20f8331aca)
2022-03-04 20:43:01 +01:00
Stefan Eßer
6f9036a651 netstat: Fix typo
Correct spelling of "received packers" to "received packets".

(cherry picked from commit c5b8d7b7c1)
2022-03-04 20:41:55 +01:00
Stefan Eßer
c82c2fb1ae 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.

(cherry picked from commit 35b8fd0b69)
2022-03-04 20:41:02 +01:00
Leandro Lupori
ed726c3e34 powerpc64: fix loader regression
After b4cb3fe0e3, loader started crashing on PowerPC64, with a
Program Exception (700) error. The problem was that archsw was
used before being initialized, with the new mount feature. This
change fixes the issue by initializing archsw earlier, before
setting currdev, that triggers the mount.

Reviewed by:		tsoome
MFC after:		1 month
X-MFC-With:		b4cb3fe0e3
Sponsored by:		Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D32027

(cherry picked from commit 680ca73945)
2022-03-04 19:18:22 -03:00
Mark Johnston
543157870d rmlock: Micro-optimize read locking
Use get_pcpu() instead of an open-coded pcpu_find(td->td_oncpu).  This
eliminates some memory accesses and results in a shorter instruction
sequence.  Note that get_pcpu() didn't exist when rmlocks were added.

Reviewed by:	jah, mjg
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c84bb8cd77)
2022-03-04 11:32:14 -05:00
Rick Macklem
69b2217cde nfscl: Fix a use after free in nfscl_cleanupkext()
ler@, markj@ reported a use after free in nfscl_cleanupkext().
They also provided two possible causes:
- In nfscl_cleanup_common(), "own" is the owner string
  owp->nfsow_owner.  If we free that particular
  owner structure, than in subsequent comparisons
  "own" will point to freed memory.
- nfscl_cleanup_common() can free more than one owner, so the use
  of LIST_FOREACH_SAFE() in nfscl_cleanupkext() is not sufficient.

I also believe there is a 3rd:
- If nfscl_freeopenowner() or nfscl_freelockowner() is called
  without the NFSCLSTATE mutex held, this could race with
  nfscl_cleanupkext().
  This could happen when the exclusive lock is held
  on the client, such as when delegations are being returned
  or when recovering from NFSERR_EXPIRED.

This patch fixes them as follows:
1 - Copy the owner string to a local variable before the
    nfscl_cleanup_common() call.
2 - Modify nfscl_cleanup_common() so that it will never free more
    than the first matching element.  Normally there should only
    be one element in each list with a matching open/lock owner
    anyhow (but there might be a bug that results in a duplicate).
    This should guarantee that the FOREACH_SAFE loops in
    nfscl_cleanupkext() are adequate.
3 - Acquire the NFSCLSTATE mutex in nfscl_freeopenowner()
    and nfscl_freelockowner(), if it is not already held.
    This serializes all of these calls with the ones done in
    nfscl_cleanup_common().

(cherry picked from commit 1cedb4ea1a)
2022-03-04 08:08:36 -08:00
Emmanuel Vadot
9498370743 dwc: Support phy mode MII
Some board use dwc phy in MII mode, so do not fail to attach if this is
the case.
Only rockchip code uses the phy mode to program some custom syscon register.

PR:	260848
MFC after:	1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG

(cherry picked from commit da6252a6a0)
2022-03-04 11:29:13 +01:00
Emmanuel Vadot
66f5398552 dwc: Release resources when attach fails
PR:	259282
MFC after:	1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 30f16ad460)
2022-03-04 11:29:13 +01:00
Ed Maste
d9ca85e8da ssh: correct configure option name
The option is security-key-builtin not security-key-internal.  There is
no change to the generated config.h because the option defaults off
anyway.

MFC after:	3 days
Fixes:		87152f3405 ("ssh: disble internal security key...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f1421a8972)
2022-03-03 20:23:51 -05:00
Franco Fichtner
d3e338662f netinet: simplify RSS ifdef statements
Approved by:	transport (rrs)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D31583

(cherry picked from commit 47ded797ce)
2022-03-03 08:56:22 -07:00
Hans Petter Selasky
cf912859d2 usb(4): Automagically apply all quirks for USB mass storage devices.
Currently there are five quirks the USB stack tries to automagically detect:
- UQ_MSC_NO_PREVENT_ALLOW
- UQ_MSC_NO_SYNC_CACHE
- UQ_MSC_NO_TEST_UNIT_READY
- UQ_MSC_NO_GETMAXLUN
- UQ_MSC_NO_START_STOP

If any of the quirks above are set, no further quirks will be probed.

If any of the USB mass storage tests fail, the USB device is
re-enumerated as a last resort to clear any error states from the
device. Then the USB stack will try to probe and attach the umass<N>
device passing the detected quirks.

While at it give more details in dmesg about what is going on.

Tested by:		several
Submitted by:		Idwer Vollering <vidwer_fbsdbugs@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D30919
Sponsored by:		NVIDIA Networking

(cherry picked from commit 7520b88860)
2022-03-03 15:41:12 +01:00
Hans Petter Selasky
304a69596b mlx5ib: Add support for NDR link speed.
The IBTA specification has new speed - NDR. That speed supports signaling
rate of 100Gb. mlx5 IB driver translates link modes reported by ConnectX
device to IB speed and width. Added translation of new 100Gb, 200Gb and
400Gb link modes to NDR IB type and width of x1, x2 or x4 respectively.

Linux commits:
f946e45f59ef01ff54ffb3b1eba3a8e7915e7326

Sponsored by:	NVIDIA Networking

(cherry picked from commit 91c8ffd7e6)
2022-03-03 15:28:53 +01:00
Hans Petter Selasky
36b2d16b51 ibcore: Add support for NDR link speed.
Add new IBTA speed NDR, supporting signaling rate of 100Gb.

Linux commit:
c7adf7717301558e8852949d8e3dc3748d1a4a97

Sponsored by:	NVIDIA Networking

(cherry picked from commit 1aa593b90c)
2022-03-03 15:28:53 +01:00
Hans Petter Selasky
696e179e56 mlx5core: Add PCI IDs for ConnectX-8.
Sponsored by:	NVIDIA Networking

(cherry picked from commit eb16e362d6)
2022-03-03 15:28:53 +01:00
Hans Petter Selasky
d608562a75 mlx5core: Add PCI IDs for ConnectX-7.
Linux commits:
505a7f5478062c6cd11e22022d9f1bf64cd8eab3
dd8595eabeb486d41ad9994e6cece36e0e25e313

Sponsored by:	NVIDIA Networking

(cherry picked from commit ea8aacc523)
2022-03-03 15:28:53 +01:00
Marvin Ma
769f1e79f5 vfs_unregister: fix error handling
Due to misplaced braces, an error from vfs_uninit() in the VFCF_SBDRY
case was ignored.

Reported by:	Anton Rang <rang@acm.org>
Reviewed by:	Anton Rang <rang@acm.org>, markj
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34375

(cherry picked from commit 1517b8d5a7)
2022-03-03 08:20:08 -06:00
Arka Sharma
6a73d96ac4 mmap map_at_zero test: handle W^X
Use kern.elfXX.allow_wx to decide whether to map W+X or W-only memory.

Future work could expand this test to add an "allow_wx" axis to the
test matrix, but I would argue that a separate test should be written,
since that's orthogonal to map_at_zero.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon

(cherry picked from commit 766c2466ff)
2022-03-03 08:20:07 -06:00
Austin Zhang
b8319d9f78 atrtc: reads Century field from FADT table
The ACPI spec describes the FADT->Century field as:

    The RTC CMOS RAM index to the century of data value (hundred and
    thousand year decimals).  If this field contains a zero, then the
    RTC centenary feature is not supported.  If this field has a non-zero
    value, then this field contains an index into RTC RAM space that
    OSPM can use to program the centenary field.

Use this field to decide whether to program the CENTURY register
of the CMOS RTC device.

Reviewed by:	akumar3@isilon.com, dab, vangyzen
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D33667

MFC after:	1 week
Sponsored by:	Dell EMC Isilon

(cherry picked from commit e1ef6c0ef2)
2022-03-03 08:20:07 -06:00
Keith Owens
487cee4ddc ddb: do not assume that ffs is mounted with softdep
Avoid a panic when debugging with "show ffs" in ddb.

Reviewed By:	kib, markj, mckusick
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D31622

(cherry picked from commit 3b29c8b4bd)
2022-03-03 08:20:07 -06:00
Yinlong Lu
a7b187860c ipmi: support getting address from EFI
The original implementation only supports getting the address from legacy
BIOS (by searching for the SMBIOS_SIG pattern in a fixed address space).

Try to get the SMBIOS table from EFI through efirt (EFI Runtime Services)
firstly.  Continue to search in the legacy BIOS if a NULL address is
returned from EFI.

By this way the ipmi function supports both legacy BIOS and UEFI systems.

Reviewed by:	dab, vangyzen
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D30007

(cherry picked from commit ee8b757a94)
2022-03-03 08:20:07 -06:00
Greg V
0ea19e39ff ipmi,smbios: move smbios_walk_table to smbios.h
This function will be used for exposing DMI info as sysctls in the
smbios module (in an upcoming review).

While here, add __packed to the structs.

Reviewed by:	dab
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D29270

(cherry picked from commit f689cb23b2)
2022-03-03 08:20:07 -06:00
Greg V
4cfd4d5482 smbios: support getting address from EFI
On some systems (e.g. Lenovo ThinkPad X240, Apple MacBookPro12,1)
the SMBIOS entry point is not found in the <0xFFFFF space.

Follow the SMBIOS spec and use the EFI Configuration Table for
locating the entry point on EFI systems.

Reviewed by:	rpokala, dab
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D29276

(cherry picked from commit a29bff7a52)
2022-03-03 08:20:07 -06:00
Allan Jude
7abbfbda1e smbios: Move smbios driver out from x86 machdep code
Add it to the x86 GENERIC and MINIMAL kernels

Sponsored by:	Ampere Computing LLC
Submitted by:	Klara Inc.
Reviewed by:	rpokala
Differential Revision:	https://reviews.freebsd.org/D28738

(cherry picked from commit d0673fe160)
2022-03-03 08:20:07 -06:00
Jessica Clarke
95e945313e fuse: Fix build on 32-bit architectures
MFC 3d721de049 ("Fix NFS exports of FUSE file systems for big
directories") missed a case of a uint64_t from HEAD that should be a
u_long in 13 due to KPI differences. Specifically, HEAD has b214fcceac
("Change VOP_READDIR's cookies argument to a **uint64_t"), but stable/13
does not.

This is a direct commit to stable/13.
2022-03-03 03:22:30 +00:00
Warner Losh
e8bb416da1 time_t is pathological: use %j + cast to print it.
Sponsored by:		Netflix

(cherry picked from commit 4aed5c3c9d)
2022-03-02 17:39:34 -06:00
Alan Somers
837e2f537c [skip ci] fusefs: delete a stray comment from 91972cfcdd
(cherry picked from commit 0b6a34acda)
2022-03-02 16:37:25 -07:00
Alan Somers
3d721de049 Fix NFS exports of FUSE file systems for big directories
The FUSE protocol does not require that a directory entry's d_off field
outlive the lifetime of its directory's file handle.  Since the NFS
server must reopen the directory on every VOP_READDIR call, that means
it can't pass uio->uio_offset down to the FUSE server.  Instead, it must
read the directory from 0 each time.  It may need to issue multiple
FUSE_READDIR operations until it finds the d_off field that it's looking
for.  That was the intention behind SVN r348209 and r297887, but a logic
bug prevented subsequent FUSE_READDIR operations from ever being issued,
rendering large directories incompletely browseable.

Reviewed by:	rmacklem

(cherry picked from commit d088dc76e1)

fusefs: optimize NFS readdir for FUSE_NO_OPENDIR_SUPPORT

In its lowest common denominator, FUSE does not require that a directory
entry's d_off field is valid outside of the lifetime of the directory's
FUSE file handle.  But since NFS is stateless, it must reopen the
directory on every call to VOP_READDIR.  That means reading the
directory all the way from the first entry.  Not only does this create
an O(n^2) condition for large directories, but it can also result in
incorrect behavior if either:

* The file system _does_ change the d_off field for the last directory
  entry previously seen by NFS, or
* The file system deletes the last directory entry previously seen by
  NFS.

Handily, for file systems that set FUSE_NO_OPENDIR_SUPPORT d_off is
guaranteed to be valid for the lifetime of the directory entry, there is
no need to read the directory from the start.

Reviewed by:	rmacklem

(cherry picked from commit 4a6526d84a)

fusefs: require FUSE_NO_OPENDIR_SUPPORT for NFS exporting

FUSE file systems that do not set FUSE_NO_OPENDIR_SUPPORT do not
guarantee that d_off will be valid after closing and reopening a
directory.  That conflicts with NFS's statelessness, that results in
unresolvable bugs when NFS reads large directories, if:

* The file system _does_ change the d_off field for the last directory
  entry previously returned by VOP_READDIR, or
* The file system deletes the last directory entry previously seen by
  NFS.

Rather than doing a poor job of exporting such file systems, it's better
just to refuse.

Even though this is technically a breaking change, 13.0-RELEASE's
NFS-FUSE support was bad enough that an MFC should be allowed.

Reviewed by:	rmacklem
Differential Revision: https://reviews.freebsd.org/D33726

(cherry picked from commit 00134a0789)

fusefs: fix the build without INVARIANTS after 00134a0789

MFC with:	00134a0789
Reported by:	se

(cherry picked from commit 18ed2ce77a)
2022-03-02 16:35:33 -07:00
Jamie Gritton
1e40fc6fa9 MFC posixshm: Add a -j option to posixshmcontrol ls, to specify a jail
PR:		257556
Reported by:	grembo@

(cherry picked from commit be7cf3f4b8)
2022-03-02 15:10:33 -08:00
Jamie Gritton
803d7f4ccd posixshm: Allow jails to use kern.ipc.posix_shm_list
PR:		257554
Reported by:	grembo@

(cherry picked from commit d7c4ea7d72)
2022-03-02 15:08:00 -08:00
Li-Wen Hsu
694614c64a powerpc: Fix syntax atomic.h
Fixes:	b5d227b0b2 powerpc: Add atomic_testand_{set,clear}_{int,long}
(cherry picked from commit 62b4e25f05)
2022-03-02 14:08:33 -08:00
Justin Hibbits
c9c6985b8a powerpc/atomic: Fix atomic_testand_*_long on powerpc64
After b5d227b0 FreeBSD was panicking on boot with "Duplicate free" in
UMA.  Analyzing the asm, the '1' mask was treated as an integer, rather
than a long, causing 'slw' (shift left word) to be used for the shifting
instruction, not 'sld' (shift left double).  This means the upper bits
of the bitfield were not getting used, resulting in corruption of the
bitfield.

While fixing this, the 'and' check of the mask does not need to be
recorded, so don't record (drop the '.').

(cherry picked from commit aa4736459e)
2022-03-02 14:08:33 -08:00
Justin Hibbits
8af771a0b3 powerpc: Add atomic_testand_{set,clear}_{int,long}
Add machine-optimized implementations for the following:
* atomic_testandset_int
* atomic_testandclear_int
* atomic_testandset_long
* atomic_testandclear_long

This fixes the build with ISA_206_ATOMICS enabled.
Add the associated atomic_testandset_32, atomic_testandclear_32, so
that ice(4) can potentially build.

(cherry picked from commit b5d227b0b2)
2022-03-02 14:08:33 -08:00
Navdeep Parhar
de6c7392d0 cxgbe(4): Changes to the fatal error handler.
* New error_flags that can be used from the error ithread and elsewhere
  without a synch_op.
* Stop the adapter immediately in t4_fatal_err but defer most of the
  rest of the handling to a task.  The task is allowed to sleep, unlike
  the ithread.  Remove async_event_task as it is no longer needed.
* Dump the devlog, CIMLA, and PCIE_FW exactly once on any fatal error
  involving the firmware or the CIM block.  While here, dump some
  additional info (see dump_cim_regs) for these errors.
* If both reset_on_fatal_err and panic_on_fatal_err are set then attempt
  a reset first and do not panic the system if it is successful.

Sponsored by:	Chelsio Communications

(cherry picked from commit e9e7bc8250)
2022-03-02 14:08:33 -08:00
Dimitry Andric
109eb045bd Apply lld fixes for internal errors building perl on 32-bit PowerPC
Merge commit f457863ae345 from llvm git (by Fangrui Song):

  [ELF] Support REL-format R_AARCH64_NONE relocation

  -fprofile-use=/-fprofile-sample-use= compiles may produce REL-format
  .rel.llvm.call-graph-profile even if the prevailing format is RELA on AArch64.
  Add R_AARCH64_NONE to getImplicitAddend to fix this linker error:

  ```
  ld.lld: error: internal linker error: cannot read addend for relocation R_AARCH64_NONE
  PLEASE submit a bug report to https://crbug.com and run tools/clang/scripts/process_crashreports.py (only works inside Google) which will upload a report and include the crash backtrace.
  ```

Merge commit 53fc5d9b9a01 from llvm git (by Fangrui Song):

  [ELF] Support R_PPC_NONE/R_PPC64_NONE in getImplicitAddend

  Similar to f457863ae345d2635026501f5383e0e625869639

Merge commit 767e64fc11d7 from llvm git (by Fangrui Song):

  [ELF] Support some absolute/PC-relative relocation types for REL format

  ctfconvert seems to use REL-format `.rel.SUNW_dof` for 32-bit architectures.
  ```
  Binary file usr/ports/lang/perl5.32/work/perl-5.32.1/dtrace_mini.o matches
  [alfredo.junior@dell-a ~/tmp/llvm-bug]$ readelf -r dtrace_mini.o

  Relocation section (.rel.SUNW_dof):
  r_offset r_info   r_type              st_value st_name
  00000184 0000281a R_PPC_REL32         00000000 $dtrace1772974259.Perl_dtrace_probe_load
  ```

  Support R_PPC_REL32 to fix `ld.lld: error: drti.c:(.SUNW_dof+0x4E4): internal linker error: cannot read addend for relocation R_PPC_REL32`.
  While here, add some common relocation types for AArch64, PPC, and PPC64.
  We perform minimum tests.

  Reviewed By: adalava, arichardson

  Differential Revision: https://reviews.llvm.org/D120535

Requested by:	alfredo
MFC after:	3 days

(cherry picked from commit 298c3e8d6b)
2022-03-02 23:04:56 +01:00
Eric van Gyzen
9bee45e915 gzip: fix error handling in unxz
The result of fstat() was not checked.  Furthermore, there was a
redundant check of st.st_size.  Fix both.

Reported by:    Coverity
MFC after:	1 week
Sponsored by:	Dell EMC Isilon

(cherry picked from commit 58135fbd8b)
2022-03-02 15:56:31 -06:00
Eric van Gyzen
6887791e18 efivar: handle error when reading --fromfile
The result of read() was stored in an unsigned variable, so the
test for a negative value would never work.

While I'm here, print a better error message for an empty file,
omitting the misleading errno message.

Reported by:	Coverity
MFC after:	1 week
Sponsored by:	Dell EMC Isilon

(cherry picked from commit d0f4e583bf)
2022-03-02 15:56:31 -06:00
Warner Losh
d8d0ac7b5d efivar: use bool for booleans
Rather than int flags we ++, use booleans for all command line args.
No functional change intended.

Reviewed by:		markj@
Sponsored by:		Netflix, Inc
Differential Revision:	https://reviews.freebsd.org/D29621

(cherry picked from commit 066b096d13)
2022-03-02 15:56:31 -06:00
Warner Losh
c2d161d300 efivar: Attempt to fix setting/printing/deleting EFI vars with '-' in their name
Due to how we're parsing UUIDs, we were disallowing setting, printing or
deleting any UEFI variable with a '-' in it when you attempted to do that
operation with the exact name (wildcard reporting was unaffected). Fix the
parser to loop over all the dashes in the name and only give up when all
possible matches are exhausted.

Reviewed by:		markj@
Sponsored by:		Netflix, Inc
Differential Revision:	https://reviews.freebsd.org/D29620

(cherry picked from commit 0292a5c95f)
2022-03-02 15:56:31 -06:00
Warner Losh
36a9057e04 efivar: Add --quiet to not report errors
Add -q/--quiet flag to the command line. With it, errors are not reported at
all. Instead nothing is printed and the exit code is non-zero.

Reviewed by:		markj
Sponsored by:		Netflix, Inc
Differential Revision:	https://reviews.freebsd.org/D29619

(cherry picked from commit 3c0dcbfc85)
2022-03-02 15:56:31 -06:00
Eric van Gyzen
bf75cc097a rtsold: fix memory leak in script execution
Since commit 04e9edb544, rtsold has leaked the memory for the
argument vector of every script it runs.

Reported by:	Coverity
Reviewed by:	markj
Fixes:		04e9edb544
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34355

(cherry picked from commit 331b84b5db)
2022-03-02 15:56:31 -06:00
Eric van Gyzen
b43916e230 rtsold: Use correct error in llflags_get()
Set errno to EINVAL if the name overflows the buffer, as was done
before commit ecce515d54.

Reviewed by:	dab, markj
Fixes:		ecce515d54
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34354

(cherry picked from commit a2a8efb4f6)
2022-03-02 15:56:31 -06:00
Eric van Gyzen
ec68cb077b sendfile_test: fix copy-paste bug
Require the newly opened file descriptor to be good, instead of
re-requiring the one that was required three lines earlier.
Thankfully, opening /dev/null is really unlikely to fail.

Reported by:	Coverity
MFC after:	1 week
Sponsored by:	Dell EMC Isilon

(cherry picked from commit a8fea07c30)
2022-03-02 15:56:31 -06:00
Eric van Gyzen
5be8c23a34 elfdump: handle small files more gracefully
elfdump -E on an empty file would complain "Invalid argument" because
it tried to mmap zero bytes.  With the -E flag, elfdump should
simply exit non-zero.  For tiny files, the code would reference off
the end of the mapped region.

Ensure the file is large enough to contain an ELF header before mapping it.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon

(cherry picked from commit 86e5e10daf)
2022-03-02 15:56:31 -06:00
Eric van Gyzen
22561b00ab Integrate contrib/file/tests with kyua/atf
This could be done better by making each test a separate ATF test case.
This exercise is left for the reader.

Reviewed by:	delphij (earlier version)
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34303

(cherry picked from commit 1581ec9a45)
2022-03-02 15:56:31 -06:00
Eric van Gyzen
c14635226b newfs_msdos: connect the ATF test from NetBSD
NetBSD has an ATF test for newfs_msdos.  Connect it to the build.
Adapt it for FreeBSD.  This would have caught the bug fixed by my
previous commit.

Reviewed by:	delphij, emaste
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34116

(cherry picked from commit 4e71258227)
2022-03-02 15:56:30 -06:00
Eric van Gyzen
6aac8c3904 Allow downstream projects to easily add private and internal libs
Allow projects based on the FreeBSD tree to append to _PRIVATELIBS
and _INTERNALLIBS by simply maintaining their own lists of
LOCAL_PRIVATELIBS and LOCAL_INTERNALLIBS, respectively.

Reviewed by:	bdrewery
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D33901

(cherry picked from commit d7f944a046)
2022-03-02 15:56:30 -06:00
Eric van Gyzen
b49682bb06 sem_clockwait_np test: fix usage of ATF API
ATF_REQUIRE_ERRNO requires the given errno iff the given expression is
true.  These test cases used it incorrectly, potentially allowing
sem_clockwait_np to succeed when it was expected to fail.  Use separate
ATF calls to require failure and the expected errno.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon

(cherry picked from commit 35e4527e88)
2022-03-02 15:56:30 -06:00
Eric van Gyzen
190a6b5aea sem test: move sem_clockwait_np tests into individual cases
Move these tests into individual test cases for all the usual reasons.
No functional change intended.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon

(cherry picked from commit 2334abfd01)
2022-03-02 15:56:30 -06:00
Eric van Gyzen
74c02b96ad sem_clockwait_np test: relax time constraint on VMs
In a guest on a busy hypervisor, the time remaining after an
interrupted sleep could be much lower than other environments.
Relax the lower bound on VMs.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon

(cherry picked from commit 31466594cd)
2022-03-02 15:56:30 -06:00
Eric van Gyzen
c15fc3249f Fix lockstat:::thread-spin dtrace probe with LOCK_PROFILING
The spinning start time is missing from the calculation due to a
misplaced #endif.  Return the #endif where it's supposed to be.

Submitted by:	Alexander Alexeev <aalexeev@isilon.com>
Reviewed by:	bdrewery, mjg
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D31384

(cherry picked from commit 428624130a)
2022-03-02 15:56:30 -06:00