]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoRemove dir empty since r214734
imp [Tue, 10 Sep 2019 17:20:24 +0000 (17:20 +0000)]
Remove dir empty since r214734

4 years agoRemove dirs empty since r336203
imp [Tue, 10 Sep 2019 17:19:43 +0000 (17:19 +0000)]
Remove dirs empty since r336203

4 years agoRemove directory empty after r266735
imp [Tue, 10 Sep 2019 16:58:19 +0000 (16:58 +0000)]
Remove directory empty after r266735

4 years agoRemove empty directory after r215937
imp [Tue, 10 Sep 2019 16:57:35 +0000 (16:57 +0000)]
Remove empty directory after r215937

4 years agoRemove empty directory after r342871
imp [Tue, 10 Sep 2019 16:56:43 +0000 (16:56 +0000)]
Remove empty directory after r342871

4 years agoRemove empty directory imported with r342935
imp [Tue, 10 Sep 2019 16:53:16 +0000 (16:53 +0000)]
Remove empty directory imported with r342935

4 years agoRemove empty directory imported with r238438
imp [Tue, 10 Sep 2019 16:51:52 +0000 (16:51 +0000)]
Remove empty directory imported with r238438

4 years agoRemove now-empty directory after r288337
imp [Tue, 10 Sep 2019 16:50:38 +0000 (16:50 +0000)]
Remove now-empty directory after r288337

4 years agoRemove now-empty directories after r272458
imp [Tue, 10 Sep 2019 16:48:49 +0000 (16:48 +0000)]
Remove now-empty directories after r272458

4 years agoRemove gateworks directories left over from r336136
imp [Tue, 10 Sep 2019 16:43:05 +0000 (16:43 +0000)]
Remove gateworks directories left over from r336136

4 years agoRemove empty tap/tun modules directories after r347241
imp [Tue, 10 Sep 2019 16:41:00 +0000 (16:41 +0000)]
Remove empty tap/tun modules directories after r347241

4 years agoRemove leftover usr.bin/send-pr after r338042
imp [Tue, 10 Sep 2019 16:40:00 +0000 (16:40 +0000)]
Remove leftover usr.bin/send-pr after r338042

4 years agoRemove empty directory after r342256
imp [Tue, 10 Sep 2019 16:38:52 +0000 (16:38 +0000)]
Remove empty directory after r342256

4 years agoRemove empty directory aftre r336532
imp [Tue, 10 Sep 2019 16:37:32 +0000 (16:37 +0000)]
Remove empty directory aftre r336532

4 years agoRemove more directories left over from nand removal
imp [Tue, 10 Sep 2019 16:36:09 +0000 (16:36 +0000)]
Remove more directories left over from nand removal

4 years agoRemove empty directories after drm removal
imp [Tue, 10 Sep 2019 16:35:31 +0000 (16:35 +0000)]
Remove empty directories after drm removal

4 years agoRemove empty directories left over from nand removal
imp [Tue, 10 Sep 2019 16:30:06 +0000 (16:30 +0000)]
Remove empty directories left over from nand removal

4 years agoAdd R_PPC_IRELATIVE relocation
luporl [Tue, 10 Sep 2019 16:16:05 +0000 (16:16 +0000)]
Add R_PPC_IRELATIVE relocation

Pre-requisite for most ifunc related changes.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D21587

4 years agolocale: handle day, abday, mon, abmon, am_pm keywords
yuripv [Tue, 10 Sep 2019 15:09:46 +0000 (15:09 +0000)]
locale: handle day, abday, mon, abmon, am_pm keywords

All of these are defined as mandatory by POSIX.

While here, mark all non-standard ones as FreeBSD-only as
other systems (at least, GNU/Linux and illumos) do not handle
them, so we should not encourage their use.

PR: 237752
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D21490

4 years agoCallout drain does not have to be followed by a callout stop call.
hselasky [Tue, 10 Sep 2019 14:33:07 +0000 (14:33 +0000)]
Callout drain does not have to be followed by a callout stop call.
Fix bogus code.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoImport libedit 2019-09-10
bapt [Tue, 10 Sep 2019 14:30:10 +0000 (14:30 +0000)]
Import libedit 2019-09-10

Compared to current version in base:
- great improvements on the Unicode support
- full support for filename completion including quoting
  which means we do not need anymore our custom addition)
- Improved readline compatiblity

Upgrading libedit has been a pain in the past, because somehow we never
managed to properly cleanup the tree in lib/libedit and each merge has always
been very painful. After years of fighting give up and refresh a merge from
scrarch properly in contrib.

Note that the switch to this version will be done in another commit.

4 years agoTag import of libedit snapshot 2019-09-10
bapt [Tue, 10 Sep 2019 13:56:36 +0000 (13:56 +0000)]
Tag import of libedit snapshot 2019-09-10

4 years agoUpdate libedit to snapshot 2019-09-10
bapt [Tue, 10 Sep 2019 13:55:44 +0000 (13:55 +0000)]
Update libedit to snapshot 2019-09-10

4 years agoFix build for the platforms where db_expr_t is not long
lwhsu [Tue, 10 Sep 2019 08:51:11 +0000 (08:51 +0000)]
Fix build for the platforms where db_expr_t is not long

Sponsored by: The FreeBSD Foundation

4 years agoFix bad path
bapt [Tue, 10 Sep 2019 08:28:44 +0000 (08:28 +0000)]
Fix bad path

Reported by: zeising

4 years agoStop linking to libl by specifying we do not need yywrap
bapt [Tue, 10 Sep 2019 08:19:46 +0000 (08:19 +0000)]
Stop linking to libl by specifying we do not need yywrap

MFC after: 3 days

4 years agoRemove a blankline wrongly added in r351781
bapt [Tue, 10 Sep 2019 07:56:57 +0000 (07:56 +0000)]
Remove a blankline wrongly added in r351781

4 years agoRemove mklocale(1) and colldef(1) which are deprecated since FreeBSD 11
bapt [Tue, 10 Sep 2019 07:54:49 +0000 (07:54 +0000)]
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

4 years agoIn FreeBSD 11 localedef(1) has replaced the mklocale(1) and colldef(1)
bapt [Tue, 10 Sep 2019 07:47:52 +0000 (07:47 +0000)]
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

4 years agoRemove reference to mklocale regarding the nls directory
bapt [Tue, 10 Sep 2019 07:40:45 +0000 (07:40 +0000)]
Remove reference to mklocale regarding the nls directory

mklocale never had anything to do with the content of this directory

MFC after: 3 days

4 years agoStop linking to libl by specifying we do not need yywrap
bapt [Tue, 10 Sep 2019 07:28:27 +0000 (07:28 +0000)]
Stop linking to libl by specifying we do not need yywrap

MFC after: 3 days

4 years agoStop linking to libl by specifying we do not need yywrap
bapt [Tue, 10 Sep 2019 07:26:38 +0000 (07:26 +0000)]
Stop linking to libl by specifying we do not need yywrap

MFC after: 3 days

4 years agoStop linking to libl by specifying we do not need yywrap
bapt [Tue, 10 Sep 2019 07:25:37 +0000 (07:25 +0000)]
Stop linking to libl by specifying we do not need yywrap

MFC after: 3 days

4 years agoStop linking to libl by specifying we do not need yywrap
bapt [Tue, 10 Sep 2019 07:23:01 +0000 (07:23 +0000)]
Stop linking to libl by specifying we do not need yywrap

MFC after: 3 days

4 years agoby specifyng we do not use yywrap we can avoid linking to libl and liby
bapt [Tue, 10 Sep 2019 07:20:32 +0000 (07:20 +0000)]
by specifyng we do not use yywrap we can avoid linking to libl and liby

MFC after: 3 days

4 years agoconfig: do not link against libl, it is not needed
bapt [Tue, 10 Sep 2019 07:14:39 +0000 (07:14 +0000)]
config: do not link against libl, it is not needed

MFC after: 3 days

4 years agoFix 'calendar -a' in several ways.
glebius [Tue, 10 Sep 2019 04:21:48 +0000 (04:21 +0000)]
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)

4 years agoRemove pointless playing with LC_TIME, which should have been done in r205821.
glebius [Tue, 10 Sep 2019 04:01:41 +0000 (04:01 +0000)]
Remove pointless playing with LC_TIME, which should have been done in r205821.

4 years agoAppease Clang false-positive Werrors in r352112
cem [Tue, 10 Sep 2019 01:56:47 +0000 (01:56 +0000)]
Appease Clang false-positive Werrors in r352112

Reported by: bcran

4 years agoddb(4): Add 'show route <dest>' and 'show routetable [<af>]'
cem [Mon, 9 Sep 2019 22:54:27 +0000 (22:54 +0000)]
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

4 years agoInitialize page/subpage in case of `modepage -d`.
mav [Mon, 9 Sep 2019 22:08:22 +0000 (22:08 +0000)]
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.

4 years agoChange synchonization rules for vm_page reference counting.
markj [Mon, 9 Sep 2019 21:32:42 +0000 (21:32 +0000)]
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

4 years agoReverse the referenced tables.
crees [Mon, 9 Sep 2019 20:48:12 +0000 (20:48 +0000)]
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>

4 years agoAdd one more error message to r352082.
mav [Mon, 9 Sep 2019 19:00:37 +0000 (19:00 +0000)]
Add one more error message to r352082.

MFC after: 5 days
Sponsored by: iXsystems, Inc.

4 years agoRemove obsolete WITHOUT names that are no longer in the system.
imp [Mon, 9 Sep 2019 18:46:28 +0000 (18:46 +0000)]
Remove obsolete WITHOUT names that are no longer in the system.

Noticed by: swills@

4 years agoThese should have been removed when we removed atmel port before 12.
imp [Mon, 9 Sep 2019 18:45:52 +0000 (18:45 +0000)]
These should have been removed when we removed atmel port before 12.

4 years agomsdosfsmount.h: fix ifdef comment
emaste [Mon, 9 Sep 2019 18:35:17 +0000 (18:35 +0000)]
msdosfsmount.h: fix ifdef comment

4 years agocompiler-rt: use 64-bit time_t for all FreeBSD archs except i386
emaste [Mon, 9 Sep 2019 18:33:15 +0000 (18:33 +0000)]
compiler-rt: use 64-bit time_t for all FreeBSD archs except i386

Obtained from: LLVM r370756

4 years agocompiler-rt: use more __sanitizer_time_t on FreeBSD
emaste [Mon, 9 Sep 2019 18:32:29 +0000 (18:32 +0000)]
compiler-rt: use more __sanitizer_time_t on FreeBSD

A few structs were using long for time_t members.

Obtained from: LLVM r370755

4 years agobectl(8): initialize reverse earlier
kevans [Mon, 9 Sep 2019 18:17:30 +0000 (18:17 +0000)]
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

4 years agoFix number of problems found while testing on SAT devices.
mav [Mon, 9 Sep 2019 17:36:29 +0000 (17:36 +0000)]
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.

4 years agoddb(4): Add some support for lexing IPv6 addresses
cem [Mon, 9 Sep 2019 16:32:23 +0000 (16:32 +0000)]
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

4 years agoddb(4): Enhance lexer functionality for specialized commands
cem [Mon, 9 Sep 2019 16:31:14 +0000 (16:31 +0000)]
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

4 years agocsu: Add the riscv .init call sequence
kp [Mon, 9 Sep 2019 16:25:09 +0000 (16:25 +0000)]
csu: Add the riscv .init call sequence

Reviewed by: br
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D21537

4 years agoOnly update SACK/DSACK lists when a non-empty segment was received.
tuexen [Mon, 9 Sep 2019 16:07:47 +0000 (16:07 +0000)]
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

4 years agoriscv: Ensure that BSS is 8-byte aligned
kp [Mon, 9 Sep 2019 15:57:24 +0000 (15:57 +0000)]
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

4 years agom4: import from OpenBSD
bapt [Mon, 9 Sep 2019 15:37:40 +0000 (15:37 +0000)]
m4: import from OpenBSD

By deraadt@

mkstemp() returns -1 on failure

Obtained from: OpenBSD

4 years agom4: import from OpenBSD
bapt [Mon, 9 Sep 2019 15:35:34 +0000 (15:35 +0000)]
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

4 years agom4: import patch from OpenBSD
bapt [Mon, 9 Sep 2019 15:28:22 +0000 (15:28 +0000)]
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

4 years agom4: import patch from OpenBSD
bapt [Mon, 9 Sep 2019 15:24:48 +0000 (15:24 +0000)]
m4: import patch from OpenBSD

Use waitpid()/EINTR idiom for the specific pid, rather than generic wait()

Patch by: deraadt@

Obtained from: OpenBSD

4 years agoImport from OpenBSD a patch which eliminates the link with -ly or -ly
bapt [Mon, 9 Sep 2019 15:20:19 +0000 (15:20 +0000)]
Import from OpenBSD a patch which eliminates the link with -ly or -ly

patch by ibara@

Obtained from: OpenBSD

4 years agoImport from OpenBSD: -E flag
bapt [Mon, 9 Sep 2019 15:18:04 +0000 (15:18 +0000)]
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

4 years agoci-qemu-test: if firmware is not available, hint at pkg to install
emaste [Mon, 9 Sep 2019 14:51:25 +0000 (14:51 +0000)]
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

4 years agoInitialize timehands linkage much earlier.
kib [Mon, 9 Sep 2019 12:42:48 +0000 (12:42 +0000)]
Initialize timehands linkage much earlier.

Reported and tested by: trasz
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoMake timehands count selectable at boottime.
kib [Mon, 9 Sep 2019 11:29:58 +0000 (11:29 +0000)]
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

4 years agoRemove some unneeded vfs_busy() calls in SU code.
kib [Mon, 9 Sep 2019 11:22:38 +0000 (11:22 +0000)]
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

4 years agoMake snprintf(3) and vscanf(3) definitions available under appropriate
kib [Mon, 9 Sep 2019 11:15:14 +0000 (11:15 +0000)]
Make snprintf(3) and vscanf(3) definitions available under appropriate
POSIX visibility.

Reported by: jbeich
Reviewed by: jilles
PR: 207287
MFC after: 1 week

4 years agoral(4): Use unsigned to avoid undefined behavior.
pfg [Mon, 9 Sep 2019 03:31:46 +0000 (03:31 +0000)]
ral(4): Use unsigned to avoid undefined behavior.

Found by NetBSD's kUBSan

Obtained from: NetBSD (github 5b153f1)

4 years agoddb(4): Move an extern variable declaration to a header
cem [Mon, 9 Sep 2019 01:33:45 +0000 (01:33 +0000)]
ddb(4): Move an extern variable declaration to a header

Trivial cleanup, no functional change.

4 years agogdb(4): Root a sysctl tree at 'debug.gdb.'
cem [Sun, 8 Sep 2019 22:52:47 +0000 (22:52 +0000)]
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.

4 years agoFix cpuwhich_t column width
mhorne [Sun, 8 Sep 2019 21:37:52 +0000 (21:37 +0000)]
Fix cpuwhich_t column width

Not bumping .Dd since this is purely a format change.

Approved by: markj (mentor)

4 years agoremove leftover zfsloader directory
tsoome [Sun, 8 Sep 2019 19:54:28 +0000 (19:54 +0000)]
remove leftover zfsloader directory

It really is empty.

4 years agoFix compilation of locore.S with clang
mhorne [Sun, 8 Sep 2019 19:53:11 +0000 (19:53 +0000)]
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

4 years agoRemove a duplicate KTR entry
mhorne [Sun, 8 Sep 2019 19:46:34 +0000 (19:46 +0000)]
Remove a duplicate KTR entry

Reviewed by: markj
Approved by: markj (mentor)
Differential Revision: https://reviews.freebsd.org/D21438

4 years agoRISC-V: fix kernel CFLAGS with clang
mhorne [Sun, 8 Sep 2019 19:44:21 +0000 (19:44 +0000)]
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

4 years agoAllow for compiler versions >= 10
mhorne [Sun, 8 Sep 2019 19:40:52 +0000 (19:40 +0000)]
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

4 years agoloader: --gc-sections needs sections to work with
tsoome [Sun, 8 Sep 2019 19:39:45 +0000 (19:39 +0000)]
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.

4 years ago[rpi] Inherit framebuffer BPP value from the VideoCore firmware
gonzo [Sun, 8 Sep 2019 09:47:21 +0000 (09:47 +0000)]
[rpi] Inherit framebuffer BPP value from the VideoCore firmware

Instead of using hardcoded bpp of 24, obtain current/configured value
from VideoCore. This solves certain problems with Xorg/Qt apps that
require bpp of 32 to work properly. The mode can be forced by setting
framebuffer_depth value in config.txt

PR: 235363
Submitted by: Steve Peurifoy <ssw01@mathistry.net>

4 years agomount_fusefs: fix a segfault on memory allocation failure
asomers [Sat, 7 Sep 2019 21:49:01 +0000 (21:49 +0000)]
mount_fusefs: fix a segfault on memory allocation failure

Reported by: Coverity
Coverity CID: 1354188
MFC after: 4 days
Sponsored by: The FreeBSD Foundation

4 years agofusefs: suppress some Coverity resource leak CIDs in the tests
asomers [Sat, 7 Sep 2019 19:25:45 +0000 (19:25 +0000)]
fusefs: suppress some Coverity resource leak CIDs in the tests

The fusefs tests deliberately leak file descriptors.  To do otherwise would
add extra complications to the tests' mock FUSE server.  This annotation
should hopefully convince Coverity to shut up about the leaks.

Reviewed by: uqs
MFC after: 4 days
Sponsored by: The FreeBSD Foundation

4 years agoUnify cam_send_ccb() error reporting.
mav [Sat, 7 Sep 2019 16:52:40 +0000 (16:52 +0000)]
Unify cam_send_ccb() error reporting.

Error there mean that command was not even executed, and all information
we have about it is errno, and cam_error_print() call is not very useful.
Plus it is most likely a programmatic error, that shoud not happen.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

4 years agoIn do_execve(), use shared text vnode lock consistently.
kib [Sat, 7 Sep 2019 16:10:57 +0000 (16:10 +0000)]
In do_execve(), use shared text vnode lock consistently.

Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agoIn do_execve(), clear imgp->textset when restarting for interpreter.
kib [Sat, 7 Sep 2019 16:05:17 +0000 (16:05 +0000)]
In do_execve(), clear imgp->textset when restarting for interpreter.

Otherwise, we might left the boolean set, which would affect cleanup
after an error on interpreter activation.

Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agoWhen loading ELF interpreter, initialize whole nested image_params with zero.
kib [Sat, 7 Sep 2019 16:03:26 +0000 (16:03 +0000)]
When loading ELF interpreter, initialize whole nested image_params with zero.

Otherwise we could mishandle imgp->textset.

Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agovm_object_deallocate(): Remove no longer needed code.
kib [Sat, 7 Sep 2019 16:01:45 +0000 (16:01 +0000)]
vm_object_deallocate(): Remove no longer needed code.

We track text mappings explicitly, there is no removal of the text
refs on the object deallocate any more, so tmpfs objects should not be
treated specially. Doing so causes excess deref.

Reported and tested by: gallatin
Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agovm_object_coalesce(): avoid extending any nosplit objects, not only
kib [Sat, 7 Sep 2019 15:58:48 +0000 (15:58 +0000)]
vm_object_coalesce(): avoid extending any nosplit objects, not only
that which back tmpfs nodes.

Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agoProperly check for writers when fetching quotas for writeable vnodes
kib [Sat, 7 Sep 2019 15:57:23 +0000 (15:57 +0000)]
Properly check for writers when fetching quotas for writeable vnodes
in UFS quotaon().

Reviewed by: markj
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21560

4 years agoSupply SAT layer with valid transfer sizes.
mav [Sat, 7 Sep 2019 15:56:00 +0000 (15:56 +0000)]
Supply SAT layer with valid transfer sizes.

This is a rework of r344701, that noticed that number of bytes passes to
8 bit sector count field gets truncated.  First decision was to not pass
anything, since ATA specs define the field as N/A.  But it appeared to be a
problem for some SAT devices, that require information about data transfer
to operate properly.  Some additional investigation shown that it is quite
a common practice to set unused fields of ATA commands (fortunately ATA
specs formally allow it) to supply the information to SAT layer.  I have
found SAS-SATA interposer that does not allow pass-through without it.

As side effect, reduce code duplication by removing ata_do_28bit_cmd()
function, replacing it with more universal ata_do_cmd().

MFC after: 1 week
Sponsored by: iXsystems, Inc.

4 years agoriscv: restore default HZ=1000, keep QEMU at HZ=100
philip [Sat, 7 Sep 2019 05:13:31 +0000 (05:13 +0000)]
riscv: restore default HZ=1000, keep QEMU at HZ=100

This reverts r351918 and r351919.

Discussed with: br, ian, imp

4 years agoSome newer HID devices have descriptors that are larger than 1k. Bump
imp [Sat, 7 Sep 2019 03:51:26 +0000 (03:51 +0000)]
Some newer HID devices have descriptors that are larger than 1k. Bump
this to 2k to prevent them from being truncated and ignored. It
appears to be a sanity check only, but bumping it to 2k allows both of
my iic hid devices to be parsed and the second one to work...

4 years agofusefs: coverity cleanup in the tests
asomers [Fri, 6 Sep 2019 19:50:45 +0000 (19:50 +0000)]
fusefs: coverity cleanup in the tests

Address the following defects reported by Coverity:

* Structurally dead code (CID 1404366): set m_quit before FAIL, not after

* Unchecked return value of sysctlbyname (CID 1404321)

* Unchecked return value of stat(2) (CID 1404471)

* Unchecked return value of open(2) (CID 14044021404529)

* Unchecked return value of dup(2) (CID 1404478)

* Buffer overflows. These are all false positives caused by the fact that
  Coverity thinks I'm using a buffer to store strings, when in fact I'm
  really just using it to store a byte array that happens to be initialized
  with a string. I'm changing the type from char to uint8_t in the hopes
  that it will placate Coverity. (CID 1404338140435014043671404376,
  14043791404381140438814044031404425140443314044341404474,
  1404480140448414045031404505)

* False positive file descriptor leak. I'm going to try to fix this with
  Coverity modeling, but I'll also change an EXPECT to ASSERT so we don't
  perform meaningless assertions after the failure. (CID 14043201404324,
  14044401404445).

* Unannotated file descriptor leak. This will be followed up by a Coverity
  modeling change. (CID 14043261404334140433614043571404361,
  14043721404391140439514044091404430140444814044511404455,
  140445714044581404460)

* Uninitialized variables in C++ constructors (CID 14043271404346). In the
  case of m_maxphys, this actually led to part of the FUSE_INIT's response
  being set to stack garbage during the WriteCluster::clustering test.

* Uninitialized sun_len field in struct sockaddr_un (CID 14043301404371,
  1404429).

Reported by: Coverity
Reviewed by: emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21457

4 years agoCoverity fixes in fusefs(5)
asomers [Fri, 6 Sep 2019 19:40:11 +0000 (19:40 +0000)]
Coverity fixes in fusefs(5)

CID 1404532 fixes a signed vs unsigned comparison error in fuse_vnop_bmap.
It could potentially have resulted in VOP_BMAP reporting too many
consecutive blocks.

CID 1404364 is much worse. It was an array access by an untrusted,
user-provided variable. It could potentially have resulted in a malicious
file system crashing the kernel or worse.

Reported by: Coverity
Reviewed by: emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21466

4 years agoloader.efi: UEFI text mode background colors are only using 3 bits
tsoome [Fri, 6 Sep 2019 19:30:23 +0000 (19:30 +0000)]
loader.efi: UEFI text mode background colors are only using 3 bits

Need to mask background colors to pass allowed value.

4 years agoUse file destdir for stage_as sets
sjg [Fri, 6 Sep 2019 19:05:01 +0000 (19:05 +0000)]
Use file destdir for stage_as sets

We cannot use file (without :T) to name targets
but we can use the destination directory (with / replaced by _)
This has the benefit of minimizing the targets created.

Reviewed by: bdrewery
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org//D21283

4 years agorc.8: Update documentation regarding old-style rc scripts
0mp [Fri, 6 Sep 2019 18:51:41 +0000 (18:51 +0000)]
rc.8: Update documentation regarding old-style rc scripts

The EXAMPLES section does not contain any examples of output formats for
the old-style scripts. Remove the misleading bits stating otherwise.

Reviewed by: bcr, imp
Approved by: src (imp)
Differential Revision: https://reviews.freebsd.org/D21552

4 years agoFix build after r351934
cem [Fri, 6 Sep 2019 18:33:39 +0000 (18:33 +0000)]
Fix build after r351934

tcp_queue_pkts() is only used if TCPHPTS is defined (and it is not by
default).

Reported by: gcc

4 years agoThis adds in the missing counter initialization which
rrs [Fri, 6 Sep 2019 18:29:48 +0000 (18:29 +0000)]
This adds in the missing counter initialization which
I had forgotten to bring over.. opps.

Differential Revision: https://reviews.freebsd.org/D21127

4 years agoInitialize if_hw_tsomaxsegsize to 0 to appease gcc's flow analysis as a
imp [Fri, 6 Sep 2019 18:25:42 +0000 (18:25 +0000)]
Initialize if_hw_tsomaxsegsize to 0 to appease gcc's flow analysis as a
fail-safe.

4 years agoAdd myself as a mentor for Scott Phillip (scottph)
scottl [Fri, 6 Sep 2019 17:06:48 +0000 (17:06 +0000)]
Add myself as a mentor for Scott Phillip (scottph)

4 years agoPull in r371111 from upstream llvm trunk (by Eli Friedman):
dim [Fri, 6 Sep 2019 16:06:37 +0000 (16:06 +0000)]
Pull in r371111 from upstream llvm trunk (by Eli Friedman):

  [IfConversion] Fix diamond conversion with unanalyzable branches.

  The code was incorrectly counting the number of identical
  instructions, and therefore tried to predicate an instruction which
  should not have been predicated.  This could have various effects: a
  compiler crash, an assembler failure, a miscompile, or just
  generating an extra, unnecessary instruction.

  Instead of depending on TargetInstrInfo::removeBranch, which only
  works on analyzable branches, just remove all branch instructions.

  Fixes https://bugs.llvm.org/show_bug.cgi?id=43121 and
  https://bugs.llvm.org/show_bug.cgi?id=41121 .

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

This should fix "Unable to predicate BX killed renamable $r0" errors
when building the lang/spidermonkey170 and lang/spidermonkey38 ports for
armv7 and armv6.

PR: 236567
MFC after: 3 days