]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agointpm.4 update supported hardware list
avg [Thu, 8 Sep 2016 12:07:25 +0000 (12:07 +0000)]
intpm.4 update supported hardware list

MFC after: 1 week

7 years agoIn dqsync(), when called from quotactl(), um_quotas entry might appear
kib [Thu, 8 Sep 2016 12:06:43 +0000 (12:06 +0000)]
In dqsync(), when called from quotactl(), um_quotas entry might appear
cleared since nothing prevents completion of the parallel quotaoff.
There is nothing to sync in this case, and no reason to panic.

Reported and tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoIn softdep_prealloc(), return early not only for snapshots, but for
kib [Thu, 8 Sep 2016 12:05:13 +0000 (12:05 +0000)]
In softdep_prealloc(), return early not only for snapshots, but for
the quota files as well.

Reported and tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoThere is no need to upgrade the last dvp lock on lookups for modifying
kib [Thu, 8 Sep 2016 12:04:45 +0000 (12:04 +0000)]
There is no need to upgrade the last dvp lock on lookups for modifying
operations.  Instead of upgrading, assert that the lock is exclusive.
Explain the cause in comments.

This effectively reverts r209367.

Tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoPartially lift suspension when ffs_reload() finished with cgs and
kib [Thu, 8 Sep 2016 12:01:28 +0000 (12:01 +0000)]
Partially lift suspension when ffs_reload() finished with cgs and
going to re-read inodes.

Secondary write initiators, e.g. ufs_inactive(), might need to start a
write while owning the vnode lock.  Since the suspended state
established by /dev/ufssuspend prevents them from entering
vn_start_secondary_write(), we get deadlock otherwise.

Note that it is arguably not very useful to re-read inodes after
/dev/ufssuspend suspension, because the suspension does not block
readers, and other threads might read existing files in parallel with
suspension owner (for now, only growfs(8)) operations.  This
effectively means that suspension owner cannot safely modify existing
inodes, and then there is no sense in re-reading.  But keep the code
enabled for now.

Reported and tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoDecode ATA Status Return descriptor.
mav [Thu, 8 Sep 2016 12:00:02 +0000 (12:00 +0000)]
Decode ATA Status Return descriptor.

MFC after: 2 weeks

7 years agoCorrectly map the USB mouse tilt delta values into buttons 5 and 6
hselasky [Thu, 8 Sep 2016 10:10:05 +0000 (10:10 +0000)]
Correctly map the USB mouse tilt delta values into buttons 5 and 6
instead of 3 and 4 which is used for the scroll wheel, according to
X.org.

PR: 170358
MFC after: 1 week

7 years agopxeboot: Add nfs.read_size tunable.
sephe [Thu, 8 Sep 2016 09:11:13 +0000 (09:11 +0000)]
pxeboot: Add nfs.read_size tunable.

Increase this tunable improves kernel loading speed.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: rpokala, wblock (previous version)
Obtained from: DragonFlyBSD
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7756

7 years agohyperv/hn: Factor out NVS NDIS initialization
sephe [Thu, 8 Sep 2016 07:45:20 +0000 (07:45 +0000)]
hyperv/hn: Factor out NVS NDIS initialization

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7811

7 years agohyperv/hn: Function renaming.
sephe [Thu, 8 Sep 2016 07:34:31 +0000 (07:34 +0000)]
hyperv/hn: Function renaming.

While I'm here, remove obvious comment.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7810

7 years agohyperv/kvp: Fix IPv4/IPv6 address injection support.
sephe [Thu, 8 Sep 2016 07:16:56 +0000 (07:16 +0000)]
hyperv/kvp: Fix IPv4/IPv6 address injection support.

The GUID string provided by hypervisor has leading and trailing braces,
while our GUID string does not have braces at all.  Both braces should
be ignored, when the GUID strings are compared.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
Modified by: sephe
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7809

7 years agohyperv/hn: Pass MTU around.
sephe [Thu, 8 Sep 2016 06:42:30 +0000 (06:42 +0000)]
hyperv/hn: Pass MTU around.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7808

7 years agohyperv/hn: Factor out function to do NVS initialization.
sephe [Thu, 8 Sep 2016 06:23:08 +0000 (06:23 +0000)]
hyperv/hn: Factor out function to do NVS initialization.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7807

7 years agohyperv/hn: Push RXBUF size adjustment down.
sephe [Thu, 8 Sep 2016 06:06:54 +0000 (06:06 +0000)]
hyperv/hn: Push RXBUF size adjustment down.

It is not used in other places.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7806

7 years agohyperv/hn: Pull vmbus channel open up.
sephe [Thu, 8 Sep 2016 05:27:43 +0000 (05:27 +0000)]
hyperv/hn: Pull vmbus channel open up.

While I'm here, pull up the channel callback related code too.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7805

7 years agoFix typo in skein amd64 assembly
allanjude [Thu, 8 Sep 2016 02:38:55 +0000 (02:38 +0000)]
Fix typo in skein amd64 assembly

Sponsored by: ScaleEngine Inc.

7 years agoIn m_devget(), if the data fits in a packet header mbuf, check the amount
kevlo [Thu, 8 Sep 2016 01:02:53 +0000 (01:02 +0000)]
In m_devget(), if the data fits in a packet header mbuf, check the amount
of data is less than or equal to MHLEN instead of MLEN when placing initial
small packet header at end of mbuf.

Reviewed by: glebius
MFC after: 3 days

7 years agoRemove a pointless translation of struct ioc_toc_header.
brooks [Thu, 8 Sep 2016 00:38:50 +0000 (00:38 +0000)]
Remove a pointless translation of struct ioc_toc_header.

struct ioc_toc_header will be the same size (and thus IOREADTOCHEADER
will have the same value on all supported platforms).

Sponsored by: DARPA, AFRL

7 years agoFix an obvious typo.
jkim [Wed, 7 Sep 2016 23:37:10 +0000 (23:37 +0000)]
Fix an obvious typo.

7 years agoSuffix short month names with "월" and replace %b with %_m for date formats.
jkim [Wed, 7 Sep 2016 23:35:38 +0000 (23:35 +0000)]
Suffix short month names with "월" and replace %b with %_m for date formats.
This change is analogous to r199179, r199271, and r289041 for japanese and
chinese locales.

7 years agoMFV r305562: 7259 DS_FIELD_LARGE_BLOCKS is unused
mav [Wed, 7 Sep 2016 20:09:24 +0000 (20:09 +0000)]
MFV r305562: 7259 DS_FIELD_LARGE_BLOCKS is unused

The DS_FIELD_LARGE_BLOCKS macro has been unused since the integration of
this patch:

    commit ca0cc3918a1789fa839194af2a9245f801a06b1a
    Author: Matthew Ahrens <mahrens@delphix.com>
    Date:   Fri Jul 24 09:53:55 2015 -0700

        5959 clean up per-dataset feature count code
        Reviewed by: Toomas Soome <tsoome@me.com>
        Reviewed by: George Wilson <george@delphix.com>
        Reviewed by: Alex Reece <alex@delphix.com>
        Approved by: Richard Lowe <richlowe@richlowe.net>

This patch simply removes this macro from dsl_dataset.h.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Author: Matthew Ahrens <mahrens@delphix.com>

7 years agoMFV r305560: 7278 tuning zfs_arc_max does not impact arc_c_min
mav [Wed, 7 Sep 2016 20:05:10 +0000 (20:05 +0000)]
MFV r305560: 7278 tuning zfs_arc_max does not impact arc_c_min

When changing zfs_arc_max (e.g. as zdb does), it may be set to less
than the default arc_c_min. arc_c_min should decrease to not be more than
arc_c_max, but it doesn't; therefore tuning of arc_c_max is ineffective.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@608764beadaf4bb71c5d8fe1818e8392ac66a61b

7 years agoChelsio T4/T5 VF driver.
jhb [Wed, 7 Sep 2016 18:13:57 +0000 (18:13 +0000)]
Chelsio T4/T5 VF driver.

The cxgbev/cxlv driver supports Virtual Function devices for Chelsio
T4 and T4 adapters.  The VF devices share most of their code with the
existing PF4 driver (cxgbe/cxl) and as such the VF device driver
currently depends on the PF4 driver.

Similar to the cxgbe/cxl drivers, the VF driver includes a t4vf/t5vf
PCI device driver that attaches to the VF device.  It then creates
child cxgbev/cxlv devices representing ports assigned to the VF.
By default, the PF driver assigns a single port to each VF.

t4vf_hw.c contains VF-specific routines from the shared code used to
fetch VF-specific parameters from the firmware.

t4_vf.c contains the VF-specific PCI device driver and includes its
own attach routine.

VF devices are required to use a different firmware request when
transmitting packets (which in turn requires a different CPL message
to encapsulate messages).  This alternate firmware request does not
permit chaining multiple packets in a single message, so each packet
results in a firmware request.  In addition, the different CPL message
requires more detailed information when enabling hardware checksums,
so parse_pkt() on VF devices must examine L2 and L3 headers for all
packets (not just TSO packets) for VF devices.  Finally, L2 checksums
on non-UDP/non-TCP packets do not work reliably (the firmware trashes
the IPv4 fragment field), so IPv4 checksums for such packets are
calculated in software.

Most of the other changes in the non-VF-specific code are to expose
various variables and functions private to the PF driver so that they
can be used by the VF driver.

Note that a limited subset of cxgbetool functions are supported on VF
devices including register dumps, scheduler classes, and clearing of
statistics.  In addition, TOE is not supported on VF devices, only for
the PF interfaces.

Reviewed by: np
MFC after: 2 months
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7599

7 years agoDon't break out of the m_advance() loop if len drops to zero.
jhb [Wed, 7 Sep 2016 18:08:43 +0000 (18:08 +0000)]
Don't break out of the m_advance() loop if len drops to zero.

If a packet contains the Ethernet header (14 bytes) in the first mbuf
and the payload (IP + UDP + data) in the second mbuf, then the attempt
to fetch the l3hdr will return a NULL pointer.  The first loop iteration
will drop len to zero and exit the loop without setting 'p'.  However,
the desired data is at the start of the second mbuf, so the correct
behavior is to loop around and let the conditional set 'p' to m_data of
the next mbuf (and leave offset as 0).

Reviewed by: np
Sponsored by: Chelsio Communications

7 years agoWhen synchronising the instruction and data caches we only need to clean
andrew [Wed, 7 Sep 2016 16:46:54 +0000 (16:46 +0000)]
When synchronising the instruction and data caches we only need to clean
the data cache to the point of unification. This is the point where the
two caches are unified to a single unified cache so cleaning past here
is just extra unneeded work.

This was noticed when investigating r305545.

Reported by: bz
Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agoOnly call cpu_icache_sync_range when inserting an executable page. If the
andrew [Wed, 7 Sep 2016 16:22:05 +0000 (16:22 +0000)]
Only call cpu_icache_sync_range when inserting an executable page. If the
page is non-executable the contents of the i-cache are unimportant so this
call is just adding unneeded overhead when inserting pages.

While doing research using gem5 with an O3 pipeline and 1k/32k/1M iTLB/L1
iCache/L2 Bjoern Zeeb (bz@) observed a fairly high rate of calls into
arm64_icache_sync_range() from pmap_enter() along with a high number of
instruction fetches and iTLB/iCache hits.

Limiting the calls to arm64_icache_sync_range() to only executable pages,
we observe the iTLB and iCache Hit going down by about 43%. These numbers
are quite misleading when looked at alone as at the same time instructions
retired were reduced by 19.2% and instruction fetches were reduced by 38.8%.
Overall this reduced the runtime of the test program by 22.4%.

On Juno hardware, in steady-state, running the same test, using the cycle
count to determine runtime, we do see a reduction of up to 28.9% in runtime.

While these numbers certainly depend on the program executed, we expect an
overall performance improvement.

Reported by: bz
Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agorum: fix possible panic on device detach (similar to r302034).
avos [Wed, 7 Sep 2016 16:19:20 +0000 (16:19 +0000)]
rum: fix possible panic on device detach (similar to r302034).

Tested with WUSB54GC, STA/AP modes.

7 years agoo Update QEMU device tree.
br [Wed, 7 Sep 2016 15:48:44 +0000 (15:48 +0000)]
o Update QEMU device tree.

QEMU was updated to privileged architecture v1.9
and we now fully support it.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agowork around AMD erratum 793 for family 16h, models 00h-0Fh
avg [Wed, 7 Sep 2016 14:24:29 +0000 (14:24 +0000)]
work around AMD erratum 793 for family 16h, models 00h-0Fh

7 years agoFix channel initialization in FBS mode.
mav [Wed, 7 Sep 2016 13:51:34 +0000 (13:51 +0000)]
Fix channel initialization in FBS mode.

Due to reading initialized variable, FIS receive area was always allocated
as 256 bytes, suitable for command-based switching, instead of 4096 bytes,
required for FIS-based switching.  This caused memory corruption in case of
port multipliers used on FBS-capable HBAs (Marvell).

MFC after: 1 week

7 years agoamdsbwd: add support for FCH in family 16h models 30h-3Fh processors
avg [Wed, 7 Sep 2016 13:45:35 +0000 (13:45 +0000)]
amdsbwd: add support for FCH in family 16h models 30h-3Fh processors

Requested by: Mike Tancsa <mike@sentex.net>
Tested by: Mike Tancsa <mike@sentex.net>
MFC after: 1 week

7 years agorum: use mgmt frame rate for EAPOL frames.
avos [Wed, 7 Sep 2016 12:07:02 +0000 (12:07 +0000)]
rum: use mgmt frame rate for EAPOL frames.

7 years agoFix MIPS INTRNG (both FDT and non-FDT) behaviour broken by r304459
sgalabov [Wed, 7 Sep 2016 09:31:10 +0000 (09:31 +0000)]
Fix MIPS INTRNG (both FDT and non-FDT) behaviour broken by r304459

More changes to MIPS may be required, as commented in D7692, but this
revision aims to restore MIPS INTRNG functionality so we can move on
with working interrupts.

Reported by: yamori813@yahoo.co.jp
Tested by: mizhka (on BCM), sgalabov (on Mediatek)
Reviewed by: adrian, nwhitehorn (older version)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D7692

7 years agohyperv/hn: Nuke unused bits
sephe [Wed, 7 Sep 2016 09:20:58 +0000 (09:20 +0000)]
hyperv/hn: Nuke unused bits

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7795

7 years agohyperv/hn: Simplify per-packet-info construction.
sephe [Wed, 7 Sep 2016 06:02:29 +0000 (06:02 +0000)]
hyperv/hn: Simplify per-packet-info construction.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7794

7 years agohyperv/hn: Cleanup RNDIS packet message encapsulation.
sephe [Wed, 7 Sep 2016 05:41:01 +0000 (05:41 +0000)]
hyperv/hn: Cleanup RNDIS packet message encapsulation.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7793

7 years agoRemove messy machdep code for Alpine V1 and use proper drivers instead
wma [Wed, 7 Sep 2016 05:36:55 +0000 (05:36 +0000)]
Remove messy machdep code for Alpine V1 and use proper drivers instead

Let drivers for Alpine CCU, NB and Serdes take care of internal SoC configuration.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           imp,wma
Differential Revision: https://reviews.freebsd.org/D7566

7 years agoIntroduce support for Annapurna Alpine CCU and NB devices
wma [Wed, 7 Sep 2016 05:34:41 +0000 (05:34 +0000)]
Introduce support for Annapurna Alpine CCU and NB devices

This commit adds drivers for Alpine Cache Coherency Unit
and North Bridge Service whose task is to configure
the system fabric and enable cache coherency.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7565

7 years agohyperv/hn: Avoid bit fields for TXCSUM setup.
sephe [Wed, 7 Sep 2016 05:27:43 +0000 (05:27 +0000)]
hyperv/hn: Avoid bit fields for TXCSUM setup.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7792

7 years agoDisable the qoriq errata fix for now
jhibbits [Wed, 7 Sep 2016 04:13:28 +0000 (04:13 +0000)]
Disable the qoriq errata fix for now

It hangs more often than it actually works it seems.  Further debugging is
needed to determine why, but for now the system needs to be able to boot.

7 years agoAllow pmap_early_io_unmap() to reclaim memory
jhibbits [Wed, 7 Sep 2016 03:26:55 +0000 (03:26 +0000)]
Allow pmap_early_io_unmap() to reclaim memory

pmap_early_io_map()/pmap_early_io_unmap(), if used in pairs, should be used in
the form:

pmap_early_io_map()
..do stuff..
pmap_early_io_unmap()

Without other allocations in the middle.  Without reclaiming memory this can
leave large holes in the device space.

While here, make a simple change to the unmap loop which now permits it to unmap
multiple TLB entries in the range.

7 years agoRemove extra period from kern.vt.kbd_reboot
kevlo [Wed, 7 Sep 2016 02:45:09 +0000 (02:45 +0000)]
Remove extra period from kern.vt.kbd_reboot

7 years agoAdd support for Allwinner A83T CPU frequency scaling.
jmcneill [Wed, 7 Sep 2016 01:10:16 +0000 (01:10 +0000)]
Add support for Allwinner A83T CPU frequency scaling.

7 years agoAttach later so axp81x attaches after aw_nmi.
jmcneill [Wed, 7 Sep 2016 01:09:25 +0000 (01:09 +0000)]
Attach later so axp81x attaches after aw_nmi.

7 years agoDon't treat an error from g_mirror_clear_metadata() as fatal.
markj [Tue, 6 Sep 2016 23:42:59 +0000 (23:42 +0000)]
Don't treat an error from g_mirror_clear_metadata() as fatal.

Such errors can occur as the result of a write error or because the disk
backing the mirror element was removed. They result in a generation ID bump
on all active elements of the mirror, so we can safely disconnect the mirror
component rather than destroy it.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7750

7 years agoAdd some fail points to gmirror.
markj [Tue, 6 Sep 2016 23:35:48 +0000 (23:35 +0000)]
Add some fail points to gmirror.

These are useful for testing changes to I/O error handling, and for
reproducing existing bugs in a controlled manner. The fail points are

    g_mirror_regular_request_read
    g_mirror_regular_request_write
    g_mirror_sync_request_read
    g_mirror_sync_request_write
    g_mirror_metadata_write

They all effectively allow one to inject an error value into the bio_error
field of a corresponding BIO request as it is being completed.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

7 years agoDisable vt(4) by default on sparc64 as creator_vt(4) and vt_ofwfb(4)
marius [Tue, 6 Sep 2016 22:18:08 +0000 (22:18 +0000)]
Disable vt(4) by default on sparc64 as creator_vt(4) and vt_ofwfb(4)
have the serious problem of not actually attaching the hardware they
are driving at the bus level. This causes creator(4) and machfb(4)
to attach and drive the very same hardware in parallel when both
syscons(4) and vt(4) as well as their associated hardware drivers
are built into a kernel, i. e. GENERIC, at the same time.
Also, syscons(4) and its drivers still are way superior to vt(4) and
its equivalents; unlike the syscons(4) counterparts the vt(4) drivers
don't provide hardware acceleration resulting in considerably slower
screen drawing, creator_vt(4) doesn't provide a /dev/fb node as
required by the Xorg sunffb(4) etc. In theory, vt_ofwfb(4) should be
able to handle more devices than machfb(4). However, testing shows
that it hardly works with any hardware machfb(4) isn't also able to
drive, making vt(4) and vt_ofwfb(4) not favorable for the time being
from that perspective either.

MFC after: 3 days

7 years agoModernize the initalization of sigproptbl.
brooks [Tue, 6 Sep 2016 22:03:53 +0000 (22:03 +0000)]
Modernize the initalization of sigproptbl.

Use C99 designators to set the value of each slot and the nitems macro to
check for valid entries. In the process, switch to indexing by signal
number rather than signal-1 for improved clarity.

Obtained from: CheriBSD (a6053c5abf03a5f53bbfcdd3a26429383f67e09f)
Sponsored by: DARPA, AFRL
Reviewed by: kib

7 years agoAdd generic device-tree cpufreq driver.
jmcneill [Tue, 6 Sep 2016 21:36:20 +0000 (21:36 +0000)]
Add generic device-tree cpufreq driver.

7 years agonullfs: stop special-casing directories in null_vptocnp
mjg [Tue, 6 Sep 2016 21:22:03 +0000 (21:22 +0000)]
nullfs: stop special-casing directories in null_vptocnp

The previous code was forcing an expensive walk in vop_stdvptocnp,
which was causing performance issues on highly contended zfs.

No objections: kib
MFC after: 2 weeks

7 years agoAdd generic device-tree cpufreq driver.
jmcneill [Tue, 6 Sep 2016 21:18:14 +0000 (21:18 +0000)]
Add generic device-tree cpufreq driver.

7 years agoReset PCI pass through devices via PCI-e FLR during VM start and end.
jhb [Tue, 6 Sep 2016 21:15:35 +0000 (21:15 +0000)]
Reset PCI pass through devices via PCI-e FLR during VM start and end.

Add routines to trigger a function level reset (FLR) of a PCI-express
device via the PCI-express device control register.  This also includes
support routines to wait for pending transactions to complete as well
as calculating the maximum completion timeout permitted by a device.

Change the ppt(4) driver to reset pass through devices before attaching
to a VM during startup and before detaching from a VM during shutdown.

Reviewed by: imp, wblock (earlier version)
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7751

7 years agoAdd "pci" as a dependency to ichss.
jmcneill [Tue, 6 Sep 2016 21:01:38 +0000 (21:01 +0000)]
Add "pci" as a dependency to ichss.

Reviewed by: jhibbits

7 years agoAdd generic device-tree cpufreq driver.
jmcneill [Tue, 6 Sep 2016 20:43:26 +0000 (20:43 +0000)]
Add generic device-tree cpufreq driver.

This driver supports two bindings:
 - cpufreq-dt: systems which share clock and voltage across all CPUs
 - arm_big_little_dt: systems which share clock and voltage across all
   CPUs in a single cluster

Reviewed by: andrew, imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D7741

7 years agoUpdate the I/O MMU in bhyve when PCI devices are added and removed.
jhb [Tue, 6 Sep 2016 20:17:54 +0000 (20:17 +0000)]
Update the I/O MMU in bhyve when PCI devices are added and removed.

When the I/O MMU is active in bhyve, all PCI devices need valid entries
in the DMAR context tables. The I/O MMU code does a single enumeration
of the available PCI devices during initialization to add all existing
devices to a domain representing the host. The ppt(4) driver then moves
pass through devices in and out of domains for virtual machines as needed.
However, when new PCI devices were added at runtime either via SR-IOV or
HotPlug, the I/O MMU tables were not updated.

This change adds a new set of EVENTHANDLERS that are invoked when PCI
devices are added and deleted. The I/O MMU driver in bhyve installs
handlers for these events which it uses to add and remove devices to
the "host" domain.

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7667

7 years agoLet knlist_add do the locking part
gonzo [Tue, 6 Sep 2016 19:36:28 +0000 (19:36 +0000)]
Let knlist_add do the locking part

Remove explicit mtx_lock/mtx_unlock around knlist_add and pass 0 as
locked parameter so knlist_add does the locking itself

Suggested by: kib@

7 years agoRemove remnants of PERFMON and I586_PMC_GUPROF from amd64.
jhb [Tue, 6 Sep 2016 19:25:32 +0000 (19:25 +0000)]
Remove remnants of PERFMON and I586_PMC_GUPROF from amd64.

These options were never fully ported over from i386.

7 years agobspatch: add sanity checks on sizes to avoid integer overflow
emaste [Tue, 6 Sep 2016 19:00:37 +0000 (19:00 +0000)]
bspatch: add sanity checks on sizes to avoid integer overflow

Note that this introduces an explicit 2GB limit, but this was already
implicit in variable and function argument types.

This is based on the "non-cryptanalytic attacks against freebsd
update components" anonymous gist. Further refinement is planned.

Reviewed by: allanjude, cem, kib
Obtained from: anonymous gist
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7619

7 years agoLeave ppt devices in the host domain when they are not attached to a VM.
jhb [Tue, 6 Sep 2016 18:53:17 +0000 (18:53 +0000)]
Leave ppt devices in the host domain when they are not attached to a VM.

This allows a pass through device to be reset to a normal device driver
on the host and reused on the host.  ppt devices are now always active in
some I/O MMU domain when the I/O MMU is active, either the host domain
or the domain of a VM they are attached to.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7666

7 years agoloader.efi: Bump the staging size to 64M.
will [Tue, 6 Sep 2016 17:58:58 +0000 (17:58 +0000)]
loader.efi: Bump the staging size to 64M.

This is required on my system, which loads nvidia, vmm, and zfs, and 48M is
no longer enough for that.  nvidia-driver's recent update increased its size
by several megabytes.

Reviewed by: jhb
MFC after: 1 week

7 years agoFix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper
ngie [Tue, 6 Sep 2016 17:22:25 +0000 (17:22 +0000)]
Fix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper
format specifier for pointers when printing them out with printf(3)

MFC after: 57 days
Pointyhat to: ngie
Reported by: bz, cy, Jenkins (i386 job)
Submitted by: cy
Sponsored by: EMC / Isilon Storage Division

7 years agocv: do a lockless check for no waiters in cv_signal and cv_broadcastpri
mjg [Tue, 6 Sep 2016 17:16:59 +0000 (17:16 +0000)]
cv: do a lockless check for no waiters in cv_signal and cv_broadcastpri

In case of some consumers like zfs there are no waiters vast majority of
the time

Reviewed by: jhb
MFC after: 1 week

7 years agoRenumber the advertising clause.
imp [Tue, 6 Sep 2016 15:17:35 +0000 (15:17 +0000)]
Renumber the advertising clause.

7 years agoImport missing enum declaration in pci_host_generic header file
wma [Tue, 6 Sep 2016 15:11:37 +0000 (15:11 +0000)]
Import missing enum declaration in pci_host_generic header file

Other files including pci_host_generic.h failed to compile
due to missing declaration of enum pci_id_type.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7561

7 years agoRemove check for 64-bit FDT ranges in pci-host-generic
wma [Tue, 6 Sep 2016 15:06:08 +0000 (15:06 +0000)]
Remove check for 64-bit FDT ranges in pci-host-generic

This allows 32-bit platforms to use pci-host-generic.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7560

7 years agoUpdate Annapurna Alpine HAL to a newer version.
wma [Tue, 6 Sep 2016 14:59:13 +0000 (14:59 +0000)]
Update Annapurna Alpine HAL to a newer version.
  HAL version: 2.7a

Import from vendor-sys, r305475

7 years agobhnd: remove redundant ;s at the end of functions or switch statements
emaste [Tue, 6 Sep 2016 13:34:10 +0000 (13:34 +0000)]
bhnd: remove redundant ;s at the end of functions or switch statements

7 years agorum: use m_get2() in Rx path.
avos [Tue, 6 Sep 2016 12:00:16 +0000 (12:00 +0000)]
rum: use m_get2() in Rx path.

7 years agortwn: fix firmware readiness check in rtwn_load_firmware().
avos [Tue, 6 Sep 2016 11:08:32 +0000 (11:08 +0000)]
rtwn: fix firmware readiness check in rtwn_load_firmware().

7 years agoTeach acpidump how to parse ACPI 5.1 tables found on the development
andrew [Tue, 6 Sep 2016 10:13:49 +0000 (10:13 +0000)]
Teach acpidump how to parse ACPI 5.1 tables found on the development
ThunderX units in the netperf cluster.

Approved by: jkim
Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7252

7 years agoiwm: fix scanning for hidden SSIDs.
avos [Tue, 6 Sep 2016 10:08:32 +0000 (10:08 +0000)]
iwm: fix scanning for hidden SSIDs.

Setup SSIDs in scan command so firmware will send direct probe request(s)
while scanning.

Tested by: dbkirk@gmail.com

PR: 211519
MFC after: 1 week

7 years agoEnsure that we always open only files that is named by explicitly
delphij [Tue, 6 Sep 2016 08:52:00 +0000 (08:52 +0000)]
Ensure that we always open only files that is named by explicitly
using shell redirections instead of having gzip(1) to decide what
file to open.

Issue reported in the "non-cryptanalytic attacks against freebsd
update components" anonymous gist.

Reviewed by: allanjude, emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7653

7 years agoPort contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/...
ngie [Tue, 6 Sep 2016 08:50:21 +0000 (08:50 +0000)]
Port contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/...

proc2_test must be skipped because the invariant tested
(`ke.fflags & NOTE_TRACKERR`) doesn't pass.

MFC after: 58 days
Submitted by: kib (earlier form)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6172

7 years agoMove tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/...
ngie [Tue, 6 Sep 2016 08:45:29 +0000 (08:45 +0000)]
Move tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/...

This is being done to clearly distinguish the libkqueue tests
from the (soon to be imported) NetBSD tests.

MFC after: 58 days
Sponsored by: EMC / Isilon Storage Division

7 years agorum: fix frame length checks in Rx path.
avos [Tue, 6 Sep 2016 06:40:59 +0000 (06:40 +0000)]
rum: fix frame length checks in Rx path.

Split usbd_xfer_status() check:
- Check xfer length: must be longer, than Rx descriptor size.
- Check frame size: must be shorter than xfer length.
- Discard too short frames.

Tested with WUSB54GC, STA/MONITOR modes.

7 years agofix zfs pool creation accidentally broken by r305331
avg [Tue, 6 Sep 2016 06:09:12 +0000 (06:09 +0000)]
fix zfs pool creation accidentally broken by r305331

The upstream change introduced a new load state, SPA_LOAD_CREATE,
and vdev_geom code needs to be aware of it.

Tested by: cy
MFC after: 1 week
X-MFC with: r305331

7 years agohyperv/hn: Avoid bit fields for LSOv2 setup.
sephe [Tue, 6 Sep 2016 04:37:53 +0000 (04:37 +0000)]
hyperv/hn: Avoid bit fields for LSOv2 setup.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7786

7 years agohyperv/hn: Fix VLAN tag setup for outgoing VLAN packets.
sephe [Tue, 6 Sep 2016 03:31:31 +0000 (03:31 +0000)]
hyperv/hn: Fix VLAN tag setup for outgoing VLAN packets.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7785

7 years agohyperv/hn: Stringent RNDIS packet message length/offset check.
sephe [Tue, 6 Sep 2016 03:20:06 +0000 (03:20 +0000)]
hyperv/hn: Stringent RNDIS packet message length/offset check.

While I'm here, use definition in net/rndis.h

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7782

7 years agoFix lib/libc/rpc test assumptions added in r305358
ngie [Tue, 6 Sep 2016 01:07:12 +0000 (01:07 +0000)]
Fix lib/libc/rpc test assumptions added in r305358

- Require root in the tcp/udp subtests (it's needed on FreeBSD when
  registering services).
- Skip the tests if service registration fails.

MFC after: 59 days
X-MFC with: r305358
Reported by: Jenkins, rodrigc
Sponsored by: EMC / Isilon Storage Division

7 years agoInstall h_db to unbreak some of the lib/libc/db testcases after
ngie [Tue, 6 Sep 2016 00:51:25 +0000 (00:51 +0000)]
Install h_db to unbreak some of the lib/libc/db testcases after
r305358

MFC after: 59 days
X-MFC with: r305358
Reported by: Jenkins, rodrigc
Sponsored by: EMC / Isilon Storage Division

7 years agoFix send/recv limit mixup.
np [Mon, 5 Sep 2016 23:12:24 +0000 (23:12 +0000)]
Fix send/recv limit mixup.

7 years agobhnd(4): Implement backplane interrupt handling.
landonf [Mon, 5 Sep 2016 22:11:46 +0000 (22:11 +0000)]
bhnd(4): Implement backplane interrupt handling.

This adds bhnd(4) bus-level support for querying backplane interrupt vector
routing, and delegating machine/bridge-specific interrupt handling to the
concrete bhnd(4) driver implementation.

On bhndb(4) bridged PCI devices, we provide the PCI/MSI interrupt directly
to attached cores.

On MIPS devices, we report a backplane interrupt count of 0, effectively
disabling the bus-level interrupt assignment. This allows mips/broadcom
to temporarily continue using hard-coded MIPS IRQs until bhnd_mips PIC
support is implemented.

Reviewed by: mizhka
Approved by: adrian (mentor, implicit)

7 years agobwn(4): ignore BCM4321's unpopulated USB11 host controller core.
landonf [Mon, 5 Sep 2016 21:55:27 +0000 (21:55 +0000)]
bwn(4): ignore BCM4321's unpopulated USB11 host controller core.

Broadcom Intensi-fi chipsets provided a common set of IP cores; on PCI/PCIe
devices, the USB11 host controller is left floating.

Approved by: adrian (mentor, implicit)

7 years agobhnd(4): Add device classes for USB host/dev/dual-mode controller cores.
landonf [Mon, 5 Sep 2016 21:48:16 +0000 (21:48 +0000)]
bhnd(4): Add device classes for USB host/dev/dual-mode controller cores.

Approved by: adrian (mentor, implicit)

7 years agorum: do not restart device when protmode / rtsthreshold is changed.
avos [Mon, 5 Sep 2016 19:42:35 +0000 (19:42 +0000)]
rum: do not restart device when protmode / rtsthreshold is changed.

7 years agocxgbe/t4_tom: toepcb should be all-zero on allocation because the code
np [Mon, 5 Sep 2016 19:37:47 +0000 (19:37 +0000)]
cxgbe/t4_tom: toepcb should be all-zero on allocation because the code
that cleans up on failure assumes that non-NULL values indicate
initialized items.

Sponsored by: Chelsio Communications

7 years agoRevert r305119, move the control module register data to am335x_scm.h and
loos [Mon, 5 Sep 2016 18:42:21 +0000 (18:42 +0000)]
Revert r305119, move the control module register data to am335x_scm.h and
fix if_cpsw.c to include the correct header.

Discussed with: bz

7 years agoDefine libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable
dim [Mon, 5 Sep 2016 18:02:37 +0000 (18:02 +0000)]
Define libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable
way.

MFC after: 3 days

7 years ago[BHND/USB] Port of EHCI/OHCI support from ZRouter
mizhka [Mon, 5 Sep 2016 16:06:52 +0000 (16:06 +0000)]
[BHND/USB] Port of EHCI/OHCI support from ZRouter

This patch adds driver implementation for BHND USB core. Driver has been
imported from ZRouter project with small adaptions for FreeBSD 11.

Also it's enabled for BroadCom MIPS74k boards by default. It's fully tested
on Asus boards (RT-N16: external USB, RT-N53: USB bus between SoC and WiFi
chips).

Reviewed by:    adrian (mentor), ray
Approved by: adrian (mentor)
Obtained from: ZRouter
Differential Revision:  https://reviews.freebsd.org/D7781

7 years agoRemove an unreachable return state from ARM's minidumpsys().
markj [Mon, 5 Sep 2016 16:04:40 +0000 (16:04 +0000)]
Remove an unreachable return state from ARM's minidumpsys().

Submitted by: Dominik Ermel <der@semihalf.com>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7787

7 years agoMFV r305420:
mm [Mon, 5 Sep 2016 15:40:41 +0000 (15:40 +0000)]
MFV r305420:
Sync libarchive with vendor

Vendor issues fixed:
PR #777: Multiple bugfixes for setup_acls()

This includes a bugfix for a bug that caused ACLs not to be read properly
for files and directories inside subdirectories and as a result not being
stored or being incorrectly stored in tar archives.

MFC after: 3 days

7 years agoResolve deadlock between device_detach() and usbd_do_request_flags()
hselasky [Mon, 5 Sep 2016 15:35:58 +0000 (15:35 +0000)]
Resolve deadlock between device_detach() and usbd_do_request_flags()
by reviving the SX control request lock and refining which lock
protects the common scratch area in "struct usb_device".

The SX control request lock was removed by r246759 because it caused a
lock order reversal with the USB enumeration lock inside
usbd_transfer_setup() as a function of r246616. It was thought that
reducing the number of locks would resolve the LOR, but because some
USB device drivers use usbd_do_request_flags() inside callback
functions, like in taskqueues, a deadlock may occur when these are
drained from device_detach(). By restoring the SX control request
lock usbd_do_request_flags() is allowed to complete its execution
when a USB device driver is detaching. By using the SX control request
lock to protect the scratch area, the LOR introduced by r246616 is
also resolved.

Bump the FreeBSD version while at it to force recompilation of all USB
kernel modules.

Found by: avos@
MFC after: 1 week

7 years agoUpdate vendor/libarchive to git b4099917d6893ed77af24caff1156e044ebd4fa5
mm [Mon, 5 Sep 2016 15:20:55 +0000 (15:20 +0000)]
Update vendor/libarchive to git b4099917d6893ed77af24caff1156e044ebd4fa5

Vendor issues fixed:
PR #777: Multiple bugfixes for setup_acls()

This fixes a bug that caused ACLs not to be read properly for files and
directories inside subdirectories and as a result not being stored in tar
archives.

7 years agoAdd sy8106a to Allwinner kernel. This regulator is used to control VDD_CPUX
jmcneill [Mon, 5 Sep 2016 13:45:45 +0000 (13:45 +0000)]
Add sy8106a to Allwinner kernel. This regulator is used to control VDD_CPUX
and is connected to R_TWI on some H3-based Orange Pi boards.

7 years agoAdd driver for Silergy Corp. SY8106A buck regulator.
jmcneill [Mon, 5 Sep 2016 13:39:54 +0000 (13:39 +0000)]
Add driver for Silergy Corp. SY8106A buck regulator.

7 years agoAdd support for Allwinner H3 PLL_CPUX.
jmcneill [Mon, 5 Sep 2016 12:36:54 +0000 (12:36 +0000)]
Add support for Allwinner H3 PLL_CPUX.

The H3 PLL_CPUX register looks exactly like the one found in A23, but we
need to follow a specific protocol when making adjustments to the clock.

7 years agoAdd support for the Allwinner H3 Thermal Sensor Controller. The H3 embeds
jmcneill [Mon, 5 Sep 2016 11:05:14 +0000 (11:05 +0000)]
Add support for the Allwinner H3 Thermal Sensor Controller. The H3 embeds
a single thermal sensor located in the CPU.

7 years agobsdinstall: add warning when unsupported partition is modified
wma [Mon, 5 Sep 2016 08:42:36 +0000 (08:42 +0000)]
bsdinstall: add warning when unsupported partition is modified

Right now is possible to modify bootable partition type to
non-bootable type without getting warning from partedit.
Example: if you auto parition drive for arm64, you will
get freebsd-ufs as bootable partition; now you are able
to change bootable partition type to freebsd-zfs; there
will be no warning and the system will install but
will not be bootable afterwards.

After this fix, partedit will issue the same warning it
does when user attempts to create bootable partition of
not supported type, notyfing a user about incoming
problem and allowing to think the decision over before
commiting the schema.

This has been tested on amd64 and arm64.

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

7 years agoAdd a toggle to display the approximate amount of swap used by each
des [Mon, 5 Sep 2016 08:27:04 +0000 (08:27 +0000)]
Add a toggle to display the approximate amount of swap used by each
process.  We don't *quite* pull that number out of our backside, as
the actual number is difficult to determine without modifying the VM
system to report it, but it's still useful to get an idea of what's
going on when a machine unexpectedly starts swapping.

MFC after: 1 week