]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoEnable ArmadaXP using INTRNG interrupt controller
mw [Tue, 3 Apr 2018 21:17:19 +0000 (21:17 +0000)]
Enable ArmadaXP using INTRNG interrupt controller

Defining INTRNG remove some necessary registers and declarations of
pic_init_secondary, pic_ipi_send, pic_ipi_read and pic_ipi_clear.
Because Marvell ArmadaXP and Armada38X always use INTRNG, include all
INTRNG code and remove code that does not use it.
Separate pic registers declarations for Armada38X are unnecessary, it
works properly with ArmadaXP config.

Submitted by: Rafal Kozik <rk@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14734

6 years ago9434 Speculative prefetch is blocked by device removal code.
mav [Tue, 3 Apr 2018 21:16:41 +0000 (21:16 +0000)]
9434 Speculative prefetch is blocked by device removal code.

Device removal code does not set spa_indirect_vdevs_loaded for pools
that never experienced device removal.  At least one visual consequence
of it is completely blocked speculative prefetcher.  This patch sets
the variable in such situations.

6 years agoAdd the etdump utility for dumping El Torito boot catalog information.
benno [Tue, 3 Apr 2018 21:08:10 +0000 (21:08 +0000)]
Add the etdump utility for dumping El Torito boot catalog information.

This can be used to check existing images but will be used in the future to
find EFI ESP images placed in El Torito catalogs so they can be used for
hybrid boot purposes.

Reviewed by: imp (code), sbruno (man page), bcr (man page)
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14952

6 years agoRemove redundant check.
cy [Tue, 3 Apr 2018 20:59:46 +0000 (20:59 +0000)]
Remove redundant check.

Reported by: kib@
MFC after: 2 weeks
X-MFC with: r331936
Differential Revision: https://reviews.freebsd.org/D12785

6 years agoThe correct symbol version for FreeBSD 12 is 1.5.
cy [Tue, 3 Apr 2018 20:53:53 +0000 (20:53 +0000)]
The correct symbol version for FreeBSD 12 is 1.5.

Reported by: kib@
MFC after: 2 weeks
X-MFC with: r331936
Differential Revision: https://reviews.freebsd.org/D12785

6 years agoCorrect the version number for gets_s(3).
cy [Tue, 3 Apr 2018 20:38:25 +0000 (20:38 +0000)]
Correct the version number for gets_s(3).

Reported by: kib@
MFC after: 2 weeks
X-MFC with: r331936
Differential Revision: https://reviews.freebsd.org/D12785

6 years agoInclude update to stdio.h missed in r331936.
cy [Tue, 3 Apr 2018 20:14:37 +0000 (20:14 +0000)]
Include update to stdio.h missed in r331936.

In my attempt to limit the commit in r331936 to only the gets_s()
commit and not include unrelated patches in my tree, this patch
was missed.

Reported by: pfg
MFC after: 2 weeks
X-MFC with: r331936
Differential Revision: https://reviews.freebsd.org/D12785

6 years agoAdd gets_s(3) to the man page title (noticed by ed@).
cy [Tue, 3 Apr 2018 19:51:23 +0000 (19:51 +0000)]
Add gets_s(3) to the man page title (noticed by ed@).

While I'm at it correct the update date in the man page.

Reported by: ed@
MFC after: 2 weeks
X-MFC with: r331936
Differential Revision: https://reviews.freebsd.org/D12785

6 years agoAdd new gets_s(3) stdio function.
cy [Tue, 3 Apr 2018 18:52:38 +0000 (18:52 +0000)]
Add new gets_s(3) stdio function.

This implements the gets_s(3) function as documented at
http://en.cppreference.com/w/c/io/gets. It facilitates the
optional removal of gets(3).

Reviewed by: ed
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D12785

6 years agovtfontcvt: allow .bdf characters less than full height
emaste [Tue, 3 Apr 2018 18:43:00 +0000 (18:43 +0000)]
vtfontcvt: allow .bdf characters less than full height

Sponsored by: The FreeBSD Foundation

6 years agoWrap long lines.
markj [Tue, 3 Apr 2018 18:41:27 +0000 (18:41 +0000)]
Wrap long lines.

MFC after: 3 days

6 years agofix i386 build with CPU_ELAN (LINT for instance) after r331878
avg [Tue, 3 Apr 2018 17:16:06 +0000 (17:16 +0000)]
fix i386 build with CPU_ELAN (LINT for instance) after r331878

x86/cpu_machdep.c now needs to include elan_mmcr.h when CPU_ELAN is set.
While here, also remove the now unneeded inclusion of isareg.h in i386
and amd64 vm_machdep.c.

Reported by: lwhsu
MFC after: 14 days
X-MFC with: r331878

6 years agor330675 introduced an extra window check in the LRO code to ensure it
jtl [Tue, 3 Apr 2018 13:54:38 +0000 (13:54 +0000)]
r330675 introduced an extra window check in the LRO code to ensure it
captured and reported the highest window advertisement with the same
SEQ/ACK.  However, the window comparison uses modulo 2**16 math, rather
than directly comparing the absolute values.  Because windows use
absolute values and not modulo 2**16 math (i.e. they don't wrap), we
need to compare the absolute values.

Reviewed by: gallatin
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D14937

6 years agoRemove fdt_is_enabled, fdt_reg_to_rl, and fdt_get_unit. These are not used
andrew [Tue, 3 Apr 2018 13:30:40 +0000 (13:30 +0000)]
Remove fdt_is_enabled, fdt_reg_to_rl, and fdt_get_unit. These are not used
by anything in the tree.

Sponsored by: DARPA, AFRL

6 years agoSwitch users of fdt_is_enabled to use ofw_bus_node_status_okay. These are
andrew [Tue, 3 Apr 2018 11:01:50 +0000 (11:01 +0000)]
Switch users of fdt_is_enabled to use ofw_bus_node_status_okay. These are
equivalent, so to prepare to remove the former move users to call the
latter.

Sponsored by: DARPA, AFRL

6 years agofix signatures of cpu_reset_real and cpu_reset_proxy, broken in r331878
avg [Tue, 3 Apr 2018 06:46:26 +0000 (06:46 +0000)]
fix signatures of cpu_reset_real and cpu_reset_proxy, broken in r331878

When I moved these functions from i386 and amd64 to x86 I dropped their
prototype declarations (that were correct) and left only their definitions
that became incorrect.

Reported by: bde
MFC after: 15 days
X-MFC with: r331878

6 years agoFix accidental USB port resets by GPIO on Zynq/Zedboard boards
gonzo [Tue, 3 Apr 2018 04:31:54 +0000 (04:31 +0000)]
Fix accidental USB port resets by GPIO on Zynq/Zedboard boards

The Zynq/Zedboard GPIO driver attempts to tri-state all GPIO pins on
boot up but the order in which I reset the hardware can cause the pins
to be briefly held low before being tri-stated.  This is a problem on
boards that use GPIO pins to reset devices.

In particular, the Zybo and ZC-706 boards use a GPIO pin as a USB PHY
reset.  If U-boot enables the USB port before booting the kernel, the
GPIO driver attach causes a glitch on the USB PHY reset and the USB
port loses power.  My fix is to have the GPIO driver leave the pins in
whatever configuration U-boot placed them.

PR: 225713
Submitted by: Thomas Skibo <thoma555-bsd@yahoo.com>
MFC after: 1 week

6 years agoDefault loader.conf: Drop efi_max_resolution to 1x1
kevans [Tue, 3 Apr 2018 02:41:32 +0000 (02:41 +0000)]
Default loader.conf: Drop efi_max_resolution to 1x1

Effectively disabling the mode changing bits in the loader. No matter which
way we go with it, it seems to be wrong- either the firmware doesn't change
the resolution and reports the resolution we requested, or the firmware
changes the resolution and doesn't report the resolution we requested. It
some cases, it does the right thing, but the bad cases outweight those.

Interested individuals can still set efi_max_resolution to 1080p or whatnot
in loader.conf(5) to restore the new behavior, but the new behavior does not
work out well for many cases.

Discussed with: imp

6 years agocxgbe: Implement tcp_info handler for connections handled by t4_tom.
np [Tue, 3 Apr 2018 01:22:15 +0000 (01:22 +0000)]
cxgbe: Implement tcp_info handler for connections handled by t4_tom.

The TCB is read using a memory window right now.  A better alternate to
get self-consistent, uncached information would be to use a GET_TCB
request but waiting for a reply from hw while holding non-sleepable
locks is quite inconvenient.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D14817

6 years agoAdd a hook to allow the toedev handling an offloaded connection to
np [Tue, 3 Apr 2018 01:08:54 +0000 (01:08 +0000)]
Add a hook to allow the toedev handling an offloaded connection to
provide accurate TCP_INFO.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D14816

6 years agoAdd support for a pmap direct map for 64-bit Book-E
jhibbits [Tue, 3 Apr 2018 00:45:38 +0000 (00:45 +0000)]
Add support for a pmap direct map for 64-bit Book-E

As with AIM64, map the DMAP at the beginning of the fourth "quadrant" of
memory, and move the KERNBASE to the the start of KVA.

Eventually we may run the kernel out of the DMAP, but for now, continue
booting as it has been.

6 years agoImport CK as of commit b19ed4c6a56ec93215ab567ba18ba61bf1cfbac8
cognet [Mon, 2 Apr 2018 23:40:50 +0000 (23:40 +0000)]
Import CK as of commit b19ed4c6a56ec93215ab567ba18ba61bf1cfbac8
It should fix ck_pr_[load|store]_ptr on mips and riscv, make sure no
*fence instructions are used on i386, as older cpus don't support it, and
make sure we don't rely on gcc builtins that can lead to calls to
libatomic when linked with -O0.

MFC after: 1 week

6 years agoFix formatting in snd_hda.4
bjk [Mon, 2 Apr 2018 22:59:33 +0000 (22:59 +0000)]
Fix formatting in snd_hda.4

Submitted by: 0mp
Reviewed by: skreuzer
Differential Revision: https://reviews.freebsd.org/D14922

6 years agoBring some order to horizontal and vertical spacing in hier(7).
trasz [Mon, 2 Apr 2018 21:33:16 +0000 (21:33 +0000)]
Bring some order to horizontal and vertical spacing in hier(7).

MFC after: 2 weeks

6 years agoEnsure the background laundering threshold is positive after a scan.
markj [Mon, 2 Apr 2018 15:07:41 +0000 (15:07 +0000)]
Ensure the background laundering threshold is positive after a scan.

The division added in r331732 meant that we wouldn't attempt a
background laundering until at least v_free_target - v_free_min clean
pages had been freed by the page daemon since the last laundering. If
the inactive queue is depleted but not completely empty (e.g., because
it contains busy pages), it can thus take a long time to meet this
threshold. Restore the pre-r331732 behaviour of using a non-zero
background laundering threshold if at least one inactive queue scan has
elapsed since the last attempt at background laundering.

Submitted by: tijl (original version)

6 years agounify amd64 and i386 cpu_reset() in x86/cpu_machdep.c
avg [Mon, 2 Apr 2018 13:45:23 +0000 (13:45 +0000)]
unify amd64 and i386 cpu_reset() in x86/cpu_machdep.c

Because I didn't see any reason not too.
I've been making some changes to the code and couldn't help but notice
that the i386 and am64 code was nearly identical.

MFC after: 17 days

6 years agoAdd the missing header for malloc(9). It was pulled in through header
andrew [Mon, 2 Apr 2018 13:36:48 +0000 (13:36 +0000)]
Add the missing header for malloc(9). It was pulled in through header
pollution that doesn't seem to exist in some configurations.

6 years agox86 cpu_reset: if failed to switch to BSP proceed to cpu_reset_real
avg [Mon, 2 Apr 2018 08:06:18 +0000 (08:06 +0000)]
x86 cpu_reset: if failed to switch to BSP proceed to cpu_reset_real

If cpu_reset() is called on an AP and if it somehow fails to wake the
BSP, then it's better to attempt the reset on the AP than just sit there
spinning on an unusable and undebuggable system.

MFC after: 16 days

6 years agox86 cpu_reset_proxy: no need to stop_cpus() the original processor
avg [Mon, 2 Apr 2018 07:45:13 +0000 (07:45 +0000)]
x86 cpu_reset_proxy: no need to stop_cpus() the original processor

The processor is "parked" in a spin-loop already and that's sufficient
for the reset.  There is nothing that stop_cpus() would add here, only
extra complexity and fragility.
The original processor does not need to enable interrupts now, in fact,
it must not do that.

MFC after: 2 weeks

6 years agoUse UMA_SLAB_SPACE macro. No functional change here.
glebius [Mon, 2 Apr 2018 05:15:25 +0000 (05:15 +0000)]
Use UMA_SLAB_SPACE macro. No functional change here.

6 years agoIn uma_startup_count() handle special case when zone will fit into
glebius [Mon, 2 Apr 2018 05:14:31 +0000 (05:14 +0000)]
In uma_startup_count() handle special case when zone will fit into
single slab, but with alignment adjustment it won't. Again, when
there is only one item in a slab alignment can be ignored. See
previous revision of this file for more info.

PR: 227116

6 years agoHandle a special case when a slab can fit only one allocation,
glebius [Mon, 2 Apr 2018 05:11:59 +0000 (05:11 +0000)]
Handle a special case when a slab can fit only one allocation,
and zone has a large alignment. With alignment taken into
account uk_rsize will be greater than space in a slab. However,
since we have only one item per slab, it is always naturally
aligned.

Code that will panic before this change with 4k page:

z = uma_zcreate("test", 3984, NULL, NULL, NULL, NULL, 31, 0);
uma_zalloc(z, M_WAITOK);

A practical scenario to hit the panic is a machine with 56 CPUs
and 2 NUMA domains, which yields in zone size of 3984.

PR: 227116
MFC after: 2 weeks

6 years agoFix the build on arches with default unsigned char. Capture the fubyte()
ian [Sun, 1 Apr 2018 18:53:27 +0000 (18:53 +0000)]
Fix the build on arches with default unsigned char.  Capture the fubyte()
return value in an int as well as the char, and test the full int value
for fubyte() failure.

6 years agoAdd opt_platform.h for several modules that have #ifdef FDT in the source.
ian [Sun, 1 Apr 2018 18:22:24 +0000 (18:22 +0000)]
Add opt_platform.h for several modules that have #ifdef FDT in the source.

Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com>

6 years agoAdd a uma cache of free pages in the DEFAULT freepool. This gives us
jeff [Sun, 1 Apr 2018 04:50:05 +0000 (04:50 +0000)]
Add a uma cache of free pages in the DEFAULT freepool.  This gives us
per-cpu alloc and free of pages.  The cache is filled with as few trips
to the phys allocator as possible by the use of a new
vm_phys_alloc_npages() function which allocates as many as N pages.

This code was originally by markj with the import function rewritten by
me.

Reviewed by: markj, kib
Tested by: pho
Sponsored by: Netflix, Dell/EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14905

6 years agoAdd the flag ZONE_NOBUCKETCACHE. This flag instructions UMA not to keep
jeff [Sun, 1 Apr 2018 04:47:05 +0000 (04:47 +0000)]
Add the flag ZONE_NOBUCKETCACHE.  This flag instructions UMA not to keep
a cache of fully populated buckets.  This will be used in a follow-on
commit.

The flag idea was originally from markj.

Reviewed by: markj, kib
Tested by: pho
Sponsored by: Netflix, Dell/EMC Isilon

6 years agolualoader: Don't try to lookup a nil logo
kevans [Sun, 1 Apr 2018 01:21:00 +0000 (01:21 +0000)]
lualoader: Don't try to lookup a nil logo

6 years agolualoader: Split logodefs out into logo-* files
kevans [Sun, 1 Apr 2018 01:07:15 +0000 (01:07 +0000)]
lualoader: Split logodefs out into logo-* files

This commit splits all of the logodefs/graphics out into their own own files
and provides a method for these files to register their logodefs with the
drawer. Graphics are now loaded on demand if they don't exist in the current
set of logodefs.

The drawer module becomes a little easier to navigate through without all of
the graphics mixed in. It's also easy to do one-off graphics like the
9.2 Die Hard tribute by dteske@ without adding even more to our memory
requirements.

6 years agoThe Uninorth ID was really for Uninorth 2.
imp [Sun, 1 Apr 2018 00:25:47 +0000 (00:25 +0000)]
The Uninorth ID was really for Uninorth 2.

Submitted by: Sevan Janiyan
Differential Revision: https://reviews.freebsd.org/D14919

6 years agolualoader: Simplify some expressions
kevans [Sun, 1 Apr 2018 00:22:51 +0000 (00:22 +0000)]
lualoader: Simplify some expressions

- No need for a 'goto' when our entire loop body is then wrapped in a
  conditional.

- No need to leave commented out prints laying around

- If an expression is clearly going to be either nil or an expression that
  isn't likely to be a boolean, we might as well use `or` to specify a
  default value for the expression. e.g. `loader.getenv(...) or "no"`

6 years agolualoader: revert whitespace change that snuck in
kevans [Sat, 31 Mar 2018 23:50:20 +0000 (23:50 +0000)]
lualoader: revert whitespace change that snuck in

6 years agolualoader: Don't assume that {module}_load is set
kevans [Sat, 31 Mar 2018 23:49:00 +0000 (23:49 +0000)]
lualoader: Don't assume that {module}_load is set

The previous iteration of this assumed that {module}_load was set. In the
old world order of default loader.conf(5), this was probably a safe
assumption given that we had almost every module explicitly not-loaded in
it.

In the new world order, this is no longer the case, so one could delete a
_load line inadvertently while leaving a _name, _type, _flags, _before,
_after, or _error. This would have caused a confusing Lua error and borked
module loading.

6 years agolualoader: Do case-insensitive comparison of "yes"
kevans [Sat, 31 Mar 2018 23:40:05 +0000 (23:40 +0000)]
lualoader: Do case-insensitive comparison of "yes"

6 years agoDon't verify td_locks accounting after a panic.
markj [Sat, 31 Mar 2018 23:24:28 +0000 (23:24 +0000)]
Don't verify td_locks accounting after a panic.

Reported by: pho
X-MFC with: r331738

6 years agofwohcireg.h is 99% the same between the boot loader and the
imp [Sat, 31 Mar 2018 22:02:59 +0000 (22:02 +0000)]
fwohcireg.h is 99% the same between the boot loader and the
kernel. Delete it and fix up the 1% difference because there's no need
for them to be different.

6 years agoFix memory leaks in route(8).
melifaro [Sat, 31 Mar 2018 15:06:14 +0000 (15:06 +0000)]
Fix memory leaks in route(8).

Submitted by: Tom Rix (trix_juniper.net)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9676

6 years agoSynchronise with NetBSD's version of EFI handling for El Torito images.
benno [Sat, 31 Mar 2018 15:04:41 +0000 (15:04 +0000)]
Synchronise with NetBSD's version of EFI handling for El Torito images.

When I implemented my EFI support I failed to check if the upstream version
of makefs in NetBSD had done the same. Override my version with theirs to
make it easier to stay in sync with them in the future.

Reviewed by: imp, mav
Obtained from: NetBSD
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14913

6 years agoRemove MK_AUTO_OBJ from env passed to PORTS_MODULES
jah [Sat, 31 Mar 2018 05:17:12 +0000 (05:17 +0000)]
Remove MK_AUTO_OBJ from env passed to PORTS_MODULES

This fixes a failure to resolve object file paths seen when buildkernel
(which sets MK_AUTO_OBJ=yes) and installkernel (which sets MK_AUTO_OBJ=no)
are run as separate steps.  r329232 partially fixed this scenario by removing
MAKEOBJDIR, but it seems the AUTO_OBJ setting also needs to be on the same
page for the build and install steps.

Reviewed by: bdrewery
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D14143

6 years agoDocument and enforce assumptions about struct (in6_)ifreq.
brooks [Fri, 30 Mar 2018 21:38:53 +0000 (21:38 +0000)]
Document and enforce assumptions about struct (in6_)ifreq.

- The two types must be type-punnable for shared members of ifr_ifru.
  This allows compatibility accessors to be shared.

- There must be no padding gap between ifr_name and ifr_ifru.  This is
  assumed in tcpdump's use of SIOCGIFFLAGS output which attempts to be
  broadly portable.  This is true for all current architectures, but very
  large (256-bit) fat-pointers could violate this invariant.

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

6 years agoAdd deprecation notices for Arcnet and FDDI drivers.
brooks [Fri, 30 Mar 2018 20:27:47 +0000 (20:27 +0000)]
Add deprecation notices for Arcnet and FDDI drivers.

We intend to remove support before FreeBSD 12 is branched.

Reviewed by: imp, emaste
MFC after: 3 days
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14890

6 years agoFall back to ether_ioctl() by default.
brooks [Fri, 30 Mar 2018 20:24:29 +0000 (20:24 +0000)]
Fall back to ether_ioctl() by default.

The common pratice in ethernet device drivers is to fall back to
ether_ioctl() to implement generic ioctls not implemented by the driver
and to fail if no handler exists.

Convert these drivers to follow that practice rather than calling
ether_ioctl() for specific cases.

vxge(4) aready had the default case, but it was only called on failure
to match.

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

6 years agoOptimise use of Giant in the LinuxKPI.
hselasky [Fri, 30 Mar 2018 20:11:12 +0000 (20:11 +0000)]
Optimise use of Giant in the LinuxKPI.

- Make sure Giant is locked when calling PCI device methods.
Newbus currently requires this.

- Avoid unlocking Giant right before aquiring the sleepqueue lock.
This can save a task switch.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoRemove unused structure field in mlx5core.
hselasky [Fri, 30 Mar 2018 19:58:58 +0000 (19:58 +0000)]
Remove unused structure field in mlx5core.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoBump mlx5core driver version.
hselasky [Fri, 30 Mar 2018 19:55:31 +0000 (19:55 +0000)]
Bump mlx5core driver version.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoFix for use after free in mlx5core.
hselasky [Fri, 30 Mar 2018 19:50:45 +0000 (19:50 +0000)]
Fix for use after free in mlx5core.

Make sure the command completion handler is not called when the device is
in internal error state. This can easily trigger use after free situations.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoMake sure Giant is locked when allocating bus resources in mlx5core.
hselasky [Fri, 30 Mar 2018 19:49:35 +0000 (19:49 +0000)]
Make sure Giant is locked when allocating bus resources in mlx5core.

During health care IRQ resources will be reallocated.
Newbus requires that Giant is locked before accessing
these resources.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoCollect firmware dump when mlx5core is in device error state.
hselasky [Fri, 30 Mar 2018 19:48:25 +0000 (19:48 +0000)]
Collect firmware dump when mlx5core is in device error state.

Firmware dump collecting should be triggered in case firmware syndrome
with request for reset bit is set.

MFC after: 3 days
Submitted by: slavash@
Sponsored by: Mellanox Technologies

6 years agoReorganize health recovery in mlx5core.
hselasky [Fri, 30 Mar 2018 19:45:48 +0000 (19:45 +0000)]
Reorganize health recovery in mlx5core.

- Move the semaphore locking and unlocking to the same function.
- Flags are no longer needed if the reset and crdump will be done in the
  same function.

MFC after: 3 days
Submitted by: slavash@
Sponsored by: Mellanox Technologies

6 years agoPrepare for FW dump in error state in mlx5core.
hselasky [Fri, 30 Mar 2018 19:43:15 +0000 (19:43 +0000)]
Prepare for FW dump in error state in mlx5core.

- Move firmware dump prep and cleanup to init_one() and remove_one() so that
the init and cleanup will happen only upon driver reload.
- Add some prints to indicate firmware dump.

MFC after: 3 days
Submitted by: slavash@
Sponsored by: Mellanox Technologies

6 years agoProperly check if crspace is supported in mlx5core.
hselasky [Fri, 30 Mar 2018 19:39:27 +0000 (19:39 +0000)]
Properly check if crspace is supported in mlx5core.

The old code checked for MLX5_CR_SPACE_DOMAIN which is irrelevant here.
However, if dev->vsec_addr would be 0, an access to wrong offset would
happen.

MFC after: 3 days
Submitted by: slavash@
Sponsored by: Mellanox Technologies

6 years agoAdd missing newline character in print in mlx5core.
hselasky [Fri, 30 Mar 2018 19:35:31 +0000 (19:35 +0000)]
Add missing newline character in print in mlx5core.

MFC after: 3 days
Submitted by: slavash@
Sponsored by: Mellanox Technologies

6 years agoAdd logic for "families" for GCE images.
gjb [Fri, 30 Mar 2018 19:08:37 +0000 (19:08 +0000)]
Add logic for "families" for GCE images.

This allows for GCE consumers to easily detect the latest major
version of FreeBSD when using the gcloud command line utility.

To ensure snapshot builds do not conflict with release-style
builds (ALPHA, BETA, RC, RELEASE), the '-snap' suffix is appended
to the GCE image family name.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoUse an accessor function to access ifr_data.
brooks [Fri, 30 Mar 2018 18:50:13 +0000 (18:50 +0000)]
Use an accessor function to access ifr_data.

This fixes 32-bit compat (no ioctl command defintions are required
as struct ifreq is the same size).  This is believed to be sufficent to
fully support ifconfig on 32-bit systems.

Reviewed by: kib
Obtained from: CheriBSD
MFC after: 1 week
Relnotes: yes
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14900

6 years agoRemove a comment that suggests checking that a non-pointer is non-NULL.
brooks [Fri, 30 Mar 2018 18:26:29 +0000 (18:26 +0000)]
Remove a comment that suggests checking that a non-pointer is non-NULL.

Reviewed by: melifaro, markj, hrs, ume
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14904

6 years agoocs_fc(4): Fix GCC build (-Wredundant-decls)
cem [Fri, 30 Mar 2018 16:44:54 +0000 (16:44 +0000)]
ocs_fc(4): Fix GCC build (-Wredundant-decls)

These objects are defined earlier in the same file; an extern declaration
after definition is redundant.

Broken in r331766 (introduction of ocs_fc(4)).

Sponsored by: Dell EMC Isilon

6 years agoefinet: Do not return only if ReceiveFilter fails
manu [Fri, 30 Mar 2018 16:37:08 +0000 (16:37 +0000)]
efinet: Do not return only if ReceiveFilter fails

If the network interface or the uefi implementation do not support the
ReceiveFilter interface do not return only and just print a message.
U-Boot doesn't support is and likely never will. Also even if this fails
it doesn't mean that network in EFI isn't supported.

6 years agoBring in the Broadcom/Emulex Fibre Channel driver, ocs_fc(4).
ken [Fri, 30 Mar 2018 15:28:25 +0000 (15:28 +0000)]
Bring in the Broadcom/Emulex Fibre Channel driver, ocs_fc(4).

The ocs_fc(4) driver supports the following hardware:

Emulex 16/8G FC GEN 5 HBAS
LPe15004 FC Host Bus Adapters
LPe160XX FC Host Bus Adapters

Emulex 32/16G FC GEN 6 HBAS
LPe3100X FC Host Bus Adapters
LPe3200X FC Host Bus Adapters

The driver supports target and initiator mode, and also supports FC-Tape.

Note that the driver only currently works on little endian platforms.  It
is only included in the module build for amd64 and i386, and in GENERIC
on amd64 only.

Submitted by: Ram Kishore Vegesna <ram.vegesna@broadcom.com>
Reviewed by: mav
MFC after: 5 days
Relnotes: yes
Sponsored by: Broadcom
Differential Revision: https://reviews.freebsd.org/D11423

6 years agoFix missing n after \ of Eric Turgeon entry
ericbsd [Fri, 30 Mar 2018 14:41:16 +0000 (14:41 +0000)]
Fix missing n after \ of Eric Turgeon entry

Approved by: bapt (mentor)

6 years agoAdding Eric Turgeon (ericbsd) to calendar.freebsd
ericbsd [Fri, 30 Mar 2018 13:37:33 +0000 (13:37 +0000)]
Adding Eric Turgeon (ericbsd) to calendar.freebsd

Approved by: bapt (mentor)

6 years agoAdd Eric Turgeon (ericbsd) in committers-ports.dot with mentor/mentee.
ericbsd [Fri, 30 Mar 2018 11:30:48 +0000 (11:30 +0000)]
Add Eric Turgeon (ericbsd) in committers-ports.dot with mentor/mentee.

Approved by: bapt (mentor)

6 years agoalign i386 cpu_reset() with amd64 version
avg [Fri, 30 Mar 2018 11:25:30 +0000 (11:25 +0000)]
align i386 cpu_reset() with amd64 version

Maybe this code could be moved to x86.

MFC after: 1 week

6 years agoMake vm_map_max/min/pmap KBI stable.
kib [Fri, 30 Mar 2018 10:55:31 +0000 (10:55 +0000)]
Make vm_map_max/min/pmap KBI stable.

There are out of tree consumers of vm_map_min() and vm_map_max(), and
I believe there are consumers of vm_map_pmap(), although the later is
arguably less in the need of KBI-stable interface. For the consumers
benefit, make modules using this KPI not depended on the struct vm_map
layout.

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

6 years agomakefs: sync fragment and block size with newfs
emaste [Fri, 30 Mar 2018 03:38:08 +0000 (03:38 +0000)]
makefs: sync fragment and block size with newfs

r222319 in newfs raised the default blocksize for UFS/FFS filesystems
from 16K to 32K and the default fragment size from 2K to 4K, with a
rationale that most disks were now running with 4K sectors.

MFC after: 2 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

6 years agoCorrect comment typo in Hyper-V
emaste [Fri, 30 Mar 2018 02:25:12 +0000 (02:25 +0000)]
Correct comment typo in Hyper-V

PR: 226665
Submitted by: Ryo ONODERA
MFC after: 3 days

6 years agobhnd(4): Use the new BHND_CAP_BP64 capability flag to exclude DMA
landonf [Thu, 29 Mar 2018 19:48:50 +0000 (19:48 +0000)]
bhnd(4): Use the new BHND_CAP_BP64 capability flag to exclude DMA
translations unsupported by the backplane.

6 years agoFix RSS build (broken in r331309).
np [Thu, 29 Mar 2018 19:48:17 +0000 (19:48 +0000)]
Fix RSS build (broken in r331309).

Sponsored by: Chelsio Communications

6 years agobhnd(4): include a subset of the ChipCommon capability flags in bhnd_chipid;
landonf [Thu, 29 Mar 2018 19:44:15 +0000 (19:44 +0000)]
bhnd(4): include a subset of the ChipCommon capability flags in bhnd_chipid;
this provides early access to device capability flags required by bhnd(4)
bus and bhndb(4) bridge drivers.

6 years agoAdd libdl to clibs package
kevans [Thu, 29 Mar 2018 19:43:29 +0000 (19:43 +0000)]
Add libdl to clibs package

libdl is a filter on libc, and pretty lightweight. Add it to the 'clibs'
package with libc, effectively tying them together in a pkgbase world.

Reviewed by: gjb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D13997

6 years agoIt is March not May.
brooks [Thu, 29 Mar 2018 17:44:55 +0000 (17:44 +0000)]
It is March not May.

Reported by: jkim

6 years ago1. Add additional debug prints.
davidcs [Thu, 29 Mar 2018 17:36:34 +0000 (17:36 +0000)]
1. Add additional debug prints.
2. Break transmit when IFF_DRV_RUNNING is OFF.
3. set desc_count=0 for default case in switch in ql_rcv_isr()
MFC after:5 days

6 years agoHave TD_LOCKS_DEC() assert that td_locks is positive.
markj [Thu, 29 Mar 2018 17:19:59 +0000 (17:19 +0000)]
Have TD_LOCKS_DEC() assert that td_locks is positive.

This makes it easier to catch lock accounting bugs, since the problem
is otherwise only detected upon a return to user mode (or never, for
kernel threads).

Reviewed by: cem
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14896

6 years agoGC never enabled support for SIOCGADDRROM and SIOCGCHIPID.
brooks [Thu, 29 Mar 2018 15:58:49 +0000 (15:58 +0000)]
GC never enabled support for SIOCGADDRROM and SIOCGCHIPID.

When de(4) was imported in 1997 the world was not ready for these ioctls.
In over 20 years that hasn't changed so it seems safe to assume their
time will never come.

Reviewed by: imp, jhb
Approved by: CheriBSD
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14889

6 years agoFix the background laundering mechanism after r329882.
markj [Thu, 29 Mar 2018 14:27:40 +0000 (14:27 +0000)]
Fix the background laundering mechanism after r329882.

Rather than using the number of inactive queue scans as a metric for
how many clean pages are being freed by the page daemon, have the
page daemon keep a running counter of the number of pages it has freed,
and have the laundry thread use that when computing the background
laundering threshold.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D14884

6 years agoPull in r328738 from upstream lld trunk (by Rafael Espindola):
dim [Thu, 29 Mar 2018 13:55:23 +0000 (13:55 +0000)]
Pull in r328738 from upstream lld trunk (by Rafael Espindola):

  Strip @VER suffices from the LTO output.

  This fixes pr36623.

  The problem is that we have to parse versions out of names before LTO
  so that LTO can use that information.

  When we get the LTO produced .o files, we replace the previous symbols
  with the LTO produced ones, but they still have @ in their names.

  We could just trim the name directly, but calling parseSymbolVersion
  to do it is simpler.

This is a follow-up to r331366, since we discovered that lld could
append version strings to symbols twice, when using Link Time
Optimization.

MFC after: 3 months
X-MFC-With: r327952

6 years agocryptocheck: Add Chacha20 cipher to tool
cem [Thu, 29 Mar 2018 04:14:37 +0000 (04:14 +0000)]
cryptocheck: Add Chacha20 cipher to tool

6 years agocryptotest: Add chacha20 cipher
cem [Thu, 29 Mar 2018 04:07:53 +0000 (04:07 +0000)]
cryptotest: Add chacha20 cipher

6 years agoopencrypto: Integrate Chacha20 algorithm into OCF
cem [Thu, 29 Mar 2018 04:02:50 +0000 (04:02 +0000)]
opencrypto: Integrate Chacha20 algorithm into OCF

Mostly this is a thin shim around existing code to integrate with enc_xform
and cryptosoft (+ cryptodev).

Expand the cryptodev buffer used to match that of Chacha20's native block
size as a performance enhancement for chacha20_xform_crypt_multi.

6 years agoImplement several enhancements to NUMA policies.
jeff [Thu, 29 Mar 2018 02:54:50 +0000 (02:54 +0000)]
Implement several enhancements to NUMA policies.

Add a new "interleave" allocation policy which stripes pages across
domains with a stride or width keeping contiguity within a multi-page
region.

Move the kernel to the dedicated numbered cpuset #2 making it possible
to assign kernel threads and memory policy separately from user.  This
also eliminates the need for the complicated interrupt binding code.

Add a sysctl API for viewing and manipulating domainsets.  Refactor some
of the cpuset_t manipulation code using the generic bitset type so that
it can be used for both.  This probably belongs in a dedicated subr file.

Attempt to improve the include situation.

Reviewed by: kib
Discussed with: jhb (cpuset parts)
Tested by: pho (before review feedback)
Sponsored by: Netflix, Dell/EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14839

6 years agotimeout.1: Try to improve clarity
cem [Thu, 29 Mar 2018 02:13:58 +0000 (02:13 +0000)]
timeout.1: Try to improve clarity

Minor rewordings, markup fixes or enhancements, and some typo fixes.  Add a few
sentences clarifying the special zero duration.

PR: 227012
Submitted by: Mateusz Piotrowski (0mp@) (earlier version)

6 years agostand: Add workaround for HP BIOS issues
kevans [Thu, 29 Mar 2018 00:55:11 +0000 (00:55 +0000)]
stand: Add workaround for HP BIOS issues

hrs@ and kuriyama@ have found that on some HP BIOS, a system will fail to
boot immediately after installation with the claim that it can't work out
which disk they are booting from.

They tracked it down to a buffer overrun, and found that it could be
alleviated by doing a dummy read before-hand.

Submitted by: kuriyama
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14341

6 years agoReformat the enum of syscall argument types.
jhb [Thu, 29 Mar 2018 00:12:50 +0000 (00:12 +0000)]
Reformat the enum of syscall argument types.

List enum values on separate lines to minimize diffs as new types are
added.  Split the enum values up into groups and use some simple sorting
within groups (scalar enums are sorted by size, then base, all other
groups are generally sorted alphabetically).

No functional change.

6 years agoRename ClouduABIFDSFlags to CloudABIFDSFlags.
jhb [Thu, 29 Mar 2018 00:04:07 +0000 (00:04 +0000)]
Rename ClouduABIFDSFlags to CloudABIFDSFlags.

6 years agoRemove infrastructure for token-ring networks.
brooks [Wed, 28 Mar 2018 23:33:26 +0000 (23:33 +0000)]
Remove infrastructure for token-ring networks.

Reviewed by: cem, imp, jhb, jmallett
Relnotes: yes
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14875

6 years agoMFV r331712:
mav [Wed, 28 Mar 2018 23:17:29 +0000 (23:17 +0000)]
MFV r331712:
9280 Assertion failure while running removal_with_ganging test with 4K devices

illumos/illumos-gate@243952c7eeef020886e3e2e3df99a513df40584a

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Matt Ahrens <Matt.Ahrens@delphix.com>

6 years agoMFV 331710:
mav [Wed, 28 Mar 2018 23:05:48 +0000 (23:05 +0000)]
MFV 331710:
9188 increase size of dbuf cache to reduce indirect block decompression

illumos/illumos-gate@268bbb2a2fa79c36d4695d13a595ba50a7754b76

With compressed ARC (6950) we use up to 25% of our CPU to decompress indirect
blocks, under a workload of random cached reads. To reduce this decompression
cost, we would like to increase the size of the dbuf cache so that more
indirect blocks can be stored uncompressed.

If we are caching entire large files of recordsize=8K, the indirect blocks
use 1/64th as much memory as the data blocks (assuming they have the same
compression ratio). We suggest making the dbuf cache be 1/32nd of all memory,
so that in this scenario we should be able to keep all the indirect blocks
decompressed in the dbuf cache. (We want it to be more than the 1/64th that
the indirect blocks would use because we need to cache other stuff in the
dbuf cache as well.)

In real world workloads, this won't help as dramatically as the example
above, but we think it's still worth it because the risk of decreasing
performance is low. The potential negative performance impact is that we
will be slightly reducing the size of the ARC (by ~3%).

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Allan Jude <allanjude@freebsd.org>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: George Wilson <george.wilson@delphix.com>

6 years agoMFV r331708:
mav [Wed, 28 Mar 2018 22:50:05 +0000 (22:50 +0000)]
MFV r331708:
9321 arc_loan_compressed_buf() can increment arc_loaned_bytes by the wrong value

illumos/illumos-gate@9be12bd737714550277bd02b0c693db560976990

arc_loan_compressed_buf() increments arc_loaned_bytes by psize unconditionally
In the case of zfs_compressed_arc_enabled=0, when the buf is returned via
arc_return_buf(), if ARC_BUF_COMPRESSED(buf) is false, then arc_loaned_bytes
is decremented by lsize, not psize.

Switch to using arc_buf_size(buf), instead of psize, which will return
psize or lsize, depending on the result of ARC_BUF_COMPRESSED(buf).

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Allan Jude <allanjude@freebsd.org>

6 years agoMFV r331706:
mav [Wed, 28 Mar 2018 22:29:11 +0000 (22:29 +0000)]
MFV r331706:
9235 rename zpool_rewind_policy_t to zpool_load_policy_t

illumos/illumos-gate@5dafeea3ebd2dd77affc802bcb90f63faf01589f

We want to be able to pass various settings during import/open of a pool,
which are not only related to rewind. Instead of adding a new policy and
duplicate a bunch of code, we should just rename rewind_policy to a more
generic term like load_policy.

For instance, we'd like to set spa->spa_import_flags from the nvlist,
rather from a flags parameter passed to spa_import as in some cases we want
those flags not only for the import case, but also for the open case. One
such flag could be ZFS_IMPORT_MISSING_LOG (as used in zdb) which would
allow zfs to open a pool when logs are missing.

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

6 years agoMFV 331704:
mav [Wed, 28 Mar 2018 22:10:06 +0000 (22:10 +0000)]
MFV 331704:
9191 dump vdev tree to zfs_dbgmsg when spa load fails due to missing log devices

illumos/illumos-gate@ccef24b493bcbd146fcd6d8946666cae081470b6

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

6 years agoMFV 331702:
mav [Wed, 28 Mar 2018 22:07:31 +0000 (22:07 +0000)]
MFV 331702:
9187 racing condition between vdev label and spa_last_synced_txg in vdev_validate

illumos/illumos-gate@d1de72cfa29ab77ff80e2bb0e668a6afa5bccaf0

ztest failed with uncorrectable IO error despite having the fix for #7163.
Both sides of the mirror have CANT_OPEN_BAD_LABEL, which also distinguishes
it from that issue.

Definitely seems like a racing condition between the vdev_validate and spa_sync:
1. Thread A (spa_sync): vdev label is updated to latest txg
2. Thread B (vdev_validate): vdev label's txg is compared to spa_last_synced_txg and is ahead.
3. Thread A (spa_sync): spa_last_synced_txg is updated to latest txg.

Solution: do not check txg in vdev_validate unless config lock is held.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matt Ahrens <matthew.ahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

6 years agoMFV r331695, 331700: 9166 zfs storage pool checkpoint
mav [Wed, 28 Mar 2018 22:01:27 +0000 (22:01 +0000)]
MFV r331695, 331700: 9166 zfs storage pool checkpoint

illumos/illumos-gate@8671400134a11c848244896ca51a7db4d0f69da4

The idea of Storage Pool Checkpoint (aka zpool checkpoint) deals with
exactly that.  It can be thought of as a “pool-wide snapshot” (or a
variation of extreme rewind that doesn’t corrupt your data).  It remembers
the entire state of the pool at the point that it was taken and the user
can revert back to it later or discard it.  Its generic use case is an
administrator that is about to perform a set of destructive actions to ZFS
as part of a critical procedure.  She takes a checkpoint of the pool before
performing the actions, then rewinds back to it if one of them fails or puts
the pool into an unexpected state.  Otherwise, she discards it.  With the
assumption that no one else is making modifications to ZFS, she basically
wraps all these actions into a “high-level transaction”.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>