]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMake sure the mlx4en RX DMA ring gets stamped with software ownership
Hans Petter Selasky [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

7 years agoStart to move the arm *_mp.h to be names *_machdep.h. These will be used
Andrew Turner [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

7 years agoProvide libdl.
Konstantin Belousov [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

7 years agoFix attribute flipping for cut marking in pixel mode. The text-mode
Bruce Evans [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.

7 years agoFix warnings, adjust style.
Konstantin Belousov [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

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

7 years agoFix whitespace bugs
Enji Cooper [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.

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

7 years agoFix -Wuninitialized warning with gcc
Enji Cooper [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)

7 years agoBetter contain MMCCAM parts of this file
Warner Losh [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@

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

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

7 years agoAdd some functions to math64.h in the LinuxKPI, and fix nearby style.
Mark Johnston [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

7 years agoAdd a few functions to ktime.h in the LinuxKPI, and fix nearby style.
Mark Johnston [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

7 years agoFree existing per-thread task structs when unloading linuxkpi.ko.
Mark Johnston [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

7 years agoAdd a helper function to agp(4) which installs a single GTT entry.
Mark Johnston [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

7 years agoBack out enabling the card interrupt detection bit. It is not ready to
Warner Losh [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@

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

7 years agopf: Fix vnet purging
Kristof Provost [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

7 years agoAdded new tool for doing experiments with SDIO card.
Warner Losh [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

7 years agoNew command 'mmcsdcmd' for camcontrol, to allow interacting with SD cards
Warner Losh [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

7 years agoAdded mmcnull, an emulated lightweight MMC controller
Warner Losh [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

7 years agoAn MMC/SD/SDIO stack using CAM
Warner Losh [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.

7 years agoFix loop termination in vm_map_find_min().
Konstantin Belousov [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

7 years agoRemove stale comments.
Pedro F. Giffuni [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)

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

MFC after: 3 weeks

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

MFC after: 3 weeks

7 years agodts: arm: Fix our local patches for H3
Emmanuel Vadot [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.

7 years agoUpdate DTS files from Linux 4.12
Emmanuel Vadot [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

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

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

7 years agoif_awg: Add "allwinner,sun50i-a64-emac" compatible string.
Emmanuel Vadot [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.

7 years agoMove open coding of construction of attributes for cut regions and
Bruce Evans [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.

7 years agoSwitch prison check from PROV_DRIVER to PRIV_KMEM_WRITE (like /dev/mem).
Alexander Leidinger [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

7 years ago - Extend pr_allow flags visually to 32 bits, to make it more obvious at first look...
Alexander Leidinger [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

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

MFC after: 3 weeks

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

MFC after: 3 weeks

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

MFC after: 3 weeks

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

MFC after: 3 weeks

7 years agoRemove init from declaration, collapse two int vars declarations into single.
Dmitry Chagin [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

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

MFC after: 3 weeks

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

MFC after: 3 weeks

7 years agoAdd some helper definitions to fs.h in the LinuxKPI.
Mark Johnston [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

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

MFC after: 1 week

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

MFC after: 1 week

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

MFC after: 1 week

7 years agomakeman: Don't show META_MODE ABI rebuild warnings.
Bryan Drewery [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

7 years agoAdd many bitmaps (now there are 13) for mouse cursors and logic to try
Bruce Evans [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).

7 years agostdbuf(1): Add buffer definition "B" to the usage message
Alan Somers [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

7 years agoSYSTEM_COMPILER: Ensure there is not a stale compiler in WORLDTMP.
Bryan Drewery [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

7 years agoAdd files to help manage the (vga) syscons mouse cursor.
Bruce Evans [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.

7 years agoFix handling of one more possible exception on return to usermode.
Konstantin Belousov [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

7 years agoFix "mount -uw /" when the filesystem type doesn't match.
Edward Tomasz Napierala [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

7 years agoAllow more services to run in vnet jails
Kristof Provost [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

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

Submitted by: wblock
MFC after: 3 days

7 years agoCorrectly ignore branch operators in the top-level parser when applicable.
Kyle Evans [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

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

7 years agoImprove wording for -E and -t flags. -E never writes the entire disk,
Warner Losh [Fri, 7 Jul 2017 16:54:18 +0000 (16:54 +0000)]
Improve wording for -E and -t flags. -E never writes the entire disk,
so don't imply that. Note that if BIO_DELETE isn't supported, the
operation will fail (as opposed to writing the entire disk with
zeros). Thin storage also benefits from trim. List more accurate
reason why trim helps flash-memory.

7 years agoConnect ena(4) to the build.
Glen Barber [Fri, 7 Jul 2017 16:22:09 +0000 (16:22 +0000)]
Connect ena(4) to the build.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoRemove the MULTIDELAY option from arm. It's now enabled when PLATFORM is
Andrew Turner [Fri, 7 Jul 2017 13:55:11 +0000 (13:55 +0000)]
Remove the MULTIDELAY option from arm. It's now enabled when PLATFORM is
enabled.

7 years agoComplete r320189 which allows a NULL VM fault handler in the LinuxKPI.
Hans Petter Selasky [Fri, 7 Jul 2017 13:44:14 +0000 (13:44 +0000)]
Complete r320189 which allows a NULL VM fault handler in the LinuxKPI.
Instead of mapping a dummy page upon a page fault, map the page
pointed to by the physical address given by IDX_TO_OFF(vmap->vm_pfn).
To simplify the implementation use OBJT_DEVICE to implement our own
linux_cdev_pager_fault() instead of using the existing
linux_cdev_pager_populate().

Some minor code factoring while at it.

Reviewed by: markj @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoFix a bug in synchronize RCU when the calling thread is bound to a CPU.
Hans Petter Selasky [Fri, 7 Jul 2017 13:15:00 +0000 (13:15 +0000)]
Fix a bug in synchronize RCU when the calling thread is bound to a CPU.

Set "td_pinned" to zero after "sched_unbind()" to prevent "td_pinned"
from temporarily becoming negative during "sched_bind()". This can
happen if "sched_bind()" uses "sched_pin()" and "sched_unpin()".

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoImplement fix for BULK IN-token retry mechanism. When the hardware is
Hans Petter Selasky [Fri, 7 Jul 2017 12:03:58 +0000 (12:03 +0000)]
Implement fix for BULK IN-token retry mechanism. When the hardware is
programmed for infinite IN token retry after NAK, the SAF1761
hardware, however, does not retry the IN-token. This problem is
described in the SAF1761 errata, section 18.1.1.

While at it:
- Add some minor chip specific initialization for RTEMS.
- Add debug print for status registers in the interrupt filter.

Submitted by: Christian Mauderer <christian.mauderer@embedded-brains.de>
MFC after: 1 week

7 years agoamd-vi: gcc build errors
Ryan Libby [Fri, 7 Jul 2017 06:37:19 +0000 (06:37 +0000)]
amd-vi: gcc build errors

amdvi_cmp_wait: gcc complained about a malformed string behind an ifdef.

struct amdvi_dte: widen the type of the first reserved bitfield so that
the packed representation would not cross an alignment boundary for that
type. Apparently that causes in-tree gcc (4.2) to insert padding
(despite packed, resulting in a wrong structure definition), and causes
more modern gcc to emit a warning.

ivrs_hdr_iterate_tbl: delete a misleading check about header length
being less than 0 (the type is unsigned) and replace it with a check
that the length doesn't exceed the table size.

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

7 years agoImprove BIT_FLS() documentation.
Konstantin Belousov [Fri, 7 Jul 2017 05:43:44 +0000 (05:43 +0000)]
Improve BIT_FLS() documentation.

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

7 years ago - Use strlcat() instead of strncat().
Xin LI [Fri, 7 Jul 2017 02:48:55 +0000 (02:48 +0000)]
 - Use strlcat() instead of strncat().
 - Use asprintf() and handle allocation errors.

Reviewed by: kevlo
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11486

7 years agoDocument the changes done to nfsuserd by r320757.
Rick Macklem [Thu, 6 Jul 2017 22:34:34 +0000 (22:34 +0000)]
Document the changes done to nfsuserd by r320757.

This is a content change.

7 years agoModify the nfsuserd daemon so that it uses an AF_LOCAL socket for upcalls.
Rick Macklem [Thu, 6 Jul 2017 22:04:37 +0000 (22:04 +0000)]
Modify the nfsuserd daemon so that it uses an AF_LOCAL socket for upcalls.

This patch modifies the nfsuserd daemon so that it uses an AF_LOCAL socket
for upcalls by default. This should fix the problem with using a UDP
socket upcall to 127.0.0.1 when jails are used.
The AF_LOCAL socket case only supports a single server daemon, since hangs
were observed by the original problem reporter when multiple daemons
were used.
The patch adds a command line option called "-use-udpsock" which makes
the daemon revert to its prepatched behaviour.

Suggested by: dfr
PR: 205193
Relnotes: yes

7 years agoAdd BIT_FLS() analogous to BIT_FFS().
Konstantin Belousov [Thu, 6 Jul 2017 21:47:17 +0000 (21:47 +0000)]
Add BIT_FLS() analogous to BIT_FFS().

The benefit of BIT_FLS() is that ffsl() can be implemented with a
count leading zeros instruction which is more widespread available.

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

7 years agoUpdate copyright e-mail address to @FreeBSD.org address
Kyle Evans [Thu, 6 Jul 2017 19:53:30 +0000 (19:53 +0000)]
Update copyright e-mail address to @FreeBSD.org address

Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11508

7 years agoFix sparc64 libc build after r320742.
Kyle Evans [Thu, 6 Jul 2017 18:21:30 +0000 (18:21 +0000)]
Fix sparc64 libc build after r320742.

p_branch_empty was declared but never used due to an oversight. Use it as
designed, further comment on its return value.

Reported by: Jenkins (head-sparc64)
Reviewed by: emaste
Approved by: emaste (mentor)
MFC with: r320742
Differential Revision: https://reviews.freebsd.org/D11506

7 years agoAllow passing NOPKG= to make(1) to prevent the pkg-stage target
Glen Barber [Thu, 6 Jul 2017 17:54:03 +0000 (17:54 +0000)]
Allow passing NOPKG= to make(1) to prevent the pkg-stage target
from getting executed.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoFix drivers that assume ticks starts at zero. These drivers all have logic
Ian Lepore [Thu, 6 Jul 2017 17:03:22 +0000 (17:03 +0000)]
Fix drivers that assume ticks starts at zero.  These drivers all have logic
similar to "if (ticks > localvar+interval) {localvar=ticks; ...}" where
localvar is initialized to zero.  Ticks is initialized to a negative value
since r278230, and that leads to these if statements never being true.

7 years agoThe impending libregex will implement GNU extensions to bring BREs and
Kyle Evans [Thu, 6 Jul 2017 17:01:51 +0000 (17:01 +0000)]
The impending libregex will implement GNU extensions to bring BREs and
EREs closer together. Prepare for this and reduce the diff of libregex changes by
refactoring and combining the top-level parsers for EREs/BREs ahead of time.

Branching functionality has been split out to make it easier to follow the combined
version of the top-level parser. It may also be enabled in the parsing context to make
it easier when libregex enables branching for BREs.

A branching context was also added for the various branching functions and so that
BREs, for instance, can determine if they're the first expression in a chain of expressions
within the current branch and treat '*' as ordinary if so.

This should have no functional impact and negligible performance impact.

Reviewed by: cem, emaste, pfg
Approved by: emaste (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D10920

7 years agoMake ^c work in ddb(4).
Edward Tomasz Napierala [Thu, 6 Jul 2017 15:27:34 +0000 (15:27 +0000)]
Make ^c work in ddb(4).

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

7 years agoMake ^w work in ddb(4).
Edward Tomasz Napierala [Thu, 6 Jul 2017 15:21:57 +0000 (15:21 +0000)]
Make ^w work in ddb(4).

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

7 years agoMake ddb(4) disassembler (x/i) use n32 register names.
Edward Tomasz Napierala [Thu, 6 Jul 2017 15:08:51 +0000 (15:08 +0000)]
Make ddb(4) disassembler (x/i) use n32 register names.

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

7 years agoSimplify UIO_SYSSPACE and UIO_NOCOPY paths in uiomove
Andrew Gallatin [Thu, 6 Jul 2017 15:03:54 +0000 (15:03 +0000)]
Simplify UIO_SYSSPACE and UIO_NOCOPY paths in uiomove

Uiomove can only block when the segflag is UIO_USERSPACE,
otherwise we end up just doing a bcopy (or nothing) and
moving cursors. So only emit witness warnings and
set deadlock thread flags in the UIO_USERSPACE case.

Reviewed by: kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D11489

7 years agoFix cleanup in lib/libc/gen/setdomainname_test
Alan Somers [Thu, 6 Jul 2017 14:47:59 +0000 (14:47 +0000)]
Fix cleanup in lib/libc/gen/setdomainname_test

ATF cleanup routines run in separate processes from the tests themselves, so
they can't share global variables.

Also, setdomainname_test needs to be is_exclusive because the test cases
access a global resource.

PR: 219967
Reviewed by: ngie
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11188

7 years agoacpidump: warn and exit loop on invalid subtable length
Ed Maste [Thu, 6 Jul 2017 14:35:47 +0000 (14:35 +0000)]
acpidump: warn and exit loop on invalid subtable length

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by: The FreeBSD Foundation

7 years agocompiler_rt: provide bswap buildins on sparc64
Ed Maste [Thu, 6 Jul 2017 13:27:01 +0000 (13:27 +0000)]
compiler_rt: provide bswap buildins on sparc64

Attempting to build sparc64 world with GCC 6.3 previously failed with
zstd_compress.c:(.text+0x8fc): undefined reference to `__bswapsi2'

7 years agoImprove ddb(4) error reporting a bit.
Edward Tomasz Napierala [Thu, 6 Jul 2017 12:30:39 +0000 (12:30 +0000)]
Improve ddb(4) error reporting a bit.

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

7 years agoMake ddb(4) a bit more user-friendly by improving "help".
Edward Tomasz Napierala [Thu, 6 Jul 2017 12:27:14 +0000 (12:27 +0000)]
Make ddb(4) a bit more user-friendly by improving "help".

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

7 years agousr.sbin/bsdinstall/scripts/hardening: fix options numbers
Bartek Rutkowski [Thu, 6 Jul 2017 12:19:15 +0000 (12:19 +0000)]
usr.sbin/bsdinstall/scripts/hardening: fix options numbers

Submitted by: Bartek Rutkowski <robak@FreeBSD.org>
Reviewed by: bapt
Approved by: bapt
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D11505

7 years agoReport device descr in addition to ident.
Alexander Motin [Thu, 6 Jul 2017 09:05:38 +0000 (09:05 +0000)]
Report device descr in addition to ident.

Serial number without device model is somewhat less useful.

MFC after: 2 weeks

7 years agoAdd GEOM::descr attribute for symmetry with GEOM::ident.
Alexander Motin [Thu, 6 Jul 2017 08:36:14 +0000 (08:36 +0000)]
Add GEOM::descr attribute for symmetry with GEOM::ident.

MFC after: 2 weeks

7 years agoChase upstream change deprecating LIBXO_OPTIONS similar to r320521
Enji Cooper [Thu, 6 Jul 2017 08:05:57 +0000 (08:05 +0000)]
Chase upstream change deprecating LIBXO_OPTIONS similar to r320521

LIBXO_OPTIONS was deprecated in favor of the --libxo options.

Inspired by: https://github.com/Juniper/libxo (02272d5c6d7d)

7 years ago:snprintf_float: don't blindly set RLIMIT_DATA and RLIMIT_AS to 1 MB -- raise
Enji Cooper [Thu, 6 Jul 2017 07:59:00 +0000 (07:59 +0000)]
:snprintf_float: don't blindly set RLIMIT_DATA and RLIMIT_AS to 1 MB -- raise
the limit to 32MB instead.

Require user=root and memory=64MB+ first so one can be reasonably sure that
the test will function appropriately.

MFC after: 1 month
MFC with: r320726
PR: 220502

7 years agoExpect :snprintf_float to segfault
Enji Cooper [Thu, 6 Jul 2017 07:45:20 +0000 (07:45 +0000)]
Expect :snprintf_float to segfault

This issue started occurring within the past month or so.

PR: 220502
Reported by: Jenkins (amd64-head job)

7 years agortwn: add Rx descriptor structures for common code.
Andriy Voskoboinyk [Thu, 6 Jul 2017 07:37:33 +0000 (07:37 +0000)]
rtwn: add Rx descriptor structures for common code.

Remove any chipset specific usage of Rx descriptor structure / bits
from common code to prevent misuse of fields that may differ
between various chipsets.

Checked with:  RTL8821AU in STA mode.

7 years ago:l_flag:: be more aggressive when normalizing whitespace
Enji Cooper [Thu, 6 Jul 2017 07:37:03 +0000 (07:37 +0000)]
:l_flag:: be more aggressive when normalizing whitespace

Save output from ls -ldT and stat -l, then normalize all repeating whitespace using
sed to single column spaces.

This makes the test flexible with single-digit days, etc, similar to r320723. This
approach is just a bit more of a hammer approach because of how the columns are
ordered/spaced in both ls and stat.

MFC after: 1 week
MFC with: r319841

7 years agoUse %e instead of %d with x_output_date(..)
Enji Cooper [Thu, 6 Jul 2017 06:15:44 +0000 (06:15 +0000)]
Use %e instead of %d with x_output_date(..)

stat -x doesn't 0-fill days so %d is inappropriate. %e is correct.

MFC after: 1 week
MFC with: r319841

7 years agoRegenerate src.conf(5)
Enji Cooper [Thu, 6 Jul 2017 05:43:04 +0000 (05:43 +0000)]
Regenerate src.conf(5)

7 years agoAdd WITH_RCMDS for parity with WITHOUT_RCMDS
Enji Cooper [Thu, 6 Jul 2017 05:40:51 +0000 (05:40 +0000)]
Add WITH_RCMDS for parity with WITHOUT_RCMDS

7 years agohptmv: avoid gcc variably-modified warning
Ryan Libby [Thu, 6 Jul 2017 05:32:22 +0000 (05:32 +0000)]
hptmv: avoid gcc variably-modified warning

gcc produces a "variably modified X at file scope" warning for
structures that use these size definitions.

PR: 211540
Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential revision: https://reviews.freebsd.org/D11416

7 years agoRelease mtx hw_lock before calling pause() in qla_stop() and
David C Somayajulu [Thu, 6 Jul 2017 05:16:06 +0000 (05:16 +0000)]
Release mtx hw_lock before calling pause() in qla_stop() and
qla_error_recovery()

MFC after: 5 days

7 years ago[ar724x] put in explicit memory barriers now that read/write register no longer
Adrian Chadd [Thu, 6 Jul 2017 04:56:23 +0000 (04:56 +0000)]
[ar724x] put in explicit memory barriers now that read/write register no longer
implicitly do them.

They were removed as part of my "fix this to actually work" a few commits
ago in this file.

Tested:

* AP93, AR7240 + AR9280 PCI

7 years agoAdd tests to help verify Links functionality for .../contrib/tzdata/backwards
Enji Cooper [Thu, 6 Jul 2017 04:30:06 +0000 (04:30 +0000)]
Add tests to help verify Links functionality for .../contrib/tzdata/backwards

MFC after: 1 month
MFC with: r320702

7 years agoFormalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as
Enji Cooper [Thu, 6 Jul 2017 04:19:33 +0000 (04:19 +0000)]
Formalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as
`MK_ZONEINFO_LEAPSECONDS_SUPPORT == yes` and
`MK_ZONEINFO_OLD_TIMEZONES_SUPPORT == yes`.

Keep `LEAPSECONDS` and `OLDTIMEZONES` for backwards compatibility,
but print out a warning notifying users that they should use the new
variables, in an effort to migrate them to the variables. This is being
done mostly for automated build tools, etc, that might rely on these
variables being set. The variables will be removed in the future on
^/head, e.g., after ^/stable/12 is cut.

MFC after:      1 month
Relnotes:       yes
Reviewed by: bdrewery
Differential Revision: D11376

7 years agoRemove SUBDIR ordering/uniquifying in *bin/Makefile
Enji Cooper [Thu, 6 Jul 2017 04:15:30 +0000 (04:15 +0000)]
Remove SUBDIR ordering/uniquifying in *bin/Makefile

After the addition of SUBDIR.yes, uniquifying/ordering the SUBDIRs doesn't
make a whole lot of sense, and it's in effect a half measure.

Ordering SUBDIR (after adding SUBDIR.yes to it) in bsd.subdir.mk is a
separate change that warrants more discussion/testing, because while
the SUBDIR_PARALLEL work largely fixed dependency ordering for SUBDIRs,
there might be downstream FreeBSD consumers that rely on the SUBDIR
ordering.

MFC after: 2 months
Reviewed by: bdrewery
Differential Revision: D11398