]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoDetect integer overflow and limit the number of positional
Ruslan Bukin [Mon, 31 Oct 2016 18:38:58 +0000 (18:38 +0000)]
Detect integer overflow and limit the number of positional
arguments in the string format.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D8286

7 years agoMake sure the virtual T-axis buttons gets cleared for USB mice which has
Hans Petter Selasky [Mon, 31 Oct 2016 18:38:50 +0000 (18:38 +0000)]
Make sure the virtual T-axis buttons gets cleared for USB mice which has
less than 6 buttons.

PR: 213919
MFC after: 3 days

7 years agoMove declarations of invpcid_works and pmap_pcid_enabled to pmap.h.
John Baldwin [Mon, 31 Oct 2016 18:37:05 +0000 (18:37 +0000)]
Move declarations of invpcid_works and pmap_pcid_enabled to pmap.h.

Previously these were only declared under #ifdef SMP in <machine/smp.h>.
However, these variables are defind in pmap.c unconditionally, and efirt.c
references them unconditionally.  This fixes non-SMP kernel builds.

Discussed with: kib
MFC after: 1 week

7 years agocron(8): add support for /etc/cron.d and /usr/local/etc/cron.d
Baptiste Daroussin [Mon, 31 Oct 2016 18:20:12 +0000 (18:20 +0000)]
cron(8): add support for /etc/cron.d and /usr/local/etc/cron.d

For automation tools it is way easier to maintain files in directories rather
than modifying /etc/crontab.

The files in those directories are in the same format as /etc/crontab

Reviewed by: adrian
MFC after: 2 weeks
Relnotes: yes
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D8400

7 years agoFix alignment issues on MIPS: align the pointers properly.
Ruslan Bukin [Mon, 31 Oct 2016 16:55:14 +0000 (16:55 +0000)]
Fix alignment issues on MIPS: align the pointers properly.

All the 5520 GEOM_ELI tests passed successfully on MIPS64EB.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D7905

7 years agoThere appeared to be even more copy/pastes. :)
Alexander Motin [Mon, 31 Oct 2016 16:06:57 +0000 (16:06 +0000)]
There appeared to be even more copy/pastes. :)

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

7 years agoFix wrong copy/paste in error message.
Alexander Motin [Mon, 31 Oct 2016 16:01:22 +0000 (16:01 +0000)]
Fix wrong copy/paste in error message.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

7 years agoUse correct signal number for floating point exceptions.
Ruslan Bukin [Mon, 31 Oct 2016 15:49:41 +0000 (15:49 +0000)]
Use correct signal number for floating point exceptions.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoAdd full softfloat and hardfloat support for MIPS.
Ruslan Bukin [Mon, 31 Oct 2016 15:33:58 +0000 (15:33 +0000)]
Add full softfloat and hardfloat support for MIPS.

This adds new target architectures for hardfloat:
mipselhf mipshf mips64elhf mips64hf.

Tested in QEMU only.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D8376

7 years agoWhen issuing a PXE dhcp request, always issue a param request (DHCP option 55)
Baptiste Daroussin [Mon, 31 Oct 2016 15:11:55 +0000 (15:11 +0000)]
When issuing a PXE dhcp request, always issue a param request (DHCP option 55)
with all dhcp parameters we might be interested in.

Some DHCP server like the new kea (by ISC) expect it.

This makes pxeboot functional with ISC kea.

Submitted by: Vincent Legout <vincent.legout@gandi.net>
MFC after: 1 month
Sponsored by: Gandi.net

7 years agoxen: add a grant-table user-space device
Roger Pau Monné [Mon, 31 Oct 2016 13:12:58 +0000 (13:12 +0000)]
xen: add a grant-table user-space device

A grant-table user-space device will allow user-space applications to map
and share grants (Xen way to share memory) among Xen domains. This grant
table user-space device has been tested with the QEMU Qdisk Xen backed.

Submitted by: jaggi
Reviewed by: royger
Differential review: https://reviews.freebsd.org/D7293

7 years agoxen/intr: add reference counts to event channels
Roger Pau Monné [Mon, 31 Oct 2016 13:00:53 +0000 (13:00 +0000)]
xen/intr: add reference counts to event channels

Add a reference count to xenisrc. This is required for implementation of
unmap-notifications in the grant table userspace device (gntdev). We need to
hold a reference to the event channel port, in case the user deallocates the
port before we send the notification.

Submitted by: jaggi
Reviewed by: royger
Differential review: https://reviews.freebsd.org/D7429

7 years agoxen/netfront: fix statistics
Roger Pau Monné [Mon, 31 Oct 2016 11:31:11 +0000 (11:31 +0000)]
xen/netfront: fix statistics

Fix the statistics used by netfront.

Reported by:    Trond.Endrestol@ximalas.info
Submitted by:   ae
Reviewed by:    royger, Wei Liu <wei.liu2@citrix.com>
MFC after: 4 weeks
PR: 213439

7 years agoIn loader.efi, instead of exiting directly, try to fallback on the
Emmanuel Vadot [Mon, 31 Oct 2016 11:30:01 +0000 (11:30 +0000)]
In loader.efi, instead of exiting directly, try to fallback on the
first EFI device if we can't find the one from which the image was loaded.

Reviewed by: allanjude,imp,jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6780

7 years agoOn arm64 build the efi loader with -fPIC. Without this clang 3.9 will
Andrew Turner [Mon, 31 Oct 2016 11:13:36 +0000 (11:13 +0000)]
On arm64 build the efi loader with -fPIC. Without this clang 3.9 will
generate relocation in the self relocation code.

MFC after: 1 week
Sponsored by: ABT Systems Ltd

7 years agoAdd preliminary support for the RTL8153.
Kevin Lo [Mon, 31 Oct 2016 05:58:11 +0000 (05:58 +0000)]
Add preliminary support for the RTL8153.

Reviewed by: hselasky

7 years agohyperv/hn: Don't start shared TX taskq, if the hypervisor is not Hyper-V.
Sepherosa Ziehau [Mon, 31 Oct 2016 05:22:00 +0000 (05:22 +0000)]
hyperv/hn: Don't start shared TX taskq, if the hypervisor is not Hyper-V.

- Move the SYSINIT to DRIVER/SECOND, i.e. after the vm_guest becomes
  determistic.
- Minor style changes.

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

7 years agohyperv/hn: Reset do_lro, if the hash types are not TCP related.
Sepherosa Ziehau [Mon, 31 Oct 2016 05:05:12 +0000 (05:05 +0000)]
hyperv/hn: Reset do_lro, if the hash types are not TCP related.

Mainly because the host side only set TCPCS and IPCS even for
UDP datagrams.

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

7 years agohyperv/hn: Cleanup RXBUF ack processing.
Sepherosa Ziehau [Mon, 31 Oct 2016 04:54:15 +0000 (04:54 +0000)]
hyperv/hn: Cleanup RXBUF ack processing.

- Increase the # of retries.
- Add comment.
- Log error, if RXBUF ack fails.
- Add stat for RXBUF ack failures.

RXBUF ack really should _not_ fail...

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

7 years agohyperv/hn: Rework temporary channel packet buffer expanding.
Sepherosa Ziehau [Mon, 31 Oct 2016 04:46:02 +0000 (04:46 +0000)]
hyperv/hn: Rework temporary channel packet buffer expanding.

And use large default temporary channel packer buffer; we really
don't want it to be expanded at run time.

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

7 years agohyperv/hn: Rename cleaned up RNDIS source file.
Sepherosa Ziehau [Mon, 31 Oct 2016 01:36:28 +0000 (01:36 +0000)]
hyperv/hn: Rename cleaned up RNDIS source file.

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

7 years agoRevert r308107
Li-Wen Hsu [Sun, 30 Oct 2016 22:18:22 +0000 (22:18 +0000)]
Revert r308107

Requested by: jhb

7 years agoChange remained internal uses of boolean_t to bool in vm/vm_fault.c.
Konstantin Belousov [Sun, 30 Oct 2016 20:39:38 +0000 (20:39 +0000)]
Change remained internal uses of boolean_t to bool in vm/vm_fault.c.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove vm_pager_has_page() declaration. It is not too useful since
Konstantin Belousov [Sun, 30 Oct 2016 20:38:57 +0000 (20:38 +0000)]
Remove vm_pager_has_page() declaration.  It is not too useful since
static inline definition appears later in the file.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoMerge and sort vm_fault_hold()'s "int" variable definitions.
Alan Cox [Sun, 30 Oct 2016 19:15:59 +0000 (19:15 +0000)]
Merge and sort vm_fault_hold()'s "int" variable definitions.

Reviewed by: kib
MFC after: 7 days

7 years agoRemove vnode_locked label and goto, by collapsing vp calculation into
Konstantin Belousov [Sun, 30 Oct 2016 18:05:18 +0000 (18:05 +0000)]
Remove vnode_locked label and goto, by collapsing vp calculation into
the conditional.

Suggested and reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoSplit long line instead of unindenting it. Add KASSERT() verifying
Konstantin Belousov [Sun, 30 Oct 2016 18:04:11 +0000 (18:04 +0000)]
Split long line instead of unindenting it.  Add KASSERT() verifying
that a device object with the same handle has the same ops vector.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years ago- Fix `make` in sys/modules/bhnd
Li-Wen Hsu [Sun, 30 Oct 2016 15:56:42 +0000 (15:56 +0000)]
- Fix `make` in sys/modules/bhnd

Approved by: landonf
Differential Revision: https://reviews.freebsd.org/D7774

7 years ago- Use virtualbox-ose-additions-nox11 for vagrant image to reduce size
Li-Wen Hsu [Sun, 30 Oct 2016 15:46:24 +0000 (15:46 +0000)]
- Use virtualbox-ose-additions-nox11 for vagrant image to reduce size

Reviewed by: brd, gjb, swills
Approved by: gjb

7 years agoFix H3 temperature reporting. The formula in for V1.0 of the H3 datasheet
Jared McNeill [Sun, 30 Oct 2016 14:39:33 +0000 (14:39 +0000)]
Fix H3 temperature reporting. The formula in for V1.0 of the H3 datasheet
seems to be incorrect, so use the same method of conversion as the H3 BSP
instead.

7 years agoadd iic interface to ig4 driver, move isl and cyapa to iicbus
Andriy Gapon [Sun, 30 Oct 2016 12:15:33 +0000 (12:15 +0000)]
add iic interface to ig4 driver, move isl and cyapa to iicbus

Summary:
The hardware does not expose a classic SMBus interface.
Instead it has a lower level interface that can express a far richer
I2C protocol than what smbus offers.  However, the interface does not
provide a way to explicitly generate the I2C stop and start conditions.
It's only possible to request that the stop condition is generated
after transferring the next byte in either direction.  So, at least
one data byte must always be transferred.
Thus, some I2C sequences are impossible to generate, e.g., an equivalent
of smbus quick command (<start>-<slave addr>-<r/w bit>-<stop>).

At the same time isl(4) and cyapa(4) are moved to iicbus and now they use
iicbus_transfer for communication.  Previously they used smbus_trans()
interface that is not defined by the SMBus protocol and was implemented
only by ig4(4).  In fact, that interface was impossible to implement
for the typical SMBus controllers like intpm(4) or ichsmb(4) where
a type of the SMBus command must be programmed.

The plan is to remove smbus_trans() and all its uses.
As an aside, the smbus_trans() method deviates from the standard,
but perhaps backwards, FreeBSD convention of using 8-bit slave
addresses (shifted by 1 bit to the left).  The method expects
7-bit addresses.

There is a user facing consequence of this change.
A user must now provide device hints for isl and cyapa that specify an iicbus to use
and a slave address on it.
On Chromebook hardware where isl and cyapa devices are commonly found
it is also possible to use a new chromebook_platform(4) driver that
automatically configures isl and cyapa devices.  There is no need to
provide the device hints in that case,

Right now smbus(4) driver tries to discover all slaves on the bus.
That is very dangerous.  Fortunately, the probing code uses smbus_trans()
to do its job, so it is really enabled for ig4 only.
The plan is to remove that auto-probing code and smbus_trans().

Tested by: grembo, Matthias Apitz <guru@unixarea.de> (w/o
chromebook_platform)
Discussed with: grembo, imp
Reviewed by: wblock (docs)
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D8172

7 years agohwpmc: fix a race between amd_stop_pmc and amd_intr
Andriy Gapon [Sun, 30 Oct 2016 09:38:10 +0000 (09:38 +0000)]
hwpmc: fix a race between amd_stop_pmc and amd_intr

It is possible that wrmsr in amd_stop_pmc() causes an overflow in a counter
that it disables.  In that case a non-maskable interrupt is generated.  The
interrupt handler code was written in such a way that it would re-enable the
counter.  That would lead to an unexpected interrupt later on.

This problem was easy to reproduce with
$ pmcstat -T -P instructions -t $pid
if the target process is sufficiently busy and there are context switches from
time to time.  There would be a lot of interrupts to "race" with amd_stop_pmc()
called during the context switches.  The problem affected only AMD processors.

While there, trace whether amd_intr() claimed an interrupt.

Reviewed by: jhb
MFC after: 2 weeks

7 years agocompile libunwind c source with -fexceptions
Ed Maste [Sun, 30 Oct 2016 02:57:47 +0000 (02:57 +0000)]
compile libunwind c source with -fexceptions

When an exception is thrown the unwinder must unwind its own C source
(starting with _Unwind_RaiseException in UnwindLevel1.c), so it needs to
be built with unwinding data.

7 years agoAdd sysctls for zfs_immediate_write_sz and zvol_immediate_write_sz.
Alexander Motin [Sat, 29 Oct 2016 23:25:12 +0000 (23:25 +0000)]
Add sysctls for zfs_immediate_write_sz and zvol_immediate_write_sz.

7 years agoThe "lookup_is_valid" field is used as a "bool". Make it one.
Alan Cox [Sat, 29 Oct 2016 21:01:49 +0000 (21:01 +0000)]
The "lookup_is_valid" field is used as a "bool".  Make it one.

Convert vm_fault_hold()'s Boolean variables that are only used
internally to "bool".  Add a comment describing why the one
remaining "boolean_t" was not converted.

Reviewed by: kib
MFC after: 8 days

7 years agoFix WITNESS hints for pagequeue locks.
Mark Johnston [Sat, 29 Oct 2016 20:01:48 +0000 (20:01 +0000)]
Fix WITNESS hints for pagequeue locks.

MFC after: 1 week

7 years agoWith one exception, "hardfault" is used like a "bool". Change that
Alan Cox [Sat, 29 Oct 2016 19:22:38 +0000 (19:22 +0000)]
With one exception, "hardfault" is used like a "bool".  Change that
exception and make it a "bool".

Reviewed by: kib
MFC after: 7 days

7 years agoAdd one more use of unlock_vp().
Mark Johnston [Sat, 29 Oct 2016 18:47:28 +0000 (18:47 +0000)]
Add one more use of unlock_vp().

Discussed with: kib
X-MFC With: r308094

7 years agoAdd unlock_vp() helper.
Konstantin Belousov [Sat, 29 Oct 2016 18:03:29 +0000 (18:03 +0000)]
Add unlock_vp() helper.
Trim space.

Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agozfsbootcfg: a simple tool to set next boot (one time) options for zfsboot
Andriy Gapon [Sat, 29 Oct 2016 14:09:32 +0000 (14:09 +0000)]
zfsbootcfg: a simple tool to set next boot (one time) options for zfsboot

(gpt)zfsboot will read one-time boot directives from a special ZFS pool
area.  The area was previously described as "Boot Block Header", but
currently it is know as Pad2, marked as reserved and is zeroed out on
pool creation.  The new code interprets data in this area, if any, using
the same format as boot.config.  The area is immediately wiped out.
Failure to parse the directives results in a reboot right after the
cleanup.  Otherwise the boot sequence proceeds as usual.

zfsbootcfg writes zfsboot arguments specified on its command line to the
Pad2 area of a disk identified by vfs.zfs.boot.primary_pool and
vfs.zfs.boot.primary_vdev kenv variables that are set by loader during
boot.  Please see the manual page for more.

Thanks to all who reviewed, contributed and made suggestions!  There are
many potential improvements to the feature, please see the review for
details.

Reviewed by: wblock (docs)
Discussed with: jhb, tsoome
MFC after: 3 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D7612

7 years agoFix getfsstat(2) handling of flags. The 'flags' argument is an enum,
Edward Tomasz Napierala [Sat, 29 Oct 2016 12:38:30 +0000 (12:38 +0000)]
Fix getfsstat(2) handling of flags. The 'flags' argument is an enum,
not a bitfield. For the intended usage - being passed either MNT_WAIT,
or MNT_NOWAIT - this shouldn't introduce any changes in behaviour.

Reviewed by: jhb@
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D8373

7 years agoAdd the SPE feature mask for e500v1 and e500v2
Justin Hibbits [Sat, 29 Oct 2016 01:24:30 +0000 (01:24 +0000)]
Add the SPE feature mask for e500v1 and e500v2

On e500v2 SoCs it will now print:

cpu0: Features 84e08000<PPC32,MMU,SPE,EFPS,EFPD,BOOKE>

at bootup.

7 years agoFix a copy&paste-o causing a segfault with sigsetjmp.
Justin Hibbits [Sat, 29 Oct 2016 01:22:55 +0000 (01:22 +0000)]
Fix a copy&paste-o causing a segfault with sigsetjmp.

I'm not sure how this passed my code inspection and initial testing, it's
obviously wrong.  Found when debugging csh.

7 years agoioat(4): Use memory completion rather than device register
Conrad Meyer [Fri, 28 Oct 2016 23:53:37 +0000 (23:53 +0000)]
ioat(4): Use memory completion rather than device register

The CHANSTS register is a split 64-bit register on CBDMA units before
hardware v3.3.  If a torn read happens during ioat_process_events(),
software cannot know when to stop completing descriptors correctly.

So, just use the device-pushed main memory channel status instead.

Remove the ioat_get_active() seatbelt as well.  It does nothing if the
completion address is valid.

Sponsored by: Dell EMC Isilon

7 years agoioat(4): Add failpoint for delay() in ioat_release
Conrad Meyer [Fri, 28 Oct 2016 23:53:36 +0000 (23:53 +0000)]
ioat(4): Add failpoint for delay() in ioat_release

Sponsored by: Dell EMC Isilon

7 years agoioat(4): Assert the submit lock in ioat_submit_single
Conrad Meyer [Fri, 28 Oct 2016 23:53:35 +0000 (23:53 +0000)]
ioat(4): Assert the submit lock in ioat_submit_single

Sponsored by: Dell EMC Isilon

7 years agoioat(4): Add additional tracing
Conrad Meyer [Fri, 28 Oct 2016 23:53:33 +0000 (23:53 +0000)]
ioat(4): Add additional tracing

These probes help track down driver bugs.

Sponsored by: Dell EMC Isilon

7 years agocxgbe(4): Accurate statistics for all chip settings.
Navdeep Parhar [Fri, 28 Oct 2016 23:01:11 +0000 (23:01 +0000)]
cxgbe(4): Accurate statistics for all chip settings.

There are 4 independent knobs in T5+ chips to include or exclude PAUSE
frames from the "total frames" and "multicast frames" counters in either
direction.  This change lets the driver deal with any combination of
these settings.

7 years agoRemove a PCI ID for a raid controller from Adaptec that was planned,
Warner Losh [Fri, 28 Oct 2016 20:23:38 +0000 (20:23 +0000)]
Remove a PCI ID for a raid controller from Adaptec that was planned,
but never released. Since no real hardware was released with this ID,
just drop it from the aacraid driver. This paves the path for future
drivers for hardware that actually has this ID.

Submitted by: Scott Benesh from Microsemi.
Differential Revision: https://reviews.freebsd.org/D8377
MFC After: 3 days

7 years agoAvoid possible overflow when calclating malloc size for auxillary
Kirk McKusick [Fri, 28 Oct 2016 20:15:19 +0000 (20:15 +0000)]
Avoid possible overflow when calclating malloc size for auxillary
data structure sizes when mounting and reloading UFS/FFS
filesystems by using a u_long rather than an int for the size.

Reported by: Mariusz Zaborski <oshogbo@>
MFC after:   1 week

7 years agoFix formatting of tables.
John Baldwin [Fri, 28 Oct 2016 18:09:08 +0000 (18:09 +0000)]
Fix formatting of tables.

Specifically, use .Ta instead of tabs to separate column entries.  While
here fix a few other things:
- Use .Sy for all column headers (previously only the first column header
  was bold)
- Use .Dv to markup constants used for MIB names.
- Use "1234" and "4321" for the byte order descriptions without
  thousands separators.
- Mark up header files in the first table with .In.

MFC after: 2 weeks

7 years agoAdd vdev_reopening support to vdev_geom.
Alexander Motin [Fri, 28 Oct 2016 17:05:14 +0000 (17:05 +0000)]
Add vdev_reopening support to vdev_geom.

It allows to avoid extra GEOM providers flapping without significant need.
Since GEOM got resize support, we don't need to reopen provider to get new
size.  If provider was orphaned and no longer valid, ZFS should already
know that, and in such case reopen should be done in full as expected.

MFC after: 2 weeks

7 years agoMatching GUIDs, handle possible race on vdev detach.
Alexander Motin [Fri, 28 Oct 2016 16:21:31 +0000 (16:21 +0000)]
Matching GUIDs, handle possible race on vdev detach.

In case of vdev detach, causing top level mirror vdev destruction, leaf
vdev changes its GUID to one of the destroyed mirror, that creates race
condition when GUID in vdev label may not match one in the pool config.

This change replicates logic nuance of vdev_validate() by adding special
exception, matching the vdev GUID against the top level vdev GUID.
Since this exception is not completely reliable (may give false positives
if we fail to erase label on detached vdev), use it only as last resort.

Quick way to reproduce this scenario now is detach vdev from a pool with
enabled autoextend.  During vdev detach autoextend logic tries to reopen
remaining vdev, that always fails now since in-memory configuration is
already updated, while on-disk labels are not yet.

MFC after: 2 weeks

7 years agofix a syntax error in r308039 ...
Andriy Gapon [Fri, 28 Oct 2016 15:57:55 +0000 (15:57 +0000)]
fix a syntax error in r308039 ...

that I somehow introduced between testing the change
iand committing it.

MFC after: 1 week
X-MFC with: r307903

7 years agoImprove few debugging log messages.
Alexander Motin [Fri, 28 Oct 2016 15:30:10 +0000 (15:30 +0000)]
Improve few debugging log messages.

7 years agonap time between pats is forced to be at most half of the timeout
Andriy Gapon [Fri, 28 Oct 2016 14:49:54 +0000 (14:49 +0000)]
nap time between pats is forced to be at most half of the timeout

Previously, if the timeout was less than 10 seconds, for example, about
8 seconds, then the watchdog timer would be let to expire before patting
the watchdog.

MFC after: 2 weeks

7 years agovmm: another take at maximmum address passed to contigmalloc
Andriy Gapon [Fri, 28 Oct 2016 14:38:01 +0000 (14:38 +0000)]
vmm: another take at maximmum address passed to contigmalloc

Just using vm_paddr_t value with all bits set.
That should work as long as the type is unsigned.

While there, fix a couple of whitespace issues nearby.

MFC after: 1 week
X-MFC with: r307903

7 years agoThe buffer address is always overwritten in the extended descriptor format,
Sean Bruno [Fri, 28 Oct 2016 13:37:58 +0000 (13:37 +0000)]
The buffer address is always overwritten in the extended descriptor format,
we have to refresh it ... always.  This fixes problems reported in NetMap
with em(4) devices after conversion to extended descriptor format in
svn r293331.

Submitted by: luigi@
Reported by: franco@opnsense.org
MFC after: 2 days

7 years agoFix indentation and remove duplicate queue stopped stats increment.
Hans Petter Selasky [Fri, 28 Oct 2016 12:36:59 +0000 (12:36 +0000)]
Fix indentation and remove duplicate queue stopped stats increment.

Found by: Ryan Stone <rysto32@gmail.com>
Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agoUse correct cpu id in the banner. Fix style.
Konstantin Belousov [Fri, 28 Oct 2016 12:27:05 +0000 (12:27 +0000)]
Use correct cpu id in the banner.  Fix style.

Noted by: avg
Sponsored by: The FreeBSD Foundation
MFC after: 9 days

7 years agoHandle pmap_enter() over an existing 4/2M page in KVA on i386.
Konstantin Belousov [Fri, 28 Oct 2016 11:53:22 +0000 (11:53 +0000)]
Handle pmap_enter() over an existing 4/2M page in KVA on i386.

The userspace case was already handled by pmap_allocpte().  For kernel
VA, page table page must exist, and demote cannot fail, so we need to
just call pmap_demote_pde().  Also note that due to the machine AS
layout, promotions in the KVA on i386 are highly unlikely, so this
change is mostly for completeness.

Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D8323

7 years agoUse buffer pager for cd9660.
Konstantin Belousov [Fri, 28 Oct 2016 11:46:39 +0000 (11:46 +0000)]
Use buffer pager for cd9660.

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

7 years agoUse buffer pager for msdosfs.
Konstantin Belousov [Fri, 28 Oct 2016 11:46:15 +0000 (11:46 +0000)]
Use buffer pager for msdosfs.

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

7 years agoGeneralize UFS buffer pager to allow it serving other filesystems
Konstantin Belousov [Fri, 28 Oct 2016 11:43:59 +0000 (11:43 +0000)]
Generalize UFS buffer pager to allow it serving other filesystems
which also use buffer cache.

Most important addition to the code is the handling of filesystems
where the block size is less than the machine page size, which might
require reading several buffers to validate single page.

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

7 years agoEnable vn_io_fault() deadlock avoidance for msdosfs.
Konstantin Belousov [Fri, 28 Oct 2016 11:35:06 +0000 (11:35 +0000)]
Enable vn_io_fault() deadlock avoidance for msdosfs.

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

7 years agoEnsure that cluster allocations never allocate clusters outside the
Konstantin Belousov [Fri, 28 Oct 2016 11:34:32 +0000 (11:34 +0000)]
Ensure that cluster allocations never allocate clusters outside the
volume limits.  In particular:
- Assert that usemap_alloc() and usemap_free() cluster number argument
  is valid.
- In chainlength(), return 0 if cluster start is after the max cluster.
- In chainlength(), cut the calculated cluster chain length at the max
  cluster.
- For true paranoia, after the pm_inusemap is calculated in
  fillinusemap(), reset all bits in the array for clusters after the
  max cluster, as in-use.

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

7 years agoIf the fatchain() call in chainalloc() returned an error, revert
Konstantin Belousov [Fri, 28 Oct 2016 11:26:44 +0000 (11:26 +0000)]
If the fatchain() call in chainalloc() returned an error, revert
marking the cluster run as in-use.

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

7 years agoUse symbolic name for the value of fully free word in pm_inusemap.
Konstantin Belousov [Fri, 28 Oct 2016 11:23:36 +0000 (11:23 +0000)]
Use symbolic name for the value of fully free word in pm_inusemap.
Explicitely mention every bit in the value.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoUse symbolic name for the free cluster number.
Konstantin Belousov [Fri, 28 Oct 2016 11:01:49 +0000 (11:01 +0000)]
Use symbolic name for the free cluster number.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoFix comment formatting.
Konstantin Belousov [Fri, 28 Oct 2016 10:59:34 +0000 (10:59 +0000)]
Fix comment formatting.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoRemove useless NULL check.
Konstantin Belousov [Fri, 28 Oct 2016 10:57:41 +0000 (10:57 +0000)]
Remove useless NULL check.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agohyeprv/hn: Rename cleaned up RNDIS header file.
Sepherosa Ziehau [Fri, 28 Oct 2016 08:53:18 +0000 (08:53 +0000)]
hyeprv/hn: Rename cleaned up RNDIS header file.

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

7 years agohyperv/hn: Change header guardian; in preparation for the upcoming rename.
Sepherosa Ziehau [Fri, 28 Oct 2016 08:41:30 +0000 (08:41 +0000)]
hyperv/hn: Change header guardian; in preparation for the upcoming rename.

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

7 years agohyperv/hn: Cleanup RNDIS related files.
Sepherosa Ziehau [Fri, 28 Oct 2016 08:32:54 +0000 (08:32 +0000)]
hyperv/hn: Cleanup RNDIS related files.

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

7 years agohyperv/hn: Pull data path code up.
Sepherosa Ziehau [Fri, 28 Oct 2016 08:18:49 +0000 (08:18 +0000)]
hyperv/hn: Pull data path code up.

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

7 years agohyperv/hn: Reorganize RX path; mainly pull non-control code path up
Sepherosa Ziehau [Fri, 28 Oct 2016 08:08:46 +0000 (08:08 +0000)]
hyperv/hn: Reorganize RX path; mainly pull non-control code path up

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

7 years agohyperv/hn: Nuke unnecessary indirection.
Sepherosa Ziehau [Fri, 28 Oct 2016 07:59:02 +0000 (07:59 +0000)]
hyperv/hn: Nuke unnecessary indirection.

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

7 years agohyperv/hn: Rename cleaned up NVS source file.
Sepherosa Ziehau [Fri, 28 Oct 2016 07:48:17 +0000 (07:48 +0000)]
hyperv/hn: Rename cleaned up NVS source file.

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

7 years agohyperv/hn: Rename cleaned up NVS header file.
Sepherosa Ziehau [Fri, 28 Oct 2016 05:56:23 +0000 (05:56 +0000)]
hyperv/hn: Rename cleaned up NVS header file.

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

7 years agohyperv/hn: Change header guardian; in preparation for the upcoming rename.
Sepherosa Ziehau [Fri, 28 Oct 2016 05:31:34 +0000 (05:31 +0000)]
hyperv/hn: Change header guardian; in preparation for the upcoming rename.

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

7 years ago[net80211] add comments!
Adrian Chadd [Fri, 28 Oct 2016 02:10:07 +0000 (02:10 +0000)]
[net80211] add comments!

7 years ago[net80211] don't abort a background scan upon reception of a single packet.
Adrian Chadd [Fri, 28 Oct 2016 02:09:45 +0000 (02:09 +0000)]
[net80211] don't abort a background scan upon reception of a single packet.

Full offload drivers don't need this behaviour - they do it in firmware.

7 years agolibunwind: consistently add \n to log and trace messages
Ed Maste [Fri, 28 Oct 2016 00:04:04 +0000 (00:04 +0000)]
libunwind: consistently add \n to log and trace messages

Previously most messages included a newline in the string, but a few of
them were missing. Fix these and simplify by just adding the newline in
the _LIBUNWIND_LOG macro itself.

While here correct 'libuwind' typo (missing 'n').

Upstream LLVM libunwind commits r280086 and r280103.

7 years agoAdd powerd(8) support for several families of AMD CPUs.
John Baldwin [Thu, 27 Oct 2016 21:31:56 +0000 (21:31 +0000)]
Add powerd(8) support for several families of AMD CPUs.

Use the same logic to calculate the nominal CPU frequency from the P-state
MSRs on family 0x12, 0x15, and 0x16 CPUs as is used for family 0x10.
Family 0x14 was included in the original patch in the PR but I left that
out as the BIOS writer's guide for family 0x14 CPUs show a different layout
for the relevant MSR and include a different formulate for calculating the
frequency.

While here, simplify a few expressions and print out the family of
unsupported CPUs in hex rather than decimal.

PR: 212020
Submitted by: Anthony Jenkins <Scoobi_doo@yahoo.com>
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7587

7 years agoMFamd64: Add bounds checks on addresses used with /dev/mem.
John Baldwin [Thu, 27 Oct 2016 21:23:14 +0000 (21:23 +0000)]
MFamd64: Add bounds checks on addresses used with /dev/mem.

Reject attempts to read from or memory map offsets in /dev/mem that are
beyond the maximum-supported physical address of the current CPU.

Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7408

7 years agoRevert r307823 (Use upstream suffixes for LLVM IR) for now. It causes a
Dimitry Andric [Thu, 27 Oct 2016 18:46:52 +0000 (18:46 +0000)]
Revert r307823 (Use upstream suffixes for LLVM IR) for now.  It causes a
number of ports to fail, which use bmake, and use .ll file extensions
(usually for for C++-based lex input).

Reported by: antoine

7 years agolibgcc_eh/libgcc_s: apply hidden visibility only to static libs
Ed Maste [Thu, 27 Oct 2016 14:21:54 +0000 (14:21 +0000)]
libgcc_eh/libgcc_s: apply hidden visibility only to static libs

7 years agoVarious fixes for ptnet/ptnetmap (passthrough of netmap ports). In detail:
Luigi Rizzo [Thu, 27 Oct 2016 09:46:22 +0000 (09:46 +0000)]
Various fixes for ptnet/ptnetmap (passthrough of netmap ports). In detail:
- use PCI_VENDOR and PCI_DEVICE ids from a publicly allocated range
  (thanks to RedHat)
- export memory pool information through PCI registers
- improve mechanism for configuring passthrough on different hypervisors
Code is from Vincenzo Maffione as a follow up to his GSOC work.

7 years ago3746 ZRLs are racy
Andriy Gapon [Thu, 27 Oct 2016 07:38:07 +0000 (07:38 +0000)]
3746 ZRLs are racy

illumos/illumos-gate@260af64db74a52d64de8c6c5f67dd0a71d228ca5
https://github.com/illumos/illumos-gate/commit/260af64db74a52d64de8c6c5f67dd0a71d228ca5

https://www.illumos.org/issues/3746
  From the original change log:
  It was possible for a reference to be added even with the lock held, and
  for references added just after a lock release to be lost.
  This bug was also independently found and reported in wesunsolve.net
  issues 6985013 6995524.
  In zrl_add(), always use an atomic operation to update the refcount.
  The mutex in the ZRL only guarantees that wakeups occur for waiters on the
  lock. It offers no protection against concurrent updates of the refcount.
  The only refcount transition that is safe to perform without an atomic
  operation is from ZRL_LOCKED back to 0, since this can only be performed
  by the thread which has the ZRL locked.

Authored by: Will Andrews <will@freebsd.org>
Reviewed by: Boris Protopopov <bprotopopov@hotmail.com>
Reviewed by: Pavel Zakharov <pavel.zakha@gmail.com>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Reviewed by: Justin T. Gibbs <gibbs@scsiguy.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author: Youzhong Yang <yyang@mathworks.com>
PR: 204037
MFC after: 1 week

7 years ago3746 ZRLs are racy
Andriy Gapon [Thu, 27 Oct 2016 07:11:31 +0000 (07:11 +0000)]
3746 ZRLs are racy

illumos/illumos-gate@260af64db74a52d64de8c6c5f67dd0a71d228ca5
https://github.com/illumos/illumos-gate/commit/260af64db74a52d64de8c6c5f67dd0a71d228ca5

https://www.illumos.org/issues/3746
  From the original change log:
  It was possible for a reference to be added even with the lock held, and
  for references added just after a lock release to be lost.
  This bug was also independently found and reported in wesunsolve.net
  issues 6985013 6995524.
  In zrl_add(), always use an atomic operation to update the refcount.
  The mutex in the ZRL only guarantees that wakeups occur for waiters on the
  lock. It offers no protection against concurrent updates of the refcount.
  The only refcount transition that is safe to perform without an atomic
  operation is from ZRL_LOCKED back to 0, since this can only be performed
  by the thread which has the ZRL locked.

Authored by: Will Andrews <will@freebsd.org>
Reviewed by: Boris Protopopov <bprotopopov@hotmail.com>
Reviewed by: Pavel Zakharov <pavel.zakha@gmail.com>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Reviewed by: Justin T. Gibbs <gibbs@scsiguy.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author: Youzhong Yang <yyang@mathworks.com>

7 years agohyperv/hn: NVS inclusion cleanup and forward declare functions.
Sepherosa Ziehau [Thu, 27 Oct 2016 05:33:48 +0000 (05:33 +0000)]
hyperv/hn: NVS inclusion cleanup and forward declare functions.

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

7 years agohyperv/hn: Move send context to NVS domain.
Sepherosa Ziehau [Thu, 27 Oct 2016 05:26:04 +0000 (05:26 +0000)]
hyperv/hn: Move send context to NVS domain.

Since all sends are encapsulated in NVS messages.

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

7 years agohyperv/hn: Move hn_softc to if_hnvar.h
Sepherosa Ziehau [Thu, 27 Oct 2016 05:13:00 +0000 (05:13 +0000)]
hyperv/hn: Move hn_softc to if_hnvar.h

While I'm here, use consistent macro names.

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

7 years agohyperv/hn: Shuffle chimney sending buffer alloc/free around.
Sepherosa Ziehau [Thu, 27 Oct 2016 05:04:54 +0000 (05:04 +0000)]
hyperv/hn: Shuffle chimney sending buffer alloc/free around.

This paves way for more chimney sending buffer reorganization.

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

7 years agohyperv/hn: Define empty packet filter.
Sepherosa Ziehau [Thu, 27 Oct 2016 04:55:19 +0000 (04:55 +0000)]
hyperv/hn: Define empty packet filter.

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

7 years agohyperv/hn: Move %b format string for capabilities near their definition.
Sepherosa Ziehau [Thu, 27 Oct 2016 04:42:39 +0000 (04:42 +0000)]
hyperv/hn: Move %b format string for capabilities near their definition.

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

7 years agohyperv/hn: Nuke unnecessary M_NETVSC
Sepherosa Ziehau [Thu, 27 Oct 2016 04:28:01 +0000 (04:28 +0000)]
hyperv/hn: Nuke unnecessary M_NETVSC

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

7 years agoAdd support for Allwinner Consumer IR interface.
Ganbold Tsagaankhuu [Thu, 27 Oct 2016 04:26:33 +0000 (04:26 +0000)]
Add support for Allwinner Consumer IR interface.
RX is supported now and the driver is using evdev framework.
It was tested on Cubieboard2 (A20 SoC) using lirc
with dfrobot's IR remote controller.

7 years agohyperv/hn: Properly configure RSS according to RSS capabilities
Sepherosa Ziehau [Thu, 27 Oct 2016 03:43:27 +0000 (03:43 +0000)]
hyperv/hn: Properly configure RSS according to RSS capabilities

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

7 years agoDisable CLKREQ for ASPM since re(4) doesn't implement link level power saving.
Kevin Lo [Thu, 27 Oct 2016 02:20:13 +0000 (02:20 +0000)]
Disable CLKREQ for ASPM since re(4) doesn't implement link level power saving.

Reviewed by:  yongari