Commit Graph

225249 Commits

Author SHA1 Message Date
Ian Lepore
7ad88b3ce0 The imx6_snvs driver is not strictly required for the system to run, so
change it from standard to optional and add a device statement for it so
that it's included unless someone uses nodevice to eliminate it.
2017-08-02 15:15:18 +00:00
Konstantin Belousov
dfcc612cb0 For makedev(), cast the minor argument to unsigned type explicitely,
avoiding possible sign propagation.

Submitted by:	hselasky
2017-08-02 14:54:54 +00:00
Hans Petter Selasky
2b79a966ab Fix LinuxKPI regression after r321920. The mda_unit and si_drv0 fields are not
wide enough to hold the full 64-bit dev_t. Instead use the "dev" field in
the "linux_cdev" structure to store and lookup this value.

While at it remove superfluous use of parenthesis inside the
MAJOR(), MINOR() and MKDEV() macros in the LinuxKPI.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2017-08-02 14:27:27 +00:00
Andrew Turner
28356527bf Fix the return type for get_cntxc(). The register is 64-bit on both arm
and arm64 so move any truncation to the caller.

Submitted by:	Mihai Carabas <mihai.carabas@gmail.com>
X-Differential Revision:	https://reviews.freebsd.org/D10213
2017-08-02 14:12:47 +00:00
Ed Schouten
c852847584 Keep top page on CloudABI to work around AMD Ryzen stability issues.
Similar to r321899, reduce sv_maxuser by one page inside of CloudABI.
This ensures that the stack, the vDSO and any allocations cannot touch
the top page of user virtual memory.

Considering that CloudABI userspace is completely oblivious to virtual
memory layout, don't bother making this conditional based on the CPU of
the running system.

Reviewed by:	kib, truckman
Differential Revision:	https://reviews.freebsd.org/D11808
2017-08-02 13:08:10 +00:00
Dru Lavigne
eb4db65b18 Update my entry in marketing. 2017-08-02 12:31:03 +00:00
Mateusz Guzik
fd1d4c8159 amd64: annotate the syscall return address check with __predict_false
before:
   0xffffffff80b03ebb <+2059>:	mov    0x460(%r14),%rax
   0xffffffff80b03ec2 <+2066>:	mov    0x98(%rax),%rax
   0xffffffff80b03ec9 <+2073>:	shr    $0x2f,%rax
   0xffffffff80b03ecd <+2077>:	je     0xffffffff80b03edd <amd64_syscall+2093>
   0xffffffff80b03ecf <+2079>:	mov    0x3f8(%r14),%rax
   0xffffffff80b03ed6 <+2086>:	orl    $0x1,0xc8(%rax)
   0xffffffff80b03edd <+2093>:	add    $0xf8,%rsp

after:
   0xffffffff80b03ebb <+2059>:	mov    0x460(%r14),%rax
   0xffffffff80b03ec2 <+2066>:	mov    0x98(%rax),%rax
   0xffffffff80b03ec9 <+2073>:	shr    $0x2f,%rax
   0xffffffff80b03ecd <+2077>:	jne    0xffffffff80b03eef <amd64_syscall+2111>
   0xffffffff80b03ecf <+2079>:	add    $0xf8,%rsp

Reviewed by:	kib
MFC after:	1 week
2017-08-02 11:25:38 +00:00
Alexander Motin
f2d3f6918e Add compat shim part missed at r305197.
This fixes compatibility between old kernel and new ZFS tools.
It seems to be tradition to forget it. :(

PR:		221112
MFC after:	3 days
2017-08-02 10:33:47 +00:00
Konstantin Belousov
5dd371944e Change major()/minor() to work with 64bit dev_t.
Since traditional types for the macros values are int, remove the
cookie trick and just split the dev_t at the word boundary.

Reported by:	Victor Stinner <victor.stinner@gmail.com>
PR:	221048
Sponsored by:	The FreeBSD Foundation
2017-08-02 10:14:17 +00:00
Konstantin Belousov
6632a4330f Do not call trapsignal() after handling usermode fault or interrupt,
when a signal is not intended to be sent.

The variable holding the signal number to send is left uninitialized,
which sometimes triggers invalid signal checks.

For NMI, a return to usermode without ast processing is done.  On the
other hand, for spurious dtrace probe interrupt it is usermode which
triggered the interrupt, so handle it through userret() as any other
fault.

Reported by:	Nils Beyer <nbe@renzel.net>
PR:	221151
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-08-02 10:12:10 +00:00
Enji Cooper
67b82daf3e Fix cosmetic issue with error message
Add missing space in error message related to PR noted.

MFC after:	2 weeks
PR:		220398
2017-08-02 09:49:41 +00:00
Enji Cooper
63dc0fc9c7 Fix accidental misconversion done in r321912
SUBDIR.${MK_TESTS} should append osmtest, not tests

MFC after:	1 week
MFC with:	r321912
2017-08-02 09:00:18 +00:00
Enji Cooper
c119e4a444 Remove bogus bsd.subdir.mk .include
bsd.subdir.mk is included from bsd.obj.mk, which is included via bsd.lib.mk.

MFC after:	3 days
2017-08-02 08:54:18 +00:00
Enji Cooper
4b330699f8 Convert traditional ${MK_TESTS} conditional idiom for including test
directories to SUBDIR.${MK_TESTS} idiom

This is being done to pave the way for future work (and homogenity) in
^/projects/make-check-sandbox .

No functional change intended.

MFC after:	1 weeks
2017-08-02 08:35:51 +00:00
Don Lewis
cd155b5603 Lower the amd64 shared page, which contains the signal trampoline,
from the top of user memory to one page lower on machines with the
Ryzen (AMD Family 17h) CPU.  This pushes ps_strings and the stack
down by one page as well.  On Ryzen there is some sort of interaction
between code running at the top of user memory address space and
interrupts that can cause FreeBSD to either hang or silently reset.
This sounds similar to the problem found with DragonFly BSD that
was fixed with this commit:
  https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b48dd28447fc8ef62fbc963accd301557fd9ac20
but our signal trampoline location was already lower than the address
that DragonFly moved their signal trampoline to.  It also does not
appear to be related to SMT as described here:
  https://www.phoronix.com/forums/forum/hardware/processors-memory/955368-some-ryzen-linux-users-are-facing-issues-with-heavy-compilation-loads?p=955498#post955498

  "Hi, Matt Dillon here. Yes, I did find what I believe to be a
   hardware issue with Ryzen related to concurrent operations. In a
   nutshell, for any given hyperthread pair, if one hyperthread is
   in a cpu-bound loop of any kind (can be in user mode), and the
   other hyperthread is returning from an interrupt via IRETQ, the
   hyperthread issuing the IRETQ can stall indefinitely until the
   other hyperthread with the cpu-bound loop pauses (aka HLT until
   next interrupt). After this situation occurs, the system appears
   to destabilize. The situation does not occur if the cpu-bound
   loop is on a different core than the core doing the IRETQ. The
   %rip the IRETQ returns to (e.g. userland %rip address) matters a
   *LOT*. The problem occurs more often with high %rip addresses
   such as near the top of the user stack, which is where DragonFly's
   signal trampoline traditionally resides. So a user program taking
   a signal on one thread while another thread is cpu-bound can cause
   this behavior. Changing the location of the signal trampoline
   makes it more difficult to reproduce the problem. I have not
   been because the able to completely mitigate it. When a cpu-thread
   stalls in this manner it appears to stall INSIDE the microcode
   for IRETQ. It doesn't make it to the return pc, and the cpu thread
   cannot take any IPIs or other hardware interrupts while in this
   state."
since the system instability has been observed on FreeBSD with SMT
disabled.  Interrupts to appear to play a factor since running a
signal-intensive process on the first CPU core, which handles most
of the interrupts on my machine, is far more likely to trigger the
problem than running such a process on any other core.

Also lower sv_maxuser to prevent a malicious user from using mmap()
to load and execute code in the top page of user memory that was made
available when the shared page was moved down.

Make the same changes to the 64-bit Linux emulator.

PR:		219399
Reported by:	nbe@renzel.net
Reviewed by:	kib
Reviewed by:	dchagin (previous version)
Tested by:	nbe@renzel.net (earlier version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D11780
2017-08-02 01:43:35 +00:00
Enji Cooper
8fe10e175b Revert accidental character conversion for pfg's entry, done in r321886 2017-08-02 00:51:56 +00:00
Mark Johnston
526b5fe16c Amend r321884 to check the refcount and update the class with w_mtx held.
Reviewed by:	jhb
X-MFC with:	r321884
2017-08-01 23:14:38 +00:00
Emmanuel Vadot
fad5dbf8d5 Allwinner dtb: Add NanoPi M1 to the build
It was tested on NanoPi M1 Plus.
2017-08-01 20:28:11 +00:00
Taras Korenko
05dee37094 + Add myself to calendar.freebsd. 2017-08-01 20:16:00 +00:00
Tobias C. Berner
b7824a0870 Add joneum to the calendar.freebsd
Reported by:	mckusick
Submitted by:	joneum
2017-08-01 19:29:16 +00:00
Emmanuel Vadot
5393952249 Alwinner: nanopi-neo: Remove r_i2c node from DTS as it isn't used on the board 2017-08-01 19:22:00 +00:00
Maksim Yevmenkin
02990f3b21 fix sort order 2017-08-01 18:48:09 +00:00
Maksim Yevmenkin
41837538e6 add myself
Requested by:	mckusick
2017-08-01 18:46:24 +00:00
Emmanuel Vadot
3da70cfac3 Allwinner dtb: add link for NanoPi Neo
Reported by:	Richard Puga <richard@puga.net>
Tested by:	Richard Puga <richard@puga.net>, myself
2017-08-01 18:33:27 +00:00
Bryan Drewery
91234af7d8 CCACHE_BUILD: Follow-up r321880: Fix some PATH issues with buildworld.
- bsd.compiler.mk: Must ensure that the CCACHE_WRAPPER_PATH comes first
  in PATH.
- Makefile.inc1: Must prepend the CCACHE_WRAPPER_PATH into BPATH as it
  overrides the PATH set in bsd.compiler.mk in sub-makes.  The PATH
  set in bsd.compiler.mk is not exported and doing so would cause it to
  then override the BPATH set from environment.  The only sane solution
  is to prepend into BPATH as needed.
CCACHE_PATH could possibly be used for some of this as well.

Sponsored by:	Dell EMC Isilon
2017-08-01 18:26:20 +00:00
Kirk McKusick
550bff8dfc Add Anne Dickison.
Requested by: Anne Dickison
2017-08-01 18:25:04 +00:00
Lev A. Serebryakov
9143211387 Add myself to the calendar.freebsd
Reported by:	mckusick
2017-08-01 18:05:19 +00:00
Mark Johnston
57688b6e4e Fix a witness assertion that fires when a lock type's class changes.
When all instances of a lock type are destroyed (for example, after a
module unload), the corresponding witness entry remains associated with
that lock type. In this case, we shouldn't panic if a new instance of the
lock type is created and its lock class does not match that recorded in the
witness entry.

Reviewed by:	jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11788
2017-08-01 17:50:28 +00:00
Bryan Drewery
5aa73fa259 NO_CLEAN: No need to run delete-old if the directories don't exist.
X-MFC-With:	r321443
MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2017-08-01 16:41:17 +00:00
Sevan Janiyan
26b5613dfc For the udp-client example, instruct user to add an entry for a udp based
service.
For tcp-client & udp-client, use the same port in configuration snippet as used
in the comment prior to remove any ambiguity on the port number which needs to
be specified.

Reviewed by:	bcr (mentor) wblock (mentor)
Approved by:	gavin
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D9830
2017-08-01 16:20:33 +00:00
Bryan Drewery
e2a659ea64 CCACHE_BUILD: Allow setting CCACHE_BUILD_TYPE=wrapper.
This uses the /usr/local/libexec/ccache/<cc,c++> wrappers rather than
modifying CC to be '/usr/local/bin/ccache cc'.  Some forms of compilation
do not support the 'command' type.

Sponsored by:	Dell EMC Isilon
2017-08-01 16:15:08 +00:00
Glen Barber
6f4c1b61b2 Update doceng, re, security-officer, clusteradm, webmaster and
donations entries.

Requested by:	sevan
Sponsored by:	The FreeBSD Foundation
2017-08-01 16:05:23 +00:00
Ian Lepore
dca576be69 In xdev-links, when installing symlinks to the cross-compiler pieces that
includes the OS version (armv6-freebsd12.0-cc, etc), use the OS version of
the compiler/world source code, not the version of the build host machine.
2017-08-01 14:54:25 +00:00
Michael Zhilin
6630716fa8 [calendar.freebsd] Add myselft into freebsd.calendar 2017-08-01 11:51:35 +00:00
Andriy Gapon
5d1186a4ed zfsboottest: catch up with r316585 and provide ldi_get_size method
This method is required for querying file / disk sizes which is needed
at least for finding all copies of ZFS VDEV labels.

Reported by:	ngie
MFC after:	1 week
2017-08-01 11:09:18 +00:00
Marcin Wojtas
7579dce2c6 Merge ena-com 1.1.4.2
Update ENA HAL after fixing gcc build in r321861.

Submitted by: rlibby
Reviewed by: cognet (mentor)
Approved by: cognet (mentor)
Differential Revision: https://reviews.freebsd.org/D11480
2017-08-01 11:00:04 +00:00
Roger Pau Monné
d4ed36cde2 pci: fix write order when sizing BARs
According to the PCI Local Specification rev. 3.0 in case of a 64-bit
BAR both the low and the high parts of the register should be set to
~0 before attempting to read back the size.

So far I have found no single device that has problems with the
previous approach, but I think it's better to stay on the safe size.

This commit should not introduce any functional change.

MFC after:		3 weeks
Sponsored by:		Citrix Systems R&D
Reviewed by:		jhb
Differential revision:	https://reviews.freebsd.org/D11750
2017-08-01 10:47:44 +00:00
Marcin Wojtas
945c72c7ae Add myself to calendar
Approved by: cognet (mentor)
2017-08-01 10:11:20 +00:00
Stefan Eßer
eb69150993 Adjust path to X11 locale files (/usr/X11 has been changed to /usr/local a
long ago) in comment. No functional change.
2017-08-01 09:34:15 +00:00
Stefan Eßer
5c4a023c86 Add alternate Turkish keyboard layout F. The layout and menu texts have
been provided by Ufuk Güler, with minor changes for consistency by me.

Submitted by:	Ufuk Güler <ufukguler@yahoo.com>
MFC after:	1 week
2017-08-01 09:30:21 +00:00
Michael Tuexen
4cc853fe94 Add myself to calendar.
Reminded by:	mckusick
2017-08-01 09:26:22 +00:00
Alexander Motin
40715e9ed7 Add explicit check for PCI bus to r321720.
Reported by:	jhb
MFC after:	6 days
2017-08-01 09:22:10 +00:00
Vladimir Kondratyev
388b7f1cc5 Add myself to the calendar
Reminded by:	mckusick
Approved by:	gonzo (mentor)
2017-08-01 07:05:29 +00:00
Enji Cooper
6755788d98 Fix up r321849
pager_output should return 0 if no more output needs to be paged; non-zero
otherwise.

MFC after:	1 week
MFC with:	r321849
Reported by:	avg
2017-08-01 06:51:03 +00:00
Enji Cooper
20cce726e6 Standardize paths on SRCTOP instead of .CURDIR-relative paths
MFC after:	1 week
2017-08-01 05:39:40 +00:00
Enji Cooper
d125609b7a Makefile cleanup
- Standardize on SRCTOP instead of .CURDIR-relative paths
- Use LIBADD instead of a mix of specifying -lgeom via DPADD/LDADD/LDFLAGS.
  Specifying -lgeom via LDFLAGS is an especially unnecessary and odd
  pattern.

MFC after:	1 week
2017-08-01 05:34:04 +00:00
Enji Cooper
7e299eacab Fix the return type for pager_output(..) in bootparttest and zfsboottest
pager_output(..) has always returned int. For some reason (probably the
clang 5.0 update), this mismatch now results in an error with CC=clang.

MFC after:	1 week
2017-08-01 05:29:36 +00:00
Enji Cooper
d96899bad0 Chase r315408 with the fourth parameter being removed from disk_open(..)
This fixes one part of the build.
2017-08-01 05:26:45 +00:00
Mark Johnston
2375aaa8e9 Batch updates to v_wire_count when freeing page table pages on x86.
The removed release stores are not needed since stores are totally
ordered on i386 and amd64.

Reviewed by:	alc, kib (previous revision)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11790
2017-08-01 05:26:30 +00:00
Marcelo Araujo
4271417a84 Log when we have finished pushing users and groups.
Obtained from:	OpenBSD (rev 1.4)
MFC after:	3 weeks.
2017-08-01 05:26:20 +00:00