Commit Graph

249282 Commits

Author SHA1 Message Date
hselasky
c22224101f 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
hselasky
4e79e1a83b 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
hselasky
00a71092fb 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
hselasky
0945850a32 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
hselasky
3c7c22a9aa 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
hselasky
1a484bcfce 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
hselasky
3f07451c55 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
eadler
50932dab8f open.3: Use .Fa where appropriate
Obtained From:	DragonFlyBSD (78732326a796ca521f3c0fe33c6fc9c695742ede)
2018-03-04 18:00:32 +00:00
ian
37014d3bca 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
dim
ef58aa56fe 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
avg
34d79fcc91 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
imp
16d50b0d62 Mention that CTLFLAG_MPSAFE is only for _PROC entries. 2018-03-04 06:19:41 +00:00
nwhitehorn
47a0fb0f64 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
kevans
bd5fc9a0ca lualoader: logdef -> logodef typo 2018-03-04 03:23:19 +00:00
kevans
1729991fcc 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
imp
50c377a8e9 Add documentation for CTLFLAG_MPSAFE. 2018-03-04 03:13:13 +00:00
emaste
d8b61da16b 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
nwhitehorn
c0ba77685a 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
bdrewery
c258f254e4 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
bdrewery
fa2d9dcbe0 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
hselasky
ef1e592a79 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
e84fc5d3a2 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
97829b536a Minor (mostly) wording changes. 2018-03-03 22:10:16 +00:00
eadler
9b775b4141 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
44ecf95a8a Minor changes to wording. 2018-03-03 21:41:16 +00:00
eadler
93e0dd9ce6 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
eadler
d7c7fe26c8 sys/fuse: fix off by one error
Reported by:	Ilja Van Sprundel <ivansprundel@ioactive.com>
Reported by:	Domagoj Stolfa <domagoj.stolfa@gmail.com>
2018-03-03 20:42:39 +00:00
hselasky
75c9371458 Use mstosbt() instead of SBT_1MS in the LinuxKPI to get the last few bits
of precision.

MFC after:	1 week
Suggested by:	ian@
Sponsored by:	Mellanox Technologies
2018-03-03 19:26:40 +00:00
hselasky
74843c3f01 Implement msleep_interruptible() in the LinuxKPI. While at it use pause_sbt()
instead of pause() in the msleep() function to avoid rounding errors when
converting delay values forth and back. Add a guard for a delay value
of zero milliseconds which is undefined.

MFC after:	1 week
Requested by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
2018-03-03 18:54:16 +00:00
kevans
07eb12bbd8 Move imx6_usbphy to SUPPORTDEV, massage associated comment
No objections from:	ian
2018-03-03 18:52:19 +00:00
kevans
a280501e5d aw_syscon(4): Move to BUS_PASS_SUPPORTDEV
It would have been on an actual named pass before, but none were really
appropriate in name. Move it to the recently created SUPPORTDEV pass, which
perfectly describes it and keeps it in the right order.
2018-03-03 18:40:46 +00:00
hselasky
95ebcd3ae9 Allow pause_sbt() to catch signals during sleep by passing C_CATCH flag.
Define pause_sig() function macro helper similarly to other kernel functions
which catch signals. Update outdated function description.

Discussed with:	kib@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-03 18:36:38 +00:00
manu
3292a8abac aw_mmc: Regulator improvement
Getting regulator is good, enabling them is better.
When the mmc stack decide to change the voltage for IO, don't
change the main vcc of the sd/mmc, only the io vcc.
2018-03-03 18:30:31 +00:00
manu
91e6f0519d axp81x: Add support for AXP803
AXP803 and AXP813/818 are very similar, only two regulators differs.
AXP803 is the companion chip for A64/R18
AXP813 is the companion chip for A83T
AXP818 is the companion chip for H8 (~A83T)
Add support for all regulators found in both of them.
2018-03-03 18:28:19 +00:00
kevans
6404b9c6ae lualoader: Shift menu+brand even for logo=none with customized pos 2018-03-03 18:25:50 +00:00
kevans
d107b38924 lualoader: Tweak positioning and fix an off-by-one
- All of our default positions were offset from forth
- Our menu frame size was smaller than in forth
- Logo/brand drawing had an off-by-one, drawing one column lower on the
  screen than they should have been.
- While here, switch a print() to printc() as it's expected that logos may
  contain color and other escpae sequences that we'll need to honor.
2018-03-03 18:13:14 +00:00
hselasky
dfc94d6584 Correct the return code from pause() during cold startup from zero to
EWOULDBLOCK. This also matches the description in pause(9).

Discussed with:	kib@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-03 18:12:21 +00:00
kevans
2af7045372 lualoader: Respect loader_menu_title_align
It may be set to "left" or "right" -- any other value will cause the title
to be centered.

I've chosen to position these things just inside the vertical borders,
rather than overlapping the corners. This is an arbitrary choice and easily
amendable if this looks terrible.
2018-03-03 17:38:25 +00:00
kevans
02956fabe2 lualoader: Respect loader_menu_title, prepare for align 2018-03-03 17:25:49 +00:00
kevans
02b5cfe0d6 lualoader: Execute menu_timeout_command at the end of menu autoboot
Instead of hardcoding "boot", respect menu_timeout_command from Forth. It
still defaults to 'boot', so this will not be a functional change for most.
2018-03-03 17:18:40 +00:00
kevans
59eb711faf liblua: Add loader.interpret
This allows lua to pass back a command string to be executed as if it were
typed at the loader prompt- loader tries to execute the string first as pure
lua, then parses it and gives lua a chance to intercept before it tries to
execute it itself.

This will be used to implement menu_timeout_command, among other things,
which *should* be used to execute basic loader commands independent of the
chosen interpreter.
2018-03-03 17:13:12 +00:00
avg
785f44d456 db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common
Since that change the system call stack traces look like this:
  ...
  sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe0028e13ac0
  amd64_syscall() at amd64_syscall+0x79b/frame 0xfffffe0028e13bf0
  fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0028e13bf0
So, db_nextframe() stopped recognizing the system call frame.
This commit should fix that.

Reviewed by:	kib
MFC after:	4 days
2018-03-03 15:10:37 +00:00
andrew
f59ac355de Move setting the IRQ base and length into the common GICv3 ITS attach
function. This is common across both ACPI and FDT.

Sponsored by:	ABT Systems Ltd
Sponsored by:	Cavium (Hardware)
2018-03-03 13:20:44 +00:00
andrew
50b4748453 Add the missing GICv3 dev info struct to the ACPI dev info.Previously we
would read from the resource list when querying from this.

Sponsored by:	ABT Systems Ltd
Sponsored by:	Cavium (Hardware)
2018-03-03 13:19:08 +00:00
manu
95ded24bd6 Introduce BUS_PASS_SUPPORTDEV
The reason for this new pass is :

The earlier pass names are really specific (interrupt, timer, scheduler etc ..)
and making a driver that other device driver (that attach at DEFAULT pass)
needs probe at earlier pass can be confiusing. We can live with GPIO driver
at INTERRUPT pass because they are often an interrupt controller too but having
a usb phy driver probed at RESOURCES (or SCHEDULER for example) is silly.
The number was choosen to have a lot of margin if we want to introduce other
pass in the futur.

Reviewed by:	ian, imp, kevans
Differential Revision:	https://reviews.freebsd.org/D14568
2018-03-03 12:43:11 +00:00
gonzo
3074910c5f [fdt_pinctrl] Add man pages for fdt_pinctrl driver
- Add fdt_pinctrl(4) with general information for the driver
- Add fdt_pinctrl(9) with fdt_pinctrl KPI description

Reviewed by:	ian, manu, wblock
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D14235
2018-03-03 02:49:49 +00:00
nwhitehorn
ba40a61f8f Honor physical memory regions marked unavailable in the FDT, when present.
The most notable of these is the FDT itself, which it is a bad idea to
overwrite.
2018-03-03 02:06:48 +00:00
nwhitehorn
8b6e9e7a9e Remove assumption that all physical memory is available to the kernel and
that the physical and available memory arrays are interchangeable.
2018-03-03 02:04:40 +00:00
rpokala
03d8fd318a imcsmb(4): Intel integrated Memory Controller (iMC) SMBus controller driver
imcsmb(4) provides smbus(4) support for the SMBus controller functionality
in the integrated Memory Controllers (iMCs) embedded in Intel Sandybridge-
Xeon, Ivybridge-Xeon, Haswell-Xeon, and Broadwell-Xeon CPUs. Each CPU
implements one or more iMCs, depending on the number of cores; each iMC
implements two SMBus controllers (iMC-SMBs).

*** IMPORTANT NOTE ***
Because motherboard firmware or the BMC might try to use the iMC-SMBs for
monitoring DIMM temperatures and/or managing an NVDIMM, the driver might
need to temporarily disable those functions, or take a hardware interlock,
before using the iMC-SMBs. Details on how to do this may vary from board to
board, and the procedure may be proprietary. It is strongly suggested that
anyone wishing to use this driver contact their motherboard vendor, and
modify the driver as described in the manual page and in the driver itself.
(For what it's worth, the driver as-is has been tested on various SuperMicro
motherboards.)

Reviewed by:	avg, jhb
MFC after:	1 week
Relnotes:	yes
Sponsored by:	Panasas
Differential Revision:	https://reviews.freebsd.org/D14447
Discussed with:	avg, ian, jhb
Tested by:	allanjude (previous version), Panasas
2018-03-03 01:53:51 +00:00
brooks
ca6208b512 Fix build post r330299 2018-03-02 23:31:55 +00:00