]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoAdd support for vendor specific function for PCI devid acquisition in ITS
zbb [Tue, 21 Jul 2015 14:47:23 +0000 (14:47 +0000)]
Add support for vendor specific function for PCI devid acquisition in ITS

It is possible that some HW will use different PCI devids,
hence allow to replace the default domain:bus:slot:func schema
by implementing and registering custom function.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3118

8 years agoThe part of r285680 which removed release semantic for two stores to
kib [Tue, 21 Jul 2015 14:39:34 +0000 (14:39 +0000)]
The part of r285680 which removed release semantic for two stores to
it_need was wrong [*].  Restore the releases and add a comment
explaining why it is needed.

Noted by: alc [*]
Reviewed by: bde [*]
Sponsored by: The FreeBSD Foundation

8 years agoDescribe COMPAT_CLOUDABI64 in the amd64 configuration NOTES file.
ed [Tue, 21 Jul 2015 12:53:47 +0000 (12:53 +0000)]
Describe COMPAT_CLOUDABI64 in the amd64 configuration NOTES file.

8 years agoImplement get_cyclecount() on ARM64
zbb [Tue, 21 Jul 2015 12:50:45 +0000 (12:50 +0000)]
Implement get_cyclecount() on ARM64

Use Vritual Counter register associated with Generic Timer to
read the cyclecount.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3134

8 years agoMake thread creation work for CloudABI processes.
ed [Tue, 21 Jul 2015 12:47:15 +0000 (12:47 +0000)]
Make thread creation work for CloudABI processes.

Summary:
Remove the stub system call that was put in place during the system call
import and replace it by a target-dependent version stored in sys/amd64.
Initialize the thread in a way similar to cpu_set_upcall_kse(). We
provide the entry point with two arguments: the thread ID and the
argument pointer.

Test Plan:
Thread creation still seems to work, both for FreeBSD and CloudABI
binaries.

Reviewers: dchagin, mjg, kib

Reviewed By: kib

Subscribers: imp

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

8 years agoImprove ARM64 CPU_MATCH
zbb [Tue, 21 Jul 2015 12:15:00 +0000 (12:15 +0000)]
Improve ARM64 CPU_MATCH

Add a method to identify CPU based on RAW MIDR value.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3117

8 years agoUnbreak "last reboot".
ed [Tue, 21 Jul 2015 10:52:05 +0000 (10:52 +0000)]
Unbreak "last reboot".

According to the last(1) man page, the "reboot" pseudo-user should print
all system reboot entries. This got broken by the utmpx import, as
records are typed.

Re-add support for "last reboot" by specifically matching against
SHUTDOWN_TIME and BOOT_TIME records.

PR: 168844
Submitted by: matthew@
MFC after: 1 month

8 years agoFix sb_state constant names as used e.g. to display in DDB ``show sockbuf''.
pluknet [Tue, 21 Jul 2015 09:57:13 +0000 (09:57 +0000)]
Fix sb_state constant names as used e.g. to display in DDB ``show sockbuf''.

MFC after: 1 week

8 years agoWhen a tunneling protocol is being used with UDP we must release the
rrs [Tue, 21 Jul 2015 09:54:31 +0000 (09:54 +0000)]
When a tunneling protocol is being used with UDP we must release the
lock on the INP before calling the tunnel protocol, else a LOR
may occur (it does with SCTP for sure). Instead we must acquire a
ref count and release the lock, taking care to allow for the case
where the UDP socket has gone away and *not* unlocking since the
refcnt decrement on the inp will do the unlock in that case.

Reviewed by: tuexen
MFC after: 3 weeks

8 years agoAdd missing priority argument in example code in BUGS section.
pluknet [Tue, 21 Jul 2015 09:44:45 +0000 (09:44 +0000)]
Add missing priority argument in example code in BUGS section.

PR: 201725
Submitted by: Thomas Cort
MFC after: 1 week

8 years agoRemove a couple of TUNABLE_INT() calls which are unnecessary after r267961.
hiren [Tue, 21 Jul 2015 06:48:36 +0000 (06:48 +0000)]
Remove a couple of TUNABLE_INT() calls which are unnecessary after r267961.
r267961 did remove them but they "reappeared" when ixgbe(4) rewrite happened in
r280182.

Sponsored by: Limelight Networks

8 years agolseek() allows an offset to be set beyond the end of file. Using
ae [Tue, 21 Jul 2015 06:18:42 +0000 (06:18 +0000)]
lseek() allows an offset to be set beyond the end of file. Using
it to check that partition has enough space to write bootcode doesn't
work. Use the known size of provider instead.

PR: 201504
MFC after: 1 week

8 years agoFix some issues with the application of libxo to ls(1)
allanjude [Tue, 21 Jul 2015 05:03:59 +0000 (05:03 +0000)]
Fix some issues with the application of libxo to ls(1)

* Add whitespace trimming to some fields (username, group, size, inode, blocks) to avoid whitespace in JSON strings
* fix -m mode, was invalid JSON (repeated keys), and was missing outer array container
* in -n mode, numeric uids and gids were returned as strings

Approved by: eadler (mentor)
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D2854

8 years agoFix an out-of-order execution issue regarding pkg(8):
gjb [Tue, 21 Jul 2015 03:18:53 +0000 (03:18 +0000)]
Fix an out-of-order execution issue regarding pkg(8):
- pkg(8) cannot be removed before subsequent reinvocations
- The PKG_CACHEDIR cannot be cleaned after the repo*.sqlite
  has been removed
- pkg(8) cannot be removed as a precursor to any of the other
  steps involved here

MFC after: 3 days
X-MFC-With: r285722
X-MFC-Before: 10.2-{BETA3,RC1} (whichever happens next)
Sponsored by: The FreeBSD Foundation

8 years agoAdd the Dell E7240 laptop and Intel DP965LT motherboard to the list for the GPT activ...
allanjude [Tue, 21 Jul 2015 00:33:15 +0000 (00:33 +0000)]
Add the Dell E7240 laptop and Intel DP965LT motherboard to the list for the GPT active workaround

PR: 194359
Requested by: sbruno, hiren
Approved by: marcel
MFC after: 3 days
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3139

8 years agoOnly report the lack of ALTQ support if pfctl is using verbose (-v) mode.
gnn [Mon, 20 Jul 2015 23:24:25 +0000 (23:24 +0000)]
Only report the lack of ALTQ support if pfctl is using verbose (-v) mode.

PR: 194935
Submitted by: Jim Thompson
MFC after: 2 weeks

8 years agoTypo in comment.
kib [Mon, 20 Jul 2015 19:51:41 +0000 (19:51 +0000)]
Typo in comment.

8 years agoIncrease output amp on ASUS UX31A by +5dB.
mav [Mon, 20 Jul 2015 17:48:00 +0000 (17:48 +0000)]
Increase output amp on ASUS UX31A by +5dB.

While there, implement couple helper functions.

8 years agoAdd support for building VirtualBox Vagrant images.
brd [Mon, 20 Jul 2015 16:27:44 +0000 (16:27 +0000)]
Add support for building VirtualBox Vagrant images.
Abstract the build, package and upload to handle building either type.

Approved by: re (gjb)

8 years agolibusb: Fix minor cast-qual warning.
pfg [Mon, 20 Jul 2015 16:15:56 +0000 (16:15 +0000)]
libusb: Fix minor cast-qual warning.

Fix a warning triggered by the gcc + FORTIFY_SOURCE patches:

In function 'libusb20_parse_config_desc': lib/libusb/libusb20_desc.c:141:
warning: passing argument 1 of 'memcpy' discards qualifiers from pointer
target type

Submitted by: hselansky

8 years agosnmp_hostres(3): Fix buffer overflow.
pfg [Mon, 20 Jul 2015 16:08:01 +0000 (16:08 +0000)]
snmp_hostres(3): Fix buffer overflow.

Actually just a typo. Detected by gcc + FORTIFY_SOURCE patches.

CID: 1007594
MFC after: 3 days

8 years agoMake forking of CloudABI processes work.
ed [Mon, 20 Jul 2015 13:46:22 +0000 (13:46 +0000)]
Make forking of CloudABI processes work.

Just like FreeBSD+Capsicum, CloudABI uses process descriptors. Return
the file descriptor number to the parent process.

To the child process we both return a special value for the file
descriptor number (CLOUDABI_PROCESS_CHILD). We also return the thread ID
of the new thread in the copied process, so the threading library can
reinitialize itself.

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

8 years agoAdd an API for easily creating userspace threads in kernelspace.
ed [Mon, 20 Jul 2015 10:20:04 +0000 (10:20 +0000)]
Add an API for easily creating userspace threads in kernelspace.

This change refactors the existing create_thread() function to be more
generic. It replaces almost all of its arguments by a callback that can
be used to extract the thread ID and copy it out to the right place, but
also to perform additional initialization steps, such as setting the
trapframe. This also makes the difference between thr_new() and
thr_create() more clear in my opinion.

This function is going to be used by the CloudABI compatibility layer.

It looks like the OpenSolaris compatibility framework already provides a
function called thread_create(). Rename this function to
do_thread_create() and use a macro to deal with the namespacing
conflict. A similar approach is already used for thread_exit().

MFC after: 1 month

8 years agoFix typo in comment.
mav [Mon, 20 Jul 2015 09:37:42 +0000 (09:37 +0000)]
Fix typo in comment.

Submitted by: Masao Uebayashi

8 years agoPrevent null-pointer dereferencing.
zec [Mon, 20 Jul 2015 08:21:51 +0000 (08:21 +0000)]
Prevent null-pointer dereferencing.

MFC after: 3 days

8 years agoAdd helper functions for IP checksum adjusting. Use these functions in
ae [Mon, 20 Jul 2015 07:26:31 +0000 (07:26 +0000)]
Add helper functions for IP checksum adjusting. Use these functions in
dummynet code and for setdscp. This fixes wrong checksums in some cases.

Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC

8 years agoAdd LLE event handler to report ND6 events to userland via rtsock.
ae [Mon, 20 Jul 2015 06:58:32 +0000 (06:58 +0000)]
Add LLE event handler to report ND6 events to userland via rtsock.

Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC

8 years agoInvoke LLE event handler when entry is deleted.
ae [Mon, 20 Jul 2015 06:54:50 +0000 (06:54 +0000)]
Invoke LLE event handler when entry is deleted.

MFC after: 2 weeks
Sponsored by: Yandex LLC

8 years agoDeclare lockstat_enabled even when KDTRACE_HOOKS is not defined.
markj [Mon, 20 Jul 2015 04:41:25 +0000 (04:41 +0000)]
Declare lockstat_enabled even when KDTRACE_HOOKS is not defined.

Reported by: bz
X-MFC-With: r285704

8 years agoFix some libxo format string errors in the pfkey stats code.
markj [Mon, 20 Jul 2015 02:38:51 +0000 (02:38 +0000)]
Fix some libxo format string errors in the pfkey stats code.

PR: 201700

8 years agoCheck the hw.proto.attach environment variable for devices that
marcel [Sun, 19 Jul 2015 23:37:45 +0000 (23:37 +0000)]
Check the hw.proto.attach environment variable for devices that
proto(4) should attach to instead of the normal driver.

Document the variable.

8 years agoDon't increment the spin count until after the first attempt to acquire a
markj [Sun, 19 Jul 2015 22:26:02 +0000 (22:26 +0000)]
Don't increment the spin count until after the first attempt to acquire a
rwlock read lock. Otherwise the lockstat:::rw-spin probe will fire
spuriously.

MFC after: 1 week

8 years agoRestructure code for readability improvement. No functional change.
mckusick [Sun, 19 Jul 2015 22:25:16 +0000 (22:25 +0000)]
Restructure code for readability improvement. No functional change.

Reviewed by: kib

8 years agoConsistently use a reader/writer flag for lockstat probes in rwlock(9) and
markj [Sun, 19 Jul 2015 22:24:33 +0000 (22:24 +0000)]
Consistently use a reader/writer flag for lockstat probes in rwlock(9) and
sx(9), rather than using the probe function name to determine whether a
given lock is a read lock or a write lock. Update lockstat(1) accordingly.

8 years agoImplement the lockstat provider using SDT(9) instead of the custom provider
markj [Sun, 19 Jul 2015 22:14:09 +0000 (22:14 +0000)]
Implement the lockstat provider using SDT(9) instead of the custom provider
in lockstat.ko. This means that lockstat probes now have typed arguments and
will utilize SDT probe hot-patching support when it arrives.

Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D2993

8 years agoDrop libarchive.pc
bapt [Sun, 19 Jul 2015 21:31:52 +0000 (21:31 +0000)]
Drop libarchive.pc

We want to ensure we always use libarchive from ports in the ports tree.
It simplifies ports maintainance and anyway libarchive.pc was not reflecting the
different way libarchive can be built in base

8 years agoUse fixed date/time (the time choosen was the time the import was done on
delphij [Sun, 19 Jul 2015 19:23:38 +0000 (19:23 +0000)]
Use fixed date/time (the time choosen was the time the import was done on
-HEAD) in libntp so we can make reproducible build.

PR: bin/201661
Reviewed by: gjb, cy, roberto
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D3122

8 years agoFix some untidy logic. I committed the wrong local fix; please pass the pointy hat.
markm [Sun, 19 Jul 2015 18:07:35 +0000 (18:07 +0000)]
Fix some untidy logic. I committed the wrong local fix; please pass the pointy hat.

Approved by:        so (/dev/random blanket)

8 years agoadd a use count so the netmap module cannot be unloaded while in use.
luigi [Sun, 19 Jul 2015 18:07:25 +0000 (18:07 +0000)]
add a use count so the netmap module cannot be unloaded while in use.

8 years agoproperly destroy persistent vale ports
luigi [Sun, 19 Jul 2015 18:06:30 +0000 (18:06 +0000)]
properly destroy persistent vale ports

8 years agodo not free NULL if pipe allocation fails
luigi [Sun, 19 Jul 2015 18:05:49 +0000 (18:05 +0000)]
do not free NULL if pipe allocation fails

8 years agorelease a reference when stopping a monitor
luigi [Sun, 19 Jul 2015 18:04:51 +0000 (18:04 +0000)]
release a reference when stopping a monitor

8 years agosmall documentation update
luigi [Sun, 19 Jul 2015 17:54:42 +0000 (17:54 +0000)]
small documentation update

8 years agoFix atomic_store_64, it should write the value passed in, not the value
andrew [Sun, 19 Jul 2015 16:55:47 +0000 (16:55 +0000)]
Fix atomic_store_64, it should write the value passed in, not the value
read by the load.

Pointy Hat: andrew

8 years agoRemove out-of-date comments.
markm [Sun, 19 Jul 2015 16:05:34 +0000 (16:05 +0000)]
Remove out-of-date comments.

Approved by:        so (/dev/random blanket)

8 years agoFix the read blocking so that it is interruptable and slow down the rate of console...
markm [Sun, 19 Jul 2015 16:05:30 +0000 (16:05 +0000)]
Fix the read blocking so that it is interruptable and slow down the rate of console warning spamming while blocked.

Approved by: so (/dev/random blanket)

8 years agoClarify the intent of the RANDOM_* options.
markm [Sun, 19 Jul 2015 16:05:26 +0000 (16:05 +0000)]
Clarify the intent of the RANDOM_* options.

Approved by: so (/dev/random blanket)

8 years agoOptimise the buffer-size calculation. It was possible to get one block too many.
markm [Sun, 19 Jul 2015 16:05:23 +0000 (16:05 +0000)]
Optimise the buffer-size calculation. It was possible to get one block too many.

Approved by: so (/dev/random blanket)

8 years agoClean up the style of the armv6 atomic code.
andrew [Sun, 19 Jul 2015 15:44:51 +0000 (15:44 +0000)]
Clean up the style of the armv6 atomic code.

Sponsored by: ABT Systems Ltd

8 years agoClean up some trailing whitespace.
markm [Sun, 19 Jul 2015 14:34:35 +0000 (14:34 +0000)]
Clean up some trailing whitespace.

8 years agoSort the ARM atomic functions to be in alphabetical order.
andrew [Sun, 19 Jul 2015 13:10:47 +0000 (13:10 +0000)]
Sort the ARM atomic functions to be in alphabetical order.

Sponsored by: ABT Systems Ltd

8 years agoRevert bit of the r285627, locore.s does not need include of
kib [Sun, 19 Jul 2015 10:45:58 +0000 (10:45 +0000)]
Revert bit of the r285627, locore.s does not need include of
opt_kstack_pages.h.  The asm gets the right KSTACK_PAGES from the
assym.s.

Reported by: bz
Sponsored by: The FreeBSD Foundation

8 years agoAdd support to the jail framework to be able to mount linsysfs(5) and
araujo [Sun, 19 Jul 2015 08:52:35 +0000 (08:52 +0000)]
Add support to the jail framework to be able to mount linsysfs(5) and
linprocfs(5).

Differential Revision: D2846
Submitted by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Reviewed by: jamie

8 years ago- Record dependencies of gdb/gdbtui/kgdb on binutils/lib{bfd,iberty,opcodes},
marius [Sun, 19 Jul 2015 00:38:19 +0000 (00:38 +0000)]
- Record dependencies of gdb/gdbtui/kgdb on binutils/lib{bfd,iberty,opcodes},
  fixing parallel builds.
- Don't build gdb/gdbtui/kgdb or libreadline when MK_BINUTILS is "no" for
  obvious reasons.

MFC after: 3 days

8 years agomove the prototype to the lib.h header.. This makes more sense, and
jmg [Sat, 18 Jul 2015 22:47:46 +0000 (22:47 +0000)]
move the prototype to the lib.h header..  This makes more sense, and
it's an API between boot2.c and arm_init.S which calls it..

8 years agoother fixes to make boot2 compile for IXP... Properly end the asm
jmg [Sat, 18 Jul 2015 20:21:25 +0000 (20:21 +0000)]
other fixes to make boot2 compile for IXP...  Properly end the asm
sections, and for some reason, main needs a prototype... If someone
has a better fix, I'm all ears...

Pointed out by: Berislav Purgar

8 years agorevert r278579, this is in a different compile environment than the
jmg [Sat, 18 Jul 2015 20:19:51 +0000 (20:19 +0000)]
revert r278579, this is in a different compile environment than the
kernel, and needs to be named cpu_id...

Pointed out by: Berislav Purgar

8 years agoFurther cleanup after r285607.
kib [Sat, 18 Jul 2015 19:59:29 +0000 (19:59 +0000)]
Further cleanup after r285607.

Remove useless release semantic for some stores to it_need.  For
stores where the release is needed, add a comment explaining why.

Fence after the atomic_cmpset() op on the it_need should be acquire
only, release is not needed (see above).  The combination of
atomic_cmpset() + fence_acq() is better expressed there as
atomic_cmpset_acq().

Use atomic_cmpset() for swi' ih_need read and clear.

Discussed with: alc, bde
Reviewed by: bde
Comments wording provided by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoAdd support for two workarounds for known issues booting GPT in legacy mode on some...
allanjude [Sat, 18 Jul 2015 18:49:44 +0000 (18:49 +0000)]
Add support for two workarounds for known issues booting GPT in legacy mode on some hardware

For Lenovo laptops with buggy bios (x220, t420, t520):
Write the 0xee entry into the second slot in the pmbr instead of the first

For some Dell and HP models:
The BIOS gives a warning message when booting in legacy mode from a GPT partitioned disk where the 0xee partition in the pmbr is not flagged active
For models known to have this problem, mark the pmbr active during installation

Use smbios data to identify machines known to be affected by any of the above, and offer the user the option to apply the workaround

In bsdinstall's ufs auto mode (autopart partition wizard):
Allow users to select which type of partition table to use
Keep current defaults: MBR for BIOS, GPT for UEFI
This allows users to choose GPT for legacy boot if they wish

PR: 184910
PR: 194359
Reviewed by: Michael Dexter
Approved by: marcel
MFC after: 3 days
X-MFC-With: r285594
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3091

8 years agoDeselect the sd card before re-selecting it when working around a problem
ian [Sat, 18 Jul 2015 16:56:51 +0000 (16:56 +0000)]
Deselect the sd card before re-selecting it when working around a problem
with some cards that causes them to become deselected after probing for
switch capabilities.  The old workaround fixes the behavior with some cards,
but causes problems with the cards the behave correctly and don't become
deselected.  Forcing a deselect then reselect appears to work correctly
with all cards in initial testing.

8 years agofix a typo in a comment
luigi [Sat, 18 Jul 2015 15:28:32 +0000 (15:28 +0000)]
fix a typo in a comment

8 years agoExpand sysctl descriptions in iscsi(4) and ctl(4).
trasz [Sat, 18 Jul 2015 15:27:12 +0000 (15:27 +0000)]
Expand sysctl descriptions in iscsi(4) and ctl(4).

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoRemove a comment in the wrong place.
trasz [Sat, 18 Jul 2015 12:25:47 +0000 (12:25 +0000)]
Remove a comment in the wrong place.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

8 years agoDocument suspend/resume notification in devd.conf(5).
trasz [Sat, 18 Jul 2015 12:24:54 +0000 (12:24 +0000)]
Document suspend/resume notification in devd.conf(5).

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

8 years agoAdd CARP events description to devd.conf(5).
trasz [Sat, 18 Jul 2015 12:17:59 +0000 (12:17 +0000)]
Add CARP events description to devd.conf(5).

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

8 years agofstyp(8) ships with 10.2.
trasz [Sat, 18 Jul 2015 12:03:51 +0000 (12:03 +0000)]
fstyp(8) ships with 10.2.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agouefisign(8) ships with 10.2.
trasz [Sat, 18 Jul 2015 12:03:17 +0000 (12:03 +0000)]
uefisign(8) ships with 10.2.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoThe si_status field of the siginfo_t, provided by the waitid(2) and
kib [Sat, 18 Jul 2015 09:02:50 +0000 (09:02 +0000)]
The si_status field of the siginfo_t, provided by the waitid(2) and
SIGCHLD signal, should keep full 32 bits of the status passed to the
_exit(2).

Split the combined p_xstat of the struct proc into the separate exit
status p_xexit for normal process exit, and signalled termination
information p_xsig.  Kernel-visible macro KW_EXITCODE() reconstructs
old p_xstat from p_xexit and p_xsig.  p_xexit contains complete status
and copied out into si_status.

Requested by: Joerg Schilling
Reviewed by: jilles (previous version), pho
Tested by: pho
Sponsored by: The FreeBSD Foundation

8 years agoSince the IETF has redefined the meaning of the tos field to accommodate
kevlo [Sat, 18 Jul 2015 06:48:30 +0000 (06:48 +0000)]
Since the IETF has redefined the meaning of the tos field to accommodate
a set of differentiated services, set IPTOS_PREC_* macros using
IPTOS_DSCP_* macro definitions.

While here, add IPTOS_DSCP_VA macro according to RFC 5865.

Differential Revision: https://reviews.freebsd.org/D3119
Reviewed by: gnn

8 years agoFix the !KDTRACE_HOOKS build.
markj [Sat, 18 Jul 2015 04:38:11 +0000 (04:38 +0000)]
Fix the !KDTRACE_HOOKS build.

X-MFC-With: r285664

8 years agoFix contraction spotted by igor(1) and remove 2 .Ed spotted by mandoc(1).
araujo [Sat, 18 Jul 2015 03:14:49 +0000 (03:14 +0000)]
Fix contraction spotted by igor(1) and remove 2 .Ed spotted by mandoc(1).
Also, don't capitalize "module" and remove a redundant phrase introduced
in my previous commit.

Differential Revision: D3112
Reviewed by: wblock
Sponsored by: gandi.net

8 years agoPass the lock object to lockstat_nsecs() and return immediately if
markj [Sat, 18 Jul 2015 00:57:30 +0000 (00:57 +0000)]
Pass the lock object to lockstat_nsecs() and return immediately if
LO_NOPROFILE is set. Some timecounter handlers acquire a spin mutex, and
we don't want to recurse if lockstat probes are enabled.

PR: 201642
Reviewed by: avg
MFC after: 3 days

8 years agoModify lockstat_nsecs() to just return unless lockstat probes are actually
markj [Sat, 18 Jul 2015 00:22:00 +0000 (00:22 +0000)]
Modify lockstat_nsecs() to just return unless lockstat probes are actually
enabled. The cost of a timecounter read can be quite significant, and the
problem became more apparent after r284297, since that change resulted in
a call to lockstat_nsecs() for each acquisition of an rwlock read lock.

PR: 201642
Reviewed by: avg
Tested by: Jason Unovitch
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D3073

8 years agoMerge driver for PMC Sierra's range of SAS/SATA HBAs.
benno [Fri, 17 Jul 2015 23:30:43 +0000 (23:30 +0000)]
Merge driver for PMC Sierra's range of SAS/SATA HBAs.

Submitted by: Achim Leubner <Achim.Leubner@pmcs.com>
Reviewed by: scottl

8 years agoUndo r285656.
ed [Fri, 17 Jul 2015 22:26:45 +0000 (22:26 +0000)]
Undo r285656.

It turns out that the CDDL sources already introduce a function called
thread_create(). I'll investigate what we can do to make these functions
coexist.

Reported by: Ivan Klymenko

8 years agoEnable pms module on amd64 for now.
benno [Fri, 17 Jul 2015 20:30:30 +0000 (20:30 +0000)]
Enable pms module on amd64 for now.

8 years agoDisable debugging.
benno [Fri, 17 Jul 2015 20:29:47 +0000 (20:29 +0000)]
Disable debugging.

Submitted by: Vasanthalakshmi Tharmarajan <Vasanthalakshmi.Tharmarajan@pmcs.com>
Reviewed by: scottl

8 years agomake ctdladm(8) return 0 is everything was ok.
bapt [Fri, 17 Jul 2015 19:10:43 +0000 (19:10 +0000)]
make ctdladm(8) return 0 is everything was ok.

retval is used to test the return of XML_Parse function which is ok if 1 is
returned and retval it directly returned to the main function and used as an
exit value.

if all the parsing part is done reset retval to 0 so that the command return 0
if everything ok

Differential Revision: https://reviews.freebsd.org/D3102
Reviewed by: trasz
MFC after: 3 days
Sponsored by: gandi.net

8 years agoCheck TCP timestamp option flag so that the automatic receive buffer
pkelsey [Fri, 17 Jul 2015 17:36:33 +0000 (17:36 +0000)]
Check TCP timestamp option flag so that the automatic receive buffer
scaling code does not use an uninitialized timestamp echo reply value
from the stack when timestamps are not enabled.

Differential Revision: https://reviews.freebsd.org/D3060
Reviewed by: hiren
Approved by: jmallett (mentor)
MFC after: 3 days
Sponsored by: Norse Corp, Inc.

8 years agoAdd an API for easily creating userspace threads in kernelspace.
ed [Fri, 17 Jul 2015 16:34:01 +0000 (16:34 +0000)]
Add an API for easily creating userspace threads in kernelspace.

This change refactors the existing create_thread() function to be more
generic. It replaces almost all of its arguments by a callback that can
be used to extract the thread ID and copy it out to the right place, but
also to perform additional initialization steps, such as setting the
trapframe. This also makes the difference between thr_new() and
thr_create() more clear in my opinion.

This function is going to be used by the CloudABI compatibility layer.

Reviewed by: kib
MFC after: 1 month

8 years agoFix possible coherency issues between PEs related to I-cache
zbb [Fri, 17 Jul 2015 14:33:47 +0000 (14:33 +0000)]
Fix possible coherency issues between PEs related to I-cache

Basing on B.2.3.4:
Synchronization and coherency issues between data and
instruction accesses.

To ensure that modified instructions are visible to all PEs
(Processing Elements) in a shareability domain one need to
perform following sequence:
    1. Clean D-cache
    2. Ensure the visibility of data cleaned from cache
    3. Invalidate I-cache
    4. Ensure completion
    5. In SMP system PE must issue isb to ensure execution of the
       modified instructions

Reviewed by:   andrew
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3106

8 years agoFix secondary stacks calculation on ARM64
zbb [Fri, 17 Jul 2015 14:08:08 +0000 (14:08 +0000)]
Fix secondary stacks calculation on ARM64

Secondary stack calculation is modified to provide
stack_top = secondary_stacks + (cpu_id) * PAGE_SIZE * KSTACK_PAGES
because on ARM64 the stack grows to lower memory addresses.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3107

8 years agoIncrease DMAP (Direct Map) size on ARM64
zbb [Fri, 17 Jul 2015 13:58:00 +0000 (13:58 +0000)]
Increase DMAP (Direct Map) size on ARM64

Previous DMAP size was too small for systems with more than 64GB
of RAM. Increase it to 128GB to support ThunderX CRB.

Reviewed by:   andrew
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3113

8 years agoImplement CloudABI memory management system calls.
ed [Fri, 17 Jul 2015 09:00:38 +0000 (09:00 +0000)]
Implement CloudABI memory management system calls.

Add support for the <sys/mman.h> functions by wrapping around our own
implementations. There are no kern_*() variants of these system calls,
but we also don't need them in this case. It is sufficient to just call
into the sys_*() functions.

Differential Revision: https://reviews.freebsd.org/D3033
Reviewed by: brooks

8 years agoMove assignments around to avoid a false-positive uninitialized variable
des [Fri, 17 Jul 2015 08:37:13 +0000 (08:37 +0000)]
Move assignments around to avoid a false-positive uninitialized variable
warning which broke the sparc64 build.

PR: 201585
MFC after: 3 weeks

8 years agocxgbe(4): Ask the firmware for the start of the RSS slice for a port and
np [Fri, 17 Jul 2015 06:46:18 +0000 (06:46 +0000)]
cxgbe(4): Ask the firmware for the start of the RSS slice for a port and
save it for later.  This enables direct manipulation of the indirection
tables (although the stock driver doesn't do that right now).

MFC after: 1 month

8 years agoDescribe how to load gmultipath at boot time.
araujo [Fri, 17 Jul 2015 06:34:46 +0000 (06:34 +0000)]
Describe how to load gmultipath at boot time.

Differential Revision: D3112
Reviewed by: allanjude, bapt
Sponsored by: gandi.net

8 years agoMention the dd-like recoverdisk(1) to help folks find this great BSD command.
obrien [Thu, 16 Jul 2015 23:38:12 +0000 (23:38 +0000)]
Mention the dd-like recoverdisk(1) to help folks find this great BSD command.

8 years agosqlite: clean a couple of invocations of memcpy(3)
pfg [Thu, 16 Jul 2015 22:07:13 +0000 (22:07 +0000)]
sqlite: clean a couple of invocations of memcpy(3)

Found almost accidentally by our native gcc when enhanced with
FORTIFY_SOURCE.

Submitted by: Oliver Pinter
Sponosored by: Google Inc. GSoC 2015

8 years agoWhen checking for the valid value of the frame pointer, verify that it
kib [Thu, 16 Jul 2015 19:40:18 +0000 (19:40 +0000)]
When checking for the valid value of the frame pointer, verify that it
belongs to the kernel stack address range for the thread.  Right now,
code checks that new frame is not farther then KSTACK_PAGES pages from
the current frame, which allows the address to point past the top of
the stack.

Reviewed by: andrew, emaste, markj
Differential revision: https://reviews.freebsd.org/D3108
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agossh: canonicize the host name before looking it up in the host file
vangyzen [Thu, 16 Jul 2015 18:44:18 +0000 (18:44 +0000)]
ssh: canonicize the host name before looking it up in the host file

Re-apply r99054 by des in 2002.  This was accidentally dropped
by the update to OpenSSH 6.5p1 (r261320).

This change is actually taken from r387082 of
ports/security/openssh-portable/files/patch-ssh.c

PR: 198043
Differential Revision: https://reviews.freebsd.org/D3103
Reviewed by: des
Approved by: kib (mentor)
MFC after: 3 days
Relnotes: yes
Sponsored by: Dell Inc.

8 years agoAdd a sysentvec for CloudABI on x86-64.
ed [Thu, 16 Jul 2015 18:24:06 +0000 (18:24 +0000)]
Add a sysentvec for CloudABI on x86-64.

Summary:
For CloudABI we need to put two things on the stack of new processes:
the argument data (a binary blob; not strings) and a startup data
structure. The startup data structure contains interesting things such
as a pointer to the ELF program header, the thread ID of the initial
thread, a stack smashing protection canary, and a pointer to the
argument data.

Fetching system call arguments and setting the return value is similar
to FreeBSD. The only differences are that system call 0 does not exist
and that we call into cloudabi_convert_errno() to convert the error
code. We also need this function in a couple of other places, so we'd
better reuse it here.

Reviewers: dchagin, kib

Reviewed By: kib

Subscribers: imp

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

8 years agoDocument r285550, w(1) now displays the full IPv6 address of a remote
gjb [Thu, 16 Jul 2015 17:48:37 +0000 (17:48 +0000)]
Document r285550, w(1) now displays the full IPv6 address of a remote
connected host.

Sponsored by: The FreeBSD Foundation

8 years agoAdd an adapter CORE lock in the DDB hook em_dump_queue to avoid WITNESS
sbruno [Thu, 16 Jul 2015 16:32:57 +0000 (16:32 +0000)]
Add an adapter CORE lock in the DDB hook em_dump_queue to avoid WITNESS
panic in em_init_locked() while debugging.

MFC after: 2 weeks
Sponsored by: Limelight Networks

8 years agoOptimise the DWC OTG host mode driver's transmit path:
hselasky [Thu, 16 Jul 2015 16:08:40 +0000 (16:08 +0000)]
Optimise the DWC OTG host mode driver's transmit path:

1) Use the TX FIFO empty interrupts to poll the transmit FIFO usage,
instead of using own software counters and waiting for SOF
interrupts. Assume that enough FIFO space is available to execute one
USB OUT transfer of any kind when the TX FIFO is empty.

2) Use the host channel halted event to asynchronously wait for host
channels to be disabled instead of waiting for SOF interrupts. This
results in less turnaround time for re-using host channels and at the
same time increases the performance.

The network transmit performance measured by "iperf" for the "RPi-B v1
2011/12" board, increased from 45MBit/s to 65Mbit/s after applying the
changes above.

No regressions seen using:
 - High Speed (BULK, CONTROL, INTERRUPT)
 - Full Speed (All transfer types)
 - Low Speed (Control and Interrupt)

MFC after: 1 month
Submitted by: Daisuke Aoyama <aoyama@peach.ne.jp>

8 years agoFix a small typo: "the the".
ed [Thu, 16 Jul 2015 15:43:55 +0000 (15:43 +0000)]
Fix a small typo: "the the".

Spotted by: wblock

8 years agofd: partially deduplicate fdescfree and fdescfree_remapped
mjg [Thu, 16 Jul 2015 15:26:37 +0000 (15:26 +0000)]
fd: partially deduplicate fdescfree and fdescfree_remapped

This also moves vrele of cdir/rdir/jdir vnodes earlier, which should not
matter.

8 years agoGet rid of lim_update_thread and cred_update_thread.
mjg [Thu, 16 Jul 2015 14:30:11 +0000 (14:30 +0000)]
Get rid of lim_update_thread and cred_update_thread.

Their primary use was in thread_cow_update to free up old resources.
Freeing had to be done with proc lock held and _cow_ funcs already knew
how to free old structs.

8 years agovfs: implement v_holdcnt/v_usecount manipulation using atomic ops
mjg [Thu, 16 Jul 2015 13:57:05 +0000 (13:57 +0000)]
vfs: implement v_holdcnt/v_usecount manipulation using atomic ops

Transitions 0->1 and 1->0 (which decide e.g. on putting the vnode on the free
list) of either counter are still guarded with vnode interlock.

Reviewed by: kib (earlier version)
Tested by: pho

8 years agoSplit out the arm and armv6 parts of atomic.h to new files. While here use
andrew [Thu, 16 Jul 2015 13:33:03 +0000 (13:33 +0000)]
Split out the arm and armv6 parts of atomic.h to new files. While here use
__ARM_ARCH to determine which revision of the architecture is applicable.

Sponsored by: ABT Systems Ltd