]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoUpdate to bmake-20171028
sjg [Thu, 2 Nov 2017 20:08:00 +0000 (20:08 +0000)]
Update to bmake-20171028

Ignore empty MAKEOBJDIR[PREFIX]

Reported by: bdrewery

6 years agoThis used to have bzip2 support too.
imp [Thu, 2 Nov 2017 19:53:51 +0000 (19:53 +0000)]
This used to have bzip2 support too.

6 years agoloader: fix BOOTSRC -> BOOTOBJ in a library path
avg [Thu, 2 Nov 2017 19:45:51 +0000 (19:45 +0000)]
loader: fix BOOTSRC -> BOOTOBJ in a library path

6 years agoloader: re-enable gzip support for x86
royger [Thu, 2 Nov 2017 18:13:26 +0000 (18:13 +0000)]
loader: re-enable gzip support for x86

r324653 inadvertently disabled default gzip support on x86, re-enable.

Sponsored by: Citrix System R&D
Reviewed by: imp
Differential revision: https://reviews.freebsd.org/D12913

6 years agoRegenerate for AUTO_OBJ.
bdrewery [Thu, 2 Nov 2017 18:09:10 +0000 (18:09 +0000)]
Regenerate for AUTO_OBJ.

Sponsored by: Dell EMC Isilon

6 years agoEnable AUTO_OBJ by default if the OBJDIR is writable, only for in-tree builds.
bdrewery [Thu, 2 Nov 2017 18:09:07 +0000 (18:09 +0000)]
Enable AUTO_OBJ by default if the OBJDIR is writable, only for in-tree builds.

This can be disabled by putting WITHOUT_AUTO_OBJ=yes in /etc/src-env.conf, not
/etc/src.conf, or passing it in the environment.

The purpose of this rather than simply flipping the default of AUTO_OBJ to yes
is to avoid hassling users with auto.obj.mk failures if the wanted OBJDIR is
not writable. It will fallback to writing to the source directory like it does
today if MAKEOBJDIRPREFIX is not writable.

The act of enabling MK_AUTO_OBJ disables all 'make obj' treewalks since
previous work has made those not run if MK_AUTO_OBJ==yes in Makefile.inc1.

Relnotes: yes
Reviewed by: sjg
Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12841

6 years agoReduce MAKEOBJDIRPREFIX path spam by specifying a direct objdir to use.
bdrewery [Thu, 2 Nov 2017 18:08:36 +0000 (18:08 +0000)]
Reduce MAKEOBJDIRPREFIX path spam by specifying a direct objdir to use.

Sponsored by: Dell EMC Isilon

6 years agoMerge OpenSSL 1.0.2m.
jkim [Thu, 2 Nov 2017 18:04:29 +0000 (18:04 +0000)]
Merge OpenSSL 1.0.2m.

6 years agoImport OpenSSL 1.0.2m.
jkim [Thu, 2 Nov 2017 17:35:19 +0000 (17:35 +0000)]
Import OpenSSL 1.0.2m.

6 years agoTake into account race conditions in case of accessed or modified bit
skra [Thu, 2 Nov 2017 14:08:38 +0000 (14:08 +0000)]
Take into account race conditions in case of accessed or modified bit
emulation in fast path of data/prefetch abort common routine. Process
these bits only if related page table entries are consistent with
provided abort info. In case of inconsistency, do nothing and let
processor to signal new abort if still needed.

The mapping related to an abort may be a subject of change concurrently.
The situation is more evident on multicore machines. Mapping may be
removed on one core while being used on another one before TLB flush
happened. Memory swapping process may be an example. Or, two or more
aborts may be signaled for the same page on more cores concurrently.
While an abort on one core may cause a promotion of related mapping,
an abort on another core may be inconsistent then as related mapping
was promoted. A question is how much real the issue may be on single
core machine. However, it's better to play safe even for these machines.

This change may solve some "PT2MAP abort" panics reported rarely.
The revision of pmap_fault() was initiated thanks to stack backtrace
provided by Bob Prohaska (fbsd at www.zefox.net).

While here, INVARIANTS block was changed. The previous check had iffy
value as only one entry from many was checked from L2 page table.

Reviewed by: mmel
MFC after: 3 weeks

6 years agoDisable posix_fallocate(2) for ZFS
avg [Thu, 2 Nov 2017 13:49:08 +0000 (13:49 +0000)]
Disable posix_fallocate(2) for ZFS

The generic (naive) implementation of posix_fallocate cannot provide the
standard mandated guarantee that overwrites would never fail due to the lack
of free space.  The fundamental reason is the copy-on-write architecture
of ZFS.  Other features like compression and deduplication can also
increase the size difference between the (pre-)allocated dummy content
and the future content.

So, until ZFS can properly implement the feature it's better to report
that it is unsupported rather than providing an ersatz implementation.
Please note that EINVAL is used to report that the underlying file system
does not support the operation (POSIX.1-2008).

illumos and ZoL seem to do the same.

MFC after: 3 weeks
Sponsored by: Panzura

6 years agoRemove artificial limit for -i.
trasz [Thu, 2 Nov 2017 12:16:50 +0000 (12:16 +0000)]
Remove artificial limit for -i.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd benchmark for access(2).
trasz [Thu, 2 Nov 2017 12:16:11 +0000 (12:16 +0000)]
Add benchmark for access(2).

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd bad_open benchmark, which measures failed opens by calling
trasz [Thu, 2 Nov 2017 12:15:39 +0000 (12:15 +0000)]
Add bad_open benchmark, which measures failed opens by calling
open("", O_RDONLY);.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd benchmark for getresuid(2) - three pointers, although only "output" ones,
trasz [Thu, 2 Nov 2017 12:14:42 +0000 (12:14 +0000)]
Add benchmark for getresuid(2) - three pointers, although only "output" ones,
and quite lightwait.

The purpose of this commit, and the previous one, is to be able to measure
overhead of pointer arguments - in case you're running a strange architecture
where pointers and integers are quite different things at the hardware level.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd select(2) benchmark. It takes four pointers; unfortunately it's
trasz [Thu, 2 Nov 2017 12:13:02 +0000 (12:13 +0000)]
Add select(2) benchmark.  It takes four pointers; unfortunately it's
somewhat heavy.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd getpriority(2) benchmark; it's a lightweight syscall which does pretty
trasz [Thu, 2 Nov 2017 12:12:18 +0000 (12:12 +0000)]
Add getpriority(2) benchmark; it's a lightweight syscall which does pretty
much nothing - just like getuid(2) - but takes arguments.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoMake syscall_timing(1) default to a temporary file when run without -p.
trasz [Thu, 2 Nov 2017 12:11:20 +0000 (12:11 +0000)]
Make syscall_timing(1) default to a temporary file when run without -p.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoAdd fetchbench, a trivial HTTP benchmark based on fetch(1).
trasz [Thu, 2 Nov 2017 12:09:18 +0000 (12:09 +0000)]
Add fetchbench, a trivial HTTP benchmark based on fetch(1).

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agozfs.c:vdev_read() needs to be careful about large sectors
tsoome [Thu, 2 Nov 2017 08:47:03 +0000 (08:47 +0000)]
zfs.c:vdev_read() needs to be careful about large sectors

Using the same implementation as done in efi/boot1. We must handle smaller
than sector size IO etc.

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

6 years agoActually add the dtsec(4) man page to the build
jhibbits [Thu, 2 Nov 2017 04:17:10 +0000 (04:17 +0000)]
Actually add the dtsec(4) man page to the build

6 years agoFix interrupt handling for dtsec
jhibbits [Thu, 2 Nov 2017 04:07:41 +0000 (04:07 +0000)]
Fix interrupt handling for dtsec

The macId is the dTSEC unit within the FMan, so use the cell-index, not the unit
number, which may not match the cell index.

MFC after: 1 week

6 years agoDon't propagate MAKEOBJDIRPREFIX changes to environment.
bdrewery [Thu, 2 Nov 2017 04:05:03 +0000 (04:05 +0000)]
Don't propagate MAKEOBJDIRPREFIX changes to environment.

A makefile may use this variable later for its own reasons,
don't infect sub-makes with that value.

Sponsored by: Dell EMC Isilon

6 years agorsu(4): trim code for Rx rate calculation.
avos [Thu, 2 Nov 2017 00:17:52 +0000 (00:17 +0000)]
rsu(4): trim code for Rx rate calculation.

Include ridx <-> rate conversion functions from rtwn(4) +
reuse already calculated value for ieee80211_radiotap(9).

Tested with Asus USB-N10, STA mode.

6 years agoWe get VERSION from bmake/VERSION now
sjg [Wed, 1 Nov 2017 23:20:04 +0000 (23:20 +0000)]
We get VERSION from bmake/VERSION now

6 years agotag bmake-20171028
sjg [Wed, 1 Nov 2017 23:17:47 +0000 (23:17 +0000)]
tag bmake-20171028

6 years agoImport bmake-20171028
sjg [Wed, 1 Nov 2017 23:16:32 +0000 (23:16 +0000)]
Import bmake-20171028

From ChangeLog

2017-10-28  Simon J. Gerraty  <sjg@bad.crufty.net>

        * VERSION: 20171028
          Merge with NetBSD make, pick up
          o main.c: ignore empty MAKEOBJDIR

        * Makefile.config.in:
          make @prefix@ @machine*@ and @default_sys_path@ defaults.

2017-10-05  Simon J. Gerraty  <sjg@bad.crufty.net>

        * VERSION: 20171005

        * unit-tests/dotwait.mk: redirect stderr through pipe for more
          consistent result on some platforms.

2017-08-13  Simon J. Gerraty  <sjg@bad.crufty.net>

        * machine.sh: entry for AIX

2017-08-12  Simon J. Gerraty  <sjg@bad.crufty.net>

        * VERSION (_MAKE_VERSION): Move the setting of _MAKE_VERSION
          to a file that can be included by configure as well as make.
          This allows configure to set set _MAKE_VERSION in make-bootstrap.sh

2017-08-10  Simon J. Gerraty  <sjg@bad.crufty.net>

        * Makefile (_MAKE_VERSION): 20170810
          Merge with NetBSD make, pick up
          o meta.c: if target is in subdir we only need subdir name in
            meta_name.

6 years agoevdev: Do not start/stop softrepeat callout if no clients attached
wulf [Wed, 1 Nov 2017 22:37:43 +0000 (22:37 +0000)]
evdev: Do not start/stop softrepeat callout if no clients attached

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12676

6 years agoevdev: Disable value normalization and state filtering for SND events.
wulf [Wed, 1 Nov 2017 22:33:44 +0000 (22:33 +0000)]
evdev: Disable value normalization and state filtering for SND events.

Some events can take sound pitch as a value so can not be represented
as binary on/off events. Tracking for on/off state is left in place
as it is a part of the evdev API.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12676

6 years agosysmouse(4): Fix ums(4)-style T-axis reporting via evdev protocol
wulf [Wed, 1 Nov 2017 22:30:36 +0000 (22:30 +0000)]
sysmouse(4): Fix ums(4)-style T-axis reporting via evdev protocol

- Do not report T-axis wheel events as button presses
- Reverse T-axis to match Linux
- Remove wrong comment. T-axis buttons state should be checked by level not
    by edge to allow continuous wheel tilt reporting

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12676

6 years agoevdev: Take driver's lock in cdev write handler if necessary
wulf [Wed, 1 Nov 2017 22:19:19 +0000 (22:19 +0000)]
evdev: Take driver's lock in cdev write handler if necessary

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12676

6 years agoevdev: Lock Giant around keyboard ioctls
wulf [Wed, 1 Nov 2017 22:15:19 +0000 (22:15 +0000)]
evdev: Lock Giant around keyboard ioctls

This fixes turning ukbd(4) LEDs on/off with evdev interface as well

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12676

6 years agoevdev: Hide "kern.evdev.rcpt_mask" sysctl if kernel is compiled
wulf [Wed, 1 Nov 2017 22:09:10 +0000 (22:09 +0000)]
evdev: Hide "kern.evdev.rcpt_mask" sysctl if kernel is compiled
w/o EVDEV_SUPPORT as it's value has no meaning in this case.

Now presence of this sysctl can be used for discovery if evdev support
for hybrid devices is compiled into kernel or not.
Hide "kern.evdev.sysmouse_t_axis" sysctl for the same reason.

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D12676

6 years agoRegenerate for UNIFIED_OBJDIR.
bdrewery [Wed, 1 Nov 2017 21:22:23 +0000 (21:22 +0000)]
Regenerate for UNIFIED_OBJDIR.

Sponsored by: Dell EMC Isilon

6 years agoMETA_MODE: Respect make -s.
bdrewery [Wed, 1 Nov 2017 21:22:19 +0000 (21:22 +0000)]
META_MODE: Respect make -s.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agomake obj: Skip treewalk if AUTO_OBJ is enabled.
bdrewery [Wed, 1 Nov 2017 21:22:16 +0000 (21:22 +0000)]
make obj: Skip treewalk if AUTO_OBJ is enabled.

Sponsored by: Dell EMC Isilon

6 years agonative-xtools/xdev: Store these in a location including both MACHINE/TARGET.
bdrewery [Wed, 1 Nov 2017 21:22:13 +0000 (21:22 +0000)]
native-xtools/xdev: Store these in a location including both MACHINE/TARGET.

Given MACHINE/MACHINE_ARCH=amd64, TARGET=arm64 and TARGET_ARCH=aarch64,
this change will build them in a location such as:
    /usr/obj/usr/src/amd64.amd64/nxb/arm64.aarch64/
and
    /usr/obj/usr/src/amd64.amd64/xdev/aarch64-freebsd/

Sponsored by: Dell EMC Isilon

6 years agoAdd a 'make cleanuniverse'.
bdrewery [Wed, 1 Nov 2017 21:22:10 +0000 (21:22 +0000)]
Add a 'make cleanuniverse'.

This will remove all build files for the source directory
when MK_UNIFIED_OBJDIR is enabled.

Sponsored by: Dell EMC Isilon

6 years agoAdd option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.
bdrewery [Wed, 1 Nov 2017 21:22:05 +0000 (21:22 +0000)]
Add option UNIFIED_OBJDIR, on by default, which moves the default build OBJDIR.

This changes the build OBJDIR from the older style of /usr/obj/<srcdir> for
native builds, and /usr/obj/<target>.<target_arch>/<srcdir> for cross builds to
a new simpler format of /usr/obj/<srcdir>/<target>.<target_arch>.  This
new format is used regardless of cross or native build.  It allows
easier management of multiple source tree object directories.

The UNIFIED_OBJDIR option will be removed and its feature made permanent
for the 12.0 release.

Relnotes: yes (don't note UNIFIED_OBJDIR option since it will be removed)
Prior work: D3711 D874
Reviewed by: gjb, sjg
Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Discussed with: emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12840

6 years agobluetooth: Default to discoverable off
cem [Wed, 1 Nov 2017 18:58:54 +0000 (18:58 +0000)]
bluetooth: Default to discoverable off

Try to not expose bluetooth devices to external devices unless the user
explicitly configures it, like any other radio/network device.  Bluetooth
has a long history of security problems and it is probably best to keep it
disabled if not needed.

Users who do use the bluetooth device should enable "discoverable" in
bluetooth.device.conf(5) after this change.

Keep in mind that bluetooth addresses can be discovered by passive
monitoring or whole address-space scans[0], so a safety conscious user
should also disable "connectable" in bluetooth.device.conf(5).

[0]: https://www.sans.edu/cyber-research/security-laboratory/article/bluetooth

Reviewed by: emax, hselasky
Security: maybe
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12831

6 years agoefipart_strategy is using wrong offset with >512B sectors
tsoome [Wed, 1 Nov 2017 18:49:45 +0000 (18:49 +0000)]
efipart_strategy is using wrong offset with >512B sectors

The strategy() calls are assuming 512B sectors, so we need to adjust the
offset accordingly.

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

6 years agoRestore an optimization that was temporary disabled by r324665.
kib [Wed, 1 Nov 2017 18:06:44 +0000 (18:06 +0000)]
Restore an optimization that was temporary disabled by r324665.

In reclaim_pv_chunk(), rotate the pv chunks list so that next
invocations of the reclaim do not scan the same pv chunks that could
not be freed.  Only do the rotation when there is no parallel scan,
tracked by active_reclaims counter.

To rotate, move all chunks that are before current iteration marker,
after another marker that is inserted at the list tail on start of the
reclaim.

Reviewed by: alc
Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoFix the reporting of the MTU for SCTP sockets when using IPv6.
tuexen [Wed, 1 Nov 2017 16:32:11 +0000 (16:32 +0000)]
Fix the reporting of the MTU for SCTP sockets when using IPv6.

MFC after: 1 week

6 years agoepair: Fix panic on unload
kp [Wed, 1 Nov 2017 14:27:26 +0000 (14:27 +0000)]
epair: Fix panic on unload

The VNET_SYSUNINIT() callback is executed after the MOD_UNLOAD. That means
that netisr_unregister() has already been called when
netisr_unregister_vnet() gets calls, leading to an assertion failure.

Restore the expected order of operations by performing everything that
was done in MOD_UNLOAD to a SYSUNINIT() (that will be called after the
VNET_SYSUNINIT()).

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

6 years agoImplement ioread16be() in the LinuxKPI.
hselasky [Wed, 1 Nov 2017 12:34:18 +0000 (12:34 +0000)]
Implement ioread16be() in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoUnconditionally include "opt_inet6.h" in the LinuxKPI.
hselasky [Wed, 1 Nov 2017 12:21:28 +0000 (12:21 +0000)]
Unconditionally include "opt_inet6.h" in the LinuxKPI.
This makes sure the INET6 macro gets properly defined,
also for kernel module builds.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoDo not run pmclog_configure_log() without pmc_sx protection.
kib [Wed, 1 Nov 2017 11:43:39 +0000 (11:43 +0000)]
Do not run pmclog_configure_log() without pmc_sx protection.

The r195005 unlocked pmc_sx before calling into pmclog_configure_log()
to avoid the LOR, but it allows flush or closelog to run in parallel
with the configuration, causing many failure modes.

Revert r195005.  Pre-create the logging process, allowing it to run
after the set up succeeded, otherwise the process terminates itself.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D12882

6 years agoBe protective and check the po_file validity before dropping the ref.
kib [Wed, 1 Nov 2017 11:37:45 +0000 (11:37 +0000)]
Be protective and check the po_file validity before dropping the ref.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D12882

6 years agoIn hwpmc, do not double-close the logging file.
kib [Wed, 1 Nov 2017 11:32:52 +0000 (11:32 +0000)]
In hwpmc, do not double-close the logging file.

hwpmc(4) must not voluntarily call fo_close(), doing this causes
double-close of the file.  It seems to almost avoid bad consequences
for pipes, but other types of files demonstrate random memory access.

To fix, remove fo_close() calls, which also do not provide the
declared wake-up of waiters consistently.  Instead, send a signal to
the logger and configure the logger process to not block it.  Since
logger never returns to userspace, the signal only causes termination
of the interruptible sleeps in fo_write().

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D12882

6 years agoThere is no use for dropping Giant in the pmc syscall.
kib [Wed, 1 Nov 2017 11:16:18 +0000 (11:16 +0000)]
There is no use for dropping Giant in the pmc syscall.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D12882

6 years agoMinor style tweaks.
kib [Wed, 1 Nov 2017 11:05:47 +0000 (11:05 +0000)]
Minor style tweaks.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D12882

6 years agogeom_slice: fix r325227, protect against multiple calls to g_slice_free
avg [Wed, 1 Nov 2017 10:53:10 +0000 (10:53 +0000)]
geom_slice: fix r325227, protect against multiple calls to g_slice_free

This geom does not immediately detach its consumer relying on the
wither-washer to do that.  Since that happens asynchronously we may get
additional spoiling events.  So, we need to account for that.

There are multiple options for fixing this issue like detaching
immediately or checking for G_CF_ORPHAN in g_slice_spoiled().
The most reliable and least intrusive fix seems to be setting
geom->softc to NULL on the first call and checking for NULL on
subsequent calls.  This is something that the code did before r325227.

Reported by: David Wolfskill <david@catwhisker.org>,
O. Hartmann <o.hartmann@walstatt.org>
Tested by: David Wolfskill <david@catwhisker.org> (earlier version)
Discussed with: mav
MFC after: 1 week
X-MFC with: r325227

6 years agoUse designated initializers for pmc sysent and module data.
kib [Wed, 1 Nov 2017 10:49:41 +0000 (10:49 +0000)]
Use designated initializers for pmc sysent and module data.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D12882

6 years agoConsistently ensure that we do not load MXCSR with reserved bits set.
kib [Wed, 1 Nov 2017 10:32:44 +0000 (10:32 +0000)]
Consistently ensure that we do not load MXCSR with reserved bits set.

Some callers of fpusetregs()/npxsetregs(), most importantly
set_fpcontext(), clear reserved bits.  But some did not.  Do the
clearing in fpusetregs() and remove now redundand operation from
set_fpcontext().

Reported by: Maxime Villard <max@m00nbsd.net>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoevdev: Translate KEY_102ND in evdev_scancode2key()
dumbbell [Wed, 1 Nov 2017 09:18:41 +0000 (09:18 +0000)]
evdev: Translate KEY_102ND in evdev_scancode2key()

This is the extra key on 102/105-keys keyboards, located on the right
of the Left Shift key. For instance on a French layout, this is the '<'
key.

This fixes an issue where the key fires no evdev event and thus remains
inactive in an evdev/libinput-enabled X.Org server. The issue only
occurred on an AT keyboard; the same key on a USB keyboard worked fine.

PR: 222609 (only for reference)
Approved by: wulf@
Differential Revision: https://reviews.freebsd.org/D12883

6 years agonamecache: fix .. check broken after r324378
mjg [Wed, 1 Nov 2017 08:40:04 +0000 (08:40 +0000)]
namecache: fix .. check broken after r324378

wtf by: mjg
Diagnosed by: avg

6 years agoFixup r325264, take #2
mjg [Wed, 1 Nov 2017 06:46:58 +0000 (06:46 +0000)]
Fixup r325264, take #2

whack an unused variable

6 years agonamecache: ncnegfactor 16 -> 12
mjg [Wed, 1 Nov 2017 06:45:41 +0000 (06:45 +0000)]
namecache: ncnegfactor 16 -> 12

It is used on each new entry addition to decide whether to whack an existing
negative entry in order to prevent a blow out in size, but the parameter was
set years ago and never revisited.

Building with poudriere results in about 400 evictions per second which
unnecessarily grab entries from the hot list.

With the new parameter there are next to no evictions of the sort.

6 years agoFixup r325264
mjg [Wed, 1 Nov 2017 06:38:46 +0000 (06:38 +0000)]
Fixup r325264

Accidentally committed an incomplete diff.

6 years agoSave on loginclass list locking by checking if caller already uses the struct
mjg [Wed, 1 Nov 2017 06:12:14 +0000 (06:12 +0000)]
Save on loginclass list locking by checking if caller already uses the struct

6 years agoSave on uihash table locking by checking if the caller already uses the struct
mjg [Wed, 1 Nov 2017 05:51:20 +0000 (05:51 +0000)]
Save on uihash table locking by checking if the caller already uses the struct

In particular with poudriere this saves about 90% of lookups.

6 years agoEnable a bunch more options in the QORIQ64 kernel
jhibbits [Wed, 1 Nov 2017 03:54:07 +0000 (03:54 +0000)]
Enable a bunch more options in the QORIQ64 kernel

This brings it closer to par with GENERIC64.  In the future I hope to have a
GENERIC64-E and GENERIC-E kernels as Book-E analogues to the GENERIC64/GENERIC
AIM kernels.

6 years agoEmulate the "OR reg, r/m" instruction (opcode 0BH).
grehan [Wed, 1 Nov 2017 03:26:53 +0000 (03:26 +0000)]
Emulate the "OR reg, r/m" instruction (opcode 0BH).

This is needed for the HDA emulation with FreeBSD guests.

Reviewed by: marcelo
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12832

6 years agoRename a couple files to not conflict with ZFS filenames
jhibbits [Wed, 1 Nov 2017 03:09:16 +0000 (03:09 +0000)]
Rename a couple files to not conflict with ZFS filenames

Now a kernel can be built with both ZFS and DPAA compiled in.

6 years agoAdd Guest State (GS) bit to MSR bits
jhibbits [Wed, 1 Nov 2017 02:54:48 +0000 (02:54 +0000)]
Add Guest State (GS) bit to MSR bits

For completeness only.  It will be used by a hypervisor if/when one is written.
While here, sort the MSR bits into the proper categories.

6 years agoFix debug interrupts on 64-bit Book-E
jhibbits [Wed, 1 Nov 2017 02:40:15 +0000 (02:40 +0000)]
Fix debug interrupts on 64-bit Book-E

Use a WORD_SIZE macro to define the correct offset to the second word
needed.  This corrects the offset calculation in 64-bit builds.

6 years agoRemove 'adding_user.7'
eadler [Wed, 1 Nov 2017 01:22:33 +0000 (01:22 +0000)]
Remove 'adding_user.7'

Not to be confused with adduser.
Not to be confused with useful information.

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

6 years agoRemove a singleton in the DPAA driver, to allow multiple fman instances
jhibbits [Wed, 1 Nov 2017 00:46:48 +0000 (00:46 +0000)]
Remove a singleton in the DPAA driver, to allow multiple fman instances

Some devices (P5040, P4080) have multiple frame managers in their DPAA
subsystems.  This was prevented by use of a softc singleton in the DPAA
driver.  Since if_dtsec(4) has moved to be a child of fman, it can access
the fman device data via the parent object.

6 years agoAdd the amazon-ssm-agent package to EC2 AMI builds. This makes it
cperciva [Wed, 1 Nov 2017 00:33:54 +0000 (00:33 +0000)]
Add the amazon-ssm-agent package to EC2 AMI builds.  This makes it
immediately available on instances which are running without internet
access (or which can't rely on firstboot_pkgs to install it for some
other reason).

Note that this agent is not enabled by default; to enable it, add
amazon_ssm_agent_enable="YES" to /etc/rc.conf, e.g., by placing the lines
>>/etc/rc.conf
amazon_ssm_agent_enable="YES"
into the EC2 user-data.  In addition to being enabled, the agent requires
keys to be provided via IAM Roles; users are encouraged to be very careful
in using this functionality due to the inherent vulnerability in the idea
of providing credentials via a service accessible to any process which can
open an HTTP connection.

Requested by: Amazon
No objection from: re@
Relnotes: FreeBSD/EC2 AMIs now include the Amazon EC2 Systems Manager
(SSM) Agent.

6 years agoxdev: Follow-up r325087: Need to build lib/clang before lld.
bdrewery [Tue, 31 Oct 2017 23:48:57 +0000 (23:48 +0000)]
xdev: Follow-up r325087: Need to build lib/clang before lld.

LLD needs headers generated by the full libllvm.

X-MFC-With: r325087
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoRegenerate etc/devd/usb.conf
avos [Tue, 31 Oct 2017 23:33:24 +0000 (23:33 +0000)]
Regenerate etc/devd/usb.conf

Reminded by: hselasky

6 years agoAllocate the ITS translation table with a 64k page alignment. This is the
andrew [Tue, 31 Oct 2017 23:17:17 +0000 (23:17 +0000)]
Allocate the ITS translation table with a 64k page alignment. This is the
largest alignment the ITS can require.

This fixes a bug with the ARM Architecture Envelope Model (AEM) where it
only allows 64k pages so will fail to attach the ITS device when this table
is not sufficiently aligned.

Sponsored by: DARPA, AFRL

6 years agoAs with r325242 use mp_maxid when iterating over CPUs in the GICv3 driver.
andrew [Tue, 31 Oct 2017 22:12:14 +0000 (22:12 +0000)]
As with r325242 use mp_maxid when iterating over CPUs in the GICv3 driver.

Sponsored by: DARPA, AFRL

6 years agokernel-toolchain: Fix improper build order after r325244.
bdrewery [Tue, 31 Oct 2017 21:51:33 +0000 (21:51 +0000)]
kernel-toolchain: Fix improper build order after r325244.

Due to removing some targets that the previous .ORDER: ${WMAKE_TGTS}
set, it was no longer being respected; _build_tools was coming
immediately.

Pointyhat to: bdrewery
X-MFC-with: r325244
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoloader ptblread() is broken with >512B sectors
tsoome [Tue, 31 Oct 2017 20:29:31 +0000 (20:29 +0000)]
loader ptblread() is broken with >512B sectors

The loader strategy() function is assuming 512B blocks, so we need to adjust
ptblread() for other sector sizes.

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

6 years agoDisconnect libpathconv tests since they require external perl and do not work with...
bdrewery [Tue, 31 Oct 2017 19:52:30 +0000 (19:52 +0000)]
Disconnect libpathconv tests since they require external perl and do not work with kyua.

This reverts r325192 and is due to libpathconv being connected in r325186.

Reported by: ngie
Sponsored by: Dell EMC Isilon

6 years agoUse -j hw.ncpu for build/install.
bdrewery [Tue, 31 Oct 2017 19:26:07 +0000 (19:26 +0000)]
Use -j hw.ncpu for build/install.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoPreserve TSO checksum flags
shurd [Tue, 31 Oct 2017 19:03:35 +0000 (19:03 +0000)]
Preserve TSO checksum flags

r323941 incorrectly disabled TSO flags based on MTU.

Reported by: Yuri Pankov <yuripv@gmx.com>
Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12880

6 years agokernel-toolchain: Skip world _obj and _cleanobj phases.
bdrewery [Tue, 31 Oct 2017 19:02:14 +0000 (19:02 +0000)]
kernel-toolchain: Skip world _obj and _cleanobj phases.

There's no good reason to treewalk the entire tree removing old OBJDIRS
and creating new ones when 'includes', 'libraries', and 'everything' are
all skipped.  The only shared directory in the existing toolchain target
and world is build-tools.  So handle cleaning in it directly if needed
only for the directories it wants to build.

The extra _obj/_cleanobj walks came in the initial kernel-toolchain
addition in r128189.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agobuild-tools: De-special-case the gcc tools build.
bdrewery [Tue, 31 Oct 2017 19:02:05 +0000 (19:02 +0000)]
build-tools: De-special-case the gcc tools build.

It merely wanted to use 'all' rather than 'build-tools' so just
add a build-tools target to the Makefile.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoUse mp_maxid when iterating over CPUs as we may have sparse id allocations.
andrew [Tue, 31 Oct 2017 18:22:21 +0000 (18:22 +0000)]
Use mp_maxid when iterating over CPUs as we may have sparse id allocations.

Sponsored by: DARPA, AFRL

6 years agoFix PR221990 - Assertion at iflib.c:1947
shurd [Tue, 31 Oct 2017 17:50:42 +0000 (17:50 +0000)]
Fix PR221990 - Assertion at iflib.c:1947

ifl_pidx and ifl_credits are going out of sync in _iflib_fl_refill() as they
use different update log.  Use the same update logic for both, and add a
final call to isc_rxd_refill() to handle early exits from the loop.

PR: 221990
Reported by: pho
Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12798

6 years agoFollow-up r297998: Remove redundant TOOLS_PREFIX in XMAKE.
bdrewery [Tue, 31 Oct 2017 17:16:46 +0000 (17:16 +0000)]
Follow-up r297998: Remove redundant TOOLS_PREFIX in XMAKE.

Sponsored by: Dell EMC Isilon

6 years agoRework counting of hardware statistics in ENA driver
mw [Tue, 31 Oct 2017 16:31:23 +0000 (16:31 +0000)]
Rework counting of hardware statistics in ENA driver

Do not read all statistics from the device, instead count them in the
driver except from RX drops - they are received directly from the NIC
in the AENQ descriptor.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: imp
Obtained from: Semihalf
Sponsored by: Amazon.com, Inc.
Differential Revision: https://reviews.freebsd.org/D12852

6 years agoUpdate ena-com HAL to v1.1.4.3 and update driver accordingly
mw [Tue, 31 Oct 2017 12:41:07 +0000 (12:41 +0000)]
Update ena-com HAL to v1.1.4.3 and update driver accordingly

The newest ena-com HAL supports LLQv2 and introduces
API changes. In order not to break the driver compilation
it was updated/fixed in a following way:

* Change version of the driver to 0.8.0
* Provide reset cause when triggering reset of the device
* Reset device after attach fails
* In the reset task free management irq after calling ena_down. Admin
  queue can still be used before ena_down is called, or when it is
  being handled
* Do not reset device if ena_reset_task fails
* Move call of the ena_com_dev_reset to the ena_down() routine - it
  should be called only if interface was up
* Use different function for checking empty space on the sq ring
  (ena-com API change)
* Fix typo on ENA_TX_CLEANUP_THRESHOLD
* Change checking for EPERM with EOPNOTSUPP - change in the ena-com API
* Minor style fixes

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Amazon.com, Inc.
               Semihalf
Sponsored by: Amazon.com, Inc.
Differential Revision: https://reviews.freebsd.org/D12143

6 years agoUpdate ena-com HAL to newest version
mw [Tue, 31 Oct 2017 12:20:48 +0000 (12:20 +0000)]
Update ena-com HAL to newest version

The newest ena-com HAL supports LLQv2 and introduces numerous API changes.

Obtained from: Amazon.com, Inc.

6 years ago[i2c/clock] add support for EPSON RTC-8583
mizhka [Tue, 31 Oct 2017 12:15:00 +0000 (12:15 +0000)]
[i2c/clock] add support for EPSON RTC-8583

RTC-8583 is time-of-day clock used in some SOHO routers. This clock has
only 2 bits for year values, but thanks to user SRAM it's possible to save
year value and keep it up to date via driver code.

Tested on Planex_MZK-W300NAG (SoC is RT2880)

Submitted by: Hiroki Mori <yamori83@yahoo.co.jp>
Differential Revision: https://reviews.freebsd.org/D12833

6 years agoSet the return address for stack entry points to zero.
tijl [Tue, 31 Oct 2017 11:51:34 +0000 (11:51 +0000)]
Set the return address for stack entry points to zero.

Stack unwinders treat zero as a stop condition.  The value on the stack can
be non-zero because thread stacks may be arbitrary memory provided via
pthread_attr_setstack(3) or may be recycled from previous threads.

Reference:
https://lists.freebsd.org/pipermail/freebsd-current/2017-August/066855.html
https://lists.freebsd.org/pipermail/freebsd-current/2017-October/067254.html

Discussed with: kib
MFC after: 1 week

6 years ago[mips] Pin control configuration for MediaTek RT2880
mizhka [Tue, 31 Oct 2017 11:29:16 +0000 (11:29 +0000)]
[mips] Pin control configuration for MediaTek RT2880

RT2880 is MIPS4Kc SoC used in many SOHO routers. This commits adds GPIO pin
control configuration of RT2880.

Submitted by: Hiroki Mori <yamori83@yahoo.co.jp>
Reviewed by: mizhka, sgalabov
Differential Revision: https://reviews.freebsd.org/D12648

6 years agovdev_geom_close: close errored consumer even if vdev_reopening is set
avg [Tue, 31 Oct 2017 10:15:03 +0000 (10:15 +0000)]
vdev_geom_close: close errored consumer even if vdev_reopening is set

If vdev_geom_close doesn't close the consumer, then the subsequent call
to vdev_geom_open() would be just a NOP and would always return success.
Thus, at present vdev_reopen() would always succeed for vdev_geom devices
even if the underlying provider is in error state.
The problem was introduced as a result of an optimization in rS308055.

The most significant manifistation of the problem is that
zio_vdev_io_done() --> vdev_probe() --> SPA_ASYNC_PROBE -->
spa_async_probe() --> vdev_reopen()
chain of calls and events becomes a NOP as well.
This chain is invoked when zio_vdev_io_done() detects an "unexpected"
error from the lower level I/O.
Additionally, that call path may race with SPA_ASYNC_REMOVE path because
of the asynchronous nature of them both.  So, the SPA_ASYNC_PROBE may
erroneously mark a vdev as being healthy after SPA_ASYNC_REMOVE marked
it as removed.

Reviewed by: asomers, mav
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12731

6 years agogeom_slice: do not destroy softc until providers are gone
avg [Tue, 31 Oct 2017 10:10:13 +0000 (10:10 +0000)]
geom_slice: do not destroy softc until providers are gone

At present, g_slice_orphan and g_slice_spoiled destroy the softc
(struct g_slicer) even before calling g_wither_geom, so there can
be active and incoming io requests at that time and g_slice_start
can access the softc.

This commit changes the code to destroy the softc only after all
providers are closed.

While there, a couple of small cleanups.

Reported by: Ben RUBSON <ben.rubson@gmail.com>
Tested by: Ben RUBSON <ben.rubson@gmail.com>
Reviewed by: mav, smh (earlier version)
MFC after: 2 weeks
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D12809

6 years agoAdd myself as a new committer
yuri [Tue, 31 Oct 2017 07:47:57 +0000 (07:47 +0000)]
Add myself as a new committer

Reviewed by: tcberner
Approved by: tcberner (mentor)
Differential Revision: https://reviews.freebsd.org/D12845

6 years agoFix '\' in binary ascii table
eadler [Tue, 31 Oct 2017 06:43:37 +0000 (06:43 +0000)]
Fix '\' in binary ascii table

6 years agoAlso bump Dd
eadler [Tue, 31 Oct 2017 06:36:33 +0000 (06:36 +0000)]
Also bump Dd

6 years agoUpdate tuning(7) some more
eadler [Tue, 31 Oct 2017 06:35:17 +0000 (06:35 +0000)]
Update tuning(7) some more

At this point its unclear how much help tuning(7) is whatsoever
but leave it around in case someone decides to spend some time on
it.

6 years agoAdd `static` to `cap_setgrent` prototype in !WITH_CASPER case
ngie [Tue, 31 Oct 2017 04:02:50 +0000 (04:02 +0000)]
Add `static` to `cap_setgrent` prototype in !WITH_CASPER case

This unbreaks the default powerpc/sparc64 build configuration after r325062.

6 years agoAdd -c to the usage statements.
imp [Tue, 31 Oct 2017 03:39:36 +0000 (03:39 +0000)]
Add -c to the usage statements.

Submitted by: Maxim Konovalov

6 years agoMake DPAA work in 64-bit mode
jhibbits [Tue, 31 Oct 2017 02:53:50 +0000 (02:53 +0000)]
Make DPAA work in 64-bit mode

Rework the dTSEC and FMan drivers to be more like a full bus relationship,
so that dtsec can use bus_alloc_resource() instead of trying to handle the
offset from the dts.  This required taking some code from the sparc64 ebus
driver to allow subdividing the fman region for the dTSEC devices.

6 years agonative-xtools: Allow SYSTEM_COMPILER to be used after r325001.
bdrewery [Tue, 31 Oct 2017 02:52:36 +0000 (02:52 +0000)]
native-xtools: Allow SYSTEM_COMPILER to be used after r325001.

Now that a proper sysroot is used and a separate target list, it should
be safe to skip building the initial cross-compiler.

X-MFC-With: r325001
MFC after: 1 month
Sponsored by: Dell EMC Isilon

6 years agoFix build with nodevice netmap
shurd [Tue, 31 Oct 2017 02:49:28 +0000 (02:49 +0000)]
Fix build with nodevice netmap

iru_init() was declared and used outside the DEV_NETMAP
conditional blocks, but was implemented inside one. Move the
implementation out of the DEV_NETMAP block to allow building with
netmap disabled.

Reported by: Andrew Turner <andrew@fubar.geek.nz>
Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12842