]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoBuild iicbus/rtc8583 as a module.
ian [Sun, 4 Mar 2018 21:06:21 +0000 (21:06 +0000)]
Build iicbus/rtc8583 as a module.

6 years agoConvert to the new(ish) bcd_clocktime conversion functions, add calls to
ian [Sun, 4 Mar 2018 21:04:30 +0000 (21:04 +0000)]
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.

6 years agoUnify bulk free operations in several pmaps.
kib [Sun, 4 Mar 2018 20:53:20 +0000 (20:53 +0000)]
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

6 years agoRefer to SysV IPC permissions as numeric constants.
brooks [Sun, 4 Mar 2018 20:06:02 +0000 (20:06 +0000)]
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

6 years agoProperly wrap the BUILD_BUG() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 19:42:50 +0000 (19:42 +0000)]
Properly wrap the BUILD_BUG() function macro in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd calls to the new clock_dbgprint_xxx() functions. Also, stop applying
ian [Sun, 4 Mar 2018 19:32:52 +0000 (19:32 +0000)]
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.

6 years agoAdd calls to the new clock_dbgprint_xxx() functions.
ian [Sun, 4 Mar 2018 19:26:47 +0000 (19:26 +0000)]
Add calls to the new clock_dbgprint_xxx() functions.

6 years agoOops, fix a paste-o.
ian [Sun, 4 Mar 2018 19:25:54 +0000 (19:25 +0000)]
Oops, fix a paste-o.

6 years agoAdd calls to the new clock_dbgprint_xxx() functions.
ian [Sun, 4 Mar 2018 19:23:48 +0000 (19:23 +0000)]
Add calls to the new clock_dbgprint_xxx() functions.

6 years agoAdd calls to the new clock_dbgprint_xxx() functions.
ian [Sun, 4 Mar 2018 19:20:11 +0000 (19:20 +0000)]
Add calls to the new clock_dbgprint_xxx() functions.

6 years agolockmgr: start decomposing the main routine
mjg [Sun, 4 Mar 2018 19:12:54 +0000 (19:12 +0000)]
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

6 years agoStub kernel_param_lock() and kernel_param_unlock() in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 19:10:30 +0000 (19:10 +0000)]
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

6 years agoImplement wait_event_lock_irq() macro function in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 19:07:10 +0000 (19:07 +0000)]
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

6 years agoFix a paste-o: use the IICBUS version constants, not IICBB bitbang driver's.
ian [Sun, 4 Mar 2018 18:58:24 +0000 (18:58 +0000)]
Fix a paste-o: use the IICBUS version constants, not IICBB bitbang driver's.

6 years agoKeep the old SLAB_DESTROY_BY_RCU macro definition around in the LinuxKPI
hselasky [Sun, 4 Mar 2018 18:53:41 +0000 (18:53 +0000)]
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

6 years agoImplement DEFINE_WAIT_FUNC() function macro and default_wake_function()
hselasky [Sun, 4 Mar 2018 18:51:43 +0000 (18:51 +0000)]
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

6 years agoImplement pr_err_ratelimited() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:27:50 +0000 (18:27 +0000)]
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

6 years agoImplement __MODULE_STRING() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:21:21 +0000 (18:21 +0000)]
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

6 years agoImplement BUILD_BUG() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:19:44 +0000 (18:19 +0000)]
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

6 years agoImplement writel_relaxed() in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:17:54 +0000 (18:17 +0000)]
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

6 years agoDefine noinline and __maybe_unused macros in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:13:31 +0000 (18:13 +0000)]
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

6 years agoImplement for_each_clear_bit() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:10:18 +0000 (18:10 +0000)]
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

6 years agoImplement GENMASK_ULL() function macro in the LinuxKPI.
hselasky [Sun, 4 Mar 2018 18:08:21 +0000 (18:08 +0000)]
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

6 years agoRename the SLAB_DESTROY_BY_RCU flag into SLAB_TYPESAFE_BY_RCU in the LinuxKPI
hselasky [Sun, 4 Mar 2018 18:04:37 +0000 (18:04 +0000)]
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

6 years agoopen.3: Use .Fa where appropriate
eadler [Sun, 4 Mar 2018 18:00:32 +0000 (18:00 +0000)]
open.3: Use .Fa where appropriate

Obtained From: DragonFlyBSD (78732326a796ca521f3c0fe33c6fc9c695742ede)

6 years agoFlag the first interface on a KTLINK FTDI-based jtag+uart device as being
ian [Sun, 4 Mar 2018 17:30:16 +0000 (17:30 +0000)]
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

6 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
dim [Sun, 4 Mar 2018 17:06:37 +0000 (17:06 +0000)]
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

6 years agodb_script_exec: use a saved script name when reporting commands executed
avg [Sun, 4 Mar 2018 13:27:21 +0000 (13:27 +0000)]
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

6 years agoMention that CTLFLAG_MPSAFE is only for _PROC entries.
imp [Sun, 4 Mar 2018 06:19:41 +0000 (06:19 +0000)]
Mention that CTLFLAG_MPSAFE is only for _PROC entries.

6 years agoWhere we can, pass the kernel an FDT facsimile of the OF device tree rather
nwhitehorn [Sun, 4 Mar 2018 04:49:09 +0000 (04:49 +0000)]
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

6 years agolualoader: logdef -> logodef typo
kevans [Sun, 4 Mar 2018 03:23:19 +0000 (03:23 +0000)]
lualoader: logdef -> logodef typo

6 years agolualoader: Return meaningful value in cli_execute
kevans [Sun, 4 Mar 2018 03:21:12 +0000 (03:21 +0000)]
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.

6 years agoAdd documentation for CTLFLAG_MPSAFE.
imp [Sun, 4 Mar 2018 03:13:13 +0000 (03:13 +0000)]
Add documentation for CTLFLAG_MPSAFE.

6 years agoWhen lld is ld, install bfd's man page as ld.bfd.1
emaste [Sun, 4 Mar 2018 01:37:49 +0000 (01:37 +0000)]
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

6 years agoMove "common" Open Firmware parts of the loader used only on PowerPC to
nwhitehorn [Sat, 3 Mar 2018 23:39:07 +0000 (23:39 +0000)]
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.

6 years agoDon't read SRC_ENV_CONF for MAKEOBJDIRPREFIX guard.
bdrewery [Sat, 3 Mar 2018 23:23:23 +0000 (23:23 +0000)]
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

6 years agoIgnore MAKEOBJDIRPREFIX from src-env.conf in sub-makes.
bdrewery [Sat, 3 Mar 2018 23:23:01 +0000 (23:23 +0000)]
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

6 years agoDocument pause_sig(9) and update prototypes for existing pause(9) and
hselasky [Sat, 3 Mar 2018 23:08:49 +0000 (23:08 +0000)]
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

6 years agoCorrect a misplaced closing paren. Does not affect the result, but does
ian [Sat, 3 Mar 2018 22:28:20 +0000 (22:28 +0000)]
Correct a misplaced closing paren.  Does not affect the result, but does
clarify (at least for me) that the multiplication happens before the shift.

6 years agoMinor (mostly) wording changes.
ian [Sat, 3 Mar 2018 22:10:16 +0000 (22:10 +0000)]
Minor (mostly) wording changes.

6 years agosys/linux: Fix a few potential infoleaks in cloudabi
eadler [Sat, 3 Mar 2018 21:50:55 +0000 (21:50 +0000)]
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

6 years agoMinor changes to wording.
ian [Sat, 3 Mar 2018 21:41:16 +0000 (21:41 +0000)]
Minor changes to wording.

6 years agosys/linux: Fix a few potential infoleaks in Linux IPC
eadler [Sat, 3 Mar 2018 21:14:55 +0000 (21:14 +0000)]
sys/linux: Fix a few potential infoleaks in Linux IPC

Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC After: 1 month

6 years agosys/fuse: fix off by one error
eadler [Sat, 3 Mar 2018 20:42:39 +0000 (20:42 +0000)]
sys/fuse: fix off by one error

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reported by: Domagoj Stolfa <domagoj.stolfa@gmail.com>

6 years agoUse mstosbt() instead of SBT_1MS in the LinuxKPI to get the last few bits
hselasky [Sat, 3 Mar 2018 19:26:40 +0000 (19:26 +0000)]
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

6 years agoImplement msleep_interruptible() in the LinuxKPI. While at it use pause_sbt()
hselasky [Sat, 3 Mar 2018 18:54:16 +0000 (18:54 +0000)]
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

6 years agoMove imx6_usbphy to SUPPORTDEV, massage associated comment
kevans [Sat, 3 Mar 2018 18:52:19 +0000 (18:52 +0000)]
Move imx6_usbphy to SUPPORTDEV, massage associated comment

No objections from: ian

6 years agoaw_syscon(4): Move to BUS_PASS_SUPPORTDEV
kevans [Sat, 3 Mar 2018 18:40:46 +0000 (18:40 +0000)]
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.

6 years agoAllow pause_sbt() to catch signals during sleep by passing C_CATCH flag.
hselasky [Sat, 3 Mar 2018 18:36:38 +0000 (18:36 +0000)]
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

6 years agoaw_mmc: Regulator improvement
manu [Sat, 3 Mar 2018 18:30:31 +0000 (18:30 +0000)]
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.

6 years agoaxp81x: Add support for AXP803
manu [Sat, 3 Mar 2018 18:28:19 +0000 (18:28 +0000)]
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.

6 years agolualoader: Shift menu+brand even for logo=none with customized pos
kevans [Sat, 3 Mar 2018 18:25:50 +0000 (18:25 +0000)]
lualoader: Shift menu+brand even for logo=none with customized pos

6 years agolualoader: Tweak positioning and fix an off-by-one
kevans [Sat, 3 Mar 2018 18:13:14 +0000 (18:13 +0000)]
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.

6 years agoCorrect the return code from pause() during cold startup from zero to
hselasky [Sat, 3 Mar 2018 18:12:21 +0000 (18:12 +0000)]
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

6 years agolualoader: Respect loader_menu_title_align
kevans [Sat, 3 Mar 2018 17:38:25 +0000 (17:38 +0000)]
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.

6 years agolualoader: Respect loader_menu_title, prepare for align
kevans [Sat, 3 Mar 2018 17:25:49 +0000 (17:25 +0000)]
lualoader: Respect loader_menu_title, prepare for align

6 years agolualoader: Execute menu_timeout_command at the end of menu autoboot
kevans [Sat, 3 Mar 2018 17:18:40 +0000 (17:18 +0000)]
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.

6 years agoliblua: Add loader.interpret
kevans [Sat, 3 Mar 2018 17:13:12 +0000 (17:13 +0000)]
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.

6 years agodb_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common
avg [Sat, 3 Mar 2018 15:10:37 +0000 (15:10 +0000)]
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

6 years agoMove setting the IRQ base and length into the common GICv3 ITS attach
andrew [Sat, 3 Mar 2018 13:20:44 +0000 (13:20 +0000)]
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)

6 years agoAdd the missing GICv3 dev info struct to the ACPI dev info.Previously we
andrew [Sat, 3 Mar 2018 13:19:08 +0000 (13:19 +0000)]
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)

6 years agoIntroduce BUS_PASS_SUPPORTDEV
manu [Sat, 3 Mar 2018 12:43:11 +0000 (12:43 +0000)]
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

6 years ago[fdt_pinctrl] Add man pages for fdt_pinctrl driver
gonzo [Sat, 3 Mar 2018 02:49:49 +0000 (02:49 +0000)]
[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

6 years agoHonor physical memory regions marked unavailable in the FDT, when present.
nwhitehorn [Sat, 3 Mar 2018 02:06:48 +0000 (02:06 +0000)]
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.

6 years agoRemove assumption that all physical memory is available to the kernel and
nwhitehorn [Sat, 3 Mar 2018 02:04:40 +0000 (02:04 +0000)]
Remove assumption that all physical memory is available to the kernel and
that the physical and available memory arrays are interchangeable.

6 years agoimcsmb(4): Intel integrated Memory Controller (iMC) SMBus controller driver
rpokala [Sat, 3 Mar 2018 01:53:51 +0000 (01:53 +0000)]
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

6 years agoFix build post r330299
brooks [Fri, 2 Mar 2018 23:31:55 +0000 (23:31 +0000)]
Fix build post r330299

6 years agoDon't declare union semun in userspace unless _WANT_SEMUN is defined.
brooks [Fri, 2 Mar 2018 22:32:53 +0000 (22:32 +0000)]
Don't declare union semun in userspace unless _WANT_SEMUN is defined.

POSIX explicitly states that the application must declare union semun.
This makes no sense, but it is what it is.  This brings us into line
with Linux, MacOS/Darwin, and NetBSD.

In a ports exp-run a moderate number of ports fail due to a lack of
approprate autotools-like discovery mechanisms or local patches.  A
commit to address them will follow shortly.

PR: 224300, 224443 (exp-run)
Reviewed by: emaste, jhb, kib
Exp-run by: antoine
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14492

6 years agoDon't define struct mymsg.
brooks [Fri, 2 Mar 2018 22:13:29 +0000 (22:13 +0000)]
Don't define struct mymsg.

PR: 224299, 224443 (exp-run)
Reviewed by: kib, jhb
Exp-run by: antoine
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14491

6 years agoRename kernel-only members of semid_ds and msgid_ds.
brooks [Fri, 2 Mar 2018 22:10:48 +0000 (22:10 +0000)]
Rename kernel-only members of semid_ds and msgid_ds.

This deliberately breaks the API in preperation for future syscall
revisions which will remove these nonstandard members.

In an exp-run a single port (devel/qemu-user-static) was found to
use them which it did becuase it emulates system calls.  This has
been fixed in the ports tree.

PR: 224443 (exp-run)
Reviewed by: kib, jhb (previous version)
Exp-run by: antoine
Sponsored by: DARPA, AFRP
Differential Revision: https://reviews.freebsd.org/D14490

6 years agoZFS: fix adding vdevs to very large pools
asomers [Fri, 2 Mar 2018 21:26:48 +0000 (21:26 +0000)]
ZFS: fix adding vdevs to very large pools

r323791 changed the return value of zpool_read_label.  Error paths that
previously returned 0 began to return -1 instead.  However, not all error
paths initialized errno.  When adding vdevs to a very large pool, errno could
be prepopulated with ENOMEM, causing the operation to fail.  Fix the bug by
setting errno=ENOENT in the case that no ZFS label is found.

PR: 226096
Submitted by: Nikita Kozlov
Reviewed by: avg
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D13088

6 years agosx: fix adaptive spinning broken in r327397
mjg [Fri, 2 Mar 2018 21:26:27 +0000 (21:26 +0000)]
sx: fix adaptive spinning broken in r327397

The condition was flipped.

In particular heavy multithreaded kernel builds on zfs started suffering
due to nested sx locks.

For instance make -s -j 128 buildkernel:

before: 3326.67s user 1269.62s system 6981% cpu 1:05.84 total
after: 3365.55s user 911.27s system 6871% cpu 1:02.24 total

ps.
      .-'---`-.       .-'---`-.
    ,'          `.     ,'          `.
    |             \     |             \
    |              \     |              \
    \           _  \     \           _  \
    ,\  _    ,'-,/-)\     ,\  _    ,'-,/-)\
    ( * \ \,' ,' ,'-)     ( * \ \,' ,' ,'-)
     `._,)     -',-')      `._,)     -',-')
       \/         ''/        \/         ''/
        )        / /         )        / /
       /       ,'-'        /       ,'-'

6 years agodtb/allwinner: Build sun8i-h3-nanopi-m1-plus.dts
manu [Fri, 2 Mar 2018 20:59:36 +0000 (20:59 +0000)]
dtb/allwinner: Build sun8i-h3-nanopi-m1-plus.dts

We have a u-boot port for this board so add the dtb to the build.

6 years agoUpdate QLogic ISP 24xx/25xx chips firmware to 8.07.00.
mav [Fri, 2 Mar 2018 19:50:41 +0000 (19:50 +0000)]
Update QLogic ISP 24xx/25xx chips firmware to 8.07.00.

MFC after: 1 month

6 years agoClarify and clean up some language, and add an explicit example.
wblock [Fri, 2 Mar 2018 19:07:32 +0000 (19:07 +0000)]
Clarify and clean up some language, and add an explicit example.

Sponsored by: iXsystems
Differential Revision: https://reviews.freebsd.org/D12336

6 years agoClarity and style fixes.
wblock [Fri, 2 Mar 2018 18:57:00 +0000 (18:57 +0000)]
Clarity and style fixes.

Sponsored by: iXsystems

6 years agoiflib: stop timer callout when stopping
shurd [Fri, 2 Mar 2018 18:48:07 +0000 (18:48 +0000)]
iflib: stop timer callout when stopping

iflib_timer has been seen running after the interface had been removed.
This change prevents that.

Submitted by: matt.macy@joyent.com

6 years agolualoader: Reset the cursor position after the menu is drawn
kevans [Fri, 2 Mar 2018 17:07:08 +0000 (17:07 +0000)]
lualoader: Reset the cursor position after the menu is drawn

Rather than before the menu is drawn. The drawer is going to reset the
crusor position as soon as it draws anything anyways, so doing it before
serves no purpose. Setting it after is needed so we don't clobber the menu
when we start booting.

6 years agoAdd --globals printc to lua-lint
kevans [Fri, 2 Mar 2018 16:51:43 +0000 (16:51 +0000)]
Add --globals printc to lua-lint

We provide a global 'printc' as of r330282; make luacheck aware of this fact
so that we can use it without complaints.

6 years agoRemove _Nonnull attributes from user addresses arguments for
kib [Fri, 2 Mar 2018 16:47:02 +0000 (16:47 +0000)]
Remove _Nonnull attributes from user addresses arguments for
copyout(9) family.

The addresses are user-controllable, and if the process ABI allows
mapping at zero, then the zero address is meaningful, contradicting
the definition of _Nonnull.  In any case, it does not require any
special code to handle NULL udaddr.

It is not clear if __restrict makes sense as well, since kaddr and
udaddr point to different address spaces, so equal numeric values of
the pointers do not imply aliasing and a legitimate.  But leave it for
later.

copyinstr(9) does not have its user address argument annotated.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoliblua: Use putc instead of printf for printc
kevans [Fri, 2 Mar 2018 16:31:23 +0000 (16:31 +0000)]
liblua: Use putc instead of printf for printc

printc does not need the features or the overhead of printf. It does not
take formatting strings, and it pipes the single string argument through an
"%s" format.

Instead, use putc directly. This pipes the string through in its entirety as
a series of 'unsigned char's, generally straight to the console emulator.

Discussed with: tsoome

6 years agolualoader: Use global printc instead of loader.printc
kevans [Fri, 2 Mar 2018 16:06:20 +0000 (16:06 +0000)]
lualoader: Use global printc instead of loader.printc

r330282 registered loader.printc as printc, so use it instead. This makes
sense for a couple reasons, the major point being that it reads a little bit
easier and pairs nicely with the global 'print'.

Similar cases can not really be made for other loader.* functions as most of
them are either highly specific to our use-case or usually available in
other modules, such as `os`. printc does not have a standard implementation
in the Lua world(*), so we have a little more leeway with it, and it's kind
of a special case of the globally available 'print'.

(*) I've been in the Lua world for all of two weeks, so this could be wrong.

6 years agolualoader: Register loader.printc as global printc
kevans [Fri, 2 Mar 2018 15:46:22 +0000 (15:46 +0000)]
lualoader: Register loader.printc as global printc

6 years agolualoader: Steamroll the box-drawing
kevans [Fri, 2 Mar 2018 15:28:08 +0000 (15:28 +0000)]
lualoader: Steamroll the box-drawing

- Add drawer.frame_styles to map out the kinds of characters we need for the
  different loader_menu_frame values
- Respect loader_menu_frame, default to double[*]
- (imp) Use loader.printc instead of print- print adds a newline to the
  output, which is not the right thing we want to be doing.
- (imp) Draw horizontal frames a little more efficiently- setting the cursor
  after every line segment is horribly inefficient, especially on serial
  consoles. Halve the number of characters written at the expense of an
  additional loop to draw the bottom frame, which is likely more efficient
  in the long run for some of less ideal scenarios.

[*] menu.4th(8) claims that the default here was single, but unset
loader_menu_frame yielded double and we didn't have any overrides in the
default loader.conf(5), so double it is.

6 years agolibefivar: use standard 2-Clause FreeBSD license
emaste [Fri, 2 Mar 2018 15:12:18 +0000 (15:12 +0000)]
libefivar: use standard 2-Clause FreeBSD license

Approved by: imp
Sponsored by: The FreeBSD Foundation

6 years agoFix README.md formatting.
trasz [Fri, 2 Mar 2018 14:42:08 +0000 (14:42 +0000)]
Fix README.md formatting.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years ago.Xr pstat(8), so that people have a chance to learn how to get a list
trasz [Fri, 2 Mar 2018 14:16:19 +0000 (14:16 +0000)]
.Xr pstat(8), so that people have a chance to learn how to get a list
of terminal devices using "pstat -t".

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoCount the number of children in the GICv3 ACPI attachment. This is needed
andrew [Fri, 2 Mar 2018 13:04:21 +0000 (13:04 +0000)]
Count the number of children in the GICv3 ACPI attachment. This is needed
later for assigning IRQ vector space.

Sponsored by: DARPA, AFRL
Sponsored by: Cavium (Hardware)

6 years agoImplement more lockdep stubs in the LinuxKPI.
hselasky [Fri, 2 Mar 2018 08:59:53 +0000 (08:59 +0000)]
Implement more lockdep stubs in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoImplement ktime_get_raw() function in the LinuxKPI.
hselasky [Fri, 2 Mar 2018 08:58:32 +0000 (08:58 +0000)]
Implement ktime_get_raw() function in the LinuxKPI.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agoImplement wait_on_bit() function macro in the LinuxKPI.
hselasky [Fri, 2 Mar 2018 08:56:15 +0000 (08:56 +0000)]
Implement wait_on_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

6 years agoRename callout member in struct timer_list to match the one in struct
hselasky [Fri, 2 Mar 2018 08:52:27 +0000 (08:52 +0000)]
Rename callout member in struct timer_list to match the one in struct
delayed_work in the LinuxKPI. This allows the timer_pending() function
macro to be used with delayed work structures.

No functional nor structural change.

MFC after: 1 week
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

6 years agog_label_ufs: Fix typo from r330264
cem [Fri, 2 Mar 2018 06:02:54 +0000 (06:02 +0000)]
g_label_ufs: Fix typo from r330264

Reported by: O. Hartmann <o.hartmann AT walstatt.org>
Sponsored by: Dell EMC Isilon

6 years agocore.lua(8): Add missing note about core.KEYSTR_CSI
kevans [Fri, 2 Mar 2018 05:38:08 +0000 (05:38 +0000)]
core.lua(8): Add missing note about core.KEYSTR_CSI

6 years agoAdd menu.lua(8), but do not add to distribution
kevans [Fri, 2 Mar 2018 05:36:04 +0000 (05:36 +0000)]
Add menu.lua(8), but do not add to distribution

Distribution will be done after all of the lualoader manpages are created.

Reviewed by: rpokala
Differential Revision: https://reviews.freebsd.org/D14480

6 years agoAdd core.lua(8), but do not add to distribution
kevans [Fri, 2 Mar 2018 05:35:14 +0000 (05:35 +0000)]
Add core.lua(8), but do not add to distribution

Distribution will be done after all of the lualoader manpages are created.

Reviewed by: rpokala
Differential Revision: https://reviews.freebsd.org/D14479

6 years agoThis change is some refactoring of Mark Johnston's changes in r329375
mckusick [Fri, 2 Mar 2018 04:34:53 +0000 (04:34 +0000)]
This change is some refactoring of Mark Johnston's changes in r329375
to fix the memory leak that I introduced in r328426. Instead of
trying to clear up the possible memory leak in all the clients, I
ensure that it gets cleaned up in the source (e.g., ffs_sbget ensures
that memory is always freed if it returns an error).

The original change in r328426 was a bit sparse in its description.
So I am expanding on its description here (thanks cem@ and rgrimes@
for your encouragement for my longer commit messages).

In preparation for adding check hashing to superblocks, r328426 is
a refactoring of the code to get the reading/writing of the superblock
into one place. Unlike the cylinder group reading/writing which
ends up in two places (ffs_getcg/ffs_geom_strategy in the kernel
and cgget/cgput in libufs), I have the core superblock functions
just in the kernel (ffs_sbfetch/ffs_sbput in ffs_subr.c which is
already imported into utilities like fsck_ffs as well as libufs to
implement sbget/sbput). The ffs_sbfetch and ffs_sbput functions
take a function pointer to do the actual I/O for which there are
four variants:

    ffs_use_bread / ffs_use_bwrite for the in-kernel filesystem

    g_use_g_read_data / g_use_g_write_data for kernel geom clients

    ufs_use_sa_read for the standalone code (stand/libsa/ufs.c
but not stand/libsa/ufsread.c which is size constrained)

    use_pread / use_pwrite for libufs

Uses of these interfaces are in the UFS filesystem, geoms journal &
label, libsa changes, and libufs. They also permeate out into the
filesystem utilities fsck_ffs, newfs, growfs, clri, dump, quotacheck,
fsirand, fstyp, and quot. Some of these utilities should probably be
converted to directly use libufs (like dumpfs was for example), but
there does not seem to be much win in doing so.

Tested by: Peter Holm (pho@)

6 years agolualoader: Use string literal \xNN instead of string.char()
kevans [Fri, 2 Mar 2018 03:05:36 +0000 (03:05 +0000)]
lualoader: Use string literal \xNN instead of string.char()

6 years agolualoader: Use #str instead of tracking length with 'n'
kevans [Fri, 2 Mar 2018 02:39:41 +0000 (02:39 +0000)]
lualoader: Use #str instead of tracking length with 'n'

We really gain almost nothing by tracking length separately, especially when
it's as easy as "#str", so reduce complexity.

6 years agolualoader: Fix some lint-mentioned errors
kevans [Fri, 2 Mar 2018 02:39:16 +0000 (02:39 +0000)]
lualoader: Fix some lint-mentioned errors

- nextbootfile is not a variable, but nextboot_file is
- pstatus was explicitly initialized but later clobbered, so don't
  initialize it.