]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoDefine the MSR used to fetch the current microcode patch level on AMD.
markj [Fri, 13 Jul 2018 19:42:59 +0000 (19:42 +0000)]
Define the MSR used to fetch the current microcode patch level on AMD.

It is defined in the AMD family 17h register reference.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoFix glitched indentation (and rewrap as needed due to deeper indent).
ian [Fri, 13 Jul 2018 18:58:37 +0000 (18:58 +0000)]
Fix glitched indentation (and rewrap as needed due to deeper indent).
No functional changes.

Reported by: rpokala@

5 years agog_eli_key_cmp is used only in the kernel, so only define it in the
imp [Fri, 13 Jul 2018 18:21:38 +0000 (18:21 +0000)]
g_eli_key_cmp is used only in the kernel, so only define it in the
kernel.

5 years agoUse if rather than case for a simple boolean. gcc thinks blks is
imp [Fri, 13 Jul 2018 18:19:33 +0000 (18:19 +0000)]
Use if rather than case for a simple boolean. gcc thinks blks is
undefined sometimes with the case, but enc is always 0 or 1, so
and if / else is better anyway.

5 years agoAdd missing include of sys/boot.h
imp [Fri, 13 Jul 2018 18:00:13 +0000 (18:00 +0000)]
Add missing include of sys/boot.h

5 years agoExtend loader(8) geli support to all architectures and all disk-like devices.
ian [Fri, 13 Jul 2018 17:50:25 +0000 (17:50 +0000)]
Extend loader(8) geli support to all architectures and all disk-like devices.

This moves the bulk of the geli support from lib386/biosdisk.c into a new
geli/gelidev.c which implements a devsw-type device whose dv_strategy()
function handles geli decryption. Support for all arches comes from moving
the taste-and-attach code to the devopen() function in libsa.

After opening any DEVT_DISK device, devopen() calls the new function
geli_probe_and_attach(), which will "attach" the geli code to the open_file
struct by creating a geli_devdesc instance to replace the disk_devdesc
instance in the open_file. That routes all IO for the device through the
geli code.

A new public geli_add_key() function is added, to allow arch/vendor-specific
code to add keys obtained from custom hardware or other sources.

With these changes, geli support will be compiled into all variations of
loader(8) on all arches because the default is WITH_LOADER_GELI.

Relnotes: yes
Sponsored by: Microchip Technology Inc
Differential Revision: https://reviews.freebsd.org/D15743

5 years agoUse C99 initializers for instances of struct apic_enumerator.
markj [Fri, 13 Jul 2018 17:42:48 +0000 (17:42 +0000)]
Use C99 initializers for instances of struct apic_enumerator.

MFC after: 3 days

5 years agoThere's two files in the sys tree named inflate.c, in addition
imp [Fri, 13 Jul 2018 17:41:28 +0000 (17:41 +0000)]
There's two files in the sys tree named inflate.c, in addition
to it being a common name elsewhere. Rename the old kzip one
to subr_inflate.c.

This actually fixes the build issues on sparc64 that my inclusion of
.PATH ${SYSDIR}/kern created in r336244, so also revert the broken
workaround I committed in r336249.

This slipped passed me because apparently, I never did a clean build.

5 years agoFix sparc64 builds
imp [Fri, 13 Jul 2018 17:15:14 +0000 (17:15 +0000)]
Fix sparc64 builds

gcc is complaining about struct infate being defined in a parameter
list. It's inclear how long this has been broken, but the fix is
simple enough.

5 years agoInvalidate the mapping before updating its physical address.
alc [Fri, 13 Jul 2018 17:12:50 +0000 (17:12 +0000)]
Invalidate the mapping before updating its physical address.

Doing so ensures that all threads sharing the pmap have a consistent
view of the mapping.  This fixes the problem described in the commit
log message for r329254 without the overhead of an extra fault in the
common case.  (Once the riscv pmap_enter() implementation is similarly
modified, the workaround added in r329254 can be removed, reducing the
overhead of CoW faults.)

See also r335784 for amd64.  The mips implementation of pmap_enter()
already reused the PV entry from the old mapping.

Reviewed by: kib, markj
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D16199

5 years agoTransition to boot_env_to_howto and boot_howto_to_env in the boot
imp [Fri, 13 Jul 2018 16:43:29 +0000 (16:43 +0000)]
Transition to boot_env_to_howto and boot_howto_to_env in the boot
loader.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16205

5 years agoEliminate boot loader copies of boot arg parsing.
imp [Fri, 13 Jul 2018 16:43:23 +0000 (16:43 +0000)]
Eliminate boot loader copies of boot arg parsing.

Eliminate 4 of the copies of the arg parsing in /boot/laoder
by using boot_parse_cmdline.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16205

5 years agoUse boot_parse_* to parse command line args and retire cut-n-paste
imp [Fri, 13 Jul 2018 16:43:17 +0000 (16:43 +0000)]
Use boot_parse_* to parse command line args and retire cut-n-paste
code that was substantially identical.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16205

5 years agoCreate helper functions for parsing boot args.
imp [Fri, 13 Jul 2018 16:43:05 +0000 (16:43 +0000)]
Create helper functions for parsing boot args.

boot_parse_arg to parse a single arg
boot_parse_cmdline to parse a command line string
boot_parse_args to parse all the args in a vector
boot_howto_to_env Convert howto bits to env vars
boot_env_to_howto Return howto mask mased on what's set in the environment.

All these routines return an int that's the bitmask of the args
translated to RB_* flags. As a special case, the 'S' flag sets the
comconsole_speed env var. Any arg that looks like a=b will set the env
key 'a' to value 'b'. If =b is omitted, 'a' is set to '1'.  This
should help us reduce the number of redundant copies of these routines
in the tree.  It should also give a more uniform experience between
platforms.

Also, invent a new flag RB_PROBE that's set when 'P' is parsed.  On
x86 + BIOS, this means 'probe for the keyboard, and if it's not there
set both RB_MULTIPLE and RB_SERIAL (which means show the output on
both video and serial consoles, but make serial primary).  Others it
may be some similar concept of probing, but it's loader dependent
what, exactly, it means.

These routines are suitable for /boot/loader and/or the kernel,
though they may not be suitable for the tightly hand-rolled-for-space
environments like boot2.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16205

5 years agoMake generated scripts executable.
ian [Fri, 13 Jul 2018 16:37:42 +0000 (16:37 +0000)]
Make generated scripts executable.

5 years agoMore little fixes... fix a function name typo (eps vs esp), and cope with
ian [Fri, 13 Jul 2018 16:33:21 +0000 (16:33 +0000)]
More little fixes... fix a function name typo (eps vs esp), and cope with
newer versions of gpart that show mbr efi partition types with the name
'efi' rather than as '!239'.

5 years agoRevert r336240, which contained unrelated changes accidentally committed.
ian [Fri, 13 Jul 2018 16:32:31 +0000 (16:32 +0000)]
Revert r336240, which contained unrelated changes accidentally committed.

5 years agoMore little fixes... fix a function name typo (eps vs esp), and cope with
ian [Fri, 13 Jul 2018 16:30:54 +0000 (16:30 +0000)]
More little fixes... fix a function name typo (eps vs esp), and cope with
newer versions of gpart that show mbr efi partition types with the name
'efi' rather than as '!239'.

5 years agoChange the pNFS client so that it does not report an NFSERR_STALE from
rmacklem [Fri, 13 Jul 2018 12:39:27 +0000 (12:39 +0000)]
Change the pNFS client so that it does not report an NFSERR_STALE from
an I/O attempt on a DS to the server via LayoutReturn.

The current FreeBSD client can generate these errors for an operational
DS while doing a recovery of a mirror after a mirrored DS has been repaired.
I am not sure why these errors occur, but my best current guess is a race
between the Layout Recall issued by the kernel code run from pnfsdscopymr(8)
and a Read operation on the DS for the file bing copied.
The errrors are not fatal, since the client falls back on doing I/O through
the MDS, which can do the I/O successfully as a proxy. (The fact that the
MDS can do this indicates that the file does still exist on the functioning
DS.)
This patch only affects behaviour of the pNFS client and only when using
Flexible File layouts.

MFC after: 2 weeks

5 years agoRound down the location of execpathp to slightly improve copyout speed.
brooks [Fri, 13 Jul 2018 11:32:27 +0000 (11:32 +0000)]
Round down the location of execpathp to slightly improve copyout speed.

In practice, this moves the padding from below the canary to above
execpathp has no impact on stack consumption.

Submitted by: Wuyang-Chung (via github pull request #159)
MFC after: 1 week

5 years agogeom_gate: enable resize
trociny [Fri, 13 Jul 2018 07:08:06 +0000 (07:08 +0000)]
geom_gate: enable resize

Reviewed By: pjd
Approved By: pjd
Differential Revision: https://reviews.freebsd.org/D11531

5 years agoDetect and handle invalid number of FATs
delphij [Fri, 13 Jul 2018 02:02:16 +0000 (02:02 +0000)]
Detect and handle invalid number of FATs

If the number of FATs field in the boot sector is zero, give
an appropriate error code.

Obtained from: Android https://android.googlesource.com/platform/external/fsck_msdos/+/6c29bbe8d58e6fe8755935a04166ecf82ff31f47%5E%21/
MFC after: 2 weeks

5 years agofd: stop passing M_ZERO to uma_zalloc
mjg [Thu, 12 Jul 2018 22:48:18 +0000 (22:48 +0000)]
fd: stop passing M_ZERO to uma_zalloc

The optimisation seen with malloc cannot be used here as zone sizes are
now known at compilation. Thus bzero by hand to get the optimisation
instead.

5 years agouma: whack main zone counter update in the slow path, freeing side
mjg [Thu, 12 Jul 2018 22:35:52 +0000 (22:35 +0000)]
uma: whack main zone counter update in the slow path, freeing side

See r333052.

5 years agosx: remove the spurious macro value difference vs rwlocks
mjg [Thu, 12 Jul 2018 22:34:40 +0000 (22:34 +0000)]
sx: remove the spurious macro value difference vs rwlocks

No functional changes.

5 years agoModify the NFSv4.1 pNFS client to use separate TCP connections for DSs.
rmacklem [Thu, 12 Jul 2018 20:46:22 +0000 (20:46 +0000)]
Modify the NFSv4.1 pNFS client to use separate TCP connections for DSs.

Without this patch, the NFSv4.1 pNFS client shared a single TCP connection
for all DSs that resided on the same machine. This made disabling one of
the DSs impossible. Although unlikely, it is possible that the storage
subsystem has failed in such a way that the storage for one DS on a machine
is no longer functioning correctly, but the storage used by another DS on
the same machine is still ok. For this case, it would be nice if a system
can fail one of the DSs without failing them all.
This patch changes the default behaviour to use separate TCP connections
for each DS even if they reside on the same machine.
I do not believe that this will be a problem for extant pNFS servers, but
a sysctl can be set to restore the old behaviour if this change causes a
problem for an extant pNFS server.
This patch only affects the NFSv4.1 pNFS client.

MFC after: 2 weeks

5 years agoPull in r336008 from upstream clang trunk:
dim [Thu, 12 Jul 2018 19:02:59 +0000 (19:02 +0000)]
Pull in r336008 from upstream clang trunk:

  Request init/fini array on FreeBSD 12 and later

  Summary:

  It seems a bad idea to change the default in the middle of a release
  branch due to possible changes in global ctor / dtor ordering between
  .ctors and .init_array. With FreeBSD 11.0's release imminent lets
  change the default now for FreeBSD 12 (the current development
  stream) and later.

  FreeBSD rtld has supported .init_array / .fini_array for many years.
  As of Jan 1 2017 all supported FreeBSD releases and branches will
  have support.

  Reviewers: dim, brooks, arichardson

  Reviewed By: dim, brooks, arichardson

  Subscribers: bsdjhb, krytarowski, emaste, cfe-commits

  Differential Revision: https://reviews.llvm.org/D24867

Requested by: jhb
MFC after: 3 days

5 years agoPass the right sizes to malloc() and realloc().
markj [Thu, 12 Jul 2018 18:48:53 +0000 (18:48 +0000)]
Pass the right sizes to malloc() and realloc().

Reported by: scan-build, via Mark Millard
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16180

5 years agoAdd PCI IDs for AMD X370 AHCI and XHCI.
markj [Thu, 12 Jul 2018 18:44:00 +0000 (18:44 +0000)]
Add PCI IDs for AMD X370 AHCI and XHCI.

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

5 years agopf: Fix typo in r336221
kp [Thu, 12 Jul 2018 18:07:28 +0000 (18:07 +0000)]
pf: Fix typo in r336221

Reported by: olivier@

5 years agoixl(4): Set baudrate on link up using proper link_speed variable
erj [Thu, 12 Jul 2018 17:42:36 +0000 (17:42 +0000)]
ixl(4): Set baudrate on link up using proper link_speed variable

And remove old, now-completely unused link_speed variable.

Reported by: Jacob Keller <jacob.e.keller@intel.com>
MFC after: 1 month

5 years agoWee fix: $dev is passed in to the function with the /dev prefix already in
ian [Thu, 12 Jul 2018 17:22:25 +0000 (17:22 +0000)]
Wee fix: $dev is passed in to the function with the /dev prefix already in
place, don't add it.

5 years agopf: Increate default state table size
kp [Thu, 12 Jul 2018 16:35:35 +0000 (16:35 +0000)]
pf: Increate default state table size

The typical system now has a lot more memory than when pf was new, and is also
expected to handle more connections. Increase the default size of the state
table.
Note that users can overrule this using 'set limit states' in pf.conf.

From OpenBSD:
    The year is 2018.
    Mercury, Bowie, Cash, Motorola and DEC all left us.
    Just pf still has a default state table limit of 10000.
    Had! Now it's a tiny little bit more, 100k.
    lead guitar: me
    ok chorus: phessler theo claudio benno
    background school girl laughing: bob

Obtained from: OpenBSD

5 years agoFix an obvious 'is odd' check.
imp [Thu, 12 Jul 2018 16:19:17 +0000 (16:19 +0000)]
Fix an obvious 'is odd' check.

len % 1 is always true. Fix StrHexToBytes to do a proper odd length
check. This was only called by DevPathFromTextGenericPath,
ConvertFromTextVendor and DevPathFromTextMAC, which we've not had
a need to actually use just yet.

Submitted by: David Binderman
PR: 229718

5 years agoUse correct size when we are allocating array for skipto index.
ae [Thu, 12 Jul 2018 11:38:18 +0000 (11:38 +0000)]
Use correct size when we are allocating array for skipto index.

Also, there is no need to use M_ZERO for idxmap_back. It will be
re-filled just after allocation in update_skipto_cache().

PR: 229665
MFC after: 1 week

5 years agokern_environment: Give the static environment a chance to disable MD env
kevans [Thu, 12 Jul 2018 02:51:50 +0000 (02:51 +0000)]
kern_environment: Give the static environment a chance to disable MD env

This variable has been given the name "loader_env.disabled" as it's the
primary way most people will have an MD environment. This restores the
previously-default behavior of ignoring the loader(8) environment, which may
be useful for vendor distributions or other scenarios where inheriting the
loader environment may be considered a security issue or potentially
breaking of a more locked-down environment.

As the change to config(5) indicates, disabling the loader environment
should not be a choice made lightly since it may provide ACPI hints and
other useful things that the system can rely on to boot.

An UPDATING entry has been added to mention an upgrade path for those that
may have relied on the previous behavior.

Discussed with: bde
Relnotes: yes (maybe)

5 years agoActually build and install the spigen.4 manpage.
ian [Wed, 11 Jul 2018 23:59:04 +0000 (23:59 +0000)]
Actually build and install the spigen.4 manpage.

5 years agoIgnore the cookie verifier for NFSv4.1 when the cookie is 0.
rmacklem [Wed, 11 Jul 2018 23:23:29 +0000 (23:23 +0000)]
Ignore the cookie verifier for NFSv4.1 when the cookie is 0.

RFC5661 states that the cookie verifier should be 0 when the cookie is 0.
However, the wording is somewhat unclear and a recent discussion on the
nfsv4@ietf.org mailing list indicated that the NFSv4 server should ignore
the cookie verifier's value when the dirctory offset cookie is 0.
This patch deletes the check for this that would return NFSERR_BAD_COOKIE
when the verifier was not 0.
This was found during testing of the ESXi client against the NFSv4.1 server.

Reported by: daniel@ftml.net (via packet trace)
MFC after: 2 weeks

5 years agoAdd various spi devices to NOTES. Add some required options for building
ian [Wed, 11 Jul 2018 22:23:50 +0000 (22:23 +0000)]
Add various spi devices to NOTES.  Add some required options for building
the cqspi and n25q drivers.

5 years agoSmall refactor of install-boot
imp [Wed, 11 Jul 2018 21:53:04 +0000 (21:53 +0000)]
Small refactor of install-boot

Use newfs_msdos to create the filesystem for the partition requested
and use loader.efi instead of boot1.efi.

5 years agoDon't acquire evclass_lock with a spinlock held
asomers [Wed, 11 Jul 2018 19:38:42 +0000 (19:38 +0000)]
Don't acquire evclass_lock with a spinlock held

When the "pc" audit class is enabled and auditd is running, witness will
panic during thread exit because au_event_class tries to lock an rwlock
while holding a spinlock acquired upstack by thread_exit.

To fix this, move AUDIT_SYSCALL_EXIT futher upstack, before the spinlock is
acquired. Of thread_exit's 16 callers, it's only necessary to call
AUDIT_SYSCALL_EXIT from two, exit1 (for exiting processes) and kern_thr_exit
(for exiting threads). The other callers are all kernel threads, which
needen't call AUDIT_SYSCALL_EXIT because since they can't make syscalls
there will be nothing to audit.  And exit1 already does call
AUDIT_SYSCALL_EXIT, making the second call in thread_exit redundant for that
case.

PR: 228444
Reported by: aniketp
Reviewed by: aniketp, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16210

5 years agoMFV r324714:
cy [Wed, 11 Jul 2018 18:53:18 +0000 (18:53 +0000)]
MFV r324714:

Update wpa 2.5 --> 2.6.

MFC after: 1 month

5 years agoEnhancements and fixes for the spigen(4) driver...
ian [Wed, 11 Jul 2018 17:54:41 +0000 (17:54 +0000)]
Enhancements and fixes for the spigen(4) driver...

- Resources used by spigen_mmap_single() are now tracked using
  devfs_set_cdevpriv() rather than in the softc.

- Since resources are now tracked per-open-fd, there is no need to try to
  impose any exclusive-open logic, so flags related to that are removed.

- Flags used to track open status to prevent detach() when the device is
  open are replaced with calls to device_busy()/device_unbusy().  That
  extends the protection up the hierarchy so that the spibus and hardware
  controller drivers also can't be detached while the device is open/in use.

- Arbitrary limits on the maximum size of a transfer are removed, along with
  the sysctl variables that allowed the limits to be changed.  There is just
  no reason to limit the size of a spi transfer to the machine's page size.
  Or to any other arbitrary value, really.

- Most of the locking is removed.  It was mostly protecting access to flags
  and fields in the softc that no longer exist.  The locking that remains is
  just to prevent concurrent calls to device_[un]busy().

- The code was calling malloc() with M_WAITOK while holding a mutex in
  several places.  Since most of the locking is gone, that's fixed.

5 years agosmartpqi(4):
sbruno [Wed, 11 Jul 2018 16:44:14 +0000 (16:44 +0000)]
smartpqi(4):
 - Update to release "3"

Submitted by: Deepak Ukey <deepak.ukey@microsemi.com>
Reviewed by: mav
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16060

5 years agoRemove a duplicate check.
markj [Wed, 11 Jul 2018 14:54:56 +0000 (14:54 +0000)]
Remove a duplicate check.

PR: 229663
Submitted by: David Binderman <dcb314@hotmail.com>
MFC after: 3 days

5 years agoTweak ports(7) manual page to better explain the basics.
trasz [Wed, 11 Jul 2018 13:53:44 +0000 (13:53 +0000)]
Tweak ports(7) manual page to better explain the basics.

Reviewed by: allanjude@ (earlier version)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16149

5 years agoMake dhclient(8) verify if new MTU (option 26) differs from current one and skip...
eugen [Wed, 11 Jul 2018 09:41:50 +0000 (09:41 +0000)]
Make dhclient(8) verify if new MTU (option 26) differs from current one and skip unneeded MTU change.
This check eliminates infinite loop of MTU change / link flap / lease verification / MTU change / link flap etc.
in case of some NIC drivers like em(4) or igb(4).

N.B.: obsolete u_int16_t is used in consistency with the rest of the file.

PR: 229432
Approved by: mav (mentor)
MFC after: 1 week

5 years agoImprove bhyve exit(3) error code.
araujo [Wed, 11 Jul 2018 03:23:09 +0000 (03:23 +0000)]
Improve bhyve exit(3) error code.

The bhyve(8) exit status indicates how the VM was terminated:

0 rebooted
1 powered off
2 halted
3 triple fault

The problem is when we have wrappers around bhyve that parses the exit
error code and gets an exit(1) for an error but interprets it as "powered off".
So to mitigate this issue and makes it less error prone for third part
applications, I have added a new exit code 4 that is "exited due to an error".

For now the bhyve(8) exit status are:
0 rebooted
1 powered off
2 halted
3 triple fault
4 exited due to an error

Reviewed by: @jhb
MFC after: 2 weeks.
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D16161

5 years agorun(4): Add a new USB device ID.
bwidawsk [Wed, 11 Jul 2018 02:32:06 +0000 (02:32 +0000)]
run(4): Add a new USB device ID.

Summary:
Add the device id of the Panda Wireless PAU06 which seems to be
the already-supported combination of RT5392 MAC and RF RT5372
radio.

Reviewed By: allanjude, eadler, jhb
Approved By: jhb
Differential Revision: https://reviews.freebsd.org/D16211

5 years agoAddress some (although not all) style(9) issues in event.h after r335776.
dab [Wed, 11 Jul 2018 02:09:11 +0000 (02:09 +0000)]
Address some (although not all) style(9) issues in event.h after r335776.

Reported by: bde@
MFC after: 1 day
Sponsored by: Dell EMC

5 years agoacpidump(8): Add ACPI LPIT (Low Power Idle Table)
bwidawsk [Wed, 11 Jul 2018 01:37:01 +0000 (01:37 +0000)]
acpidump(8): Add ACPI LPIT (Low Power Idle Table)

The LPIT is the part of the "standardized" way that one can enumerate
various power state information on Intel platforms.

The documentation for this change can be found here:
http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf

Reviewed By: jhb
Approved By: jhb
Differential Revision: https://reviews.freebsd.org/D15931

5 years agonet80211: Fix ifdetach w/o ifattach, small whitespace cleanup
kevans [Tue, 10 Jul 2018 23:30:19 +0000 (23:30 +0000)]
net80211: Fix ifdetach w/o ifattach, small whitespace cleanup

As the comment says, ifdetach might be called during the course of driver
detach if initialization failed. This shouldn't be a total failure, though,
we just have nothing to do there.

This has been modified slightly from Augustin's original commit to move the
bail-out slightly earlier since the ic wouldn't have been added to the
ic list in the first place, and a comment has been added describing when
this might be an issue.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com>
Obtained from: Haiku (e6f6c1b4633532a8ad37c803dc7c65601e5b24ba)

5 years agoUpdate the pnfs(4) man page.
rmacklem [Tue, 10 Jul 2018 22:53:07 +0000 (22:53 +0000)]
Update the pnfs(4) man page.

This is a content change.

5 years agoRemove bits of the old NUMA.
kib [Tue, 10 Jul 2018 22:00:20 +0000 (22:00 +0000)]
Remove bits of the old NUMA.

Remove numactl(1), edit numa(4) to bring it some closer to reality,
provide libc ABI shims for old NUMA syscalls.

Noted and reviewed by: brooks (previous version)
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D16142

5 years agoFix parsing of create-kernel-packages
bdrewery [Tue, 10 Jul 2018 21:20:49 +0000 (21:20 +0000)]
Fix parsing of create-kernel-packages

MFC after: 3 days
Reported by: rene

5 years agoFix up some missed and mis-merges from the sequential scan code
sef [Tue, 10 Jul 2018 20:11:32 +0000 (20:11 +0000)]
Fix up some missed and mis-merges from the sequential scan code
(r334844). Most of the changes involve moving some code around to
reduce conflicts with future merges.  One of the missing changes
included a notification on scrub cancellation.

Approved by: mav
Sponsored by: iXsystems Inc

5 years agoDocument the "-f" option added to pnfsdskill(8) by r336176.
rmacklem [Tue, 10 Jul 2018 18:44:44 +0000 (18:44 +0000)]
Document the "-f" option added to pnfsdskill(8) by r336176.

This is a content change.

5 years agoAdd a "-f" option to pnfsdskill(8) to force disabling of a DS.
rmacklem [Tue, 10 Jul 2018 18:41:16 +0000 (18:41 +0000)]
Add a "-f" option to pnfsdskill(8) to force disabling of a DS.

The pnfsdskill(8) command will normally fail if there is no valid mirror
for the DS to be disabled. However, a system administrator may need to
disable a DS which does not have a valid mirror so that the nfsd threads
can be terminated. This patch adds a "-f" option to pnfsdskill(8) that
uses the kernel changes made by r336141 to implement this "forced" case
of disabling a DS.
This patch only affects the pNFS server.

5 years agoEliminate unnecessary differences between i386's pmap_enter() and amd64's.
alc [Tue, 10 Jul 2018 18:00:55 +0000 (18:00 +0000)]
Eliminate unnecessary differences between i386's pmap_enter() and amd64's.
For example, fully construct the new PTE before entering the critical
section.  This change is a stepping stone to psind == 1 support on i386.

Reviewed by: kib, markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D16188

5 years agoFix thread state summary line display after r334918.
markj [Tue, 10 Jul 2018 17:20:27 +0000 (17:20 +0000)]
Fix thread state summary line display after r334918.

5 years agoCorrect the identifier for the Unifi Security Gateway
jhibbits [Tue, 10 Jul 2018 17:01:19 +0000 (17:01 +0000)]
Correct the identifier for the Unifi Security Gateway

The USG is really E120, not E110.

5 years agoRegen after r336171.
brooks [Tue, 10 Jul 2018 14:04:52 +0000 (14:04 +0000)]
Regen after r336171.

5 years agoGet rid of netbsd_lchown and netbsd_msync syscall entries.
brooks [Tue, 10 Jul 2018 13:32:04 +0000 (13:32 +0000)]
Get rid of netbsd_lchown and netbsd_msync syscall entries.

No valid FreeBSD binary very called them (they would call lchown and
msync directly) and we haven't supported NetBSD binaries in ages.

This is a respin of r335983 with a workaround for the ancient BFD linker
in the libc stubs.

Reviewed by: kib
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16193

5 years agoUse uintptr_t alone when assigning to kvaddr_t variables.
brooks [Tue, 10 Jul 2018 13:03:06 +0000 (13:03 +0000)]
Use uintptr_t alone when assigning to kvaddr_t variables.

Suggested by: jhb

5 years agoA direct call to echo was intruduced in r333407, which made messages
garga [Tue, 10 Jul 2018 11:33:37 +0000 (11:33 +0000)]
A direct call to echo was intruduced in r333407, which made messages
to be displayed when make is called with -s.  Replace it by ${ECHO}.

Reviewed by: brd, bdrewery
Approved by: brd, bdrewery
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D16195

5 years agoAdd support for printing the TCP FO client-side cookie cache via the
tuexen [Tue, 10 Jul 2018 10:50:43 +0000 (10:50 +0000)]
Add support for printing the TCP FO client-side cookie cache via the
sysctl interface. This is similar to the TCP host cache.

Reviewed by: pkelsey@, kbowling@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D14554

5 years agoUse appropriate MSS value when populating the TCP FO client cookie cache
tuexen [Tue, 10 Jul 2018 10:42:48 +0000 (10:42 +0000)]
Use appropriate MSS value when populating the TCP FO client cookie cache

When a client receives a SYN-ACK segment with a TFP fast open cookie,
but without an MSS option, an MSS value from uninitialised stack memory is used.
This patch ensures that in case no MSS option is included in the SYN-ACK,
the appropriate value as given in RFC 7413 is used.

Reviewed by: kbowling@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16175

5 years agoFix build broken by r336130
wma [Tue, 10 Jul 2018 09:49:27 +0000 (09:49 +0000)]
Fix build broken by r336130

Add ifdef's to compile parts of pci_host_generic only on armv8

5 years agoRemoved pointless NULL check
smh [Tue, 10 Jul 2018 08:05:32 +0000 (08:05 +0000)]
Removed pointless NULL check

Removed pointless NULL check after malloc with M_WAITOK which can never
return NULL.

Sponsored by: Multiplay

5 years agoFix vertical whitespace nit in cxgbe.
np [Tue, 10 Jul 2018 06:09:25 +0000 (06:09 +0000)]
Fix vertical whitespace nit in cxgbe.

5 years agoFix style(9) space and tab.
araujo [Tue, 10 Jul 2018 05:36:32 +0000 (05:36 +0000)]
Fix style(9) space and tab.

5 years agotop(1): rollback r335836
daichi [Tue, 10 Jul 2018 03:49:48 +0000 (03:49 +0000)]
top(1): rollback r335836

Encoding-specific processing introduced in r335836 is not recommended.
And doing getenv("LANG") and assuming an encoding based on it is a
very bad practice to internationalize software.

Submitted by: hrs
Differential Revision: https://reviews.freebsd.org/D16203

5 years agocxgbe(4): Add a sysctl to report the chip's microprocessor's load
np [Tue, 10 Jul 2018 03:03:10 +0000 (03:03 +0000)]
cxgbe(4): Add a sysctl to report the chip's microprocessor's load
averages.  This works with debug or custom firmwares only.

sysctl dev.<nexus>.<instance>.loadavg
sysctl dev.t6nex.0.loadavg

MFC after: 1 month
Sponsored by: Chelsio Communications

5 years agokern_environment: bool'itize dynamic_kenv; fix small style(9) nit
kevans [Tue, 10 Jul 2018 02:43:22 +0000 (02:43 +0000)]
kern_environment: bool'itize dynamic_kenv; fix small style(9) nit

5 years agoUse endian.h le32dec() instead of rolling our own.
delphij [Tue, 10 Jul 2018 01:42:28 +0000 (01:42 +0000)]
Use endian.h le32dec() instead of rolling our own.

Suggested by: phk
Reviewed by: imp, pfg
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16192

5 years agosubr_hints: Skip static_env and static_hints if they don't contain hints
kevans [Tue, 10 Jul 2018 00:36:37 +0000 (00:36 +0000)]
subr_hints: Skip static_env and static_hints if they don't contain hints

This is possible because, well, they're static. Both the dynamic environment
and the MD-environment (generally loader(8) environment) can potentially
have room for new variables to be set, and thus do not receive this
treatment.

5 years agosubr_hints: Convert some bool-like ints to bools
kevans [Tue, 10 Jul 2018 00:34:19 +0000 (00:34 +0000)]
subr_hints: Convert some bool-like ints to bools

5 years agosubr_hints: Use goto/label instead of series of conditionals
kevans [Tue, 10 Jul 2018 00:33:31 +0000 (00:33 +0000)]
subr_hints: Use goto/label instead of series of conditionals

5 years agoRemove redundant space.
cy [Tue, 10 Jul 2018 00:26:13 +0000 (00:26 +0000)]
Remove redundant space.

MFC after: 3 days

5 years agotop(1): Fix the prompt bug and core dump problem in o / p mode that occurred by r336028
daichi [Tue, 10 Jul 2018 00:19:52 +0000 (00:19 +0000)]
top(1): Fix the prompt bug and core dump problem in o / p mode that occurred by r336028

Reviewed by: cy
Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D16174

5 years agoFix pre-SI_SUB_CPU initialization of per-CPU counters.
markj [Tue, 10 Jul 2018 00:18:12 +0000 (00:18 +0000)]
Fix pre-SI_SUB_CPU initialization of per-CPU counters.

r336020 introduced pcpu_page_alloc(), replacing page_alloc() as the
backend allocator for PCPU UMA zones.  Unlike page_alloc(), it does
not honour malloc(9) flags such as M_ZERO or M_NODUMP, so fix that.

r336020 also changed counter(9) to initialize each counter using a
CPU_FOREACH() loop instead of an SMP rendezvous.  Before SI_SUB_CPU,
smp_rendezvous() will only execute the callback on the current CPU
(i.e., CPU 0), so only one counter gets zeroed.  The rest are zeroed
by virtue of the fact that UMA gratuitously zeroes slabs when importing
them into a zone.

Prior to SI_SUB_CPU, all_cpus is clear, so with r336020 we weren't
zeroing vm_cnt counters during boot: the CPU_FOREACH() loop had no
effect, and pcpu_page_alloc() didn't honour M_ZERO.  Fix this by
iterating over the full range of CPU IDs when zeroing counters,
ignoring whether the corresponding bits in all_cpus are set.

Reported and tested by: pho (previous version)
Reviewed by: kib (previous version)
Differential Revision: https://reviews.freebsd.org/D16190

5 years agoTweak documentation to RB_ constants to reflect current use
imp [Tue, 10 Jul 2018 00:01:14 +0000 (00:01 +0000)]
Tweak documentation to RB_ constants to reflect current use

RB_ASKNAME is no longer instructions to the boot loader to request a
prompt for which kernel to boot. Instead, it asks for what the root
file system to use. RB_INITNAME is unused, and never has been in
FreeBSD as far as I can tell. Remove it from the documentation and fix
comment. RB_SELFTEST and RB_MINIROOT likewise (though they were
completely undocumented). These last three constants can likely just
be deleted as nothing references them (even to set useless bits).

RB_ASKNAME doesn't actually survive reboot, however, so needs to be
communicated to the bootloader via other means. If the bootloader sets
it, though, it will be honored.

5 years agolocaledef(1): remove duplicated includes.
pfg [Mon, 9 Jul 2018 20:38:47 +0000 (20:38 +0000)]
localedef(1): remove duplicated includes.

Hinted by: DragonFlyBSD

5 years agopowerpc/powernv: Make opal_i2c driver work with attached i2c drivers
jhibbits [Mon, 9 Jul 2018 20:33:48 +0000 (20:33 +0000)]
powerpc/powernv: Make opal_i2c driver work with attached i2c drivers

* FreeBSD stores addresses in 8 bit format, but the OPAL API requires the 7-bit
  address, and encodes the direction elsewhere.  Behave like other i2c drivers,
  and shift accordingly.
* The OPAL API can already handle multiple requests in flight.  Change the async
  token to be private to the thread, so as not to stomp across i2c accesses,
  remove the limitation error message, and use the correct message index to
  transfer all messages in the list.
* Micro-optimize the async handler to not continuously call pmap_kextract() when
  spin-waiting for the operation to complete.

This has been tested by hexdumping an EEPROM attached via the icee(4) driver.

5 years agosed(1): Suppress implicit-fallthrough.
pfg [Mon, 9 Jul 2018 20:27:31 +0000 (20:27 +0000)]
sed(1): Suppress implicit-fallthrough.

Apparently some tools are not able to determine if all the cases of a
switch are covered. Make use of the attribute for cases like this.

Hinted by: DragonFlyBSD GGC8 (but fixed differently)

CID: 976552

5 years agoig4(4): add devmatch(8) PNP info
gonzo [Mon, 9 Jul 2018 20:00:45 +0000 (20:00 +0000)]
ig4(4): add devmatch(8) PNP info

Now that we have all devices ids in a table add MODULE_PNP_INFO macro
to let devmatch autoload module

5 years agoAdd support for a "forced" pnfsdskill to the pNFS server kernel code.
rmacklem [Mon, 9 Jul 2018 19:58:01 +0000 (19:58 +0000)]
Add support for a "forced" pnfsdskill to the pNFS server kernel code.

The pnfsdskill(8) command will normally fail if there is no valid mirror
for the DS to be disabled. However, a system administrator may need to
disable a DS which does not have a valid mirror so that the nfsd threads
can be terminated. This patch adds the kernel code needed by pnfsdskill(8)
to implement this "forced" case of disabling a DS.
This patch only affects the pNFS server.

5 years agotruncate: Add support for -s % and /
manu [Mon, 9 Jul 2018 19:03:30 +0000 (19:03 +0000)]
truncate: Add support for -s % and /

% round up to the multiple size and / round down
This is compatible with gnu truncate.
Add tests and document in the man page.

5 years agotruncate: style(9) some parts
manu [Mon, 9 Jul 2018 19:02:05 +0000 (19:02 +0000)]
truncate: style(9) some parts

5 years agoAdd pnp info to the imx_spi driver.
ian [Mon, 9 Jul 2018 19:00:39 +0000 (19:00 +0000)]
Add pnp info to the imx_spi driver.

5 years agoAdd a manpage for the imx_spi driver.
ian [Mon, 9 Jul 2018 19:00:13 +0000 (19:00 +0000)]
Add a manpage for the imx_spi driver.

5 years agoRemove gateworks nanobsd support.
imp [Mon, 9 Jul 2018 18:02:35 +0000 (18:02 +0000)]
Remove gateworks nanobsd support.

A quick test of this shows multiple problems. Rather than fix the
problems, just retire this board's support. It's for a 12 year old
board that's been out of production for at least 7 years and generally
lacks the memory to run even a stripped down NanoBSD image well. It's
not really relevant anymore.

5 years agoRemove armeb from the list of architectures we build for the boot
imp [Mon, 9 Jul 2018 18:02:23 +0000 (18:02 +0000)]
Remove armeb from the list of architectures we build for the boot
laoder testing scripts. It just adds to the build time, and will be
retired soon anyway, per discussions in freebsd-arch@ last month.

5 years agoAdd missing generated header file.
ian [Mon, 9 Jul 2018 14:18:03 +0000 (14:18 +0000)]
Add missing generated header file.

Reported by: Julian H. Stacey <jhs@berklix.com>

5 years agoAdd "record-state", "set-limit" and "defer-action" rule options to ipfw.
ae [Mon, 9 Jul 2018 11:35:18 +0000 (11:35 +0000)]
Add "record-state", "set-limit" and "defer-action" rule options to ipfw.

"record-state" is similar to "keep-state", but it doesn't produce implicit
O_PROBE_STATE opcode in a rule. "set-limit" is like "limit", but it has the
same feature as "record-state", it is single opcode without implicit
O_PROBE_STATE opcode. "defer-action" is targeted to be used with dynamic
states. When rule with this opcode is matched, the rule's action will
not be executed, instead dynamic state will be created. And when this
state will be matched by "check-state", then rule action will be executed.
This allows create a more complicated rulesets.

Submitted by: lev
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D1776

5 years agoDeduplicate the code.
ae [Mon, 9 Jul 2018 11:03:28 +0000 (11:03 +0000)]
Deduplicate the code.

Add generic function if_tunnel_check_nesting() that does check for
allowed nesting level for tunneling interfaces and also does loop
detection. Use it in gif(4), gre(4) and me(4) interfaces.

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

5 years agoARM64: Add quirk mechanism to pci_host_generic_acpi
wma [Mon, 9 Jul 2018 09:00:16 +0000 (09:00 +0000)]
ARM64: Add quirk mechanism to pci_host_generic_acpi

Add few quirks which are necessary to use AHCI on ThX2

Submitted by:          Patryk Duda <pdk@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium
Differential revision: https://reviews.freebsd.org/D15929

5 years agoARM64: Add support for ThunderX2 PCIe
wma [Mon, 9 Jul 2018 08:55:07 +0000 (08:55 +0000)]
ARM64: Add support for ThunderX2 PCIe

Submitted by:          Patryk Duda <pdk@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium
Differential revision: https://reviews.freebsd.org/D15141

5 years agoARM64: Add ThunderX2 CPU revision macro. Add ThunderX2 name in identcpu.c
wma [Mon, 9 Jul 2018 08:41:54 +0000 (08:41 +0000)]
ARM64: Add ThunderX2 CPU revision macro. Add ThunderX2 name in identcpu.c

Submitted by:          Patryk Duda <pdk@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium

5 years agogzip(1): Don't shadow global 'err'
cem [Mon, 9 Jul 2018 08:37:55 +0000 (08:37 +0000)]
gzip(1): Don't shadow global 'err'

Unbreak work build on ppc due to -Werror=shadow.  Introduced in r336121.

X-MFC-With: r336121