imp [Sun, 3 Dec 2017 04:55:33 +0000 (04:55 +0000)]
Mark two things as unused (since they are only sometimes used) and
toss in a DECONST to remove a const in some tricky code that would
require too extensive a change to unwind otherwise.
imp [Sun, 3 Dec 2017 04:55:19 +0000 (04:55 +0000)]
Disconnet ps3 from the build. There's too many warnings to fix. Also,
it's going to be removed soon anyway once the final lingering issues
with kboot are resolved. Go ahead and disconnect it from the build a
little early.
kevans [Sun, 3 Dec 2017 02:23:29 +0000 (02:23 +0000)]
grep test: Fix copyright notice
The copyright notice was erroneously introduced as one from the NetBSD
foundation due to it being copied from a file in the NetBSD test suite, but
this file itself is not derived from or supplied with the NetBSD test suite.
eadler [Sat, 2 Dec 2017 17:10:13 +0000 (17:10 +0000)]
diag/httpd-error: remove
This is a script for a web server in a specific
configuration. Current web servers don't produce
similar log files and it isn't FreeBSD's
goal to produce a log file analyzer.
imp [Sat, 2 Dec 2017 07:29:19 +0000 (07:29 +0000)]
Create a function to translate UEFI paths to unix paths
efivar_device_path_to_unix_path translates from UEFI to Unix
efivar_unix_path_to_device_path translates from Unix to UEFI
At present, only HD() device types are supported (both GPT and
MBR). CdRom and floppy devices aren't supported. ZFS isn't supported
because there's no way in the UEFI standard to specify a ZFS datastore.
Network devices aren't supported either.
Three forms of Unix path are accepted: /path/to/file (for a mounted
filesystem), //path/to/file (uses the EFI partition on the same disk
as /), and dev:/path/to/file (for unmounted filesystem). Two forms are
produced (the first and last).
imp [Sat, 2 Dec 2017 07:29:07 +0000 (07:29 +0000)]
Read multiple lines when parsing the data. Allow multiple device paths
to be read when formatting device paths. Set the upper limit to 64k
(most of these paths are < 64 bytes).
landonf [Sat, 2 Dec 2017 02:21:27 +0000 (02:21 +0000)]
Introduce bwn(4) support for the bhnd(4) bus.
Currently, bwn(4) relies on the siba_bwn(4) bus driver to provide support
for the on-chip SSB interconnect found in Broadcom's older PCI(e) Wi-Fi
adapters. Non-PCI Wi-Fi adapters, as well as the newer BCMA interconnect
found in post-2009 Broadcom Wi-Fi hardware, are not supported by
siba_bwn(4).
The bhnd(4) bus driver (also used by the FreeBSD/MIPS Broadcom port)
provides a unified kernel interface to a superset of the hardware supported
by siba_bwn; by attaching bwn(4) via bhnd(4), we can support both modern
PCI(e) Wi-Fi devices based on the BCMA backplane interconnect, as well as
Broadcom MIPS WiSoCs that include a D11 MAC core directly attached to their
SSB or BCMA backplane.
This diff introduces opt-in bwn(4) support for bhnd(4) by providing:
- A small bwn(4) driver subclass, if_bwn_bhnd, that attaches via
bhnd(4) instead of siba_bwn(4).
- A bhndb(4)-based PCI host bridge driver, if_bwn_pci, that optionally
probes at a higher priority than the siba_bwn(4) PCI driver.
- A set of compatibility shims that perform translation of bwn(4)'s
siba_bwn function calls into their bhnd(9) API equivalents when bwn(4)
is attached via a bhnd(4) bus parent. When bwn(4) is attached via
siba_bwn(4), all siba_bwn function calls are simply passed through to
their original implementations.
To test bwn(4) with bhnd(4), place the following lines in loader.conf(5):
To verify that bwn(4) is using bhnd(4), you can check dmesg:
bwn0: <Broadcom 802.11 MAC/PHY/Radio, rev 15> ... on bhnd0
... or devinfo(8):
pcib2
pci2
bwn_pci0
bhndb0
bhnd0
bwn0
...
bwn(4)/bhnd(4) has been tested for regressions with most chipsets currently
supported by bwn(4), including:
- BCM4312
- BCM4318
- BCM4321
With minimal changes to the DMA code (not included in this commit), I was
also able to test support for newer BCMA devices by bringing up basic
working Wi-Fi on two previously unsupported, BCMA-based N-PHY chipsets:
- BCM43224
- BCM43225
Approved by: adrian (mentor, implicit)
Sponsored by: The FreeBSD Foundation & Plausible Labs
Differential Revision: https://reviews.freebsd.org/D13041
jhibbits [Sat, 2 Dec 2017 01:42:07 +0000 (01:42 +0000)]
Override memattr for mmap on the Freescale DIU driver
The Display Interface Unit (DIU) uses main memory for the framebuffer, which
is already mapped as cache coherent physical memory. Prevent mmap() from
using its own attributes which may otherwise conflict.
landonf [Sat, 2 Dec 2017 01:07:41 +0000 (01:07 +0000)]
bhndb(4): Fix leak of child devices and MSI vectors.
- Add missing call to device_delete_children() in bhndb_detach(), without
which we're left with stale child devices on module unload.
- Pass the parent PCI device to pci_release_msi(), not the bhndb_pci(4)
child.
Approved by: adrian (mentor, implicit)
Sponsored by: The FreeBSD Foundation
landonf [Sat, 2 Dec 2017 00:52:59 +0000 (00:52 +0000)]
bhnd_chipc(4): Break cyclic references to the ChipCommon device
bhnd_chipc's children may hold strong provider references to their parent;
we must detach any children before attempting to deregister the bhnd_chipc
device as a bus service provider.
Approved by: adrian (mentor, implicit)
Sponsored by: The FreeBSD Foundation
imp [Sat, 2 Dec 2017 00:06:58 +0000 (00:06 +0000)]
Minor flags cleanup
Move kernel includes and libsa includes together at the top of defs.mk
Move all machine specific defines from Makefile.inc to their friends
in defs.mk.
Add comments and remove now useless junk after the move.
imp [Sat, 2 Dec 2017 00:06:52 +0000 (00:06 +0000)]
Remove stale dependency on ufsread.c
Remove the now-useless dependency on ufsread.c. In some cases, it was
on the wrong file. But in all cases, we now automatically generate
.depend files, so we don't need it explicitly.
imp [Fri, 1 Dec 2017 22:48:20 +0000 (22:48 +0000)]
Correct history for Unix 2nd Edition through 6th Edition for the
system calls. Man pages are missing for v2 and v5, so any entries for
those versions were inferred by new implementations of these functions
in libc.
kib [Fri, 1 Dec 2017 22:38:28 +0000 (22:38 +0000)]
vmstat: fix style(9) violations and bump WARNS.
Based on the patch by: Pawel Biernacki <pawel.biernacki@gmail.com>
Sponsored by: Mysterious Code Ltd. (Pawel),
The FreeBSD Foundation (me)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D13228
imp [Fri, 1 Dec 2017 22:26:36 +0000 (22:26 +0000)]
Mark all the system calls that were in 1st Edition Unix as such in the
HISTORY section. Note: Any system calls that were added prior to v7,
but after v1 weren't changed.
kevans [Fri, 1 Dec 2017 20:51:08 +0000 (20:51 +0000)]
a10_gpio: Add support for more modern pin configuration
a10_gpio previously accepted only {allwinner,}drive and {allwinner,}pull for
drive/bias setting, while newer DTS is using drive-strength and
bias-{disable,pull-up,pull-down} properties. Accept these properties as
well.
Additionally make bias and drive strength optional rather than required; not
setting them should just indicate that we do not need to configure these
properties.
Tested on: BananaPi-M3 (a83t)
Reviewed by: manu
Approved by: emaste (implicit)
Obtained from: NetBSD (partially)
Differential Revision: https://reviews.freebsd.org/D13284
Do better cleaning in key_destroy() for VIMAGE case.
SPDB was cleaned using TAILQ_CONCAT() instead of calling key_unlink()
for each SP, thus we need to properly clean lists in each bucket of
V_sphashtbl to avoid panic in hashdestroy() when INVARIANTS is enabled.
Do the same for V_acqaddrhashtbl and V_acqseqhashtbl.
When we are called in DEFAULT_VNET, destroy also all global locks and
drain key_timer callout.
tsoome [Fri, 1 Dec 2017 06:37:12 +0000 (06:37 +0000)]
loader.efi: efipart should exclude iPXE stub block protocol
iPXE does insert stub BLOCK IO protocol handle to rework other issues,
this handle is not usable as it does not provide actual implementation.
We can detect this situation by checking and validating the BlockSize
property, so this update does make sure we have BlockSize at least 512B
and its value is power of 2.
markj [Thu, 30 Nov 2017 20:36:29 +0000 (20:36 +0000)]
Update gmirror metadata less frequently when synchronizing.
We periodically record synchronization progress in the metadata
block of the disk being synchronized; this allows an interrupted
synchronization to be resumed. However, the frequency of these
updates heavily pessimized synchronization time on some media. This
change modifies gmirror to update metadata based on a time period,
and adds a sysctl to control that period. The default value results
in a much lower update frequency and increases the completion time
for an interrupted rebuild only marginally.
Reported by: Andre Albsmeier <andre@fbsd.e4m.org>
MFC after: 3 weeks
jkim [Thu, 30 Nov 2017 20:21:42 +0000 (20:21 +0000)]
Properly skip the first CPU. It only accidentally worked because the
CPU_FOREACH() loop always starts from BSP (cpu0) and the if condition
is always false for APs.
ed [Thu, 30 Nov 2017 17:58:48 +0000 (17:58 +0000)]
Port cloudabi32.ko to FreeBSD/arm64.
This change adds an implementation of a sysent for running CloudABI
armv6 and armv7 binaries on FreeBSD/arm64. It is a somewhat literal copy
of the armv6 version, except that it's been patched up to use the proper
registers.
Just like for cloudabi32.ko on FreeBSD/amd64, we make use of a vDSO that
automatically pads system call parameters to 64-bit value. These are
stored in a buffer on the stack, meaning we need to use copyin() and
copyout() unconditionally.
jkim [Thu, 30 Nov 2017 01:40:07 +0000 (01:40 +0000)]
Add a tunable "debug.hwpstate_verify" to check P-state after changing it and
turn it off by default. It is very inefficient to verify current P-state of
each core, especially for CPUs with many cores. When multiple commands are
requested to the same power domain before completion of pending transitions,
the last command is executed according to the manual. Because requests are
serialized by the caller, all cores will receive the same command for each
call. Do not call sched_bind() and sched_unbind(). It is redundant because
the caller does it anyway.
hselasky [Wed, 29 Nov 2017 23:28:40 +0000 (23:28 +0000)]
The sched_add() function is not only used when the thread is initially
started, but also by the turnstiles to mark a thread as runnable for
all locks, for instance sleepqueues do:
setrunnable()->sched_wakeup()->sched_add()
In r326218 code was added to allow booting from non-zero CPU numbers
by setting the ts_cpu field inside the ULE scheduler's sched_add()
function. This had an undesired side-effect that prior sched_pin() and
sched_bind() calls got disregarded. This patch fixes the
initialization of the ts_cpu field for the ULE scheduler to only
happen once when the initial thread is constructed during system
init. Forking will then later on ensure that a valid ts_cpu value gets
copied to all children.
arichardson [Wed, 29 Nov 2017 21:16:14 +0000 (21:16 +0000)]
Don't fail the build due to clang integer constant range warnings
This warning checks whether a constant is out of range of the integer
type. An example is `comparison of 'u_int' > 4294967295 is always false`
and in this case the warning makes sense.
However, when the type is a typedef that can be either 64 or 32 bits the
if condition is only tautological in some configurations so this should
not be a warning that fails the build.
Reviewed by: dim
Approved by: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D12912
markj [Wed, 29 Nov 2017 19:47:09 +0000 (19:47 +0000)]
Verify the object/vnode association after vget() in vm_pageout_clean().
It's theoretically possible for the vnode and object to be disassociated
while locks are dropped around the vget() call, in which case we
shouldn't proceed with laundering.
shurd [Wed, 29 Nov 2017 18:14:57 +0000 (18:14 +0000)]
Ensure that ctx->ifc_cpus is always initialized
If a device didn't support MSI-X, ctx->ifc_cpus would not be initialized,
but the IRQ allocation routines still uses the value. Move the
initialization to common code.
kib [Wed, 29 Nov 2017 10:04:11 +0000 (10:04 +0000)]
Implement hardware mlx5(4) rx timestamps.
Driver support is only provided for ConnectX4/5.
System-time timestamp is calculated based on the free-running counter
timestamp provided by hardware. Driver periodically samples the
counter to calibrate it against the system clock and uses linear
interpolation to convert. Stability of the crystal which drives the
clock is +-50 ppm at the operational temperature, which makes the
algorithm good enough.
The calculation is somewhat delicate because all values are 64bit and
overflow the naive formula for linear interpolation. The calculation
drops the least significant bits in advance, see the PREC shift in
mlx5_mbuf_tstmp().
Hardware stamps can be turned off by 'ifconfig mceN -hwrxtsmp'. Buggy
firmware might result in small but visible errors in the reported
timestamps, detectable e.g. by nonsensical (negative) RTT values for
LAN pings.
hselasky [Wed, 29 Nov 2017 09:40:11 +0000 (09:40 +0000)]
Disallow TUN and TAP character device IOCTLs to modify the network device
type to any value. This can cause page faults and panics due to accessing
uninitialized fields in the "struct ifnet" which are specific to the network
device type.
jeff [Tue, 28 Nov 2017 23:40:54 +0000 (23:40 +0000)]
Eliminate kmem_arena and kmem_object in preparation for further NUMA commits.
The arena argument to kmem_*() is now only used in an assert. A follow-up
commit will remove the argument altogether before we freeze the API for the
next release.
This replaces the hard limit on kmem size with a soft limit imposed by UMA. When
the soft limit is exceeded we periodically wakeup the UMA reclaim thread to
attempt to shrink KVA. On 32bit architectures this should behave much more
gracefully as we exhaust KVA. On 64bit the limits are likely never hit.
jeff [Tue, 28 Nov 2017 23:18:35 +0000 (23:18 +0000)]
Move domain iterators into the page layer where domain selection should take
place. This makes the majority of the phys layer explicitly domain specific.