]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoRemove leftover _LDSCRIPTROOT missed in r297270.
bdrewery [Tue, 5 Apr 2016 21:12:03 +0000 (21:12 +0000)]
Remove leftover _LDSCRIPTROOT missed in r297270.

Sponsored by: EMC / Isilon Storage Division

8 years agobhyve: Remove unneeded variable ncq.
pfg [Tue, 5 Apr 2016 19:30:19 +0000 (19:30 +0000)]
bhyve: Remove unneeded variable ncq.

ncq was not being inititialized properly but it was not actually
necessary either, so make the code smaller by removing it.

CID: 1248842
Reviewed by: grehan

8 years agoRemove misleading comment. musb supports host mode for more than two years now
gonzo [Tue, 5 Apr 2016 18:07:13 +0000 (18:07 +0000)]
Remove misleading comment. musb supports host mode for more than two years now

Spotted by: jmcneill

8 years agoFix typo. No functional change.
skra [Tue, 5 Apr 2016 13:56:43 +0000 (13:56 +0000)]
Fix typo. No functional change.

8 years agoAdd more DPRINTF() to the ftdi driver. Now everything that can change the
ian [Tue, 5 Apr 2016 13:47:06 +0000 (13:47 +0000)]
Add more DPRINTF() to the ftdi driver.  Now everything that can change the
chip's state has a DPRINTF, with things that happen repeatedly at debug=2
level and things that happen frequently (like per-transfer IO) at debug=3.

8 years agoRework BCM283x gpio interrupt controller for INTRNG. It's used on RPI-B
skra [Tue, 5 Apr 2016 13:45:23 +0000 (13:45 +0000)]
Rework BCM283x gpio interrupt controller for INTRNG. It's used on RPI-B
and RPI2 where INTRNG is already enabled by default.

Differential Revision: https://reviews.freebsd.org/D5810

8 years agoImplement bcm2836 interrupt controller for INTRNG and enable it
skra [Tue, 5 Apr 2016 13:41:51 +0000 (13:41 +0000)]
Implement bcm2836 interrupt controller for INTRNG and enable it
on RPI2 by default.

Differential Revision: https://reviews.freebsd.org/D5822

8 years agoRework bcm283x interrupt controller for INTRNG and enable it
skra [Tue, 5 Apr 2016 13:37:03 +0000 (13:37 +0000)]
Rework bcm283x interrupt controller for INTRNG and enable it
on RPI-B by default.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D5809

8 years agoehci_interrupt is MPSAFE code. Most drivers in tree calls bus_setup_intr
mmel [Tue, 5 Apr 2016 12:13:53 +0000 (12:13 +0000)]
ehci_interrupt is MPSAFE code. Most drivers in tree calls bus_setup_intr
with MPSAFE, some are not. Fix those.

Submitted by: Howard Su <howard0su@gmail.com>
Differential Revision: https://reviews.freebsd.org/D5755

8 years agoUse proper locking macros in RACCT in RCTL.
trasz [Tue, 5 Apr 2016 11:30:52 +0000 (11:30 +0000)]
Use proper locking macros in RACCT in RCTL.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agox86 topo: add some comments, descriptions and references to documentation
avg [Tue, 5 Apr 2016 10:36:40 +0000 (10:36 +0000)]
x86 topo: add some comments, descriptions and references to documentation

Plus a minor cosmetic change.

MFC after: 1 month

8 years agoTEGRA: Fix CPU frequency switching.
mmel [Tue, 5 Apr 2016 09:20:52 +0000 (09:20 +0000)]
TEGRA: Fix CPU frequency switching.
The PLL_X, base CPU frequency source, doesn't have a bypass switch and thus
we must use another frequency source for CPU while changing its frequency.
PLL_P is ideal for this, it runs at 480MHz and CPU can be clocked at this
frequency at any CPU voltage.

8 years agoAdd support for the Microchip mcp7941x.
jhibbits [Tue, 5 Apr 2016 03:27:33 +0000 (03:27 +0000)]
Add support for the Microchip mcp7941x.

This is compatible with the ds1307, but comparing the mcp7941x datasheet vs the
ds1307 code, appears there is one bit placement difference, so that is now
accounted for.

Relnotes: yes

8 years agoMake i2c device child auto-probe work for MPC85xx and QorIQ SoCs.
jhibbits [Tue, 5 Apr 2016 02:27:01 +0000 (02:27 +0000)]
Make i2c device child auto-probe work for MPC85xx and QorIQ SoCs.

OFW i2c probing requires a new method ofw_bus_get_node(), and the bus device is
assumed iichb.  With these changes, i2c devices attached in fdt are probed and
attached automagically.

8 years agoAdd another real-life example of setting a quirk for a USB gaming
wblock [Tue, 5 Apr 2016 01:12:56 +0000 (01:12 +0000)]
Add another real-life example of setting a quirk for a USB gaming
keyboard.  From forum thread: https://forums.freebsd.org/threads/55717/

MFC after: 1 week

8 years agoRemove a redundant check.
jhb [Tue, 5 Apr 2016 00:10:07 +0000 (00:10 +0000)]
Remove a redundant check.

cpu_suspend_map is always empty if smp_started is false.

Sponsored by: Netflix

8 years agoRemove an unneeded check.
jhb [Tue, 5 Apr 2016 00:09:19 +0000 (00:09 +0000)]
Remove an unneeded check.

CPUs with valid per-CPU data are not absent.

Sponsored by: Netflix

8 years agoDon't wakeup the fdc worker thread once a second when idle.
jhb [Tue, 5 Apr 2016 00:08:42 +0000 (00:08 +0000)]
Don't wakeup the fdc worker thread once a second when idle.

The fdc worker thread was using a one second timeout while waiting for
a new bio to arrive or for the device to detach.  However, the driver
already does a wakeup when queueing a new bio or asking the thread to
detach, so the timeout only served to waste CPU time waking up the
thread once a second just so it could go right back to sleep.  Use an
infinite timeout instead.

Discussed with: phk
Sponsored by: Netflix

8 years agoDIRDEPS_BUILD: Use 1 parameter for defining -rpath-link.
bdrewery [Mon, 4 Apr 2016 23:15:57 +0000 (23:15 +0000)]
DIRDEPS_BUILD: Use 1 parameter for defining -rpath-link.

Sponsored by: EMC / Isilon Storage Division

8 years ago[net80211] Add an A-MSDU debug output shortcut.
adrian [Mon, 4 Apr 2016 22:10:52 +0000 (22:10 +0000)]
[net80211] Add an A-MSDU debug output shortcut.

8 years agoAdd early_customize_cmd() that allows to register custom functions run
glebius [Mon, 4 Apr 2016 21:06:44 +0000 (21:06 +0000)]
Add early_customize_cmd() that allows to register custom functions run
before the build stage.

Reviewed by: imp
Obtained from: Netflix

8 years ago[net80211] teach wlanstats about the ff_encapfail field.
adrian [Mon, 4 Apr 2016 20:33:16 +0000 (20:33 +0000)]
[net80211] teach wlanstats about the ff_encapfail field.

Without this it just displays a blank, short column which is just
plainly not useful.

8 years ago[net80211] add amsdu and fast frames encap failure counters in the ioctl
adrian [Mon, 4 Apr 2016 20:32:31 +0000 (20:32 +0000)]
[net80211] add amsdu and fast frames encap failure counters in the ioctl
definition.

The code to set these will come in a subsequent commit (when I start
fleshing out A-MSDU support.)

8 years agoAdd a table to map from the FreeBSD CPUID space to the GIC CPUID space. On
andrew [Mon, 4 Apr 2016 17:04:33 +0000 (17:04 +0000)]
Add a table to map from the FreeBSD CPUID space to the GIC CPUID space. On
many SoCs these two are the same, however there is no requirement for this
to be the case, e.g. on the ARM Juno we boot on what the GIC thinks of as
CPU 2, but FreeBSD numbers it CPU 0.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agonew x86 smp topology detection code
avg [Mon, 4 Apr 2016 16:09:29 +0000 (16:09 +0000)]
new x86 smp topology detection code

Previously, the code determined a topology of processing units
(hardware threads, cores, packages) and then deduced a cache topology
using certain assumptions.  The new code builds a topology that
includes both processing units and caches using the information
provided by the hardware.

At the moment, the discovered full topology is used only to creeate
a scheduling topology for SCHED_ULE.
There is no KPI for other kernel uses.

Summary:
- based on APIC ID derivation rules for Intel and AMD CPUs
- can handle non-uniform topologies
- requires homogeneous APIC ID assignment (same bit widths for ID
  components)
- topology for dual-node AMD CPUs may not be optimal
- topology for latest AMD CPU models may not be optimal as the code is
  several years old
- supports only thread/package/core/cache nodes

Todo:
  - AMD dual-node processors
  - latest AMD processors
  - NUMA nodes
  - checking for homogeneity of the APIC ID assignment across packages
  - more flexible cache placement within topology
  - expose topology to userland, e.g., via sysctl nodes

Long term todo:
  - KPI for CPU sharing and affinity with respect to various resources
    (e.g., two logical processors may share the same FPU, etc)

Reviewed by: mav
Tested by: mav
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D2728

8 years agoSJIS encoding don't have single byte characters >= 224
ache [Mon, 4 Apr 2016 15:56:14 +0000 (15:56 +0000)]
SJIS encoding don't have single byte characters >= 224

MFC after:      1 week

8 years agoReduce the diff for when we switch to intrng. The IPI interrupts will be
andrew [Mon, 4 Apr 2016 15:13:17 +0000 (15:13 +0000)]
Reduce the diff for when we switch to intrng. The IPI interrupts will be
split out to multiple handlers.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoInclude sys/rman.h directly rather than relying on header pollution.
andrew [Mon, 4 Apr 2016 10:52:43 +0000 (10:52 +0000)]
Include sys/rman.h directly rather than relying on header pollution.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoOpenBSD 5.9 and FreeBSD 10.3 releases added.
maxim [Mon, 4 Apr 2016 10:27:48 +0000 (10:27 +0000)]
OpenBSD 5.9 and FreeBSD 10.3 releases added.

8 years agoFix a format string when uint64_t is not unsigned long long by casting
andrew [Mon, 4 Apr 2016 10:03:06 +0000 (10:03 +0000)]
Fix a format string when uint64_t is not unsigned long long by casting
through uintmax_t.

8 years agoDefine local-intc for BCM2836 platform (RPI2) and make BCM2835 intc
skra [Mon, 4 Apr 2016 09:41:22 +0000 (09:41 +0000)]
Define local-intc for BCM2836 platform (RPI2) and make BCM2835 intc
a child of it. This is done in conformity with Linux dts files and
as preparation for rework of BCM2836 interrupt controller for INTRNG.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D5807

8 years agoRework TI gpio interrupt controller for INTRNG. It's used on PANDABOARD
skra [Mon, 4 Apr 2016 09:29:30 +0000 (09:29 +0000)]
Rework TI gpio interrupt controller for INTRNG. It's used on PANDABOARD
and BEAGLEBONE where INTRNG is already enabled by default.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D5806

8 years agoRework am33xx interrupt controller for INTRNG and enable it
skra [Mon, 4 Apr 2016 09:23:21 +0000 (09:23 +0000)]
Rework am33xx interrupt controller for INTRNG and enable it
on BEAGLEBONE by default.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D5805

8 years agoRemove FDT specific parts from INTRNG. Change its interface to make it
skra [Mon, 4 Apr 2016 09:15:25 +0000 (09:15 +0000)]
Remove FDT specific parts from INTRNG. Change its interface to make it
universal.

(1) New struct intr_map_data is defined as a container for arbitrary
description of an interrupt used by a device. Typically, an interrupt
number and configuration relevant to an interrupt controller is encoded
in such description. However, any additional information may be encoded
too like a set of cpus on which an interrupt should be enabled or vendor
specific data needed for setup of an interrupt in controller. The struct
intr_map_data itself is meant to be opaque for INTRNG.

(2) An intr_map_irq() function is created which takes an interrupt
controller identification and struct intr_map_data as arguments and
returns global interrupt number which identifies an interrupt.

(3) A set of functions to be used by bus drivers is created as well as
a corresponding set of methods for interrupt controller drivers. These
sets take both struct resource and struct intr_map_data as one of the
arguments. There is a goal to keep struct intr_map_data in struct
resource, however, this way a final solution is not limited to that.

(4) Other small changes are done to reflect new situation.

This is only first step aiming to create stable interface for interrupt
controller drivers. Thus, some temporary solution is taken. Interrupt
descriptions for devices are stored in INTRNG and two specific mapping
function are created to be temporary used by bus drivers. That's why
the struct intr_map_data is not opaque for INTRNG now. This temporary
solution will be replaced by final one in next step.

Differential Revision: https://reviews.freebsd.org/D5730

8 years agoarm64: pagezero improvement
wma [Mon, 4 Apr 2016 07:16:43 +0000 (07:16 +0000)]
arm64: pagezero improvement

This change has been provided to improve pagezero call performance.

Submitted by:          Dominik Ermel <der@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           kib
Differential Revision: https://reviews.freebsd.org/D5741

8 years agoAdd bzero.S to ARM64 machdep
wma [Mon, 4 Apr 2016 07:11:33 +0000 (07:11 +0000)]
Add bzero.S to ARM64 machdep

Add fille missing from https://svnweb.freebsd.org/changeset/base/297536

8 years agoarm64: bzero optimization
wma [Mon, 4 Apr 2016 07:06:20 +0000 (07:06 +0000)]
arm64: bzero optimization

This optimization attempts to utylize as wide as possible register store instructions to zero large buffers.
The implementation, if possible, will use 'dc zva' to zero buffer by cache lines.

Speedup: 60x faster memory zeroing

Submitted by:          Dominik Ermel <der@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           kib
Differential Revision: https://reviews.freebsd.org/D5726

8 years agoRemove unused variable. It was write-only before r297139.
kib [Mon, 4 Apr 2016 06:58:59 +0000 (06:58 +0000)]
Remove unused variable.  It was write-only before r297139.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoEnable 4-byte address support for the mx25l family of SPI flash devices.
sgalabov [Mon, 4 Apr 2016 06:55:48 +0000 (06:55 +0000)]
Enable 4-byte address support for the mx25l family of SPI flash devices.

Introduce 2 new flags:
- FL_ENABLE_4B_ADDR (forces the use of 4-byte addresses)
- FL_DISABLE_4B_ADDR (forces the use of 3-byte addresses)

If an SPI flash chip is defined with FL_ENABLE_4B_ADDR in its flags,
then an 'Enter 4-byte mode' command is sent to the chip at attach time
and, later, all commands that require addressing are issued with 4-byte
addresses.
If an SPI flash chip is defined with FL_DISABLE_4B_ADDR in its flags,
then an 'Exit 4-byte mode' command is sent to the chip at attach time
and, later, all commands that require addressing are issued with 3-byte
addresses.
For chips that do not have any of these flags defined the behaviour is
unchanged.

This change also adds support for the MX25L25735F and MX25L25635E chips
(vendor id 0xc2, device id 0x2019), which support 4-byte mode and enables
4-byte mode for them. These are 256Mbit devices (32MiB) and, as such, can
only be fully addressed by using 4-byte addresses.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5808

8 years agoEUC-type encodings don't have single byte characters >= 128
ache [Mon, 4 Apr 2016 02:43:35 +0000 (02:43 +0000)]
EUC-type encodings don't have single byte characters >= 128

This change should not be MFCed until new collate will be
MFCed first, because our old EUC tables have some hacks for
missing codesets.

8 years ago[iwn] Don't try to seamlessly recover from a firmware panic; just restart
adrian [Sun, 3 Apr 2016 23:39:58 +0000 (23:39 +0000)]
[iwn] Don't try to seamlessly recover from a firmware panic; just restart
the interface.

I know this may be unpopular, but iwn is not yet completely ready for
a transparent firmware restart.  I have this thing panic my laptop
reliably because 11n state isn't kept in sync and the TX completion
path ends up trying to free a null node reference.

8 years agoMove i386/i386/autoconf.c to sys/x86/x86 and use it on both amd64 and i386.
jhb [Sun, 3 Apr 2016 23:03:54 +0000 (23:03 +0000)]
Move i386/i386/autoconf.c to sys/x86/x86 and use it on both amd64 and i386.

8 years agoAdd a timestamp variable to the environment. This is when the event
imp [Sun, 3 Apr 2016 20:29:21 +0000 (20:29 +0000)]
Add a timestamp variable to the environment. This is when the event
was read from the kernel by devd.

8 years agoMake $_ match the docs.
imp [Sun, 3 Apr 2016 20:29:14 +0000 (20:29 +0000)]
Make $_ match the docs.

8 years agochdone(): Prevent returning uninitialized scalar value.
pfg [Sun, 3 Apr 2016 16:38:15 +0000 (16:38 +0000)]
chdone(): Prevent returning uninitialized scalar value.

If there is an error different from ERESTART, there is some
chance that we may end up accessing an uninitialized value. This
doesn't seem likely/possible but initialize announce_buf[0],
just in case.

CID: 1006486

8 years agog_sched_destroy(): prevent return of uninitialized scalar variable.
pfg [Sun, 3 Apr 2016 16:25:51 +0000 (16:25 +0000)]
g_sched_destroy(): prevent return of uninitialized scalar variable.

For the !gsp case there some chance of returning an uninitialized
return value. Prevent that from happening by initializing the
error value.

CID: 1006421

8 years agoFix indentation oops.
pfg [Sun, 3 Apr 2016 14:40:54 +0000 (14:40 +0000)]
Fix indentation oops.

8 years agowpi, iwn: fix check in find_eeprom_channel()
avos [Sun, 3 Apr 2016 14:38:26 +0000 (14:38 +0000)]
wpi, iwn: fix check in find_eeprom_channel()

Return correct eeprom_chan structure pointer for 7, 8, 11 and 12 5Ghz
channels.

8 years agoPass through some new block device features.
mav [Sun, 3 Apr 2016 11:18:20 +0000 (11:18 +0000)]
Pass through some new block device features.

MFC after: 1 month

8 years agofix zfs set canmount=off on an unmounted filesystem
avg [Sun, 3 Apr 2016 07:42:13 +0000 (07:42 +0000)]
fix zfs set canmount=off on an unmounted filesystem

Previously this operation tried to unmount and remount children.
Also see https://www.illumos.org/issues/6428.

MFC after: 2 weeks
X-Needs-Upstreaming: illumos

8 years agozfs receive: -u can be ignored sometimes
avg [Sun, 3 Apr 2016 07:40:33 +0000 (07:40 +0000)]
zfs receive: -u can be ignored sometimes

When force-receiving a filesystem that was already mounted the re-created
filesystem is mounted despite -u flag.

Also see https://www.illumos.org/issues/6412.

PR: 204705
Tested by: Vladimir Krstulja <vlad-fbsd@acheronmedia.com>
MFC after: 2 weeks
X-Needs-Upstreaming: illumos

8 years agoMove Linux specific times tests up to guarantee the values are defined.
dchagin [Sun, 3 Apr 2016 06:33:16 +0000 (06:33 +0000)]
Move Linux specific times tests up to guarantee the values are defined.

CID: 1305178
Submitted by: pfg@
MFC after: 1 week

8 years agoImprove HDMI display detection by searching the CEA-861 extension block for
jmcneill [Sat, 2 Apr 2016 16:53:12 +0000 (16:53 +0000)]
Improve HDMI display detection by searching the CEA-861 extension block for
an HDMI vendor-specific data block (VSDB) containing the HDMI 24-bit IEEE
registration ID (0x000C03).

Approved by: gonzo (mentor)

8 years agoremove emulation of VFS_HOLD and VFS_RELE from opensolaris compat
avg [Sat, 2 Apr 2016 16:25:46 +0000 (16:25 +0000)]
remove emulation of VFS_HOLD and VFS_RELE from opensolaris compat

On FreeBSD VFS_HOLD/VN_RELE were mapped to MNT_REF/MNT_REL that
manipulate mnt_ref.  But the job of properly maintaining the reference
count is already automatically performed by insmntque(9) and
delmntque(9).  So, in effect all ZFS vnodes referenced the corresponding
mountpoint twice.

That was completely harmless, but we want to be very explicit about what
FreeBSD VFS APIs are used, because illumos VFS_HOLD and FreeBSD MNT_REF
provide quite different guarantees with respect to the held vfs_t /
mountpoint.  On illumos VFS_HOLD is sufficient to guarantee that
vfs_t.vfs_data stays valid.  On the other hand, on FreeBSD MNT_REF does
*not* provide the same guarantee about mnt_data.  We have to use
vfs_busy() to get that guarantee.

Thus, the calls to VFS_HOLD/VFS_RELE on vnode init and fini are removed.
VFS_HOLD calls are replaced with vfs_busy in the ioctl handlers.

And because vfs_busy has a richer interface that can not be dumbed down
in all cases it's better to explicitly use it rather than trying to mask
it behind VFS_HOLD.

This change fixes a panic that could result from a race between
zfs_umount() and zfs_ioc_rollback().  We observed a case where
zfsvfs_free() tried to destroy data that zfsvfs_teardown() was still
using.  That happened because there was nothing to prevent unmounting of
a ZFS filesystem that was in between zfs_suspend_fs() and
zfs_resume_fs().

Reviewed by: kib, smh
MFC after: 3 weeks
Sponsored by: ClusterHQ
Differential Revision: https://reviews.freebsd.org/D2794

8 years agoAdd configurable rate limit for "log" and "devctl" actions.
trasz [Sat, 2 Apr 2016 09:11:52 +0000 (09:11 +0000)]
Add configurable rate limit for "log" and "devctl" actions.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoMFV r297506: 6738 zfs send stream padding needs documentation
mav [Sat, 2 Apr 2016 08:36:24 +0000 (08:36 +0000)]
MFV r297506: 6738 zfs send stream padding needs documentation

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Eli Rosenthal <eli.rosenthal@delphix.com>

illumos/illumos-gate@c20404ff77119516354b0d112d28b7ea0dadd303

8 years agoMFV r297505:
mav [Sat, 2 Apr 2016 08:34:15 +0000 (08:34 +0000)]
MFV r297505:
6739 userland version of cv_timedwait_hires() always assumes absolute time

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>

illumos/illumos-gate@41c6413cb54bf338d7a59ed789ec2e0e44c35e6f

8 years agoMFV r297504: 6681 zfs list burning lots of time in dodefault() via dsl_prop_*
mav [Sat, 2 Apr 2016 08:28:46 +0000 (08:28 +0000)]
MFV r297504: 6681 zfs list burning lots of time in dodefault() via dsl_prop_*

Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Alex Wilson <alex.wilson@joyent.com>

illumos/illumos-gate@d09e4475f635b6f66ee68d8c17a32bba7be17c96

8 years agoOutput information about PCI-e devices with slots.
jhb [Sat, 2 Apr 2016 01:59:53 +0000 (01:59 +0000)]
Output information about PCI-e devices with slots.

In particular this includes additional information on HotPlug capable
slots.

8 years agoVarious updates to the PCI-express capability output.
jhb [Sat, 2 Apr 2016 01:55:43 +0000 (01:55 +0000)]
Various updates to the PCI-express capability output.

- Group the output so that it follows the capability register set more
  closely.  The first line now contains device information and the
  second line contains link information.  As a result, ARI status is now
  output on the first line, and the link width is moved down to the second
  line of link information.
- Only read the DEVICE_CAP2 register to check for ARI if the capability
  version is >= 2.
- Don't output any link information if the link capability and status
  registers are zero.
- Label the MSI interrupt index value as "MSI" instead of "IRQ".

8 years agoSmall typo.
pfg [Sat, 2 Apr 2016 01:14:51 +0000 (01:14 +0000)]
Small typo.

8 years agoFollow-up r297282: Make the COPTS warning more useful.
bdrewery [Fri, 1 Apr 2016 23:31:57 +0000 (23:31 +0000)]
Follow-up r297282: Make the COPTS warning more useful.

Sponsored by: EMC / Isilon Storage Division

8 years agoSet the chunk id for ERROR chunks.
tuexen [Fri, 1 Apr 2016 20:38:15 +0000 (20:38 +0000)]
Set the chunk id for ERROR chunks.
This is work with rrs@.
MFC after: 1 week

8 years agoMove support for Synopsys Designware APB UART out of ns8250 and into a
jmcneill [Fri, 1 Apr 2016 20:26:45 +0000 (20:26 +0000)]
Move support for Synopsys Designware APB UART out of ns8250 and into a
separate driver. Add support for activating clock and hwreset resources
for these devices when the EXT_RESOURCES option is present.

Reviewed by: andrew, mmel, Emmanuel Vadot <manu@bidouilliste.com>
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5749

8 years agoFix mismerge.
trasz [Fri, 1 Apr 2016 18:45:04 +0000 (18:45 +0000)]
Fix mismerge.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoDrop the 'resource' argument to racct_decay(); it wouldn't make sense
trasz [Fri, 1 Apr 2016 18:36:10 +0000 (18:36 +0000)]
Drop the 'resource' argument to racct_decay(); it wouldn't make sense
to iterate separately for each resource.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoCap IOSIZE_MAX to INT_MAX for 32-bit processes.
jhb [Fri, 1 Apr 2016 18:29:38 +0000 (18:29 +0000)]
Cap IOSIZE_MAX to INT_MAX for 32-bit processes.

Previously, freebsd32 binaries could submit read/write requests with lengths
greater than INT_MAX that a native kernel would have rejected.

Reviewed by: kib
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D5788

8 years agoCall rctl_enforce() in all cases the resource usage goes up, even when called
trasz [Fri, 1 Apr 2016 17:28:55 +0000 (17:28 +0000)]
Call rctl_enforce() in all cases the resource usage goes up, even when called
from racct_*_force() functions.  It makes the "log" and "devctl" actions work
in those cases.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoReorder the functions; no functional changes.
trasz [Fri, 1 Apr 2016 17:21:55 +0000 (17:21 +0000)]
Reorder the functions; no functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoReduce code duplication.
trasz [Fri, 1 Apr 2016 17:17:32 +0000 (17:17 +0000)]
Reduce code duplication.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoReduce code duplication. There should be no (intended) functional changes.
trasz [Fri, 1 Apr 2016 17:05:46 +0000 (17:05 +0000)]
Reduce code duplication.  There should be no (intended) functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoRepair a overflow condition where a user could submit a string that was
sbruno [Fri, 1 Apr 2016 16:16:26 +0000 (16:16 +0000)]
Repair a overflow condition where a user could submit a string that was
not getting a proper bounds check.

Thanks to CTurt for pointing at this with a big red blinking neon sign.

PR: 206761
Submitted by: sson
Reviewed by: cturt@hardenedbsd.org
MFC after: 3 days

8 years agoFix PowerPC LINT build after r297392
zbb [Fri, 1 Apr 2016 09:07:18 +0000 (09:07 +0000)]
Fix PowerPC LINT build after r297392

PowerPC has real Open Firmware and does not necessarily need FDT.
Make ofwpci.c only PCI dependent.

Pointed out by: emaste
Reviewed by: nwhitehorn
Obtained from: Semihalf

8 years agoStyle(9), use tabs for the #define LOOPS line.
kib [Fri, 1 Apr 2016 08:47:23 +0000 (08:47 +0000)]
Style(9), use tabs for the #define LOOPS line.
Print unsigned values with %u.
Make code slightly more compact by inlining loop limit.

Noted by: bde
Sponsored by: The FreeBSD Foundation

8 years agotcp/lro: Change SLIST to LIST, so that removing an entry is O(1)
sephe [Fri, 1 Apr 2016 06:43:05 +0000 (06:43 +0000)]
tcp/lro: Change SLIST to LIST, so that removing an entry is O(1)

This is kinda critical to the performance when the CPU is slow and
network bandwidth is high, e.g. in the hypervisor.

Reviewed by: rrs, gallatin, Dexuan Cui <decui microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5765

8 years agotcp/lro: Use tcp_lro_flush_all in device drivers to avoid code duplication
sephe [Fri, 1 Apr 2016 06:28:33 +0000 (06:28 +0000)]
tcp/lro: Use tcp_lro_flush_all in device drivers to avoid code duplication

And factor out tcp_lro_rx_done, which deduplicates the same logic with
netinet/tcp_lro.c

Reviewed by: gallatin (1st version), hps, zbb, np, Dexuan Cui <decui microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5725

8 years agohyperv: Register Hyper-V timer early enough for TSC freq calibration
sephe [Fri, 1 Apr 2016 06:17:57 +0000 (06:17 +0000)]
hyperv: Register Hyper-V timer early enough for TSC freq calibration

The i8254 simulation in Hyper-V is kinda broken and is not available
in Generation 2 Hyper-V VMs, so Hyper-V timer must be registered early
enough so that it can be used to do the TSC freq calibration.

This fixes the notorious warning like this:
calcru: runtime went backwards from 50 usec to 25 usec for pid 0 (kernel)

Submitted by: Dexuan Cui <decui microsoft com>
Reviewed by: kib, sephe
Tested by: kib, sephe
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5778

8 years agoUpdate comment: Linux does set a randomized generation number of an inode
kevlo [Fri, 1 Apr 2016 03:21:01 +0000 (03:21 +0000)]
Update comment: Linux does set a randomized generation number of an inode
on ext2/3/4.

While here use arc4random() instead of random().

Reviewed by: pfg
MFC after: 3 days

8 years agomtest: Prevent access to uninitialized value.
pfg [Fri, 1 Apr 2016 01:35:52 +0000 (01:35 +0000)]
mtest: Prevent access to uninitialized value.

case 'g' makes use of value n, which is initialized for case 'b'
and passe through to case 'g'. If case 'g' is called directly
value 'n' is not initialized.

Avoid the issue by initializing n before entering the switch.

CID: 1006375
Reviewed by: bms

8 years agoAdd a cross reference to ktrace(2).
brooks [Thu, 31 Mar 2016 23:57:03 +0000 (23:57 +0000)]
Add a cross reference to ktrace(2).

Obtained from: CheriBSD (9cb420d6b7f04c1b7d2006180b80932e5d3fe50e)
MFC after: 1 week
Sponsored by: DARPA, AFRL

8 years agoDocument KTRFAC_FAULT and KTRFAC_FAULTEND.
brooks [Thu, 31 Mar 2016 23:55:19 +0000 (23:55 +0000)]
Document KTRFAC_FAULT and KTRFAC_FAULTEND.

Obtained from: CheriBSD (9d70f563f1b033e6a9b51eaf3b145a8cbbc6617c)
MFC after: 1 week
Sponsored by: DARPA, AFRL

8 years agoCorrect error messages in recently added test.
jhb [Thu, 31 Mar 2016 21:25:40 +0000 (21:25 +0000)]
Correct error messages in recently added test.

The large read test uses an empty file created via mkstemp() rather than
/dev/null as character devices are subject to two different clamping
sysctls.  However, I forgot to update some of the error messages after
changing to mkstemp() that were still referring to /dev/null.

8 years agoFix an error in r292373. Use proper count to update "pages in" counter.
glebius [Thu, 31 Mar 2016 21:15:00 +0000 (21:15 +0000)]
Fix an error in r292373. Use proper count to update "pages in" counter.

Noticed by: pfg via Coverity

8 years agopci_emul_dior(): fix uninitialized scalar variable.
pfg [Thu, 31 Mar 2016 19:07:03 +0000 (19:07 +0000)]
pci_emul_dior(): fix uninitialized scalar variable.

Prevent from returning an unitialized value in case the
ior size is unknown.

CID: 1194319
Reviewed by: grehan

8 years agoCatch up with some more fields. I needed the bpf one lately.
bz [Thu, 31 Mar 2016 18:53:13 +0000 (18:53 +0000)]
Catch up with some more fields. I needed the bpf one lately.

Sponsored by: The FreeBSD Foundation

8 years agoMake Position Independent Executables work for CloudABI.
ed [Thu, 31 Mar 2016 18:52:00 +0000 (18:52 +0000)]
Make Position Independent Executables work for CloudABI.

- Set BI_CAN_EXEC_DYN, so we can execute ET_DYN ELF files in addition to
  regular ET_EXECs.
- Provide an AT_BASE entry in the auxiliary vector, so the executable
  knows at which address it got loaded and can apply relocations.

8 years agoRegenerate system call table after r297468.
ed [Thu, 31 Mar 2016 18:50:52 +0000 (18:50 +0000)]
Regenerate system call table after r297468.

8 years agoSync in the latest CloudABI system call definitions.
ed [Thu, 31 Mar 2016 18:50:06 +0000 (18:50 +0000)]
Sync in the latest CloudABI system call definitions.

Some time ago I made a change to merge together the memory scope
definitions used by mmap (MAP_{PRIVATE,SHARED}) and lock objects
(PTHREAD_PROCESS_{PRIVATE,SHARED}). Though that sounded pretty smart
back then, it's backfiring. In the case of mmap it's used with other
flags in a bitmask, but for locking it's an enumeration. As our plan is
to automatically generate bindings for other languages, that looks a bit
sloppy.

Change all of the locking functions to use separate flags instead.

Obtained from: https://github.com/NuxiNL/cloudabi

8 years agoRemove #ifdef's from various structures used in the cxgbe/cxl driver.
jhb [Thu, 31 Mar 2016 18:36:50 +0000 (18:36 +0000)]
Remove #ifdef's from various structures used in the cxgbe/cxl driver.

This provides a constant ABI and layout for these structures (especially
struct adapter) avoiding some foot shooting.

Discussed with: np
Sponsored by: Chelsio Communications

8 years agoRework handling of thread sleeps before timers are working.
jhb [Thu, 31 Mar 2016 18:10:29 +0000 (18:10 +0000)]
Rework handling of thread sleeps before timers are working.

Previously, calls to *sleep() and cv_*wait*() immediately returned during
early boot.  Instead, permit threads that request a sleep without a
timeout to sleep as wakeup() works during early boot.  Sleeps with
timeouts are harder to emulate without working timers, so just punt and
panic explicitly if any thread tries to use those before timers are
working.  Any threads that depend on timeouts should either wait until
SI_SUB_KICK_SCHEDULER to start or they should use DELAY() until timers
are available.

Until APs are started earlier this should be a no-op as other kthreads
shouldn't get a chance to start running until after timers are working
regardless of when they were created.

Reviewed by: kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D5724

8 years agoRefactor; no functional changes.
trasz [Thu, 31 Mar 2016 17:32:28 +0000 (17:32 +0000)]
Refactor; no functional changes.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoTidy up the unmapped I/O code in qphysio.
jhb [Thu, 31 Mar 2016 17:27:30 +0000 (17:27 +0000)]
Tidy up the unmapped I/O code in qphysio.

- Move some blocks around to reduce the number of 'if (unmap)' checks.
- Use 'pbuf == NULL' instead of 'unmap'.
- Use nitems.
- Pull an assignment out of an if expression.

Reviewed by: kib
Sponsored by: Chelsio Communications

8 years agoWITHOUT_TOOLCHAIN: Skip building of h_raw.
bdrewery [Thu, 31 Mar 2016 17:27:17 +0000 (17:27 +0000)]
WITHOUT_TOOLCHAIN: Skip building of h_raw.

-fsanitize does not seem to work when a --sysroot is specified and there
is no <sysroot>/usr/lib/clang/3.8.0/lib/freebsd/libclang_rt.ubsan_standalone-*.a.

Sponsored by: EMC / Isilon Storage Division

8 years agoLIB32+WITHOUT_TOOLCHAIN: Fix build by staging includes.
bdrewery [Thu, 31 Mar 2016 17:27:14 +0000 (17:27 +0000)]
LIB32+WITHOUT_TOOLCHAIN: Fix build by staging includes.

This is the same fix as r297281 for the normal build.

Sponsored by: EMC / Isilon Storage Division

8 years agoWITHOUT_TOOLCHAIN: Fix build of rtld.
bdrewery [Thu, 31 Mar 2016 17:27:01 +0000 (17:27 +0000)]
WITHOUT_TOOLCHAIN: Fix build of rtld.

MK_TOOLCHAIN==no disables building and installing of pic archives.
c_pic.a is still needed for rtld though so force it to build in lib/libc
and link directly to the objdir version of it for rtld.

Somehow this has been broken since r148725.

Sponsored by: EMC / Isilon Storage Division

8 years agoImprove comments.
trasz [Thu, 31 Mar 2016 17:15:03 +0000 (17:15 +0000)]
Improve comments.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoAdd wait_event_interruptible_timeout to linuxkpi.
np [Thu, 31 Mar 2016 17:11:58 +0000 (17:11 +0000)]
Add wait_event_interruptible_timeout to linuxkpi.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Reviewed by: hselasky@
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D5776

8 years agoFix overflows, making it impossible to add negative amounts using rctl(8).
trasz [Thu, 31 Mar 2016 17:00:47 +0000 (17:00 +0000)]
Fix overflows, making it impossible to add negative amounts using rctl(8).

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix number of the enabled VFs in VNIC
zbb [Thu, 31 Mar 2016 16:44:32 +0000 (16:44 +0000)]
Fix number of the enabled VFs in VNIC

nic->num_vf_en is set based on the number of the enabled LMACs.
This number should not be overwritten later by any routine.
Instead it should fail PCI_IOV_ADD_VF() so that available VFs
with the corresponding LMACs will attach whereas other, disabled
VFs will fail with the proper error code.
Error signaling (due to improper number of VFs requested) is also moved
from PCI_IOV_INIT() to PCI_IOV_ADD_VF().

This will be reworked when multiple queue sets are enabled but for
now this is the correct behavior of the driver.

Obtained from: Semihalf
Sponsored by:  Cavium

8 years agoWe don't support DPLIBS.
bdrewery [Thu, 31 Mar 2016 16:09:59 +0000 (16:09 +0000)]
We don't support DPLIBS.

Sponsored by: EMC / Isilon Storage Division