Commit Graph

254178 Commits

Author SHA1 Message Date
Adrian Chadd
26c29e743b [libnetmap] Fix 32 bit compilation under gcc-6.4
Use uintptr_t to cast a uint64_t to a pointer type.
Yeah, it isn't technically correct for platforms with pointers
> 64 bits, but it's fine here.

This fixes 32 bit compat library builds on amd64 and also
mips32 builds.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D26790
2020-11-02 15:01:37 +00:00
Hans Petter Selasky
44a1b2f07b Fix for referencing file via its vnode in ibore.
Use the native vnode lookup functions, instead of going via the LinuxKPI,
because the file referenced is typically created outside the LinuxKPI, and
the LinuxKPI's fdget() can only resolve file descriptor numbers which
were created by itself.

The vnode pointer is used as an identifier to identify XRCD handles which
are sharing resources.

This patch fixes the so-called XRCD support in ibcore for FreeBSD.
Refer to ibv_open_xrcd(3) for more information how the file descriptor
argument is used.

Reviewed by:	kib@
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-11-02 10:44:29 +00:00
Michal Meloun
099b595154 Improve loading of multipage aligned buffers.
The multipage alignment requirements is incompatible with many aspects
of actual busdma code. Multi-page alignment requests are incompatible
with many aspects of current busdma code. Mainly with partially bounced
buffer segments and per-page loop in bus_dmamap_load_buffer(). Because
proper implementation would be a major restructuring of the code, add
the fix only for already known uses and do KASSERT for all other cases.

For this reason, bus_dmamap_load_buffer () should take the memory allocated
by bus_dmam_alloc () as one segment bypassing per page segmentation. We can
do this because it is guaranteed that the memory is physically continuous.

Reviewed by:	bz
Tested by: 	imp, mv, daniel.engberg.lists_pyret.net, kjopek_gmail.com
Differential Revision: https://reviews.freebsd.org/D26735
2020-11-02 08:26:19 +00:00
Conrad Meyer
63ed2e3642 linux(4): Disambiguate identical ioctl errors in distinct paths
And stop truncating the full ioctl number in the error message.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D27048
2020-11-02 06:16:11 +00:00
Alexander Motin
06c888ecb9 Add icc (Isochronous Command Completion) ccb_ataio field.
MFC after:	1 week
2020-11-02 01:01:41 +00:00
Mateusz Piotrowski
a257740767 ifconfig.8: Improve formatting of -f in synopsis
MFC after:	3 days
2020-11-01 22:50:21 +00:00
Mateusz Piotrowski
44c4affa00 Remove Tn macros from ifconfig.8
MFC after:	3 days
2020-11-01 22:46:43 +00:00
Adrian Chadd
e72a100b79 [ctld] Fix compilation under gcc-6.4
* remove dup yylex symbol; already defined in a header file
* uint64_t is always >= 0

Reviewed by:	cem, imp
Differential Revision:	https://reviews.freebsd.org/D27046
2020-11-01 21:18:21 +00:00
Mateusz Piotrowski
758dde0614 Do not document default locations of the OpenBSD and NetBSD ports trees
Our own Ports Collection is not targeting those systems at the moment,
so let's stop documenting bits specific to OpenBSD and NetBSD in the ports
documentation. Especially, that it might bit rot one day.

MFC after:	1 week
2020-11-01 20:54:02 +00:00
Stefan Eßer
ab34af0746 Fix psoition reporting for calendar data file in system directory
MFC after:	3 days
2020-11-01 20:38:35 +00:00
Stefan Eßer
a97cfe08a7 Fix year in 2 most recent entries (2010 -> 2020)
Reported by:	mack@macktronics.com (Dan Mack)
2020-11-01 19:13:55 +00:00
Mateusz Piotrowski
76d2af50b5 Document how to use sudo for SU_CMD
It is rather common for the ports users to replace su(1) with sudo(8)
within the SU_CMD variable. Let's document it in the manual page (so far
it's been hidden in a comment within bsd.commands.mk).

MFC after:	2 weeks
2020-11-01 17:27:48 +00:00
Konstantin Belousov
1fbbe9dbf5 net/if_media.c: improve IFMEDIA_DEBUG output.
Use consistent output format for hex.
Print both media and mask where relevant.

Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27034
2020-11-01 16:38:30 +00:00
Konstantin Belousov
e399f19dba Cleanup of net/if_media.c: simplify cleanup loop in ifmedia_removeall().
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27034
2020-11-01 16:36:21 +00:00
Konstantin Belousov
899322fdfa Cleanup of net/if_media.c: some style.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27034
2020-11-01 16:30:17 +00:00
Konstantin Belousov
2193fb16b5 Cleanup of net/if_media.c: switch to ANSI C function definitions.
Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27034
2020-11-01 16:25:35 +00:00
Adrian Chadd
c2a5b2abc7 [iscsictl] Fix compile issues that creep up with gcc-6.4
This fixes two warnings:

* double-definition of a symbol in a yacc header
* Comparison of an unsigned int being >= 0; that's always
  going to be true.

Reviewed by:	imp, rscheff
Differential Revision:	https://reviews.freebsd.org/D27036
2020-11-01 15:57:14 +00:00
Stefan Eßer
1ebef47735 Make sysctl user.local a tunable that can be written at run-time
This sysctl value had been provided as a read-only variable that is
compiled into the C library based on the value of _PATH_LOCALBASE in
paths.h.

After this change, the value is compiled into the kernel as an empty
string, which is translated to _PATH_LOCALBASE by the C library.

This empty string can be overridden at boot time or by a privileged
user at run time and will then be returned by sysctl.

When set to an empty string, the value returned by sysctl reverts to
_PATH_LOCALBASE.

This update does not change the behavior on any system that does
not modify the default value of user.localbase.

I consider this change as experimental and would prefer if the run-time
write permission was reconsidered and the sysctl variable defined with
CLFLAG_RDTUN instead to restrict it to be set at boot time.

MFC after:	1 month
2020-10-31 23:48:41 +00:00
Vladimir Kondratyev
113ec54c58 acpi_dock(4): Add ACPI_PNP_INFO
MFC after:	2 weeks
2020-10-31 22:20:42 +00:00
Vladimir Kondratyev
58ea3386f3 acpi_wmi(4): Add ACPI_PNP_INFO
MFC after:	2 weeks
2020-10-31 22:19:39 +00:00
Vladimir Kondratyev
9c6e377448 Add plug and play information macroses for ACPI and I2C buses.
Matching table format is compatible with ACPI_ID_PROBE bus method.

Note that while ACPI_ID_PROBE matches against _HID and all _CIDs, current
acpi_pnpinfo_str() exports only _HID and first _CID.  That means second
and further _CIDs should be added to both acpi_pnpinfo_str() and
ACPICOMPAT_PNP_INFO if device matching against them is required.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26824
2020-10-31 22:15:59 +00:00
Brandon Bergren
d4fba56212 Fix 32-bit build after r367209
Fix build on systems with a 32-bit size_t.

Since it's being passed as a pointer, a 64-bit write to it will overflow.

MFC with:	r367209
2020-10-31 22:14:37 +00:00
Vladimir Kondratyev
3bdb684633 devmatch(8): Respect mask field when matching strings of Z type.
While here, add debug output for this action.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D26823
2020-10-31 22:04:13 +00:00
Hans Petter Selasky
c77bfaa750 Implement the USB_GET_DEVICEINFO ioctl(2) for uhid(4).
Submitted by:		pedro martelletto <pedro@ambientworks.net>
MFC after:		1 week
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-10-31 21:53:23 +00:00
Brandon Bergren
bd5e074531 Fix 32-bit build after r367229.
The use of atomic_sub_64() in zfs_zstd.c was breaking the 32-bit build on
platforms without native 64-bit atomics due to atomic_sub_64() not being
available, and no fallback being provided in _STANDALONE.

Provide a standalone stub to match atomic_add_64() using simple math.

While this is not actually atomic, it does not matter in libsa context,
since it always runs single-threaded and does not run under a scheduler.

Reviewed by: mjg (in email)
2020-10-31 21:11:34 +00:00
Vladimir Kondratyev
59402cc58a acpi_video(4): Put display device in to D3 state on "Display off" event.
As required by ACPI specs 6.3, appendix A.6, table B-8.
2020-10-31 20:28:13 +00:00
Vladimir Kondratyev
16b168c115 acpi_video(4): Add evdev support for reporting of video events. 2020-10-31 20:25:55 +00:00
Vladimir Kondratyev
ae2b074bbb acpi(9): Add EVENTHANDLERs for video and AC adapter events.
They are required for coming ACPI support in LinuxKPI.

Reviewed by:	hselasky, manu (as part of D26603)
2020-10-31 20:14:28 +00:00
Vladimir Kondratyev
fe64ff3c04 acpi: Tweak _DSM method evaluation helpers.
- Use ACPI style for _DSM evaluation helper parameter types.
- Constify UUID parameter.
- Increase size of returned DSM function bitmap by acpi_DSMQuery() up to 64
  items. Old limit of 8 functions is not sufficient for JEDEC JESD245 NVDIMMs.
- Add new acpi_EvaluateDSMTyped() helper which performs additional return
  value type check as compared with acpi_EvaluateDSM().
- Reimplement acpi_EvaluateDSM() on top of the acpi_EvaluateDSMTyped() call.

Reviewed by:	scottph, manu
Differential Revision:	https://reviews.freebsd.org/D26602
2020-10-31 19:47:34 +00:00
Vladimir Kondratyev
f19aed3517 ig4(4): Add PCI IDs for Intel Comit Lake I2C controllers.
MFC after:	2 weeks
2020-10-31 19:30:23 +00:00
Mateusz Guzik
4a58b4ab28 zfs: zstd: track allocator statistics
This applies:
commit c4ede65bdf
Author: Mateusz Guzik <mjguzik@gmail.com>
Date:   Fri Oct 30 23:26:10 2020 +0100

    zstd: track allocator statistics

    Note that this only tracks sizes as requested by the caller.
    Actual allocated space will almost always be bigger (e.g., rounded up to
    the next power of 2 or page size). Additionally the allocated buffer may
    be holding other areas hostage. Nonetheless, this is a starting point
    for tracking memory usage in zstd.

from openzfs
2020-10-31 19:07:32 +00:00
Stefan Eßer
7afa1a753e Mention the more strict consistency checks performed by calendar(), which
can make the program abort with an error message on previously accepted
but malformed input files.
2020-10-31 16:39:27 +00:00
Ed Maste
e128bd0ff9 readelf: Add -z decompression support
Compatible with GNU readelf, -z decompresses sections displayed by
-x or -p.

ELF Tool Chain ticket #555
https://sourceforge.net/p/elftoolchain/tickets/555/

Submitted by:	Tiger Gao <tig@FreeBSDFoundation.org>
Reviewed by:	markj
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:    https://reviews.freebsd.org/D26909
2020-10-31 15:27:45 +00:00
Stefan Eßer
8e8c5da47f Improve calendar file parsing and consistency tests
Add line number information to more warning and error messages.
Detect #else and #endif without corresponing #ifdef/#ifndef as error.
Detect missing #endif at end of file and print warning but continue.

Support for #undef has been added to reverse the effect of a prior #define.
It is no error if the argument value has not been defined before.

These changes may cause error aborts on malformed input files (e.g. with
spurious #else or #endif), but no such errors exist in the calendar files
in the FreeBSD base system and the calendar-data port and all tests pass.

More tests will be added in a follow-up commit to detect regressions that
might affect the newly added features.

This commit ends a series of updates that enhance the pre-processor and
make it behave much more like prior versions of the calendar progarm that
called cpp to pre-process the data files.

MFC after:	3 days
Relnotes:	yes
2020-10-31 15:11:24 +00:00
Stefan Eßer
6688708624 Add file names and line numbers to debug messages
MFC after:	3 days
2020-10-31 13:55:10 +00:00
Stefan Eßer
1462201cd5 Add file names and line numbers to calendar format error messages
Without file name and line number it is very cumbersum to identify the
locations of errors in calendar files.

MFC after:	3 days
2020-10-31 13:32:08 +00:00
Stefan Eßer
3b9795a2e8 Fix reversed condition after attempted style fix in r367196
Reported by:	xtouqh@hotmail.com
MFC after:	3 days
2020-10-31 12:10:43 +00:00
Stefan Eßer
d86926912c Fix style, no functional change
Submitted by:	kib
MFC after:	3 days
2020-10-31 11:44:10 +00:00
Colin Percival
d8e59012e2 Attempt to defuse a land mine before anyone else steps on it: The
freebsd-boot partition is not always the first one.

Following the instructions in UPDATING resulted in my overwriting
the efiboot0 partition on my laptop with ZFS boot blocks, which
had negative effects on the system's bootability.

Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D27002
2020-10-31 03:36:31 +00:00
Conrad Meyer
76dfd556f1 linux(4): Add missing clone(2) flags 2020-10-31 01:12:35 +00:00
Warner Losh
096582b0a8 Integrate 4.4BSD-Lite2 changes to IOC_* definitions
Bring in the long-overdue 4.4BSD-Lite2 rev 8.3 by cgd of
sys/ioccom.h. This uses UL suffix for the IOC_* constants so they
don't sign extend. Also bring in the handy diagram from NetBSD's
version of this file. This alters the 4.4BSD-Lite2 code slightly
in a way that's semantically the same but more compact.

This should stop the warnings from Chrome for bogus sign extension.

Reviewed by: kib@, jhb@
Differential Revision: https://reviews.freebsd.org/D26423
2020-10-30 22:00:35 +00:00
John Baldwin
b64b636d46 Use a dynamic buffer for the copy of a node's new value.
This permits setting a node's value to a string longer than BUFSIZ.

Reported by:	Sony Arpita Das @ Chelsio
Reviewed by:	freqlabs
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D27027
2020-10-30 21:13:05 +00:00
John Baldwin
b7d92a6683 Remove IF_SND_TAG_TYPE_TLS_RATE_LIMIT conditionals.
Support for TLS rate limit tags is now in the tree, so this macro is
always defined.

Reviewed by:	hselasky
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27020
2020-10-30 21:05:50 +00:00
Mateusz Guzik
82c174a3b4 malloc: delegate M_EXEC handling to dedicacted routines
It is almost never needed and adds an avoidable branch.

While here do minior clean ups in preparation for larger changes.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D27019
2020-10-30 20:02:32 +00:00
Jung-uk Kim
ac61934942 Add ossl(4) to cryptotest. 2020-10-30 19:53:16 +00:00
Stefan Eßer
77b793c465 Update man-pages to describe the user.localbase variable added in r367179.
MFC after:	3 days
2020-10-30 19:37:53 +00:00
Luca Pizzamiglio
6c0ecdd095 bectl(8): missing flag in the help message
Flag -o for destroy subcommand is missing in the help message,
but present in the man page. Fix it.

PR:		249325
Approved by:	kevans
Differential Revision:	https://reviews.freebsd.org/D26429
2020-10-30 19:37:34 +00:00
Conrad Meyer
ae9cafd919 linux(4): Quiesce warning about madvise(..., -1)
This API misuse is intended to produce an error value to detect certain
bogus stub implementations of MADV_WIPEONFORK.  We don't need to log a
warning about it.

Example:
https://boringssl.googlesource.com/boringssl/+/ad5582985cc6b89d0e7caf0d9cc7e301de61cf66%5E%21/

Reviewed by:	emaste, trasz
Differential Revision:	https://reviews.freebsd.org/D27017
2020-10-30 19:02:59 +00:00
Conrad Meyer
e6790841f7 UFS2: Fix DoS due to corrupted extattrfile
Prior versions of FreeBSD (11.x) may have produced a corrupt extattr file.
(Specifically, r312416 accidentally fixed this defect by removing a strcpy.)
CURRENT FreeBSD supports disk images from those prior versions of FreeBSD.
Validate the internal structure as soon as we read it in from disk, to
prevent these extattr files from causing invariants violations and DoS.

Attempting to access the extattr portion of these files results in
EINTEGRITY.  At this time, the only way to repair files damaged in this way
is to copy the contents to another file and move it over the original.

PR:		244089
Reported by:	Andrea Venturoli <ml AT netfence.it>
Reviewed by:	kib
Discussed with:	mckusick (earlier draft)
Security:	no
Differential Revision:	https://reviews.freebsd.org/D27010
2020-10-30 19:00:42 +00:00
Ilya Bakulin
3f3878075e Add help messages for camcontrol(8) MMCCAM functionality
This adds the help messages for camcontrol(8) in-binary help.
Man page will follow in the separate change.

Reviewed by:	bz
Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D25963
2020-10-30 18:55:08 +00:00