Commit Graph

244187 Commits

Author SHA1 Message Date
Baptiste Daroussin
c844ab6717 Remove mklocale(1) and colldef(1) which are deprecated since FreeBSD 11
In FreeBSD 11 along with the rework on the collation, mklocale(1) and colldef(1)
has been replaced by localedef(1) (a note has been added to the manpage to state
it).
mklocale(1) and colldef(1) has been kept around to be able to build older
versions of FreeBSD. None of the version requiring those tools are supported
anymore so it is time to remove them from base
2019-09-10 07:54:49 +00:00
Baptiste Daroussin
b3f9b73820 In FreeBSD 11 localedef(1) has replaced the mklocale(1) and colldef(1)
tools to generate the locales data. state it in the libc manpages.

MFC after:	3 days
2019-09-10 07:47:52 +00:00
Baptiste Daroussin
98ac0a3d6a Remove reference to mklocale regarding the nls directory
mklocale never had anything to do with the content of this directory

MFC after:	3 days
2019-09-10 07:40:45 +00:00
Baptiste Daroussin
58aad230b5 Stop linking to libl by specifying we do not need yywrap
MFC after: 3 days
2019-09-10 07:28:27 +00:00
Baptiste Daroussin
bcba42d1f8 Stop linking to libl by specifying we do not need yywrap
MFC after: 3 days
2019-09-10 07:26:38 +00:00
Baptiste Daroussin
a9a39d4014 Stop linking to libl by specifying we do not need yywrap
MFC after: 3 days
2019-09-10 07:25:37 +00:00
Baptiste Daroussin
36ad097f9b Stop linking to libl by specifying we do not need yywrap
MFC after:	3 days
2019-09-10 07:23:01 +00:00
Baptiste Daroussin
35f36f825a by specifyng we do not use yywrap we can avoid linking to libl and liby
MFC after:	3 days
2019-09-10 07:20:32 +00:00
Baptiste Daroussin
ef5312c38e config: do not link against libl, it is not needed
MFC after:	3 days
2019-09-10 07:14:39 +00:00
Gleb Smirnoff
e67975d331 Fix 'calendar -a' in several ways.
o Do not run any iconv() processing in -a. The locale of root user is not
  what is desired by most of the users who receive their calendar mail.
  Just assume that users store their calendars in a format that is readable
  to them. This fixes regression from r344340.
o fork() and setusercontext(LOGIN_SETALL) for every user. This makes LANG
  set inside a calendar file mostly excessive, as we will pick up user's
  login class LANG.
o This also executes complex function cal() that parses user owned files
  with appropriate user privileges.
  Previously it was run with privileges dropped only temporary for execution
  of cal(), and fully dropped only before invoking sendmail (see r22473).

Reviewed by:	bapt (older version of patch)
2019-09-10 04:21:48 +00:00
Gleb Smirnoff
1e01d2dcac Remove pointless playing with LC_TIME, which should have been done in r205821. 2019-09-10 04:01:41 +00:00
Conrad Meyer
0b12ab8111 Appease Clang false-positive Werrors in r352112
Reported by:	bcran
2019-09-10 01:56:47 +00:00
Conrad Meyer
8b6acd2b51 ddb(4): Add 'show route <dest>' and 'show routetable [<af>]'
These commands show the route resolved for a specified destination, or
print out the entire routing table for a given address family (or all
families, if none is explicitly provided).

Discussed with:	emaste
Differential Revision:	https://reviews.freebsd.org/D21510
2019-09-09 22:54:27 +00:00
Alexander Motin
576649b30a Initialize page/subpage in case of modepage -d.
Previously without -m parameter it worked mostly by concodence.

While there, make page/subpage values validation more strict.

MFC after:	5 days
Sponsored by:	iXsystems, Inc.
2019-09-09 22:08:22 +00:00
Mark Johnston
fee2a2fa39 Change synchonization rules for vm_page reference counting.
There are several mechanisms by which a vm_page reference is held,
preventing the page from being freed back to the page allocator.  In
particular, holding the page's object lock is sufficient to prevent the
page from being freed; holding the busy lock or a wiring is sufficent as
well.  These references are protected by the page lock, which must
therefore be acquired for many per-page operations.  This results in
false sharing since the page locks are external to the vm_page
structures themselves and each lock protects multiple structures.

Transition to using an atomically updated per-page reference counter.
The object's reference is counted using a flag bit in the counter.  A
second flag bit is used to atomically block new references via
pmap_extract_and_hold() while removing managed mappings of a page.
Thus, the reference count of a page is guaranteed not to increase if the
page is unbusied, unmapped, and the object's write lock is held.  As
a consequence of this, the page lock no longer protects a page's
identity; operations which move pages between objects are now
synchronized solely by the objects' locks.

The vm_page_wire() and vm_page_unwire() KPIs are changed.  The former
requires that either the object lock or the busy lock is held.  The
latter no longer has a return value and may free the page if it releases
the last reference to that page.  vm_page_unwire_noq() behaves the same
as before; the caller is responsible for checking its return value and
freeing or enqueuing the page as appropriate.  vm_page_wire_mapped() is
introduced for use in pmap_extract_and_hold().  It fails if the page is
concurrently being unmapped, typically triggering a fallback to the
fault handler.  vm_page_wire() no longer requires the page lock and
vm_page_unwire() now internally acquires the page lock when releasing
the last wiring of a page (since the page lock still protects a page's
queue state).  In particular, synchronization details are no longer
leaked into the caller.

The change excises the page lock from several frequently executed code
paths.  In particular, vm_object_terminate() no longer bounces between
page locks as it releases an object's pages, and direct I/O and
sendfile(SF_NOCACHE) completions no longer require the page lock.  In
these latter cases we now get linear scalability in the common scenario
where different threads are operating on different files.

__FreeBSD_version is bumped.  The DRM ports have been updated to
accomodate the KPI changes.

Reviewed by:	jeff (earlier version)
Tested by:	gallatin (earlier version), pho
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D20486
2019-09-09 21:32:42 +00:00
Chris Rees
58a11be1cf Reverse the referenced tables.
If ipv4_prefer is specified, Section 10.3 is relevant.
If ipv6_prefer is specified, Section  2.1 is relevant.

This change makes the corresponding options/sections 'respective'

PR:		docs/234249
Submitted by:	David Fiander <david@fiander.info>
2019-09-09 20:48:12 +00:00
Alexander Motin
2090029769 Add one more error message to r352082.
MFC after:	5 days
Sponsored by:	iXsystems, Inc.
2019-09-09 19:00:37 +00:00
Warner Losh
606478ebb2 Remove obsolete WITHOUT names that are no longer in the system.
Noticed by: swills@
2019-09-09 18:46:28 +00:00
Warner Losh
50e3bde2f3 These should have been removed when we removed atmel port before 12. 2019-09-09 18:45:52 +00:00
Ed Maste
4f0372f8cb msdosfsmount.h: fix ifdef comment 2019-09-09 18:35:17 +00:00
Ed Maste
057a14dafb compiler-rt: use 64-bit time_t for all FreeBSD archs except i386
Obtained from:	LLVM r370756
2019-09-09 18:33:15 +00:00
Ed Maste
af3c40982c compiler-rt: use more __sanitizer_time_t on FreeBSD
A few structs were using long for time_t members.

Obtained from:	LLVM r370755
2019-09-09 18:32:29 +00:00
Kyle Evans
a58f19e687 bectl(8): initialize reverse earlier
This turns into a warning in GCC 4.2 that 'reverse' may be used
uninitialized in this function. While I don't immediately see where it's
deciding this from (there's only two paths that make column != NULL, and
they both set reverse), initializing reverse earlier is good for clarity.

MFC after:	3 days
2019-09-09 18:17:30 +00:00
Alexander Motin
ca847845e3 Fix number of problems found while testing on SAT devices.
- Remove incomplete and dangerous ata_res decoding from ata_do_cmd().
Instead switch all functions that need the result to use get_ata_status(),
doing the same, but more careful, also reducing code duplication.
 - Made get_ata_status() to also decode fixed format sense.  In many cases
it is still not enough to make it useful, since it can only report results
of 28-bit command, but it is slightly better then nothing.
 - Organize error reporting in ata_do_cmd(), so that if caller specified
AP_FLAG_CHK_COND, it is responsible for command errors (non-ioctl ones).
 - Make HPA/AMA errors not fatal for `identify` subcommand.
 - Fix reprobe() not being called on HPA/AMA when in quiet mode.
 - Remove not very useful messages from `format` and `sanitize` commands
with -y flag.  Once they started, they often can't be stopped any way.

MFC after:	5 days
Sponsored by:	iXsystems, Inc.
2019-09-09 17:36:29 +00:00
Conrad Meyer
25b3370cfd ddb(4): Add some support for lexing IPv6 addresses
Allow commands to specify that (hex) numbers may start with A-F, by adding
the DRT_HEX flag for db_read_token_flags().  As before, numbers containing
invalid digits for the current radix are rejected.

Also, lex ':' and '::' tokens as tCOLON and tCOLONCOLON respectively.

There is a mild conflict here with lexed "identifiers" (tIDENT): ddb
identifiers may contain arbitrary colons, and the ddb lexer is greedy.  So
the identifier lex will swallow any colons it finds inside identifiers, and
consumers are still unable to expect the token sequence 'tIDENT tCOLON'.
That limitation does not matter for IPv6 addresses, because the lexer always
attempts to lex numbers before identifiers.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D21509
2019-09-09 16:32:23 +00:00
Conrad Meyer
e0c5dd431b ddb(4): Enhance lexer functionality for specialized commands
Add a db_read_token_flags() variant of db_read_token() with configurable
parameters.

Allow specifying an explicit radix for tNUMBER lexing.  It overrides the
default inference and db_radix setting.

Also provide the option of yielding any lexed whitespace (tWSPACE) (instead
of ignoring it).  This is useful for whitespace-sensitive CS_OWN commands.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D21459
2019-09-09 16:31:14 +00:00
Kristof Provost
d4402ecd3b csu: Add the riscv .init call sequence
Reviewed by:	br
Sponsored by:	Axiado
Differential Revision:	https://reviews.freebsd.org/D21537
2019-09-09 16:25:09 +00:00
Michael Tuexen
6d261981ee Only update SACK/DSACK lists when a non-empty segment was received.
This fixes hitting a KASSERT with a valid packet exchange.

Reviewed by:		rrs@, Richard Scheffenegger
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D21567
2019-09-09 16:07:47 +00:00
Kristof Provost
62ea153efd riscv: Ensure that BSS is 8-byte aligned
This makes clearing it (from locore.S) work without misaligned accesses
(which can trap to machine mode, and be slow).

Reviewed by:	br
Sponsored by:	Axiado
Differential Revision:	https://reviews.freebsd.org/D21538
2019-09-09 15:57:24 +00:00
Baptiste Daroussin
c57596e1ae m4: import from OpenBSD
By deraadt@

mkstemp() returns -1 on failure

Obtained from:	OpenBSD
2019-09-09 15:37:40 +00:00
Baptiste Daroussin
db531a5d18 m4: import from OpenBSD
patch by espie@

replace sloppy parsing of numeric values with strtonum (incr, decr, divert)

still use integers, so use the natural bounds for these.

POSIX says m4 should error when these use non numeric values, and now they
do.

okay millert@

Obtained from:	OpenBSD
2019-09-09 15:35:34 +00:00
Baptiste Daroussin
e0f4e0415e m4: import patch from OpenBSD
by espie@
ifelse is special, fix argv parsing to avoid segfault

problem noticed by Matthew Green (netbsd), slightly different fix
so that argc counting makes more sense.

we might want to warn on wrong number of parameters later, but this is
somewhat inconsistent depending on the builtin right now.

okay millert@

Obtained from:	OpenBSD
2019-09-09 15:28:22 +00:00
Baptiste Daroussin
fdb905e20f m4: import patch from OpenBSD
Use waitpid()/EINTR idiom for the specific pid, rather than generic wait()

Patch by: deraadt@

Obtained from:	OpenBSD
2019-09-09 15:24:48 +00:00
Baptiste Daroussin
d031bd192e Import from OpenBSD a patch which eliminates the link with -ly or -ly
patch by ibara@

Obtained from:	OpenBSD
2019-09-09 15:20:19 +00:00
Baptiste Daroussin
c560b67c5c Import from OpenBSD: -E flag
Add -E flag (make warnings fatal), following the behavior of GNU m4 1.4.9+

Help and direction millert@ espie@ anton@ deraadt@

ok espie@

Obtained from:	OpenBSD
2019-09-09 15:18:04 +00:00
Ed Maste
3e6b8ce30e ci-qemu-test: if firmware is not available, hint at pkg to install
uefi-edk2-qemu-x86_64 provides the firmware ci-qemu-test.sh expects to
use.

Sponsored by:	The FreeBSD Foundation
2019-09-09 14:51:25 +00:00
Konstantin Belousov
6c46ce7ea3 Initialize timehands linkage much earlier.
Reported and tested by:	trasz
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-09-09 12:42:48 +00:00
Konstantin Belousov
4b23dec4c2 Make timehands count selectable at boottime.
Tested by:	O'Connor, Daniel <darius@dons.net.au>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D21563
2019-09-09 11:29:58 +00:00
Konstantin Belousov
d89ac450a7 Remove some unneeded vfs_busy() calls in SU code.
When softdep_fsync() is running, a caller must already started write
for the mount point.  Since unmount or remount to ro suspends mount
point, it cannot run in parallel with softdep_fsync(), which makes
vfs_busy() call there not needed.

Doing blocking vfs_busy() there effectively causes lock order reversal
between vn_start_write() and setting MNTK_UNMOUNT, because
vfs_busy(mp, 0) sleeps waiting for MNTK_UNMOUNT becoming clear, while
unmount sets the flag and starts the suspension.

Note that all other uses of vfs_busy() in SU code are non-blocking.

Reported by:	chs by mckusick
Reviewed by:	mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-09-09 11:22:38 +00:00
Konstantin Belousov
7f3ea0ab3a Make snprintf(3) and vscanf(3) definitions available under appropriate
POSIX visibility.

Reported by:	jbeich
Reviewed by:	jilles
PR:	207287
MFC after:	1 week
2019-09-09 11:15:14 +00:00
Pedro F. Giffuni
26d9565dfc ral(4): Use unsigned to avoid undefined behavior.
Found by NetBSD's kUBSan

Obtained from:	NetBSD (github 5b153f1)
2019-09-09 03:31:46 +00:00
Conrad Meyer
3c40d3fc54 ddb(4): Move an extern variable declaration to a header
Trivial cleanup, no functional change.
2019-09-09 01:33:45 +00:00
Conrad Meyer
10f6c05ce7 gdb(4): Root a sysctl tree at 'debug.gdb.'
Like debug.ddb and debug.kdb.  Rename 'debug.gdbcons' to 'debug.gdb.cons,'
but leave the old name as a compatibility alias.
2019-09-08 22:52:47 +00:00
Mitchell Horne
d1bc2d79f2 Fix cpuwhich_t column width
Not bumping .Dd since this is purely a format change.

Approved by:	markj (mentor)
2019-09-08 21:37:52 +00:00
Toomas Soome
414a763063 remove leftover zfsloader directory
It really is empty.
2019-09-08 19:54:28 +00:00
Mitchell Horne
c7ac71f2ca Fix compilation of locore.S with clang
The branch from _start to mpentry has to cross a large section of data;
an offset larger than can be specified with a 12-bit branch immediate.
Fix this by converting the branch to an unconditional jump. The gcc
assembler does this conversion silently but it is not done automatically
by clang.

Reported by:	Jeremy Bennett <jeremy.bennett@embecosm.com>
Reviewed by:	markj
Approved by:	markj (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21437
2019-09-08 19:53:11 +00:00
Mitchell Horne
5b4f0f860e Remove a duplicate KTR entry
Reviewed by:	markj
Approved by:	markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D21438
2019-09-08 19:46:34 +00:00
Mitchell Horne
45b535facf RISC-V: fix kernel CFLAGS with clang
Use the -march and -mabi flags for both gcc and clang as they are
compatible. Specify the "medium" code model separately as it goes by the
name "medany" under gcc, although they are equivalent.

Reviewed by:	markj
Approved by:	markj (mentor)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D21436
2019-09-08 19:44:21 +00:00
Mitchell Horne
e90bb1adec Allow for compiler versions >= 10
Both clang and gcc development branches have reached version 10. Since we
only parse for a single digit in the major version number, this causes
COMPILER_VERSION to be set to its default of 0.0.0, meaning version checks
fail with these newer compilers.

Reviewed by:	emaste
Approved by:	markj (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D21413
2019-09-08 19:40:52 +00:00
Toomas Soome
094b40659f loader: --gc-sections needs sections to work with
--gc-sections is not really useful unless we generate sections with
-ffunction-sections -fdata-sections

While there, i386/loader would win from --gc-sections too.
2019-09-08 19:39:45 +00:00