]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agotruncate: use better type for 'round'
eadler [Sun, 29 Jul 2018 07:51:40 +0000 (07:51 +0000)]
truncate: use better type for 'round'

5 years agoFix a variable name typo in r336845 that prevented the rc.d scripts
truckman [Sun, 29 Jul 2018 05:42:07 +0000 (05:42 +0000)]
Fix a variable name typo in r336845 that prevented the rc.d scripts
from being installed in the correct directory.

Resurrect a few rc.d scripts that were prematurely deleted from the
Makefile by r336845.

Reviewed by: brd

5 years agoFix a typo that prevented some rc scripts from being installed.
brd [Sun, 29 Jul 2018 03:20:05 +0000 (03:20 +0000)]
Fix a typo that prevented some rc scripts from being installed.

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16495

5 years agobeinstall: perform pre-installworld steps.
will [Sun, 29 Jul 2018 01:44:26 +0000 (01:44 +0000)]
beinstall: perform pre-installworld steps.

Since all post-installkernel steps are assumed to operate in the updated
installation, it's necessary to chroot all of the followup steps in the new
boot environment.  Set up and mount the source and object directories at the
same paths inside the BE root, and clean up to the extent changes were made.
This commit fixes upgrading using beinstall past the new ntpd user change.

Improve testability of changes to this script while I'm here.

Reported by: rpokala (earlier patch)

5 years agoFix the long term ULE load balancer so that it actually works. The
truckman [Sun, 29 Jul 2018 00:30:06 +0000 (00:30 +0000)]
Fix the long term ULE load balancer so that it actually works.  The
initial call to sched_balance() during startup is meant to initialize
balance_ticks, but does not actually do that since smp_started is
still zero at that time.  Since balance_ticks does not get set,
there are no further calls to sched_balance().  Fix this by setting
balance_ticks in sched_initticks() since we know the value of
balance_interval at that time, and eliminate the useless startup
call to sched_balance().  We don't need to randomize the intial
value of balance_ticks.

Since there is now only one call to sched_balance(), we can hoist
the tests at the top of this function out to the caller and avoid
the overhead of the function call when running a SMP kernel on UP
hardware.

PR: 223914
Reviewed by: kib
MFC after: 2 weeks

5 years agoMFV r336851:
mm [Sun, 29 Jul 2018 00:12:16 +0000 (00:12 +0000)]
MFV r336851:

Update vendor/libarchive/dist to git 2c8c83b9731ff822fad6cc8c670ea5519c366a14

Important vendor changes:
  PR #993: Chdir to -C directory for metalog processing
  OSS-Fuzz #4969: Check size of the extended time field in zip archives
  PR #973: Record informational compression level in gzip header

MFC after: 1 week

5 years agowpa_supplicant.8: Remove removed option
cem [Sat, 28 Jul 2018 23:59:36 +0000 (23:59 +0000)]
wpa_supplicant.8: Remove removed option

Our base version of wpa_supplicant does not support the -u option, so remove
it.

PR: 230102
Submitted by: D Green <dfrg AT xsmail.com>

5 years agoexec.3: Add BUGS section and document non-FreeBSD portability
cem [Sat, 28 Jul 2018 23:55:18 +0000 (23:55 +0000)]
exec.3: Add BUGS section and document non-FreeBSD portability

Requested by: kib (in part)

5 years agoUpdate vendor/libarchive/dist to git 2c8c83b9731ff822fad6cc8c670ea5519c366a14
mm [Sat, 28 Jul 2018 23:47:22 +0000 (23:47 +0000)]
Update vendor/libarchive/dist to git 2c8c83b9731ff822fad6cc8c670ea5519c366a14

Important vendor changes:
  PR #993: Chdir to -C directory for metalog processing
  OSS-Fuzz #4969: Check size of the extended time field in zip archives
  PR #973: Record informational compression level in gzip header

5 years agoMove nscd.conf from etc/ to usr.sbin/nscd/
brd [Sat, 28 Jul 2018 23:29:36 +0000 (23:29 +0000)]
Move nscd.conf from etc/ to usr.sbin/nscd/

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16490

5 years agoSwitch these to CONFS as well so they work with etcupdate/mergemaster.
brd [Sat, 28 Jul 2018 23:02:10 +0000 (23:02 +0000)]
Switch these to CONFS as well so they work with etcupdate/mergemaster.

Approved by: will (mentor)

5 years agorelease: arm: Add a GENERIC sdcard image
manu [Sat, 28 Jul 2018 20:45:36 +0000 (20:45 +0000)]
release: arm: Add a GENERIC sdcard image

This produce a generic sdcard image using armv7 GENERIC kernel that
just need some u-boot (or none if the board have u-boot or a SPI flash
for example).

Reviewed by: imp, gjb
Differential Revision: https://reviews.freebsd.org/D16410

5 years agoOpps, I missed moving a couple of files in r336845.
brd [Sat, 28 Jul 2018 20:41:33 +0000 (20:41 +0000)]
Opps, I missed moving a couple of files in r336845.

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16466

5 years agoMove rc startup scripts from etc/ to sbin/init/
brd [Sat, 28 Jul 2018 20:36:23 +0000 (20:36 +0000)]
Move rc startup scripts from etc/ to sbin/init/

This keeps most startup scripts as CONFS per discussion on src-committers from
back during BSDCan.

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16466

5 years agoUPDATING: Add note about efifb support and serial output
manu [Sat, 28 Jul 2018 20:33:08 +0000 (20:33 +0000)]
UPDATING: Add note about efifb support and serial output

5 years agoWhitespace only change, no functional change intended.
brd [Sat, 28 Jul 2018 20:31:03 +0000 (20:31 +0000)]
Whitespace only change, no functional change intended.

The padding makes it much easier to read, but occasionally means that commits
like this one have to be done to follow up.  I intentionally kept this
separate from r336841 to try and make things easier to follow later on.

Approved by: bapt (mentor)

5 years agoFix `make distribute' installing some configs which means CONFS was broken
brd [Sat, 28 Jul 2018 20:26:25 +0000 (20:26 +0000)]
Fix `make distribute' installing some configs which means CONFS was broken
with etcupdate and mergemaster.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16478

5 years agoMove etc/shells to lib/libc/gen with getusershell(3).
brd [Sat, 28 Jul 2018 20:21:23 +0000 (20:21 +0000)]
Move etc/shells to lib/libc/gen with getusershell(3).

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D16467

5 years agoModify the NFSv4.1 server so that it allows ReclaimComplete as done by ESXi 6.7.
rmacklem [Sat, 28 Jul 2018 20:21:04 +0000 (20:21 +0000)]
Modify the NFSv4.1 server so that it allows ReclaimComplete as done by ESXi 6.7.

I believe that a ReclaimComplete with rca_one_fs == TRUE is only
to be used after a file system has been transferred to a different
file server.  However, RFC5661 is somewhat vague w.r.t. this and
the ESXi 6.7 client does both a ReclaimComplete with rca_one_fs == TRUE
and one with ReclaimComplete with rca_one_fs == FALSE.
Therefore, just ignore the rca_one_fs == TRUE operation and return
NFS_OK without doing anything instead of replying NFS4ERR_NOTSUPP.
This allows the ESXi 6.7 NFSv4.1 client to do a mount.
After discussion on the NFSv4 IETF working group mailing list, doing this
along with setting a flag to note that a ReclaimComplete with rca_one_fs TRUE
was an appropriate way to handle this.
The flag that indicates that a ReclaimComplete with rca_one_fs == TRUE was
done may be used to disable replies of NFS4ERR_GRACE for non-reclaim
state operations in a future commit.

This patch along with r332790, r334492 and r336357 allow ESXi 6.7 NFSv4.1 mounts
work ok. ESX 6.5 NFSv4.1 mounts do not work well, due to what I believe are
violations of RFC-5661 and should not be used.

Reported by: andreas.nagy@frequentis.com
Tested by: andreas.nagy@frequentis.com, daniel@ftml.net (earlier version)
MFC after: 2 weeks
Relnotes: yes

5 years agoDisable -Wcast-align in libbsm and libauditd
asomers [Sat, 28 Jul 2018 20:04:39 +0000 (20:04 +0000)]
Disable -Wcast-align in libbsm and libauditd

Along with some pending upstream changes, this will allow raising the WARNS
level.

Reviewed by: cem, aniketp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16486

5 years agoBe more conservative about setting hw.uart.console
imp [Sat, 28 Jul 2018 19:44:20 +0000 (19:44 +0000)]
Be more conservative about setting hw.uart.console

Note when we've found a 8250 PNP node. Only try to set hw.uart.console
if we see one (otherwise ignore serial hints). The 8250 is the only
one known to have I/O ports, so limit the guessing to when we've
positively seen one.  And limit this to x86 since that's the only
platform where we have I/O ports. Otherwise, we'd set the serial port
to something crazy for the platform and fall off the cliff early in
boot.

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

5 years agoRemove insecure ciphers from GCE sshd configuration
cem [Sat, 28 Jul 2018 19:35:49 +0000 (19:35 +0000)]
Remove insecure ciphers from GCE sshd configuration

They were added for unclear reasons in r277263.  The current OpenSSH
defaults (7.5+) are reasonable, and do not include the insecure rc4 cipher:

                   chacha20-poly1305@openssh.com,
                   aes128-ctr,aes192-ctr,aes256-ctr,
                   aes128-gcm@openssh.com,aes256-gcm@openssh.com,
                   aes128-cbc,aes192-cbc,aes256-cbc

I think I recall there being a reason for a specific list of ciphers on GCE
at the time, but I do not recall what it was, and cannot find any
current GCE documentation of such a list.

So, just revert the explicit configuration and use sane openssh defaults.

PR: 230092
Submitted by: Gustavo Scalet <gustavo.scalet AT collabora.com>
MFC after: 3 days
Security: yes

5 years agoClean up execl*(3) manual page prototype formatting
cem [Sat, 28 Jul 2018 19:08:00 +0000 (19:08 +0000)]
Clean up execl*(3) manual page prototype formatting

Rendering of execle was missing a comma between the NULL argument and envp.

For unclear reasons, POSIX' definition of these routines comments out the
mandatory trailing NULL argument.  That seems unnecessary and probably
(reasonably) confuses mdoc.

For unclear reasons, POSIX' definition of these routines spells NULL as
"(char *)0."  This is needlessly unclear.  One guess might be that POSIX
targets more exotic computer architectures than FreeBSD does.  Fortunately,
there is no such problem on any reasonable platform for FreeBSD to support.
Spell NULL as NULL.

The comma was probably removed in r117204 while the comment and creative
spelling of NULL were added in r116537 (both 15 years ago).

5 years agoUse the cp15 functions to read cp15 registers rather than using assembly
andrew [Sat, 28 Jul 2018 17:21:34 +0000 (17:21 +0000)]
Use the cp15 functions to read cp15 registers rather than using assembly
functions. The former are static inline functions so will compile to a
single instruction.

5 years agoRemove an unneeded cpu_ident() prototype.
andrew [Sat, 28 Jul 2018 16:56:46 +0000 (16:56 +0000)]
Remove an unneeded cpu_ident() prototype.

5 years agoImplement atomic_swap_{32,64,int,long,ptr}(9).
marius [Sat, 28 Jul 2018 15:42:57 +0000 (15:42 +0000)]
Implement atomic_swap_{32,64,int,long,ptr}(9).

5 years agoRemove some write only global values from the arm cpufunc code.
andrew [Sat, 28 Jul 2018 12:53:10 +0000 (12:53 +0000)]
Remove some write only global values from the arm cpufunc code.

5 years agoRemove an unused function from the arm ELF trampoline. It tries to find
andrew [Sat, 28 Jul 2018 12:52:03 +0000 (12:52 +0000)]
Remove an unused function from the arm ELF trampoline. It tries to find
properties about the CPU caches, however we never use these values.

5 years agoOnly build the cache handling code we need when building the arm ELF
andrew [Sat, 28 Jul 2018 12:50:09 +0000 (12:50 +0000)]
Only build the cache handling code we need when building the arm ELF
trampoline.

5 years agoMake the arm cpu setup functions static. Any other place that needs these
andrew [Sat, 28 Jul 2018 12:20:42 +0000 (12:20 +0000)]
Make the arm cpu setup functions static. Any other place that needs these
functions will use the function pointer we create for them.

5 years agoRemove an unneeded check for CPU_XSCALE_81342
andrew [Sat, 28 Jul 2018 12:16:57 +0000 (12:16 +0000)]
Remove an unneeded check for CPU_XSCALE_81342

5 years agoRemove old CPU_ values from the arm cpufunc code. These have been removed.
andrew [Sat, 28 Jul 2018 12:00:32 +0000 (12:00 +0000)]
Remove old CPU_ values from the arm cpufunc code. These have been removed.

5 years agoRemove the old CPU_ values from the arm kernel trampoline. These options
andrew [Sat, 28 Jul 2018 11:58:43 +0000 (11:58 +0000)]
Remove the old CPU_ values from the arm kernel trampoline. These options
are gone so we can remove them from the code.

5 years agoRemove now the cow unused CPU_ARM9 and CPU_FA526 options. These are for
andrew [Sat, 28 Jul 2018 11:00:45 +0000 (11:00 +0000)]
Remove now the cow unused CPU_ARM9 and CPU_FA526 options. These are for
ARMv4 CPUs that are no longer supported.

5 years agoThe RT1310 is an ARM926EJ-S, fix the config to mark it as such.
andrew [Sat, 28 Jul 2018 10:48:41 +0000 (10:48 +0000)]
The RT1310 is an ARM926EJ-S, fix the config to mark it as such.

5 years agoOnly support INTRNG in the SMP code on arm. We already require INTRNG on
andrew [Sat, 28 Jul 2018 07:54:21 +0000 (07:54 +0000)]
Only support INTRNG in the SMP code on arm. We already require INTRNG on
anything that could be multicore on arm.

5 years agoRemove IPI_IRQ_START and IPI_IRQ_END from the arm kernel config files.
andrew [Sat, 28 Jul 2018 06:46:10 +0000 (06:46 +0000)]
Remove IPI_IRQ_START and IPI_IRQ_END from the arm kernel config files.
These are unneeded with INTRNG.

5 years agoTo date, mlockall(MCL_FUTURE) has had the unfortunate side effect of
alc [Sat, 28 Jul 2018 04:06:33 +0000 (04:06 +0000)]
To date, mlockall(MCL_FUTURE) has had the unfortunate side effect of
blocking vm map entry and object coalescing for the calling process.
However, there is no reason that mlockall(MCL_FUTURE) should block
such coalescing.  This change enables it.

Reviewed by: kib, markj
Tested by: pho
MFC after: 6 weeks
Differential Revision: https://reviews.freebsd.org/D16413

5 years agoFix compilation error on some arches after r336761 & r336781.
dab [Sat, 28 Jul 2018 02:53:36 +0000 (02:53 +0000)]
Fix compilation error on some arches after r336761 & r336781.

Another cast for printing an intmax_t was needed in a kqueue test for
some arches.

Pointy-hat: me (twice)
MFC after: 1 week
X-MFC-with: r336761, r336781
Sponsored by: Dell EMC

5 years agoMFV r336800: libarchive: Cherry-pick upstream 2c8c83b9
cem [Sat, 28 Jul 2018 00:59:59 +0000 (00:59 +0000)]
MFV r336800: libarchive: Cherry-pick upstream 2c8c83b9

Relevant vendor changes:
  Fix issue #948: out-of-bounds read in lha_read_data_none()

admbugs: 877
MFC after: 3 days
Security: CVE-2017-14503

5 years agolibarchive: Cherry-pick upstream 2c8c83b9
cem [Sat, 28 Jul 2018 00:55:57 +0000 (00:55 +0000)]
libarchive: Cherry-pick upstream 2c8c83b9

Relevant vendor changes:
  Fix issue #948: out-of-bounds read in lha_read_data_none()

admbugs: 877
Security: CVE-2017-14503

5 years agotools/build/beinstall.sh: Use some slightly better shell syntax; reduce duplication
eadler [Sat, 28 Jul 2018 00:33:40 +0000 (00:33 +0000)]
tools/build/beinstall.sh: Use some slightly better shell syntax; reduce duplication

This is is a first pass at improving the be installer.

Reviewed By: will
Differential Revision: https://reviews.freebsd.org/D16081

5 years agoUpdate nfsd.8 for support of IPv6 addresses for hosts in the "-p" option.
rmacklem [Fri, 27 Jul 2018 23:38:31 +0000 (23:38 +0000)]
Update nfsd.8 for support of IPv6 addresses for hosts in the "-p" option.

r336795 adds support for handling of IPv6 addresses returned by getaddrinfo(3)
for DS hostnames. This updates the man page for this change.

This is a content change.

5 years agoRemove npe.4. It was removed as part of the xscale removal.
imp [Fri, 27 Jul 2018 23:28:35 +0000 (23:28 +0000)]
Remove npe.4. It was removed as part of the xscale removal.

5 years agoAdd support for IPv6 addresses to the pNFS "-p" option.
rmacklem [Fri, 27 Jul 2018 23:10:28 +0000 (23:10 +0000)]
Add support for IPv6 addresses to the pNFS "-p" option.

This patch adds code to handle IPv6 addresses returned by getaddrinfo()
for the host entries in the "-p" command line argument.
If the IPv6 address is a link local address, only use it if it is the
only address for the host. This is done since there is no way to know
if the NFSv4.1 pNFS client is in the same scope zone as the MDS.
inet_ntop() is used for the IPv6 address translation, since the client
will have no use for the scope zone suffix and inet_ntop() does not
put this in the address string.

Discussed with: bu7cher@yandex.ru

5 years agoAvoid a install(1) crash by not using -C when the source is /dev/null
brd [Fri, 27 Jul 2018 22:46:42 +0000 (22:46 +0000)]
Avoid a install(1) crash by not using -C when the source is /dev/null

Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D16476

5 years agoUse % for printf, not a dollar sign
imp [Fri, 27 Jul 2018 22:35:07 +0000 (22:35 +0000)]
Use % for printf, not a dollar sign

5 years agoStyle nits noted by rpokala
imp [Fri, 27 Jul 2018 22:31:38 +0000 (22:31 +0000)]
Style nits noted by rpokala

5 years agoIn the BootXXXX message, use the actual boot variable.
imp [Fri, 27 Jul 2018 22:29:20 +0000 (22:29 +0000)]
In the BootXXXX message, use the actual boot variable.
Fix stupid compile issue that crept in when I moved patches between trees.

5 years agoAdd some additional debug to loader.efi
imp [Fri, 27 Jul 2018 22:29:15 +0000 (22:29 +0000)]
Add some additional debug to loader.efi

Add some verbose debugging information to the loader's new
choices. I'll remove these / put them behind a DEBUG define at a later
time. This is to give additional information if there's any dangling
edge cases not contemplated by the code. r336789 had most of this
change, but had the wrong commit message. This refines it slightly.

5 years agostand debug
imp [Fri, 27 Jul 2018 22:00:00 +0000 (22:00 +0000)]
stand debug

5 years agoalso set multicons for tests
imp [Fri, 27 Jul 2018 21:50:10 +0000 (21:50 +0000)]
also set multicons for tests

5 years agoNote ARM Atmel, Cavlium and XScale removal.
imp [Fri, 27 Jul 2018 21:40:05 +0000 (21:40 +0000)]
Note ARM Atmel, Cavlium and XScale removal.

5 years agoRe-remove these empty directories
imp [Fri, 27 Jul 2018 21:36:29 +0000 (21:36 +0000)]
Re-remove these empty directories

5 years agoThis builds now, so aadd it back to Universe.
imp [Fri, 27 Jul 2018 21:26:32 +0000 (21:26 +0000)]
This builds now, so aadd it back to Universe.

5 years agoRemove xscale support.
imp [Fri, 27 Jul 2018 21:25:07 +0000 (21:25 +0000)]
Remove xscale support.

As discussed in arm@.  This is a scaled back version of the prior
commit because xscale is overlaoded in places to mean armv5 or
similar.  The OLD XSCALE stuff hasn't been useful in a while. The
original committer (cognet@) was the only one that had boards for
it. He's blessed this removal. Newer XSCALE (GUMSTIX) is for hardware
that's quite old. After discussion on arm@, it was clear there was no
support for keeping it.

Noticed by: andrew@

5 years agoRevert r336773: it removed too much.
imp [Fri, 27 Jul 2018 21:25:01 +0000 (21:25 +0000)]
Revert r336773: it removed too much.

r336773 removed all things xscale. However, some things xscale are
really armv5. Revert that entirely. A more modest removal will follow.

Noticed by: andrew@

5 years agoDetach from the child process before completing the test.
markj [Fri, 27 Jul 2018 20:34:15 +0000 (20:34 +0000)]
Detach from the child process before completing the test.

Otherwise the child will receive SIGTRAP if the parent exits first.

5 years agoFix compilation error on some arches after r336761.
dab [Fri, 27 Jul 2018 20:14:58 +0000 (20:14 +0000)]
Fix compilation error on some arches after r336761.

A cast for printing an intmax_t was needed in a kqueue test for some
arches.

MFC after: 1 week
X-MFC-with: r336761
Sponsored by: Dell EMC

5 years agoForgot to delete the link as well for npe.
imp [Fri, 27 Jul 2018 20:07:40 +0000 (20:07 +0000)]
Forgot to delete the link as well for npe.

5 years agoStop exporting __pw_scan and __pw_initpwd as freebsd-private libc functions
ian [Fri, 27 Jul 2018 19:47:42 +0000 (19:47 +0000)]
Stop exporting __pw_scan and __pw_initpwd as freebsd-private libc functions
for use in libutil, and instead compile the small amount of common code
directly into libutil with a .PATH reachover.

Discussed with: kib@

5 years agoRemove the hopelessly confused GUMSTIX.conf config
imp [Fri, 27 Jul 2018 19:25:09 +0000 (19:25 +0000)]
Remove the hopelessly confused GUMSTIX.conf config

This config never worked. At no time did u-boot match the kenrel match
the userland. As all the GUMSTIX gear we support is quite old and/or
not working, remove it. The duovero stuff might work, but nobody
has the hardware for it and GUMSTIX hasn't sold it in years.

5 years agoRemove now-empty directories.
imp [Fri, 27 Jul 2018 19:12:02 +0000 (19:12 +0000)]
Remove now-empty directories.

git-svn doesn't remove them unless you give it special flags, which I
forgot.

Pointy Hat to: imp

5 years agoRename VM_FREELIST_ISADMA to VM_FREELIST_LOWMEM.
imp [Fri, 27 Jul 2018 18:34:20 +0000 (18:34 +0000)]
Rename VM_FREELIST_ISADMA to VM_FREELIST_LOWMEM.

There's no differene between VM_FREELIST_ISADMA and VM_FREELIST_LOWMEM
except for the default boundary (16MB on x86 and 256MB on MIPS, but
they are otherwise the same). We don't need both for any system we
support (there were some really old ARC systems that did have ISA/EISA
bus, but we never ran on them and they are too old to ever grow
support for).

Differential Review: https://reviews.freebsd.org/D16290

5 years agoRemove xscale support
imp [Fri, 27 Jul 2018 18:33:09 +0000 (18:33 +0000)]
Remove xscale support

The OLD XSCALE stuff hasn't been useful in a while. The original
committer (cognet@) was the only one that had boards for it. He's
blessed this removal. Newer XSCALE (GUMSTIX) is for hardware that's
quite old. After discussion on arm@, it was clear there was no support
for keeping it.

Differential Review: https://reviews.freebsd.org/D16313

5 years agoMake ralink compile again.
imp [Fri, 27 Jul 2018 18:31:30 +0000 (18:31 +0000)]
Make ralink compile again.

Add std.ralink to define common things across all ralink configs.
Add cpu, machine and options INTRNG to this file.
Remove RT1310.hints file reference: that file isn't in our tree.

5 years agoRemove Cavium/Econa CNS11xx support.
imp [Fri, 27 Jul 2018 18:30:01 +0000 (18:30 +0000)]
Remove Cavium/Econa CNS11xx support.

This port hasn't been updated since it was committed, apart from
housekeeping. There's no known users, and the known hardware for
this port is too thin to run FreeBSD/arm these days well.

This also removes the last armv4 port. We've had no reports of armv4
systems working since FreeBSD 8. All the kernel support for armv4 has
not been removed since it's too intertwined with armv5 support (which
remains in the tree).

RelNotes: Yes
No objection from: arm@

5 years agoRemove Atmel AT91RM9200 and AT91SAM9 support.
imp [Fri, 27 Jul 2018 18:28:22 +0000 (18:28 +0000)]
Remove Atmel AT91RM9200 and AT91SAM9 support.

The last known robust version of this code base was FreeBSD 8.2. There
are no users of this on current, and all users of it have abandoned
this platform or are in legacy mode with a prior version of FreeBSD.

All known users on arm@ approved this removal, and there were no
objections.

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

5 years agoAdd -b bootnum to allow creation of a specific boot number (rather
imp [Fri, 27 Jul 2018 18:18:20 +0000 (18:18 +0000)]
Add -b bootnum to allow creation of a specific boot number (rather
than the auotmatic selection). This is important in some scripting
environments.

Also, remove bogus checks for bootnum != 0. 0 is a valid bootnum.

Sponsored by: Netflix

5 years agoUse SPP (Supervisor Previous Privilege) bit in the sstatus
br [Fri, 27 Jul 2018 16:13:06 +0000 (16:13 +0000)]
Use SPP (Supervisor Previous Privilege) bit in the sstatus
register to determine if trap is from userspace.

Otherwise if we jump to kernel address from userspace, then
TRAPF_USERMODE failed to detect usermode and then do_ast
triggers a panic "ast in kernel mode".

Reviewed by: markj@
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16469

5 years agoFix handling of KVA in kmem_bootstrap_free().
markj [Fri, 27 Jul 2018 15:46:34 +0000 (15:46 +0000)]
Fix handling of KVA in kmem_bootstrap_free().

Do not use vm_map_remove() to release KVA back to the system.  Because
kernel map entries do not have an associated VM object, with r336030
the vm_map_remove() call will not update the kernel page tables.  Avoid
relying on the vm_map layer and instead update the pmap and release KVA
to the kernel arena directly in kmem_bootstrap_free().

Because the pmap updates will generally result in superpage demotions,
modify pmap_init() to insert PTPs shadowed by superpage mappings into
the kernel pmap's radix tree.

While here, port r329171 to i386.

Reported by: alc
Reviewed by: alc, kib
X-MFC with: r336505
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16426

5 years agoOn amd64, enable workarounds for several Ryzen erratas as described in
kib [Fri, 27 Jul 2018 15:31:20 +0000 (15:31 +0000)]
On amd64, enable workarounds for several Ryzen erratas as described in
the AMD document 55449 'Revision Guide for AMD Family 17h Models
00h-0Fh Processors' rev 1.12.

The errata numbers are mentioned near each action.

It seems that newer BIOSes already include required chicken bits
settings, so the magic MSR updates are only needed when BIOS cannot be
updated.  On the other hand, MWAIT avoidance seems to be important.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoRemove some code that's no longer needed because it's now part of pw_scan(3).
ian [Fri, 27 Jul 2018 15:17:24 +0000 (15:17 +0000)]
Remove some code that's no longer needed because it's now part of pw_scan(3).
It was also leading to segfaults; pw can be NULL when control reaches these
lines now, because of the way my previous change restructured the loops.

Reported by: lwhsu@

5 years agoAllow a EVFILT_TIMER kevent to be updated.
dab [Fri, 27 Jul 2018 13:49:17 +0000 (13:49 +0000)]
Allow a EVFILT_TIMER kevent to be updated.

If a timer is updated (re-added) with a different time period
(specified in the .data field of the kevent), the new time period has
no effect; the timer will not expire until the original time has
elapsed. This violates the documented behavior as the kqueue(2) man
page says (in part) "Re-adding an existing event will modify the
parameters of the original event, and not result in a duplicate
entry."

This modification, adapted from a patch submitted by cem@ to PR214987,
fixes the kqueue system to allow updating a timer entry. The
kevent timer behavior is changed to:

  * When a timer is re-added, update the timer parameters to and
    re-start the timer using the new parameters.
  * Allow updating both active and already expired timers.
  * When the timer has already expired, dequeue any undelivered events
    and clear the count of expirations.

All of these changes address the original PR and also bring the
FreeBSD and macOS kevent timer behaviors into agreement.

A few other changes were made along the way:

  * Update the kqueue(2) man page to reflect the new timer behavior.
  * Fix man page style issues in kqueue(2) diagnosed by igor.
  * Update the timer libkqueue system test to test for the updated
    timer behavior.
  * Fix the (test) libkqueue common.h file so that it includes
    config.h which defines various HAVE_* feature defines, before the
    #if tests for such variables in common.h. This enables the use of
    the actual err(3) family of functions.
  * Fix the usages of the err(3) functions in the tests for incorrect
    type of variables. Those were formerly undiagnosed due to the
    disablement of the err(3) functions (see previous bullet point).

PR: 214987
Reported by: Brian Wellington <bwelling@xbill.org>
Reviewed by: kib
MFC after: 1 week
Relnotes: yes
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D15778

5 years agoFixed endianess issue in AHCI driver
luporl [Fri, 27 Jul 2018 13:11:05 +0000 (13:11 +0000)]
Fixed endianess issue in AHCI driver

There were some bits that were being set in cmd_flags (a field of AHCI's
command list structure) after cmd_flags was converted to little endian.
On a big endian host, such as PowerPC, this would set the wrong bits.
This was preventing AHCI driver from working on these hosts.

Reviewed by: jhibbits
Approved by: jhibbits (mentor)

5 years agolualoader: "nextboot_file" should be spelled "nextboot_conf"
kevans [Fri, 27 Jul 2018 11:35:58 +0000 (11:35 +0000)]
lualoader: "nextboot_file" should be spelled "nextboot_conf"

See: /boot/defaults/loader.conf

Reported by: gtetlow (inadvertently)

5 years agoFeex a cuple of small typos
eadler [Fri, 27 Jul 2018 10:44:38 +0000 (10:44 +0000)]
Feex a cuple of small typos

5 years agoUse https over http for FreeBSD pages
eadler [Fri, 27 Jul 2018 10:40:48 +0000 (10:40 +0000)]
Use https over http for FreeBSD pages

5 years agotop(1): fix a buffer overflow copying states to display while they were incremented
daichi [Fri, 27 Jul 2018 07:05:50 +0000 (07:05 +0000)]
top(1): fix a buffer overflow copying states to display while they were incremented

  - fix an AddressSanitizer error

Submitted by: devnexen@gmail.com
Reviewed by: eadler
Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D16183

5 years agoImprove --strip-trailing-cr handling:
delphij [Fri, 27 Jul 2018 05:21:20 +0000 (05:21 +0000)]
Improve --strip-trailing-cr handling:

 - Advance ctold for f1 and ctnew for f2
 - ungetc() if the character is unexpected
 - Don't break early when we hit the combination on one side

PR: 230049
Reported by: maskray <emacsray gmail com>
Reviewed by: bapt, maskray
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16451

5 years agotop(1): fixed the empty output problem in non-interactive mode (-n, -b) regressed...
daichi [Fri, 27 Jul 2018 01:20:34 +0000 (01:20 +0000)]
top(1): fixed the empty output problem in non-interactive mode (-n, -b) regressed in r336028

PR: 229842
Reported by: Ali Abdallah <aliovx@gmail.com>
Reviewed by: eadler, cy
Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D16455

5 years agoFor the dynamic I/O scheduler, make the TRIM stuff also count against
imp [Thu, 26 Jul 2018 22:55:51 +0000 (22:55 +0000)]
For the dynamic I/O scheduler, make the TRIM stuff also count against
read bias so we do reads in preference to TRIMs. This helps a lot when
many trims are delivered at once from the upper layers as they tend to
delay READs due to priority inversion in the code today.

The non iosched case will be fixed when the trim comibing changes
needed for nvme come in later this year.

Sponsored by: Netflix

5 years agoRe-apply r336625 which was reverted with r336638, now that the underlying
ian [Thu, 26 Jul 2018 20:03:11 +0000 (20:03 +0000)]
Re-apply r336625 which was reverted with r336638, now that the underlying
pw_scan(3) has been fixed in a way that doesn't perturb other callers of
it or the getpwnam(3) family.

Make pw(8) showuser work the same with or without -R <path> for non-root
users.  Without -R, pw(8) uses getpwnam(3), which will open master.passwd
for the root user or passwd for non-root users.  With -R <path> pw(8) was
always opening <path>/master.passwd, which would fail for a non-root user,
then falsely claim the userid you're trying to show doesn't exist.

Now for a non-root user it opens <path>/passwd, and populates the fields in
the returned struct passwd which aren't present in that file with well-known
canonical values, which duplicates the behavior of getpwnam(3).  The net
effect is that the showuser output is identical whether using -R or not.

5 years agoFix OL_DIR definition following r336721.
gjb [Thu, 26 Jul 2018 19:42:23 +0000 (19:42 +0000)]
Fix OL_DIR definition following r336721.

Sponsored by: The FreeBSD Foundation

5 years agoMake pw_scan(3) more compatible with getpwent(3) et. al. when processing
ian [Thu, 26 Jul 2018 18:34:38 +0000 (18:34 +0000)]
Make pw_scan(3) more compatible with getpwent(3) et. al. when processing
data from /etc/passwd rather than /etc/master.passwd.

The libc getpwent(3) and related functions automatically read master.passwd
when run by root, or passwd when run by a non-root user.  When run by non-
root, getpwent() copes with the missing data by setting the corresponding
fields in the passwd struct to known values (zeroes for numbers, or a
pointer to an empty string for literals).  When libutil's pw_scan(3) was
used to parse a line without the root-accessible data, it was leaving
garbage in the corresponding fields.

These changes rename the static pw_init() function used by getpwent() and
friends to __pw_initpwd(), and move it into pw_scan.c so that common init
code can be shared between libc and libutil.  pw_scan(3) now calls
__pw_initpwd() before __pw_scan(), just like the getpwent() family does, so
that reading an arbitrary passwd file in either format and parsing it with
pw_scan(3) returns the same results as getpwent(3) would.

This also adds a new pw_initpwd(3) function to libutil, so that code which
creates passwd structs from scratch in some manner that doesn't involve
pw_scan() can initialize the struct to the values expected by lots of
existing code, which doesn't expect to encounter NULL pointers or garbage
values in some fields.

5 years agoelf_common: update ARM ABI flag names
emaste [Thu, 26 Jul 2018 17:52:57 +0000 (17:52 +0000)]
elf_common: update ARM ABI flag names

In the V5 ABI the flags are EF_ARM_ABI_FLOAT_HARD and
EF_ARM_ABI_FLOAT_SOFT. The flags have the same values as the legacy GCC
flags EF_ARM_VFP_FLOAT and EF_ARM_SOFT_FLOAT respectively.

The legacy names are kept for compatibility.

Reported by: Peter Smith (Linaro)
Reviewed by: imp
Sponsored by: The FreeBSD Foundation

5 years agoConvert bsd.files.mk to support DIRS and simplify by only having one install
brd [Thu, 26 Jul 2018 17:05:33 +0000 (17:05 +0000)]
Convert bsd.files.mk to support DIRS and simplify by only having one install
target.

Also update the pfctl tests Makefile to work with this change.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16430

5 years agoMove apmd.conf to CONFS in usr.sbin/apmd which simplifies this nicely.
brd [Thu, 26 Jul 2018 16:51:23 +0000 (16:51 +0000)]
Move apmd.conf to CONFS in usr.sbin/apmd which simplifies this nicely.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16431

5 years agoMove dumpdates creation to CONFS=
brd [Thu, 26 Jul 2018 16:45:25 +0000 (16:45 +0000)]
Move dumpdates creation to CONFS=

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16435

5 years agoImplement pmap_mincore() for riscv.
markj [Thu, 26 Jul 2018 16:08:26 +0000 (16:08 +0000)]
Implement pmap_mincore() for riscv.

Reviewed by: alc, br
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16444

5 years agoFix fabs(3) for powerpcspe, this time for real
jhibbits [Thu, 26 Jul 2018 14:42:20 +0000 (14:42 +0000)]
Fix fabs(3) for powerpcspe, this time for real

SPE ABI uses the soft-float ABI, which splits doubles into two words.  As such,
fabs(3) cannot work on a double directly.  It's too costly to convert the
argument pair into a single double to use efdabs, so clear the top bit of the
high word, which is the sign bit.

5 years agoDisable OFED for RISC-V: it does not build.
br [Thu, 26 Jul 2018 14:15:04 +0000 (14:15 +0000)]
Disable OFED for RISC-V: it does not build.

Sponsored by: DARPA, AFRL

5 years agotop(1): forgot in r336160
daichi [Thu, 26 Jul 2018 13:53:22 +0000 (13:53 +0000)]
top(1): forgot in r336160

Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D16452

5 years agomakefs: use FreeBSD brelse function signature
emaste [Thu, 26 Jul 2018 13:33:10 +0000 (13:33 +0000)]
makefs: use FreeBSD brelse function signature

Although the ffs (and later msdosfs) implementation in makefs is
independent of the one in kernel, it makes sense to keep differences to
a minimum in order to ease comparison and porting changes across.

Submitted by: Siva Mahadevan
Sponsored by: The FreeBSD Foundation

5 years agocxgbe(4): Consider rateunit before ratemode when displaying information
np [Thu, 26 Jul 2018 07:29:44 +0000 (07:29 +0000)]
cxgbe(4): Consider rateunit before ratemode when displaying information
about a traffic class.  This matches the order in which the firmware
evaluates unit and mode internally.

Sponsored by: Chelsio Communications

5 years agocxgbe(4): Better defaults for all cl-rl rate limiters.
np [Thu, 26 Jul 2018 06:42:09 +0000 (06:42 +0000)]
cxgbe(4): Better defaults for all cl-rl rate limiters.

Start in "class" instead of "flow" mode.  This eliminates the need to
specify an MTU, which is not available that early anyway.  It also
allows the user to manually configure ch-rl rate limiting after attach.
This used to fail because ch-rl isn't supported if cl-rl "flow" mode is
configured.

Set all traffic classes to 1Gbps during initialization.  The goal is to
start off with _any_ valid configuration and 1Gbps works even for
gigabit cards.

Sponsored by: Chelsio Communications

5 years agoIgnore Device Paths in the Boot Info that don't have Media path
imp [Thu, 26 Jul 2018 05:08:58 +0000 (05:08 +0000)]
Ignore Device Paths in the Boot Info that don't have Media path
nodes. These show up in default entries on SuperMicro motherboards and
elsewhere. Before, we couldn't find a block device associated with the
device path and return BAD_CHOICE which was an instant
failure. However, a VendHw node isn't specifc, so when we don't find a
media path, return NOT_SPECIFIC so that the rest of the algorithms
work.

Sponsored by: Netflix.

5 years agoIntroduce test program for auditpipe(4)
asomers [Thu, 26 Jul 2018 00:16:41 +0000 (00:16 +0000)]
Introduce test program for auditpipe(4)

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16395

5 years agoALTQ support for iflib.
pkelsey [Wed, 25 Jul 2018 22:46:36 +0000 (22:46 +0000)]
ALTQ support for iflib.

Reviewed by: jmallett, mmacy
Differential Revision: https://reviews.freebsd.org/D16433

5 years agoOnly build ipmi_linux on x86
jhibbits [Wed, 25 Jul 2018 19:31:32 +0000 (19:31 +0000)]
Only build ipmi_linux on x86

Somehow this wasn't triggered in my pre-commit build.