]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMerge ^/head r320573 through r320970.
dim [Thu, 13 Jul 2017 22:01:38 +0000 (22:01 +0000)]
Merge ^/head r320573 through r320970.

6 years agoMerge llvm, clang, lld, lldb, compiler-rt and libc++ r307894, and update
dim [Thu, 13 Jul 2017 21:58:45 +0000 (21:58 +0000)]
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r307894, and update
build glue.

6 years agoFix a missing comment marker.
gjb [Thu, 13 Jul 2017 20:04:42 +0000 (20:04 +0000)]
Fix a missing comment marker.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoVendor import of libc++ trunk r307894:
dim [Thu, 13 Jul 2017 19:25:57 +0000 (19:25 +0000)]
Vendor import of libc++ trunk r307894:
https://llvm.org/svn/llvm-project/libcxx/trunk@307894

6 years agoVendor import of compiler-rt trunk r307894:
dim [Thu, 13 Jul 2017 19:25:48 +0000 (19:25 +0000)]
Vendor import of compiler-rt trunk r307894:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@307894

6 years agoVendor import of llvm trunk r307894:
dim [Thu, 13 Jul 2017 19:25:18 +0000 (19:25 +0000)]
Vendor import of llvm trunk r307894:
https://llvm.org/svn/llvm-project/llvm/trunk@307894

6 years agoAdd some functions to jiffies.h.
markj [Thu, 13 Jul 2017 18:27:22 +0000 (18:27 +0000)]
Add some functions to jiffies.h.

Also add some checks for overflow to existing functions.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11533

6 years agoAdd 4k and NCQ_TRIM_BROKEN quirks for Samsung 845 SSDs.
sbruno [Thu, 13 Jul 2017 16:56:26 +0000 (16:56 +0000)]
Add 4k and NCQ_TRIM_BROKEN quirks for Samsung 845 SSDs.

Submitted by:  hannula@gmail.com
Differential Revision: https://reviews.freebsd.org/D7967

6 years agoAdd 4K quirks for Samsung 750 EVO SSD
sbruno [Thu, 13 Jul 2017 15:33:08 +0000 (15:33 +0000)]
Add 4K quirks for Samsung 750 EVO SSD

Submitted by: lev
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D9478

6 years agoAdd an rc.d script to setup a netflow export via ng_netflow
manu [Thu, 13 Jul 2017 13:40:18 +0000 (13:40 +0000)]
Add an rc.d script to setup a netflow export via ng_netflow
The default is to export netflow data on localhost on the netflow port.
ngtee is used to have the lowest overhead possible.
The ipfw ng hook is the netflow port (it can only be numeric)
Default is netflow version 5.

Sponsored-By: Gandi.net
Reviewed by: bapt (earlier version), olivier (earlier version)

6 years agoAdd ipfw_status command to etc/rc.d/ipfw
manu [Thu, 13 Jul 2017 13:32:23 +0000 (13:32 +0000)]
Add ipfw_status command to etc/rc.d/ipfw

This is helpful when using service/conf management tools.

Sonsored-By: Gandi.net

6 years agoFix GRE over IPv6 tunnels with IPFW
philip [Thu, 13 Jul 2017 09:01:22 +0000 (09:01 +0000)]
Fix GRE over IPv6 tunnels with IPFW

Previously, GRE packets in IPv6 tunnels would be dropped by IPFW (unless
net.inet6.ip6.fw.deny_unknown_exthdrs was unset).

PR: 220640
Submitted by: Kun Xie <kxie@xiplink.com>
MFC after: 1 week

6 years agoFix size argument to vm_pager_allocate(), it is in bytes, not in pages.
kib [Thu, 13 Jul 2017 08:23:37 +0000 (08:23 +0000)]
Fix size argument to vm_pager_allocate(), it is in bytes, not in pages.
It is believed to be only cosmetic.

Noted by: andrew
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoRevert r320936 to recommit with the correct log message.
kib [Thu, 13 Jul 2017 08:23:12 +0000 (08:23 +0000)]
Revert r320936 to recommit with the correct log message.

6 years agoIt is believed to be only cosmetic.
kib [Thu, 13 Jul 2017 08:19:50 +0000 (08:19 +0000)]
It is believed to be only cosmetic.

Noted by: andrew
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoFix libarchive mismerge of r320927 in libarchive_entry.h
mm [Thu, 13 Jul 2017 04:46:00 +0000 (04:46 +0000)]
Fix libarchive mismerge of r320927 in libarchive_entry.h

MFC after: 1 week
X-MFC-with: 320927
Reported by: Ngie Cooper <ngie@FreeBSD.org>

6 years agoFix libarchive mismerge of r320927
mm [Thu, 13 Jul 2017 04:42:29 +0000 (04:42 +0000)]
Fix libarchive mismerge of r320927

MFC after: 1 week
X-MFC-with: 320927
Reported by: Ngie Cooper <ngie@FreeBSD.org>

6 years agoAdd some basic tests for hexdump(1)'s various output flags. Formatting
kevans [Thu, 13 Jul 2017 03:52:54 +0000 (03:52 +0000)]
Add some basic tests for hexdump(1)'s various output flags. Formatting
tests are omitted for this initial run as there are still some bugs to work
out there.

This covers -s flag testing on devices and non-devices that would have
caught breakage found in PR 219173 as well as other subtle breakage caused
locally.

Reviewed by: cem, ngie
Approved by: cem (acting co-mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11279

6 years agoPut an #ifdef notyet wrapper around a function that's not being used yet,
ian [Thu, 13 Jul 2017 02:20:07 +0000 (02:20 +0000)]
Put an #ifdef notyet wrapper around a function that's not being used yet,
to avoid compile warnings.

6 years agoSupport the "disable-over-current" property for imx ehci controllers.
ian [Thu, 13 Jul 2017 02:16:15 +0000 (02:16 +0000)]
Support the "disable-over-current" property for imx ehci controllers.

It turns out that this is more than a power optization.  The OTG port
won't work on boards that have this property unless this setting is honored.

Also ensure that the usb phy device attaches before ehci.

6 years agoMFV r320924:
mm [Thu, 13 Jul 2017 00:28:36 +0000 (00:28 +0000)]
MFV r320924:
Bump libarchive to 3.3.2

Vendor changes:
  PR #901: don't depend on stdin in a testcase

MFC after: 1 week

6 years agoMETA_MODE: Fix not writing .meta files in the kernel build.
bdrewery [Wed, 12 Jul 2017 19:01:25 +0000 (19:01 +0000)]
META_MODE: Fix not writing .meta files in the kernel build.

This was a regression in r320220 due to improper porting of the
same logic from share/mk/bsd.dep.mk and having only tested with
-DNO_FILEMON at the time.

Pointyhat to: bdrewery
Reported by: Mark Millard, dhw, O. Hartmann
Sponsored by: Dell EMC Isilon

6 years agoAdd a newline after the version string.
markj [Wed, 12 Jul 2017 18:29:25 +0000 (18:29 +0000)]
Add a newline after the version string.

MFC after: 3 days

6 years agoReset unsupported SFP tuneable back to original entry name.
sbruno [Wed, 12 Jul 2017 17:35:32 +0000 (17:35 +0000)]
Reset unsupported SFP tuneable back to original entry name.

Reported by: olivier@

6 years agoRemove an extraneous strlen from t_setdomainname.c
asomers [Wed, 12 Jul 2017 14:51:32 +0000 (14:51 +0000)]
Remove an extraneous strlen from t_setdomainname.c

Reported by: Coverity
CID: 1377568
MFC after: 15 days
X-MFC-With: 320737
Sponsored by: Spectra Logic Corp

6 years agokvprintf %b enhancements
rlibby [Wed, 12 Jul 2017 07:30:14 +0000 (07:30 +0000)]
kvprintf %b enhancements

Make the %b formatter accept number formatting flags. It will now accept
alternate form, precision, and length modifiers. It also now partially
supports field width (but forces left justification).

Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11284

6 years agoMFV r320905: Import upstream fix for CVE-2017-11103.
delphij [Wed, 12 Jul 2017 07:19:06 +0000 (07:19 +0000)]
MFV r320905: Import upstream fix for CVE-2017-11103.

In _krb5_extract_ticket() the KDC-REP service name must be obtained from
encrypted version stored in 'enc_part' instead of the unencrypted version
stored in 'ticket'.  Use of the unecrypted version provides an
opportunity for successful server impersonation and other attacks.

Submitted by: hrs
Obtained from: Heimdal
Security: FreeBSD-SA-17:05.heimdal
Security: CVE-2017-11103

6 years agoSupport multiple realtime clocks, and remove locking/sleeping restrictions
ian [Wed, 12 Jul 2017 02:53:54 +0000 (02:53 +0000)]
Support multiple realtime clocks, and remove locking/sleeping restrictions
on clock drivers.

This tracks multiple concurrent realtime clock drivers in a list sorted by
clock resolution.  When system time changes (and periodically) the
clock_settime() methods of all registered clocks are invoked.

To initialize system time, each driver is tried in turn from best to worst
resolution, until one succesfully returns a valid time.

The code no longer holds a mutex while calling the clock_settime() and
clock_gettime() methods of the registered clocks. This allows clock drivers
to do whatever kind of locking or sleeping is necessary (this is especially
important for i2c clock chips since i2c drivers often need to sleep).

A new clock_register_flags() function allows the clock driver to pass
flags. The flags currently defined help support drivers that use their own
techniques to avoid roundoff errors (prevents the 4/5 rounding done by the
subr_rtc code). A driver which may need to wait for resources (such as bus
ownership) may pass a flag to indicate that it will obtain system time for
itself after waiting for resources; this is merely an optimization to avoid
the common code retrieving a timespec that will never get used.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11484

6 years agoProtect access to the AT realtime clock with its own mutex.
ian [Wed, 12 Jul 2017 02:42:57 +0000 (02:42 +0000)]
Protect access to the AT realtime clock with its own mutex.

The mutex protecting access to the registered realtime clock should not be
overloaded to protect access to the atrtc hardware, which might not even be
the registered rtc. More importantly, the resettodr mutex needs to be
eliminated to remove locking/sleeping restrictions on clock drivers, and
that can't happen if MD code for amd64 depends on it. This change moves the
protection into what's really being protected: access to the atrtc date and
time registers.

This change also adds protection when the clock is accessed from
xentimer_settime(), which bypasses the resettodr locking.

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

6 years agoConsistently use vop_stdpathconf() for default pathconf values.
jhb [Tue, 11 Jul 2017 21:55:20 +0000 (21:55 +0000)]
Consistently use vop_stdpathconf() for default pathconf values.

Update filesystems not currently using vop_stdpathconf() in pathconf
VOPs to use vop_stdpathconf() for any configuration variables that do
not have filesystem-specific values.  vop_stdpathconf() is used for
variables that have system-wide settings as well as providing default
values for some values based on system limits.  Filesystems can still
explicitly override individual settings.

PR: 219851
Reported by: cem
Reviewed by: cem, kib, ngie
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D11541

6 years agoAdd a subroutine for comparing kerneldump identifiers.
markj [Tue, 11 Jul 2017 18:24:05 +0000 (18:24 +0000)]
Add a subroutine for comparing kerneldump identifiers.

MFC after: 2 weeks

6 years agoDon't dlclose NSS modules from nss_atexit().
markj [Tue, 11 Jul 2017 17:59:15 +0000 (17:59 +0000)]
Don't dlclose NSS modules from nss_atexit().

As hinted in the commit log message for r259042, this is unnecessary.
Moreover, as a result of that change we may invoke a DSO's atexit handler
after it has been unmapped.

Reviewed by: bdrewery, cem
MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoAdd external PLATFORM access on arm, and use it in the pl310 driver.
andrew [Tue, 11 Jul 2017 16:30:16 +0000 (16:30 +0000)]
Add external PLATFORM access on arm, and use it in the pl310 driver.

This allows multiple instances of SoCs that use the pl310 driver to be
built within the same kernel:

 * Add access to the platform_t object from outside platform.c
 * Use this with the pl310 driver

There is a new platform_pl310 interface to replace the existing code. SoCs
need to implement the init method, and if they have special requirements to
write to the two registers we care about will also need to implement the
write_ctrl and write_debug methods.

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

6 years agoFix BIT_FLS().
kib [Tue, 11 Jul 2017 12:35:44 +0000 (12:35 +0000)]
Fix BIT_FLS().

The iteration index is unsigned, so testing for larger than or equal
to zero makes little sense.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 3 days

6 years agoMake fsck_y_enable default to passing pass -R to fsck_ffs(8) in addition
trasz [Tue, 11 Jul 2017 12:32:40 +0000 (12:32 +0000)]
Make fsck_y_enable default to passing pass -R to fsck_ffs(8) in addition
to -y.  To me, fsck_y_enable means "try as hard as possible", and without
-R, it... well, doesn't.

Reviewed by: mckusick
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11490

6 years agoDIRDEPS_BUILD: Connect more libraries.
bdrewery [Tue, 11 Jul 2017 00:32:48 +0000 (00:32 +0000)]
DIRDEPS_BUILD: Connect more libraries.

Sponsored by: Dell EMC Isilon

6 years agoFix INSTALL_AS_USER after r319020.
bdrewery [Mon, 10 Jul 2017 23:52:07 +0000 (23:52 +0000)]
Fix INSTALL_AS_USER after r319020.

Reviewed by: vangyzen
MFC after: 1 week
Sponsored by: Dell EMC Isilon

6 years agoDIRDEPS_BUILD: Update dependencies.
bdrewery [Mon, 10 Jul 2017 23:52:04 +0000 (23:52 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: Dell EMC Isilon

6 years agoFollow-up r318881: Disconnect groff documents.
bdrewery [Mon, 10 Jul 2017 23:51:51 +0000 (23:51 +0000)]
Follow-up r318881: Disconnect groff documents.

6 years agoFix error check for Rx mbuf allocation in ENA driver
zbb [Mon, 10 Jul 2017 22:11:30 +0000 (22:11 +0000)]
Fix error check for Rx mbuf allocation in ENA driver

ena_alloc_rx_mbuf() will return positive error code
on failure. Act accordingly.

Submitted by: Krishna Yenduri <kyenduri at brkt.com>

6 years agoBump to FreeBSD_version to 1200038 for MMC CAM
imp [Mon, 10 Jul 2017 21:55:24 +0000 (21:55 +0000)]
Bump to FreeBSD_version to 1200038 for MMC CAM

6 years agoMove mmc_parmas to the end of the structure for better compatability.
imp [Mon, 10 Jul 2017 21:55:19 +0000 (21:55 +0000)]
Move mmc_parmas to the end of the structure for better compatability.

6 years agoKill some unnecessary noise.
imp [Mon, 10 Jul 2017 21:38:26 +0000 (21:38 +0000)]
Kill some unnecessary noise.

6 years agoMake sure the mlx4en RX DMA ring gets stamped with software ownership
hselasky [Mon, 10 Jul 2017 19:26:50 +0000 (19:26 +0000)]
Make sure the mlx4en RX DMA ring gets stamped with software ownership
in order to prevent the flow of QP to error in the firmware once
UPDATE_QP is called.

MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoStart to move the arm *_mp.h to be names *_machdep.h. These will be used
andrew [Mon, 10 Jul 2017 15:27:53 +0000 (15:27 +0000)]
Start to move the arm *_mp.h to be names *_machdep.h. These will be used
by the reworked pl310 driver interface in
https://reviews.freebsd.org/D11546

6 years agoProvide libdl.
kib [Mon, 10 Jul 2017 14:59:21 +0000 (14:59 +0000)]
Provide libdl.

Create libdl.so.1 as a filter for libc.so.7 which exports public dl*
functions. The functions are resolved from the rtld instead, the goal
of creating library is to avoid errors from the static linker due to
missed libdl. For static binaries, an empty .o is compiled into
libdl.a so that static binaries still get dl stubs from libc.a.

Right now lld cannot create filter objects, disable libdl on arm64
when binutils are not used.

Reviewed by: bdrewery, dim (previos version); emaste
Exp run: PR 220525, done by antoine
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D11504

6 years agoFix attribute flipping for cut marking in pixel mode. The text-mode
bde [Mon, 10 Jul 2017 09:00:35 +0000 (09:00 +0000)]
Fix attribute flipping for cut marking in pixel mode.  The text-mode
code was used, so the lightness bit was not flipped, so the flipping
was unnecessarily null in some cases.  E.g., the unusal color scheme
of lightwhite on white (white = lightgrey in kernelspeak) is not
completely unusable, except null flipping of it gave no visible marks
for cut marking.  Now flipping it works in pixel mode only.

Fix text cursor attribute adjustment over cut marking in text mode for
the usual cursor type (non-blinking full block).  Apply the flipping
for cut marking first and adjust that instead of vice versa.  This
gives a uniform color scheme for the usual text cursor type in text
mode: a white block background with no change to the character
foreground except for variations to avoid collisions.  The old order
gave a white character fg with no change in the bg in non-colliding
cases.  Versions before r316636 changed the bg to the non-cut-marked
one about half the time using a saveunder bug; this accidentally gave
something resembling a block cursor half the time.

6 years agoFix warnings, adjust style.
kib [Mon, 10 Jul 2017 08:10:45 +0000 (08:10 +0000)]
Fix warnings, adjust style.

Reviewed by: bdrewery, dim, emaste (as part of D11504)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years ago"Port Type not registered" is not a real error for GIT_PT.
mav [Mon, 10 Jul 2017 06:25:30 +0000 (06:25 +0000)]
"Port Type not registered" is not a real error for GIT_PT.

6 years agoFix whitespace bugs
ngie [Mon, 10 Jul 2017 05:16:07 +0000 (05:16 +0000)]
Fix whitespace bugs

- Delete trailing whitespace.
- Replace 8 single column spaces with hard tabs.
- Delete lines with consisting purely of blank space.
- Add space between `return` and `(`, per style(9).

Special care was taken to not blindly replace 8 single column spaces
with tabs; doing so could break tools that do strict string comparisons
with camcontrol output.

6 years agoInclude opt files in the kernel with "" instead of <>.
imp [Mon, 10 Jul 2017 05:08:01 +0000 (05:08 +0000)]
Include opt files in the kernel with "" instead of <>.

6 years agoFix -Wuninitialized warning with gcc
ngie [Mon, 10 Jul 2017 04:28:28 +0000 (04:28 +0000)]
Fix -Wuninitialized warning with gcc

Initialize mmc_data_byte to 0, as it could be used uninitialized
later on.

MFC with: r320846
Reported by: Jenkins (powerpc jobs)

6 years agoBetter contain MMCCAM parts of this file
imp [Mon, 10 Jul 2017 03:38:17 +0000 (03:38 +0000)]
Better contain MMCCAM parts of this file
Remove some useless to the general user debugs
Put debugs under sdhci_debug.
Fix some style(9) regressions

Submitted by: marius@

6 years agoOpt files are included with single quotes.
imp [Mon, 10 Jul 2017 03:38:12 +0000 (03:38 +0000)]
Opt files are included with single quotes.

6 years agoAdd dependency on opt_cam.h and opt_mmccam.h
imp [Mon, 10 Jul 2017 03:38:07 +0000 (03:38 +0000)]
Add dependency on opt_cam.h and opt_mmccam.h

6 years agoAdd some functions to math64.h in the LinuxKPI, and fix nearby style.
markj [Sun, 9 Jul 2017 23:14:51 +0000 (23:14 +0000)]
Add some functions to math64.h in the LinuxKPI, and fix nearby style.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11535

6 years agoAdd a few functions to ktime.h in the LinuxKPI, and fix nearby style.
markj [Sun, 9 Jul 2017 23:13:08 +0000 (23:13 +0000)]
Add a few functions to ktime.h in the LinuxKPI, and fix nearby style.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11534

6 years agoFree existing per-thread task structs when unloading linuxkpi.ko.
markj [Sun, 9 Jul 2017 22:57:00 +0000 (22:57 +0000)]
Free existing per-thread task structs when unloading linuxkpi.ko.

They are otherwise leaked.

Reported and tested by: ae
MFC after: 1 week

6 years agoAdd a helper function to agp(4) which installs a single GTT entry.
markj [Sun, 9 Jul 2017 22:53:24 +0000 (22:53 +0000)]
Add a helper function to agp(4) which installs a single GTT entry.

Submitted by: dumbbell
MFC after: 1 week

6 years agoBack out enabling the card interrupt detection bit. It is not ready to
imp [Sun, 9 Jul 2017 20:49:02 +0000 (20:49 +0000)]
Back out enabling the card interrupt detection bit. It is not ready to
commit.

Noticed by: marius@

6 years agoReconnect mmc and mmcsd disconnected unintentioanlly in mmccam commit.
imp [Sun, 9 Jul 2017 20:42:11 +0000 (20:42 +0000)]
Reconnect mmc and mmcsd disconnected unintentioanlly in mmccam commit.

6 years agopf: Fix vnet purging
kp [Sun, 9 Jul 2017 17:56:39 +0000 (17:56 +0000)]
pf: Fix vnet purging

pf_purge_thread() breaks up the work of iterating all states (in
pf_purge_expired_states()) and tracks progress in the idx variable.

If multiple vnets exist this results in pf_purge_thread() only calling
pf_purge_expired_states() for part of the states (the first part of the
first vnet, second part of the second vnet and so on).
Combined with the mark-and-sweep approach to cleaning up old rules (in
V_pf_unlinked_rules) that resulted in pf freeing rules that were still
referenced by states. This in turn caused panics when pf_state_expires()
encounters that state and attempts to access the rule.

We need to track the progress per vnet, not globally, so idx is moved
into a per-vnet V_pf_purge_idx.

PR: 219251
Sponsored by: Hackathon Essen 2017

6 years agoAdded new tool for doing experiments with SDIO card.
imp [Sun, 9 Jul 2017 17:05:48 +0000 (17:05 +0000)]
Added new tool for doing experiments with SDIO card.

Due to its experimental nature, it's not yet connected to the build.

Submitted by: Ilya Babulin

6 years agoNew command 'mmcsdcmd' for camcontrol, to allow interacting with SD cards
imp [Sun, 9 Jul 2017 17:02:52 +0000 (17:02 +0000)]
New command 'mmcsdcmd' for camcontrol, to allow interacting with SD cards

Submitted by: Ilya Babulin

6 years agoAdded mmcnull, an emulated lightweight MMC controller
imp [Sun, 9 Jul 2017 17:02:47 +0000 (17:02 +0000)]
Added mmcnull, an emulated lightweight MMC controller

This emulated device attaches to the ISA bus and registers itself as
HBA supporting MMC/SD cards. This allows to develop and test MMC XPT
and MMC / SDIO peripheral drivers even in the VM such as bhyve.

Submitted by: Ilya Babulin

6 years agoAn MMC/SD/SDIO stack using CAM
imp [Sun, 9 Jul 2017 16:57:24 +0000 (16:57 +0000)]
An MMC/SD/SDIO stack using CAM

Implement the MMC/SD/SDIO protocol within a CAM framework. CAM's
flexible queueing will make it easier to write non-storage drivers
than the legacy stack. SDIO drivers from both the kernel and as
userland daemons are possible, though much of that functionality will
come later.

Some of the CAM integration isn't complete (there are sleeps in the
device probe state machine, for example), but those minor issues can
be improved in-tree more easily than out of tree and shouldn't gate
progress on other fronts. Appologies to reviews if specific items
have been overlooked.

Submitted by: Ilya Bakulin
Reviewed by: emaste, imp, mav, adrian, ian
Differential Review: https://reviews.freebsd.org/D4761

merge with first commit, various compile hacks.

6 years agoFix loop termination in vm_map_find_min().
kib [Sun, 9 Jul 2017 15:41:49 +0000 (15:41 +0000)]
Fix loop termination in vm_map_find_min().

Reported by: antoine
Tested by: Stefan Ehmann <shoesoft@gmx.net>,
       Jan Kokemueller <jan.kokemueller@gmail.com>
PR: 220493
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

6 years agoRemove stale comments.
pfg [Sun, 9 Jul 2017 15:19:28 +0000 (15:19 +0000)]
Remove stale comments.

There's no real advantage in using memcpy here.

Dicussed with: bde (long ago)

6 years agoStyle(9). Whitespace.
dchagin [Sun, 9 Jul 2017 14:18:22 +0000 (14:18 +0000)]
Style(9). Whitespace.

MFC after: 3 weeks

6 years agoEliminate the bogus casts.
dchagin [Sun, 9 Jul 2017 14:15:51 +0000 (14:15 +0000)]
Eliminate the bogus casts.

MFC after: 3 weeks

6 years agodts: arm: Fix our local patches for H3
manu [Sun, 9 Jul 2017 13:56:34 +0000 (13:56 +0000)]
dts: arm: Fix our local patches for H3

sun4i-a10.h is not included anymore, define directly the drive strengh
of the pins.

6 years agoUpdate DTS files from Linux 4.12
manu [Sun, 9 Jul 2017 13:53:32 +0000 (13:53 +0000)]
Update DTS files from Linux 4.12

Notable changes:

Allwinner:
  * H3/H5 were merged into a common dtsi file
  * include/dt-bindings/sun4i-a10.h is not included anymore
  in a lot of dts files
  * Add sun8i-h3-nanopi-neo-air board DTS file

6 years agoUpdate the DTS file from Linux 4.12
manu [Sun, 9 Jul 2017 13:12:48 +0000 (13:12 +0000)]
Update the DTS file from Linux 4.12

6 years agoarm64: Add Allwinner I2C controller to GENERIC kernel
manu [Sun, 9 Jul 2017 12:53:02 +0000 (12:53 +0000)]
arm64: Add Allwinner I2C controller to GENERIC kernel

6 years agoif_awg: Add "allwinner,sun50i-a64-emac" compatible string.
manu [Sun, 9 Jul 2017 12:35:19 +0000 (12:35 +0000)]
if_awg: Add "allwinner,sun50i-a64-emac" compatible string.

This enable ethernet on Pine64 with latest DTS.

6 years agoMove open coding of construction of attributes for cut regions and
bde [Sun, 9 Jul 2017 12:13:37 +0000 (12:13 +0000)]
Move open coding of construction of attributes for cut regions and
text cursors to functions so that it is easier to fix and improve.
This commit doesn't fix anything except for removing unnecessary
complications and adding comments.

6 years agoSwitch prison check from PROV_DRIVER to PRIV_KMEM_WRITE (like /dev/mem).
netchild [Sun, 9 Jul 2017 06:50:15 +0000 (06:50 +0000)]
Switch prison check from PROV_DRIVER to PRIV_KMEM_WRITE (like /dev/mem).

Access to the dri device gives effectively access to the entire memory of the machine (you can program
the graphic card to do DMA).

For current/stable/release this is a NOP, as access to memory is not allowed in a jail. This puts the dri
device into the same (in)security class than /dev/mem for future use.

Discussed with: anholt(?) several years ago
Sponsored by: Hackathon Essen 2017

6 years ago - Extend pr_allow flags visually to 32 bits, to make it more obvious at first look...
netchild [Sun, 9 Jul 2017 06:40:16 +0000 (06:40 +0000)]
 - Extend pr_allow flags visually to 32 bits, to make it more obvious at first look how much flags we still
   have available to use in the future.
 - Add kmem_access flag as a placeholder (reserve it), not used yet.

Differential Revision: D11451
Reviewed by: jamie
Sponsored by: Hackathon Essen 2017

6 years agoDon't initialize error in declaration.
dchagin [Sat, 8 Jul 2017 21:15:46 +0000 (21:15 +0000)]
Don't initialize error in declaration.

MFC after: 3 weeks

6 years agoEliminate the bogus cast.
dchagin [Sat, 8 Jul 2017 21:13:25 +0000 (21:13 +0000)]
Eliminate the bogus cast.

MFC after: 3 weeks

6 years agoEliminate the bogus cast.
dchagin [Sat, 8 Jul 2017 21:12:00 +0000 (21:12 +0000)]
Eliminate the bogus cast.

MFC after: 3 weeks

6 years agoDon't take a lock around atomic operation.
dchagin [Sat, 8 Jul 2017 21:08:22 +0000 (21:08 +0000)]
Don't take a lock around atomic operation.

MFC after: 3 weeks

6 years agoRemove init from declaration, collapse two int vars declarations into single.
dchagin [Sat, 8 Jul 2017 21:05:28 +0000 (21:05 +0000)]
Remove init from declaration, collapse two int vars declarations into single.

MFC after: 3 weeks

6 years agoRemove init from declaration.
dchagin [Sat, 8 Jul 2017 21:04:09 +0000 (21:04 +0000)]
Remove init from declaration.

MFC after: 3 weeks

6 years agoStyle(9). Add blank line aftr {.
dchagin [Sat, 8 Jul 2017 21:02:40 +0000 (21:02 +0000)]
Style(9). Add blank line aftr {.

MFC after: 3 weeks

6 years agoAdd some helper definitions to fs.h in the LinuxKPI.
markj [Sat, 8 Jul 2017 20:11:06 +0000 (20:11 +0000)]
Add some helper definitions to fs.h in the LinuxKPI.

Add a field to struct linux_file to allow the creation of anonymous
shmem objects.

MFC after: 1 week

6 years agoFix the definitions of pgprot_{noncached,writecombine} after r316562.
markj [Sat, 8 Jul 2017 19:22:29 +0000 (19:22 +0000)]
Fix the definitions of pgprot_{noncached,writecombine} after r316562.

MFC after: 1 week

6 years agoAdd device_is_registered() to the LinuxKPI.
markj [Sat, 8 Jul 2017 18:53:02 +0000 (18:53 +0000)]
Add device_is_registered() to the LinuxKPI.

MFC after: 1 week

6 years agoAdd TASK_COMM_LEN to the LinuxKPI.
markj [Sat, 8 Jul 2017 18:52:29 +0000 (18:52 +0000)]
Add TASK_COMM_LEN to the LinuxKPI.

MFC after: 1 week

6 years agomakeman: Don't show META_MODE ABI rebuild warnings.
bdrewery [Sat, 8 Jul 2017 17:53:00 +0000 (17:53 +0000)]
makeman: Don't show META_MODE ABI rebuild warnings.

Reported by: dim
Sponsored by: Dell EMC Isilon

6 years agoAdd many bitmaps (now there are 13) for mouse cursors and logic to try
bde [Sat, 8 Jul 2017 17:30:33 +0000 (17:30 +0000)]
Add many bitmaps (now there are 13) for mouse cursors and logic to try
to choose the best one.

The old 9x13 cursor was was sort of correct for CGA 640x200 text mode,
but distorted for all other modes.  This mode is still available on
all systems with VGA, but stopped being useful in ~1985.  It has very
unsquare pixels with an aspect ratio of 240:100 on 4:3 monitors.  On
16:9 monitors, the unsquareness in this mode is reduced to only 180:100
iff the monitor stretches the pixels to the full screen.

Newer modes and systems have smaller distortions, but with many more
variations.  Square pixels first became common with VGA 640x480 mode
on 4:3 monitors.  However, standard VGA text mode also has 9-bit wide
characters and only 25 lines, so it has 720x400 pixels.  This has
unsquare pixels with an aspect ratio of 135:100 on 4:3 monitors.  On
16:9 monitors, it gives almost-square pixels with an aspect ration of
101:100 iff the monitor stretches, but in modes that were square on
4:3 monitors square similar monitor stretching breaks the squareness.

Guess the physical aspect ratio using heuristics.  The old version of
X that I use is further from doing this using info from PnP monitors
that is unavailable in syscons (X doesn't understand if the monitor
is doing stretching and doesn't even understand how its its own mode
changes affect the pixel size).  Monitors with aspect ratio control
should be configured to _not_ stretch 4:3 modes to 16:9.  Otherwise,
use the machdep.vga_aspect_scale sysctl to compensate.  Only 1 of my
4 monitors/laptops requires this.  It always stretches to 16:9.

The mouse data has new aspect ratio fields for selecting the best
cursor and a new name field for display in debugging messages.

Selecting the mouse cursor is now a slow operation so it is not done
for every drawing of the cursor.  To avoid a new initialization method,
it is done whenever the text cursor is set or changed.  Also remove
dead code in settings of text cursors.

Use larger mouse cursors (sometimes the full 10x16 one) for 8x8 fonts
in cases where this works better (mostly in graphics mode).

6 years agostdbuf(1): Add buffer definition "B" to the usage message
asomers [Sat, 8 Jul 2017 17:08:42 +0000 (17:08 +0000)]
stdbuf(1): Add buffer definition "B" to the usage message

This option has been missing from the usage message ever since the program
was first imported.

Submitted by: shivansh
Reviewed by: asomers
MFC after: 3 weeks
Sponsored by: Google, Inc (GSoC 2017)
Differential Revision: https://reviews.freebsd.org/D11529

6 years agoSYSTEM_COMPILER: Ensure there is not a stale compiler in WORLDTMP.
bdrewery [Sat, 8 Jul 2017 16:39:55 +0000 (16:39 +0000)]
SYSTEM_COMPILER: Ensure there is not a stale compiler in WORLDTMP.

In a scenario of cross-building it is possible that an OBJDIR's WORLDTMP
contains an older compiler in WORLDTMP/usr/bin/cc that is not rebuilt
if SYSTEM_COMPILER logic is triggered.  This compiler was still
incorrectly used.  Address this by removing WORLDTMP/usr/bin/cc and all
of the hardlinked files associated with it.  Also do this for c++ for
GCC builds.

Sponsored by: Dell EMC Isilon
MFC after: 1 week

6 years agoAdd files to help manage the (vga) syscons mouse cursor.
bde [Sat, 8 Jul 2017 15:01:55 +0000 (15:01 +0000)]
Add files to help manage the (vga) syscons mouse cursor.

To mostly fix distortion of mouse cursors by non-square pixels, I
needed 8 variants of the same cursor shape for large fonts and
another 7 variants for small fonts.  Some variants are shared,
leaving only 13 variants in 26 glyphs altogether.  Keep these in
the BDF source file cursor.bdf.  cursor.bdf has another 5 unused
experimental cursors in 10 glyphs.  cursor.awk is a simple awk
script for converting this and similar bdf files into C declarations
for copying into scvgarndr.c.  syscons doesn't use any of this yet.

6 years agoFix handling of one more possible exception on return to usermode.
kib [Sat, 8 Jul 2017 11:07:39 +0000 (11:07 +0000)]
Fix handling of one more possible exception on return to usermode.

If %ss is loaded with a segment pointing to a non-present descriptor
by the IRETD instruction, a kernel-mode #SS exception is generated.
Resulting T_STKFLT trap must be checked against doreti_iret_fault
location and handled, otherwise userspace may panic the kernel.

Note that this is i386 variant of FreeBSD-SA-15:21.amd64, but unlike
amd64, there is no swapgs on i386 and the issue is arguably not
exploitable.

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

6 years agoFix "mount -uw /" when the filesystem type doesn't match.
trasz [Sat, 8 Jul 2017 11:06:27 +0000 (11:06 +0000)]
Fix "mount -uw /" when the filesystem type doesn't match.

This basically makes "mount -uw /" work when the filesystem
mounted on / is NFS, but the one configured in fstab(5) is UFS,
which can happen when you forget to modify fstab.

Note that the whole special case ("else if (argv[0][0] == '/'")
is probably not needed anyway.  I'll take a look at removing it
altogether; for now this is a minimally intrusive fix.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11323

6 years agoAllow more services to run in vnet jails
kp [Sat, 8 Jul 2017 09:28:31 +0000 (09:28 +0000)]
Allow more services to run in vnet jails

After some tests, here are the services that run into a vnet jail:
  - defaultroute
  - dhclient
  - ip6addrctl
  - natd
  - pf
  - pfsync
  - pflog (deamon runs, pflog0 interface usable, but /var/log/pflog not filled)
  - rarpd
  - route6d (do nothing anyway because obsolete)
  - routed (do nothing anyway because obsolete)
  - rtsold
  - static_arp
  - static_ndp

PR: 220530
Submitted by: olivier@freebsd.org

6 years agoSimplify language.
kib [Sat, 8 Jul 2017 07:33:30 +0000 (07:33 +0000)]
Simplify language.

Submitted by: wblock
MFC after: 3 days

6 years agoCorrectly ignore branch operators in the top-level parser when applicable.
kevans [Fri, 7 Jul 2017 22:00:39 +0000 (22:00 +0000)]
Correctly ignore branch operators in the top-level parser when applicable.

An oversight in r320742 caused BREs to become sensitive to the branching operator prematurely, which caused
breakage in some limited situations -- namely, those that tried to use branching in a BRE. Most of these scenarios
had already been corrected beforehand to properly use gsed or grep for GNU extensions, so the damage is
slightly mitigated.

Reported by: antoine

Reported by: antoine
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11522

6 years agoBump date for today's commit.
imp [Fri, 7 Jul 2017 16:58:40 +0000 (16:58 +0000)]
Bump date for today's commit.