]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoCode for recording timestamps of events, especially function entries/exits.
cperciva [Sun, 31 Dec 2017 09:21:01 +0000 (09:21 +0000)]
Code for recording timestamps of events, especially function entries/exits.
This is a very primitive system, intended for use in measuring performance
during the early system boot, before more sophisticated tools like DTrace
or infrastructure like kernel memory allocation and mutexes are available.

Because this code records pointers to strings rather than copying strings
(in order to keep the memory usage more manageable), if a kernel module is
unloaded after logging an event, Bad Things can happen.  Users are advised
to not do that.

Since cycle counts from the early kernel boot are used as an initial entropy
source, publishing this information to userland could result in inadequate
entropy being kept private to the kernel RNG.  Users are advised to not
enable this on systems with untrusted users.

Discussed on: freebsd-current

6 years agos/=/+=
eadler [Sun, 31 Dec 2017 07:26:24 +0000 (07:26 +0000)]
s/=/+=

6 years agomtree: remove /etc/skel
eadler [Sun, 31 Dec 2017 07:25:55 +0000 (07:25 +0000)]
mtree: remove /etc/skel

We use /usr/share/skel instead of /etc/skel. The existence of /etc/skel
has confused people.

PR: 46062 (submitted 2002-12-07)
PR: 218897
Submitted by: carl@slackerbsd.org
Submitted by: asv@inhio.net

6 years agoskel: Quote PAGER in dot.shrc
eadler [Sun, 31 Dec 2017 06:58:58 +0000 (06:58 +0000)]
skel: Quote PAGER in dot.shrc

PR: 181853
Submitted by: pl@catslair.org
MFC After: 1 week

6 years agoaw_sid: rewrite compat-string configuration to be more flexible
kevans [Sun, 31 Dec 2017 06:44:15 +0000 (06:44 +0000)]
aw_sid: rewrite compat-string configuration to be more flexible

This will allow easiser support in the future for boards that have thermal
data and different offsets for root key/efuse data.

6 years agoUse data from the boot loader to pick the appropriate output graphics mode
nwhitehorn [Sun, 31 Dec 2017 06:10:07 +0000 (06:10 +0000)]
Use data from the boot loader to pick the appropriate output graphics mode
instead of hard-coding a default. This information is passed implicitly by
the PS3 firmware and can be relied upon. Also adjust the default mode, if
somehow firmware doesn't pass one, to 1920x1080 from 720x480 since it is
2017.

MFC after: 2 weeks

6 years agoMake sure the first instruction of the low-memory spinloop is in the
nwhitehorn [Sun, 31 Dec 2017 05:38:19 +0000 (05:38 +0000)]
Make sure the first instruction of the low-memory spinloop is in the
cacheline being invalidated.

MFC after: 1 month

6 years agostand/fdt: Make fdt_overlay_apply signature-compatible with libfdt
kevans [Sun, 31 Dec 2017 05:22:26 +0000 (05:22 +0000)]
stand/fdt: Make fdt_overlay_apply signature-compatible with libfdt

libfdt will assume a writable fdt overlay blob has been passed in, so make
ours compatible to allow easier review when we try to drop libfdt into
place. overlay from the calling context is writable, making it safe to
simply rip out everything related to copying the overlay blob in
fdt_overlay_apply.

I note here that we still have problems: fdt_overlay_apply, both our version
and libfdt's, may fail and have already clobbered the base fdt to some
extent. Future work will make sure we don't apply a potentially bogus fdt,
instead discarding the base fdt if we had an error.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D13695

6 years agoPreviously, swap_pager_copy() freed swap blocks one at at time, via
alc [Sun, 31 Dec 2017 04:01:47 +0000 (04:01 +0000)]
Previously, swap_pager_copy() freed swap blocks one at at time, via
swp_pager_meta_ctl(), with no opportunity to recognize freeing of
consecutive blocks and free fewer block ranges.  To open that opportunity,
this change removes the SWM_FREE option from swp_pager_meta_ctl(), and
compels the caller to do the freeing when a valid block address is returned.
In swap_pager_copy(), these frees are aggregated, so that a sequence of them
can be done at one time.

The only other caller to swp_pager_meta_ctl() that passed SWM_FREE,
swp_pager_unswapped(), is also modified to handle its single free
explicitly.

Submitted by: Doug Moore <dougm@rice.edu>
Reviewed by: kib (an earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D13290

6 years agosysv_{ipc|shm}: update the NetBSD VCS tags to match nearer our files.
pfg [Sun, 31 Dec 2017 03:34:00 +0000 (03:34 +0000)]
sysv_{ipc|shm}: update the NetBSD VCS tags to match nearer our files.

Both files originated in NetBSD:

sysv_ipc.c CVS 1.9:
Most of their changes don't apply to us as we already have similar
changes. This is a better reference for future merges.

sysv_shm.c CVS 1.39:
Most of their changes don't apply to our code but interestingly this
revision merged our changes and is a better point for reference.

Move the VCS tags to the position recommended in our committers guide
(section 8),

No functional change.

6 years agoTeach bsdinstall partedit/sade how to format FAT partitions on GPT, which
nwhitehorn [Sun, 31 Dec 2017 03:13:45 +0000 (03:13 +0000)]
Teach bsdinstall partedit/sade how to format FAT partitions on GPT, which
have the partition type code "ms-basic-data".

MFC after: 2 weeks

6 years agolocks: adjust loop limit check when waiting for readers
mjg [Sun, 31 Dec 2017 02:31:01 +0000 (02:31 +0000)]
locks: adjust loop limit check when waiting for readers

The check was for the exact value, but since the counter started being
incremented by the number of readers it could have jumped over.

6 years agosx: fix up non-smp compilation after r327397
mjg [Sun, 31 Dec 2017 01:59:56 +0000 (01:59 +0000)]
sx: fix up non-smp compilation after r327397

6 years agocacos(3): correct spelling of 'I'
eadler [Sun, 31 Dec 2017 00:55:00 +0000 (00:55 +0000)]
cacos(3): correct spelling of 'I'

In some cases we had 'i' instead of 'I'.

PR: 195517
Submitted by: stephen

6 years agolocks: re-check the reason to go to sleep after locking sleepq/turnstile
mjg [Sun, 31 Dec 2017 00:47:04 +0000 (00:47 +0000)]
locks: re-check the reason to go to sleep after locking sleepq/turnstile

In both rw and sx locks we always go to sleep if the lock owner is not
running.

We do spin for some time if the lock is read-locked.

However, if we decide to go to sleep due to the lock owner being off cpu
and after sleepq/turnstile gets acquired the lock is read-locked, we should
fallback to the aforementioned wait.

6 years agoisgreater(3): correct description of isunordered macro
eadler [Sun, 31 Dec 2017 00:46:41 +0000 (00:46 +0000)]
isgreater(3): correct description of isunordered macro

PR: 211376
Submitted by: Duane <parakleta@darkreality.org>
MFC After: 1 week

6 years agosx: read the SX_NOADAPTIVE flag and Giant ownership only once
mjg [Sun, 31 Dec 2017 00:37:50 +0000 (00:37 +0000)]
sx: read the SX_NOADAPTIVE flag and Giant ownership only once

These used to be read multiple times when waiting for the lock the become
free, which had the potential to issue completely avoidable traffic.

6 years agoman(1): document exit code
eadler [Sun, 31 Dec 2017 00:35:11 +0000 (00:35 +0000)]
man(1): document exit code

man(1) uses standard exit codes, document that.

PR: 223517
Reported by: wosch
MFC after: 1 week

6 years agomtx: deduplicate indefinite wait check in spinlocks and thread lock
mjg [Sun, 31 Dec 2017 00:34:29 +0000 (00:34 +0000)]
mtx: deduplicate indefinite wait check in spinlocks and thread lock

6 years agomtx: pre-read the lock value in thread_lock_flags_
mjg [Sun, 31 Dec 2017 00:33:28 +0000 (00:33 +0000)]
mtx: pre-read the lock value in thread_lock_flags_

Since this function is effectively slow path, if we get here the lock is most
likely already taken in which case it is cheaper to not blindly attempt the
atomic op.

While here move hwpmc probe out of the loop to match other primitives.

6 years agorwlock: tidy up __rw_runlock_hard similarly to r325921
mjg [Sun, 31 Dec 2017 00:31:14 +0000 (00:31 +0000)]
rwlock: tidy up __rw_runlock_hard similarly to r325921

6 years agodwmmc: Fully subclass driver
manu [Sat, 30 Dec 2017 22:01:17 +0000 (22:01 +0000)]
dwmmc: Fully subclass driver

Fully subclass the dwmmc driver and split every driver into multiple files.

There is still a few quirks in the dwmmc driver that will need some work.

Tested On: Pine64 Rock64

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

6 years agoAvoid use of the fdt_get_property_*() API, which is intrinsically
nwhitehorn [Sat, 30 Dec 2017 20:28:29 +0000 (20:28 +0000)]
Avoid use of the fdt_get_property_*() API, which is intrinsically
incompatible with FDT versions < 16. This also simplifies the code a bit.

MFC after: 1 month

6 years agoGarbage-collect loader.ps3. It is currently disconnected from the build and
nwhitehorn [Sat, 30 Dec 2017 20:27:13 +0000 (20:27 +0000)]
Garbage-collect loader.ps3. It is currently disconnected from the build and
is superseded by either direct loading of the kernel by petitboot (soon to
become the installer default) or loader.kboot.

6 years agoRemove logic for early console with loader.ps3 now that loader.ps3 is dead.
nwhitehorn [Sat, 30 Dec 2017 20:25:33 +0000 (20:25 +0000)]
Remove logic for early console with loader.ps3 now that loader.ps3 is dead.

6 years agoChange the way SMP startup works to match the new multi-AP features in
nwhitehorn [Sat, 30 Dec 2017 20:24:33 +0000 (20:24 +0000)]
Change the way SMP startup works to match the new multi-AP features in
locore64.S introduced in r327358.

MFC after: 3 weeks

6 years agoCheck more aggressively for whether the desired properties actually exist.
nwhitehorn [Sat, 30 Dec 2017 20:23:14 +0000 (20:23 +0000)]
Check more aggressively for whether the desired properties actually exist.
If they don't, the code would look up some random part of the device tree
and seize the console inappropriately.

MFC after: 2 weeks

6 years agoAdd macro for vxlan list mutex lock and unlock
bryanv [Sat, 30 Dec 2017 19:49:40 +0000 (19:49 +0000)]
Add macro for vxlan list mutex lock and unlock

This will simplify some later VNET support.

Submitted by: hrs
MFC after: 2 weeks

6 years agoAdvertise IFCAP_LINKSTAT after r326480 added link status support
bryanv [Sat, 30 Dec 2017 19:35:12 +0000 (19:35 +0000)]
Advertise IFCAP_LINKSTAT after r326480 added link status support

MFC after: 2 weeks

6 years agoFix r327383:
cy [Sat, 30 Dec 2017 19:27:22 +0000 (19:27 +0000)]
Fix r327383:

.../sys/dev/ep/elink.c:31:1: error: '/*' within block comment
[-Werror,-Wcomment]
/* $NetBSD: elink.c,v 1.6 1995/01/07 21:37:54 mycroft Exp $
^

6 years agoelink.[ch]: Move historic VCS tags after the license.
pfg [Sat, 30 Dec 2017 15:13:33 +0000 (15:13 +0000)]
elink.[ch]: Move historic VCS tags after the license.

This matches better our common practices and style.

6 years agoImprove usbconfig(8) manual page by adding descriptions for subcommands.
trasz [Sat, 30 Dec 2017 12:56:50 +0000 (12:56 +0000)]
Improve usbconfig(8) manual page by adding descriptions for subcommands.

Reviewed by: hselasky
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13445

6 years agoMove i386/isa/elink.[hc] to dev/ep.
kib [Sat, 30 Dec 2017 11:42:49 +0000 (11:42 +0000)]
Move i386/isa/elink.[hc] to dev/ep.

The ep(4) driver is the only consumer of the two functions from
elink.c.  I removed the standalone module as well, and most likely,
the module metadata is not needed anywhere, but this is for later
cleanup.

Discussed with: imp, jhb
Sponsored by: The FreeBSD Foundation

6 years agoMove i386/isa/npx.c to i386i386/npx.c.
kib [Sat, 30 Dec 2017 11:33:04 +0000 (11:33 +0000)]
Move i386/isa/npx.c to i386i386/npx.c.

The i386 FPU (AKA npx) code does not depend on ISA devices at all,
after the support for IRQ13 FPU exceptions was removed.  Put the file
into the expected place in the kernel source tree.

Discussed with: jhb
Sponsored by: The FreeBSD Foundation

6 years agoOn further testing on actual machines with this hardware, we should
imp [Sat, 30 Dec 2017 08:16:31 +0000 (08:16 +0000)]
On further testing on actual machines with this hardware, we should
only warn for devices that are attached. Add missing \n.

6 years agoRemove two stray references to wl driver, removed some time ago.
imp [Sat, 30 Dec 2017 07:59:32 +0000 (07:59 +0000)]
Remove two stray references to wl driver, removed some time ago.

6 years agolibsa: Pull in strnlen from libc
kevans [Sat, 30 Dec 2017 07:03:52 +0000 (07:03 +0000)]
libsa: Pull in strnlen from libc

strnlen is not used at the moment, but it will be when libfdt gets updated.
Prepare for the not-so-distant future by pulling in strnlen.

Noticed because: segfault in ld.bfd due to strnlen missing

6 years agostand/fdt: Swap libfdt include order
kevans [Sat, 30 Dec 2017 06:53:27 +0000 (06:53 +0000)]
stand/fdt: Swap libfdt include order

libfdt.h should be included before fdt.h, as hinted at by all of libfdt/;
standard include order being libfdt.h, libfdt_env.h, fdt.h.

The current include order also causes problems when libfdt gets updated, as
fdt.h requires some definitions from libfdt.h.

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

6 years agoAdd support for IPv6 scoped addresses to vxlan
bryanv [Sat, 30 Dec 2017 04:03:53 +0000 (04:03 +0000)]
Add support for IPv6 scoped addresses to vxlan

MFC after: 2 weeks

6 years agoRemove a redunant check.
jhb [Sat, 30 Dec 2017 03:08:49 +0000 (03:08 +0000)]
Remove a redunant check.

6 years agogeom_ccd.c: Fix the licenses properly
pfg [Sat, 30 Dec 2017 02:07:18 +0000 (02:07 +0000)]
geom_ccd.c: Fix the licenses properly

The license merging in r109471 didn't take into account that licensing
could change. Just removing the 3rd clause obviates the copyright
assignment to the NetBSD Foundation.

We do have plenty of files that have two or more licensing as in this
case, so fix this properly by splitting back the licenses as they are
upstream.

Obtained from: NetBSD

6 years agogeom_ccd.c: Update the license with changes from upstream.
pfg [Sat, 30 Dec 2017 01:37:08 +0000 (01:37 +0000)]
geom_ccd.c: Update the license with changes from upstream.

Part of this file originated in NetBSD, with the original file
carrying two versions of 4-clause BSD licenses. r109471 attempted to
simplify the situation by putting both licenses together.

Meanwhile, NetBSD dropped Clauses 3 and 4 from their own license, and
eventually NetBSD got permission from the University of Utah to drop the
3rd clause.

Keep the license "simple" by dropping the third clause since both TNF,
Utah/Berkeley and phk agree in principle that it can be dropped.

Obtained from: NetBSD (ccd.c CVS 1.128, 1.138)

6 years agonet80211: sanitize input for ieee80211_output()
avos [Sat, 30 Dec 2017 00:40:34 +0000 (00:40 +0000)]
net80211: sanitize input for ieee80211_output()

- Add some basic checks for i_fc* bits (ToDS, FromDS, MoreFrag, Protected);
those are used / checked across various places in Tx path.
- Mark injected 802.11 frame as encapsulated (just as it should be).
- Classify 802.11 frame in a proper way (extract ether_type from LLC header
for Data frames, use AC_BE queue for others (NoData / Management / Control).
- Subtract header length from tx_bytes statistics (so it will correspond
to the comment).

Was checked with RTL8188EU (AP) + Intel 6205 (STA).

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D13161

6 years agoccdconfig: Move VCS tags to be more consistent with our style.
pfg [Sat, 30 Dec 2017 00:26:42 +0000 (00:26 +0000)]
ccdconfig: Move VCS tags to be more consistent with our style.

Update a now-bogus SPDX tag while here.

6 years agonet80211: handle VHT nodes in ieee80211_node_setuptxparms()
avos [Sat, 30 Dec 2017 00:24:53 +0000 (00:24 +0000)]
net80211: handle VHT nodes in ieee80211_node_setuptxparms()

Select proper mode when node can do VHT.

Currently there are no drivers with VHT support in the tree,
so this should be noop.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D9806

6 years agoccdconfig: Update licensing terms to match NetBSD.
pfg [Sat, 30 Dec 2017 00:22:47 +0000 (00:22 +0000)]
ccdconfig: Update licensing terms to match NetBSD.

The code originated in NetBSD which has since removed Clauses 3 and 4.

Approved by: phk (concerning his own copyright)
Obtained from: NetBSD (CVS ccdconfig.c 1.47, ccdconfig.8 1.24)

6 years agoMake kernel option KERNVIRTADDR optional, remove it from std.<platform>
ian [Sat, 30 Dec 2017 00:20:49 +0000 (00:20 +0000)]
Make kernel option KERNVIRTADDR optional, remove it from std.<platform>
files that can use the default value.

It used to be required that the low-order bits of KERNVIRTADDR matched
the low-order bits of the physical load address for all arm platforms.
That hasn't been a requirement for armv6 platforms since FreeBSD 10.
There is no longer any relationship between load addr and KERNVIRTADDR
except that both must be aligned to a 2 MiB boundary.

This change makes the default KERNVIRTADDR value 0xc0000000, and removes the
options from all the platforms that can use the default value.  The default
is now defined in vmparam.h, and that file is now included in a few new
places that reference KERNVIRTADDR, since it may not come in via the
forced-include of opt_global.h on the compile command line.

6 years agoexamples: fix typo
eadler [Fri, 29 Dec 2017 23:58:05 +0000 (23:58 +0000)]
examples: fix typo

6 years agoRemove a reference to burncd
eadler [Fri, 29 Dec 2017 23:56:06 +0000 (23:56 +0000)]
Remove a reference to burncd

I'm unclear of the purpose of this pseudo-target
but while its here keep it up to date

6 years agoAdd AHCI/XHCI device IDs found on AMD 1950X+X399 system
cem [Fri, 29 Dec 2017 22:24:41 +0000 (22:24 +0000)]
Add AHCI/XHCI device IDs found on AMD 1950X+X399 system

A follow-up to r327094.

Sponsored by: Dell EMC Isilon

6 years agofind(1): Fix -newer and -samefile to conform to POSIX[0]
cem [Fri, 29 Dec 2017 22:08:43 +0000 (22:08 +0000)]
find(1): Fix -newer and -samefile to conform to POSIX[0]

By default, or with the -P flag, find(1) should evaluate paths "physically."
For symlinks, this means using the link itself instead of the target.

Historically (since the import of BSD 4.4-lite from CSRG), find(1) has
failed to refer to the link itself, at least for -newer and -samefile.

[0]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html

PR: 222698
Reported by: Harald Schmalzbauer <bugzilla.freebsd AT omnilan.de>
Sponsored by: Dell EMC Isilon

6 years agoSort by time.
maxim [Fri, 29 Dec 2017 21:37:36 +0000 (21:37 +0000)]
Sort by time.

6 years agoEnhance the CHRP/pSeries platform layer:
nwhitehorn [Fri, 29 Dec 2017 21:09:17 +0000 (21:09 +0000)]
Enhance the CHRP/pSeries platform layer:
- Densely number CPUs to avoid systems with CPUs with very high ID numbers
- Always have the BSP be CPU 0 to avoid remnant brokenness with non-0 BSPs
  in other parts of the kernel.
- Improve parsing of the device tree CPU listings on SMT systems.
- Allow reboot via RTAS as well as OF for pSeries systems booted by FDT
  without functioning Open Firmware.

Obtained from: projects/powernv
MFC after: 3 weeks

6 years agoDo not lock vm map in swapout_procs().
kib [Fri, 29 Dec 2017 20:33:56 +0000 (20:33 +0000)]
Do not lock vm map in swapout_procs().

Neither swapout_procs() nor swapout() access the map.  Since the
process' vmspace is referenced only to obtain the pointer to the
vm_map, the reference is not needed as well.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D13681

6 years agoAdd support for 64-bit PowerPC kernels to be directly loaded by kexec, which
nwhitehorn [Fri, 29 Dec 2017 20:30:10 +0000 (20:30 +0000)]
Add support for 64-bit PowerPC kernels to be directly loaded by kexec, which
is used as the bootloader on a number of PPC64 platforms. This involves the
following pieces:
- Making the first instruction a valid kernel entry point, since kexec
  ignores the ELF entry value. This requires a separate section and linker
  magic to prevent the linker from filling the beginning of the section
  with stubs.
- Adding an entry point at 0x60 past the first instruction for systems
  lacking firmware CPU shutdown support (notably PS3).
- Linker script changes to support the above.

MFC after: 1 month

6 years agoMaintain alignment of in-code 64-bit quantities by design rather than luck.
nwhitehorn [Fri, 29 Dec 2017 20:25:15 +0000 (20:25 +0000)]
Maintain alignment of in-code 64-bit quantities by design rather than luck.
If these are not aligned, the linker has to emit a different type of
relocation that the early boot self-relocation code cannot handle, even
in principle, resulting in them being set to zero and the kernel crashing.

MFC after: 1 week

6 years agoCorrect a mistake and reword a couple sentences to clarify that "the value"
ian [Fri, 29 Dec 2017 20:00:19 +0000 (20:00 +0000)]
Correct a mistake and reword a couple sentences to clarify that "the value"
refers to the scale value, not the kmem_arena size that results from scaling.

Suggested by: alc@

6 years ago- Don't allow userland to switch partitions; it's next to impossible
marius [Fri, 29 Dec 2017 19:07:50 +0000 (19:07 +0000)]
- Don't allow userland to switch partitions; it's next to impossible
  to recover from that, especially when something goes wrong.
- When userland changes EXT_CSD, update the kernel copy before using
  relevant EXT_CSD bits in mmcsd_switch_part().

6 years agoStyle.
kib [Fri, 29 Dec 2017 19:05:07 +0000 (19:05 +0000)]
Style.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D13678

6 years agogeli: fix the resize test on arm64
asomers [Fri, 29 Dec 2017 18:42:55 +0000 (18:42 +0000)]
geli: fix the resize test on arm64

The resize test used bsdlabel(8), which is not available on all
architectures.  Change it to use gpart(8) instead, which should be available
everywhere.

PR: 221763
Reported by: andrew
MFC after: 2 weeks

6 years agoFix a harmless typo from r310786
asomers [Fri, 29 Dec 2017 18:09:06 +0000 (18:09 +0000)]
Fix a harmless typo from r310786

I copy/pasted a reference to an undefined shell variable.

MFC after: 2 weeks

6 years agoFix ubldr. uboot/lib uses defines for the loader. It's part of the
imp [Fri, 29 Dec 2017 18:08:35 +0000 (18:08 +0000)]
Fix ubldr. uboot/lib uses defines for the loader. It's part of the
loader, but not compile as loader (it's building a library), so we
can't just include loader.mk for the defines. Move LOADER_DISK_SUPPORT
back to defs.mk for the moment.

Sponsored by: Netflix

6 years agostand/fdt: Consistently apply fdt_overlays
kevans [Fri, 29 Dec 2017 18:08:30 +0000 (18:08 +0000)]
stand/fdt: Consistently apply fdt_overlays

Overlays were previously not applied when U-Boot provides FDT or EFI
provides FDT, only when we load FDT from /boot/dtb given name from U-Boot.

Make all three paths lead to loading fdt_overlays and applying them, so that
fdt_overlays can be expected to Just Work.

Reviewed by: gonzo, imp, manu
Differential Revision: https://reviews.freebsd.org/D13664

6 years agoAfter r327168, the variable "vm_pageout_wanted" can be static.
alc [Fri, 29 Dec 2017 17:02:22 +0000 (17:02 +0000)]
After r327168, the variable "vm_pageout_wanted" can be static.

MFC after: 2 weeks

6 years agogeli: factor out some common code in the geli tests
asomers [Fri, 29 Dec 2017 16:13:06 +0000 (16:13 +0000)]
geli: factor out some common code in the geli tests

No functional change.

MFC after: 2 weeks
Sponsored by: Spectra Logic Corp

6 years agoFix potential TOCTTOU bug in the geli tests
asomers [Fri, 29 Dec 2017 16:06:10 +0000 (16:06 +0000)]
Fix potential TOCTTOU bug in the geli tests

This change mostly reverts r293436, which introduced the bug due to a belief
that geli(8) would allocate md(4) devices by itself. However, that belief is
incorrect. Instead of using linear probing to find available md(4) numbers,
it's best to use the existing attach_md function.

Reviewed by: ngie
MFC after: 2 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13666

6 years agoAdd a crude workaround for ports with flavors
phk [Fri, 29 Dec 2017 15:38:43 +0000 (15:38 +0000)]
Add a crude workaround for ports with flavors

6 years agolocale: add cnr (Montenegrin)
eadler [Fri, 29 Dec 2017 15:04:49 +0000 (15:04 +0000)]
locale: add cnr (Montenegrin)

See https://www.loc.gov/standards/iso639-2/php/code_changes.php

6 years agolibc/locale: fix an off-by-one in newlocale
eadler [Fri, 29 Dec 2017 14:56:46 +0000 (14:56 +0000)]
libc/locale: fix an off-by-one in newlocale

Reported by: zrj@DragonFlyBSD.org

6 years agobsd-family-tree: add NetBSD 7.1.1; correct NetBSD abbrev
eadler [Fri, 29 Dec 2017 14:31:43 +0000 (14:31 +0000)]
bsd-family-tree: add NetBSD 7.1.1; correct NetBSD abbrev

Reported by: Herbert J. Skuhra <herbert@gojira.at>
Reported by: N.J. Mann <njm@njm.me.uk>

6 years ago- There is no need to keep the tuning error and re-tuning interrupts
marius [Fri, 29 Dec 2017 12:48:19 +0000 (12:48 +0000)]
- There is no need to keep the tuning error and re-tuning interrupts
  enabled (though, no interrupt generation enabled for them) all the
  time as soon as (re-)tuning is supported; only enable them and let
  them generate interrupts when actually using (re-)tuning.
- Also disable all interrupts except SDHCI_INT_DATA_AVAIL ones while
  executing tuning and not just their signaling.

6 years agoCorrect the comment describing badrs which is bad router solicitiation,
cy [Fri, 29 Dec 2017 07:23:18 +0000 (07:23 +0000)]
Correct the comment describing badrs which is bad router solicitiation,
not bad router advertisement.

MFC after: 3 days

6 years agoThe fix in r327273 turns a memory leak into freeing wild pointer.
delphij [Fri, 29 Dec 2017 06:22:05 +0000 (06:22 +0000)]
The fix in r327273 turns a memory leak into freeing wild pointer.
Fix this by freeing only the initialized pointer.

6 years agobsd-family-tree: add NetBSD 6.0.6
eadler [Fri, 29 Dec 2017 05:01:07 +0000 (05:01 +0000)]
bsd-family-tree: add NetBSD 6.0.6

This was a missing release. Released on the same day as 6.1.5 per
https://blog.netbsd.org/tnf/entry/netbsd_6_1_5_and

6 years agobsd-family-tree: add HardenedBSD
eadler [Fri, 29 Dec 2017 04:49:59 +0000 (04:49 +0000)]
bsd-family-tree: add HardenedBSD

This adds HardenedBSD which is a pseudo-fork of FreeBSD. It hasn't had a
release yet, but does does have active users and a community. As such
document it as a branch off of FreeBSD-stable. Ideally this adds enough
space so that future releases are easy enough to add.

6 years agocxgbe(4): Reduce duplication by consolidating minor variations of the
np [Fri, 29 Dec 2017 02:30:21 +0000 (02:30 +0000)]
cxgbe(4): Reduce duplication by consolidating minor variations of the
same code into a single routine.

Sponsored by: Chelsio Communications

6 years agoif_txpreg.h: drop clauses 3 and 4.
pfg [Fri, 29 Dec 2017 00:59:56 +0000 (00:59 +0000)]
if_txpreg.h: drop clauses 3 and 4.

Obtained from: OpenBSD (CVS 1.35)

6 years agodev/txp: Update if_txpreg.h to match OpenBSD's version.
pfg [Fri, 29 Dec 2017 00:27:12 +0000 (00:27 +0000)]
dev/txp: Update if_txpreg.h to match OpenBSD's version.

Resolve a minor mismatch: TXP_CMD_READ_VERSION instead of
TXP_CMD_VERSIONS_READ.
Curiously the later is defined but not used in OpenBSD.

Obtained from: OpenBSD (CVS 1.31-1.34)
MFC after: 1 week

6 years agoClean up the comment.
kib [Thu, 28 Dec 2017 23:50:21 +0000 (23:50 +0000)]
Clean up the comment.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D13671

6 years agoRemove ELF note for Open Firmware. It is marked optional in a single 1996
nwhitehorn [Thu, 28 Dec 2017 23:49:53 +0000 (23:49 +0000)]
Remove ELF note for Open Firmware. It is marked optional in a single 1996
draft of a never-finalized standard (CHRP) and is irrelevant in practice
on FreeBSD since we load the kernel with loader(8) on Open Firmware
platforms anyway. Moreover, loader(8), which is directly loaded by Open
Firmware, has never had an equivalent note.

MFC after: 2 weeks

6 years agohumanize_number(3): fix math edge case in rounding large numbers
robak [Thu, 28 Dec 2017 22:57:34 +0000 (22:57 +0000)]
humanize_number(3): fix math edge case in rounding large numbers

Fix for remainder overflow, when in rare cases adding remainder to divider
exceeded 1 and turned the total to 1000 in final formatting, taking up
the space for the unit character.

The fix continues the division of the original number if the above case
happens -- added the appropriate check to the for loop performing
the division. This lowers the value shown, to make it fit into the buffer
space provided (1.0M for 4+1 character buffer, as used by ls).

Add test case for the reported bug and extend test program to support
providing buffer length (ls -lh uses 5, tests hard-coded 4).

PR: 224498
Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Reported by: Masachika Ishizuka <ish@amail.plala.or.jp>
Reviewed by: cem, kib
Approved by: cem, kib
MFC after: 1 week
Sponsored by: Mysterious Code Ltd.
Differential Revision: D13578

6 years agoIn vm_swapout_map_deactivate_pages(), it is enough to lock the map for read.
kib [Thu, 28 Dec 2017 22:56:30 +0000 (22:56 +0000)]
In vm_swapout_map_deactivate_pages(), it is enough to lock the map for read.

Reviewed by: alc, markj (as part of the larger patch)
Tested by: pho (again, as part of the larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D13671

6 years agoProbe Intel Denverton eMMC 5.0 controllers.
marius [Thu, 28 Dec 2017 22:03:08 +0000 (22:03 +0000)]
Probe Intel Denverton eMMC 5.0 controllers.

6 years agoWith the advent of interrupt remapping, Intel has repurposed bit 11
marius [Thu, 28 Dec 2017 21:46:09 +0000 (21:46 +0000)]
With the advent of interrupt remapping, Intel has repurposed bit 11
(now: Interrupt_Index[15]) and assigned the previously reserved bits
55:48 (Interrupt_Index[14:0] goes into 63:49 while Destination Field
used 63:56 and bit 48 now is Interrupt_Format) in the IO redirection
tables (see the VT-d specification, "5.1.5.1 I/OxAPIC Programming").
Thus, when not using interrupt remapping, ensure that all previously
reserved bits in the high part of the RTEs are zero instead of doing
a read-modify-write for their Destination Field bits only.
Otherwise, on machines based on Apollo Lake and its derivatives such
as Denverton, typically some of the previously preserved bits remain
set after boot when not employing interrupt remapping. The result is
that INTx interrupts are not getting delivered.
Note: With an AMD IOMMU, interrupt remapping apparently bypasses the
IO APIC altogether.

Submitted by: loos (modulo comment)
Reviewed by: jhb (modulo comment)

6 years agoRemove a few more dangling references to ie(4).
jhb [Thu, 28 Dec 2017 21:35:53 +0000 (21:35 +0000)]
Remove a few more dangling references to ie(4).

6 years agoe1000: Add support for Ice Lake and Cannon Lake
sbruno [Thu, 28 Dec 2017 21:26:40 +0000 (21:26 +0000)]
e1000: Add support for Ice Lake and Cannon Lake

Ths add initial support for Ice Lake and Cannon Lake ethernet devices.

This also addressed errata 1.5.4.4 for Sky Lake and Kabby Lake devices:
https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/i218-i219-ethernet-connection-spec-update.pdf?asset=9561

Submitted by: Kevin Bowling <kevin.bowling@kev009.com>
Relnotes: Yes
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D13660

6 years agostand/fdt: Avoid bailout when dtbo has no fixups
kevans [Thu, 28 Dec 2017 21:12:27 +0000 (21:12 +0000)]
stand/fdt: Avoid bailout when dtbo has no fixups

In the case of a simple dtbo where fragment uses target-path and the overlay
contains no references, /__fixups__ will not be included by either our dtc
or dtc from ports, but the file still has valid fragments to be applied.

Additional testing found that /__symbols__ might also be omitted if it's
empty, which is not necessarily an error.

Reviewed by: gonzo, imp
Differential Revision: https://reviews.freebsd.org/D13663

6 years agostand/fdt: Fix loading of multiple fdt_overlays
kevans [Thu, 28 Dec 2017 21:09:36 +0000 (21:09 +0000)]
stand/fdt: Fix loading of multiple fdt_overlays

fdt_load_dtb_overlays was written to unload previous overlay when a new
valid one is come across. fdt_apply_overlays further down is written to
iterate over all .dtbo's currently loaded and apply them one-by-one. Correct
fdt_load_dtb_overlays to stop dropping valid overlays that were previously
loaded and match expectations.

Reviewed by: gonzo, imp
Differential Revision: https://reviews.freebsd.org/D13659

6 years agoFix some typos.
pfg [Thu, 28 Dec 2017 20:40:56 +0000 (20:40 +0000)]
Fix some typos.

Obtained from: OpenBSD (CVS v1.5)

6 years agonetinet6/ip6_id.c: niels kindly dropped clause 3/4 from the license.
pfg [Thu, 28 Dec 2017 20:35:21 +0000 (20:35 +0000)]
netinet6/ip6_id.c: niels kindly dropped clause 3/4 from the license.

This bring back r327293 from OpenBSD, with the important difference that
we are now getting it from their ip6_id.c file.

Obtained from: OpenBSD (CVS v1.3)

6 years agoStart syncing changes from OpenBSD's ip6_id.c instead of ip_id.c.
pfg [Thu, 28 Dec 2017 20:26:51 +0000 (20:26 +0000)]
Start syncing changes from OpenBSD's ip6_id.c instead of ip_id.c.

correct non-repetitive ID code, based on comments from niels provos.
- seed2 is necessary, but use it as "seed2 + x" not "seed2 ^ x".
- skipping number is not needed, so disable it for 16bit generator (makes
  the repetition period to 30000)

Obtained from: OpenBSD (CVS rev. 1.2)
MFC after: 1 week

6 years agoRevert r327293
pfg [Thu, 28 Dec 2017 20:10:10 +0000 (20:10 +0000)]
Revert r327293
netinet6/ip6_id.c: niels kindly dropped clause 3/4 from the license.

I was looking at the wrong file. There is an important merge that must be
done before I can bring this change.

6 years agonetinet6/ip6_id.c: niels kindly dropped clause 3/4 from the license.
pfg [Thu, 28 Dec 2017 19:42:53 +0000 (19:42 +0000)]
netinet6/ip6_id.c: niels kindly dropped clause 3/4 from the license.

This file is supposed to be based on the OpenBSD CVS v1.6 but checking
the OpenBSD repository the license had already dropped the 2&3 clasues by
then. Catch up with the licensing.

Obtained from: OpenBSD (CVS 1.2)

6 years agoMinor formatting and style tweaks to some comments.
jhb [Thu, 28 Dec 2017 18:51:35 +0000 (18:51 +0000)]
Minor formatting and style tweaks to some comments.

6 years agoRemove a stale reference to ie(4).
jhb [Thu, 28 Dec 2017 17:55:58 +0000 (17:55 +0000)]
Remove a stale reference to ie(4).

This was missed in r304513.

Submitted by: kib

6 years agorpc.sprayd: Remove 3rd and 4th clauses in christos' license.
pfg [Thu, 28 Dec 2017 17:51:53 +0000 (17:51 +0000)]
rpc.sprayd: Remove 3rd and 4th clauses in christos' license.

Obtained from: NetBSD

6 years agorpc.sprayd: Bring some changes from NetBSD.
pfg [Thu, 28 Dec 2017 17:44:30 +0000 (17:44 +0000)]
rpc.sprayd: Bring some changes from NetBSD.

Most notable, other than some style issues:
CVS 1.11:
  do not use LOG_CONS.
CVS 1.13:
  consistently use exit instead of return in main().
  use LOG_WARNING instead of LOG_ERR for non critical errors.

Obtained from: NetBSD
MFC after: 2 weeks

6 years agosys/sys/chio.h: add NetBSD RCS ID.
pfg [Thu, 28 Dec 2017 14:26:33 +0000 (14:26 +0000)]
sys/sys/chio.h: add NetBSD RCS ID.

Make it easier to identify the point where we started diverging from
NetBSD. Newer versions of this file has been updated to a new license so
this information may become useful some day.

Obtained from: NetBSD

6 years agosys/i386/isa/elink*: sync with (older) NetBSD.
pfg [Thu, 28 Dec 2017 14:14:35 +0000 (14:14 +0000)]
sys/i386/isa/elink*: sync with (older) NetBSD.

Make it easier to identify the point where we started diverging from
NetBSD. Newer versions of these files have been updated to a new license
so this information may become useful some day.

Obtained from: NetBSD

6 years agoReuse kern_proc_vmmap_resident() for procfs_map resident count.
kib [Thu, 28 Dec 2017 13:23:13 +0000 (13:23 +0000)]
Reuse kern_proc_vmmap_resident() for procfs_map resident count.

The existing algorithm in procfs_map() to calculate count of resident
pages in an entry is too primitive, resulting in too long run time for
large sparse mapping entries.  Re-use the kern_proc_vmmap_resident()
from kern_proc.c which only looks at the existing pages in the
iterations.

Also, this makes procfs to honor kern.proc_vmmap_skip_resident_count,
if user does not need this information.

Reported by: Glenn Weinberg <glenn.weinberg@intel.com>
PR: 224532
No objections from: des (procfs maintainer)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D13595