Commit graph

225081 commits

Author SHA1 Message Date
Enji Cooper 86cc58dc96 MFhead@r321960 2017-08-02 22:28:12 +00:00
Enji Cooper 47606b869e Use MK_CHECK_USE_SANDBOX in tests/..., to deal with the fact that
tests/... is a special snowflake directory and using HAS_TESTS would
result in a nasty layering violation between bsd.tests.mk and
bsd.prog.mk.

Add reachover Makefile.inc's which get the default value from
Makefile.inc0 (inspired by gnu/usr.bin/binutils/Makefile.inc0).
2017-08-02 22:24:08 +00:00
Enji Cooper 3cf56bb43a Annotate tests that require root privileges appropriately
This unbreaks running the tests with unprivileged users.

MFC after:	1 week
2017-08-02 22:19:45 +00:00
Enji Cooper eb51cdee61 Extend r321900 (_FILESMKDIR) support to ${PROG} 2017-08-02 22:08:49 +00:00
Enji Cooper 927b89d07b Fix typo with missing line continuation added in r321956 2017-08-02 22:02:33 +00:00
Enji Cooper 2b2566c4c4 Expose _TESTS_USE_OBJDIR as MK_MAKE_CHECK_USE_SANDBOX and anchor the default
value on MK_TESTS.

Use bsd.opts.mk in suite.test.mk to toggle the behavior.
2017-08-02 22:01:06 +00:00
Enji Cooper a1c2413d52 Promote MK_TESTS from src.opts.mk to bsd.opts.mk
This knob is needed here to avoid polluting suite.tests.mk with src.opts.mk for
a knob that will be introduced in the following commit.
2017-08-02 21:52:59 +00:00
Enji Cooper ba25b1ca42 Delete comment above "__DEFAULT_DEPENDENT_OPTIONS" related to "meta mode options"
src.conf(5) should document which knobs are which and the dependency between each;
remove the comment so the variable can apply to non-"meta mode options".

MFC after:	2 weeks
2017-08-02 21:49:37 +00:00
Enji Cooper 57a87b0695 Regenerate src.conf(5) per change made in r321952 2017-08-02 21:40:51 +00:00
Enji Cooper edb58145c8 Allowing MK_NLS_CATALOGS to be enabled if MK_NLS == no doesn't make a whole lot
of sense. Anchor MK_NLS_CATALOGS being enabled off of MK_NLS.

MFC after:	1 month
2017-08-02 21:38:15 +00:00
Enji Cooper f117e4e1df Some minor doc fixups
- Tweak a sentence by placing the modifier before an adjective to make it flow
  better.
- Fix a typo.

MFC after:	3 days
2017-08-02 21:31:46 +00:00
Enji Cooper 3e46b70f38 Always use first parameter passed to get_filesystem(..) instead of discarding it
and using `.` instead.

MFC after:	1 week
MFC with:	r321949
PR:	221189 [1], 221188 [2]
2017-08-02 21:20:49 +00:00
Enji Cooper 2d3e9c25f1 Add expected failures for ZFS
- :f_flag fails on ZFS because UF_IMMUTABLE isn't supported [1].
- :v_flag fails on ZFS because the mode for foo is [always] updated
  unnecessarily.

get_filesystem(..) (supporting function that was added to the test script)
is based on equivalent logic in usr.bin/extattr/tests/extattr_test.sh .

MFC after:	1 week
PR:	221189 [1], 221188 [2]
2017-08-02 21:18:54 +00:00
Marius Strobl cd85acba1a - Correct the remainder of confusing and error prone mix-ups between
"br" or "bridge" where - according to the terminology outlined in
  comments of bridge.h and mmcbr_if.m  around since their addition in
  r163516 - the bus is meant and used instead. Some of these instances
  are also rather old, while those in e. g. mmc_subr.c are as new as
  r315430 and were caused by choosing mmc_wait_for_request(), i. e. the
  one pre-r315430 outliner existing in mmc.c, as template for function
  parameters in mmc_subr.c inadvertently. This correction translates to
  renaming "brdev" to "busdev" and "mmcbr" to "mmcbus" respectively as
  appropriate.
  While at it, also rename "reqdev" to just "dev" in mmc_subr.[c,h]
  for consistency with was already used in mmm.c pre-r315430, again
  modulo mmc_wait_for_request() that is.
- Remove comment lines from bridge.h incorrectly suggesting that there
  would be a MMC bridge base class driver.
- Update comments in bridge.h regarding the star topology of SD and SDIO;
  since version 3.00 of the SDHCI specification, for eSD and eSDIO bus
  topologies are actually possible in form of so called "shared buses"
  (in some subcontext later on renamed to "embedded" buses).
2017-08-02 21:11:51 +00:00
Enji Cooper d2435d7c28 Require strings(1) with :o_flag_preparer and :o_flag_publisher
strings(1) might not be installed on the system, e.g., if MK_TOOLCHAIN == no

MFC after:	1 week
2017-08-02 20:42:39 +00:00
Enji Cooper fa895917d3 Only tweak DESTDIR, etc if actively invoking "make check"
This fixes "make installworld"/"make install" (standard use).
2017-08-02 20:23:25 +00:00
Emmanuel Vadot 48ee531892 arm64: Add Allwinner H5 SoC
Allwinner H5 is an H3 (arm32) with Cortex A53 cores.
Add support for it and enable it in GENERIC kernel config

Tested on: OrangePi PC2
2017-08-02 20:19:19 +00:00
Emmanuel Vadot 904581f050 allwiner: modclk: Do not try to enable parent clock if it doesn't exist 2017-08-02 20:17:04 +00:00
Ryan Stone 4d00943ae4 Add my birthdate to the calendar
Requested by:	mckusick
2017-08-02 19:45:09 +00:00
Ian Lepore 28926d45c9 Fix the interface to imx_iomux_gpr_get/set(). The functions were defined
as taking a register number, and that would get multiplied by 4 to make
a register address.  But the header file that consumers have to reference
this stuff publishes register addresses, not numbers.  So now everything
works in terms of register addresses.

Note that the HDMI init code was writing into the wrong register before
this change.  Apparently whatever it wrote to was harmless, and apparently
HDMI was working because uboot had set up the right bits.
2017-08-02 18:28:06 +00:00
Ian Lepore c396301df0 Add missing ofw_bus_if.h src file. 2017-08-02 15:16:40 +00:00
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 3a8b7649ce MFhead@r321916 2017-08-02 09:00:59 +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 d511b20a69 Add HAS_TESTS to all Makefiles that are currently using the
`SUBDIR.${MK_TESTS}+= tests` idiom.

This is a follow up to r321912.
2017-08-02 08:50:42 +00:00
Enji Cooper 46b37aa2c4 MFhead@r321912 2017-08-02 08:38:36 +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
Enji Cooper 8c09935728 Add HAS_TESTS to all Makefiles that use the SUBDIR.${MK_TESTS}+= tests idiom 2017-08-02 08:14:06 +00:00
Enji Cooper 5e291c3faf Hook HAS_TESTS (r321901) in to bsd.lib.mk and bsd.prog.mk
Apply the required sugar to make "make check" just work (tm) when
invoked from a subdirectory where HAS_TESTS is defined in the
relevant Makefile.

Adjust $LD_LIBRARY_PATH and $PATH appropriately from bsd.lib.mk
and bsd.prog.mk to make the "user experience" more out of the
box/seamless.
2017-08-02 03:18:24 +00:00
Enji Cooper fee25c6847 Clean up DESTDIR, not CHECKDIR
While here, make the variable immediate to avoid silly mistakes that might
result in wiping out / by accident if the variable is evaluated in a delayed
manner due to poor use of $DESTDIR.
2017-08-02 03:09:55 +00:00
Enji Cooper 63c10f414b Make "make check" smarter when run from a root directory
If the user decides to specify HAS_TESTS in the upper directory, "make check"
will now iterate down the "test" directory, running the tests with an assumably
sane default value for $LD_LIBRARY_PATH, $PATH, etc.

The purpose of this work is to simplify "make check" -- in particular, to
increase dev-test velocity and get me (and others who pay attention, like
me) out of the business of paying attention to Jenkins runs and get other
developers to (hopefully) test their code more often prior to commit.

Huge caveat:

Obviously, this will fail miserably when the host can't run the target
architecture/code. Necessary compat layer or qemu usermode will be required
to make this possible, which is outside the scope of this work (batteries
not included).
2017-08-02 03:06:08 +00:00
Enji Cooper ea75327a3c Add _FILESMKDIR
_FILESMKDIR is an internal knob for creating directories

It's by no means a substitute for mtrees since the semantics for using install
are a bit rudimentary -- it's meant purely to simplify automatic directory creation
without having to invoke "make hier[archy]" from ${SRCTOP} in order to populate
a directory tree.
2017-08-02 02:56:48 +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 bfc7f8f114 MFhead@r321897 2017-08-02 01:23:17 +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