]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoUpgrade to OpenSSH 7.7p1.
des [Fri, 11 May 2018 13:22:43 +0000 (13:22 +0000)]
Upgrade to OpenSSH 7.7p1.

6 years agousbdevs: add new Microchip USB-Ethernet device IDs
emaste [Fri, 11 May 2018 13:09:21 +0000 (13:09 +0000)]
usbdevs: add new Microchip USB-Ethernet device IDs

LAN7800 USB 3.1 to 10/100/1000 Ethernet with PHY
LAN7801 USB 3.1 to 10/100/1000 Ethernet with RGMII interface

Also update manufacturer name for the Vendor ID.  Microchip acquired
SMSC in May 2012.

Sponsored by: The FreeBSD Foundation

6 years agogpart.8: list all options in table form for each command
emaste [Fri, 11 May 2018 12:58:36 +0000 (12:58 +0000)]
gpart.8: list all options in table form for each command

Previously gpart's man page listed some command options in prose, and
some in table form, which made it more difficult to use as a reference.

Reviewed by: bcr
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15135

6 years agogpart.8: sort suboptions per mdoc(7)
emaste [Fri, 11 May 2018 12:57:25 +0000 (12:57 +0000)]
gpart.8: sort suboptions per mdoc(7)

Alphabetical order, uppercase before lowercase for each letter and with
no regard to whether an option takes an argument.

Sponsored by: The FreeBSD Foundation

6 years agoamd64: align the .data.exclusive_cache_line section to 128
mjg [Fri, 11 May 2018 08:56:39 +0000 (08:56 +0000)]
amd64: align the .data.exclusive_cache_line section to 128

This aligns the section itself compared to other sections, does not change
internal alignment of fields stored inside. This may or may not come later.

The motivation is partially combating adverse effects of the adjacent cache
line prefetcher. Without the annotation part of read_mostly section was on
the line of fire.

6 years agoepoch(9): callback task fixes
mmacy [Fri, 11 May 2018 08:16:56 +0000 (08:16 +0000)]
epoch(9): callback task fixes

- initialize the pcpu STAILQ in the NUMA case
- don't enqueue the callback task if there isn't sufficient work to be done

Reported by: pho@
Approved by: sbruno@

6 years agouma: increase alignment to 128 bytes on amd64
mjg [Fri, 11 May 2018 07:04:57 +0000 (07:04 +0000)]
uma: increase alignment to 128 bytes on amd64

Current UMA internals are not suited for efficient operation in
multi-socket environments. In particular there is very common use of
MAXCPU arrays and other fields which are not always properly aligned and
are not local for target threads (apart from the first node of course).
Turns out the existing UMA_ALIGN macro can be used to mostly work around
the problem until the code get fixed. The current setting of 64 bytes
runs into trouble when adjacent cache line prefetcher gets to work.

An example 128-way benchmark doing a lot of malloc/frees has the following
instruction samples:

before:
kernel`lf_advlockasync+0x43b            32940
          kernel`malloc+0xe5            42380
           kernel`bzero+0x19            47798
   kernel`spinlock_exit+0x26            60423
         kernel`0xffffffff80            78238
                         0x0           136947
   kernel`uma_zfree_arg+0x46           159594
 kernel`uma_zalloc_arg+0x672           180556
   kernel`uma_zfree_arg+0x2a           459923
 kernel`uma_zalloc_arg+0x5ec           489910

after:
            kernel`bzero+0xd            46115
kernel`lf_advlockasync+0x25f            46134
kernel`lf_advlockasync+0x38a            49078
   kernel`fget_unlocked+0xd1            49942
kernel`lf_advlockasync+0x43b            55392
          kernel`copyin+0x4a            56963
           kernel`bzero+0x19            81983
   kernel`spinlock_exit+0x26            91889
         kernel`0xffffffff80           136357
                         0x0           239424

See the review for more details.

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

6 years agormlock: partially depessimize lock/unlock fastpath
mjg [Fri, 11 May 2018 06:59:54 +0000 (06:59 +0000)]
rmlock: partially depessimize lock/unlock fastpath

Previusly the slow path was folded in and partially jumped over in the
common case.

6 years ago[expand] add __dead2 annotation to usage
eadler [Fri, 11 May 2018 06:55:02 +0000 (06:55 +0000)]
[expand] add __dead2 annotation to usage

6 years agoAllow different bridge types to coexist
mmacy [Fri, 11 May 2018 05:00:40 +0000 (05:00 +0000)]
Allow different bridge types to coexist

if_bridge has a lot of limitations that make it scale poorly to higher data
rates. In my projects/VPC branch I leverage the bridge interface between
layers for my high speed soft switch as well as for purposes of stacking
in general.

Reviewed by: sbruno@
Approved by: sbruno@
Differential Revision: https://reviews.freebsd.org/D15344

6 years agoepoch(9): fix priority handling, make callback lists pcpu, and other fixes
mmacy [Fri, 11 May 2018 04:54:12 +0000 (04:54 +0000)]
epoch(9): fix priority handling, make callback lists pcpu, and other fixes

- Lend priority to preempted threads in epoch_wait to handle the case
  in which we've had priority lent to us. Previously we borrowed the
  priority of the lowest priority preempted thread. (pointed out by mjg@)

- Don't attempt allocate memory per-domain on powerpc, we don't currently
  handle empty sockets (as is the case on jhibbits Talos' board).

- Handle deferred callbacks as pcpu lists and poll the lists periodically.
  Currently the interval is 1/hz.

- Drop the thread lock when adaptive spinning. Holding the lock starves
  other threads and can even lead to lockups.

- Keep a generation count pcpu so that we don't keep spining if a thread
  has left and re-entered an epoch section.

- Actually removed the callback from the callback list so that we don't
  double free. Sigh ...

Approved by: sbruno@

6 years agoTest priority handling in epoch test.
mmacy [Fri, 11 May 2018 04:47:05 +0000 (04:47 +0000)]
Test priority handling in epoch test.

- Double the number of test threads to mp_ncpu*2
- Give each thread a different scheduling priority

6 years agoNo need to bzero splpar_vpa entries
jhibbits [Fri, 11 May 2018 02:04:01 +0000 (02:04 +0000)]
No need to bzero splpar_vpa entries

splpar_vpa is in the BSS, so is already zeroed when the kernel starts up.

Tested by: Leandro Lupori

6 years agoUpdate jemalloc to version 5.1.0.
jasone [Fri, 11 May 2018 00:32:31 +0000 (00:32 +0000)]
Update jemalloc to version 5.1.0.

6 years agoSlight cleanup of interface event logging.
des [Fri, 11 May 2018 00:19:49 +0000 (00:19 +0000)]
Slight cleanup of interface event logging.

Make if_printf() use vlog() instead of vprintf().  This means it can no
longer return the number of characters printed, as it used to, but every
single call to if_printf() in the entire kernel ignores the return value
anyway; just return 0 so we don't have to change the prototype.

Consistently use if_printf() throughout sys/net/if.c, instead of a
mixture of if_printf() and log().

In ifa_maintain_loopback_route(), don't needlessly log an error if we
either failed to add a route because it already existed or failed to
remove one because it did not.  We still return an error code, though.

MFC after: 1 week

6 years agoReduce <sys/queue.h> pollution.
des [Fri, 11 May 2018 00:01:43 +0000 (00:01 +0000)]
Reduce <sys/queue.h> pollution.

While <sys/sysctl.h> includes <sys/queue.h> unconditionally, it is only
actually used in code which is conditional on _KERNEL.  Make the #include
itself conditional as well, and fix userland code that uses <sys/queue.h>
for other purposes but relied on <sys/sysctl.h> to bring it in.

MFC after: 1 week

6 years agoAdd a special GCE_LICENSE variable to Makefile.gce, which when set,
gjb [Thu, 10 May 2018 21:46:58 +0000 (21:46 +0000)]
Add a special GCE_LICENSE variable to Makefile.gce, which when set,
will include license metadata in the resultant GCE image.

GCE_LICENSE is unset by default, as it primarily pertains to images
produced by the FreeBSD Project, but for downstream FreeBSD consumers,
it can be set in the make(1) environment in the format of:

 --licenses="projects/PROJECT_ID/global/licenses/LICENSE_NAME"

The "license" is not a license, per se, but required metadata that
is required by the GCE marketplace.  For the FreeBSD Project, the
license name is simply 'freebsd', with the description of 'FreeBSD'.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agocxgbe(4): Add fields to support configuration of hardware NAT and
np [Thu, 10 May 2018 20:39:04 +0000 (20:39 +0000)]
cxgbe(4): Add fields to support configuration of hardware NAT and
swapmac (SMAC/DMAC switcheroo) from userspace.

Sponsored by: Chelsio Communications

6 years agoRevert r333365
imp [Thu, 10 May 2018 20:27:12 +0000 (20:27 +0000)]
Revert r333365

Even though we don't use it, it appears something else requires it to
be != 0 to work. This breaks tftp boot in loader.efi, so revert until
that can be sorted out.

6 years agoError out on attempt to link amd64 kernel with old binutils linker
emaste [Thu, 10 May 2018 20:10:02 +0000 (20:10 +0000)]
Error out on attempt to link amd64 kernel with old binutils linker

As of r333461 we require ifunc support to link a working amd64 kernel.
The default in-tree bootstrap linker is lld and it has the required
support, as does any modern out-of-tree binutils linker.  The in-tree
GNU ld is from binutils 2.17.50 and it does not have ifunc support,
so produce an error rather than a broken kernel.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15378

6 years agoAllocate epoch for networking at startup
mmacy [Thu, 10 May 2018 19:13:00 +0000 (19:13 +0000)]
Allocate epoch for networking at startup

Additionally add CK to include paths for modules

Approved by: sbruno@

6 years agoRevert accidentally commited local change to bmake to prevent debilitating
mmacy [Thu, 10 May 2018 17:57:46 +0000 (17:57 +0000)]
Revert accidentally commited local change to bmake to prevent debilitating
excess system time from poor API usage.

Approved by: sbruno@

6 years agoAdd simple preempt safe epoch API
mmacy [Thu, 10 May 2018 17:55:24 +0000 (17:55 +0000)]
Add simple preempt safe epoch API

Read locking is over used in the kernel to guarantee liveness. This API makes
it easy to provide livenes guarantees without atomics.

Includes epoch_test kernel module to stress test the API.

Documentation will follow initial use case.

Test case and improvements to preemption handling in response to discussion
with mjg@

Reviewed by: imp@, shurd@
Approved by: sbruno@

6 years agoFix build for platforms using GCC:
lwhsu [Thu, 10 May 2018 17:22:04 +0000 (17:22 +0000)]
Fix build for platforms using GCC:

- Remove unused or dead store variable
- Remove unused function ctl_copyin_alloc
- Add missing curly brackets, this seems a regression in r287720

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D15383

6 years agovt(4): Use default VGA palette
dumbbell [Thu, 10 May 2018 17:00:33 +0000 (17:00 +0000)]
vt(4): Use default VGA palette

Before this change, the VGA palette was configured to match the shell
palette (e.g. color #1 was red). There was one glitch early in boot when
the vt(4)'s VGA palette was loaded: the loader's logo would switch from
red to blue. Likewise for the "Booting..." message switching from blue
to red. That's because the loader's logo was drawed with the default VGA
palette where a few colors are swapped compared to the shell palette
(e.g. blue <-> red).

This change configures the default VGA palette during initialization and
converts input's colors from shell to VGA palette index.

There should be no visible changes, except the loader's logo which will
keep its original color.

Reviewed by: eadler

6 years agovt(4): Put for() loop outside switch() in vt_generate_cons_palette()
dumbbell [Thu, 10 May 2018 16:41:47 +0000 (16:41 +0000)]
vt(4): Put for() loop outside switch() in vt_generate_cons_palette()

This makes it more logical:
 1. It checks the requested color format
 2. It fills the palette accordingly

Also vt_palette_init() is only called when needed (i.e. when the format
is `COLOR_FORMAT_RGB`).

6 years agoFix a panic in the IPv6 multicast code.
gallatin [Thu, 10 May 2018 16:19:41 +0000 (16:19 +0000)]
Fix a panic in the IPv6 multicast code.

Use LIST_FOREACH_SAFE in in6m_disconnect() since we're
deleting and freeing item from the membership list
while traversing the list.

Reviewed by: mmacy
Sponsored by: Netflix

6 years agoMake fpusave() and fpurestore() on amd64 ifuncs.
kib [Thu, 10 May 2018 15:01:43 +0000 (15:01 +0000)]
Make fpusave() and fpurestore() on amd64 ifuncs.

From now on, linking amd64 kernel requires either lld or newer ld.bfd.

Reviewed by: jhb (as part of the large patch)
Discussed with: emaste
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D13838

6 years agoAdd the test program to examine CPU behaviour for pop ss issue
kib [Thu, 10 May 2018 13:52:52 +0000 (13:52 +0000)]
Add the test program to examine CPU behaviour for pop ss issue
CVE-2018-8897.

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

6 years agoFix the build after r333457
gallatin [Thu, 10 May 2018 13:19:42 +0000 (13:19 +0000)]
Fix the build after r333457

In r333457, the arguments to kern_pwritev() were accidentally
re-ordered as part of ANSIfication, breaking the build.

6 years agoFix the printing of rule comments.
ae [Thu, 10 May 2018 12:25:01 +0000 (12:25 +0000)]
Fix the printing of rule comments.

Change uint8_t type of opcode argument to int in the print_opcode()
function. Use negative value to print the rest of opcodes, because
zero value is O_NOP, and it can't be uses for this purpose.

Reported by: lev
MFC after: 1 week

6 years agoANSIfy sys_generic.c
emaste [Thu, 10 May 2018 11:36:16 +0000 (11:36 +0000)]
ANSIfy sys_generic.c

6 years agoDo not pass header length to the ENA controller
mw [Thu, 10 May 2018 09:37:54 +0000 (09:37 +0000)]
Do not pass header length to the ENA controller

Header length is optional hint for the ENA device. Because It is not
guaranteed that every packet header will be in the first mbuf
segment, it is better to skip passing any information. If the header
length will be indicating invalid value (different than 0), then the
packet will be dropped.

This kind situation can appear, when the UDP packet will be fragmented
by the stack in the ip_fragment() function.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reported by:  Krishna Yenduri <kyenduri@brkt.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.

6 years agoarm64: Add ALT_BREAK_TO_DEBUGGER to GENERIC
manu [Thu, 10 May 2018 09:37:50 +0000 (09:37 +0000)]
arm64: Add ALT_BREAK_TO_DEBUGGER to GENERIC

It is useful to enter kdb with an escape sequence.
While here move the USB_DEBUG with the others debug options and define
nooptions USB_DEBUG for GENERIC-NODEBUG

6 years agoSkip setting the MTU for ENA if it is not changing
mw [Thu, 10 May 2018 09:32:59 +0000 (09:32 +0000)]
Skip setting the MTU for ENA if it is not changing

On AWS, a network interface can get reinitialized every 30 minutes due
to the MTU being (re)set when a new DHCP lease is obtained. This can
cause packet drop, along with annoying syslog messages.

Skip setting the MTU in the ena driver if the new MTU is the same as the
old MTU. Note this fix is already in the netfront driver.

Testing: Verified ena up/down messages do not appear every 30 min in
/var/log/messages with the fix in place.

Submitted by:   Krishna Yenduri <kyenduri@brkt.com>
Reviewed by: Michal Krawczyk <mk@semihalf.com>

6 years agoApply fixes in ena-com
mw [Thu, 10 May 2018 09:25:51 +0000 (09:25 +0000)]
Apply fixes in ena-com

* Change ena-com BIT macro to work on unsigned value.
  To make the shifting operations safer, they should be working on
  unsigned values.

* Fix a mutex not owned ASSERT panic in ENA control path.
  A thread calling cv_broadcast()/cv_signal() must hold the mutex used for
  cv_wait(). Fix the ENA control path code that has this problem.

Submitted by:   Krishna Yenduri <kyenduri@brkt.com>
Reviewed by:    Michal Krawczyk <mk@semihalf.com>
Tested by:      Michal Krawczyk <mk@semihalf.com>

6 years agoUpgrade ENA version to v0.8.1
mw [Thu, 10 May 2018 09:06:21 +0000 (09:06 +0000)]
Upgrade ENA version to v0.8.1

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.

6 years agoRemove "All rights reserved" from my files.
delphij [Thu, 10 May 2018 06:41:08 +0000 (06:41 +0000)]
Remove "All rights reserved" from my files.

See r333391 for the rationale.

MFC after: 1 week

6 years agocxgbe(4): Disable write-combined doorbells by default.
np [Thu, 10 May 2018 06:33:54 +0000 (06:33 +0000)]
cxgbe(4): Disable write-combined doorbells by default.

This had been the default behavior but was changed accidentally as part
of the recent iw_cxgbe+OFED overhaul.  Fix another bug in that change
while here: the global knob affects all the adapters in the system and
should be left alone by per-adapter code.

MFC after: 3 days
Sponsored by: Chelsio Communications

6 years agoFix PPC symbol resolution
jhibbits [Thu, 10 May 2018 03:59:48 +0000 (03:59 +0000)]
Fix PPC symbol resolution

Summary:
There were 2 issues that were preventing correct symbol resolution
on PowerPC/pseries:

1- memory corruption at chrp_attach() - this caused the inital
   part of the symbol table to become zeroed, which would cause
   the kernel linker to fail to parse it.
   (this was probably zeroing out other memory parts as well)

2- DDB symbol resolution wasn't working because symtab contained
   not relocated addresses but it was given relocated offsets.
   Although relocating the symbol table fixed this, it broke the
   linker, that already handled this case.
   Thus, the fix for this consists in adding a new DDB macro:
   DB_STOFFS(offs) that converts a (potentially) relocated offset
   into one that can be compared with symbol table values.

PR: 227093
Submitted by: Leandro Lupori <leandro.lupori_gmail.com>
Differential Revision: https://reviews.freebsd.org/D15372

6 years agoRework CTL frontend & backend options to use nv(3), allow creating multiple
araujo [Thu, 10 May 2018 03:50:20 +0000 (03:50 +0000)]
Rework CTL frontend & backend options to use nv(3), allow creating multiple
ioctl frontend ports.

This revision introduces two changes to CTL:
- Changes the way options are passed to CTL_LUN_REQ and CTL_PORT_REQ ioctls.
  Removes ctl_be_arg structure and associated logic and replaces it with
  nv(3)-based logic for passing in and out arguments.
- Allows creating multiple ioctl frontend ports using either ctladm(8) or
  ctld(8).
  New frontend ports are represented by /dev/cam/ctl<pp>.<vp> nodes, eg /dev/cam/ctl5.3.
  Those device nodes respond only to CTL_IO ioctl.

New command-line options for ctladm:
# creates new ioctl frontend port with using free pp and vp=0
ctladm port -c
# creates new ioctl frontend port with pp=10 and vp=0
ctladm port -c -O pp=10
# creates new ioctl frontend port with pp=11 and vp=12
ctladm port -c -O pp=11 -O vp=12
# removes port with number 4 (it's a "targ_port" number, not pp number)
ctladm port -r -p 4

New syntax for ctl.conf:
target ... {
    port ioctl/<pp>
    ...
}

target ... {
    port ioctl/<pp>/<vp>
    ...

Note: Most of this work was made by jceel@, thank you.

Submitted by: jceel
Reworked by: myself
Reviewed by: mav (earlier versions and recently during the rework)
Obtained from:  FreeNAS and TrueOS
Relnotes: Yes
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D9299

6 years agoRemove unused bcopyb.
imp [Thu, 10 May 2018 02:31:54 +0000 (02:31 +0000)]
Remove unused bcopyb.

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

6 years agoSimplify things a little
imp [Thu, 10 May 2018 02:31:48 +0000 (02:31 +0000)]
Simplify things a little

Rather than include a copy for memmove to call bcopy to call memcpy
(which handles overlapping copies), make memmove a strong reference to
memcpy to save the two calls.

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

6 years agoMove MI-ish bcopy routine to libkern
imp [Thu, 10 May 2018 02:31:38 +0000 (02:31 +0000)]
Move MI-ish bcopy routine to libkern

riscv and powerpc have nearly identical bcopy.c that's
supposed to be mostly MI. Move it to the MI libkern.

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

6 years agocxgbe(4): Determine whether the firmware supports the FILTER2 work
np [Thu, 10 May 2018 00:04:14 +0000 (00:04 +0000)]
cxgbe(4): Determine whether the firmware supports the FILTER2 work
request, which can be used to configure hardware NAT and swapmac.

All firmwares released after Jan 2017 support this work request.

Sponsored by: Chelsio Communications

6 years agoRemove "All rights reserved" from my files.
markj [Wed, 9 May 2018 20:57:18 +0000 (20:57 +0000)]
Remove "All rights reserved" from my files.

See r333391 for the rationale.

MFC after: 1 week

6 years agoIntroduce the 'n' flag for the geli attach command.
oshogbo [Wed, 9 May 2018 20:53:38 +0000 (20:53 +0000)]
Introduce the 'n' flag for the geli attach command.

If the 'n' flag is provided the provided key number will be used to
decrypt device. This can be used combined with dryrun to verify if the key
is set correctly. This can be also used to determine which key slot we want to
change on already attached device.

Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D15309

6 years agoChange option dry-run from 'n' to 'C' in geli attach command.
oshogbo [Wed, 9 May 2018 20:51:16 +0000 (20:51 +0000)]
Change option dry-run from 'n' to 'C' in geli attach command.

'n' is used in other commands to define the key index.
We should be consistent with that.
'C' option is used by patch(1) to perform dryrun so lets use that.

Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D15308

6 years agoFor video consoles, only launch a getty if the device exists.
imp [Wed, 9 May 2018 20:49:00 +0000 (20:49 +0000)]
For video consoles, only launch a getty if the device exists.

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

6 years agoRemove 'All Rights Reserved'
imp [Wed, 9 May 2018 20:41:03 +0000 (20:41 +0000)]
Remove 'All Rights Reserved'

Remove this from some of the iXsystems stuff I did. OK'd by kmoore
at iXsystems

6 years agoRemove the 'All Rights Reserved' clause from some of the stuff I've
imp [Wed, 9 May 2018 20:32:23 +0000 (20:32 +0000)]
Remove the 'All Rights Reserved' clause from some of the stuff I've
done for Netflix, since I'm in the neighborhood.

6 years agoUse the full year, for real this time.
imp [Wed, 9 May 2018 20:26:37 +0000 (20:26 +0000)]
Use the full year, for real this time.

6 years agoRemove 'All rights reserved' from my files
vangyzen [Wed, 9 May 2018 20:12:59 +0000 (20:12 +0000)]
Remove 'All rights reserved' from my files

See r333391 for the rationale.

Approved by: emaste (for the Foundation copyright)
Sponsored by: Dell EMC

6 years agoFix bxe(4) netdump rx polling.
markj [Wed, 9 May 2018 19:54:34 +0000 (19:54 +0000)]
Fix bxe(4) netdump rx polling.

Reviewed by: cem, rstone
X-MFC with: r333287
Sponsored by: Dell EMC Isilon

6 years agoFix style error introduced in r333393.
cy [Wed, 9 May 2018 19:05:27 +0000 (19:05 +0000)]
Fix style error introduced in r333393.

Reported by: jhb, imp, phk
MFC after: 6 days
X-MFC with: r333393

6 years agoAdd taskqgroup_config_gtask_deinit to support teardown after
mmacy [Wed, 9 May 2018 18:51:35 +0000 (18:51 +0000)]
Add taskqgroup_config_gtask_deinit to support teardown after
taskqgroup_config_gtask_init.

Approved by: sbruno

6 years agoEliminate the overhead of gratuitous repeated reinitialization of cap_rights
mmacy [Wed, 9 May 2018 18:47:24 +0000 (18:47 +0000)]
Eliminate the overhead of gratuitous repeated reinitialization of cap_rights

- Add macros to allow preinitialization of cap_rights_t.

- Convert most commonly used code paths to use preinitialized cap_rights_t.
  A 3.6% speedup in fstat was measured with this change.

Reported by: mjg
Reviewed by: oshogbo
Approved by: sbruno
MFC after: 1 month

6 years agonda protocol rate reporting
imp [Wed, 9 May 2018 18:41:04 +0000 (18:41 +0000)]
nda protocol rate reporting

Report the NVMe spec, number of lanes (and max) as well as the PCIe
generation we're negotiated at (and max) for the camcontrol rate
command.

Reviewed by: scottl (the output, not the code)
Sponsored by: Netflix

6 years agoRemove bogus panic
mmacy [Wed, 9 May 2018 17:48:52 +0000 (17:48 +0000)]
Remove bogus panic

r333345 added a panic to the default case statement on the incorrect
premise that it should "never happen" when in fact it is simply a
different adapter version.

Reported by: markj
Approved by: sbruno

6 years agoRemove "all rights reserved" on files where I have copyright.
zeising [Wed, 9 May 2018 17:06:52 +0000 (17:06 +0000)]
Remove "all rights reserved" on files where I have copyright.

According to r333391 it is not needed any more.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D15370

6 years agoStandardize SPDX tag on files I've added
kevans [Wed, 9 May 2018 16:52:28 +0000 (16:52 +0000)]
Standardize SPDX tag on files I've added

6 years agoRemove "All Rights Reserved" on files that I hold sole copyright on
kevans [Wed, 9 May 2018 16:44:19 +0000 (16:44 +0000)]
Remove "All Rights Reserved" on files that I hold sole copyright on

See r333391 for more detail; in summary: it holds no weight and may be
removed.

6 years agoReport TRAP_BRKPT for breakpoint traps on sparc64.
jhb [Wed, 9 May 2018 15:25:26 +0000 (15:25 +0000)]
Report TRAP_BRKPT for breakpoint traps on sparc64.

Reviewed by: marius
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D15190

6 years agoRecognize the base/gcc compiler as GCC.
jhb [Wed, 9 May 2018 15:20:39 +0000 (15:20 +0000)]
Recognize the base/gcc compiler as GCC.

The existing patterns for 'cc --version' output do not work for GCC
built from the base/gcc port.

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

6 years agoamd64: depessimize bcmp for small buffers
mjg [Wed, 9 May 2018 15:16:25 +0000 (15:16 +0000)]
amd64: depessimize bcmp for small buffers

Adapt assembly generated by clang for memcmp and use it for <= 64 sized
compares (which are the vast majority).

Sample result of doing stats on Broadwell (% of samples):
before: 4.0 kernel     bcmp                 cache_lookup
after : 0.7 kernel     bcmp                 cache_lookup

The routine is most definitely still not optimal. Anyone interested in
spending time improving it is welcome to take over.

Reviewed by: kib

6 years agoAvoid calls to bzero() before ireloc.
kib [Wed, 9 May 2018 14:39:24 +0000 (14:39 +0000)]
Avoid calls to bzero() before ireloc.

Evaluate cpu_stdext_feature early to have moved link_elf_ireloc() see
correct flags, most important is SMAP.

Tested by: mjg
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D15367

6 years agoMinor style nits
imp [Wed, 9 May 2018 14:11:35 +0000 (14:11 +0000)]
Minor style nits

Use full copyright year.
Remove 'All Rights Reserved' from new file (rights holder OK'd)
Minor #ifdef motion and #endif tagging
Remove __FBSDID macro from comments

Sponsored by: Netflix
OK'd by: rrs@

6 years agoConvert share/examples/Makefile over to using FILES and FILESDIR.
brd [Wed, 9 May 2018 13:53:10 +0000 (13:53 +0000)]
Convert share/examples/Makefile over to using FILES and FILESDIR.

The goal is to avoid using install directly so we can make changes the affect
how the entire system is installed, without having to touch many places.

This is part of the packaging base work.

Reviewed by: will
Approved by: bapt (mentor), allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D1513

6 years agoEnable directory creation with FILESDIR.
brd [Wed, 9 May 2018 13:44:54 +0000 (13:44 +0000)]
Enable directory creation with FILESDIR.

This is part of packaging base work.

Reviewed by: will
Approved by: bapt (mentor), allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D15130

6 years agoUpdate NAT64 documentation, now we support any IPv6 prefixes.
ae [Wed, 9 May 2018 12:25:23 +0000 (12:25 +0000)]
Update NAT64 documentation, now we support any IPv6 prefixes.

MFC after: 1 month

6 years agoRemove PG_U from the rest of the kernel pmap ptes.
kib [Wed, 9 May 2018 12:09:08 +0000 (12:09 +0000)]
Remove PG_U from the rest of the kernel pmap ptes.

Supposedly, they PG_U bits there were set to easier making some kernel
page accessible to userspace in-place.  Since it was not used for the
whole existence of the amd64 pmap.c and current design of the shared
pages prefers double-mapping over the in-place access, remove PG_U
both from the direct map and KVA slots.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoRemove PG_U from the recursive pte for kernel pmap' PML4 page.
kib [Wed, 9 May 2018 12:03:40 +0000 (12:03 +0000)]
Remove PG_U from the recursive pte for kernel pmap' PML4 page.

This PML4 page is never used for the userspace process, so there is no
security implications.  But the configuration trips SMAP check, which
should be corrected.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoBring in some last changes in NAT64 implementation:
ae [Wed, 9 May 2018 11:59:24 +0000 (11:59 +0000)]
Bring in some last changes in NAT64 implementation:

o Modify ipfw(8) to be able set any prefix6 not just Well-Known,
  and also show configured prefix6;
o relocate some definitions and macros into proper place;
o convert nat64_debug and nat64_allow_private variables to be
  VNET-compatible;
o add struct nat64_config that keeps generic configuration needed
  to NAT64 code;
o add nat64_check_prefix6() function to check validness of specified
  by user IPv6 prefix according to RFC6052;
o use nat64_check_private_ip4() and nat64_embed_ip4() functions
  instead of nat64_get_ip4() and nat64_set_ip4() macros. This allows
  to use any configured IPv6 prefixes that are allowed by RFC6052;
o introduce NAT64_WKPFX flag, that is set when IPv6 prefix is
  Well-Known IPv6 prefix. It is used to reduce overhead to check this;
o modify nat64lsn_cfg and nat64stl_cfg structures to use nat64_config
  structure. And respectivelly modify the rest of code;
o remove now unused ro argument from nat64_output() function;
o remove __FreeBSD_version ifdef, NAT64 was not merged to older versions;
o add commented -DIPFIREWALL_NAT64_DIRECT_OUTPUT flag to module's Makefile
  as example.

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

6 years agolld: Omit PT_NOTE for SHT_NOTE without SHF_ALLOC
emaste [Wed, 9 May 2018 11:17:01 +0000 (11:17 +0000)]
lld: Omit PT_NOTE for SHT_NOTE without SHF_ALLOC

A non-alloc note section should not have a PT_NOTE program header.

Found while linking ghc (Haskell compiler) with lld on FreeBSD.  Haskell
emits a .debug-ghc-link-info note section (as the name suggests, it
contains link info) as a SHT_NOTE section without SHF_ALLOC set.

For this case ld.bfd does not emit a PT_NOTE segment for
.debug-ghc-link-info.  lld previously emitted a PT_NOTE with p_vaddr = 0
and FreeBSD's rtld segfaulted when trying to parse a note at address 0.

LLVM PR: https://llvm.org/pr37361
LLVM review: https://reviews.llvm.org/D46623

PR: 226872
Reviewed by: dim
Sponsored by: The FreeBSD Foundation

6 years agoAdd IFCAP_LINKSTATE support to if_loop(4).
ae [Wed, 9 May 2018 10:50:51 +0000 (10:50 +0000)]
Add IFCAP_LINKSTATE support to if_loop(4).

Reviewed by: wollman
Obtained from: Yandex LLC
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D15278

6 years agoNow that a special no-SSP libc is used for rtld, allow
kib [Wed, 9 May 2018 10:33:25 +0000 (10:33 +0000)]
Now that a special no-SSP libc is used for rtld, allow
-fstack-protector-all for normal libc builds.

Submitted by: Luis Pires
Reviewed by: brooks
Differential revision: https://reviews.freebsd.org/D15340

6 years agoMake rtld use libc_nossp_pic.a. Remove SSP shims.
kib [Wed, 9 May 2018 10:30:56 +0000 (10:30 +0000)]
Make rtld use libc_nossp_pic.a.  Remove SSP shims.

Submitted by: Luis Pires
Reviewed by: brooks
Differential revision: https://reviews.freebsd.org/D15341

6 years agoCreated static libc PIC/no-SSP library to be used by rtld.
kib [Wed, 9 May 2018 10:28:24 +0000 (10:28 +0000)]
Created static libc PIC/no-SSP library to be used by rtld.

Rtld is not compatible with SSP, and since we link libc_pic.a to rtld
to have the basic support like memory and string copy functions, we
have to both carefully limit libc use, and to provide the ssp support
shims.  This change makes the libc use in rtld more straighforward but
still limited, and allows to remove the shims, to be done in the next
commit.

Submitted by: Luis Pires
Reviewed by: bdrewery, brooks
Differential revision: https://reviews.freebsd.org/D15283

6 years agoAdd myself to copyright in the LinuxKPI RCU support layer.
hselasky [Wed, 9 May 2018 08:50:42 +0000 (08:50 +0000)]
Add myself to copyright in the LinuxKPI RCU support layer.

Suggested by: mmacy@
Sponsored by: Mellanox Technologies

6 years agoenigma(1) Remove reference to PGP; modernize a bit
eadler [Wed, 9 May 2018 07:46:57 +0000 (07:46 +0000)]
enigma(1) Remove reference to PGP; modernize a bit

- the port was removed 2017-06-07 in r442847
- gnupg1 is the older version of gpg with legacy PGP support
- remove unused macro
- remove now-false statement about export restrictions

6 years agocxgbe(4): Add support for hash filters.
np [Wed, 9 May 2018 04:09:49 +0000 (04:09 +0000)]
cxgbe(4): Add support for hash filters.

These filters reside in the card's memory instead of its TCAM and can be
configured via a new "hashfilter" subcommand in cxgbetool.  Hash and
normal TCAM filters can be used together.  The hardware does an
exact-match of packet fields for hash filters, unlike the masked match
performed for TCAM filters.  Any T5/T6 card with memory can support at
least half a million hash filters.  The sample config file with the
driver configures 512K of these, it is possible to double this to 1
million+ in some cases.

The chip does an exact-match of fields of incoming datagrams with hash
filters and performs the action configured for the filter if it matches.
The fields to match are specified in a "filter mask" in the firmware
config file.  The filter mask always includes the 5-tuple (sip, dip,
sport, dport, ipproto).  It can, optionally, also include any subset of
the filter mode (see filterMode and filterMask in the firmware config
file).

For example:
filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe
filterMask = protocol, port, vlan

Exact values of the 5-tuple, the physical port, and VLAN tag would have
to be provided while setting up a hash filter with the chip
configuration above.

Hash filters support all actions supported by TCAM filters.  A packet
that hits a hash filter can be dropped, let through (with optional
steering to a specific queue or RSS region), switched out of another
port (with optional L2 rewrite of DMAC, SMAC, VLAN tag), or get NAT'ed.
(Support for some of these will show up in the driver in a follow-up
commit very shortly).

Sponsored by: Chelsio Communications

6 years agoDocument intentional fallthrough. (CID 976535)
cy [Wed, 9 May 2018 02:07:09 +0000 (02:07 +0000)]
Document intentional fallthrough. (CID 976535)

MFC after: 1 week

6 years agoFix memory leak. (CID 1199373).
cy [Wed, 9 May 2018 02:02:58 +0000 (02:02 +0000)]
Fix memory leak. (CID 1199373).

MFC after: 1 week

6 years agoRemove 'All Rights Reserved' from the collection copyright and templates.
imp [Wed, 9 May 2018 02:02:49 +0000 (02:02 +0000)]
Remove 'All Rights Reserved' from the collection copyright and templates.

The original Berkeley Software Distributions were made in the 1980's
and 1990's. At that time, the Buenos Ares Convention of 1910 was in
force in most of the countries in the Americas. It required an
affirmative statement of rights reservation, typically using 'All
Rights Reserved.' The Regents included this phrase in their copyright
notices to invoke this treaty to ensure maximal copyright protection.

In the 1990's, Latin America coutries ratifeid the Berne Convention on
copyrights which prohibited them from requiring an affirmative
statement to reserve the rights. When Nicaragua ratified in 2000, the
Buenos Ares Convention of 1910 was effectively repealed. This made all
the 'All Rights Reserved' phrases obsolete and legal deadweight most
of the time, and certainly in the cases removed here.

Since it's no longer required, and is in fact meaningless, core has
decided to dropped it from the project's collection copyright and
sample templates. It encourages other rights holders to do the same
after consultation with their legal department.

More see https://en.wikipedia.org/wiki/Buenos_Aires_Convention for
more information.

Approved by: core@ (emaste@, jhb@)
Differential Review:  https://reviews.freebsd.org/D15264

6 years agoReduce overhead of ktrace checks in the common case.
mmacy [Wed, 9 May 2018 00:00:47 +0000 (00:00 +0000)]
Reduce overhead of ktrace checks in the common case.

KTRPOINT() checks both if we are tracing _and_ if we are recursing within
ktrace. The second condition is only ever executed if ktrace is actually
enabled. This change moves the check out of the hot path in to the functions
themselves.

Discussed with mjg@

Reported by: mjg@
Approved by: sbruno@

6 years agoUpgrade to OpenSSH 7.6p1. This will be followed shortly by 7.7p1.
des [Tue, 8 May 2018 23:13:11 +0000 (23:13 +0000)]
Upgrade to OpenSSH 7.6p1.  This will be followed shortly by 7.7p1.

This completely removes client-side support for the SSH 1 protocol,
which was already disabled in 12 but is still enabled in 11.  For that
reason, we will not be able to merge 7.6p1 or newer back to 11.

6 years agonxge(4):
sbruno [Tue, 8 May 2018 21:14:29 +0000 (21:14 +0000)]
nxge(4):
Remove nxge(4) and associated man page and tools in FreeBSD 12.0.

Submitted by: kbowling
Reviewed by: brooks
Relnotes: yes
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D1529

6 years agoUpdate svn_private_config.h - I misread an autoconf change.
peter [Tue, 8 May 2018 21:01:04 +0000 (21:01 +0000)]
Update svn_private_config.h - I misread an autoconf change.
SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL -> SVN_LIBSVN_RA_LINKS_RA_LOCAL
SVN_LIBSVN_CLIENT_LINKS_RA_SERF -> SVN_LIBSVN_RA_LINKS_RA_SERF
SVN_LIBSVN_CLIENT_LINKS_RA_SVN -> SVN_LIBSVN_RA_LINKS_RA_SVN

6 years agoFix two typos reported by N. J. Mann, which were introduced in
tuexen [Tue, 8 May 2018 20:39:35 +0000 (20:39 +0000)]
Fix two typos reported by N. J. Mann, which were introduced in
https://svnweb.freebsd.org/changeset/base/333382 by me.

MFC after: 3 days

6 years agoRemove ignored command line options
imp [Tue, 8 May 2018 20:02:44 +0000 (20:02 +0000)]
Remove ignored command line options

The --device and --part command line options were planned for Linux
compatibility mode. However, that mode will never happen, so remove
them as last vestiges of a false start.

Submitted by: Vlad Movchan

6 years agoefibootmgr.8: fix example
imp [Tue, 8 May 2018 20:02:39 +0000 (20:02 +0000)]
efibootmgr.8: fix example

The example given was for the old, and now deleted, Linux
compatibility mode. Update the example for the current code.

Submitted by: Vlad Movchan

6 years agoImprove printing the boot variables.
imp [Tue, 8 May 2018 19:43:57 +0000 (19:43 +0000)]
Improve printing the boot variables.

Print the boot variables in the order in the BootOrder variable, if it
exists, and then in verbose mode print any unreferneced BootXXXX
variables. If BootOrder isn't set, fall back to printing all the
variables.

Sponsored by: Netflix

6 years agoWhen reporting ERROR or ABORT chunks, don't use more data
tuexen [Tue, 8 May 2018 18:48:51 +0000 (18:48 +0000)]
When reporting ERROR or ABORT chunks, don't use more data
that is guaranteed to be contigous.
Thanks to Felix Weinrank for finding and reporting this bug
by fuzzing the usrsctp stack.

MFC after: 3 days

6 years agoInline print_order(). It's used one palce.
imp [Tue, 8 May 2018 18:25:37 +0000 (18:25 +0000)]
Inline print_order(). It's used one palce.

6 years agoMFV: r333378
jkim [Tue, 8 May 2018 18:18:27 +0000 (18:18 +0000)]
MFV: r333378

Import ACPICA 20180508.

6 years agoUse vYYYYMMDD in the timestamp suffix for Google Compute Engine
gjb [Tue, 8 May 2018 17:15:12 +0000 (17:15 +0000)]
Use vYYYYMMDD in the timestamp suffix for Google Compute Engine
snapshot images for consistency with other OSes.

MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation

6 years agoiflib: print message when iflib_tx_structures_setup fails
shurd [Tue, 8 May 2018 17:15:10 +0000 (17:15 +0000)]
iflib: print message when iflib_tx_structures_setup fails

Print a message when iflib_tx_structures_setup fails, like we do for
iflib_rx_structures_setup.

Now that we always print a message from within
iflib_qset_structures_setup when it fails, stop printing one in
iflib_device_register() at the call site.

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: gallatin
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D15300

6 years agoPrepare DB# handler for deferred trigger of watchpoints.
kib [Tue, 8 May 2018 17:00:34 +0000 (17:00 +0000)]
Prepare DB# handler for deferred trigger of watchpoints.

Since pop %ss/mov %ss instructions defer all interrupts and exceptions
for the next instruction, it is possible that the userspace watchpoint
trap executes on the first instruction of the kernel entry for
syscall/bpt.

In this case, DB# should be treated similarly to NMI: on amd64 we must
always load GSBASE even if the trap comes from kernel mode, and load
the kernel page table root into %cr3.  Moreover, the trap must
use the dedicated stack, because we are still on the user stack when
trapped on syscall entry.

For i386, we must reload %cr3.  The syscall instruction is not configured,
so there is no issue with executing on user stack when trapping.

Due to some CPU erratas it is not always possible to detect that the
userspace watchpoint triggered by inspecting %dr6.  In trap(), compare the
trap %rip with the known unsafe entry points and if matched pretend that
the watchpoint did not fire at all.

Thank you to the MSRC Incident Response Team, and in particular Greg
Lenti and Nate Warfield, for coordinating the response to this issue
across multiple vendors.

Thanks to Computer Recycling at The Working Center of Kitchener for
making hardware available to allow us to test the patch on additional
CPU families.

Reviewed by: jhb
Discussed with: Matthew Dillon
Tested by: emaste
Sponsored by: The FreeBSD Foundation
Security: CVE-2018-8897
Security: FreeBSD-SA-18:06.debugreg

6 years agoiflib: cleanup queues when iflib_device_register fail
shurd [Tue, 8 May 2018 16:56:02 +0000 (16:56 +0000)]
iflib: cleanup queues when iflib_device_register fail

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: gallatin
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D15299

6 years agoWe don't use f_devdata, so don't set it. Should that need to change
imp [Tue, 8 May 2018 16:16:56 +0000 (16:16 +0000)]
We don't use f_devdata, so don't set it. Should that need to change
later, we can. This leaves ZFS as the only irregular f_devdata
user in the tree.