]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoForgotten part of r351137.
mav [Fri, 16 Aug 2019 20:30:31 +0000 (20:30 +0000)]
Forgotten part of r351137.

MFC after: 2 weeks

4 years agoNTB Tool: Test driver for NTB hardware drivers.
mav [Fri, 16 Aug 2019 20:14:37 +0000 (20:14 +0000)]
NTB Tool: Test driver for NTB hardware drivers.

NTB Tool driver is meant for testing NTB hardware driver functionalities,
such as doorbell interrupts, link events, scratchpad registers and memory
windows.  This is a port of ntb_tool driver from Linux.  It has been
verified on top of AMD and PLX NTB HW drivers.

Submitted by: Arpan Palit <arpan.palit@amd.com>
Cleaned up by: mav
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D18819

4 years agostand: gptboot: fix build with xtoolchain-llvm90
kevans [Fri, 16 Aug 2019 20:09:20 +0000 (20:09 +0000)]
stand: gptboot: fix build with xtoolchain-llvm90

ufsread.c grows a dependency on __ashldi3 with llvm90. For gptboot, just
start pulling in ashldi3.c ashrdi3.c lshrdi3.c into libsa for all archs as
the number of archs requiring one or more of them keeps growing. qdivrem.c
and quad.h can be trivially kicked out of libsa if we start pulling these
from compiler-rt as qdivrem was only used to implement umoddi3, divdi3,
moddi3 (also in qdivrem.c).

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21291

4 years agostand: boot2: fix build with xtoolchain-llvm90
kevans [Fri, 16 Aug 2019 20:07:43 +0000 (20:07 +0000)]
stand: boot2: fix build with xtoolchain-llvm90

ufsread.c grows a dependency on __ashldi3 with llvm90. Grab ashldi3.c out of
compiler-rt rather than trying to link against libsa (for now).
-Wno-missing-prototypes is necessary to compile ashldi3.c standalone.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21291

4 years agoAdd support for 'j', 't' and 'z' flags to kernel sscanf().
mav [Fri, 16 Aug 2019 19:46:22 +0000 (19:46 +0000)]
Add support for 'j', 't' and 'z' flags to kernel sscanf().

MFC after: 2 weeks

4 years agoCheck paddr for overflow.
ray [Fri, 16 Aug 2019 19:27:05 +0000 (19:27 +0000)]
Check paddr for overflow.
Fix panic on initialize of "vm reserv" per-superpage lock in case when RAM ends at upper boundary of address space.
Observed on ARM32 board BPI-R2 (2GB RAM 0x80000000-0xffffffff).

PR: 235362
Reviewed by: kib, markj, alc
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D21272

4 years agomd(4): remove the unused and unusable MDIOCLIST ioctl.
brooks [Fri, 16 Aug 2019 18:57:32 +0000 (18:57 +0000)]
md(4): remove the unused and unusable MDIOCLIST ioctl.

It is unused, the ABI was broken in r322969, and it is broken by design
(more than MDNPAD md devices can exist and there is no way to retreive
them with this interface).

mdconfig(8) was converted to use libgeom to obtain this information
in r157160 and any other consumers of MDIOCLIST should likewise be
converted.

Reviewed by: emaste
Relnotes: yes
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18936

4 years agoaarch64: make pmap_change_attr public like on other platforms
emaste [Fri, 16 Aug 2019 18:21:31 +0000 (18:21 +0000)]
aarch64: make pmap_change_attr public like on other platforms

Submitted by: Greg V <greg@unrelenting.technology>
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D20787

4 years agoarm64: mv: a37x0_gpio: Set the memory to SHAREABLE
manu [Fri, 16 Aug 2019 17:10:38 +0000 (17:10 +0000)]
arm64: mv: a37x0_gpio: Set the memory to SHAREABLE

Since r349596 the syscon driver will map the memory. Since the gpio/pinctrl
controller wants it too set it to SHAREABLE.
This fix the gpio controller for attaching and so consumer can use it.
Now the sdhci_xenon driver can detect presence of an sdcard and attach
the mmc driver.

MFC after: 1 week

4 years agofdt: simple-mfd: Set the syscon memory to SHAREABLE
manu [Fri, 16 Aug 2019 17:08:06 +0000 (17:08 +0000)]
fdt: simple-mfd: Set the syscon memory to SHAREABLE

Since syscon is usually used with another compatible string (and so
another driver), this driver might want to map the memory too.

MFC after: 1 week

4 years agoAdd @generated tag to libc syscall asm wrappers
emaste [Fri, 16 Aug 2019 14:14:57 +0000 (14:14 +0000)]
Add @generated tag to libc syscall asm wrappers

Although libc syscall wrappers do not get checked in this can aid in
finding the source of generated files when spelunking in the objdir.

Multiple tools use @generated to identify generated files (for example,
in a review Phabricator will by default hide diffs in generated files).
For consistency use the @generated tag in makesyscalls.sh as we've done
for other generated files, even though these wrappers aren't checked in
to the tree.

4 years agoarch.7: indicate expectation that arm (i.e., v5) will be removed before 13.0
emaste [Fri, 16 Aug 2019 14:06:04 +0000 (14:06 +0000)]
arch.7: indicate expectation that arm (i.e., v5) will be removed before 13.0

MFC after: 1 week

4 years agoRegen src.conf.5 after r351027 (enable BSD_CRTBEGIN on powerpc)
emaste [Fri, 16 Aug 2019 13:50:44 +0000 (13:50 +0000)]
Regen src.conf.5 after r351027 (enable BSD_CRTBEGIN on powerpc)

4 years agostand: push LIBC_SRC up into defs.mk
kevans [Fri, 16 Aug 2019 13:22:57 +0000 (13:22 +0000)]
stand: push LIBC_SRC up into defs.mk

Other parts of stand/ that don't use libsa will need to grab bits from libc
shortly. Push LIBC_SRC up to defs.mk in advance of this so that they can use
it, and rename it to LIBCSRC to match the convention of the rest of the *SRC
variables in this file.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21282

4 years agoUpdate pthread_cond_timedwait() test to current NetBSD
vangyzen [Fri, 16 Aug 2019 13:10:08 +0000 (13:10 +0000)]
Update pthread_cond_timedwait() test to current NetBSD

NetBSD adapted and committed our r350620.  Update to their version 1.8.

Reviewed by: ngie
Obtained from: NetBSD
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D21279

4 years agozpool-features.7: Fix a typo
0mp [Fri, 16 Aug 2019 10:43:23 +0000 (10:43 +0000)]
zpool-features.7: Fix a typo

Reported by: pstef
Reviewed by: pstef
Approved by: src (pstef)
Differential Revision: https://reviews.freebsd.org/D21290

4 years agoFix OOM handling of some corner cases.
kib [Fri, 16 Aug 2019 09:43:49 +0000 (09:43 +0000)]
Fix OOM handling of some corner cases.

In addition to pagedaemon initiating OOM, also do it from the
vm_fault() internals.  Namely, if the thread waits for a free page to
satisfy page fault some preconfigured amount of time, trigger OOM.
These triggers are rate-limited, due to a usual case of several
threads of the same multi-threaded process to enter fault handler
simultaneously.  The faults from pagedaemon threads participate in the
calculation of OOM rate, but are not under the limit.

Reviewed by: markj (previous version)
Tested by: pho
Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D13671

4 years agofusefs: don't send the namespace during listextattr
asomers [Fri, 16 Aug 2019 05:06:54 +0000 (05:06 +0000)]
fusefs: don't send the namespace during listextattr

The FUSE_LISTXATTR operation always returns the full list of a file's
extended attributes, in all namespaces. There's no way to filter the list
server-side. However, currently FreeBSD's fusefs driver sends a namespace
string with the FUSE_LISTXATTR request. That behavior was probably copied
from fuse_vnop_getextattr, which has an attribute name argument. It's
been there ever since extended attribute support was added in r324620. This
commit removes it.

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

4 years agoMove phys_avail definition into MI code. It is consumed in the MI layer and
jeff [Fri, 16 Aug 2019 00:45:14 +0000 (00:45 +0000)]
Move phys_avail definition into MI code.  It is consumed in the MI layer and
doing so adds more flexibility with less redundant code.

Reviewed by: jhb, markj, kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D21250

4 years agoFix i386 build.
mav [Thu, 15 Aug 2019 23:56:19 +0000 (23:56 +0000)]
Fix i386 build.

MFC after: 2 weeks

4 years agoFix copy_file_range(2) so that unneeded blocks are not allocated to the output file.
rmacklem [Thu, 15 Aug 2019 23:21:41 +0000 (23:21 +0000)]
Fix copy_file_range(2) so that unneeded blocks are not allocated to the output file.

When the byte range for copy_file_range(2) doesn't go to EOF on the
output file and there is a hole in the input file, a hole must be
"punched" in the output file. This is done by writing a block of bytes
all set to 0.
Without this patch, the write is done unconditionally which means that,
if the output file already has a hole in that byte range, a unneeded data block
of all 0 bytes would be allocated.
This patch adds code to check for a hole in the output file, so that it can
skip doing the write if there is already a hole in that byte range of
the output file. This avoids unnecessary allocation of blocks to the
output file.

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

4 years agoLimit memory window usage in ntb_transport to 256MB.
mav [Thu, 15 Aug 2019 22:55:59 +0000 (22:55 +0000)]
Limit memory window usage in ntb_transport to 256MB.

This adds safety net for the case of misconfigured NTB with too big
memory window, for which we may be unable to allocate a memory buffer,
which does not make much sense for the network interface.  While there,
fix the code to really work with asymmetric window sizes setup.

This makes driver just print warning message on boot instead of hanging
if too large memory window is configured.

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

4 years agopmc: restore "unhalted-cycles" alias
mmacy [Thu, 15 Aug 2019 21:51:11 +0000 (21:51 +0000)]
pmc: restore "unhalted-cycles" alias

Reported by: mav@

4 years agoping6: Fix alignment errors
asomers [Thu, 15 Aug 2019 19:52:32 +0000 (19:52 +0000)]
ping6: Fix alignment errors

This fixes -Wcast-align errors when compiled with WARNS=6.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21217

4 years agoping6: fix uninitialized variable warnings when MK_CASPER=no
asomers [Thu, 15 Aug 2019 19:27:36 +0000 (19:27 +0000)]
ping6: fix uninitialized variable warnings when MK_CASPER=no

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21273

4 years agotwsi: Fix build when DEBUG is used on 32bits arch.
manu [Thu, 15 Aug 2019 18:59:52 +0000 (18:59 +0000)]
twsi: Fix build when DEBUG is used on 32bits arch.

MFC after: 3 days

4 years agoarm: allwinner: Set aw_ccu to BUS_PASS_BUS
manu [Thu, 15 Aug 2019 18:57:48 +0000 (18:57 +0000)]
arm: allwinner: Set aw_ccu to BUS_PASS_BUS

In r350842 I've switched the bus pass to resource so it matches the other
clock drivers but this cannot work as this drivers is meant to match
the dts node '/clocks' and if we don't do it at this pass simplebus is
catching this node and we cannot attach.
This solve booting on Allwinner boards that are still using /clocks (A20 SoC)

MFC after: 3 days

4 years agoAdd missing comma in calendar.freebsd
mckusick [Thu, 15 Aug 2019 18:46:27 +0000 (18:46 +0000)]
Add missing comma in calendar.freebsd

4 years agogptzfsboot: remove CLANG_NO_IAS
emaste [Thu, 15 Aug 2019 18:43:01 +0000 (18:43 +0000)]
gptzfsboot: remove CLANG_NO_IAS

Many components under stand/ had CLANG_NO_IAS added when Clang's
Integrated Assembler did not handle .codeNN directives.  Clang gained
support quite some time ago, so we can build stand/ with IAS.

In some cases there were small differences in generated object output.
In the case of gptzfsboot however using GNU as or Clang IAS to assemble
gptldr.S resulted in identical final gptzfsboot binary output.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11115

4 years agostand: remove CLANG_NO_IAS from pxeldr
emaste [Thu, 15 Aug 2019 17:59:22 +0000 (17:59 +0000)]
stand: remove CLANG_NO_IAS from pxeldr

Many components under stand/ had CLANG_NO_IAS added when Clang's
Integrated Assembler (IAS) did not handle .codeNN directives.  Clang
gained support quite some time ago, and we can now build stand/ with
IAS.  In most cases IAS- and GNU as-assembled boot components were
identical, and CLANG_NO_IAS was already removed from other components.

Clang IAS produces different output for some components, including
pxeldr, so CLANG_NO_IAS was not previously removed for those.

In the case of pxeldr the difference is that IAS adds a size override
prefix (67h) to three instructions to specify a 32-bit address, even
though the two high bytes are zero and the address fits in 16 bits.
this wastes three bytes per instruction and causes some additional nop
npadding to be required elsewhere in the object, but pxeboot is not
size-constrained so it doesn't matter.

Sponsored by: The FreeBSD Foundation

4 years agoMFV: r351091
jkim [Thu, 15 Aug 2019 17:43:36 +0000 (17:43 +0000)]
MFV: r351091

Fix the reported boot failures and revert r350510.

Note this commit is effectively merging ACPICA 20190703 again and applying
an upstream patch.

https://github.com/acpica/acpica/commit/73f6372

Tested by: scottl

4 years agortld-elf: fix build with xtoolchain-llvm90
kevans [Thu, 15 Aug 2019 17:35:24 +0000 (17:35 +0000)]
rtld-elf: fix build with xtoolchain-llvm90

strstr ends up using bcmp when compiled with llvm90; pull it in from libc
as well.

MFC after: 3 days

4 years agostand: remove CLANG_NO_IAS from cdboot
emaste [Thu, 15 Aug 2019 17:32:39 +0000 (17:32 +0000)]
stand: remove CLANG_NO_IAS from cdboot

Many components under stand/ had CLANG_NO_IAS added when Clang's
Integrated Assembler (IAS) did not handle .codeNN directives.  Clang
gained support quite some time ago, and we can now build stand/ with
IAS.  In most cases IAS- and GNU as-assembled boot components were
identical, and CLANG_NO_IAS was already removed from other components.

Clang IAS produces different output for some components, including
cdboot, so CLANG_NO_IAS was not previously removed for those.

In the case of cdboot the difference is that IAS adds a size override
prefix (67h) to many instructions to specify a 32-bit address, even
though the two high bytes are zero.  This wastes three bytes per
instance, but as cdboot is not size-constrained it doesn't matter.
Padding is also different in one case; Clang used two one-byte nops
while GNU as used a single two-byte xchg %eax, %eax.  In any case, there
is no functional change.

Sponsored by:   The FreeBSD Foundation

4 years agoping6: Fix data type of the buffer for ancillary data of a received message
asomers [Thu, 15 Aug 2019 17:24:10 +0000 (17:24 +0000)]
ping6: Fix data type of the buffer for ancillary data of a received message

The old code worked, but wasted some stack space.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21275

4 years agoCatch mkheaders.c up to the removal of counted device support in 2005.
imp [Thu, 15 Aug 2019 17:21:38 +0000 (17:21 +0000)]
Catch mkheaders.c up to the removal of counted device support in 2005.

mkheaders.c hasn't made headers in ~15 years. Belatedly update the comments to
reflect that all it does these days is warn about 'device foo' lines in the
config where we don't know what a 'foo' is.

Remove extra includes too. These also haven't been needed for 15 years and
weren't removed at the time the comment wasn't updated...

4 years agoRevert r351078, r351085: stand/quad.h eviction
kevans [Thu, 15 Aug 2019 17:15:32 +0000 (17:15 +0000)]
Revert r351078, r351085: stand/quad.h eviction

It did not go well; further examination is required...

4 years agoSort getopt(3) options and case statements per style(9)
imp [Thu, 15 Aug 2019 17:06:53 +0000 (17:06 +0000)]
Sort getopt(3) options and case statements per style(9)

Alphebetize the options and cases without regard for case.

4 years agofinish the pcp feature, but documenting it in the man page...
jmg [Thu, 15 Aug 2019 16:58:00 +0000 (16:58 +0000)]
finish the pcp feature, but documenting it in the man page...

4 years agolibc quad.h: one last _STANDALONE correction
kevans [Thu, 15 Aug 2019 16:28:05 +0000 (16:28 +0000)]
libc quad.h: one last _STANDALONE correction

4 years agoAdd NTB modules to i386 build.
mav [Thu, 15 Aug 2019 16:27:04 +0000 (16:27 +0000)]
Add NTB modules to i386 build.

There is no reason why NTB should not be usable on i386 if memory windows
are small enough.

4 years agoFix i386 LINT build after r351056.
mav [Thu, 15 Aug 2019 16:22:15 +0000 (16:22 +0000)]
Fix i386 LINT build after r351056.

MFC after: 13 days

4 years agoping6: fix uninitialized variable warning for intvl
asomers [Thu, 15 Aug 2019 16:09:27 +0000 (16:09 +0000)]
ping6: fix uninitialized variable warning for intvl

GCC isn't smart enough to realize that this variable was always initialized.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21271

4 years agoEnable ACPICA mutex debugging in INVARIANTS case.
jkim [Thu, 15 Aug 2019 16:04:22 +0000 (16:04 +0000)]
Enable ACPICA mutex debugging in INVARIANTS case.

This lets us detect lock order reversal in ACPICA code to avoid deadlock.

4 years agoping6: quiet an undefined variable warning
asomers [Thu, 15 Aug 2019 15:55:01 +0000 (15:55 +0000)]
ping6: quiet an undefined variable warning

GCC 4.2 isn't smart enough to know that this variable is already defined by
the time it's used.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21269

4 years agoping6: quiet warning about unused copyright variable
asomers [Thu, 15 Aug 2019 15:49:01 +0000 (15:49 +0000)]
ping6: quiet warning about unused copyright variable

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21270

4 years agostand: kick out quad.h
kevans [Thu, 15 Aug 2019 15:47:48 +0000 (15:47 +0000)]
stand: kick out quad.h

Use quad.h from libc instead for the time being. This reduces the number of
nearly-identical-quad.h we have in tree to two with only minor changes.

Prototypes for some *sh*di3 have been added to match the copy in libkern.
The differences between the two are likely few enough that they can perhaps
be merged with little additional effort to bring us down to 1.

MFC after: 3 days

4 years agoRevert r351076 and r351074 because of atomic_swap_64 on 32-bit platforms
avg [Thu, 15 Aug 2019 15:27:58 +0000 (15:27 +0000)]
Revert r351076 and r351074 because of atomic_swap_64 on 32-bit platforms

Trying to sort it out.

4 years agoMFV r351075: 10406 large_dnode changes broke zfs recv of legacy stream
avg [Thu, 15 Aug 2019 15:11:20 +0000 (15:11 +0000)]
MFV r351075: 10406 large_dnode changes broke zfs recv of legacy stream

illumos/illumos-gate@811964cd9f1fbae0fc3b93d116269e9b1fca090a
https://github.com/illumos/illumos-gate/commit/811964cd9f1fbae0fc3b93d116269e9b1fca090a

https://www.illumos.org/issues/10406
  The large dnode changes from 8423 caused problems in zfs recv for a legacy
  stream. This manifests when attempting to mount the received stream, but the
  problem is in the receive code. We missed the following commit from ZoL which
  fixes this.
  commit da2feb42fb5c7a8c1e1cc67f7a880da9d8e97bc2
  Author: Tom Caputi <tcaputi@datto.com>
  Date: Thu Jun 28 17:55:11 2018 -0400
  Fix 'zfs recv' of non large_dnode send streams
  Currently, there is a bug where older send streams without the
      DMU_BACKUP_FEATURE_LARGE_DNODE flag are not handled correctly.
      The code in receive_object() fails to handle cases where
      drro->drr_dn_slots is set to 0, which is always the case when the
      sending code does not support this feature flag. This patch fixes
      the issue by ensuring that that a value of 0 is treated as
      DNODE_MIN_SLOTS.

Author: Tom Caputi <tcaputi@datto.com>

MFC after: 3 weeks
X-MFC after: r351074

4 years agoMFV r350898: 8423 8199 7432 Implement large_dnode pool feature
avg [Thu, 15 Aug 2019 14:57:27 +0000 (14:57 +0000)]
MFV r350898: 8423 8199 7432 Implement large_dnode pool feature

8423 8199 7432 Implement large_dnode pool feature

8423 Implement large_dnode pool feature
8199 multi-threaded dmu_object_alloc()
7432 Large dnode pool feature

llumos/illumos-gate@54811da5ac6b517992fdc173df5d605e4e61fdc0
https://github.com/illumos/illumos-gate/commit/54811da5ac6b517992fdc173df5d605e4e61fdc0
https://www.illumos.org/issues/8423
https://www.illumos.org/issues/8199
https://www.illumos.org/issues/7432

  ZoL issues:
  Improved dnode allocation #6564
  Clean up large dnode code #6262
  Fix dnode_hold() freeing dnode behavior #8172
  Fix dnode allocation race #6414, #6439
  Partial: Raw sends must be able to decrease nlevels #6821, #6864
  Remove unnecessary txg syncs from receive_object() Closes #7197

This updates FreeBSD large_dnode code (that was imported from ZoL) to a version
that was committed to illumos.  It has some cleanups, improvements and fixes
comparing to what we have in FreeBSD now.  I think that the most significant
update is 8199 multi-threaded dmu_object_alloc().

Obtained from: illumos
MFC after: 3 weeks

4 years agostand: remove CLANG_NO_IAS from boot2
emaste [Thu, 15 Aug 2019 14:54:18 +0000 (14:54 +0000)]
stand: remove CLANG_NO_IAS from boot2

Many components under stand/ had CLANG_NO_IAS added when Clang's
Integrated Assembler (IAS) did not handle .codeNN directives.  Clang
gained support quite some time ago, and we can now build stand/ with
IAS.  In most cases IAS- and GNU as-assembled boot components were
identical, and CLANG_NO_IAS was already removed from other components.

Clang IAS produces different output for some components, including
boot2, so CLANG_NO_IAS was not previously removed for those.

In the case of boot2 the difference is that IAS produces a larger
encoding for one instruction (the testb at the beginning of read).

GNU as produces:

    2e    f6 06 b0 08       80

while IAS includes an address size override prefix (67) and produces:

    2e 67 f6 05 b3 08 00 00 80

This results in three fewer NOPs elsewhere in boot2 but no functional
change, so switch to IAS for boot2.

(We can separately pursue improved 16-bit IAS support with the LLVM
developers.)

Sponsored by: The FreeBSD Foundation

4 years agoImplement new methods for Intel and PLX NTB.
mav [Thu, 15 Aug 2019 14:11:11 +0000 (14:11 +0000)]
Implement new methods for Intel and PLX NTB.

This restores parity with AMD NTB driver.  Though without any drivers
supporting more then one peer and respective KPI modification to pass
peer index to most of the calls this addition is pretty useless now.

MFC after: 2 weeks

4 years agoFix rule truncation on external action module unloading.
ae [Thu, 15 Aug 2019 13:44:33 +0000 (13:44 +0000)]
Fix rule truncation on external action module unloading.

Obtained from: Yandex LLC
MFC after: 1 week
Sponsored by: Yandex LLC

4 years agotelnet: remove 3rd clause from Berkeley copyrights
emaste [Thu, 15 Aug 2019 13:27:57 +0000 (13:27 +0000)]
telnet: remove 3rd clause from Berkeley copyrights

Per the July 22, 1999 letter (in /COPYRIGHT) from
William Hoskins
Director, Office of Technology Licensing
University of California, Berkeley

MFC after: 1 week

4 years agodo not enable userland retpoline if not supported by compiler/linker
emaste [Thu, 15 Aug 2019 12:48:17 +0000 (12:48 +0000)]
do not enable userland retpoline if not supported by compiler/linker

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21101

4 years agopf tests: Fix accidental duplication of content
0mp [Thu, 15 Aug 2019 12:00:59 +0000 (12:00 +0000)]
pf tests: Fix accidental duplication of content

Some files got their contented duplicated in r345409. Some mistakes where
fixed in r345430. The only file that was left with a duplicated content was
CVE-2019-5598.py.

Reviewed by: kp
Approved by: src (kp)
Differential Revision: https://reviews.freebsd.org/D21267

4 years agoRevert prior change till installworld sorted
sjg [Thu, 15 Aug 2019 06:00:55 +0000 (06:00 +0000)]
Revert prior change till installworld sorted

4 years agofusefs: fix conditional from r351061
asomers [Thu, 15 Aug 2019 04:47:42 +0000 (04:47 +0000)]
fusefs: fix conditional from r351061

The entirety of r351061 was a copy/paste error.  I'm sorry I've been
comitting so hastily.

Reported by: rpokala
Reviewed by: rpokala
MFC after: 2 weeks
MFC-With: 351061
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21265

4 years agopowerpc/pmap: Enable UMA_MD_SMALL_ALLOC for 64-bit booke
jhibbits [Thu, 15 Aug 2019 03:42:15 +0000 (03:42 +0000)]
powerpc/pmap: Enable UMA_MD_SMALL_ALLOC for 64-bit booke

The only thing blocking UMA_MD_SMALL_ALLOC from working on 64-bit booke
powerpc was a missing check in pmap_kextract().  Adding DMAP handling into
pmap_kextract(), we can now use UMA_MD_SMALL_ALLOC.  This should improve
performance and stability a bit, since DMAP is always mapped in TLB1, so
this relieves pressure on TLB0.

MFC after: 3 weeks

4 years agoswap_pager.c reserves 2 blocks for a bsd label. Change that 2 to the
dougm [Thu, 15 Aug 2019 02:30:44 +0000 (02:30 +0000)]
swap_pager.c reserves 2 blocks for a bsd label.  Change that 2 to the
expression howmany(BBSIZE, PAGE_SIZE), where BBSIZE is the size of the
boot block area.  That can be less than 2 if PAGE_SIZE is big.

swapon(8) has an option to trim (delete) all the blocks of a device at
startup.  However, if the first of those blocks is a bsd label, then
trimming those blocks is destructive.  Change swapon to leave the
first BBSIZE bytes untrimmed.

Update manual pages to reflect changes in how swapon and how it may be
used, espeically in association with savecore.

Reviewed by: alc
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D21191

4 years agoarch.7: be explicit about the future for unmigrated GCC 4.2.1 archs
emaste [Thu, 15 Aug 2019 02:14:44 +0000 (02:14 +0000)]
arch.7: be explicit about the future for unmigrated GCC 4.2.1 archs

Reported by: imp
MFC after: 1 week
MFC with: r351036

4 years agorandom(4): Remove "EXPERIMENTAL" verbiage from concurrent operation
cem [Thu, 15 Aug 2019 00:39:53 +0000 (00:39 +0000)]
random(4): Remove "EXPERIMENTAL" verbiage from concurrent operation

No functional change.

Add a verbose comment giving an example side-by-side comparison between the
prior and Concurrent modes of Fortuna, and why one should believe they
produce the same result.

The intent is to flip this on by default prior to 13.0, so testing is
encouraged.  To enable, add the following to loader.conf:

    kern.random.fortuna.concurrent_read="1"

The intent is also to flip the default blockcipher to the faster Chacha-20
prior to 13.0, so testing of that mode of operation is also appreciated.
To enable, add the following to loader.conf:

    kern.random.use_chacha20_cipher="1"

Approved by: secteam(implicit)

4 years agofusefs: fix the 32-bit build after 351042
asomers [Thu, 15 Aug 2019 00:23:03 +0000 (00:23 +0000)]
fusefs: fix the 32-bit build after 351042

Reported by: jhb
MFC after: 2 weeks
MFC-With: 351042
Sponsored by: The FreeBSD Foundation

4 years agoAdd support for PCI Device ID 0x148B in ntb_hw_amd driver.
mav [Wed, 14 Aug 2019 22:35:11 +0000 (22:35 +0000)]
Add support for PCI Device ID 0x148B in ntb_hw_amd driver.

Submitted by: Rajesh Kumar <rajesh1.kumar@amd.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20892

4 years agobsd.files.mk: fix targets to avoid directories
sjg [Wed, 14 Aug 2019 22:33:46 +0000 (22:33 +0000)]
bsd.files.mk: fix targets to avoid directories

Reintroduce :T when file is used as part of a target name.

Reviewed by: stevek

4 years agoStop listing "on motherboard" as the parent of nexus devices on x86.
jhb [Wed, 14 Aug 2019 22:13:11 +0000 (22:13 +0000)]
Stop listing "on motherboard" as the parent of nexus devices on x86.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D21256

4 years agoMove the common x86 ipmi files to files.x86. The powerpc file list is different
imp [Wed, 14 Aug 2019 20:58:50 +0000 (20:58 +0000)]
Move the common x86 ipmi files to files.x86. The powerpc file list is different
enough that unification will have to wait for the next pass.

Reviewed by: jhb (verbal OK on irc)
Differential Revision: https://reviews.freebsd.org/D21248

4 years agoThe x86 part of hwpmc is shared, so move it to files.x86.
imp [Wed, 14 Aug 2019 20:58:44 +0000 (20:58 +0000)]
The x86 part of hwpmc is shared, so move it to files.x86.

Reviewed by: jhb (verbal OK on irc)
Differential Revision: https://reviews.freebsd.org/D21248

4 years agoWindows ndis support is x86 only. Move the MI parts there.
imp [Wed, 14 Aug 2019 20:58:39 +0000 (20:58 +0000)]
Windows ndis support is x86 only. Move the MI parts there.

Reviewed by: jhb (verbal OK on irc)
Differential Revision: https://reviews.freebsd.org/D21248

4 years agoIntel's isci is part of the chipset, so it is x86 specific.
imp [Wed, 14 Aug 2019 20:58:34 +0000 (20:58 +0000)]
Intel's isci is part of the chipset, so it is x86 specific.

Reviewed by: jhb (verbal OK on irc)
Differential Revision: https://reviews.freebsd.org/D21248

4 years agoMove hyperv to files.x86
imp [Wed, 14 Aug 2019 20:58:28 +0000 (20:58 +0000)]
Move hyperv to files.x86

Move the comomon part of hyperv to files.x86.

Reviewed by: jhb (verbal OK on irc)
Differential Revision: https://reviews.freebsd.org/D21248

4 years agoThe bxe driver, QLogic NetXtreme II Ethernet 10Gb PCIe adapter driver, is x86
imp [Wed, 14 Aug 2019 20:58:23 +0000 (20:58 +0000)]
The bxe driver, QLogic NetXtreme II Ethernet 10Gb PCIe adapter driver, is x86
specific, and only builds there. Likewise the module is built there. Move it to
the x86-only files.x86.

Reviewed by: jhb (verbal OK on irc)
Differential Revision: https://reviews.freebsd.org/D21248

4 years agoThe ACPI parts are identical between i386 and amd64
imp [Wed, 14 Aug 2019 20:58:17 +0000 (20:58 +0000)]
The ACPI parts are identical between i386 and amd64

Apart from one MD file, ACPI is a x86 implementation, not specific to either
i386 or amd64, so put it into files.x86. Other architectures include fewer
files for the same options, so it can't move into the MI files file.

Reviewed by: jhb (verbal OK on irc)
Differential Revision: https://reviews.freebsd.org/D21248

4 years agoMove via padlock files to files.x86.
imp [Wed, 14 Aug 2019 20:58:12 +0000 (20:58 +0000)]
Move via padlock files to files.x86.

VIA Padlock support is for VIA C3, C7 and Eden processors, which are 64bit x86
processors.

Reviewed by: jhb (verbal OK on irc)
Differential Revision: https://reviews.freebsd.org/D21248

4 years agoApart from one MD file, aesni is common to x86. Move it into files.x86.
imp [Wed, 14 Aug 2019 20:58:06 +0000 (20:58 +0000)]
Apart from one MD file, aesni is common to x86. Move it into files.x86.

Reviewed by: jhb (verbal OK on irc)
Differential Revision: https://reviews.freebsd.org/D21248

4 years agoMove all the hp* drivers too files.x86
imp [Wed, 14 Aug 2019 20:58:01 +0000 (20:58 +0000)]
Move all the hp* drivers too files.x86

The HPT drivers are all x86 only. Move them to files.x86. Because of the way we
run uudecode, we can use $M instead of needing entries for them in separate
files.

Reviewed by: jhb (verbal OK on irc)
Differential Revision: https://reviews.freebsd.org/D21248

4 years agoMove the identical x86 lines to files.x86
imp [Wed, 14 Aug 2019 20:57:54 +0000 (20:57 +0000)]
Move the identical x86 lines to files.x86

Move all the identical x86 lines to files.x86. The non-identical ones should be
unified and moved as well, but that would require additional changes that would
need a more careful review and may not be MFCable, so I'll do them
separately. I'll delete the mildly snarky comment when things are unified.

Reviewed by: jhb (verbal OK on irc)
Differential Revision: https://reviews.freebsd.org/D21248

4 years agofusefs: Fix the size of fuse_getattr_in
asomers [Wed, 14 Aug 2019 20:45:00 +0000 (20:45 +0000)]
fusefs: Fix the size of fuse_getattr_in

In FUSE protocol 7.9, the size of the FUSE_GETATTR request has increased.
However, the fusefs driver is currently not sending the additional fields.
In our implementation, the additional fields are always zero, so I there
haven't been any test failures until now.  But fusefs-lkl requires the
request's length to be correct.

Fix this bug, and also enhance the test suite to catch similar bugs.

PR: 239830
MFC after: 2 weeks
MFC-With: 350665
Sponsored by: The FreeBSD Foundation

4 years agocompiler-rt: enable __bswapsi2/__bswapdi2 for RISC-V
emaste [Wed, 14 Aug 2019 18:41:28 +0000 (18:41 +0000)]
compiler-rt: enable __bswapsi2/__bswapdi2 for RISC-V

As with other archs the compiler may emit calls to the byte swap routines
under certain conditions.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agofusefs: fix intermittency in the default_permissions.Unlink.ok test
asomers [Wed, 14 Aug 2019 18:04:04 +0000 (18:04 +0000)]
fusefs: fix intermittency in the default_permissions.Unlink.ok test

The test needs to expect a FUSE_FORGET operation. Most of the time the test
would pass anyway, because by chance FUSE_FORGET would arrive after the
unmount.

MFC after: 2 weeks
MFC-With: 350665
Sponsored by: The FreeBSD Foundation

4 years agoPrint few more useful identify fields.
mav [Wed, 14 Aug 2019 17:36:26 +0000 (17:36 +0000)]
Print few more useful identify fields.

MFC after: 2 weeks

4 years agoarch.7: clarify that the table shows the default tool chain
emaste [Wed, 14 Aug 2019 17:17:52 +0000 (17:17 +0000)]
arch.7: clarify that the table shows the default tool chain

Reported by: jhb
MFC after: 1 week
MFC with: r351035
Sponsored by: The FreeBSD Foundation

4 years agoarch.7: add deprecation notice for GCC 4.2.1
emaste [Wed, 14 Aug 2019 17:13:36 +0000 (17:13 +0000)]
arch.7: add deprecation notice for GCC 4.2.1

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoarch.7: add tool chain table
emaste [Wed, 14 Aug 2019 17:04:28 +0000 (17:04 +0000)]
arch.7: add tool chain table

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoping: Make in_cksum() operate on u_char buffer
asomers [Wed, 14 Aug 2019 16:55:06 +0000 (16:55 +0000)]
ping: Make in_cksum() operate on u_char buffer

This fixes -Wcast-align errors for in_cksum() calls when compiled with
WARNS=6.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21261

4 years agoping: fix triptime calculation after r350998
asomers [Wed, 14 Aug 2019 16:45:09 +0000 (16:45 +0000)]
ping: fix triptime calculation after r350998

That revision changed the internal clock to the monotonic, but neglected to
change the datagram's timestamp source.

Reported by: Oliver Hartmann, Michael Butler
Reviewed by: Ján Sučan <sucanjan@gmail.com>, allanjude
MFC after: 2 weeks
MFC-With: r350998
Differential Revision: https://reviews.freebsd.org/D21258

4 years agoReport NOIOB and NPWG fields as stripe size.
mav [Wed, 14 Aug 2019 16:12:03 +0000 (16:12 +0000)]
Report NOIOB and NPWG fields as stripe size.

Namespace Optimal I/O Boundary field added in NVMe 1.3 and Namespace
Preferred Write Granularity added in 1.4 allow upper layers to align
I/Os for improved SSD performance and endurance.

I don't have hardware reportig those yet, but NPWG could probably be
reported by bhyve.

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

4 years agoEnable BSD_CRTBEGIN on powerpc
andrew [Wed, 14 Aug 2019 14:31:17 +0000 (14:31 +0000)]
Enable BSD_CRTBEGIN on powerpc

In r342974 jhibbits added support to build crtsavres.o. This was the
blocker for BSD_CRTBEGIN to be enabled there. As such enable this
option again.

Reviewed by: jhibbits
Sponsored by: DARPA, AFRL

4 years agoImplement pci_enable_msi() and pci_disable_msi() in the LinuxKPI.
hselasky [Wed, 14 Aug 2019 09:36:25 +0000 (09:36 +0000)]
Implement pci_enable_msi() and pci_disable_msi() in the LinuxKPI.
This patch makes the DRM graphics driver in ports usable on aarch64.

Submitted by: Greg V <greg@unrelenting.technology>
Differential Revision: https://reviews.freebsd.org/D21008
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoAdd missing break statements in r351004.
mav [Wed, 14 Aug 2019 02:02:14 +0000 (02:02 +0000)]
Add missing break statements in r351004.

Surprisingly code still worked, but thanks imp@ for noticing it.

MFC after: 1 week

4 years agogeom_uzip(4), mkuzip(8): Add Zstd image mode
cem [Tue, 13 Aug 2019 23:32:56 +0000 (23:32 +0000)]
geom_uzip(4), mkuzip(8): Add Zstd image mode

The Zstd format bumps the CLOOP major number to 4 to avoid incompatibility
with older systems.  Support in geom_uzip(4) is conditional on the ZSTDIO
kernel option, which is enabled in amd64 GENERIC, but not all in-tree
configurations.

mkuzip(8) was modified slightly to always initialize the nblocks + 1'th
offset in the CLOOP file format.  Previously, it was only initialized in the
case where the final compressed block happened to be unaligned w.r.t.
DEV_BSIZE.  The "Fake" last+1 block change in r298619 means that the final
compressed block's 'blen' was never correct unless the compressed uzip image
happened to be BSIZE-aligned.  This happened in about 1 out of every 512
cases.  The zlib and lzma decompressors are probably tolerant of extra trash
following the frame they were told to decode, but Zstd complains that the
input size is incorrect.

Correspondingly, geom_uzip(4) was modified slightly to avoid trashing the
nblocks + 1'th offset when it is known to be initialized to a good value.
This corrects the calculated final real cluster compressed length to match
that printed by mkuzip(8).

mkuzip(8) was refactored somewhat to reduce code duplication and increase
ease of adding other compression formats.

  * Input block size validation was pulled out of individual compression
    init routines into main().

  * Init routines now validate a user-provided compression level or select
    an algorithm-specific default, if none was provided.

  * A new interface for calculating the maximal compressed size of an
    incompressible input block was added for each driver.  The generic code
    uses it to validate against MAXPHYS as well as to allocate compression
    result buffers in the generic code.

  * Algorithm selection is now driven by a table lookup, to increase ease of
    adding other formats in the future.

mkuzip(8) gained the ability to explicitly specify a compression level with
'-C'.  The prior defaults -- 9 for zlib and 6 for lzma -- are maintained.
The new zstd default is 9, to match zlib.

Rather than select lzma or zlib with '-L' or its absense, respectively, a
new argument '-A <algorithm>' is provided to select 'zlib', 'lzma', or
'zstd'.  '-L' is considered deprecated, but will probably never be removed.

All of the new features were documented in mkuzip.8; the page was also
cleaned up slightly.

Relnotes: yes

4 years agoMake nvd(4) report NGUID or EUI64 as GEOM::lunid.
mav [Tue, 13 Aug 2019 21:49:07 +0000 (21:49 +0000)]
Make nvd(4) report NGUID or EUI64 as GEOM::lunid.

With support for multiple namespaces and multiple ports in NVMe there is
now a need for reliable unique namespace identification alike to SCSI.

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

4 years agoFix build with DRM and INVARIANTS enabled.
jhb [Tue, 13 Aug 2019 21:15:59 +0000 (21:15 +0000)]
Fix build with DRM and INVARIANTS enabled.

The DRM drivers use the lockdep assertion macros with spinlock_t locks
which are backed by mutexes, not sx locks.  This causes compile
failures since you can't use sx_assert with a mutex.  Instead, change
the lockdep macros to use lock_class methods.  This works by assuming
that each LinuxKPI locking primitive embeds a FreeBSD lock as its
first structure and uses a cast to get to the underlying 'struct
lock_object'.

Reviewed by: hselasky
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20992

4 years agoClarify comment that describes how the FS_METACKHASH is managed.
mckusick [Tue, 13 Aug 2019 20:56:44 +0000 (20:56 +0000)]
Clarify comment that describes how the FS_METACKHASH is managed.

MFC after: 3 days

4 years agoRemove deprecated GEOM classes
cem [Tue, 13 Aug 2019 20:06:55 +0000 (20:06 +0000)]
Remove deprecated GEOM classes

Follow-up on r322318 and r322319 and remove the deprecated modules.

Shift some now-unused kernel files into userspace utilities that incorporate
them.  Remove references to removed GEOM classes in userspace utilities.

Reviewed by: imp (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D21249

4 years agosys/{x86,amd64}: remove one of doubled ;s
emaste [Tue, 13 Aug 2019 19:39:36 +0000 (19:39 +0000)]
sys/{x86,amd64}: remove one of doubled ;s

MFC after: 1 week

4 years agoping: use the monotonic clock to measure durations
asomers [Tue, 13 Aug 2019 19:27:23 +0000 (19:27 +0000)]
ping: use the monotonic clock to measure durations

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21245

4 years agoping6: use the monotonic clock to measure durations
asomers [Tue, 13 Aug 2019 19:24:17 +0000 (19:24 +0000)]
ping6: use the monotonic clock to measure durations

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21226

4 years agoping: fix data type of a variable for a packet sequence number
asomers [Tue, 13 Aug 2019 16:25:23 +0000 (16:25 +0000)]
ping: fix data type of a variable for a packet sequence number

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21244

4 years agoConsistently use the byteorder functions in the correct direction
asomers [Tue, 13 Aug 2019 16:22:43 +0000 (16:22 +0000)]
Consistently use the byteorder functions in the correct direction

Though ntohs and htons are functionally identical, they have different meanings.Using the correct one helps to document the code.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21219

4 years agofusefs: skip some tests when unsafe aio is disabled
asomers [Tue, 13 Aug 2019 15:52:28 +0000 (15:52 +0000)]
fusefs: skip some tests when unsafe aio is disabled

MFC after:      15 days
MFC-With:       r350665
Sponsored by:   The FreeBSD Foundation