Commit Graph

230876 Commits

Author SHA1 Message Date
Ian Lepore
89ba361fcc The year is stored in a single byte in sram, in binary format, as a count
of years since the century, so strip the century out when converting to or
from bcd_clocktime format (the conversion routines will infer century by
pivoting on 70).
2018-03-04 21:58:32 +00:00
Mateusz Guzik
a8e747c5e7 sx: don't do an atomic op in upgrade if it cananot succeed
The code already pays the cost of reading the lock to obtain the waiters
flag. Checking whether there is more than one reader is not a problem and
avoids dirtying the line.

This also fixes a small corner case: if waiters were to show up between
reading the flag and upgrading the lock, the operation would fail even
though it should not. No correctness change here though.
2018-03-04 21:41:05 +00:00
Mateusz Guzik
d94df98c5c locks: fix a corner case in r327399
If there were exactly rowner_retries/asx_retries (by default: 10) transitions
between read and write state and the waiters still did not get the lock, the
next owner -> reader transition would result in the code correctly falling
back to turnstile/sleepq where it would incorrectly think it was waiting
for a writer and decide to leave turnstile/sleepq to loop back. From this
point it would take ts/sq trips until the lock gets released.

The bug sometimes manifested itself in stalls during -j 128 package builds.

Refactor the code to fix the bug, while here remove some of the gratituous
differences between rw and sx locks.
2018-03-04 21:38:30 +00:00
Konstantin Belousov
2a8e8f7892 Remove redundant test from r330410.
If the input slist is non-empty, counter cannot be zero after freeing.

Noted by:	mjg
MFC after:	2 weeks
2018-03-04 21:15:31 +00:00
Ian Lepore
5a45ce2f62 Build iicbus/rtc8583 as a module. 2018-03-04 21:06:21 +00:00
Ian Lepore
5deff57b6f Convert to the new(ish) bcd_clocktime conversion functions, add calls to
the new debug output functions, and when setting the clock, propagate the
timespec nsecs to the 1/100ths register.
2018-03-04 21:04:30 +00:00
Konstantin Belousov
8c8ee2ee1c Unify bulk free operations in several pmaps.
Submitted by:	Yoshihiro Ota
Reviewed by:	markj
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D13485
2018-03-04 20:53:20 +00:00
Brooks Davis
b85a98949f Refer to SysV IPC permissions as numeric constants.
POSIX defines no macros for these permissions.

Also remove unneeded headers from synopsis.

PR:		225905
Reviewed by:	wblock
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D14461
2018-03-04 20:06:02 +00:00
Hans Petter Selasky
e9e4ec118f Properly wrap the BUILD_BUG() function macro in the LinuxKPI.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-04 19:42:50 +00:00
Ian Lepore
02641ce942 Add calls to the new clock_dbgprint_xxx() functions. Also, stop applying
a local .5 second adjustment to the time, since that is now done by the
code in subr_rtc.c.
2018-03-04 19:32:52 +00:00
Ian Lepore
fa9d44f62e Add calls to the new clock_dbgprint_xxx() functions. 2018-03-04 19:26:47 +00:00
Ian Lepore
4fa48f9c58 Oops, fix a paste-o. 2018-03-04 19:25:54 +00:00
Ian Lepore
1844448d8c Add calls to the new clock_dbgprint_xxx() functions. 2018-03-04 19:23:48 +00:00
Ian Lepore
c10acec536 Add calls to the new clock_dbgprint_xxx() functions. 2018-03-04 19:20:11 +00:00
Mateusz Guzik
1c6987ebc5 lockmgr: start decomposing the main routine
The main routine takes 8 args, 3 of which are almost the same for most uses.
This in particular pushes it above the limit of 6 arguments passable through
registers on amd64 making it impossible to tail call.

This is a prerequisite for further cleanups.

Tested by:	pho
2018-03-04 19:12:54 +00:00
Hans Petter Selasky
20789a72e0 Stub kernel_param_lock() and kernel_param_unlock() in the LinuxKPI.
MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
Sponsored by:	Limelight Networks
2018-03-04 19:10:30 +00:00
Hans Petter Selasky
c3bfe0de4c Implement wait_event_lock_irq() macro function in the LinuxKPI.
MFC after:	1 week
Requested by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
2018-03-04 19:07:10 +00:00
Ian Lepore
683195e410 Fix a paste-o: use the IICBUS version constants, not IICBB bitbang driver's. 2018-03-04 18:58:24 +00:00
Hans Petter Selasky
ce930365d1 Keep the old SLAB_DESTROY_BY_RCU macro definition around in the LinuxKPI
to avoid compilation breakage in external kernel modules.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-04 18:53:41 +00:00
Hans Petter Selasky
8f368d485d Implement DEFINE_WAIT_FUNC() function macro and default_wake_function()
in the LinuxKPI.

MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
Sponsored by:	Limelight Networks
2018-03-04 18:51:43 +00:00
Hans Petter Selasky
ab7da72090 Implement pr_err_ratelimited() function macro in the LinuxKPI.
MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
Sponsored by:	Limelight Networks
2018-03-04 18:27:50 +00:00
Hans Petter Selasky
8961c48323 Implement __MODULE_STRING() function macro in the LinuxKPI.
MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
Sponsored by:	Limelight Networks
2018-03-04 18:21:21 +00:00
Hans Petter Selasky
20c8d8270c Implement BUILD_BUG() function macro in the LinuxKPI.
MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
Sponsored by:	Limelight Networks
2018-03-04 18:19:44 +00:00
Hans Petter Selasky
6c51dfb060 Implement writel_relaxed() in the LinuxKPI.
MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
Sponsored by:	Limelight Networks
2018-03-04 18:17:54 +00:00
Hans Petter Selasky
dc354b1551 Define noinline and __maybe_unused macros in the LinuxKPI.
MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
Sponsored by:	Limelight Networks
2018-03-04 18:13:31 +00:00
Hans Petter Selasky
9bce524efa Implement for_each_clear_bit() function macro in the LinuxKPI.
MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
Sponsored by:	Limelight Networks
2018-03-04 18:10:18 +00:00
Hans Petter Selasky
5d503e30ad Implement GENMASK_ULL() function macro in the LinuxKPI.
MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
Sponsored by:	Limelight Networks
2018-03-04 18:08:21 +00:00
Hans Petter Selasky
782a90d16a Rename the SLAB_DESTROY_BY_RCU flag into SLAB_TYPESAFE_BY_RCU in the LinuxKPI
to be compatible with Linux.

MFC after:	1 week
Requested by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
2018-03-04 18:04:37 +00:00
Eitan Adler
7f0f2cbbdf open.3: Use .Fa where appropriate
Obtained From:	DragonFlyBSD (78732326a796ca521f3c0fe33c6fc9c695742ede)
2018-03-04 18:00:32 +00:00
Ian Lepore
5c16a31f9d Flag the first interface on a KTLINK FTDI-based jtag+uart device as being
the jtag port, so that a tty is not created for it.

This is based on information in the PR and from the vendor website.  When
the PR was first opened we had no facility for flagging the jtag ports.  I
stumbled across the still-open PR with the idea of closing it, and noticed
that this wee update was needed.

PR:		175893
2018-03-04 17:30:16 +00:00
Dimitry Andric
c5a4cd4f85 Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
6.0.0 release (upstream r326565).

Release notes for llvm, clang and lld will be available here soon:
<http://releases.llvm.org/6.0.0/docs/ReleaseNotes.html>
<http://releases.llvm.org/6.0.0/tools/clang/docs/ReleaseNotes.html>
<http://releases.llvm.org/6.0.0/tools/lld/docs/ReleaseNotes.html>

Relnotes:	yes
MFC after:	3 months
X-MFC-With:	r327952
PR:		224669
2018-03-04 17:06:37 +00:00
Dimitry Andric
f0d24653c1 Vendor import of lld 6.0.0 release r326565:
https://llvm.org/svn/llvm-project/lld/tags/RELEASE_600/final@326565
2018-03-04 15:07:16 +00:00
Dimitry Andric
5c8694c6ce Vendor import of clang 6.0.0 release r326565:
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_600/final@326565
2018-03-04 15:06:36 +00:00
Dimitry Andric
2ed8710148 Vendor import of llvm 6.0.0 release r326565:
https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_600/final@326565
2018-03-04 15:03:44 +00:00
Andriy Gapon
3761bead4a db_script_exec: use a saved script name when reporting commands executed
Before executing a command in a ddb script ddb prints an information
line of the form:
  db:1:my-script> command
where 1 is the script's depth level, "my-script" is the scipt's name,
and "command" is the current command in the script.
db_script_exec() uses its 'scriptname' parameter to produce that string.
In the case when db_script_exec() is called from db_run_cmd() the
argument points to db_tok_string that is a global variable used for
command parsing.  So, its value changes with every command executed.

This commit changes the code to use the script's name stored in
ds_scriptname to print the line.

MFC after:	2 weeks
2018-03-04 13:27:21 +00:00
Warner Losh
d132d4ca60 Mention that CTLFLAG_MPSAFE is only for _PROC entries. 2018-03-04 06:19:41 +00:00
Nathan Whitehorn
18a119d74c Where we can, pass the kernel an FDT facsimile of the OF device tree rather
than a pointer to Open Firmware by default. This eliminates a number of
potentially unsafe calls to firmware from the kernel and provides better
performance.

This feature is meant to be expanded until it is on by default
unconditionally and, ideally, we can then garbage-collect the
nightmare pile of hacks required to call into Open Firmware from a live
kernel.

Reviewed by:	jhibbits
2018-03-04 04:49:09 +00:00
Kyle Evans
2ed9eb5dae lualoader: logdef -> logodef typo 2018-03-04 03:23:19 +00:00
Kyle Evans
c6d9f133b3 lualoader: Return meaningful value in cli_execute
loader.command(...) will return whatever the executed function returns, so
follow suit and return whatever loader.command() returned or whatever the
Lua function returns.
2018-03-04 03:21:12 +00:00
Warner Losh
982a973ebe Add documentation for CTLFLAG_MPSAFE. 2018-03-04 03:13:13 +00:00
Ed Maste
337981bd89 When lld is ld, install bfd's man page as ld.bfd.1
When WITH_LLD_IS_LD is set, lld's man page is installed as ld.1.gz, as
was GNU BFD's man page prior to this change.

Reported by:	Tobias Kortkamp
Sponsored by:	The FreeBSD Foundation
2018-03-04 01:37:49 +00:00
Nathan Whitehorn
e05bc4f98f Move "common" Open Firmware parts of the loader used only on PowerPC to
the powerpc/ subdirectory. These have never used by SPARC and we have
no other (and almost certainly will have no other) Open Firmware platforms.
This makes the directory structure simpler and lets us avoid some
cargo-cult MI patterns on code that is, and always was,
architecture-specific.
2018-03-03 23:39:07 +00:00
Bryan Drewery
9d5beec1b9 Don't read SRC_ENV_CONF for MAKEOBJDIRPREFIX guard.
This is mostly to allow using MAKEOBJDIRPREFIX in src-env.conf on stable where
src.sys.obj.mk is not going to be MFC'd.  It is still valid on head but
effectively a NOP due to MAKEOBJDIRPREFIX being handled differently in
src.sys.obj.mk.

Reported by:	eadler
MFC after:	1 week
Sponsored by:	Dell EMC
2018-03-03 23:23:23 +00:00
Bryan Drewery
743ab0187f Ignore MAKEOBJDIRPREFIX from src-env.conf in sub-makes.
A sub-make, such as in 'make buildworld', may want to override MAKEOBJDIRPREFIX
but is unable to do so if src-env.conf is forcing it to another value.  Without
using '?=' the sub-make may use the wrong .OBJDIR.

Reported by:	eadler
Sponsored by:	Dell EMC
2018-03-03 23:23:01 +00:00
Hans Petter Selasky
f0fb0d583a Document pause_sig(9) and update prototypes for existing pause(9) and
pause_sbt(9) functions.

MFC after:	1 week
Suggested by:	cem@
Sponsored by:	Mellanox Technologies
2018-03-03 23:08:49 +00:00
Ian Lepore
b43a040144 Correct a misplaced closing paren. Does not affect the result, but does
clarify (at least for me) that the multiplication happens before the shift.
2018-03-03 22:28:20 +00:00
Ian Lepore
1fe76c85dd Minor (mostly) wording changes. 2018-03-03 22:10:16 +00:00
Eitan Adler
026227b6ae sys/linux: Fix a few potential infoleaks in cloudabi
Submitted by:	Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC After:	1 month
Sponsored by:	DARPA/AFRL
2018-03-03 21:50:55 +00:00
Ian Lepore
19758005ab Minor changes to wording. 2018-03-03 21:41:16 +00:00
Eitan Adler
6eee883a17 sys/linux: Fix a few potential infoleaks in Linux IPC
Submitted by:	Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC After:	1 month
2018-03-03 21:14:55 +00:00