]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

8 years agoFix minor problems caught by mandoc -Tlint.
brueffer [Thu, 31 Mar 2016 15:16:22 +0000 (15:16 +0000)]
Fix minor problems caught by mandoc -Tlint.

8 years agoDefine OBJTOP earlier if possible for use in targets.
bdrewery [Thu, 31 Mar 2016 14:48:17 +0000 (14:48 +0000)]
Define OBJTOP earlier if possible for use in targets.

Sponsored by: EMC / Isilon Storage Division

8 years agoDon't omit m_dup() for non-writeable mbufs that need checksum calculation
zbb [Thu, 31 Mar 2016 13:23:43 +0000 (13:23 +0000)]
Don't omit m_dup() for non-writeable mbufs that need checksum calculation

If the driver is not active or link is down the packet could remain
non-writeable. This commit makes all mbufs enqueued to the driver's
ring buffer to have correct attributes.

Pointed out by: wma
Reviewed by:    wma
Obtained from:  Semihalf
Sponsored by:   Cavium
Differential Revision: https://reviews.freebsd.org/D5800

8 years agoRemove NULL checks after M_WAITOK allocations, which - by definition - can
trasz [Thu, 31 Mar 2016 13:20:02 +0000 (13:20 +0000)]
Remove NULL checks after M_WAITOK allocations, which - by definition - can
never return NULL.

Reviewed by: arybchik@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5773

8 years agoFix MAC address configuration for VNIC
zbb [Thu, 31 Mar 2016 13:13:38 +0000 (13:13 +0000)]
Fix MAC address configuration for VNIC

The FDT description is as follows:
- phy-handle, reg, qlm-mode, mac-address are under nodes in bgx0/1 node
- phy nodes (pointed by phy-handle) are under MDIO even though they may
  not be connected through to MDIO. In those nodes they do not contain
  MAC address or etc.

This commit changes parsing of the FDT nodes for BGX so that it can
obtain correct MAC address for a given PHY.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5781

8 years agoImprove TX path of the VNIC driver
zbb [Thu, 31 Mar 2016 13:10:29 +0000 (13:10 +0000)]
Improve TX path of the VNIC driver

- Avoid memory leak when nicvf_tx_mbuf_locked() fails
- Introduce nicvf_xmit_locked() routine that uses drbr_peek(),
  drbr_advance() or drbr_putback() for a specific ifnet.
  This gives more clear and efficient design as well as
  prevents from dropping mbufs that where not sent due to temporary
  lack of descriptors.
- Add missing ETHER_BPF_MTAP() hook

Pointed out by: yongari
Reviewed by:    wma
Obtained from:  Semihalf
Sponsored by:   Cavium
Differential Revision: https://reviews.freebsd.org/D5534

8 years agoFix whois queries for ARIN AS numbers.
fanf [Thu, 31 Mar 2016 12:13:01 +0000 (12:13 +0000)]
Fix whois queries for ARIN AS numbers.

The ARIN whois server likes AS number queries to be in the form
"a 8075" rather than "as7085".

8 years agoFix typo in the VNIC's PF function name
zbb [Thu, 31 Mar 2016 12:10:17 +0000 (12:10 +0000)]
Fix typo in the VNIC's PF function name

Should be add_vf not addr_vf.

8 years agoDisable MSI-x for AHCI on Alpine plattform
zbb [Thu, 31 Mar 2016 11:18:52 +0000 (11:18 +0000)]
Disable MSI-x for AHCI on Alpine plattform

Changes introduced to AHCI code adding support for MSI-x
caused interrupt storm on Alpine boards.
This is unintended behaviour so added quirk to omit this functionality.

Reviewed by:   mav
Submitted by:  Marcin Mazurek <mma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Annapurna Labs
Differential Revision: https://reviews.freebsd.org/D4301

8 years agoAdd support for 4 level pagetables. The userland address space has been
andrew [Thu, 31 Mar 2016 11:07:24 +0000 (11:07 +0000)]
Add support for 4 level pagetables. The userland address space has been
increased to 256TiB. The kernel address space can also be increased to be
the same size, but this will be performed in a later change.

To help work with an extra level of page tables two new functions have
been added, one to file the lowest level table entry, and one to find the
block/page level. Both of these find the entry for a given pmap and virtual
address.

This has been tested with a combination of buildworld, stress2 tests, and
by using sort to consume a large amount of memory by sorting /dev/zero. No
new issues are known to be present from this change.

Reviewed by: kib
Obtained from: ABT Systems Ltd
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5720

8 years agoFix bugs in currently unused bit searching loop.
hselasky [Thu, 31 Mar 2016 06:19:15 +0000 (06:19 +0000)]
Fix bugs in currently unused bit searching loop.

MFC after: 3 days
Sponsored by: Mellanox Technologies

8 years agoAdd support for the Nuvoton NCT5104D.
adrian [Thu, 31 Mar 2016 04:57:38 +0000 (04:57 +0000)]
Add support for the Nuvoton NCT5104D.

Make it compile only for i386/amd64 for now as it's been tested there.
It's quite possible it'll show up elsewhere and we can enable it
for other architectures later.

Tested:

* PC Engines APU1C4

Submitted by: Daniel Wyatt <daniel@dewyatt.com>
Reviewed by: adrian, loos
Differential Revision: https://reviews.freebsd.org/D5389

8 years agohosttools: Trim unneeded directories.
bdrewery [Thu, 31 Mar 2016 03:04:26 +0000 (03:04 +0000)]
hosttools: Trim unneeded directories.

These should only be build tools that are in various Makefile.depend
as host dependencies.  Anything toolchain related is handled by
toolchain and bootstrap-tools currently.

Sponsored by: EMC / Isilon Storage Division

8 years agorestore(8): fix use of uninitialized value.
pfg [Thu, 31 Mar 2016 02:01:11 +0000 (02:01 +0000)]
restore(8): fix use of uninitialized value.

Prevent uninitialized use of scalar newvol when jumping to gethdr.

CID: 1006491

8 years agoUnbreak the RSS/PCBGROUp build.
gnn [Thu, 31 Mar 2016 00:53:23 +0000 (00:53 +0000)]
Unbreak the RSS/PCBGROUp build.

8 years agoDIRDEPS_BUILD: Don't reset OBJROOT in sub-makes.
bdrewery [Thu, 31 Mar 2016 00:26:40 +0000 (00:26 +0000)]
DIRDEPS_BUILD: Don't reset OBJROOT in sub-makes.

MAKEOBJDIRPREFIX is set to blank and exported from MAKELEVEL0 along
with OBJROOT exported.  In sub-makes OBJROOT is recalculated with
an empty MAKEOBJDIRPREFIX though.

Sponsored by: EMC / Isilon Storage Division

8 years agoRegenerate
bdrewery [Wed, 30 Mar 2016 23:56:43 +0000 (23:56 +0000)]
Regenerate

8 years agoRemove FAST_DEPEND reference missed in r297434.
bdrewery [Wed, 30 Mar 2016 23:53:12 +0000 (23:53 +0000)]
Remove FAST_DEPEND reference missed in r297434.

8 years agoFix the external GCC build after r297271 by setting -L <sysroot>/usr/lib.
bdrewery [Wed, 30 Mar 2016 23:50:29 +0000 (23:50 +0000)]
Fix the external GCC build after r297271 by setting -L <sysroot>/usr/lib.

GCC does add <sysroot>/usr/lib to the library search path but it comes after
/usr/local/lib which can find ports libraries such as libedit.so.  The
bad path comes in as /usr/local/lib/gcc/x86_64-portbld-freebsd11.0/5.3.0/../../../
which corresponds to <prefix>/lib.

This partially reverts r297271.

Pointyhat to: bdrewery
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove the old depend (mkdep) code and make FAST_DEPEND the one true way.
bdrewery [Wed, 30 Mar 2016 23:50:23 +0000 (23:50 +0000)]
Remove the old depend (mkdep) code and make FAST_DEPEND the one true way.

Reviewed by: emaste, hselasky (partial), brooks (brief)
Discussed on: arch@
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5742

8 years agoshow-valid-targets: Indent each target 2 spaces.
bdrewery [Wed, 30 Mar 2016 22:26:14 +0000 (22:26 +0000)]
show-valid-targets: Indent each target 2 spaces.

Sponsored by: EMC / Isilon Storage Division

8 years agoRemove redundant code imported into dirdeps.mk in r290956.
bdrewery [Wed, 30 Mar 2016 21:31:34 +0000 (21:31 +0000)]
Remove redundant code imported into dirdeps.mk in r290956.

Sponsored by: EMC / Isilon Storage Division