]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoUpdate loader size on powerpc isos
jhibbits [Mon, 20 May 2019 03:35:14 +0000 (03:35 +0000)]
Update loader size on powerpc isos

Summary:
loader has grown to the point it's overflowing the existing 307200 bytes
allocated to it in the HFS boot partition on the isos.

Bump the space reservation up to 500k.

Submitted by: Brandon Bergren
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20301

5 years agoksyms: Fixup symbols for powerpc in the kernel, not just modules
jhibbits [Mon, 20 May 2019 02:41:09 +0000 (02:41 +0000)]
ksyms: Fixup symbols for powerpc in the kernel, not just modules

Summary:
PowerPC kernels are fully position independent, just like kernel modules.
The same fixups that are done for modules therefore need to be done to the
kernel, else symbol resolution in, e.g., DTrace, cannot resolve the kernel
symbols, so only addresses in the kernel are printed, while kernel module
symbols are printed.

Test Plan:
Run lockstat on powerpc64.  Note symbols are resolved for kernel and
modules.

Reviewed By: markj
Differential Revision: https://reviews.freebsd.org/D20316

5 years agoExtract eventfilter declarations to sys/_eventfilter.h
cem [Mon, 20 May 2019 00:38:23 +0000 (00:38 +0000)]
Extract eventfilter declarations to sys/_eventfilter.h

This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header
pollution substantially.

EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c
files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).

As a side effect of reduced header pollution, many .c files and headers no
longer contain needed definitions.  The remainder of the patch addresses
adding appropriate includes to fix those files.

LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by
sys/mutex.h since r326106 (but silently protected by header pollution prior
to this change).

No functional change (intended).  Of course, any out of tree modules that
relied on header pollution for sys/eventhandler.h, sys/lock.h, or
sys/mutex.h inclusion need to be fixed.  __FreeBSD_version has been bumped.

5 years agoFix rt_ifa selection during loopback route insertion process.
melifaro [Sun, 19 May 2019 21:49:56 +0000 (21:49 +0000)]
Fix rt_ifa selection during loopback route insertion process.
  Currently such routes are added with a link-level IFA, which is
  plain wrong. Only after the insertion they get fixed by the special
  link_rtrequest() ifa handler. This behaviour complicates routing code
  and makes ifa selection more complex.
Streamline this process by explicitly moving link_rtrequest() logic
  to the pre-insertion rt_getifa_fib() ifa selector. Avoid calling all
  this logic in the loopback route case by explicitly specifying
  proper rt_ifa inside the ifa_maintain_loopback_route().ยง

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

5 years agolibsecureboot: allow control of when pseudo pcr is updated
sjg [Sun, 19 May 2019 20:28:49 +0000 (20:28 +0000)]
libsecureboot: allow control of when pseudo pcr is updated

During boot we only want to measure things which *must*
be verified - this should provide more deterministic ordering.

Reviewed by: stevek
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D20297

5 years agoload_key_buf do not free data from dearmor
sjg [Sun, 19 May 2019 20:24:17 +0000 (20:24 +0000)]
load_key_buf do not free data from dearmor

The data returned by dearmor is referenced by the key
leave it alone!

Reviewed by: stevek
MFC after: 2 days

5 years agoTo avoid unnecessarily modifying ports, add a -lgomp symlink, since GCC
dim [Sun, 19 May 2019 20:13:55 +0000 (20:13 +0000)]
To avoid unnecessarily modifying ports, add a -lgomp symlink, since GCC
does not ship a -lomp symlink.  Also update OptionalObsoleteFiles for
this, and add 32-bit variants while here.

Submitted by: jbeich
PR: 237975
MFC after: 3 days

5 years agoFix OptionalObsoleteFiles copy/paste mistake from r345236, which
dim [Sun, 19 May 2019 19:42:35 +0000 (19:42 +0000)]
Fix OptionalObsoleteFiles copy/paste mistake from r345236, which
connected libomp to the build.  The comparison should not have been
against ${MK_OPENSSH}, but against ${MK_OPENMP}, obviously.

MFC after: 3 days

5 years agoAllow sending on demand SCTP HEARTBEATS only in the ESTABLISHED state.
tuexen [Sun, 19 May 2019 17:53:36 +0000 (17:53 +0000)]
Allow sending on demand SCTP HEARTBEATS only in the ESTABLISHED state.
This issue was found by running syzkaller.

MFC after: 3 days

5 years agoImprove input validation for the IPPROTO_SCTP level socket options
tuexen [Sun, 19 May 2019 17:28:00 +0000 (17:28 +0000)]
Improve input validation for the IPPROTO_SCTP level socket options
SCTP_CONNECT_X and SCTP_CONNECT_X_DELAYED.

Some issues where found by running syzkaller.

MFC after: 3 days

5 years agoAdd common support functions for USB devices configured via FDT data.
ian [Sun, 19 May 2019 16:56:59 +0000 (16:56 +0000)]
Add common support functions for USB devices configured via FDT data.

FDT data is sometimes used to configure usb devices which are hardwired into
an embedded system. Because the devices are instantiated by the usb
enumeration process rather than by ofwbus iterating through the fdt data, it
is somewhat difficult for a usb driver to locate fdt data that belongs to
it. In the past, various ad-hoc methods have been used, which can lead to
errors such applying configuration that should apply only to a hardwired
device onto a similar device attached by the user at runtime. For example,
if the user adds an ethernet device that uses the same driver as the builtin
ethernet, both devices might end up with the same MAC address.

These changes add a new usb_fdt_get_node() helper function that a driver can
use to locate FDT data that belongs to a single unique instance of the
device. This function locates the proper FDT data using the mechanism
detailed in the standard "usb-device.txt" binding document [1].

There is also a new usb_fdt_get_mac_addr() function, used to retrieve the
mac address for a given device instance from the fdt data. It uses
usb_fdt_get_node() to locate the right node in the FDT data, and attempts to
obtain the mac-address or local-mac-address property (in that order, the
same as linux does it).

The existing if_smsc driver is modified to use the new functions, both as an
example and for testing the new functions. Rpi and rpi2 boards use this
driver and provide the mac address via the fdt data.

[1] https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/usb/usb-device.txt

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

5 years agoLinuxKPI: Finalize move of lindebugfs from ports to base.
johalun [Sun, 19 May 2019 15:44:21 +0000 (15:44 +0000)]
LinuxKPI: Finalize move of lindebugfs from ports to base.

The source file was moved to base earlier and also improved upon,
but never compiled in. This patch will:
- Make a module in sys/modules
- Make lindebugfs depend on linuxkpi (for seq_file)
- Check if read/write functions are set before calling, DRM drivers
  don't always set both of them.

Reviewed by: hps
Approved by: imp (mentor), hps
MFC after: 1 week

5 years agoAdd missing setting of hv_base to the leaf that we used.
stevek [Sun, 19 May 2019 15:07:14 +0000 (15:07 +0000)]
Add missing setting of hv_base to the leaf that we used.
Correct setting hv_high to use regs[0], not leaf.

5 years agoImplement PTRACE_O_TRACESYSGOOD. This makes Linux strace(1) work.
trasz [Sun, 19 May 2019 12:58:44 +0000 (12:58 +0000)]
Implement PTRACE_O_TRACESYSGOOD.  This makes Linux strace(1) work.

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

5 years agoLinux send() call returns EAGAIN instead of ENOTCONN in case when the
dchagin [Sun, 19 May 2019 09:23:20 +0000 (09:23 +0000)]
Linux send() call returns EAGAIN instead of ENOTCONN in case when the
socket is non-blocking and connect() is not finished yet.

Initial patch developed by Steven Hartland in 2008 and adopted by me.

PR: 129169
Reported by: smh@
MFC after: 2 weeks

5 years agoFix rw->ro remount when there is a text vnode mapping.
kib [Sun, 19 May 2019 09:18:09 +0000 (09:18 +0000)]
Fix rw->ro remount when there is a text vnode mapping.

Reported and tested by: hrs
Sponsored by: The FreeBSD Foundation
MFC after: 16 days

5 years agonvd.4: Reference nda(4)
cem [Sun, 19 May 2019 06:01:11 +0000 (06:01 +0000)]
nvd.4: Reference nda(4)

Fix a totally minor typo in nvme.4 while here.

5 years agoAdd note about nvd / nda selection.
imp [Sun, 19 May 2019 05:46:24 +0000 (05:46 +0000)]
Add note about nvd / nda selection.

Noticed by: cem@

5 years agoExpose the MD_CLEAR capability used by Intel MDS mitigations to guests.
jhb [Sat, 18 May 2019 21:20:38 +0000 (21:20 +0000)]
Expose the MD_CLEAR capability used by Intel MDS mitigations to guests.

Submitted by: Patrick Mooney <pmooney@pfmooney.com>
Reviewed by: kib
Tested by: Patrick on SmartOS with Linux and Windows guests
Obtained from: Joyent
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20296

5 years agoChange ed(4), ep(4), and fxp(4) examples to em(4).
brooks [Sat, 18 May 2019 21:01:36 +0000 (21:01 +0000)]
Change ed(4), ep(4), and fxp(4) examples to em(4).

ed(4) and ep(4) have been removed. fxp(4) remains popular in older
systems, but isn't as future proof as em(4).

Reviewed by: bz, jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20311

5 years agoAdd note to UPDATING for users of mergemaster after the move of master.passwd
brd [Sat, 18 May 2019 19:36:23 +0000 (19:36 +0000)]
Add note to UPDATING for users of mergemaster after the move of master.passwd
and group in r347638.

Approved by: allanjude (mentor)

5 years agobhyve virtio needs barriers
rgrimes [Sat, 18 May 2019 19:32:38 +0000 (19:32 +0000)]
bhyve virtio needs barriers

Under certain tight race conditions, we found that the lack of a memory
barrier in bhyve's virtio handling causes it to miss a NO_NOTIFY state
transition on block devices, resulting in guest stall. The investigation
is recorded in OS-7613. As part of the examination into bhyve's use of
barriers, one other section was found to be problematic, but only on
non-x86 ISAs with less strict memory ordering. That was addressed in
this patch as well, although it was not at all a problem on x86.

PR: 231117
Submitted by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: jhb, kib, rgrimes
Approved by: jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D19501

5 years agoUpdate beinstall to use the mergemaster/etcupdate from the source tree instead
brd [Sat, 18 May 2019 17:13:08 +0000 (17:13 +0000)]
Update beinstall to use the mergemaster/etcupdate from the source tree instead
of the installed one.

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

5 years agoMake lock-less delayed invalidation operational very early.
kib [Sat, 18 May 2019 16:19:31 +0000 (16:19 +0000)]
Make lock-less delayed invalidation operational very early.

Apparently, there is more code trying to call pmap_remove() early,
mostly to free preloaded memory.  Instead of moving all deallocations
to the point where a scheduler is initialized, add missed setup of
thread0 di init at hammer_time().

The code in pmap_delayed_invl_start_u() is modified to not ever take
the thread lock if the thread priority is less or equal to PVM.  Since
thread0 starts at priority 0, and then is reset to PVM at
proc0_init(), this eliminates taking the thread lock during early
boot.

While there, fix off by one in comparision of the base priority.

Reported and tested by: bcran (previous version)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 29 days

5 years agopowerpc: Fix moea64 pmap from 347952
jhibbits [Sat, 18 May 2019 14:55:59 +0000 (14:55 +0000)]
powerpc: Fix moea64 pmap from 347952

vm_paddr_t is only 32 bits on AIM32 (currently), causing a build failure with
the shifting.

MFC after: 2 weeks
MFC with: r347952

5 years agoUpdate the DIAGNOSTIC-only vmem_check_sanity() after r347949.
markj [Sat, 18 May 2019 14:19:23 +0000 (14:19 +0000)]
Update the DIAGNOSTIC-only vmem_check_sanity() after r347949.

Cursor tags are special and shouldn't be subject to the existing checks.

Reported by: kib, David Wolfskill
MFC with: r347949

5 years agoMFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first
allanjude [Sat, 18 May 2019 12:27:22 +0000 (12:27 +0000)]
MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first

zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee

zfs_main: fix `zfs userspace` squashing unresolved entries

The `zfs userspace` squashes all entries with unresolved numeric
values into a single output entry due to the comparsion always
made by the string name which is empty in case of unresolved IDs.

Fix this by falling to a numerical comparison when either one
of string values is not found. This then compares any numerical
values after all with a name resolved.

Signed-off-by: Pavel Boldin <boldin.pavel@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reported by: clusteradm
Obtained from: ZFS-on-Linux
MFC after: 3 days

5 years agopowerpc64/pmap: NUMA-ize the page pv lock pool to reduce contention
jhibbits [Sat, 18 May 2019 11:14:43 +0000 (11:14 +0000)]
powerpc64/pmap: NUMA-ize the page pv lock pool to reduce contention

It was found during building llvm that the page pv lock pool was seeing very
high contention.  Since the pmap is already NUMA aware, it was surmised that
the domains were referencing similar pages in the different domains.  This
reduces contention to the point of noise in a lockstat(8) run (~51% down to
under 5%), reducing build times by up to 20%.

This doesn't do a perfect domain alignment, just a best-guess based on
hardware available, that the domain is roughly specified in the upper bits
of the PA.  Trying to be more clever would more than likely result in
reduced performance just on the work needed.

MFC after: 2 weeks

5 years agoUse M_NEXTFIT in memguard(9).
markj [Sat, 18 May 2019 02:02:14 +0000 (02:02 +0000)]
Use M_NEXTFIT in memguard(9).

memguard(9) wants to avoid reuse of freed addresses for as long as
possible.  Previously it maintained a racily updated cursor which was
passed to vmem_xalloc(9) as the minimum address.  However, vmem will
not in general return the lowest free address in the arena, so this
trick only really works until the cursor has wrapped around the first
time.

Reported by: alc
Reviewed by: alc
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D17227

5 years agoImplement the M_NEXTFIT allocation strategy for vmem(9).
markj [Sat, 18 May 2019 01:46:38 +0000 (01:46 +0000)]
Implement the M_NEXTFIT allocation strategy for vmem(9).

This is described in the vmem paper: "directs vmem to use the next free
segment after the one previously allocated."  The implementation adds a
new boundary tag type, M_CURSOR, which is linked into the segment list
and precedes the segment following the previous M_NEXTFIT allocation.
The cursor is used to locate the next free segment satisfying the
allocation constraints.

This implementation isn't O(1) since busy tags aren't coalesced, and we
may potentially scan the entire segment list during an M_NEXTFIT
allocation.

Reviewed by: alc
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D17226

5 years agoAdd DragonFly's partition number to fdisk(8) and diskmbr.h
cem [Sat, 18 May 2019 00:22:28 +0000 (00:22 +0000)]
Add DragonFly's partition number to fdisk(8) and diskmbr.h

This change doesn't make any attempt to add support for these slices to the
relevent GEOM classes.  Just register the number in fdisk and the canonical
list of kernel macros (diskmbr.h).

Obtained from: DragonFlyBSD (794d80aa519b394b3174f20776a) (small subset of)

5 years agoGrammar fixes for r347690.
kib [Fri, 17 May 2019 21:18:11 +0000 (21:18 +0000)]
Grammar fixes for r347690.

Submitted by: alc
MFC after: 3 days

5 years agonetmap: align if_ptnet to the changes introduced by r347233
vmaffione [Fri, 17 May 2019 20:29:31 +0000 (20:29 +0000)]
netmap: align if_ptnet to the changes introduced by r347233

This removes non-functional SCTP checksum offload support.
More information in the log message of r347233.

MFC after: 2 weeks

5 years agopowerpc/dtrace: Actually fix stack traces
jhibbits [Fri, 17 May 2019 19:57:08 +0000 (19:57 +0000)]
powerpc/dtrace: Actually fix stack traces

Fix stack unwinding such that requesting N stack frames in lockstat will
actually give you N frames, not anywhere from 0-3 as had been before.

lockstat prints the mutex function instead of the caller as the reported
locker, but the stack frame is detailed enough to find the real caller.

MFC after: 2 weeks

5 years agoAdd a new ioctl for the larger params struct that includes the label.
stevek [Fri, 17 May 2019 19:27:07 +0000 (19:27 +0000)]
Add a new ioctl for the larger params struct that includes the label.

We need to make the find_veriexec_file() function available publicly, so
rename it to mac_veriexec_metadata_find_file_info() and make it non-static.

Bump the version of the veriexec device interface so user space will know
the labelized version of fingerprint loading is available.

Approved by: sjg
Obtained from: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D20295

5 years agoAdd command to get version of the ioctl interface for the veriexec device.
stevek [Fri, 17 May 2019 18:25:53 +0000 (18:25 +0000)]
Add command to get version of the ioctl interface for the veriexec device.

Obtained from: Juniper Networks, Inc.
MFC after: 1 week

5 years agoRemove the notice that ae(4) will be removed in FreeBSD 13.
brooks [Fri, 17 May 2019 18:16:55 +0000 (18:16 +0000)]
Remove the notice that ae(4) will be removed in FreeBSD 13.

5 years agoBetter formatting for the logpage section
scottl [Fri, 17 May 2019 18:15:47 +0000 (18:15 +0000)]
Better formatting for the logpage section

5 years agoObtain a shared lock instead of exclusive in the MAC/veriexec
stevek [Fri, 17 May 2019 18:13:43 +0000 (18:13 +0000)]
Obtain a shared lock instead of exclusive in the MAC/veriexec
MAC_VERIEXEC_CHECK_PATH_SYSCALL per-MAC policy system call.

When we are checking the status of the fingerprint on a vnode using the
per-MAC-policy syscall, we do not need an exclusive lock on the vnode.

Even if there is more than one thread requesting the status at the same time,
the worst we can end up doing is processing the file more than once.

This can potentially be improved in the future with offloading the fingerprint
evaluation to a separate thread and blocking until the update completes. But
for now the race is acceptable.

Obtained from: Juniper Networks, Inc.
MFC after: 1 week

5 years agosysctls which should be restricted when securelevel is raised should also
stevek [Fri, 17 May 2019 18:09:48 +0000 (18:09 +0000)]
sysctls which should be restricted when securelevel is raised should also
be restricted when veriexec is enforced.

Add mpo_system_check_sysctl method to mac_veriexec which does this.

Obtained from: Juniper Networks, Inc.
MFC after: 1 week

5 years agoFix format strings for some debug messages that could have arguments that
stevek [Fri, 17 May 2019 18:06:24 +0000 (18:06 +0000)]
Fix format strings for some debug messages that could have arguments that
are different types across architectures by using %ju and typecasting to
uintmax_t, where appropriate.

Obtained from: Juniper Networks, Inc.
MFC after: 1 week

5 years agoProtect commands that are considered dangerous with checks for kmem write
stevek [Fri, 17 May 2019 18:02:26 +0000 (18:02 +0000)]
Protect commands that are considered dangerous with checks for kmem write
priv. This allows for MAC/veriexec to prevent apps that are not "trusted"
from using these commands.

Obtained from: Juniper Networks, Inc.
MFC after: 1 week

5 years agoEnsure we have obtained a lock on the process before calling
stevek [Fri, 17 May 2019 17:50:01 +0000 (17:50 +0000)]
Ensure we have obtained a lock on the process before calling
mac_veriexec_get_executable_flags(). Only try locking/unlocking if the caller
has not already acquired the process lock.

Obtained from: Juniper Networks, Inc.
MFC after: 1 week

5 years agoInstead of individual conditional statements to look for each hypervisor
stevek [Fri, 17 May 2019 17:21:32 +0000 (17:21 +0000)]
Instead of individual conditional statements to look for each hypervisor
type, use a table to make it easier to add more in the future, if needed.

Add VirtualBox detection to the table ("VBoxVBoxVBox" is the hypervisor
vendor string to look for.) Also add VM_GUEST_VBOX to the VM_GUEST
enumeration to indicate VirtualBox.

Save the CPUID base for the hypervisor entry that we detected. Driver code
may need to know about it in order to obtain additional CPUID features.

Approved by: bryanv, jhb
Differential Revision: https://reviews.freebsd.org/D16305

5 years agoFree microcode memory later.
kib [Fri, 17 May 2019 17:11:01 +0000 (17:11 +0000)]
Free microcode memory later.

With lockless DI, pmap_remove() requires operational thread lock,
which is initialized at SI_SUB_RUN_QUEUE for thread0.  Move it even
later where APs are started, the moment after which other boot memory
like trampoline stacks is already being freed.

Reported by: gtetlow
Sponsored by: The FreeBSD Foundation
MFC after: 30 days

5 years agopci: ecam: Correctly parse memory and IO region
manu [Fri, 17 May 2019 17:05:16 +0000 (17:05 +0000)]
pci: ecam: Correctly parse memory and IO region

When activating a resource do not compare the resource id to the adress.
Treat IO region as MEMORY region too.

Submitted by: Tuan Phan <tphan@amperecomputing.com> (Original Version)
Sponsored by: Ampere Computing, LLC
Differential Revision: https://reviews.freebsd.org/D20214

5 years agopci: ecam: Do not warn on mismatch of bus_end
manu [Fri, 17 May 2019 17:04:01 +0000 (17:04 +0000)]
pci: ecam: Do not warn on mismatch of bus_end

We cannot know the bus end number before parsing the MCFG table
so don't set the bus_end before that. If the MCFG table doesn't
exist we will set the configuration base address based on the _CBA
value and set the bus_end to the maximal number allowed by PCI.

Sponsored by: Ampere Computing, LLC

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

5 years agoImplement the ffs and fls functions, and their longer counterparts, in
dougm [Fri, 17 May 2019 15:52:17 +0000 (15:52 +0000)]
Implement the ffs and fls functions, and their longer counterparts, in
cpufunc, in terms of __builtin_ffs and the like, for arm64
architectures, and use those, rather than the simple libkern
implementations, in building arm64 kernels.

Tested by: greg_unrelenting.technology (earlier version)
Reviewed by: alc
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20250

5 years agoFCP-101: correct date of device driver removal.
brooks [Fri, 17 May 2019 15:44:11 +0000 (15:44 +0000)]
FCP-101: correct date of device driver removal.

5 years agoFCP-101: Bump __FreeBSD_version for device removal.
brooks [Fri, 17 May 2019 15:31:28 +0000 (15:31 +0000)]
FCP-101: Bump __FreeBSD_version for device removal.

Bump accidentally omitted from r347924 due to a rebase accident.

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

5 years agoFCP-101: Bump __FreeBSD_version for driver removal.
brooks [Fri, 17 May 2019 15:24:54 +0000 (15:24 +0000)]
FCP-101: Bump __FreeBSD_version for driver removal.

Remove gone_by_fcp101_dev macro.

Remove orphaned comment.

5 years agoFCP-101: Remove xe(4)
brooks [Fri, 17 May 2019 15:24:44 +0000 (15:24 +0000)]
FCP-101: Remove xe(4)

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove wb(4)
brooks [Fri, 17 May 2019 15:24:34 +0000 (15:24 +0000)]
FCP-101: Remove wb(4)

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove vx(4).
brooks [Fri, 17 May 2019 15:24:26 +0000 (15:24 +0000)]
FCP-101: Remove vx(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove txp(4).
brooks [Fri, 17 May 2019 15:24:17 +0000 (15:24 +0000)]
FCP-101: Remove txp(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove tx(4).
brooks [Fri, 17 May 2019 15:24:08 +0000 (15:24 +0000)]
FCP-101: Remove tx(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove tl(4).
brooks [Fri, 17 May 2019 15:24:00 +0000 (15:24 +0000)]
FCP-101: Remove tl(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove sn(4).
brooks [Fri, 17 May 2019 15:23:52 +0000 (15:23 +0000)]
FCP-101: Remove sn(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove sf(4).
brooks [Fri, 17 May 2019 15:23:43 +0000 (15:23 +0000)]
FCP-101: Remove sf(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove pcn(4).
brooks [Fri, 17 May 2019 15:23:34 +0000 (15:23 +0000)]
FCP-101: Remove pcn(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove fe(4).
brooks [Fri, 17 May 2019 15:23:26 +0000 (15:23 +0000)]
FCP-101: Remove fe(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove ex(4).
brooks [Fri, 17 May 2019 15:23:18 +0000 (15:23 +0000)]
FCP-101: Remove ex(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove ep(4).
brooks [Fri, 17 May 2019 15:23:10 +0000 (15:23 +0000)]
FCP-101: Remove ep(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove ed(4).
brooks [Fri, 17 May 2019 15:23:02 +0000 (15:23 +0000)]
FCP-101: Remove ed(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove de(4).
brooks [Fri, 17 May 2019 15:22:54 +0000 (15:22 +0000)]
FCP-101: Remove de(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove cs(4).
brooks [Fri, 17 May 2019 15:22:45 +0000 (15:22 +0000)]
FCP-101: Remove cs(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: Remove bm(4).
brooks [Fri, 17 May 2019 15:20:51 +0000 (15:20 +0000)]
FCP-101: Remove bm(4).

Relnotes: yes
FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoFCP-101: remove obsolete 10 and 10/100 Ethernet drivers.
brooks [Fri, 17 May 2019 15:19:12 +0000 (15:19 +0000)]
FCP-101: remove obsolete 10 and 10/100 Ethernet drivers.

Initial commit adding comment to ObsoleteFiles.  Each driver will be
removed in a seperate commit to allow later reverts if required.

FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md
Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D20230

5 years agoRemove unused define.
tychon [Fri, 17 May 2019 13:08:12 +0000 (13:08 +0000)]
Remove unused define.

Sponsored by: Dell EMC Isilon

5 years agoFix integer overflow in r346386.
tychon [Thu, 16 May 2019 22:27:38 +0000 (22:27 +0000)]
Fix integer overflow in r346386.

Sponsored by: Dell EMC Isilon

5 years agoRemove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros.
kib [Thu, 16 May 2019 22:20:54 +0000 (22:20 +0000)]
Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros.

In all practical situations, the resolver visibility is static.

Requested by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: so (emaste)
Differential revision: https://reviews.freebsd.org/D20281

5 years agoFix mergemaster after r347638 and the master.passwd / group move.
brd [Thu, 16 May 2019 21:50:12 +0000 (21:50 +0000)]
Fix mergemaster after r347638 and the master.passwd / group move.

Check the legacy directory and use it instead if present.

Install these first if using beinstall.

UPDATING entry to follow.

Approved by: allanjude (mentor, in person)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20279

5 years agoLinuxKPI: Finalize import of seq_file.
johalun [Thu, 16 May 2019 21:17:18 +0000 (21:17 +0000)]
LinuxKPI: Finalize import of seq_file.

seq_file.h and linux_seq_file.c was imported form ports earlier but
linux_seq_file.c was never compiled in with the module. With this
commit base seq_file will replace ports seq_file and it required a
few modifications to not break functionality and build.

Reviewed by: hps
Approved by: imp (mentor), hps
MFC after: 1 week

5 years agoLinuxKPI: Add in_task macro.
johalun [Thu, 16 May 2019 21:07:37 +0000 (21:07 +0000)]
LinuxKPI: Add in_task macro.

This patch is part of D19565

Reviewed by: hps, bwidawsk
Approved by: imp (mentor), hps
Obtained from: bwidawsk
MFC after: 1 week

5 years agoreinstate 4GB DMA boundary workarounds for bge and aac
tychon [Thu, 16 May 2019 20:41:28 +0000 (20:41 +0000)]
reinstate 4GB DMA boundary workarounds for bge and aac

Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20277

5 years agoLinuxKPI: Fix build on powerpc/sparc.
johalun [Thu, 16 May 2019 19:32:11 +0000 (19:32 +0000)]
LinuxKPI: Fix build on powerpc/sparc.

Use cmpset instead of testandset in tasklet lock code.

Reviewed by: hps
Approved by: imp (mentor), hps
Obtained from: hps
MFC after: 1 week

5 years agomips: Implement basic pmap_kenter_device, pmap_kremove_device
cem [Thu, 16 May 2019 19:10:48 +0000 (19:10 +0000)]
mips: Implement basic pmap_kenter_device, pmap_kremove_device

Unbreak mips.BERI_DE4_SDROOT build, which uses device xdma. Device xdma
depends on the pmap_kenter_device APIs.

Reported by: tinderbox (local)
Sponsored by: Dell EMC Isilon

5 years agoFix hostname to be returned in an ICMPv6 NI Reply message defined
hrs [Thu, 16 May 2019 19:09:41 +0000 (19:09 +0000)]
Fix hostname to be returned in an ICMPv6 NI Reply message defined
in RFC 4620, ICMPv6 Node Information Queries.  A vnet jail with an
IPv6 address sent a hostname of the host environment, not the
jail, even if another hostname was set to the jail.

This change can be tested by the following commands:

 # ifconfig epair0 create
 # jail -c -n j1 vnet host.hostname=vnetjail path=/ persist
 # ifconfig epair0b vnet j1
 # ifconfig epair0a inet6 -ifdisabled auto_linklocal up
 # jexec j1 ifconfig epair0b inet6 -ifdisabled auto_linklocal up
 # ping6 -w ff02::1%epair0a

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

5 years agoAnnounce OpenBSD 6.5.
roberto [Thu, 16 May 2019 18:54:20 +0000 (18:54 +0000)]
Announce OpenBSD 6.5.

5 years agoLinuxKPI: Updates to tasklets for Linux 5.0.
johalun [Thu, 16 May 2019 18:03:08 +0000 (18:03 +0000)]
LinuxKPI: Updates to tasklets for Linux 5.0.

DRM drivers expect tasklets to have a counter for enable/disable calls.
Also, add a few more tasklet locking functions.

This patch is part of D19565

Reviewed by: hps
Approved by: imp (mentor), hps
MFC after: 1 week

5 years agoLinuxKPI: Add group_leader member to struct task_struct.
johalun [Thu, 16 May 2019 17:53:36 +0000 (17:53 +0000)]
LinuxKPI: Add group_leader member to struct task_struct.

Assign self as group leader at creation to act as the only member of a
new process group.
This patch is part of D19565

Reviewed by: hps
Approved by: imp (mentor), hps
MFC after: 1 week

5 years agoLinuxKPI: Update access_ok macro for v5.0.
johalun [Thu, 16 May 2019 17:44:17 +0000 (17:44 +0000)]
LinuxKPI: Update access_ok macro for v5.0.

Check LINUXKPI_VERSION macro for backwards compatibility.
It's recommended to update any drivers that depend on the older KPI
so we can deprecate < 5.0 code as we update to newer Linux version.
This patch is part of D19565

Reviewed by: hps
Approved by: imp (mentor), hps
MFC after: 1 week

5 years agoAllow loading the same DMA address multiple times without any prior
tychon [Thu, 16 May 2019 17:41:16 +0000 (17:41 +0000)]
Allow loading the same DMA address multiple times without any prior
unload for the LinuxKPI.

Reviewed by: kib, zeising
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20181

5 years agoxdma(4): Fix invalid pointer use (breaks arm.SOCFPGA build)
cem [Thu, 16 May 2019 17:34:36 +0000 (17:34 +0000)]
xdma(4): Fix invalid pointer use (breaks arm.SOCFPGA build)

In xdma_handle_mem_node(), vmem_size_t and vmem_addr_t pointers were passed to
an FDT API that emits u_long values to the output parameter pointer.  This
broke on systems with both xdma and 32-bit vmem size/addr types (SOCFPGA).

Reported by: tinderbox
Sponsored by: Dell EMC Isilon

5 years agoarm64: Add the rename interpreter path for compat32 ld-elf
jhibbits [Thu, 16 May 2019 17:04:29 +0000 (17:04 +0000)]
arm64: Add the rename interpreter path for compat32 ld-elf

Let arm64 and arm32 dynamic binaries coexist.  Match all other compat32
archs.

Reviewed by: manu
Sponsored by: Juniper Networks, Inc

5 years agoFCP-101: ae(4) is sufficently popular to be moved to the keep list.
brooks [Thu, 16 May 2019 15:22:17 +0000 (15:22 +0000)]
FCP-101: ae(4) is sufficently popular to be moved to the keep list.

5 years agoamd64 pmap: sysctl vm.pmap.pcid_save_cnt should be read-only.
kib [Thu, 16 May 2019 14:33:32 +0000 (14:33 +0000)]
amd64 pmap: sysctl vm.pmap.pcid_save_cnt should be read-only.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoamd64 pmap: Add tunable vm.pmap.di_locked to set DI mode.
kib [Thu, 16 May 2019 14:29:09 +0000 (14:29 +0000)]
amd64 pmap: Add tunable vm.pmap.di_locked to set DI mode.

This is done mostly for debugging in field.  Also added the sysctl of
the same name to report used mode.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

5 years agoamd64 pmap: Rename DI functions.
kib [Thu, 16 May 2019 13:40:54 +0000 (13:40 +0000)]
amd64 pmap: Rename DI functions.

pmap_delayed_invl_started -> pmap_delayed_invl_start
pmap_delayed_invl_finished -> pmap_delayed_invl_finish

Requested by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 month

5 years agoamd64 pmap: rework delayed invalidation, removing global mutex.
kib [Thu, 16 May 2019 13:28:48 +0000 (13:28 +0000)]
amd64 pmap: rework delayed invalidation, removing global mutex.

For machines having cmpxcgh16b instruction, i.e. everything but very
early Athlons, provide lockless implementation of delayed
invalidation.

The implementation maintains lock-less single-linked list with the
trick from the T.L. Harris article about volatile mark of the elements
being removed. Double-CAS is used to atomically update both link and
generation.  New thread starting DI appends itself to the end of the
queue, setting the generation to the generation of the last element
+1.  On DI finish, thread donates its generation to the previous
element.  The generation of the fake head of the list is the last
passed DI generation.  Basically, the implementation is a queued
spinlock but without spinlock.

Many thanks both to Peter Holm and Mark Johnson for keeping with me
while I produced intermediate versions of the patch.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
MFC note: td_md.md_invl_gen should go to the end of struct thread
Differential revision: https://reviews.freebsd.org/D19630

5 years agosubr_turnstile: Extract some common code to a helper.
kib [Thu, 16 May 2019 13:17:57 +0000 (13:17 +0000)]
subr_turnstile: Extract some common  code to a helper.

Code walks the list of contested turnstiles to calculate the priority
to unlend.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agortld_malloc.c: cleanup morepages().
kib [Thu, 16 May 2019 13:13:33 +0000 (13:13 +0000)]
rtld_malloc.c: cleanup morepages().

Use roundup2() and rounddown2() instead of inlining them.
Get rid of the fd local variable, use literal -1 for the mmap argument.
Use MAP_FAILED as mmap(2) failure indicator.
After that, apply some style.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoRemove more dead definitions from rtld_malloc.c after r347019.
kib [Thu, 16 May 2019 13:07:26 +0000 (13:07 +0000)]
Remove more dead definitions from rtld_malloc.c after r347019.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoRevert r347582 for now.
markj [Thu, 16 May 2019 13:04:26 +0000 (13:04 +0000)]
Revert r347582 for now.

The inp lock still needs to be dropped when calling into the driver ioctl
handler, as some drivers expect to be able to sleep.

Reported by: kib

5 years agoimgact_elf.c: Add comment explaining the malloc/VOP_UNLOCK() dance
kib [Thu, 16 May 2019 13:03:54 +0000 (13:03 +0000)]
imgact_elf.c: Add comment explaining the malloc/VOP_UNLOCK() dance
from r347148.

Requested by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agoarm64: bzero buffer for ucontext in freebsd32_swapcontext().
kib [Thu, 16 May 2019 13:00:35 +0000 (13:00 +0000)]
arm64: bzero buffer for ucontext in freebsd32_swapcontext().

This change is the same as r340994 for amd64.

PR: 237922
Submitted by: Young <yangx92@hotmail.com>
MFC after: 3 days

5 years agoThe "apropos ''" command no longer works; change development(7)
trasz [Thu, 16 May 2019 09:49:19 +0000 (09:49 +0000)]
The "apropos ''" command no longer works; change development(7)
to suggest "apropos ." instead.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agodb show thread: avoid overflow in tick conversion
rlibby [Thu, 16 May 2019 05:29:54 +0000 (05:29 +0000)]
db show thread: avoid overflow in tick conversion

The previous calculations for displaying the time since last switch
easily overflowed, after less than 36 min for hz=1000.  Now overflow
takes 2000 times longer (as long as ticks takes to wrap).

Reviewed by: cem, markj
Sponsored by: Dell EMC Isilon
Differential revision: https://reviews.freebsd.org/D20273

5 years agoiommu static analysis cleanup
rlibby [Thu, 16 May 2019 04:24:08 +0000 (04:24 +0000)]
iommu static analysis cleanup

A static analyzer complained about a couple instances of checking a
variable against NULL after already having dereferenced it.
 - dmar_gas_alloc_region: remove the tautological NULL checks
 - dmar_release_resources / dmar_fini_fault_log: don't deref unit->regs
   unless initialized.

And while here, fix an inverted initialization check in dmar_fini_qi.

Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential revision: https://reviews.freebsd.org/D20263

5 years agoThe driver list prints "(null)" for the NDIS driver when -h (help) or
cy [Thu, 16 May 2019 02:41:25 +0000 (02:41 +0000)]
The driver list prints "(null)" for the NDIS driver when -h (help) or
an unknown switch is passed outputting the command usage. This is
because the NDIS driver is uninitialized when usage help is printed.
To resolve this we initialize the driver prior to the possibility of
printing the usage help message.

Obtained from: The wpa_supplicant port
MFC after: 1 week