]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoGarbage collect a prove test wrapper
Enji Cooper [Tue, 20 Jan 2015 22:51:29 +0000 (22:51 +0000)]
Garbage collect a prove test wrapper

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

9 years agoFix arc__shrink DTrace probe's to_free argument.
Will Andrews [Tue, 20 Jan 2015 22:39:10 +0000 (22:39 +0000)]
Fix arc__shrink DTrace probe's to_free argument.

Remove the unnecessary #ifdef _KERNEL, which did not differ in the true or
false cases.  Actually set the value of to_free before using it.

MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoUse the "zfs_gfs" tag for GFS vnodes to make them easier to identify.
Will Andrews [Tue, 20 Jan 2015 22:31:26 +0000 (22:31 +0000)]
Use the "zfs_gfs" tag for GFS vnodes to make them easier to identify.

MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoNSEC_TO_TICK(usec) -> NSEC_TO_TICK(nsec)
Will Andrews [Tue, 20 Jan 2015 22:29:27 +0000 (22:29 +0000)]
NSEC_TO_TICK(usec) -> NSEC_TO_TICK(nsec)

9 years agoRemove unused strdup() #define.
Will Andrews [Tue, 20 Jan 2015 22:27:45 +0000 (22:27 +0000)]
Remove unused strdup() #define.

9 years agoGarbage collect a prove test wrapper
Enji Cooper [Tue, 20 Jan 2015 21:58:49 +0000 (21:58 +0000)]
Garbage collect a prove test wrapper

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

9 years ago- Add jbeich as a ports committer
Jan Beich [Tue, 20 Jan 2015 21:49:50 +0000 (21:49 +0000)]
- Add jbeich as a ports committer
- List bapt and flo as his mentors

Differential Revision: https://reviews.freebsd.org/D1562
Approved by: flo (mentor)

9 years agoRestore the CAM XPT peripheral generation counter, and export it via sysctl.
Will Andrews [Tue, 20 Jan 2015 21:15:33 +0000 (21:15 +0000)]
Restore the CAM XPT peripheral generation counter, and export it via sysctl.

Define it as an atomic uint32_t.  These increments happen infrequently
enough for the atomic overhead to be a problem, and since they're now
independent atomics, they won't contend with xpt_lock_buses().

This counter is useful as a means of cheaply identifying whether any changes
have been made to the CAM peripheral list.  Userland programs have no guarantee
that the counter won't change on them while being returned or while processing
the information, so they must be written accordingly.

Discussed with: ken, mav (in general)
MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoMFV r277432:
Xin LI [Tue, 20 Jan 2015 20:36:36 +0000 (20:36 +0000)]
MFV r277432:

Plug various memory leaks in libzfs import implementation.

Illumos issue:
    5518 Memory leaks in libzfs import implementation

MFC after: 2 weeks

9 years ago5518 Memory leaks in libzfs import implementation
Xin LI [Tue, 20 Jan 2015 20:18:59 +0000 (20:18 +0000)]
5518 Memory leaks in libzfs import implementation
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Serghei Samsi <sscdvp@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Marcel Telka <marcel.telka@nexenta.com>

illumos/illumos-gate@078266a5aafa880521ea55488ef3d676f35e908e

9 years ago5497 lock contention on arcs_mtx
Xin LI [Tue, 20 Jan 2015 20:17:29 +0000 (20:17 +0000)]
5497 lock contention on arcs_mtx
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Prakash Surya <prakash.surya@delphix.com>

illumos/illumos-gate@244781f10dcd82684fd8163c016540667842f203

9 years ago5313 Allow I/Os to be aggregated across ZIO priority classes
Xin LI [Tue, 20 Jan 2015 20:14:50 +0000 (20:14 +0000)]
5313 Allow I/Os to be aggregated across ZIO priority classes
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Will Andrews <willa@SpectraLogic.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Justin T. Gibbs <justing@spectralogic.com>

illumos/illumos-gate@fe319232d24f4ae183730a5a24a09423d8ab4429

9 years ago5410 Document -S option to zfs inherit
Xin LI [Tue, 20 Jan 2015 20:13:46 +0000 (20:13 +0000)]
5410 Document -S option to zfs inherit
5412 Mention -S option when zfs inherit fails on quota
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Paul B. Henson <henson@acm.org>

illumos/illumos-gate@5ff8cfa92ec8ea0f8593ad21aa2a04829b0ef5ea

9 years ago5056 ZFS deadlock on db_mtx and dn_holds
Xin LI [Tue, 20 Jan 2015 20:11:30 +0000 (20:11 +0000)]
5056 ZFS deadlock on db_mtx and dn_holds
Reviewed by: Will Andrews <willa@spectralogic.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Justin Gibbs <justing@spectralogic.com>

illumos/illumos-gate@bc9014e6a81272073b9854d9f65dd59e18d18c35

9 years ago5445 Add more visibility via arcstats; specifically arc_state_t stats and differentia...
Xin LI [Tue, 20 Jan 2015 20:10:03 +0000 (20:10 +0000)]
5445 Add more visibility via arcstats; specifically arc_state_t stats and differentiate between "data" and "metadata"
Reviewed by: Basil Crow <basil.crow@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Bayard Bell <bayard.bell@nexenta.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

illumos/illumos-gate@4076b1bf41cfd9f968a33ed54a7ae76d9e996fe8

9 years ago5408 managing ZFS cache devices requires lots of RAM
Xin LI [Tue, 20 Jan 2015 20:08:50 +0000 (20:08 +0000)]
5408 managing ZFS cache devices requires lots of RAM
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Don Brady <dev.fs.zfs@gmail.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Chris Williamson <Chris.Williamson@delphix.com>

illumos/illumos-gate@89c86e32293a30cdd7af530c38b2073fee01411c

9 years ago5376 arc_kmem_reap_now() should not result in clearing arc_no_grow
Xin LI [Tue, 20 Jan 2015 20:04:51 +0000 (20:04 +0000)]
5376 arc_kmem_reap_now() should not result in clearing arc_no_grow
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Steven Hartland <killing@multiplay.co.uk>
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@2ec99e3e987d8aa273f1e9ba2b983557d058198c

9 years agoRemove comparisons which are not necessary.
Michael Tuexen [Tue, 20 Jan 2015 19:08:55 +0000 (19:08 +0000)]
Remove comparisons which are not necessary.

Reported by: Coverity
CID: 123782612378441237847
MFC after: 1 week

9 years agoAllow clang to be built for mips/mips64 backend types by adding our mips
Sean Bruno [Tue, 20 Jan 2015 17:00:28 +0000 (17:00 +0000)]
Allow clang to be built for mips/mips64 backend types by adding our mips
triple ids

This only allows testing and does not change the defaults for mips/mips64.
They still build/use gcc by default.

Differential Revision: https://reviews.freebsd.org/D1190
Reviewed by: dim

9 years agoo Restore 'goto tr_setup;' when operating in host mode mistakenly
Ruslan Bukin [Tue, 20 Jan 2015 16:30:02 +0000 (16:30 +0000)]
o Restore 'goto tr_setup;' when operating in host mode mistakenly
  removed in r277414.
o Remove extra parentheses around cases.

9 years agoThere does not seem to be any reason to acquire GIANT here. Follow amd64
Nathan Whitehorn [Tue, 20 Jan 2015 16:21:59 +0000 (16:21 +0000)]
There does not seem to be any reason to acquire GIANT here. Follow amd64
in removing it.

MFC after: 1 month

9 years agoo Do notify USB host each time we receive 'set packet filter' request.
Ruslan Bukin [Tue, 20 Jan 2015 15:45:09 +0000 (15:45 +0000)]
o Do notify USB host each time we receive 'set packet filter' request.
  This makes Mac OS X happy when it returns back from suspending.
o Switch notify state after data is transferred, but not before.
o Consider there is also Super Speed mode.
o Do not set stall bit on any pipes in device mode as Mac OS X seems
  don't support it.

In collaboration with: hselasky@

9 years agoAllow skipping dmu_buf_will_dirty() call in dsl_dir_transfer_space().
Alexander Motin [Tue, 20 Jan 2015 13:09:12 +0000 (13:09 +0000)]
Allow skipping dmu_buf_will_dirty() call in dsl_dir_transfer_space().

dsl_dir_transfer_space() is mostly called after dsl_dir_diduse_space(),
which already calls dmu_buf_will_dirty() for the same dbuf and tx, so
its duplicate call in those cases will change nothing, only spend time.

Skipping this call by four times reduces time spent in dbuf_write_done()
and descendants, updating dataset statistics with several congested lock
acquisitions.  When rewriting 8K zvol blocks at 1GB/s rate, this reduces
CPU time spent inside dbuf_write_done(), according to profiling, from 45%
of 683K samples to 18% of 422K.

MFC after: 2 weeks

9 years agoloader: fix the size of MODINFOMD_MODULEP
Roger Pau Monné [Tue, 20 Jan 2015 12:28:24 +0000 (12:28 +0000)]
loader: fix the size of MODINFOMD_MODULEP

The data in MODINFOMD_MODULEP is packed by the loader as a 4 byte type, but
the amd64 kernel expects a vm_paddr_t, which is of size 8 bytes. Fix this by
saving it as 8 bytes in the loader and retrieving it using the proper type
in the kernel.

Sponsored by: Citrix Systems R&D

9 years agoFix returned data for the USB_GET_DEV_PORT_PATH IOCTL in particular
Hans Petter Selasky [Tue, 20 Jan 2015 11:43:16 +0000 (11:43 +0000)]
Fix returned data for the USB_GET_DEV_PORT_PATH IOCTL in particular
the value returned in the "udp_port_level" field.

Reported by: Uffe Jakobsen <uffe@uffe.org>
MFC after: 1 week

9 years agoRemove the SMP code from locore-v4. These will never use the SMP code as
Andrew Turner [Tue, 20 Jan 2015 11:32:48 +0000 (11:32 +0000)]
Remove the SMP code from locore-v4. These will never use the SMP code as
there is no multi-core hardware prior to ARMv6.

Sponsored by: The FreeBSD Foundation

9 years agoAdd the User and PL1 read only and reqd write thread ID registers.
Andrew Turner [Tue, 20 Jan 2015 11:11:32 +0000 (11:11 +0000)]
Add the User and PL1 read only and reqd write thread ID registers.

Sponsored by: The FreeBSD Foundation

9 years agoAdd 128-byte cache flushing routines.
Ruslan Bukin [Tue, 20 Jan 2015 11:10:25 +0000 (11:10 +0000)]
Add 128-byte cache flushing routines.

Leave CNMIPS untouched as these functions depends on config2
register.

9 years agoEnable Synopsys DesignWare Mobile Storage Host Controller
Ganbold Tsagaankhuu [Tue, 20 Jan 2015 09:07:28 +0000 (09:07 +0000)]
Enable Synopsys DesignWare Mobile Storage Host Controller
driver on Rockchip boards. It currently supports PIO mode
and dma mode needs external dma controller to be used.

Submitted by:   jmcneill
Approved by:    stas (mentor)

9 years agoRemove space in the FDT reservation map from the available memory regions
Nathan Whitehorn [Tue, 20 Jan 2015 05:44:21 +0000 (05:44 +0000)]
Remove space in the FDT reservation map from the available memory regions
in ofw_mem_regions(). This function is actually MI and should move to
dev/ofw at some point in the near future so that ARM and MIPS can use the
same code.

9 years agoZero BSS explicitly if not started by loader(8). Add a check for the magic
Nathan Whitehorn [Tue, 20 Jan 2015 05:28:03 +0000 (05:28 +0000)]
Zero BSS explicitly if not started by loader(8). Add a check for the magic
values that ePAPR-compliant loaders (like skiboot) put in the register
loader uses for the metadata pointer to avoid confusing them.

9 years agoUpdate the vdso timehands only via tc_windup().
Neel Natu [Tue, 20 Jan 2015 03:54:30 +0000 (03:54 +0000)]
Update the vdso timehands only via tc_windup().

Prior to this change CLOCK_MONOTONIC could go backwards when the timecounter
hardware was changed via 'sysctl kern.timecounter.hardware'. This happened
because the vdso timehands update was missing the special treatment in
tc_windup() when changing timecounters.

Reviewed by: kib

9 years agoProperly clear IRQ status in order to fix "Spurious IRQ" message from AINT.
Oleksandr Tymoshenko [Tue, 20 Jan 2015 02:24:08 +0000 (02:24 +0000)]
Properly clear IRQ status in order to fix "Spurious IRQ" message from AINT.

This register is not documented in TRM but that's what linux driver does

9 years agoMFhead @ r277403
Enji Cooper [Mon, 19 Jan 2015 22:18:00 +0000 (22:18 +0000)]
MFhead @ r277403

9 years agoAdd missing linuxapi module dependencies and always use the FreeBSD
Hans Petter Selasky [Mon, 19 Jan 2015 21:53:00 +0000 (21:53 +0000)]
Add missing linuxapi module dependencies and always use the FreeBSD
"MODULE_VERSION" macro definition. Remove the redefinition of the
"MODULE_VERSION" macro from the Linux kernel compatibility API.

MFC after: 1 month
Reported by: np@
Sponsored by: Mellanox Technologies

9 years agoAdd more functions to the Linux kernel compatibility layer. Add some
Hans Petter Selasky [Mon, 19 Jan 2015 20:39:48 +0000 (20:39 +0000)]
Add more functions to the Linux kernel compatibility layer. Add some
missing includes which are needed when the header files are not
included in a particular order.

MFC after: 1 month
Sponsored by: Mellanox Technologies

9 years agoAdd some initial infrastructure for relocating the kernel in place.
Nathan Whitehorn [Mon, 19 Jan 2015 17:58:01 +0000 (17:58 +0000)]
Add some initial infrastructure for relocating the kernel in place.

MFC after: 2 months
Differential revision: D1554

9 years agoStop enforcing additional reference on all cdevs, which was introduced
Konstantin Belousov [Mon, 19 Jan 2015 17:36:52 +0000 (17:36 +0000)]
Stop enforcing additional reference on all cdevs, which was introduced
in r277199.  Acquire the neccessary reference in delist_dev_locked()
and inform destroy_devl() about it using CDP_UNREF_DTR flag.

Fix some style nits, add asserts.

Discussed with: hselasky
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoIgnore devfs directory entries for devices either being destroyed or
Konstantin Belousov [Mon, 19 Jan 2015 17:24:52 +0000 (17:24 +0000)]
Ignore devfs directory entries for devices either being destroyed or
delisted.  The check is racy.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoRemove extra mtx_unlock().
Alexander Motin [Mon, 19 Jan 2015 15:52:32 +0000 (15:52 +0000)]
Remove extra mtx_unlock().

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week

9 years agoCode cleanup.
Michael Tuexen [Mon, 19 Jan 2015 11:52:08 +0000 (11:52 +0000)]
Code cleanup.

Reported by: Coverity
CID: 749578
MFC after: 1 week

9 years agoMake the clock-frequency property optional as it may not be present on FDT
Andrew Turner [Mon, 19 Jan 2015 11:06:56 +0000 (11:06 +0000)]
Make the clock-frequency property optional as it may not be present on FDT
systems.

Sponsored by: The FreeBSD Foundation

9 years agoMinor refactoring of code block.
Hans Petter Selasky [Mon, 19 Jan 2015 07:29:07 +0000 (07:29 +0000)]
Minor refactoring of code block.

MFC after: 1 day

9 years agoFix the build when INVARIANTS is defined by restoring `bo`'s definition in
Enji Cooper [Mon, 19 Jan 2015 07:10:08 +0000 (07:10 +0000)]
Fix the build when INVARIANTS is defined by restoring `bo`'s definition in
ext2_truncate(..) and by putting it under INVARIANTS ifdefs

X-MFC with: r277354
MFC after: 2 weeks

9 years agoMOVS instruction emulation.
Neel Natu [Mon, 19 Jan 2015 06:53:31 +0000 (06:53 +0000)]
MOVS instruction emulation.

These instructions are emitted by 'bus_space_read_region()' when accessing
MMIO regions.

Since MOVS can be used with a repeat prefix start decoding the REPZ and
REPNZ prefixes. Also start decoding the segment override prefix since MOVS
allows overriding the source operand segment register.

Tested by: tychon
MFC after: 1 week

9 years agoFix a bug in libvmmapi 'vm_copy_setup()' where it would return success even if
Neel Natu [Mon, 19 Jan 2015 06:51:04 +0000 (06:51 +0000)]
Fix a bug in libvmmapi 'vm_copy_setup()' where it would return success even if
the 'gpa' was in the guest MMIO region. This would manifest as a segmentation
fault in 'vm_map_copyin()' or 'vm_map_copyout()' because 'vm_map_gpa()' would
return NULL for this 'gpa'.

Fix this by calling 'vm_map_gpa()' in 'vm_copy_setup' and returning a failure
if the 'gpa' cannot be mapped. This matches the behavior of 'vm_copy_setup()'
in vmm.ko.

MFC after: 1 week

9 years agoIntegrate contrib/netbsd-tests/bin/expr into the build/kyua as bin/expr/tests
Enji Cooper [Mon, 19 Jan 2015 06:13:07 +0000 (06:13 +0000)]
Integrate contrib/netbsd-tests/bin/expr into the build/kyua as bin/expr/tests

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoExpect :overflow to fail with FreeBSD's expr as it doesn't have stringent
Enji Cooper [Mon, 19 Jan 2015 06:10:01 +0000 (06:10 +0000)]
Expect :overflow to fail with FreeBSD's expr as it doesn't have stringent
overflow checks like NetBSD's expr does

MFC after: 3 days
PR: 196867

9 years agoProvide a tunable (machdep.moea64_bpvo_pool_size) to set the bootstrap
Nathan Whitehorn [Mon, 19 Jan 2015 05:14:07 +0000 (05:14 +0000)]
Provide a tunable (machdep.moea64_bpvo_pool_size) to set the bootstrap
PVO pool size. The default errs on the exceedingly large side, so absent
any intelligent automatic tuning, at least let the user set it to save
RAM on memory-constrained systems.

MFC after: 2 weeks

9 years agoFor armv6 builds, add -mfloat-abi=softfp. This tells the compiler it can
Ian Lepore [Mon, 19 Jan 2015 04:56:17 +0000 (04:56 +0000)]
For armv6 builds, add -mfloat-abi=softfp.  This tells the compiler it can
use floating point hardware instructions (because all armv6/7 systems we
support have fp hardware), but it passes args using a soft-float compatible
ABI.  This should give noticible performance improvement (but not as much
as using the armv6hf arch).

9 years agoext2: Garbage-collect some unused variables
Pedro F. Giffuni [Mon, 19 Jan 2015 03:30:45 +0000 (03:30 +0000)]
ext2: Garbage-collect some unused variables

Reported by: clang static analysis
MFC after: 2 weeks

9 years agoUpgrade libxo to 0.2.0.
Marcel Moolenaar [Mon, 19 Jan 2015 02:22:03 +0000 (02:22 +0000)]
Upgrade libxo to 0.2.0.

Obtained from: https://github.com/Juniper/libxo
Requested by: Phil Shafer <phil@juniper.net>

Revisions 276253 & 276273 were incorporated into 0.2.0.
Revision 276260 has been merged-in.

9 years agoWhen mountd is creating sockets, it iterates over all addresses specified
Ryan Stone [Mon, 19 Jan 2015 00:33:32 +0000 (00:33 +0000)]
When mountd is creating sockets, it iterates over all addresses specified
in the "hosts" array and eventually looks up the network address with
getaddrinfo(). At one point it checks for a numeric address and if it
sees one, it sets a hint parameter to force getaddrinfo to interpret the
host as a numeric address. However that hint is not cleared for subsequent
iterations of the loop and if any hosts seen after this point are host names,
getaddrinfo will fail on the name.  The result of this bug is that you cannot
pass a host name to the -h flag.

Unfortunately, the first iteration will either process ::1 or 127.0.0.1,
so the flag is set on the first iteration and all host names will fail
to be processed.

The same bug applies to rpc.lockd and rpc.statd, so fix them too.

Differential Revision: https://reviews.freebsd.org/D1507
Reported by: Dylan Martin
MFC after: 1 week
Sponsored by: Sandvine Inc.

9 years agoClean ZFS spa config before syncing
Steven Hartland [Sun, 18 Jan 2015 23:15:49 +0000 (23:15 +0000)]
Clean ZFS spa config before syncing

A number of entries that can be present in the spa config shouldn't be saved
to disk so add a method to ensure this is case. Without this if the last
caller to vdev_config_generate requested stats then we can end up in the
cache file.

Also only skip a none writable pool in the cache file generation if its
active. This prevents unavailable pools incorrectly getting removed from
cache file.

Tested by: delphij
MFC after: 2 weeks
Sponsored by: Multiplay

9 years agoFix a bug which only shows up when an mbuf allocation failed.
Michael Tuexen [Sun, 18 Jan 2015 22:00:39 +0000 (22:00 +0000)]
Fix a bug which only shows up when an mbuf allocation failed.
Therefore chances are low that we hit this.

Reported by: Coverity
CID: 1018886
MFC after: 1 week

9 years agoext2: fix for uninitialized pointer read.
Pedro F. Giffuni [Sun, 18 Jan 2015 21:18:28 +0000 (21:18 +0000)]
ext2: fix for uninitialized pointer read.

path.ep_bp was being used uninitialized in ext4_ext_find_extent().

CID: 1062344
MFC after: 1 week

9 years agoRemove an unnecessary check.
Michael Tuexen [Sun, 18 Jan 2015 21:16:22 +0000 (21:16 +0000)]
Remove an unnecessary check.

Reported by: Coverity
CID: 749576
MFC after: 1 week

9 years agoAdd protection code to free memory in case of processing an address which
Michael Tuexen [Sun, 18 Jan 2015 20:53:20 +0000 (20:53 +0000)]
Add protection code to free memory in case of processing an address which
is neither IPv4 or IPv6.

Reported by: Coverity
CID: 749311
MFC after: 1 week

9 years agoSave the command-and-flags value into the shadow register when it is written.
Ian Lepore [Sun, 18 Jan 2015 20:47:21 +0000 (20:47 +0000)]
Save the command-and-flags value into the shadow register when it is written.

This doesn't actually change any behavior, because it just allows a 16-bit
read of the command register to return the correct value, and nothing
actually does a 16-bit read of that register.

9 years agoRemove dead code.
Pedro F. Giffuni [Sun, 18 Jan 2015 20:26:27 +0000 (20:26 +0000)]
Remove dead code.

After the ext2 variant of the "orlov allocator" was implemented,
the case for a negative or zero dirsize disappeared.

Drop the dead code and unsign dirsize given that it can't be
negative anyways.

CID: 1008669
MFC after: 1 week

9 years agoRemove an unused variable.
Michael Tuexen [Sun, 18 Jan 2015 20:20:27 +0000 (20:20 +0000)]
Remove an unused variable.

Reported by: Coverity
CID: 750999
MFC after: 1 week

9 years agoUse TOC to look up all kernel globals on powerpc64 instead of doing the
Nathan Whitehorn [Sun, 18 Jan 2015 20:00:33 +0000 (20:00 +0000)]
Use TOC to look up all kernel globals on powerpc64 instead of doing the
non-relocatable lis @ha, ori @l dance and hoping they are below 4 GB.

MFC after: 2 months

9 years agoRefactor PowerPC (especially AIM) init sequence to be less baroque.
Nathan Whitehorn [Sun, 18 Jan 2015 18:32:43 +0000 (18:32 +0000)]
Refactor PowerPC (especially AIM) init sequence to be less baroque.

MFC after: 2 months

9 years agoFix bsdinstall when working with geli boot disks
Steven Hartland [Sun, 18 Jan 2015 18:25:12 +0000 (18:25 +0000)]
Fix bsdinstall when working with geli boot disks

PR: 196790
Differential Revision: https://reviews.freebsd.org/D566
Submitted by: Michael Gmelin <grembo@FreeBSD.org>
MFC after: 2 weeks
Sponsored by: Multiplay

9 years agoRefactor / restructure the RSS code into generic, IPv4 and IPv6 specific
Adrian Chadd [Sun, 18 Jan 2015 18:06:40 +0000 (18:06 +0000)]
Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific
bits.

The motivation here is to eventually teach netisr and potentially
other networking subsystems a bit more about how RSS work queues / buckets
are configured so things have a hope of auto-configuring in the future.

* net/rss_config.[ch] takes care of the generic bits for doing
  configuration, hash function selection, etc;
* topelitz.[ch] is now in net/ rather than netinet/;
* (and would be in libkern if it didn't directly include RSS_KEYSIZE;
  that's a later thing to fix up.)
* netinet/in_rss.[ch] now just contains the IPv4 specific methods;
* and netinet/in6_rss.[ch] now just contains the IPv6 specific methods.

This should have no functional impact on anyone currently using
the RSS support.

Differential Revision: D1383
Reviewed by: gnn, jfv (intel driver bits)

9 years agoOops - use the correct argument order for ar9300_set_beacon().
Adrian Chadd [Sun, 18 Jan 2015 17:43:00 +0000 (17:43 +0000)]
Oops - use the correct argument order for ar9300_set_beacon().

(It's only an issue in AP/adhoc modes. But, still. Grr.)

9 years agoFix minor syntax and grammar errors in the markup of the ee(1) man page
Allan Jude [Sun, 18 Jan 2015 17:25:41 +0000 (17:25 +0000)]
Fix minor syntax and grammar errors in the markup of the ee(1) man page

Differential Revision: https://reviews.freebsd.org/D1552
Submitted by: bcallah@openbsd.org (original)
Approved by: wblock (mentor)
MFC after: 1 week
Sponsored by: ScaleEngine Inc.

9 years agoAdd procctl(2) PROC_TRACE_CTL command to enable or disable debugger
Konstantin Belousov [Sun, 18 Jan 2015 15:13:11 +0000 (15:13 +0000)]
Add procctl(2) PROC_TRACE_CTL command to enable or disable debugger
attachment to the process.  Note that the command is not intended to
be a security measure, rather it is an obfuscation feature,
implemented for parity with other operating systems.

Discussed with: jilles, rwatson
Man page fixes by: rwatson
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoMake SIGSTOP working for sleeps done while waiting for fifo readers or
Konstantin Belousov [Sun, 18 Jan 2015 15:03:26 +0000 (15:03 +0000)]
Make SIGSTOP working for sleeps done while waiting for fifo readers or
writers in open(2), when the fifo is located on an NFS mount.

Reported by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoUpgrade our copy of clang and llvm to 3.5.1 release. This is a bugfix
Dimitry Andric [Sun, 18 Jan 2015 14:14:47 +0000 (14:14 +0000)]
Upgrade our copy of clang and llvm to 3.5.1 release.  This is a bugfix
only release, no new features have been added.

Please note that this version requires C++11 support to build; see
UPDATING for more information.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.5.1/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.5.1/tools/clang/docs/ReleaseNotes.html>

MFC after: 1 month
X-MFC-With: 276479

9 years agoMake the linuxapi module only build when WITH_OFED=YES is specified.
Hans Petter Selasky [Sun, 18 Jan 2015 14:04:55 +0000 (14:04 +0000)]
Make the linuxapi module only build when WITH_OFED=YES is specified.
There needs to be some more testing done before it is ready for all
platforms and architectures.

MFC after: 1 month
Sponsored by: Mellanox Technologies
Reported by: bz@

9 years agoWhen disabling C3+ CPU states due to the CPU_QUIRK_NO_C3 quirk, don't
Colin Percival [Sun, 18 Jan 2015 12:45:26 +0000 (12:45 +0000)]
When disabling C3+ CPU states due to the CPU_QUIRK_NO_C3 quirk, don't
accidentally enable non-existent states.

This bug was triggered if ACPI advertises the presence of a C2 state
which we fail to parse via acpi_PkgGas due to our lack of support for
FFixedHW resources, and causes an immediate panic when an attempt is
made to enter the (NULL) state.

One affected platform is the EC2 c4.8xlarge VM instance type; there
may be others.

MFC after: 1 week
Thanks to: jkim, @_msw_

9 years agoExtend fixes made in r277308 to fix build of LINT kernels for i386 and
Hans Petter Selasky [Sun, 18 Jan 2015 10:53:48 +0000 (10:53 +0000)]
Extend fixes made in r277308 to fix build of LINT kernels for i386 and
amd64. Until further we need some custom C-flags when building the
Linux compat API.

MFC after: 1 month
Sponsored by: Mellanox Technologies
Reported by: bz@

9 years agoUse proper signed types. The ADT746x uses signed 8-bit numbers for the
Justin Hibbits [Sun, 18 Jan 2015 07:08:06 +0000 (07:08 +0000)]
Use proper signed types.  The ADT746x uses signed 8-bit numbers for the
temperature.

MFC after: 2 weeks

9 years agoFix programming timing parameters to LCDC. Actual value used for HBP, HFP, HSW, VSW
Oleksandr Tymoshenko [Sun, 18 Jan 2015 06:43:09 +0000 (06:43 +0000)]
Fix programming timing parameters to LCDC. Actual value used for HBP, HFP, HSW, VSW
is register's programmed value + 1.

9 years agoInclude mca_machdep.h.
Warner Losh [Sun, 18 Jan 2015 03:43:47 +0000 (03:43 +0000)]
Include mca_machdep.h.

9 years agoSimplify instruction restart logic in bhyve.
Neel Natu [Sun, 18 Jan 2015 03:08:30 +0000 (03:08 +0000)]
Simplify instruction restart logic in bhyve.

Keep track of the next instruction to be executed by the vcpu as 'nextrip'.
As a result the VM_RUN ioctl no longer takes the %rip where a vcpu should
start execution.

Also, instruction restart happens implicitly via 'vm_inject_exception()' or
explicitly via 'vm_restart_instruction()'. The APIs behave identically in
both kernel and userspace contexts. The main beneficiary is the instruction
emulation code that executes in both contexts.

bhyve(8) VM exit handlers now treat 'vmexit->rip' and 'vmexit->inst_length'
as readonly:
- Restarting an instruction is now done by calling 'vm_restart_instruction()'
  as opposed to setting 'vmexit->inst_length' to 0 (e.g. emulate_inout())
- Resuming vcpu at an arbitrary %rip is now done by setting VM_REG_GUEST_RIP
  as opposed to changing 'vmexit->rip' (e.g. vmexit_task_switch())

Differential Revision: https://reviews.freebsd.org/D1526
Reviewed by: grehan
MFC after: 2 weeks

9 years agoMake the error message explicit instead of just printing the usage if the
Neel Natu [Sun, 18 Jan 2015 01:50:10 +0000 (01:50 +0000)]
Make the error message explicit instead of just printing the usage if the
virtual machine name is not specified.

Requested by: grehan
MFC after: 1 week

9 years agoThere are still kernel configs and mk files depending on the OFED option.
Bjoern A. Zeeb [Sun, 18 Jan 2015 01:28:08 +0000 (01:28 +0000)]
There are still kernel configs and mk files depending on the OFED option.
This will need a proper cleanup and in the meantime after r277302 unbreak
LINT builds.

9 years agoAdd a new SDHCI quirk, SDHCI_QUIRK_DONT_SET_HISPD_BIT. Apparently some
Ian Lepore [Sat, 17 Jan 2015 19:57:03 +0000 (19:57 +0000)]
Add a new SDHCI quirk, SDHCI_QUIRK_DONT_SET_HISPD_BIT.  Apparently some
sdhci controllers, such as the one on a Raspberry Pi, mishandle the signal
timing in high speed signaling mode, but run just fine in standard mode
with the bus running at frequencies between 25-50MHz (which shouldn't work).

This is the solution adopted by U-Boot and other OSes (linux and *BSD)
for the timeouts on Raspberry Pi boards with certain SD cards.  Some
research shows that this quirk is also used on a few other boards, so the
fix is a generic quirk instead of being in the RPi-specific driver code.

This change is based on information discovered by Michal Meloun.

9 years agoAdd defines for SDHCI 3.0 controllers.
Ian Lepore [Sat, 17 Jan 2015 18:56:22 +0000 (18:56 +0000)]
Add defines for SDHCI 3.0 controllers.

Submitted by: Michal Meloun <meloun@miracle.cz>

9 years agoMinor cleanups, comment changes. No need to load 3 values when setting up
Ian Lepore [Sat, 17 Jan 2015 18:40:46 +0000 (18:40 +0000)]
Minor cleanups, comment changes.  No need to load 3 values when setting up
the stack for secondary cores, the other two values are only used for zeroing
bss on the primary core.  No need to store the size of the stack at the
top of the stack (seems to be a leftover instruction from some cut-n-paste).

9 years agoCorrect the descriptor length for AR9462/AR9565 and set the final field
Adrian Chadd [Sat, 17 Jan 2015 17:37:08 +0000 (17:37 +0000)]
Correct the descriptor length for AR9462/AR9565 and set the final field
to zero - TX drops are otherwise reported.

Tested:

* AR9462 (WB222), STA mode

Obtained from: Linux ath9k

9 years agoSkip the OFDM weak signal threshold detection programming for
Adrian Chadd [Sat, 17 Jan 2015 17:31:47 +0000 (17:31 +0000)]
Skip the OFDM weak signal threshold detection programming for
AR9462/AR9565.

This and some upcoming changes to the HAL for these chips should
address some of the signal sensitivity reported by users.

Tested:

* AR9462 (WB222), STA mode

Obtained from: Linux ath9k

9 years agoStart importing the basic OFED linux compatibility layer changes made
Hans Petter Selasky [Sat, 17 Jan 2015 16:36:39 +0000 (16:36 +0000)]
Start importing the basic OFED linux compatibility layer changes made
by dumbbell@ to be able to compile this layer as a dependency module.
Clean up some Makefiles and remove the no longer used OFED define.
Currently only i386 and amd64 targets are supported.

MFC after: 1 month
Sponsored by: Mellanox Technologies

9 years agoext2: cosmetical issues
Pedro F. Giffuni [Sat, 17 Jan 2015 15:19:18 +0000 (15:19 +0000)]
ext2: cosmetical issues

Minor sorting and note when the cases are expected to fall through.

MFC after: 1 week

9 years agoMechanically convert cddl sun #ifdef's to illumos
Steven Hartland [Sat, 17 Jan 2015 14:44:59 +0000 (14:44 +0000)]
Mechanically convert cddl sun #ifdef's to illumos

Since the upstream for cddl code is now illumos not sun, mechanically
convert all sun #ifdef's to illumos #ifdef's which have been used in all
newer code for some time.

Also do a manual pass to correct the use if #ifdef comments as per style(9)
as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos.

MFC after: 1 month
Sponsored by: Multiplay

9 years agoo Notify USB host about connection when operating in device mode.
Ruslan Bukin [Sat, 17 Jan 2015 12:31:26 +0000 (12:31 +0000)]
o Notify USB host about connection when operating in device mode.
  Required when communicating to Mac OS X USB host stack.
o Also don't set stall bit to TX pipe in device mode as seems Mac OS X
  don't clears it as it should.

Discussed with: hselasky@

9 years agoFix condition and really sort ports. Also add comment describing
Andrey V. Elsukov [Sat, 17 Jan 2015 11:32:09 +0000 (11:32 +0000)]
Fix condition and really sort ports. Also add comment describing
the intent of this code.

Reported by: sbruno
MFC after: 1 week
Sponsored by: Yandex LLC

9 years agoloader: use correct types for parse_modmetadata
Roger Pau Monné [Sat, 17 Jan 2015 08:09:07 +0000 (08:09 +0000)]
loader: use correct types for parse_modmetadata

Use the proper types in parse_modmetadata for the p_start and p_end
parameters. This was causing problems in the ARM 32bit loader.

Sponsored by: Citrix Systems R&D
Reported and Tested by: ian

9 years agoOops; correctly reload the CCA registers with the uncapped value
Adrian Chadd [Sat, 17 Jan 2015 07:33:02 +0000 (07:33 +0000)]
Oops; correctly reload the CCA registers with the uncapped value
in prep for the next NF calibration pass.

Totally missing braces.  Damn you C.

Submitted by: Sascha Wildner <swildner@dragonflybsd.org>
MFC after: 1 week

9 years agoReturn an appropriate error code in the case of a missing property rather
Nathan Whitehorn [Sat, 17 Jan 2015 07:01:51 +0000 (07:01 +0000)]
Return an appropriate error code in the case of a missing property rather
than random numbers.

MFC after: 1 week

9 years agoOverride the bt enable/disable methods for AR9462 (jupiter) and
Adrian Chadd [Sat, 17 Jan 2015 06:43:30 +0000 (06:43 +0000)]
Override the bt enable/disable methods for AR9462 (jupiter) and
AR9565 (Aphrodite.)  These need to use the MCI routines, not
the legacy 2-wire / 3-wire bluetooth coexistence methods.

Tested:

* AR9462 (WB222); STA mode

9 years agoNeed to include opt_mca.h to test for DEV_MCA.
Warner Losh [Sat, 17 Jan 2015 02:17:59 +0000 (02:17 +0000)]
Need to include opt_mca.h to test for DEV_MCA.

9 years agoMove DEV_ entries scattered to their common section. Add DEV_PCI.
Warner Losh [Sat, 17 Jan 2015 02:17:57 +0000 (02:17 +0000)]
Move DEV_ entries scattered to their common section. Add DEV_PCI.

9 years agoThe sn driver isn't UCODE sourceless. While it is true there's an
Warner Losh [Sat, 17 Jan 2015 02:17:55 +0000 (02:17 +0000)]
The sn driver isn't UCODE sourceless. While it is true there's an
binary FPGA image that's in an include file in this directory, that
include file isn't actually used. It is only for certain Trump Cards
that we don't yet support. When support was anticipated for them, we
got permission to include the required FPGA image in our sources under
the BSDL, but didn't start actually including the file. This was done
to provide a public paper trail for this file.

9 years agoFix lib/libthr/tests/detach_test
Enji Cooper [Sat, 17 Jan 2015 00:58:24 +0000 (00:58 +0000)]
Fix lib/libthr/tests/detach_test

- Eliminate race with liberal use of sleep(3) [1]
- Fix NetBSD-specific implementation way of testing result from pthread_cancel
  by testing with `td` instead of `NULL` [2]

PR: 196738 [1]
PR: 191906 [2]

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoUntil there's a full MCI implementation - just implement a placeholder
Adrian Chadd [Sat, 17 Jan 2015 00:02:18 +0000 (00:02 +0000)]
Until there's a full MCI implementation - just implement a placeholder
MCI bluetooth coexistence method for WB222.

The rest of MCI requires a bunch more work, including adding a DMA buffer
for the MCI hardware to bounce messages in/out of and handling MCI
interrupts.  But the more important part here is telling the HAL
the btcoex is enabled and MCI is in use so it configures the correct
initial bluetooth parameters in the wireless NIC and configures
things like bluetooth traffic weights and such.

So, this at least gets the HAL to do some of the right things in
configuring the inital bluetooth coexistence stuff, but doesn't
actually do full btcoex.  That'll take.. some effort.

Tested:

* AR9462 (WB222), STA mode

9 years agoTie in the MCI bluetooth coexistence functions into the HAL.
Adrian Chadd [Fri, 16 Jan 2015 23:48:28 +0000 (23:48 +0000)]
Tie in the MCI bluetooth coexistence functions into the HAL.

Tested:

* AR9462 (WB222)

9 years agoAdd bluetooth MCI coexistence HAL methods - used for AR9462 and AR9565 NICs.
Adrian Chadd [Fri, 16 Jan 2015 23:47:42 +0000 (23:47 +0000)]
Add bluetooth MCI coexistence HAL methods - used for AR9462 and AR9565 NICs.

It's found, amongst other things, in the Acer Chromebook (Intel)
devices.

Tested:

* AR9462 (WB222)

Obtained from: Qualcomm Atheros