]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoConsolidate identical ELF auxargs type defintions.
brooks [Mon, 22 Oct 2018 22:24:32 +0000 (22:24 +0000)]
Consolidate identical ELF auxargs type defintions.

All platforms except powerpc use the same values and powerpc shares a
majority of them.

Go ahead and declare AT_NOTELF, AT_UID, and AT_EUID in favor of the
unused AT_DCACHEBSIZE, AT_ICACHEBSIZE, and AT_UCACHEBSIZE for powerpc.

Reviewed by: jhb, imp
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17397

5 years agoRemove the need for backslashes in syscalls.master.
brooks [Mon, 22 Oct 2018 22:13:00 +0000 (22:13 +0000)]
Remove the need for backslashes in syscalls.master.

Join non-special lines together until we hit a line containing a '}'
character. This allows the function declaration body to be split
across multiple lines without backslash continuation characters.

Continue to join lines ending with backslashes to allow gradual
migration and to support out-of-tree syscall vectors

Reviewed by: emaste, kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17488

5 years agoRegen after r339622.
brooks [Mon, 22 Oct 2018 21:51:59 +0000 (21:51 +0000)]
Regen after r339622.

Note: changes to freebsd32 syscalls.master impacted no generated files.

5 years agoRemove __restrict qualifiers from syscalls.master.
brooks [Mon, 22 Oct 2018 21:50:43 +0000 (21:50 +0000)]
Remove __restrict qualifiers from syscalls.master.

The restruct qualifier is intended to aid code generation in the
compiler, but the only access to storage through these pointers is via
structs using copyin/copyout and the like which can not be written in C
or C++ and thus the compiler gains nothing from the qualifiers.

As such, the qualifiers add no value in current usage.

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17574

5 years agoAdd a "live" mode to ktrdump.
jhb [Mon, 22 Oct 2018 21:25:28 +0000 (21:25 +0000)]
Add a "live" mode to ktrdump.

Support a "live" mode in ktrdump enabled via the -l flag.  In this
mode, ktrdump polls the kernel's trace buffer periodically (currently
hardcoded as a 50 millisecond interval) and dumps any newly added
entries.  Fancier logic for the timeout (e.g. a command line option or
some kind of backoff based on the time since the last entry) can be
added later as the need arises.

While here, fix some bugs from when this was Capsicum-ized:
- Use caph_limit_stream() for the output stream so that isatty() works
  and the output can be line-buffered (especially useful for live
  mode).
- Use caph_limit_stderr() to permit error messages to be displayed if
  an error occurs after cap_enter().

Reviewed by: kib, 0mp (manpage)
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D17315

5 years agoA couple of style fixes in recent TCP changes.
jhb [Mon, 22 Oct 2018 21:17:36 +0000 (21:17 +0000)]
A couple of style fixes in recent TCP changes.

- Add a blank line before a block comment to match other block comments
  in the same function.
- Sort the prototype for sbsndptr_adv and fix whitespace between return
  type and function name.

Reviewed by: gallatin, bz
Differential Revision: https://reviews.freebsd.org/D17474

5 years agoDefine linuxkpi readq for 64-bit architectures. It is used by drm-kmod.
tijl [Mon, 22 Oct 2018 20:55:35 +0000 (20:55 +0000)]
Define linuxkpi readq for 64-bit architectures.  It is used by drm-kmod.
Currently the compiler picks up the definition in machine/cpufunc.h.

Add compiler memory barriers to read* and write*.  The Linux x86
implementation of these functions uses inline asm with "memory" clobber.
The Linux x86 implementation of read_relaxed* and write_relaxed* uses the
same inline asm without "memory" clobber.

Implement ioread* and iowrite* in terms of read* and write* so they also
have memory barriers.

Qualify the addr parameter in write* as volatile.

Like Linux, define macros with the same name as the inline functions.

Only define 64-bit versions on 64-bit architectures because generally
32-bit architectures can't do atomic 64-bit loads and stores.

Regroup the functions a bit and add brief comments explaining what they do:
- __raw_read*, __raw_write*: atomic, no barriers, no byte swapping
- read_relaxed*, write_relaxed*: atomic, no barriers, little-endian
- read*, write*: atomic, with barriers, little-endian

Add a comment that says our implementation of ioread* and iowrite*
only handles MMIO and does not support port IO.

Reviewed by: hselasky
MFC after: 3 days

5 years agoMake it possible to disable NUMA support with a tunable.
markj [Mon, 22 Oct 2018 20:13:51 +0000 (20:13 +0000)]
Make it possible to disable NUMA support with a tunable.

This provides a chicken switch for anyone negatively impacted by
enabling NUMA in the amd64 GENERIC kernel configuration.  With
NUMA disabled at boot-time, information about the NUMA topology
is not exposed to the rest of the kernel, and all of physical
memory is viewed as coming from a single domain.

This method still has some performance overhead relative to disabling
NUMA support at compile time.

PR: 231460
Reviewed by: alc, gallatin, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17439

5 years agorelease: set -e to exit on error in iso image scripts
emaste [Mon, 22 Oct 2018 19:39:20 +0000 (19:39 +0000)]
release: set -e to exit on error in iso image scripts

Reviewed by: gjb
Differential Revision: https://reviews.freebsd.org/D17651

5 years agoarch.7: first appeared in FreeBSD 11.1
emaste [Mon, 22 Oct 2018 18:41:22 +0000 (18:41 +0000)]
arch.7: first appeared in FreeBSD 11.1

5 years agoMakefile.inc1: clean up stale dependency hacks
emaste [Mon, 22 Oct 2018 18:40:21 +0000 (18:40 +0000)]
Makefile.inc1: clean up stale dependency hacks

Our dependency tracking cannot directly cope with certain source tree
changes, particularly with respect to removing or moving source files or
replacing generated files.  We have a collection of ad-hoc workarounds
to handle these cases.  As there is a (small) build-time cost inherent
in these workarounds, we do not want to keep them indefinitely.  Thus,
remove workarounds from 2017.

Sponsored by: The FreeBSD Foundation

5 years agoUpdate to Zstandard 1.3.7
cem [Mon, 22 Oct 2018 18:29:12 +0000 (18:29 +0000)]
Update to Zstandard 1.3.7

Relnotes: yes
Sponsored by: Dell EMC Isilon

5 years agoConditionalize kern.tty_info_kstacks feature on STACKS option
cem [Mon, 22 Oct 2018 17:42:57 +0000 (17:42 +0000)]
Conditionalize kern.tty_info_kstacks feature on STACKS option

Fix tinderbox (mips XLPN32) after r339471.

Reported by: tinderbox
X-MFC-With: r339471
Sponsored by: Dell EMC Isilon

5 years agoFix the build after r339601.
markj [Mon, 22 Oct 2018 17:19:48 +0000 (17:19 +0000)]
Fix the build after r339601.

I committed some patches out of order and didn't build-test one of them.

Reported by: Jenkins, O. Hartmann <ohartmann@walstatt.org>
X-MFC with: r339601

5 years agoAvoid a redundancy in a comment updated by r339601.
markj [Mon, 22 Oct 2018 17:17:30 +0000 (17:17 +0000)]
Avoid a redundancy in a comment updated by r339601.

Reported by: alc
X-MFC with: r339601

5 years agoSwap in processes unless there's a global memory shortage.
markj [Mon, 22 Oct 2018 17:04:04 +0000 (17:04 +0000)]
Swap in processes unless there's a global memory shortage.

On NUMA systems, we would not swap in processes unless all domains
had some free pages.  This is too conservative in general.  Instead,
permit swapins so long as at least one domain has free pages, and add
a kernel stack NUMA policy which ensures that we will try to allocate
kernel stack pages from any domain.

Reported and tested by: pho, Jan Bramkamp <crest@bultmann.eu>
Reviewed by: alc, kib
Discussed with: jeff
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17304

5 years agoMake sure returned value is checked and assert a valid refcount.
hselasky [Mon, 22 Oct 2018 16:21:50 +0000 (16:21 +0000)]
Make sure returned value is checked and assert a valid refcount.
While at it fix a print: Unsigned types cannot be negative.

Reviewed by: kib, mjg
Differential revision: https://reviews.freebsd.org/D17616
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoDon't import 0 into vmem quantum caches.
markj [Mon, 22 Oct 2018 16:16:42 +0000 (16:16 +0000)]
Don't import 0 into vmem quantum caches.

vmem uses UMA cache zones to implement the quantum cache.  Since
uma_zalloc() returns 0 (NULL) to signal an allocation failure, UMA
should not be used to cache resource 0.  Fix this by ensuring that 0 is
never cached in UMA in the first place, and by modifying vmem_alloc()
to fall back to a search of the free lists if the cache is depleted,
rather than blocking in qc_import().

Reported by and discussed with: Brett Gutstein <bgutstein@rice.edu>
Reviewed by: alc
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D17483

5 years agoFix style bugs in in6_pcblookup_lbgroup().
markj [Mon, 22 Oct 2018 16:09:01 +0000 (16:09 +0000)]
Fix style bugs in in6_pcblookup_lbgroup().

This should have been a part of r338470.  No functional changes
intended.

Reported by: gallatin
Reviewed by: gallatin, Johannes Lundberg <johalun0@gmail.com>
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17109

5 years agoIf we lost race or were migrated during bucket allocation for the per-CPU
glebius [Mon, 22 Oct 2018 15:48:07 +0000 (15:48 +0000)]
If we lost race or were migrated during bucket allocation for the per-CPU
cache, then we put new bucket on generic bucket cache. However, code didn't
honor UMA_ZONE_NOBUCKETCACHE flag, so potentially we could start a cache
on a zone that clearly forbids that. Fix this.

Reviewed by: markj

5 years agonfsrvd_readdirplus: for some errors, do not fail the entire request
avg [Mon, 22 Oct 2018 15:33:05 +0000 (15:33 +0000)]
nfsrvd_readdirplus: for some errors, do not fail the entire request

Instead, a failing entry is skipped.
This change consist of two logical changes.

A failure to vget or lookup an entry is considered to be a result of a
concurrent removal, which is the only reasonable explanation given that
the filesystem is busied.  So, the entry would be silently skipped.

In the case of a failure to get attributes of an entry for an NFSv3
request, the entry would be silently skipped.  There can be legitimate
reasons for the failure, but NFSv3 does not provide any means to report
the error, so we have two options: either fail the whole request or
ignore the failed entry.  Traditionally, the old NFS server used the
latter option, so the code is reverted to it.  Making the whole
directory unreadable because of a single entry seems to be unpractical.

Additionally, some bits of code are slightly re-arranged to account for
the new control flow and to honor style(9).

Reviewed by: rmacklem
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D15424

5 years agoStop advertising ARMv8.3 Pointer Authentication
andrew [Mon, 22 Oct 2018 15:18:49 +0000 (15:18 +0000)]
Stop advertising ARMv8.3 Pointer Authentication

This needs firmware and kernel support before userspace can use it. Until
then don't advertise it's available.

MFC after: 3 days

5 years agoFix the ID_AA64ISAR0_EL1 dot product field shift.
andrew [Mon, 22 Oct 2018 15:06:14 +0000 (15:06 +0000)]
Fix the ID_AA64ISAR0_EL1 dot product field shift.

It's 44 in the documentation, use this correct value.

MFC after: 3 days

5 years agoCorrectly set the DAIF bits in new threads
andrew [Mon, 22 Oct 2018 14:58:59 +0000 (14:58 +0000)]
Correctly set the DAIF bits in new threads

We should only unmask interrupts when creating a new thread and leave the
other exceptions in teh same state as before creating the thread.

Reported by: jhibbits
Reviewed by: jhibbits
MFC after: 1 month
Sponsored by: https://reviews.freebsd.org/D17497

5 years agoichwd: add support for TCO watchdog timer in Lewisburg PCH (C620)
avg [Mon, 22 Oct 2018 14:44:44 +0000 (14:44 +0000)]
ichwd: add support for TCO watchdog timer in Lewisburg PCH (C620)

The change is based on public documents listed below as well as Linux
changes and the code developed by Kostik.

The documents:
- Intel® C620 Series Chipset Platform Controller Hub Datasheet
- Intel® 100 Series and Intel® C230 Series Chipset Family Platform
  Controller Hub (PCH) Datasheet - Volume 2 of 2

Interesting Linux commits:
- https://github.com/torvalds/linux/commit/9424693035a57961a8eb09e96aab315a7096535d
- https://github.com/torvalds/linux/commit/2a7a0e9bf7b32e838d873226808ab8a6c00148f7

The peculiarity of the new chipsets is that the watchdog resources are
configured in PCI registers of SMBus controller and Power Management
function as opposed to the LPC bridge.  I took a simplistic approach of
querying the resources from the respective PCI devices.  ichwd is still
a device on isa bus.  The PCI devices are found by their slot and
function defined in the datasheets as siblings of the upstream LPC
bridge.

There are some shortcuts and missing features.

First of all, I have not implemented the functionality required to clear
the no-reboot bit.  That would require writing to a special PCI
configuration register of a hidden / invisible PCI device after which
the device would start responding to accesses to other registers.  The
no-reboot bit was not set on my test hardware, so I decided to leave its
handling for the later time.

Also, I did not try to handle the case where the watchdog resources are
not configured by the hardware as well as the case where ACPI defined
operational region conflicts with the watchdog resources.  My test
system did not have either of those problem, so, again, I decided to
leave those cases until later.
See this Linux commit for some details of the ACPI problem:
https://github.com/torvalds/linux/commit/a7ae81952cdab56a1277bd2f9ed7284c0f575120

Finally, I have added only the PCI ID found on my test system.  I think
that more IDs can be added as the change gets tested.

Tested on Dell PowerEdge R740.

PR: 222079
Reviewed by: mav, kib
MFC after: 3 weeks
Relnotes: maybe
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D17585

5 years agoAdd myself to mentees with sbruno as mentor
skozlov [Mon, 22 Oct 2018 14:01:34 +0000 (14:01 +0000)]
Add myself to mentees with sbruno as mentor

Approved by: sbruno (mentor)

5 years agoppc64: limited 32-bit DMA address range
luporl [Mon, 22 Oct 2018 13:40:50 +0000 (13:40 +0000)]
ppc64: limited 32-bit DMA address range

Further investigation of issues with 32-bit DMA on PowerNV revealed that
its window is hardcoded by OPAL (at least in skiboot version 5.4.9) and
cannot be changed by the OS.
Thus, now jhb suggestion of limiting the range in PCI DMA tag seems
the best way to deal with it.

Reviewed by: jhibbits, nwhitehorn, sbruno
Approved by: jhibbits(mentor)
Differential Revision: https://reviews.freebsd.org/D17601

5 years agoResolve deadlock between epoch(9) and various network interface
hselasky [Mon, 22 Oct 2018 13:25:26 +0000 (13:25 +0000)]
Resolve deadlock between epoch(9) and various network interface
SX-locks, during if_purgeaddrs(), by not allowing to hold the epoch
read lock over typical network IOCTL code paths. This is a regression
issue after r334305.

Reviewed by: ae (network)
Differential revision: https://reviews.freebsd.org/D17647
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdded support for formula-based arbitrary baud rates, in contrast to
hselasky [Mon, 22 Oct 2018 11:58:30 +0000 (11:58 +0000)]
Added support for formula-based arbitrary baud rates, in contrast to
the current fixed values, which enables use of rates above 1 Mbps.
Improved the detection of HXD chips, and the status flag handling as
well.

Submitted by: Gabor Simon <gabor.simon75@gmail.com>
PR: 225932
Differential revision: https://reviews.freebsd.org/D16639
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoIn bhyve's fbuf emulation improve the overall "usage" message and
bz [Mon, 22 Oct 2018 11:43:43 +0000 (11:43 +0000)]
In bhyve's fbuf emulation improve the overall "usage" message and
for the vga option, rather than printing the entire option string,
only print vga (as we do for everything else).

MFC after: 3 days

5 years agoDo not trop UDP traffic when TXCSUM_IPV6 flag is on
whu [Mon, 22 Oct 2018 11:23:51 +0000 (11:23 +0000)]
Do not trop UDP traffic when TXCSUM_IPV6 flag is on

PR: 231797
Submitted by: whu
Reviewed by: dexuan
Obtained from: Kevin Morse
MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=198333&action=diff

5 years agomlx5: Notify user that the ConnectX-6 shutdown its port due to power limitation
slavash [Mon, 22 Oct 2018 10:38:38 +0000 (10:38 +0000)]
mlx5: Notify user that the ConnectX-6 shutdown its port due to power limitation

If power exceed the slot limit, or slot limit is unknown the ConnectX-6
firmware will shutdown its port.
Inform the user via debug message.

MFC after:      3 days
Approved by:    hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

5 years agoThe event bytes should be unsigned char.
hselasky [Mon, 22 Oct 2018 08:59:20 +0000 (08:59 +0000)]
The event bytes should be unsigned char.

Found by: Peter Holm <peter@holm.cc>
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoDrop sequencer mutex around uiomove() and make sure we don't move more bytes
hselasky [Mon, 22 Oct 2018 08:58:27 +0000 (08:58 +0000)]
Drop sequencer mutex around uiomove() and make sure we don't move more bytes
than is available, else a panic might happen.

Found by: Peter Holm <peter@holm.cc>
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoFix off-by-one which can lead to panics.
hselasky [Mon, 22 Oct 2018 08:55:58 +0000 (08:55 +0000)]
Fix off-by-one which can lead to panics.

Found by: Peter Holm <peter@holm.cc>
MFC after: 3 days
Sponsored by: Mellanox Technologies

5 years agoamd64: finish the tail in memset with an overlapping store
mjg [Mon, 22 Oct 2018 06:44:20 +0000 (06:44 +0000)]
amd64: finish the tail in memset with an overlapping store

Instead of finding the exact size to fit in we can just shift the target
by -8 + tail. Doing a blind write to a previously rep stosq'ed area comes
with a penalty so do it conditionally.

Sample win on EPYC when zeroing a 257 sized buffer (tail = 1) aligned to
16 bytes:
before: 44782846 ops/s
after:  46118614 ops/s

Idea stolen from NetBSD.

Sponsored by: The FreeBSD Foundation

5 years agopfctl: Fix line numbers when \ is used inside ""
kp [Mon, 22 Oct 2018 04:12:51 +0000 (04:12 +0000)]
pfctl: Fix line numbers when \ is used inside ""

PR: 201520
Obtained from: OpenBSD
MFC after: 2 weeks

5 years agoacpi: Add an interface to obtain DSM information
bwidawsk [Mon, 22 Oct 2018 03:29:54 +0000 (03:29 +0000)]
acpi: Add an interface to obtain DSM information

The Device Specific Method (_DSM) is on optional object that defines
device specific controls. This will be useful for our power management
controller in upcoming patches. More information can be found in ACPI
spec 6.2 section 9.1.1

https://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdf

This patch had a minor modification changing ENOMEM to AE_NO_MEMORY
after it got review and approval but before committing.

Test Plan: Tested in my s0ix branch

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

5 years agoRemove newly empty directories, plus a few ohters that have crept into
imp [Mon, 22 Oct 2018 02:42:14 +0000 (02:42 +0000)]
Remove newly empty directories, plus a few ohters that have crept into
tree over time (most my fault).

5 years agoRemove the long obsolete SYM_SETUP_LP_PROBE_MAP option. It's not been
imp [Mon, 22 Oct 2018 02:36:31 +0000 (02:36 +0000)]
Remove the long obsolete SYM_SETUP_LP_PROBE_MAP option. It's not been
needed for almost 20 years, and is totally useless now that ncr(4) has
been removed.

Relnotes: yes

5 years agoRemove the ncr(4) drive.
imp [Mon, 22 Oct 2018 02:36:18 +0000 (02:36 +0000)]
Remove the ncr(4) drive.

This driver has been obsolete since the FreeBSD 4.x. It should have
been removed then since the sym(4) driver had subsumed it. The driver
was commented out of GENERIC in 2000.

RelNotes: Yes

5 years agoRetire scsi_low
imp [Mon, 22 Oct 2018 02:36:07 +0000 (02:36 +0000)]
Retire scsi_low

scsi_low was a common set of routines to do the SCSI bus sequencing
for the ncv, nsp and stg drivers. Those have been removed, so it's no
longer needed since nothing else in the tree uses it and nothing
likely ever will (it's for super-low-end 8-bit parallel SCSI cards).

5 years agoRemove stg(4) driver
imp [Mon, 22 Oct 2018 02:35:50 +0000 (02:35 +0000)]
Remove stg(4) driver

stg(4) is marked as gone in 12. Remove it. There are no sightings of
it in the nycbug dmesg database. It was for an obscure SCSI card that
sold mostly in Japan, and was especially popilar among pc98 hackers in
the 4.x time frame. It was also only enabled on i386.

Relnote: Yes

5 years agoRemove nsp(4) driver
imp [Mon, 22 Oct 2018 02:35:38 +0000 (02:35 +0000)]
Remove nsp(4) driver

nsp(4) is marked as gone in 12. Remove it. There are no sightings of
it in the nycbug dmesg database. It was for an obscure SCSI card that
sold mostly in Japan, and was especially popilar among pc98 hackers in
the 4.x time frame. It was also only enabled on i386.

Relnote: Yes

5 years agoRemove ncv(4) driver
imp [Mon, 22 Oct 2018 02:35:26 +0000 (02:35 +0000)]
Remove ncv(4) driver

ncv(4) is marked as gone in 12. Remove it. There are no sightings of
it in the nycbug dmesg database. It was for an obscure SCSI card that
sold mostly in Japan, and was especially popilar among pc98 hackers in
the 4.x time frame..

Relnote: Yes

5 years agoRetire dpt(4)
imp [Mon, 22 Oct 2018 02:35:12 +0000 (02:35 +0000)]
Retire dpt(4)

Marked as gone in 12 and not relevant since the early 90s. No
sightings in nycbug's dmesg database.

Relnotes: yes

5 years agoRemove bt(4) driver
imp [Mon, 22 Oct 2018 02:34:59 +0000 (02:34 +0000)]
Remove bt(4) driver

The buslogic scsi driver has been tagged as gone in 12 for some time
now. Remove it. The nycbug dmesg database shows only one sighting in 6
for this driver. It was very popular in the early days of the project,
but that popularity seems to have died by 2004 when the nycbug
database started up.

Relnotes: yes

5 years agoRemove adv(4) and adw(4)
imp [Mon, 22 Oct 2018 02:34:47 +0000 (02:34 +0000)]
Remove adv(4) and adw(4)

Remove the advanssy drivers (both adv and adw). They were tagged as
gone in 12 a while qgo. The nycbug dmesg database shows this was last
seen in 6 and there were only a few adv sightings then (none for adw).

Relnotes: yes

5 years agoRemove aic(4) driver
imp [Mon, 22 Oct 2018 02:34:35 +0000 (02:34 +0000)]
Remove aic(4) driver

aic was marked to be gone in 12 a while ago. Go ahead and remove it.
nycbug's dmesg database shows this was last seen in 6 and one more
time in 4.x. It never was popular, and what popularity it had was over
before the nycbug databse got going in 2004.

Relnotes: yes

5 years agoRemove aha(4) from the tree.
imp [Mon, 22 Oct 2018 02:34:25 +0000 (02:34 +0000)]
Remove aha(4) from the tree.

We tagged aha as gone in 12 a while ago. Proceed with its removal.
Data from nycbug's database shows the last sighting of this driver in
6, with the prior one in 4.x show its popularity had died prior to
4.x.

Relnotes: yes

5 years agoRemove mse(4) from tree
imp [Mon, 22 Oct 2018 02:34:10 +0000 (02:34 +0000)]
Remove mse(4) from tree

Remove mse and all support for bus and inport devices from the tree.
Data from nycbug's dmesg database shows the last sighting of this
driver was in 4.10 on only one machine.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D17628

5 years agoRemove joy(4) driver.
imp [Mon, 22 Oct 2018 02:34:00 +0000 (02:34 +0000)]
Remove joy(4) driver.

This driver was marked as gone in 12. We're at 13 now. Remove it.
Data from nycbug's dmesg cache shows only one potential user,
suggesting it never was used much.

RelNotes: yes
Differential Revision: https://reviews.freebsd.org/D17629

5 years agoRemove the gone_in(12) devices.
imp [Mon, 22 Oct 2018 02:28:18 +0000 (02:28 +0000)]
Remove the gone_in(12) devices.

We're planning on removing adv, adw, aha, aic, bt, ncv, nsp, and stg
soon. They have been tagged for removal in 12. At least get them out
of GENERIC.

MFC after: 3 days
Relnotes: yes

5 years agoAdd explicit copyright text to trivial header
cem [Mon, 22 Oct 2018 01:27:11 +0000 (01:27 +0000)]
Add explicit copyright text to trivial header

Reported by: rgrimes

5 years agopowerpc: stash off srr0 in si_addr for signals
jhibbits [Mon, 22 Oct 2018 00:27:37 +0000 (00:27 +0000)]
powerpc: stash off srr0 in si_addr for signals

si_addr is the address of the instruction executing at the time the
signal was sent.  Populate this field with srr0, which, though not
always the case, is most often the instruction that triggered the fault.

5 years agopowerpc/booke: Turn tlb*_print_tlbentries() into 'show tlb*' DDB commands
jhibbits [Mon, 22 Oct 2018 00:21:27 +0000 (00:21 +0000)]
powerpc/booke: Turn tlb*_print_tlbentries() into 'show tlb*' DDB commands

debugf() is unnecessary for the TLB printing functions, as they're only
intended to be used from ddb.  Instead, make them full DDB 'show'
commands, so now it can be written as 'show tlb1' and 'show tlb0'
instead of calling the function, hoping DEBUG has been defined.

5 years agoNew sysctl: net.inet.icmp.error_keeptags
eugen [Sun, 21 Oct 2018 21:29:19 +0000 (21:29 +0000)]
New sysctl: net.inet.icmp.error_keeptags

Currently, icmp_error() function copies FIB number from original packet
into generated ICMP response but not mbuf_tags(9) chain.
This prevents us from easily matching ICMP responses corresponding
to tagged original packets by means of packet filter such as ipfw(8).
For example, ICMP "time-exceeded in-transit" packets usually generated
in response to traceroute probes lose tags attached to original packets.

This change adds new sysctl net.inet.icmp.error_keeptags
that defaults to 0 to avoid extra overhead when this feature not needed.

Set net.inet.icmp.error_keeptags=1 to make icmp_error() copy mbuf_tags
from original packet to generated ICMP response.

PR: 215874
MFC after: 1 month

5 years agotcpdump: Log uid on pflog interfaces
kp [Sun, 21 Oct 2018 21:17:42 +0000 (21:17 +0000)]
tcpdump: Log uid on pflog interfaces

If pf logs the user id ('pass out log (user)') have tcpdump also print
this.

Example output:
 00:00:00.000000 rule 0/0(match) [uid 1001]: pass out on vtnet0: (tos 0x0, ttl 64, id 57539, offset 0, flags [none], proto UDP (17), length 55)
    172.16.2.2.18337 > 172.16.2.1.53: [bad udp cksum 0x5c58 -> 0x16e4!] 40222+ A? google.be. (27)

PR: 122773
Differential Revision: https://reviews.freebsd.org/D17625

5 years agoInclude <sys/eventhandler.h> to fix the build.
ae [Sun, 21 Oct 2018 18:39:34 +0000 (18:39 +0000)]
Include <sys/eventhandler.h> to fix the build.

MFC after: 1 month

5 years agoFollow the fix in r339532 (by glebius):
ae [Sun, 21 Oct 2018 18:30:27 +0000 (18:30 +0000)]
Follow the fix in r339532 (by glebius):
  Fix exiting an epoch(9) we never entered. May happen only with MAC.

MFC after: 1 month

5 years agoRework if_ipsec(4) to use epoch(9) instead of rmlock.
ae [Sun, 21 Oct 2018 18:24:20 +0000 (18:24 +0000)]
Rework if_ipsec(4) to use epoch(9) instead of rmlock.

* use CK_LIST and FNV hash to keep chains of softc;
* read access to softc is protected by epoch();
* write access is protected by ipsec_ioctl_sx. Changing of softc fields
  is allowed only when softc is unlinked from CK_LIST chains.
* linking/unlinking of softc is allowed only when ipsec_ioctl_sx is
  exclusive locked.
* the plain LIST of all softc is replaced by hash table that uses ingress
  address of tunnels as a key.
* added support for appearing/disappearing of ingress address handling.
  Now it is allowed configure non-local ingress IP address, and thus the
  problem with if_ipsec(4) configuration that happens on boot, when
  ingress address is not yet configured, is solved.

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17190

5 years agoAdd handling for appearing/disappearing of ingress addresses to if_me(4).
ae [Sun, 21 Oct 2018 18:18:37 +0000 (18:18 +0000)]
Add handling for appearing/disappearing of ingress addresses to if_me(4).

* register handler for ingress address appearing/disappearing;
* add new srcaddr hash table for fast softc lookup by srcaddr;
* when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
  and set it otherwise;

MFC after: 1 month
Sponsored by: Yandex LLC

5 years agoAdd handling for appearing/disappearing of ingress addresses to if_gre(4).
ae [Sun, 21 Oct 2018 18:13:45 +0000 (18:13 +0000)]
Add handling for appearing/disappearing of ingress addresses to if_gre(4).

* register handler for ingress address appearing/disappearing;
* add new srcaddr hash table for fast softc lookup by srcaddr;
* when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
  and set it otherwise;

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17214

5 years agoAdd handling for appearing/disappearing of ingress addresses to if_gif(4).
ae [Sun, 21 Oct 2018 18:06:15 +0000 (18:06 +0000)]
Add handling for appearing/disappearing of ingress addresses to if_gif(4).

* register handler for ingress address appearing/disappearing;
* add new srcaddr hash table for fast softc lookup by srcaddr;
* when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface,
  and set it otherwise;
* remove the note about ingress address from BUGS section.

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17134

5 years agoAdd KPI that can be used by tunneling interfaces to handle IP addresses
ae [Sun, 21 Oct 2018 17:55:26 +0000 (17:55 +0000)]
Add KPI that can be used by tunneling interfaces to handle IP addresses
appearing and disappearing on the host system.

Such handling is need, because tunneling interfaces must use addresses,
that are configured on the host as ingress addresses for tunnels.
Otherwise the system can send spoofed packets with source address, that
belongs to foreign host.

The KPI uses ifaddr_event_ext event to implement addresses tracking.
Tunneling interfaces register event handlers and then they are
notified by the kernel, when an address disappears or appears.

ifaddr_event_compat() handler from if.c replaced by srcaddr_change_event()
in the ip_encap.c

MFC after: 1 month
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17134

5 years agoman: fix vale(4) port naming
vmaffione [Sun, 21 Oct 2018 17:15:09 +0000 (17:15 +0000)]
man: fix vale(4) port naming

The current documentation describing the syntax of a VALE port is wrong.
This patch fixes it to make it consistent.

Approved by: bcr, gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D17411

5 years agovlan: Fix panic with lagg and vlan
kp [Sun, 21 Oct 2018 16:51:35 +0000 (16:51 +0000)]
vlan: Fix panic with lagg and vlan

vlan_lladdr_fn() is called from taskqueue, which means there's no vnet context
set. We can end up trying to send ARP messages (through the iflladdr_event
event), which requires a vnet context.

PR: 227654
MFC after: 3 days

5 years agoRemove stray refernce to pdq. Like the infamous twenty first of Johan
imp [Sun, 21 Oct 2018 16:49:49 +0000 (16:49 +0000)]
Remove stray refernce to pdq. Like the infamous twenty first of Johan
Sebastian Bach's twenty children, it hasn't been seen in many years.

5 years agoDo not decrement RST life time if keep_alive is not turned on.
ae [Sun, 21 Oct 2018 16:44:57 +0000 (16:44 +0000)]
Do not decrement RST life time if keep_alive is not turned on.

This allows use differen values configured by user for sysctl variable
net.inet.ip.fw.dyn_rst_lifetime.

Obtained from: Yandex LLC
MFC after: 3 weeks
Sponsored by: Yandex LLC

5 years agoCall inet_ntop() only when its result is needed.
ae [Sun, 21 Oct 2018 16:37:53 +0000 (16:37 +0000)]
Call inet_ntop() only when its result is needed.

Obtained from: Yandex LLC
MFC after: 3 weeks
Sponsored by: Yandex LLC

5 years agoRemove stray fatm reference.
imp [Sun, 21 Oct 2018 16:29:32 +0000 (16:29 +0000)]
Remove stray fatm reference.

5 years agoRetire IPFIREWALL_NAT64_DIRECT_OUTPUT kernel option. And add ability
ae [Sun, 21 Oct 2018 16:29:12 +0000 (16:29 +0000)]
Retire IPFIREWALL_NAT64_DIRECT_OUTPUT kernel option. And add ability
to switch the output method in run-time. Also document some sysctl
variables that can by changed for NAT64 module.

NAT64 had compile time option IPFIREWALL_NAT64_DIRECT_OUTPUT to use
if_output directly from nat64 module. By default is used netisr based
output method. Now both methods can be used, but they require different
handling by rules.

Obtained from: Yandex LLC
MFC after: 3 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D16647

5 years agoComment -DNDEBUG in head after r339436 when head was switched
gjb [Sun, 21 Oct 2018 15:54:38 +0000 (15:54 +0000)]
Comment -DNDEBUG in head after r339436 when head was switched
from 12.0-ALPHA10 to 13.0-CURRENT.  This edit was a mistake,
and should have been applied to stable/12 upon branching, not
head.

Reported by: jbeich, dim
Sponsored by: The FreeBSD Foundation

5 years agoSplit out the virtio mmio FDT attachment and add an ACPI attachment.
andrew [Sun, 21 Oct 2018 15:43:20 +0000 (15:43 +0000)]
Split out the virtio mmio FDT attachment and add an ACPI attachment.

This allows the memory mapped I/O virtio driver to attach when we boot
with ACPI tables, for example in some cases with QEMU emulating arm64.

MFC after: 1 month

5 years agoAdd IPFW_RULE_JUSTOPTS flag, that is used by ipfw(8) to mark rule,
ae [Sun, 21 Oct 2018 15:10:59 +0000 (15:10 +0000)]
Add IPFW_RULE_JUSTOPTS flag, that is used by ipfw(8) to mark rule,
that was added using "new rule format". And then, when the kernel
returns rule with this flag, ipfw(8) can correctly show it.

Reported by: lev
MFC after: 3 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17373

5 years agoTag this obsolete driver. It was obsolete in 3.x when the sym driver
imp [Sun, 21 Oct 2018 15:09:42 +0000 (15:09 +0000)]
Tag this obsolete driver. It was obsolete in 3.x when the sym driver
supported all the "old" chips it did, so we should have killed it in
4, but 12 will do. It's a bit outside of the normal deprecation
process, but given the extreme age, it's obsolete status for 8 major
releases and the fact that I couldn't find any users who posted dmesgs
with ncr0: in them after 2000 or 3.4. It may be too late for 12 (this
change will be merged, but maybe not the next one to remove it), but
it will be removed in 13 with the first round of other drivers tagged
to be gone in 12.

MFC after: 3 days

5 years agoAdd ifaddr_event_ext event. It is similar to ifaddr_event, but the
ae [Sun, 21 Oct 2018 15:02:06 +0000 (15:02 +0000)]
Add ifaddr_event_ext event. It is similar to ifaddr_event, but the
handler receives the type of event IFADDR_EVENT_ADD/IFADDR_EVENT_DEL,
and the pointer to ifaddr. Also ifaddr_event now is implemented using
ifaddr_event_ext handler.

MFC after: 3 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17100

5 years agoFix grammar.
ae [Sun, 21 Oct 2018 14:48:40 +0000 (14:48 +0000)]
Fix grammar.

Reported by: yuripv
MFC after: 3 weeks

5 years agoDo not allow use `create` keyword as hostname when ifconfig(8) is invoked
ae [Sun, 21 Oct 2018 14:40:45 +0000 (14:40 +0000)]
Do not allow use `create` keyword as hostname when ifconfig(8) is invoked
for already existing interface.

It appeared, that ifconfig(8) assumes `create` keyword as hostname and
tries to resolve it, when `ifconfig ifname create` invoked for already
existing interface. This can produce some unexpected results, when hostname
resolving has successfully happened. This patch adds check for such case.
When an interface is already exists, and create is only one argument,
return error message. But when there are some other arguments, just remove
create keyword from the arguments list.

Obtained from: Yandex LLC
MFC after: 3 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D17171

5 years agopw: fix the checks in boolean_str() after r326738. Add related test
yuripv [Sun, 21 Oct 2018 14:23:56 +0000 (14:23 +0000)]
pw: fix the checks in boolean_str() after r326738.  Add related test
cases for `pw useradd -D -w`.

PR: 231649
Reviewed by: eugen
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D17299

5 years agoAdd sadb_x_sa2 extension to SADB_ACQUIRE requests.
ae [Sun, 21 Oct 2018 14:19:16 +0000 (14:19 +0000)]
Add sadb_x_sa2 extension to SADB_ACQUIRE requests.

SADB_ACQUIRE requests are send by kernel, when security policy doesn't
have corresponding security association for outbound packet. IKE daemon
usually registers its handler for such messages and when the kernel asks
for SA it can handle this request. Now such requests will contain
additional fields that can help IKE daemon to create SA. And IKE now
can create SAs using only information from SADB_ACQUIRE request, this
is useful when many if_ipsec(4) interfaces are in use and IKE doesn track
security policies that was installed by kernel.

Obtained from: Yandex LLC
MFC after: 3 weeks
Sponsored by: Yandex LLC

5 years agoFix exiting an epoch(9) we never entered. May happen only with MAC.
glebius [Sun, 21 Oct 2018 12:39:00 +0000 (12:39 +0000)]
Fix exiting an epoch(9) we never entered. May happen only with MAC.

5 years agoamd64: tidy up memset to have rax set earlier for small sizes
mjg [Sun, 21 Oct 2018 10:46:00 +0000 (10:46 +0000)]
amd64: tidy up memset to have rax set earlier for small sizes

5 years agoRecognize LAN in Lenovo USB-C and TB3 docks
phk [Sun, 21 Oct 2018 09:36:12 +0000 (09:36 +0000)]
Recognize LAN in Lenovo USB-C and TB3 docks

5 years agoImplement ECMA-48 "REP", some Linuxen have started emitting them recently.
phk [Sun, 21 Oct 2018 08:29:36 +0000 (08:29 +0000)]
Implement ECMA-48 "REP", some Linuxen have started emitting them recently.

Approved by: ed

5 years agoRemove all the really old junk that never would be used with an OCTEON
imp [Sun, 21 Oct 2018 07:56:58 +0000 (07:56 +0000)]
Remove all the really old junk that never would be used with an OCTEON
CPU. Most of them were here just to test build mips versions of
things, even though many of them have never been tested on mips, let
alone the Octeon.

5 years agoAdd Lenovo USB-C and TB3 docks
phk [Sun, 21 Oct 2018 07:32:35 +0000 (07:32 +0000)]
Add Lenovo USB-C and TB3 docks

5 years agoUpdate example to something people less than 40 years old have heard about.
phk [Sun, 21 Oct 2018 07:30:26 +0000 (07:30 +0000)]
Update example to something people less than 40 years old have heard about.

5 years agoUse BROKEN_OPTIONS for NVME, HYPERV, CXGBETOOL and MLX5TOOL instead of
imp [Sun, 21 Oct 2018 06:52:10 +0000 (06:52 +0000)]
Use BROKEN_OPTIONS for NVME, HYPERV, CXGBETOOL and MLX5TOOL instead of
__DEFAULT_YES/NO. These options simply cannot work where we were using
__DEFAULT_NO. The proper thing to do in that case is to use the
BROKEN_OPTIONS knob instead.

5 years agoAdd missing options.
imp [Sun, 21 Oct 2018 06:33:35 +0000 (06:33 +0000)]
Add missing options.

WITHOUT_LOADER_LUA is only needed since we turned it off by default on
powerpc and sparc64 in r338203. Same with
WITHOUT_LOADER_GEIL. WITH_NVME, WITHOUT_NVME, WITH_LOADER_FORCE_LE
have been needed since they were added.

5 years agoAdd amdgpio, driver for GPIO controller on AMD-based x86_64 platforms
gonzo [Sun, 21 Oct 2018 04:52:37 +0000 (04:52 +0000)]
Add amdgpio, driver for GPIO controller on AMD-based x86_64 platforms

Submitted by: Rajesh Kumar <rajbsd@gmail.com>
Differential Revision: https://reviews.freebsd.org/D16865

5 years agopowerpc/mpc85xx: Make Freescale PCI bridge driver a subclass of ofw_pcib_pci
jhibbits [Sun, 21 Oct 2018 02:39:13 +0000 (02:39 +0000)]
powerpc/mpc85xx: Make Freescale PCI bridge driver a subclass of ofw_pcib_pci

This driver was already 99% identical to the ofw_pcib_pci driver, except for
the attachment.  Since ofw_pcib_pci is already a subclass of pcib, this
creates a private declaration of that class, to use for the base class for
this driver.

At some point in the future, ofw_pcib_pci_driver should probably be exported
to a header, so we're not tracking the softc struct contents, but for now,
since there's only this one other driver, it's not a pressing issue.

5 years agopowerpc64/powernv: Add pnpinfo strings to opal device children
jhibbits [Sun, 21 Oct 2018 02:30:34 +0000 (02:30 +0000)]
powerpc64/powernv: Add pnpinfo strings to opal device children

This makes it easier to see what's left unattached as new drivers are
written, and to see what drivers get attached to what nodes.

5 years agopowerpc64/pmap: Correct the logic for minidump KVA chunk
jhibbits [Sun, 21 Oct 2018 02:28:04 +0000 (02:28 +0000)]
powerpc64/pmap: Correct the logic for minidump KVA chunk

r279252 inverted the logic in moea64_scan_init, such that instead of
terminating when reaching a dead page, it terminates when reaching a live
page, ostensibly preserving exactly one page of KVA.

5 years agopowerpc64/xics: Fix comment typo
jhibbits [Sun, 21 Oct 2018 02:25:56 +0000 (02:25 +0000)]
powerpc64/xics: Fix comment typo

5 years agopowerpc64/powernv:opal_pci: Fix the alignment of the TCE table
jhibbits [Sun, 21 Oct 2018 02:24:37 +0000 (02:24 +0000)]
powerpc64/powernv:opal_pci: Fix the alignment of the TCE table

The TCE table need only be aligned to the size of the table, not the size of
the TCE segment.

5 years agoarm generic_timer: fix armv8 timer desc
jchandra [Sun, 21 Oct 2018 02:12:26 +0000 (02:12 +0000)]
arm generic_timer: fix armv8 timer desc

In the FDT based probe, check for "arm,armv8-timer" before "arm,armv7-timer".
This gets the description right when the timer node has both entries in
compatible list.

5 years agopowerpc/dtrace: Use explicit bit numbers to mask out PSL_EE
jhibbits [Sun, 21 Oct 2018 02:08:57 +0000 (02:08 +0000)]
powerpc/dtrace: Use explicit bit numbers to mask out PSL_EE

There seems to be a race in CI, such that dtrace_asm.S might be assembled
before the genassym is completed.  This causes a build failure when PSL_EE
doesn't exist, and is read as 0.  Get around this by explicitly specifying
the bits in the mask instead.

5 years agopwd_mkdb: retire -B and -L endianness options
emaste [Sun, 21 Oct 2018 00:48:38 +0000 (00:48 +0000)]
pwd_mkdb: retire -B and -L endianness options

Legacy v3 db support was retired in r333133, and it was v3 support that
required the -B and -L options.  The options were retained temporarily,
but now that stable/12 has branched they can be removed.

Sponsored by: The FreeBSD Foundation

5 years agopowerpcspe: Implement SPE exception handling
jhibbits [Sun, 21 Oct 2018 00:43:27 +0000 (00:43 +0000)]
powerpcspe: Implement SPE exception handling

The Signal Processing Engine (SPE) found in Freescale e500 cores (and
others) offloads IEEE-754 compliance (NaN, Inf handling, overflow,
underflow) to software, most likely as a means of simplifying the APU
silicon.  Some software, like AbiWord, needs full IEEE-754 compliance,
including NaN handling.  Implement the necessary bits to enable it.

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