]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFV r338797:
Martin Matuska [Thu, 20 Sep 2018 11:44:36 +0000 (11:44 +0000)]
MFV r338797:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1019: Add allocation check for the zip_entry struct
  Oss-Fuzz #10192: Handle whitespace-only ACL fields correctly

Approved by: re (kib)
MFC after: 1 week

5 years agoImport mandoc 1.14.4
Baptiste Daroussin [Thu, 20 Sep 2018 10:58:52 +0000 (10:58 +0000)]
Import mandoc 1.14.4

Approved by: re (kib)
MFC after: 1 week

5 years agoMove the openssl.cnf install to secure/usr.bin/openssl/
Brad Davis [Thu, 20 Sep 2018 09:34:55 +0000 (09:34 +0000)]
Move the openssl.cnf install to secure/usr.bin/openssl/

This leverages CONFS to do the install

Approved by: re (pkgbase, blanket), bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D17245

5 years agoMove nsmb.conf to lib/libsmb/
Brad Davis [Thu, 20 Sep 2018 09:31:27 +0000 (09:31 +0000)]
Move nsmb.conf to lib/libsmb/

This leverages CONFS to do the install

Approved by: re (pkgbase, blanket), bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D17243

5 years agoMove opieaccess to lib/libopie/
Brad Davis [Thu, 20 Sep 2018 09:26:10 +0000 (09:26 +0000)]
Move opieaccess to lib/libopie/

This leverages CONFS to do the install

Approved by: re (blanket, pkgbase), bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D17241

5 years agoMove hosts.lpd and printcap to usr.sbin/lpr/lpd/
Brad Davis [Thu, 20 Sep 2018 09:21:05 +0000 (09:21 +0000)]
Move hosts.lpd and printcap to usr.sbin/lpr/lpd/

This leverages CONFS to handle the install

Approved by: re (blanket, pkgbase), bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D17238

5 years agoimport mandoc 1.14.1
Baptiste Daroussin [Thu, 20 Sep 2018 07:33:14 +0000 (07:33 +0000)]
import mandoc 1.14.1

5 years agoVarious fixes for floating point on RISC-V.
John Baldwin [Wed, 19 Sep 2018 23:45:18 +0000 (23:45 +0000)]
Various fixes for floating point on RISC-V.

- Explicitly load an empty initial state into FP registers when taking
  the fault on the first FP instruction in a thread.  Setting
  SSTATE.FS to INITIAL is just a marker to let context switch restore
  code know that it can load FP registers with zeroes instead of
  memory loads.  It does not imply that the hardware will reset all
  registers to zero on first access.  In addition, set the state to
  CLEAN instead of INITIAL after the first FP instruction.
  cpu_switch() doesn't do anything for INITIAL and only restores from
  the pcb if the state is CLEAN.  We could perhaps change cpu_switch
  to call fpe_state_clear if the state was INITIAL and leave SSTATE.FS
  set to INITIAL instead of CLEAN after the first FP instruction.
  However, adding this complexity to cpu_switch() doesn't seem worth
  the supposed gain.
- Only save the current FPU registers in fill_fpregs() if the request
  is made to save the current thread's registers.  Previously if a
  debugger requested FP registers via ptrace() it was getting a copy
  of the debugger's FP registers rather than the debugee's.
- Zero the entire FP register set structure returned for ptrace() if a
  thread hasn't used FP registers rather than leaking garbage in the
  fp_fcsr field.
- If a debugger writes FP registers via ptrace(), always mark the pcb
  as having valid FP registers and set SSTATUS.FS_MASK to CLEAN so
  that the registers will be restored when the debugged thread
  resumes.
- Be more explicit about clearing the SSTATUS.FS field before setting
  it to CLEAN on the first FP instruction trap.

Submitted by: br, markj
Approved by: re (rgrimes)
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D17141

5 years agoClear all of the VFP state in fill_fpregs().
John Baldwin [Wed, 19 Sep 2018 22:53:52 +0000 (22:53 +0000)]
Clear all of the VFP state in fill_fpregs().

Zero the entire FP register set structure returned for ptrace() if a
thread hasn't used FP registers rather than leaking garbage in the
fp_sr and fp_cr fields.

Reviewed by: emaste, andrew
Approved by: re (rgrimes)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17140

5 years agoopenssh: rename local macro to avoid OpenSSL 1.1.1 conflict
Ed Maste [Wed, 19 Sep 2018 20:52:47 +0000 (20:52 +0000)]
openssh: rename local macro to avoid OpenSSL 1.1.1 conflict

Local changes introduced an OPENSSH_VERSION macro, but this conflicts
with a macro of the same name introduced with OepnsSL 1.1.1

Reviewed by: des
Approved by: re (gjb)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoConvert x86 cache invalidation functions to ifuncs.
Konstantin Belousov [Wed, 19 Sep 2018 19:35:02 +0000 (19:35 +0000)]
Convert x86 cache invalidation functions to ifuncs.

This simplifies the runtime logic and reduces the number of
runtime-constant branches.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D16736

5 years agoMove kernel vmem arena initialization to vm_kern.c.
Mark Johnston [Wed, 19 Sep 2018 19:13:43 +0000 (19:13 +0000)]
Move kernel vmem arena initialization to vm_kern.c.

This keeps the initialization coupled together with the kmem_* KPI
implementation, which is the main user of these arenas.

No functional change intended.

Reviewed by: alc
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17247

5 years agoUpdate udp6_output() inp locking to avoid concurrency issues with
Bjoern A. Zeeb [Wed, 19 Sep 2018 18:49:37 +0000 (18:49 +0000)]
Update udp6_output() inp locking to avoid concurrency issues with
route cache updates.

Bring over locking changes applied to udp_output() for the route cache
in r297225 and fixed in r306559 which achieve multiple things:
(1) acquire an exclusive inp lock earlier depending on the expected
    conditions; we add a comment explaining this in udp6,
(2) having acquired the exclusive lock earlier eliminates a slight
    possible chance for a race condition which was present in v4 for
    multiple years as well and is now gone, and
(3) only pass the inp_route6 to ip6_output() if we are holding an
    exclusive inp lock, so that possible route cache updates in case
    of routing table generation number changes can happen safely.
In addition this change (as the legacy IP counterpart) decomposes the
tracking of inp and pcbinfo lock and adds extra assertions, that the
two together are acquired correctly.

PR: 230950
Reviewed by: karels, markj
Approved by: re (gjb)
Pointyhat to: bz (for completely missing this bit)
Differential Revision: https://reviews.freebsd.org/D17230

5 years agoConvert i386 NPX hardware context save methods to ifuncs.
Konstantin Belousov [Wed, 19 Sep 2018 16:37:43 +0000 (16:37 +0000)]
Convert i386 NPX hardware context save methods to ifuncs.

Since ifunc-capable linker is now required on i386, bring this code in
line with the amd64 counterpart.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D16736

5 years agovm: check for empty kstack cache before locking
Mateusz Guzik [Wed, 19 Sep 2018 16:02:33 +0000 (16:02 +0000)]
vm: check for empty kstack cache before locking

The current cache logic checks the total number of stacks in the kernel,
which even on small boxes significantly exceeds the 128 limit (e.g. an
8-way box with zfs has almost 800 stacks allocated).

Stacks are cached earlier for each main thread.

As a result the code is rarely executed, but when it is then (on boxes like
the above) it always fails. Since there are no provisions made for NUMA and
release time is approaching, just do a quick check to avoid acquiring the
lock.

Approved by: re (kib)

5 years agoamd64 pmap: remove tautological assert.
Konstantin Belousov [Wed, 19 Sep 2018 15:39:16 +0000 (15:39 +0000)]
amd64 pmap: remove tautological assert.

pm_pcid is unsigned.

Reviewed by: cem, markj
CID: 1395727
Noted by: cem
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D17235

5 years agoMove remote & phones to usr.bin/tip/tip/
Brad Davis [Wed, 19 Sep 2018 14:56:53 +0000 (14:56 +0000)]
Move remote & phones to usr.bin/tip/tip/

Approved by: re (blanket, pkgbase), will (mentor)
Differential Revision: https://reviews.freebsd.org/D17219

5 years agoFix ZFS VFS op quotactl to follow busy protocol.
Konstantin Belousov [Wed, 19 Sep 2018 14:38:01 +0000 (14:38 +0000)]
Fix ZFS VFS op quotactl to follow busy protocol.

Reviewed by: avg, mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17208

5 years agoFix state of dquot-less vnodes after failed quotaoff.
Konstantin Belousov [Wed, 19 Sep 2018 14:36:57 +0000 (14:36 +0000)]
Fix state of dquot-less vnodes after failed quotaoff.

UFS quotaoff iterates over all mp vnodes, and derefences and clears
the pointers to corresponding dquots. If SU work items transiently
reference some of dquots,quotaoff() would eventually fail, but all
processed vnodes are already stripped from dquots.  The state is
problematic, since quotas are left enabled, but there is no dquots
where blocks and inodes can be accounted.  The result is assertion
failures and NULL pointer dereferences.

Fix it by suspending writes around quotaoff() call.  Since the
filesystem is synced, no dandling references to dquots from SU
workitems can left behind, which means that quotaoff succeeds.

The complication there is that quotaoff VFS op is performed with the
mount point busied, while to suspend, we need to start write on the
mp.  If vn_start_write() is called on busied mp, system might deadlock
against parallel unmount request.  Handle this by unbusy-ing mp before
starting write, which in turn requires changing the quotaoff()
interface to return with the mount point not busied, same as was done
for quotaon().

Reviewed by: mckusick
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D17208

5 years agoUpdate vendor/libarchive/dist to git 0cda60af13e709e670af90553b2271bf194e7ccd
Martin Matuska [Wed, 19 Sep 2018 10:26:45 +0000 (10:26 +0000)]
Update vendor/libarchive/dist to git 0cda60af13e709e670af90553b2271bf194e7ccd

Relevant vendor changes:
  PR #1019: Add allocation check for the zip_entry struct
  Oss-Fuzz #10192: Handle whitespace-only ACL fields correctly

5 years agoMove regdomain.xml to lib/lib80211/
Brad Davis [Wed, 19 Sep 2018 09:29:06 +0000 (09:29 +0000)]
Move regdomain.xml to lib/lib80211/

This leverages CONFS to handle the install.  lib80211 was picked because it is
where this file is actually used from.

Approved by: re (blanket, pkgbase), will (mentor)
Differential Revision: https://reviews.freebsd.org/D17229

5 years agocxgbetool(8): Clarify the meaning of the "queue" parameter used to steer
Navdeep Parhar [Tue, 18 Sep 2018 22:41:30 +0000 (22:41 +0000)]
cxgbetool(8): Clarify the meaning of the "queue" parameter used to steer
traffic to a particular queue.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Approved by: re@ (kib@)

5 years agocxgbe(4): Enable TXRTLMT by default when the feature is available in the
Navdeep Parhar [Tue, 18 Sep 2018 21:34:37 +0000 (21:34 +0000)]
cxgbe(4): Enable TXRTLMT by default when the feature is available in the
kernel (options RATELIMIT) and provisioned in the driver's configuration
file (nethofld > 0).

Submitted by: gallatin@
Approved by: re@ (kib@)

5 years agoMove libalias.conf to lib/libalias/libalias/
Brad Davis [Tue, 18 Sep 2018 20:54:37 +0000 (20:54 +0000)]
Move libalias.conf to lib/libalias/libalias/

This leveages CONFS to handle the install.

Approved by: re (blanket, pkgbase), bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D17218

5 years agoMove disktab to sbin/bsdlabel/
Brad Davis [Tue, 18 Sep 2018 20:52:24 +0000 (20:52 +0000)]
Move disktab to sbin/bsdlabel/

This leverages CONFS to handle the install.

Approved by: re (blanket, pkgbase), will (mentor)
Differential Revision: https://reviews.freebsd.org/D17217

5 years agoMove install of locate.rc to usr.bin/locate/locate/
Brad Davis [Tue, 18 Sep 2018 20:50:07 +0000 (20:50 +0000)]
Move install of locate.rc to usr.bin/locate/locate/

This leverages CONFS to handle the install and purges an old comment.

Approved by: re (blanket, pkgbase), bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D17215

5 years agoMove mail.rc install to usr.bin/mail.
Brad Davis [Tue, 18 Sep 2018 20:47:06 +0000 (20:47 +0000)]
Move mail.rc install to usr.bin/mail.

This leverages CONFS to do the install

Approved by: re (blanket, pkgbase), bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D17216

5 years agoOnly update the domain cursor once in keg_fetch_slab().
Mark Johnston [Tue, 18 Sep 2018 17:51:45 +0000 (17:51 +0000)]
Only update the domain cursor once in keg_fetch_slab().

We drop the keg lock when we go to actually allocate the slab, allowing
other threads to advance the cursor.  This can cause us to exit the
round-robin loop before having attempted allocations from all domains,
resulting in a hang during a subsequent blocking allocation attempt from
a depleted domain.

Reported and tested by: Jan Bramkamp <crest@bultmann.eu>
Reviewed by: alc, cem
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17209

5 years agoUpdate the pkg-stage.sh script used to populate packages on the
Glen Barber [Tue, 18 Sep 2018 16:57:04 +0000 (16:57 +0000)]
Update the pkg-stage.sh script used to populate packages on the
dvd1.iso installation medium from including KDE4 to KDE5, as the
KDE4-based ports have been marked as deprecated in the Ports
Collection.

MFC after: 3 days
Approved by: re (rgrimes)
Sponsored by: The FreeBSD Foundation

5 years agoRegen after r338752.
Brooks Davis [Tue, 18 Sep 2018 16:16:58 +0000 (16:16 +0000)]
Regen after r338752.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17211

5 years agoOnly enable HyperV support by default on x86.
Brooks Davis [Tue, 18 Sep 2018 16:06:24 +0000 (16:06 +0000)]
Only enable HyperV support by default on x86.

Without this we get spurious output during boot as we try to run
nonexistant HyperV scripts on non-x86 models.

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17211

5 years agoFix C11 and POSIX 1003.1b-1993 compliance in time.h
Brooks Davis [Tue, 18 Sep 2018 15:31:24 +0000 (15:31 +0000)]
Fix C11 and POSIX 1003.1b-1993 compliance in time.h

Only expose timespec_get in C11, C++17, or BSD code.  Always define
struct timespect if defining timespec_get.

PR: 231425
Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17174

5 years agoRequire ifunc-capable linker for i386
Ed Maste [Tue, 18 Sep 2018 15:01:21 +0000 (15:01 +0000)]
Require ifunc-capable linker for i386

The amd64 kernel started using ifunc for a variety of functions with
arch-specific implementations, and we would like to make use of the
same functionality on i386 and as much as possible avoid divergence
between i386 and amd64.  In particular, future changes for security
improvements and mitigations may rely on ifunc support.

Approved by: re (kib)
Sponsored by: The FreeBSD Foundation

5 years agoRemove unused code.
Michael Tuexen [Tue, 18 Sep 2018 10:53:07 +0000 (10:53 +0000)]
Remove unused code.

Approved by: re (kib@)
MFC after: 1 week

5 years agoMove mac.conf to lib/libc/posix1e/
Brad Davis [Tue, 18 Sep 2018 01:40:37 +0000 (01:40 +0000)]
Move mac.conf to lib/libc/posix1e/

This leverages CONFS to handle the install of the config file.

Approved by: re (blanket, pkgbase), will (mentor)
Differential Revision: https://reviews.freebsd.org/D17162

5 years agoFix CONFS to append the value in this case.
Brad Davis [Tue, 18 Sep 2018 01:38:44 +0000 (01:38 +0000)]
Fix CONFS to append the value in this case.

Approved by: re (blanket, pkgbase), will (mentor)

5 years agovm: stop taking proc lock in mmap to satisfy racct if it is disabled
Mateusz Guzik [Tue, 18 Sep 2018 01:24:30 +0000 (01:24 +0000)]
vm: stop taking proc lock in mmap to satisfy racct if it is disabled

Limits can be safely obtained with lim_cur from the thread. racct is compiled
in but disabled by default. Note that racct enablement is a boot-only tunable.

This eliminates second most common place of taking the lock while pkg building.

While here don't take the lock in mlockall either.

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17210

5 years agoMove amd.map to usr.sbin/amd/amd/
Brad Davis [Tue, 18 Sep 2018 00:32:10 +0000 (00:32 +0000)]
Move amd.map to usr.sbin/amd/amd/

This leverages CONFS to handle the install of the config file.

Approved by: re (gjb), will (mentor)
Differential Revision: https://reviews.freebsd.org/D17159

5 years agoMove libmap.conf to libexec/rtld-elf/
Brad Davis [Tue, 18 Sep 2018 00:25:00 +0000 (00:25 +0000)]
Move libmap.conf to libexec/rtld-elf/

This leverages CONFS to handle the config file install.

Approved by: re (gjb), will (mentor)
Differential Revision: https://reviews.freebsd.org/D17161

5 years agoMove dhclient.conf to sbin/dhclient/.
Brad Davis [Tue, 18 Sep 2018 00:11:45 +0000 (00:11 +0000)]
Move dhclient.conf to sbin/dhclient/.

This also leverages CONFS for handling config files.

Approved by: re (gjb), will (mentor)
Differential Revision: https://reviews.freebsd.org/D17160

5 years agoRemove dhclient.conf from here in prep for the move of it from etc/.
Brad Davis [Tue, 18 Sep 2018 00:10:29 +0000 (00:10 +0000)]
Remove dhclient.conf from here in prep for the move of it from etc/.

This is being done a separate step to ease importing into other VCSes.

Approved by: re (gjb), will (mentor)
Differential Revision: https://reviews.freebsd.org/D17160

5 years agoDIRS: Rework how duplicated dirs are installed.
Bryan Drewery [Mon, 17 Sep 2018 22:15:12 +0000 (22:15 +0000)]
DIRS: Rework how duplicated dirs are installed.

- Warn if multiple DIRS have conflicting metadata
- This fixes META_MODE writing to a very long .meta file that contained
  the full DESTDIR path.

Reported by: sjg, jonathan
Sponsored by: Dell EMC
Approved by: re (gjb)

5 years agoinstalldirs can be a recursive/standalone target.
Bryan Drewery [Mon, 17 Sep 2018 22:15:09 +0000 (22:15 +0000)]
installdirs can be a recursive/standalone target.

Sponsored by: Dell EMC
Approved by: re (gjb)

5 years agoPROGS: Don't redundantly process DIRS.
Bryan Drewery [Mon, 17 Sep 2018 22:15:06 +0000 (22:15 +0000)]
PROGS: Don't redundantly process DIRS.

Sponsored by: Dell EMC
Approved by: re (gjb)

5 years agoDIRS: installdirs should also be .PHONY
Bryan Drewery [Mon, 17 Sep 2018 22:14:53 +0000 (22:14 +0000)]
DIRS: installdirs should also be .PHONY

Sponsored by: Dell EMC
Approved by: re (gjb, kib)

5 years agoFixed isses:
David C Somayajulu [Mon, 17 Sep 2018 20:15:18 +0000 (20:15 +0000)]
Fixed isses:
 State check before enqueuing transmit task in bxe_link_attn() routine.
 State check before invoking bxe_nic_unload in bxe_shutdown().

Submitted by:Vaishali.Kulkarni@cavium.com
Approved by:re(gjb)

5 years agoDo not upgrade the vnode lock to call getinoquota().
Konstantin Belousov [Mon, 17 Sep 2018 19:38:43 +0000 (19:38 +0000)]
Do not upgrade the vnode lock to call getinoquota().

Doing so can deadlock when the thread already owns another vnode lock,
e.g. during a rename, as was demonstrated by the reporter.  In fact,
there seems to be no need to force the call to getinoquota() always,
because vn_open() locks vnode exclusively, and this is the most
important case.  To add to the point, directories where the dirent is
added or removed, are locked exclusively as well.

Reported by: bwidawsk
Tested by: bwidawsk, pho (as part of the larger patch)
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

5 years agoMove rpc and netconfig to lib/libc/rpc/
Brad Davis [Mon, 17 Sep 2018 19:20:50 +0000 (19:20 +0000)]
Move rpc and netconfig to lib/libc/rpc/

This uses relative paths to make it more specific to avoid any potential
future problems with .PATH and leverages CONFS.

libc was picked as the destination location for these because of the syscalls
that use these files as the lowest level place they are referenced.

Approved by: re (gjb), will (mentor)
Differential Revision: https://reviews.freebsd.org/D17163

5 years agoMove hosts, hosts.equiv, networks, nsswitch.conf, protocols to lib/libc/net/
Brad Davis [Mon, 17 Sep 2018 18:56:47 +0000 (18:56 +0000)]
Move hosts, hosts.equiv, networks, nsswitch.conf, protocols to lib/libc/net/

This uses relative paths to make it more specific to avoid any potential
future problems with .PATH and leverages CONFS.

libc was picked as the destination location for these because of the syscalls
that use these files as the lowest level place they are referenced.

Approved by: re (gjb), will (mentor)
Differential Revision: https://reviews.freebsd.org/D17164

5 years agoFix a regression in r338360 when booting an x86 machine without APIC.
John Baldwin [Mon, 17 Sep 2018 17:18:54 +0000 (17:18 +0000)]
Fix a regression in r338360 when booting an x86 machine without APIC.

The atpic_register_sources callback tries to avoid registering interrupt
sources that would collide with an I/O APIC.  However, the previous
implementation was failing to register IRQs 8-15 since the slave PIC
saw valid IRQs from the master and assumed an I/O APIC was present.  To
fix, go back to registering all 8259A interrupt sources in one loop when
the master's register_sources method is invoked.

PR: 231291
Approved by: re (kib)
MFC after: 1 month

5 years agoFix an nvpair leak in vdev_geom_read_config().
Mark Johnston [Mon, 17 Sep 2018 16:16:57 +0000 (16:16 +0000)]
Fix an nvpair leak in vdev_geom_read_config().

Also change the behaviour slightly: instead of freeing "config" if the
last nvlist doesn't pass the tests, return the last config that did pass
those tests.  This matches the comment at the beginning of the function.

PR: 230704
Diagnosed by: avg
Reviewed by: asomers, avg
Tested by: Mark Martinec <Mark.Martinec@ijs.si>
Approved by: re (gjb)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential revision:  https://reviews.freebsd.org/D17202

5 years agoUse ifunc to resolve context switching mode on amd64.
Konstantin Belousov [Mon, 17 Sep 2018 15:52:19 +0000 (15:52 +0000)]
Use ifunc to resolve context switching mode on amd64.

Patch removes all checks for pti/pcid/invpcid from the context switch
path. I verified this by looking at the generated code, compiling with
the in-tree clang.  The invpcid_works1 trick required inline attribute
for pmap_activate_sw_pcid_pti() to work.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D17181

5 years agoamd64: tidy up kernel memmove, take 2
Mateusz Guzik [Mon, 17 Sep 2018 15:51:49 +0000 (15:51 +0000)]
amd64: tidy up kernel memmove, take 2

There is no need to use %rax for temporary values and avoiding doing
so shortens the func.
Handle the explicit 'check for tail' depessimisization for backwards copying.

This reduces the diff against userspace.

Tested with the glibc test suite.

Approved by: re (kib)

5 years agoamd64: depessimize userspace memcpy/memmove/bcopy
Mateusz Guzik [Mon, 17 Sep 2018 15:49:35 +0000 (15:49 +0000)]
amd64: depessimize userspace memcpy/memmove/bcopy

The change resembles what was done in r334537 for kernel routines.
While here take care of i386 variants. Note that primitives remain
suboptimal.

Reviewed by: kib (previous version)
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17167

5 years agoCalculate PTI, PCID and INVPCID modes earlier, before ifuncs are resolved.
Konstantin Belousov [Mon, 17 Sep 2018 15:34:19 +0000 (15:34 +0000)]
Calculate PTI, PCID and INVPCID modes earlier, before ifuncs are resolved.

This will be used in following conversion of pmap_activate_sw().

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D17181

5 years agoMake the PTI violation check to follow style of the SMAP check.
Konstantin Belousov [Mon, 17 Sep 2018 14:59:05 +0000 (14:59 +0000)]
Make the PTI violation check to follow style of the SMAP check.
No functional changes.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (rgrimes)
Differential revision: https://reviews.freebsd.org/D17181

5 years agoRestore outbound packets capturing for if_gre(4). It was missed in r335048.
Andrey V. Elsukov [Mon, 17 Sep 2018 10:10:14 +0000 (10:10 +0000)]
Restore outbound packets capturing for if_gre(4). It was missed in r335048.
Also clear M_MCAST and M_BCAST flags for encapsulated datagram, since it
will have new IP header.

Approved by: re (kib)

5 years agoRevert amd64: tidy up kernel memmove
Mateusz Guzik [Sun, 16 Sep 2018 21:46:27 +0000 (21:46 +0000)]
Revert amd64: tidy up kernel memmove

There is a braino in the non-erms variant which breaks the
functionality.

Will be fixed at a later time with a different patch.

Reported by: Manfred Antar
Approved by: re (implicit)

5 years ago[ig4] Fix device description for Kaby Lake systems
Oleksandr Tymoshenko [Sun, 16 Sep 2018 21:44:36 +0000 (21:44 +0000)]
[ig4] Fix device description for Kaby Lake systems

Kaby Lake I2C controller is Intel Sunrise Point-H not Intel Sunrise Point-LP.

Submitted by: Dmitry Luhtionov
Approved by: re (kib)

5 years agoamd64: tidy up kernel memmove
Mateusz Guzik [Sun, 16 Sep 2018 19:28:27 +0000 (19:28 +0000)]
amd64: tidy up kernel memmove

There is no need to use %rax for temporary values and avoiding doing
so shortens the func.
Handle the explicit 'check for tail' depessimisization for backwards copying.

This reduces the diff against userspace.

Approved by: re (kib)

5 years agoRemove unneeded new line from the panic string.
Konstantin Belousov [Sun, 16 Sep 2018 18:36:42 +0000 (18:36 +0000)]
Remove unneeded new line from the panic string.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (rgrimes)
Differential revision: https://reviews.freebsd.org/D17181

5 years agoSignificantly improve pf purge cpu usage by only taking locks
John-Mark Gurney [Sun, 16 Sep 2018 00:44:23 +0000 (00:44 +0000)]
Significantly improve pf purge cpu usage by only taking locks
when there is work to do.  This reduces CPU consumption to one
third on systems.  This will help keep the thread CPU usage under
control now that the default hash size has increased.

Reviewed by: kp
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D17097

5 years agoPull in r325478 from upstream clang trunk (by Ivan A. Kosarev):
Dimitry Andric [Sat, 15 Sep 2018 21:22:50 +0000 (21:22 +0000)]
Pull in r325478 from upstream clang trunk (by Ivan A. Kosarev):

  [CodeGen] Initialize large arrays by copying from a global

  Currently, clang compiles explicit initializers for array elements
  into series of store instructions. For large arrays of built-in types
  this results in bloated output code and significant amount of time
  spent on the instruction selection phase. This patch fixes the issue
  by initializing such arrays with global constants that store the
  binary image of the initializer.

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

This should fix a compiler hang (and excessive memory usage) while
building the science/rmg port.

Approved by: re (kib)
Reported by: yuri@tsoft.com
See also: https://bugs.llvm.org/show_bug.cgi?id=38798
MFC after: 3 days

5 years agoPull in r335365 from upstream llvm trunk (by Krzysztof Parzyszek):
Dimitry Andric [Fri, 14 Sep 2018 19:25:23 +0000 (19:25 +0000)]
Pull in r335365 from upstream llvm trunk (by Krzysztof Parzyszek):

  Initialize LiveRegs once in BranchFolder::mergeCommonTails

This should fix '(TRI && "LivePhysRegs is not initialized."' assertions
when building the lang/qt5-qml port in certain configurations.

Approved by: re (kib)
Reported by: Piotr Kubaj <pkubaj@anongoth.pl>
PR: 231355
MFC after: 3 days

5 years agoFix "fasthalt" to halt instead of reboot
Eric van Gyzen [Fri, 14 Sep 2018 18:12:30 +0000 (18:12 +0000)]
Fix "fasthalt" to halt instead of reboot

fasthalt has behaved like reboot, instead of like halt, since r228408
(2011, 10.0-RELEASE).  Fix it.  One wonders if anyone will notice.

Approved by: re (kib)
MFC after: 3 days
Sponsored by: Dell EMC Isilon

5 years agoLog a message after a successful boot-time microcode update.
Mark Johnston [Fri, 14 Sep 2018 17:04:36 +0000 (17:04 +0000)]
Log a message after a successful boot-time microcode update.

Reviewed by: kib
Approved by: re (delphij)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17135

5 years agoSet ident for GENERIC-MMCCAM to not announce itself as
Bjoern A. Zeeb [Fri, 14 Sep 2018 15:46:31 +0000 (15:46 +0000)]
Set ident for GENERIC-MMCCAM to not announce itself as
GENERIC anymore.

Reviewed by: andrew
Approved by: re (gjb)

5 years agoAdd the "-t" option to geom(8) utility, to display geoms hierarchy.
Edward Tomasz Napierala [Fri, 14 Sep 2018 15:29:45 +0000 (15:29 +0000)]
Add the "-t" option to geom(8) utility, to display geoms hierarchy.
Sample output:

% geom -t
Geom             Class      Provider
da0              DISK       da0
  da0            PART       da0s1
    da0s1        PART       da0s1a
      ffs.da0s1a VFS
      da0s1a     DEV
    da0s1        DEV
  da0            DEV
da1              DISK       da1
  swap           SWAP
  da1            DEV
cd0              DISK       cd0
  cd0            DEV

Reviewed by: oshogbo
Approved by: re (kib)
MFC after: 2 weeks
Relnotes: yes
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17151

5 years agoamd64: implement pagezero_erms
Mateusz Guzik [Fri, 14 Sep 2018 15:29:35 +0000 (15:29 +0000)]
amd64: implement pagezero_erms

Intel docs claim such a memset (rep stosb + 4096 bytes) is
special-cased by microarchs. They also switched Linux to use
it for this purpose.

Approved by: re (gjb)

5 years agolld: add -z interpose support
Ed Maste [Fri, 14 Sep 2018 15:15:16 +0000 (15:15 +0000)]
lld: add -z interpose support

-z interpose sets the DF_1_INTERPOSE flag, marking the object as an
interposer.

Committed upstream as LLVM r342239.

PR: 230604
Reported by: jbeich
Reviewed by: markj
Approved by: re (kib)
MFC after: 1 week
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17172

5 years agoImprove LibUSB debugging by simultaneously allowing both function
Hans Petter Selasky [Fri, 14 Sep 2018 13:41:37 +0000 (13:41 +0000)]
Improve LibUSB debugging by simultaneously allowing both function
and transfer prints. Make sure the debug level comes from the
correct USB context.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231264
MFC after: 1 week
Approved by: re (kib)
Sponsored by: Mellanox Technologies

5 years agohwpmc: set default rate if event description lacks one / filter rate against misuse
Matt Macy [Fri, 14 Sep 2018 01:30:05 +0000 (01:30 +0000)]
hwpmc: set default rate if event description lacks one / filter rate against misuse

Not all event descriptions have a sample rate (such as inst_retired.any)
this will restore the legacy behavior of using 65536 in that case. It also
prevents accidental API misuse that could lead to panic.

PR: 230985
Reported by: markj
Reviewed by: markj
Approved by: re (gjb)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D16958

5 years agore-enable pmcstat, pmccontrol, and pmcannotate for gcc4 builds
Matt Macy [Fri, 14 Sep 2018 01:11:10 +0000 (01:11 +0000)]
re-enable pmcstat, pmccontrol, and pmcannotate for gcc4 builds

I had disabled building of the aforementioned targets due to warnings breaking
tinderbox. This silences the warning and restores them to the build.

Reported by: jhibbits
Reviewed by: jhibbits
Approved by: re (gjb)

5 years agoUpdate head from ALPHA5 to ALPHA6 as part of the 12.0-RELEASE
Glen Barber [Thu, 13 Sep 2018 23:59:59 +0000 (23:59 +0000)]
Update head from ALPHA5 to ALPHA6 as part of the 12.0-RELEASE
cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agocxgbe(4): Use the correct number of parameters when querying the tid
Navdeep Parhar [Thu, 13 Sep 2018 22:58:13 +0000 (22:58 +0000)]
cxgbe(4): Use the correct number of parameters when querying the tid
range for hashfilters.

Approved by: re@ (gjb@)

5 years agoEnable Capsicum on armv6/armv7
Ed Maste [Thu, 13 Sep 2018 21:00:17 +0000 (21:00 +0000)]
Enable Capsicum on armv6/armv7

We ought to be consistent across our Tier-1 and nearly-Tier-1
architectures, so enable Capsicum for 32-bit armv6/armv7 by default.

PR: 204008
Reviewed by: ian, oshogbo
Approved by: re (gjb)
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17023

5 years agoSet zfs_arc_meta_strategy to metadata only
Eric van Gyzen [Thu, 13 Sep 2018 17:56:48 +0000 (17:56 +0000)]
Set zfs_arc_meta_strategy to metadata only

The previous default of "balanced" appears to have caused pathological
behavior, including very poor performance and 100% CPU load in the
arc_reclaim_thread.

The symptoms appeared when the daily periodic run started.
With this change, the system--and the ARC in particular--behaved
normally during a manual daily periodic run.

From Mark Johnston:  The port of the balanced strategy is incomplete,
since arc_prune_async() is a no-op on FreeBSD.  (This also seems
to imply that r337653 is a no-op.)  After 12 is branched we can
port the remaining bits and consider changing the default back.

Submitted by: markj (essentially)
Reviewed by: markj
Approved by: re (gjb)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D17156

5 years ago[ig4] Update list of supported hardware
Oleksandr Tymoshenko [Thu, 13 Sep 2018 17:39:08 +0000 (17:39 +0000)]
[ig4] Update list of supported hardware

Reflect the fact that ig4(4) is not an Intel-specific device but
a driver for Synopsys DesignWare I2C controller that now ships in
AMD systems too.

Approved by: re (kib), rpokala

5 years ago[ig4] Add PCI IDs for I2C controller on Intel Kaby Lake systems
Oleksandr Tymoshenko [Thu, 13 Sep 2018 17:36:55 +0000 (17:36 +0000)]
[ig4] Add PCI IDs for I2C controller on Intel Kaby Lake systems

PR: 221777
Approved by: re (kib)
Submitted by: marc.priggemeyer@gmail.com

5 years agoRemove __DATE__ and __TIME__ from ibdiag_common.c, replacing with
Glen Barber [Thu, 13 Sep 2018 16:41:15 +0000 (16:41 +0000)]
Remove __DATE__ and __TIME__ from ibdiag_common.c, replacing with
the hard-coded string "not available" to ensure reproducible builds.

Discussed with: emaste
Approved by: re (rgrimes)
Sponsored by: The FreeBSD Foundation

5 years agocxgbe/iw_cxgbe: Fix reported build breakage when the kernel
Navdeep Parhar [Thu, 13 Sep 2018 16:27:21 +0000 (16:27 +0000)]
cxgbe/iw_cxgbe: Fix reported build breakage when the kernel
configuration has "device cxgbe' but no VIMAGE.

Reported by: mav@
Approved by: re@ (kib@)

5 years agoReally fix pam install. Don't commit late at night or you make simple mistakes.
Brad Davis [Thu, 13 Sep 2018 16:14:33 +0000 (16:14 +0000)]
Really fix pam install.  Don't commit late at night or you make simple mistakes.

Reported by: dumbbell
Approved by: re (gjb), will (mentor)

5 years agoIf a user skips the pre-world mergemaster, an installworld check
Ian Lepore [Thu, 13 Sep 2018 15:16:05 +0000 (15:16 +0000)]
If a user skips the pre-world mergemaster, an installworld check
notices the missing ntpd user and refers to UPDATING. This change makes
it more clear which aspect of UPDATING is important for the ntpd change.

PR: 231334
Approved by: re (gjb)

5 years agoregenerate src.conf.5 after r338642 and r338643
Ed Maste [Thu, 13 Sep 2018 14:54:52 +0000 (14:54 +0000)]
regenerate src.conf.5 after r338642 and r338643

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

5 years agodd(1): Correct padding in status=progress
Kyle Evans [Thu, 13 Sep 2018 14:54:46 +0000 (14:54 +0000)]
dd(1): Correct padding in status=progress

Output padding is specified via outlen, which is set using the return value
of fprintf. Because it's printing that padding plus a trailing byte, it
grows by one each iteration rather than reflecting actual length.

Additionally, iec was sized improperly for scaling up similarly to si.
Fixing this revealed that the humanize_number(3) call to populate persec
was using the wrong width.

Submitted by: Thomas Hurst <tom@hur.st>
Reviewed by: imp
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D16960

5 years agoamd64: implement ERMS-based memmove, memcpy and memset
Mateusz Guzik [Thu, 13 Sep 2018 14:53:51 +0000 (14:53 +0000)]
amd64: implement ERMS-based memmove, memcpy and memset

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17124

5 years agoAdd WITHOUT_REPRODUCIBLE_BUILD description
Ed Maste [Thu, 13 Sep 2018 14:53:42 +0000 (14:53 +0000)]
Add WITHOUT_REPRODUCIBLE_BUILD description

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

5 years agoEnable reproducible builds in advance of 12.0-REL
Ed Maste [Thu, 13 Sep 2018 14:52:59 +0000 (14:52 +0000)]
Enable reproducible builds in advance of 12.0-REL

r338642 toggled the REPRODUCIBLE_BUILD knob but missed the
corresponding kern.opts.mk change.

We want to build the 12.0 release artifacts with reproducible builds
mode enabled. Switch it on in HEAD now to enable testing with upcoming
ALPHA builds. We can revisit the default setting for HEAD after the
branch is created.

This change eliminates the build metadata (user, hostname, timestamp,
etc.) from the kernel and loader.  If the src tree is a git, svn or p4
checkout with changes then the metadata is retained.

The WITHOUT_REPRODUCIBLE_BUILD src.conf(5) knob can be used to revert
to the previous behaviour.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

5 years agoEnable reproducible builds in advance of 12.0-REL
Ed Maste [Thu, 13 Sep 2018 14:26:53 +0000 (14:26 +0000)]
Enable reproducible builds in advance of 12.0-REL

We want to build the 12.0 release artifacts with reproducible builds
mode enabled. Switch it on in HEAD now to enable testing with upcoming
ALPHA builds. We can revisit the default setting for HEAD after the
branch is created.

This change eliminates the build metadata (user, hostname, timestamp,
etc.) from the kernel and loader.  If the src tree is a git, svn or p4
checkout with changes then the metadata is retained.

The WITHOUT_REPRODUCIBLE_BUILD src.conf(5) knob can be used to revert
to the previous behaviour.

Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

5 years agoarm64: Make aw_sid and aw_thermal depend on nvmem
Emmanuel Vadot [Thu, 13 Sep 2018 14:08:10 +0000 (14:08 +0000)]
arm64: Make aw_sid and aw_thermal depend on nvmem

Both drivers use this interface so add a dependancy on it.
Since awg uses aw_sid for generating the MAC address, make it
depend on both aw_sid and nmvem so when only removing nvmem from
kernel config it will not include this driver.

Reported by: sbruno
Approved by: re (gjb)

5 years agoAdd new option to the geom(8) utility, "-p". It makes it easy to look up
Edward Tomasz Napierala [Thu, 13 Sep 2018 14:06:01 +0000 (14:06 +0000)]
Add new option to the geom(8) utility, "-p".  It makes it easy to look up
the GEOM class instance from the provider name.

Reviewed by: oshogbo, 0mp
Approved by: re (kib)
MFC after: 2 weeks
Relnotes: yes
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17116

5 years agoumount: remove sync(2) call when used with -f
Mateusz Guzik [Thu, 13 Sep 2018 13:57:42 +0000 (13:57 +0000)]
umount: remove sync(2) call when used with -f

It completely unnecessarily iterates over all filesystems and happens
to be executed a lot e.g. by synth.

Reviewed by: kib
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D17143

5 years agoFix build after r338621 by avoiding LINKS and installing the link manually.
Brad Davis [Thu, 13 Sep 2018 07:48:49 +0000 (07:48 +0000)]
Fix build after r338621 by avoiding LINKS and installing the link manually.

Approved by: re (rgrimes), will (mentor)

5 years agoxen: temporary disable SMAP when forwarding hypercalls from user-space
Roger Pau Monné [Thu, 13 Sep 2018 07:15:02 +0000 (07:15 +0000)]
xen: temporary disable SMAP when forwarding hypercalls from user-space

The Xen page-table walker used to resolve the virtual addresses in the
hypercalls will refuse to access user-space pages when SMAP is enabled
unless the AC flag in EFLAGS is set (just like normal hardware with
SMAP support would do).

Since privcmd allows forwarding hypercalls (and buffers) from
user-space into Xen make sure SMAP is temporary disabled for the
duration of the hypercall from user-space.

Approved by: re (gjb)
Sponsored by: Citrix Systems R&D

5 years agoxen: legacy PVH fixes for the new interrupt count
Roger Pau Monné [Thu, 13 Sep 2018 07:14:11 +0000 (07:14 +0000)]
xen: legacy PVH fixes for the new interrupt count

Register interrupts using the PIC pic_register_sources method instead
of doing it in apic_setup_io. This is now required, since the internal
interrupt structures are not yet setup when calling apic_setup_io.

Approved by: re (gjb)
Sponsored by: Citrix Systems R&D

5 years agolapic: skip setting intrcnt if lapic is not present
Roger Pau Monné [Thu, 13 Sep 2018 07:13:13 +0000 (07:13 +0000)]
lapic: skip setting intrcnt if lapic is not present

Instead of panicking. Legacy PVH mode doesn't provide a lapic, and
since native_lapic_intrcnt is called unconditionally this would cause
the assert to trigger. Change the assert into a continue in order to
take into account the possibility of systems without a lapic.

Reviewed by: jhb
Approved by: re (gjb)
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D17015

5 years agoxen: fix setting legacy PVH vcpu id
Roger Pau Monné [Thu, 13 Sep 2018 07:12:16 +0000 (07:12 +0000)]
xen: fix setting legacy PVH vcpu id

The recommended way to obtain the vcpu id is using the cpuid
instruction with a specific leaf value. This leaf value must be
obtained at runtime, and it's done when populating the hypercall page.

Legacy PVH however will get the hypercall page populated by the
hypervisor itself before booting, so the cpuid leaf was not actually
set, thus preventing setting the vcpu id value from cpuid.

Fix this by making sure the cpuid leaf has been probed before
attempting to set the vcpu id.

Approved by: re (gjb)
Sponsored by: Citrix Systems R&D

5 years agoxen: limit the usage of PIRQs to a legacy PVH Dom0
Roger Pau Monné [Thu, 13 Sep 2018 07:11:11 +0000 (07:11 +0000)]
xen: limit the usage of PIRQs to a legacy PVH Dom0

That's the only mode in FreeBSD that requires the usage of PIRQs, so
there's no need to attach the PIRQ PIC when running in other modes.

Approved by: re (gjb)
Sponsored by: Citrix Systems R&D

5 years agoxen: fix initial kenv setup for legacy PVH
Roger Pau Monné [Thu, 13 Sep 2018 07:09:41 +0000 (07:09 +0000)]
xen: fix initial kenv setup for legacy PVH

When adding support for the new PVH mode the kenv handling was
switched to use a boot time allocated scratch space, however the
legacy PVH early boot code was not modified to allocate such space.

Approved by: re (gjb)
Sponsored by: Citrix Systems R&D

5 years ago xen: remove xenpv_set_ids
Roger Pau Monné [Thu, 13 Sep 2018 07:08:31 +0000 (07:08 +0000)]
 xen: remove xenpv_set_ids

The vcpu_id for legacy PVH mode can be set from the output of cpuid,
so there's no need to have a special function to set it.

Also note that xenpv_set_ids should have been executed only for PV
guests, but was executed for all guests types and vcpu_id was later
fixed up for HVM guests.

Reported by: cperciva
Approved by: re (gjb)
Sponsored by: Citrix Systems R&D