]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoAdd `missing` and `or-flush` options to "ipfw table <NAME> create"
ae [Fri, 24 May 2019 11:06:24 +0000 (11:06 +0000)]
Add `missing` and `or-flush` options to "ipfw table <NAME> create"
command to simplify firewall reloading.

The `missing` option suppresses EEXIST error code, but does check that
existing table has the same parameters as new one. The `or-flush` option
implies `missing` option and additionally does flush for table if it
is already exist.

Submitted by: lev
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18339

5 years agoCorrect the argument passed to g_eli_algo2str()
lwhsu [Fri, 24 May 2019 06:49:47 +0000 (06:49 +0000)]
Correct the argument passed to g_eli_algo2str()

MFC with: r348206
Sponsored by: The FreeBSD Foundation

5 years agoamdgpio: small formatting cleanup
avg [Fri, 24 May 2019 06:07:33 +0000 (06:07 +0000)]
amdgpio: small formatting cleanup

MFC after: 2 weeks

5 years agoamdgpio: fix reading status of input pins
avg [Fri, 24 May 2019 06:06:42 +0000 (06:06 +0000)]
amdgpio: fix reading status of input pins

AMD FCH GPIO controller uses different bits for setting the output level
and for reporting the input level.

MFC after: 2 weeks

5 years agoamdgpio: remove new line symbols from pin names
avg [Fri, 24 May 2019 06:02:51 +0000 (06:02 +0000)]
amdgpio: remove new line symbols from pin names

That made, for example, gpioc -l output quite hard to read and parse.

Also, fix formatting of a nearby statement with too long lines.

MFC after: 2 weeks

5 years agoRemove kgzip and kgzldr.
delphij [Fri, 24 May 2019 05:34:21 +0000 (05:34 +0000)]
Remove kgzip and kgzldr.

PR: 183666, 229763
Submitted by: Yoshihiro Ota <ota at j.email.ne.jp>
Differential Revision: https://reviews.freebsd.org/D20248

5 years agocryptodeflate: Drop z_stream zbuf.state->dummy from SDT probe.
delphij [Fri, 24 May 2019 02:44:15 +0000 (02:44 +0000)]
cryptodeflate: Drop z_stream zbuf.state->dummy from SDT probe.

For older versions of zlib, dummy was a workaround for compilers that do not
handle opaque type definition well; on FreeBSD, it's representing a value
that is not really useful for monitoring purposes, and the field would be gone
in newer zlib versions.

PR: 229763
Submitted by: Yoshihiro Ota <ota at j.email.ne.jp>
Differential Revision: https://reviews.freebsd.org/D20222

5 years agobectl(8): Add a test for jail/unjail of numeric BE names
kevans [Fri, 24 May 2019 01:53:45 +0000 (01:53 +0000)]
bectl(8): Add a test for jail/unjail of numeric BE names

Fixed by r348215, bectl ujail first attempts the trivial fetch of a jid by
passing the first argument to 'ujail' to jail_getid(3) in case a jid/name
have been passed in instead of a BE name. For numerically named BEs, this
was doing the wrong thing: instead of failing to locate the jid specified
and falling back to mountpath search, jail_getid(3) would return the input
as-is.

While here, I've fixed bectl_jail_cleanup which still used a hard-coded pool
name that was overlooked w.r.t. other work that was in-flight around the
same time.

MFC after: 3 days

5 years agoDisplay CPU model in dmesg on mips targets
imp [Fri, 24 May 2019 01:43:35 +0000 (01:43 +0000)]
Display CPU model in dmesg on mips targets

Also, save the CPU model for atheros ar531x boards.

Submitted by: Hiroki Mori
Differential Revision: https://reviews.freebsd.org/D20371

5 years agoMake uniqueifier match the module definition.
imp [Fri, 24 May 2019 01:43:29 +0000 (01:43 +0000)]
Make uniqueifier match the module definition.

5 years agojail_getid(3): validate jid string input
kevans [Fri, 24 May 2019 01:28:07 +0000 (01:28 +0000)]
jail_getid(3): validate jid string input

Currently, if jail_getid(3) is passed in a numeric string, it assumes that
this is a jid string and passes it back converted to an int without checking
that it's a valid/existing jid. This breaks consumers that might use
jail_getid(3) to see if it can trivially grab a jid from a name if that name
happens to be numeric but not actually the name/jid of the jail. Instead of
returning -1 for the jail not existing, it'll return the int version of the
input and the consumer will not fallback to trying other methods.

Pass the numeric input to jail_get(2) as the jid for validation, rather than
the name. This works well- the kernel enforces that jid=name if name is
numeric, so doing the safe thing and checking numeric input as a jid will
still DTRT based on the description of jail_getid.

Reported by: Wes Maag
Reviewed by: jamie, Wes Maag
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20388

5 years agoAdd support for writing to guest memory in the debug server.
jhb [Fri, 24 May 2019 00:34:13 +0000 (00:34 +0000)]
Add support for writing to guest memory in the debug server.

- Add a write_mem counterpart to read_mem to handle writes to MMIO.
- Add support for the GDB 'M' packet to write bytes to the guest's
  memory.  For MMIO writes, attempt to batch writes up into words.
  This is imprecise, but if you write a single 2 or 4-byte aligned
  word, it should be treated as a single MMIO write operation.
- While here, tidy up the parsing of the 'm' command used for reading
  memory to match 'M'.

Reviewed by: markj, Scott Phillips <d.scott.phillips@intel.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20307

5 years agoAdd a constant for the LS config MSR on AMD CPUs.
jhb [Thu, 23 May 2019 23:37:11 +0000 (23:37 +0000)]
Add a constant for the LS config MSR on AMD CPUs.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19506

5 years agoInitialize a variable to fix build with GCC.
jkim [Thu, 23 May 2019 22:49:03 +0000 (22:49 +0000)]
Initialize a variable to fix build with GCC.

5 years agoAdd deprecation warnings for weaker algorithms to geli(4).
jhb [Thu, 23 May 2019 22:31:55 +0000 (22:31 +0000)]
Add deprecation warnings for weaker algorithms to geli(4).

- Triple DES has been formally deprecated in Kerberos (RFC 8429)
  and is soon to be deprecated in IPsec (RFC 8221).
- Blowfish is deprecated.  FreeBSD doesn't support its successor
  (Twofish).
- MD5 is generally considered a weak digest that has known attacks.

geli refuses to create new volumes using these algorithms via 'geli
init'.  It also warns when attaching to existing volumes or creating
temporary volumes via 'geli onetime' .  The plan is to fully remove
support for these algorithms in FreeBSD 13.

Note that none of these algorithms have ever been the default
algorithm used by geli(8).  Users would have had to explicitly select
these algorithms when creating volumes in the past.

Reviewed by: cem, delphij
MFC after: 3 days
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20344

5 years agoAdd deprecation warnings for IPsec algorithms deprecated in RFC 8221.
jhb [Thu, 23 May 2019 22:06:57 +0000 (22:06 +0000)]
Add deprecation warnings for IPsec algorithms deprecated in RFC 8221.

All of these algorithms are either explicitly marked MUST NOT, or they
are implicitly MUST NOTs by virtue of not being included in IETF's
list of protocols at all despite having assignments from IANA.

Specifically, this adds warnings for the following ciphers:
- des-cbc
- blowfish-cbc
- cast128-cbc
- des-deriv
- des-32iv
- camellia-cbc

Warnings for the following authentication algorithms are also added:
- hmac-md5
- keyed-md5
- keyed-sha1
- hmac-ripemd160

Reviewed by: cem, gnn
MFC after: 3 days
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20340

5 years agoRemove yet another unused variable.
jkim [Thu, 23 May 2019 22:01:05 +0000 (22:01 +0000)]
Remove yet another unused variable.

5 years agorandom(4): deduplicate explicit_bzero() in harvest
cem [Thu, 23 May 2019 21:02:27 +0000 (21:02 +0000)]
random(4): deduplicate explicit_bzero() in harvest

Pull the responsibility for zeroing events, which is general to any
conceivable implementation of a random device algorithm, out of the
algorithm-specific Fortuna code and into the callers.  Most callers
indirect through random_fortuna_process_event(), so add the logic there.
Most callers already explicitly bzeroed the events they provided, so the
logic in Fortuna was mostly redundant.

Add one missing bzero in randomdev_accumulate().  Also, remove a redundant
bzero in the same function -- randomdev_hash_finish() is obliged to bzero
the hash state.

Reviewed by: delphij
Approved by: secteam(delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20318

5 years agouart_cpu_acpi: Fix GCC build break from r348195
cem [Thu, 23 May 2019 20:18:46 +0000 (20:18 +0000)]
uart_cpu_acpi: Fix GCC build break from r348195

extern declarations are redundant with those in uart_cpu.h, which this file
includes.

X-MFC-with: r348195

5 years agoEKCD: Add Chacha20 encryption mode
cem [Thu, 23 May 2019 20:12:24 +0000 (20:12 +0000)]
EKCD: Add Chacha20 encryption mode

Add Chacha20 mode to Encrypted Kernel Crash Dumps.

Chacha20 does not require messages to be multiples of block size, so it is
valid to use the cipher on non-block-sized messages without the explicit
padding AES-CBC would require.  Therefore, allow use with simultaneous dump
compression.  (Continue to disallow use of AES-CBC EKCD with compression.)

dumpon(8) gains a -C cipher flag to select between chacha and aes-cbc.
It defaults to chacha if no -C option is provided.  The man page documents this
behavior.

Relnotes: sure
Sponsored by: Dell EMC Isilon

5 years agoloader: Remove unused variable
manu [Thu, 23 May 2019 20:04:22 +0000 (20:04 +0000)]
loader: Remove unused variable

Reported by: lwshu, ci@

5 years agoUse ACPI SPCR on x86
cperciva [Thu, 23 May 2019 19:55:53 +0000 (19:55 +0000)]
Use ACPI SPCR on x86

This takes the SPCR code currently in uart_cpu_arm64.c, moves it into
a new uart_cpu_acpi.c (with some associated refactoring), and uses it
from both arm64 and x86.

An SPCR serial port address AccessWidth field value of 0 ("reserved")
is now treated as 1 ("byte access") in order to work around a buggy
SPCR table on Amazon EC2 i3.metal instances.

Reviewed by: manu, Greg V
MFC after: 3 days
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D20357

5 years agoloader: Add pnp functions for autoloading modules based on linker.hints
manu [Thu, 23 May 2019 19:26:50 +0000 (19:26 +0000)]
loader: Add pnp functions for autoloading modules based on linker.hints

This adds some new commands to loader :

- pnpmatch
   This takes a pnpinfo string as argument and tries to find a kernel module
   associated with it. -v and -d option are available and are the same as in
   devmatch (v is verbose, d dumps the hints).
- pnpload
   This takes a pnpinfo string as argument and tries to load a kernel module
   associated with it.
- pnpautoload
   This will attempt to load every kernel module for each buses. Each buses are
   probed, the probe function will generate pnpinfo string and load kernel module
   associated with it if it exists.

Only simplebus for FDT system is implemented for now.
Since we need the dtb and overlays to be applied before searching the tree
fdt_devmatch_next will load and apply the dtb + overlays.

All the pnp parsing code comes from devmatch and is the same at 99%.

Reviewed by: imp, kevans
Differential Revision: https://reviews.freebsd.org/D19498

5 years agoChange package the MTREEFLAGS and INSTALLFLAGS missed in r348185
bapt [Thu, 23 May 2019 18:55:48 +0000 (18:55 +0000)]
Change package the MTREEFLAGS and INSTALLFLAGS missed in r348185

Reported by: lwhsu

5 years agoMove back group, master.passwd and shells to etc directory
bapt [Thu, 23 May 2019 18:37:05 +0000 (18:37 +0000)]
Move back group, master.passwd and shells to etc directory

Use the .PATH mechanism instead so keep installing them from lib/libc/gen

While here revert 347961 and 347893 which are no longer needed

Discussed with: manu
Tested by: manu
ok manu@

5 years agoAdd pnpinfo to all i2c drivers that have FDT compat data.
ian [Thu, 23 May 2019 18:24:27 +0000 (18:24 +0000)]
Add pnpinfo to all i2c drivers that have FDT compat data.

5 years agoAdd pnpinfo.
ian [Thu, 23 May 2019 18:19:56 +0000 (18:19 +0000)]
Add pnpinfo.

5 years agoarm: allwinner: Remove frac mode from NM clk
manu [Thu, 23 May 2019 17:36:55 +0000 (17:36 +0000)]
arm: allwinner: Remove frac mode from NM clk

We have a correct clock type aw_clk_frac now for this.

5 years agoarm: allwinner: clk: Use the new frac clock
manu [Thu, 23 May 2019 17:36:19 +0000 (17:36 +0000)]
arm: allwinner: clk: Use the new frac clock

Some clocks used the NM type but this clock is for the ones with the
formula "clk = clkin / n / m" and not "clk = clkin * n / m"
Use the new frac clock for them.

5 years agoarm: allwinner: clk: Add new clock aw_clk_frac
manu [Thu, 23 May 2019 17:35:40 +0000 (17:35 +0000)]
arm: allwinner: clk: Add new clock aw_clk_frac

Add a clock driver for clock that can either be used in integer mode
with one N factor and one M divider or in fractional mode where the
output frequency is chosen between two predifined output.

5 years agoallwinner: aw_ccu: Add some debug printfs (disabled by default)
manu [Thu, 23 May 2019 17:34:33 +0000 (17:34 +0000)]
allwinner: aw_ccu: Add some debug printfs (disabled by default)

Also print information about setting frequency at boot under bootverbose

5 years agoMove to using newvers -c instead of VARS_ONLY=1
imp [Thu, 23 May 2019 17:19:05 +0000 (17:19 +0000)]
Move to using newvers -c instead of VARS_ONLY=1

Use newvers.sh -c to get the copyright, and newvers.sh -V RELDATE to
get the release date.

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

5 years agoConvert freebsd-version to using -v
imp [Thu, 23 May 2019 17:19:00 +0000 (17:19 +0000)]
Convert freebsd-version to using -v

newvers.sh has supported a variable setting only mode, use that in
preference to grep to future proof this script from changes there.

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

5 years agoConvert amd newvers to using newvers.sh -v.
imp [Thu, 23 May 2019 17:18:56 +0000 (17:18 +0000)]
Convert amd newvers to using newvers.sh -v.

Rather than the tedious and error-prone grep of sys/conf/newvers.sh,
use the new -v arg to dig out the data that's desired.

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

5 years agoImplement "VARS_ONLY=1" via special command line args
imp [Thu, 23 May 2019 17:18:48 +0000 (17:18 +0000)]
Implement "VARS_ONLY=1" via special command line args

Add -v to print TYPE REVISION BRANCH RELEASE VERSION RELDATE variables
Add -V var to print var's value
Both of these in ${var}="${val}" format suitable for
eval $(sh newvers.sh -v)
in shell scripts / makefiles.
Add -c to print the copyright / license comment text only.

Document these, and remove soon-to-be obsolete comment.

Minor code motion as well bunded here to put functions after
VARS_ONLY and command line argument parsing.

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

5 years agoRename IICBUS_FDT_PNPINFO -> IICBUS_FDT_PNP_INFO because all the other
ian [Thu, 23 May 2019 16:03:30 +0000 (16:03 +0000)]
Rename IICBUS_FDT_PNPINFO -> IICBUS_FDT_PNP_INFO because all the other
existing pnpinfo-related macros right now use PNP_INFO, not PNPINFO.

5 years agoUse the new FDTCOMPAT_PNP_INFO() macro to define SPIBUS_FDT_PNP_INFO().
ian [Thu, 23 May 2019 15:59:50 +0000 (15:59 +0000)]
Use the new FDTCOMPAT_PNP_INFO() macro to define SPIBUS_FDT_PNP_INFO().
Also rename SPIBUS_PNP_INFO -> SPIBUS_FDT_PNP_INFO because there could be
other kinds of pnpinfo for other (non-fdt) bus attachments.

5 years agoAdd warning that the PNP info has to follow the module declaration.
imp [Thu, 23 May 2019 15:53:41 +0000 (15:53 +0000)]
Add warning that the PNP info has to follow the module declaration.

Due to how the linker.hints file is laid out, we'll associate the pnp
info with the wrong module if the module declaration comes after the
pnp info. Until that limiation is removed, we need to have this
ordering. Ideally, we'd also enforce the ordering somehow, but I've
come up with no way to do that yet...

5 years agoAdd pnpinfo for icee(4) on fdt systems.
ian [Thu, 23 May 2019 15:51:51 +0000 (15:51 +0000)]
Add pnpinfo for icee(4) on fdt systems.

5 years agoDefine macros making it easier to define bus-specific pnpinfo for FDT systems.
ian [Thu, 23 May 2019 15:47:30 +0000 (15:47 +0000)]
Define macros making it easier to define bus-specific pnpinfo for FDT systems.

Pnpinfo is bus-specific and requires the bus name. The FDTCOMPAT_PNP_INFO()
macro makes it easier to define new FDT-based pnpinfo for busses other than
simplebus.

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

5 years agoUse int for the getopt() result.
kib [Thu, 23 May 2019 15:00:15 +0000 (15:00 +0000)]
Use int for the getopt() result.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoAdd posixshmcontrol(1), an utility to manipulate posix shared memory segments.
kib [Thu, 23 May 2019 14:33:01 +0000 (14:33 +0000)]
Add posixshmcontrol(1), an utility to manipulate posix shared memory segments.

See usage for the command line structure.  Man page will come shortly.

Reviewed by: jilles, tmunro
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D20258

5 years agoRelease the bus-recovery gpio pins in detach(), so that unload then
ian [Thu, 23 May 2019 14:21:23 +0000 (14:21 +0000)]
Release the bus-recovery gpio pins in detach(), so that unload then
reload of the module works without "pin already allocated" errors.

5 years agoetcupdate: Add missing directory when building the tree
manu [Thu, 23 May 2019 14:05:42 +0000 (14:05 +0000)]
etcupdate: Add missing directory when building the tree

Missed in 348151

Reported by: lwshu, ci

5 years agoMark i2c slave devices busy while they own the bus.
ian [Thu, 23 May 2019 14:02:39 +0000 (14:02 +0000)]
Mark i2c slave devices busy while they own the bus.

Many i2c slave drivers are in modules that can be unloaded.  If they detach
while IO is in progress the bus would be hung forever.  Conversely,
lower-layer drivers (iicbus and the hardware driver) also live in modules
and other kinds of bad things happen if they get detached while IO is in
progress.  Because device_busy() propagates up to parents, marking the slave
device busy while it owns the bus solves both kinds of problems that come
with detaching i2c devices while IO is in progress.

5 years agoadd mrsas_shutdown method
avg [Thu, 23 May 2019 12:51:13 +0000 (12:51 +0000)]
add mrsas_shutdown method

It should be safer to flush controller and disk caches on the shutdown.
And to gracefully shut down the controller as well.
It seems that the Linux driver has been doing that for a long time.

Discussed with: scottl
Reviewed by: imp, Sumit Saxena <sumit.saxena@broadcom.com>
(both earlier version)
MFC after: 3 weeks
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D19817

5 years agoAdd a kern.ipc.posix_shm_list sysctl.
kib [Thu, 23 May 2019 12:35:40 +0000 (12:35 +0000)]
Add a kern.ipc.posix_shm_list sysctl.

The sysctl provides the listing on named linked posix shared memory
segments existing in the system.

Reuse shm_fill_kinfo() for filling individual struct kinfo_file.
Remove unneeded lock around reading of shmfd->shm_mode.

Reviewed by: jilles, tmunro
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D20258

5 years agoReport ref count of the backing object as st_nlink for posix shm fd.
kib [Thu, 23 May 2019 12:27:45 +0000 (12:27 +0000)]
Report ref count of the backing object as st_nlink for posix shm fd.

Unless there are transient references to the object, the ref count is
equal to the number of the shared memory segment mappings plus one.

Reviewed by: jilles, tmunro
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D20258

5 years agoMake pack_kinfo() available for external callers.
kib [Thu, 23 May 2019 12:25:03 +0000 (12:25 +0000)]
Make pack_kinfo() available for external callers.

Reviewed by: jilles, tmunro
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D20258

5 years agogpioled: fix the manual page update in r348154
avg [Thu, 23 May 2019 11:35:00 +0000 (11:35 +0000)]
gpioled: fix the manual page update in r348154

MFC after: 2 weeks

5 years agogpioled: update the manual page after r348153
avg [Thu, 23 May 2019 11:21:27 +0000 (11:21 +0000)]
gpioled: update the manual page after r348153

MFC after: 2 weeks

5 years agogpioled: add a new hint for initial state
avg [Thu, 23 May 2019 11:15:22 +0000 (11:15 +0000)]
gpioled: add a new hint for initial state

hint.gpioled.%d.state determines the initial state of the LED when the
driver takes control over it:
  0 - the LED is off
  1 - the LED is on
 -1 - the LED is kept as it was

While here, add a module version declaration.

MFC after: 2 weks

5 years agoAdd USB ID for CP2112
avg [Thu, 23 May 2019 11:06:38 +0000 (11:06 +0000)]
Add USB ID for CP2112

This is a curious small widget for which I might write a driver.
It is bridge between USB HID interface and I2C interface plus some
GPIO pins.

MFC after:  2 weeks

5 years agoetcupdate: Fix -p after the move of the passwd related files
manu [Thu, 23 May 2019 07:59:16 +0000 (07:59 +0000)]
etcupdate: Fix -p after the move of the passwd related files

Since PREWORLD_FILES only contain files that needs to be copied into /etc
copy directly those files there.

Reported by: many

5 years agopkgbase: Remove etc/zfs from being packaged
manu [Thu, 23 May 2019 06:53:59 +0000 (06:53 +0000)]
pkgbase: Remove etc/zfs from being packaged

This is an empty directory and it cause a FreeBSD-zfs package to
be created when we don't need one.

Reviewed by: bapt

5 years agoDelete unneeded #include <sys/inflate.h> from sys/mips.
delphij [Thu, 23 May 2019 05:17:18 +0000 (05:17 +0000)]
Delete unneeded #include <sys/inflate.h> from sys/mips.

PR: 229763
Submitted by: Yoshihiro Ota <ota at j.email.ne.jp>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D20190

5 years agopowerpc/mpc85xx: Use the proper (EREF) form of writing to DBCR0
jhibbits [Thu, 23 May 2019 03:47:25 +0000 (03:47 +0000)]
powerpc/mpc85xx: Use the proper (EREF) form of writing to DBCR0

DBCR0, according to the Freescale EREF, is guaranteed to be updated, and
changes take effect, after an isync plus change of MSR[DE] from 0 to 1.
Otherwise it's guaranteed to be updated "eventually".  Use the expected
synchronization sequence to write it for resetting.

This prevents "Reset failed" from being printed immediately before the CPU
resets.

MFC after: 2 weeks

5 years agopowerpc/booke: It helps to set variables before using them
jhibbits [Thu, 23 May 2019 03:40:48 +0000 (03:40 +0000)]
powerpc/booke: It helps to set variables before using them

Actually set the source and destination VA's before using them.  Fixes a
bizarre panic on 32-bit Book-E.  Not sure why this wasn't caught by the
compiler.

5 years agoFix typo from r348128: _func__ -> __func__
dougm [Thu, 23 May 2019 02:10:41 +0000 (02:10 +0000)]
Fix typo from r348128: _func__ -> __func__

Reported by: LINT

5 years agoRemove accidentally-added blank line; the style throughout this file
ian [Thu, 23 May 2019 01:49:08 +0000 (01:49 +0000)]
Remove accidentally-added blank line; the style throughout this file
is to use no whitespace between a comment block and the code it describes.

5 years agoHandle the driftfile option correctly when ntpd_flags is empty.
ian [Thu, 23 May 2019 01:41:49 +0000 (01:41 +0000)]
Handle the driftfile option correctly when ntpd_flags is empty.

The logic I originally wrote to detect whether a driftfile option was in the
set of flags was based on the result of removing the pattern *flag* being an
empty string.  That didn't handle the case where the string was empty to
begin with.  Doh!  So now it also specifically checks for an empty string.

The result of the bad check was that ntpd would run without a driftfile, but
it would do so only if it was running as root instead of the non-priveleged
ntpd user, which isn't a typical case.  Ntpd runs fine without a driftfile,
although it does take it longer to stabilize the clock frequency at startup.

Reported by: avg@
Pointy hat: ian@
MFC after: some testing

5 years agoDecode and name additional x86 feature bits
cem [Wed, 22 May 2019 23:22:36 +0000 (23:22 +0000)]
Decode and name additional x86 feature bits

These are all enumerated in Intel's ISA extension reference, 37th ed.

Sponsored by: Dell EMC Isilon

5 years agoCleanups made necessary by r348115, or reactions to it:
dougm [Wed, 22 May 2019 23:11:16 +0000 (23:11 +0000)]
Cleanups made necessary by r348115, or reactions to it:
1. Change size_t to vm_size_t in some places.
2. Rename vm_map_entry_resize_free to drop the _free part.
3. Fix whitespace errors.
4. Fix screwups in patch-conflict-management that left out important
changes related to growing and shrinking objects.

Reviewed by: alc
Approved by: kib (mentor)

5 years agobectl(8): add description for create subcommand
kevans [Wed, 22 May 2019 23:07:40 +0000 (23:07 +0000)]
bectl(8): add description for create subcommand

In commit r345845, a portion of documentation for the create subcommand was
removed. Specifically, for creating a snapshot of an existing boot
environment. bectl even has a test-case for this functionality.

Removing the sub-command description was discussed in PR 235850.

This patch brings back the second "create" description that was originally
in place. Albeit, with a few wording/clarifying changes.

Submitted by: Rob Fairbanks <rob.fx907 gmail com>
Reviewed by: kevans
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20249

5 years agoAdd pnp info to the imx_i2c driver.
ian [Wed, 22 May 2019 21:47:26 +0000 (21:47 +0000)]
Add pnp info to the imx_i2c driver.

5 years agosave-entropy(8), rc.d/random: Set nodump flag
cem [Wed, 22 May 2019 21:47:17 +0000 (21:47 +0000)]
save-entropy(8), rc.d/random: Set nodump flag

Tag saved entropy files as "nodump," to signal that the files should not be
backed up by dump(8) or other automated backup software that honors the file
flag.

Do not produce an error if the target file resides on a filesystem that does
not support file flags (e.g., msdos /boot).

Reviewed by: delphij
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20358

5 years agoFix gateway setup for the interface routes.
melifaro [Wed, 22 May 2019 21:20:15 +0000 (21:20 +0000)]
Fix gateway setup for the interface routes.

Currently rinit1() and its IPv6 counterpart
  nd6_prefix_onlink_rtrequest() uses dummy null_sdl gateway address
  during route insertion and change it afterwards. This behaviour
  brings complications to the routing stack and the users of its
  upcoming notification system.

This change fixes both rinit1() and nd6_prefix_onlink_rtrequest()
  by filling in proper gateway in the beginning. It does not change any
  of the userland notifications as in both cases, they happen after
  the insertion and fixup process (rt_newaddrmsg_fib() and nd6_rtmsg()).

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20328

5 years agoAdd a new 'tr' (transfer) mode to i2c(8) to support more i2c controllers.
ian [Wed, 22 May 2019 21:06:10 +0000 (21:06 +0000)]
Add a new 'tr' (transfer) mode to i2c(8) to support more i2c controllers.

Some i2c controller hardware does not provide a way to do individual START,
REPEAT-START and STOP actions on the i2c bus.  Instead, they can only do
a complete transfer as a single operation.  Typically they can do either
START-data-STOP or START-data-REPEATSTART-data-STOP.  In the i2c driver
framework, this corresponds to the iicbus_transfer method.  In the userland
interface they are initiated with the I2CRDWR ioctl command.

These changes add a new 'tr' mode which can be specified with the '-m'
command line option.  This mode should work on all hardware; when an i2c
controller driver doesn't directly support the iicbus_transfer method,
code in the i2c driver framework uses the lower-level START/REPEAT/STOP
methods to implement the transfer.  After this new mode has gotten some
testing on various hardware, the 'tr' mode should probably become the
new default mode.

PR: 189914

5 years agoAllocate buffers smaller then ABD chunk size as linear.
mav [Wed, 22 May 2019 18:43:48 +0000 (18:43 +0000)]
Allocate buffers smaller then ABD chunk size as linear.

This allows to reduce memory waste by letting UMA to put multiple small
buffers into one memory page slab.  The page sharing means that UMA
may not be able to free memory page when some of buffers are freed, but
alternatively memory used by that buffer would just be wasted from the
beginning.

This change follows alike change in ZoL, but unlike Linux (according to
my understanding of it from comments) FreeBSD never shares slabs bigger
then one memory page, so this should be even less invasive then there.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

5 years agoPassing a parameter to vm_map_entry_resize_free that describes the
dougm [Wed, 22 May 2019 17:40:54 +0000 (17:40 +0000)]
Passing a parameter to vm_map_entry_resize_free that describes the
amount of resizing reduces the number of functions changing the vm_map
invariants regarding the max_free field of map entries.

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

5 years agoFix ObsoleteFiles after ethernet driver removal
zeising [Wed, 22 May 2019 16:59:22 +0000 (16:59 +0000)]
Fix ObsoleteFiles after ethernet driver removal

Fix OpsoleteFiles.inc after removal of ethernet drivers.  The drivers have
manual pages, and manual pages are generally stored compressed, with a .gz
suffix, but this is not reflected in ObsoleteFiles and make delete-old fails
to remove them.

Approved by: brooks
Sponsored by: B3 Init
Differential Revision: https://reviews.freebsd.org/D20351

5 years agoUpdate VFS_FHTOVP(9) with the flags argument
asomers [Wed, 22 May 2019 16:24:39 +0000 (16:24 +0000)]
Update VFS_FHTOVP(9) with the flags argument

Revison 222167 added a new argument to VFS_FHTOVP. This revision updates the
man page to match.

Reviewed by: rmacklem
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20323

5 years agoFix PPC64 kernel build with clang8 + lld8
luporl [Wed, 22 May 2019 15:56:41 +0000 (15:56 +0000)]
Fix PPC64 kernel build with clang8 + lld8

This patch fixes the following lld link errors:

- unsupported dynamic relocations on read-only sections
- out-of-range TOC references

Submitted by: git_bdragon.rtk0.net
Reviewed by: jhibbits, luporl
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19352

5 years agoSimplify math added in r310524.
mav [Wed, 22 May 2019 15:39:35 +0000 (15:39 +0000)]
Simplify math added in r310524.

Should be no functional change.

Reported by: danfe
MFC after: 1 week

5 years agoFix condition broken at r345815.
mav [Wed, 22 May 2019 15:25:10 +0000 (15:25 +0000)]
Fix condition broken at r345815.

Reported by: danfe
MFC after: 3 days

5 years agox86 MCA: introduce MCA hooks for different vendor implementations
gallatin [Wed, 22 May 2019 13:44:15 +0000 (13:44 +0000)]
x86 MCA: introduce MCA hooks for different vendor implementations

This is needed for AMD SMCA processors, as SMCA uses different
MSR address for access MCA banks.

Use IA32 specific msr_ops as defualt, and use SMCA-specific msr_ops
when on an SMCA-enabled processor

Submitted by: chandu from amd dot com
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D18055

5 years agoacpi_hpet: restore support for timers defined only in HPET table
avg [Wed, 22 May 2019 08:30:03 +0000 (08:30 +0000)]
acpi_hpet: restore support for timers defined only in HPET table

This fixes a regress introduced in r339754.
After that change the code required that there is a HPET device
in the ACPI namespace.
The problem has been noticed on an PC Engines apu2 system.

While here, fix a small formatting issue.

5 years agopkgbase: Really move login.access
manu [Wed, 22 May 2019 07:41:58 +0000 (07:41 +0000)]
pkgbase: Really move login.access

Messed up with git->svn r348102

5 years agopkgbase: Really move termcap.small
manu [Wed, 22 May 2019 07:41:20 +0000 (07:41 +0000)]
pkgbase: Really move termcap.small

Messed up with git->svn in r348101

5 years agopkgbase: Really move rc.sendmail
manu [Wed, 22 May 2019 07:40:39 +0000 (07:40 +0000)]
pkgbase: Really move rc.sendmail

Messed up with git->svn in r348100

5 years agopkgbase: Really move rc.bsdextended
manu [Wed, 22 May 2019 07:39:59 +0000 (07:39 +0000)]
pkgbase: Really move rc.bsdextended

Messed up with git->svn in r348099

5 years agopkgbase: Really move rc.firewall
manu [Wed, 22 May 2019 07:38:54 +0000 (07:38 +0000)]
pkgbase: Really move rc.firewall

Messed up with git->svn in r348098

5 years agopkgbase: Move login.access to usb.bin/login
manu [Wed, 22 May 2019 07:23:03 +0000 (07:23 +0000)]
pkgbase: Move login.access to usb.bin/login

Also remove the etc-examples target as we don't have any files
to handle here.

Reviewed by: bapt

5 years agopkgbase: Move termcap.small to share/termcap
manu [Wed, 22 May 2019 07:22:34 +0000 (07:22 +0000)]
pkgbase: Move termcap.small to share/termcap

Reviewed by: bapt

5 years agopkgbase: Move rc.sendmail to libexec/rc
manu [Wed, 22 May 2019 07:22:08 +0000 (07:22 +0000)]
pkgbase: Move rc.sendmail to libexec/rc

Reviewed by: bapt

5 years agopkgbase: Move rc.bsdextended to libexec/rc
manu [Wed, 22 May 2019 07:21:39 +0000 (07:21 +0000)]
pkgbase: Move rc.bsdextended to libexec/rc

Reviewed by: bapt

5 years agopkgbase: Move rc.firewall to libexec/rc
manu [Wed, 22 May 2019 07:21:05 +0000 (07:21 +0000)]
pkgbase: Move rc.firewall to libexec/rc

Put it with all the other rc files

Reviewed by: bapt

5 years agoMake aacraid(4) working on ASR8805 & ASR8402 in particular. This patch
sobomax [Wed, 22 May 2019 04:51:08 +0000 (04:51 +0000)]
Make aacraid(4) working on ASR8805 & ASR8402 in particular. This patch
has been in the PR system for 5 months and then on reviews for another 5.
Nobody came with any cases where it fails, while many people cried for
it to be commited & merged.

PR: 209468
Submitted by: Prasad B M <prasad.munirathnam@microsemi.com>
Reported by: Steven Peterson <scp@mainstream.net>
Approved by: scottl
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18408

5 years agoMarginally improve usage() message style in bootpd.
markj [Wed, 22 May 2019 04:13:57 +0000 (04:13 +0000)]
Marginally improve usage() message style in bootpd.

- Remove an extra space after "usage:".
- Avoid lines exceeding 80 columns.

Based on notes from rgrimes.

MFC with: r348066
Event: Waterloo Hackathon 2019

5 years agoUpdate the example added in r348082 to specify a dump device priority.
markj [Wed, 22 May 2019 03:52:39 +0000 (03:52 +0000)]
Update the example added in r348082 to specify a dump device priority.

Event: Waterloo Hackathon 2019

5 years agoProvide an example of using dhclient-script(5) to configure netdump.
markj [Wed, 22 May 2019 03:49:38 +0000 (03:49 +0000)]
Provide an example of using dhclient-script(5) to configure netdump.

Reviewed by: cem
MFC after: 1 week
Event: Waterloo Hackathon 2019
Differential Revision: https://reviews.freebsd.org/D20345

5 years agoHook up the existing i386 DTrace tests to the build.
markj [Wed, 22 May 2019 03:42:03 +0000 (03:42 +0000)]
Hook up the existing i386 DTrace tests to the build.

Now that it's relatively easy to do so, we might as well.

MFC after: 1 week
Event: Waterloo Hackathon 2019

5 years agoMake it possible to generate makefiles for arch-dependent DTrace tests.
markj [Wed, 22 May 2019 03:10:23 +0000 (03:10 +0000)]
Make it possible to generate makefiles for arch-dependent DTrace tests.

MFC after: 1 week
Event: Waterloo Hackathon 2019

5 years agopowerpc/booke: Use wrtee instead of msr to restore EE bit
jhibbits [Wed, 22 May 2019 02:43:17 +0000 (02:43 +0000)]
powerpc/booke: Use wrtee instead of msr to restore EE bit

The MSR[EE] bit does not require synchronization when changing.  This is a
trivial micro-optimization, removing the trailing isync from mtmsr().

MFC after: 1 week

5 years agopmc: Fix stack std::string lifetime
cem [Wed, 22 May 2019 01:22:33 +0000 (01:22 +0000)]
pmc: Fix stack std::string lifetime

It's invalid to reference a C++ string's c_str() buffer after the object
goes out of scope.  Adjust the scope of the string to match the use in
write(2) to fix the misuse.

CID: 1393383
Reported by: Coverity

5 years agoLink fhlinkat(2) man page
asomers [Wed, 22 May 2019 01:11:21 +0000 (01:11 +0000)]
Link fhlinkat(2) man page

Reviewed by: kib
MFC after: 3 days
MFC-With: r341689
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20339

5 years agoRevert r348070
cem [Wed, 22 May 2019 00:21:42 +0000 (00:21 +0000)]
Revert r348070

Konstantin points out that lockmgr probably requires the whole lock.h anyway.

Requested by: kib

5 years agoDo not call hw_mds_recalculate() from initializecpu().
kib [Tue, 21 May 2019 22:56:21 +0000 (22:56 +0000)]
Do not call hw_mds_recalculate() from initializecpu().

If MDS mitigation is enabled by the tunable but MDS microcode is not
early-loaded, software mitigation is selected.  This causes
initializecpu() to try to allocate memory which makes boot process
very unhappy.

Create SYSINIT that runs sufficiently late to succeed.

Reported by: naddy
PR: 237968
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoThis revision began as a simple change to eliminate an uninitialized warning
mckusick [Tue, 21 May 2019 22:24:38 +0000 (22:24 +0000)]
This revision began as a simple change to eliminate an uninitialized warning
found by Coverity. However, upon closer inspection the implementation of
fsck_ffs's fsck_readdir() and dircheck() functions is both nearly impossible
to follow and fails to check / fix directories in several cases. So, this
revision is an entire rewrite of these two functions to clarify what they
are doing and also to get something that works properly.

Referred by:  cem
Reviewed by:  kib, David G Lawrence
MFC after:    3 days
CID 1401317:  namlen may be used uninitialized

5 years agoAdd admonitions against using MD5 and SHA1 to the API man pages
allanjude [Tue, 21 May 2019 22:17:00 +0000 (22:17 +0000)]
Add admonitions against using MD5 and SHA1 to the API man pages