]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoAdd reset framework, a second part of new 'extended resources' family of
mmel [Sun, 24 Jan 2016 11:03:35 +0000 (11:03 +0000)]
Add reset framework, a second part of new 'extended resources' family of
support frameworks (i.e. regulators/phy/tsensors/fuses...).

It provides simple unified consumers interface for manipulations with
on-chip resets.

Reviewed by: ian, imp (paritaly)

8 years agoAdd clock framework, a first part of new 'extended resources' family of
mmel [Sun, 24 Jan 2016 11:00:38 +0000 (11:00 +0000)]
Add clock framework, a first part of new 'extended resources' family of
support frameworks(i.e. reset/regulators/phy/tsensors/fuses...).

The clock framework significantly simplifies handling of complex clock
structures found in modern SoCs. It provides the unified consumers
interface, holds and manages actual clock topology, frequency and gating.

It's tested on three different ARM boards (Nvidia Tegra TK1, Inforce 6410 and
Odroid XU2) and on one MIPS board (Creator Ci20) by kan@.

The framework is still far from perfect and probably doesn't have stable
interface yet, but we want to start testing it on more real boards and
different architectures.

Reviewed by: ian, kan (earlier version)

8 years agoext2: rename some directory index constants.
pfg [Sun, 24 Jan 2016 04:30:30 +0000 (04:30 +0000)]
ext2: rename some directory index constants.

Missed from r294653.

Pointyhat: me

8 years agoFix comment.
pfg [Sun, 24 Jan 2016 02:44:00 +0000 (02:44 +0000)]
Fix comment.

8 years agoRename some directory index constants.
pfg [Sun, 24 Jan 2016 02:41:49 +0000 (02:41 +0000)]
Rename some directory index constants.

Directory index was introduced in ext3. We don't always use the
prefix to denote the ext2 variant they belong to but when we
do we should try to be accurate.

8 years agoext2: Initialize i_flag after allocation.
pfg [Sun, 24 Jan 2016 02:25:41 +0000 (02:25 +0000)]
ext2: Initialize i_flag after allocation.

We use i_flag to carry some flags like IN_E4INDEX which newer
ext2fs variants uses internally.

fsck.ext3 rightfully complains after our implementation tags
non-directory inodes with INDEX_FL.

Initializing i_flag during allocation removes the noise factor
and quiets down fsck.

Patch from: Damjan Jovanovic
PR: 206530

8 years agosh: Use OLDPWD shell variable for 'cd -'.
jilles [Sat, 23 Jan 2016 23:00:38 +0000 (23:00 +0000)]
sh: Use OLDPWD shell variable for 'cd -'.

Per POSIX, 'cd -' should use the OLDPWD shell variable, not internal state.
This variable is normally exported.

Also, if OLDPWD is not set, fail 'cd -' instead of changing to the current
directory.

8 years agoUse different ports in the TCP/UDP testcases with the first set and
ngie [Sat, 23 Jan 2016 22:51:22 +0000 (22:51 +0000)]
Use different ports in the TCP/UDP testcases with the first set and
the second set (increment the original ports by 10)

This avoids issues where the first listening socket might not be torn
down by the time it makes it to the second set of testcases.

The sockets should likely only be setup once, but this keeps in the
spirit of the original testcases, so this will be easier to backport
to ^/stable/9

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

8 years agoDon't run the t_cmsg_len testcase on 64-bit architectures
ngie [Sat, 23 Jan 2016 22:49:13 +0000 (22:49 +0000)]
Don't run the t_cmsg_len testcase on 64-bit architectures

It always fails when trying to send through the sendit(9) private KPI in the
kernel due to a size mismatch between the msghdr and data being sent [*], which
suspiciously seems like it's related to sizeof pointers instead of scalars, or
something of that ilk

MFC after: 1 week
PR: 206543, 206544 [*]
Sponsored by: EMC / Isilon Storage Division

8 years ago- Don't return immediately in check_xucred, check_scm_creds_cmsgcred, and
ngie [Sat, 23 Jan 2016 22:44:00 +0000 (22:44 +0000)]
- Don't return immediately in check_xucred, check_scm_creds_cmsgcred, and
  check_scm_creds_sockcred after initial != NULL checks have been done for
  debugging purposes
- Use more terse names for bintime (bt), cmesgcred (cmcred),
  sockcred (sc), and timeval (tv) [*]
- Add some debug messages to better understand some of the flow of the test
  program

MFC after: 1 week
Requested by: bde [*]
Use of the word "terse" (^.^) corrected by: jhb, rpokala [*]
Sponsored by: EMC / Isilon Storage Division

8 years agoDocument that hashinit(9) can wait for memory to be available
bjk [Sat, 23 Jan 2016 20:01:46 +0000 (20:01 +0000)]
Document that hashinit(9) can wait for memory to be available

Also tweak nearby grammar while here.

Submitted by: Daniel O'Connor (original version)

8 years agoAdd a minimal gcc config for RISC-V.
br [Sat, 23 Jan 2016 15:33:11 +0000 (15:33 +0000)]
Add a minimal gcc config for RISC-V.
This is required to build csu.

Reviewed by: andrew
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D5039

8 years agoo Add gain-level control registers.
br [Sat, 23 Jan 2016 13:34:55 +0000 (13:34 +0000)]
o Add gain-level control registers.
o Fix style.

Sponsored by: Machdep, Inc.

8 years agoAdvertise support for ext3 and ext4.
trasz [Sat, 23 Jan 2016 12:25:24 +0000 (12:25 +0000)]
Advertise support for ext3 and ext4.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoDon't mention the "canonical six" in setfacl(1); it describes semantics
trasz [Sat, 23 Jan 2016 12:19:37 +0000 (12:19 +0000)]
Don't mention the "canonical six" in setfacl(1); it describes semantics
that's long gone.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix ru_oublocks accounting for ZFS. There are two code paths that can be
trasz [Sat, 23 Jan 2016 12:13:09 +0000 (12:13 +0000)]
Fix ru_oublocks accounting for ZFS. There are two code paths that can be
called from zfs_write() - one of them, through dmu_write(), was handled
correctly; the other wasn't.

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

8 years agoAdd "kldstat -h"; showing module sizes in hex is rather weird.
trasz [Sat, 23 Jan 2016 12:10:16 +0000 (12:10 +0000)]
Add "kldstat -h"; showing module sizes in hex is rather weird.

Reviewed by: emaste@ (earlier version)
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4969

8 years agoFollow r293066 adding a generalized exec hook for RISC-V as well.
br [Sat, 23 Jan 2016 11:46:52 +0000 (11:46 +0000)]
Follow r293066 adding a generalized exec hook for RISC-V as well.

8 years agoRemove obsolete comment.
dchagin [Sat, 23 Jan 2016 08:08:06 +0000 (08:08 +0000)]
Remove obsolete comment.

MFC after: 3 days

8 years agoFix a typo.
dchagin [Sat, 23 Jan 2016 08:04:29 +0000 (08:04 +0000)]
Fix a typo.

MFC after: 3 days

8 years agoNow that the flashmap code knows about SPI flash, add it in builds.
adrian [Sat, 23 Jan 2016 05:27:55 +0000 (05:27 +0000)]
Now that the flashmap code knows about SPI flash, add it in builds.

PR: kern/206227
Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoTeach the flashmap code about the SPI flash.
adrian [Sat, 23 Jan 2016 05:26:29 +0000 (05:26 +0000)]
Teach the flashmap code about the SPI flash.

PR: kern/206227
Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoAdd an IOCTL rr_limit to let users fine tuning the number of packets to be
araujo [Sat, 23 Jan 2016 04:18:44 +0000 (04:18 +0000)]
Add an IOCTL rr_limit to let users fine tuning the number of packets to be
sent using roundrobin protocol and set a better granularity and distribution
among the interfaces. Tuning the number of packages sent by interface can
increase throughput and reduce unordered packets as well as reduce SACK.

Example of usage:
# ifconfig bge0 up
# ifconfig bge1 up
# ifconfig lagg0 create
# ifconfig lagg0 laggproto roundrobin laggport bge0 laggport bge1 \
192.168.1.1 netmask 255.255.255.0
# ifconfig lagg0 rr_limit 500

Reviewed by: thompsa, glebius, adrian (old patch)
Approved by: bapt (mentor)
Relnotes: Yes
Differential Revision: https://reviews.freebsd.org/D540

8 years agoFix a regression in the .de and .dk whois special cases
fanf [Sat, 23 Jan 2016 01:20:58 +0000 (01:20 +0000)]
Fix a regression in the .de and .dk whois special cases

Ensure the special cases trigger whether we come via a referral
or via the -c option. Match host names case-insensitively.

Use the default character set supported by .de (UTF-8) since that
is more compatible with the modern world than ISO 8859-1. Persuade
them to give us a useful answer whether an internationalized
domain name is given in UTF-8 or in punycode.

8 years agoA lot of the cleverness in whois is no longer needed!
fanf [Sat, 23 Jan 2016 00:28:18 +0000 (00:28 +0000)]
A lot of the cleverness in whois is no longer needed!

The IANA whois server has the right referral information for domain
names, IP addresses, and AS numbers, so whois does not need to be
able to choose servers itself (except for a few cases where referrals
do not work). We can delete a chunk of code, which is always fun.

This change improves the referral handling to be less sensitive to
all the various formats, and to allow multi-hop referral chains,
such as IANA -> registry -> registrar.

ARIN queries have the "+" flag added if no flags are present, so we
get full details if the query matches multiple objects. The Verisign
anti-spam logic is also now suppressed if the user provided a non-
trivial query string.

Uninformative rubric is now trimmed by default. The -S option
turns off trimming, and disables query fettling.

The -i option is back to its traditional pre-1999 hostname, since
whois.internic.net is more useful than whois.networksolutions.com.
Note that the old fallback/default server whois.crsnic.net is an
alias for whois.internic.net.

The manual is more informative about query syntax.

8 years agoFix for iWARP servers that listen on INADDR_ANY.
np [Fri, 22 Jan 2016 23:33:34 +0000 (23:33 +0000)]
Fix for iWARP servers that listen on INADDR_ANY.

The iWARP Connection Manager (CM) on FreeBSD creates a TCP socket to
represent an iWARP endpoint when the connection is over TCP. For
servers the current approach is to invoke create_listen callback for
each iWARP RNIC registered with the CM. This doesn't work too well for
INADDR_ANY because a listen on any TCP socket already notifies all
hardware TOEs/RNICs of the new listener. This patch fixes the server
side of things for FreeBSD. We've tried to keep all these modifications
in the iWARP/TCP specific parts of the OFED infrastructure as much as
possible.

Submitted by: Krishnamraju Eraparaju @ Chelsio (with design inputs from Steve Wise)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D4801

8 years agoUse MAN= to specify that no man page is provided
emaste [Fri, 22 Jan 2016 21:33:27 +0000 (21:33 +0000)]
Use MAN= to specify that no man page is provided

NO_MAN is deprecated.

Reviewed by: imp

8 years agotools/tools/ath/ath_ee_v4k_print: reflect changes from r220589
avos [Fri, 22 Jan 2016 20:53:50 +0000 (20:53 +0000)]
tools/tools/ath/ath_ee_v4k_print: reflect changes from r220589

Fix printf() arguments + sort includes

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4045

8 years agoIn tty_dealloc(), clear the queues. See the comment for a scenario
kib [Fri, 22 Jan 2016 20:38:46 +0000 (20:38 +0000)]
In tty_dealloc(), clear the queues.  See the comment for a scenario
which explains why ttydev_leave() cleanup might not happen.

Submitted by: bde
MFC after: 3 weeks

8 years agoAdd a standards compliance note for strtok_r as suggested by cpercival.
wblock [Fri, 22 Jan 2016 20:36:03 +0000 (20:36 +0000)]
Add a standards compliance note for strtok_r as suggested by cpercival.

Reviewed by: cpercival
MFC after: 1 week

8 years agoThe struct file f_advice member is overlaid with the devfs f_cdevpriv
kib [Fri, 22 Jan 2016 20:35:20 +0000 (20:35 +0000)]
The struct file f_advice member is overlaid with the devfs f_cdevpriv
data.  If vnode bypass for devfs file failed, vn_read/vn_write are
called and might try to dereference f_advice.  Limit the accesses to
f_advice to VREG vnodes only, which is the type ensured by
posix_fadvise().

The f_advice for regular files is protected by mtxpool lock.  Recheck
that f_advice is not NULL after lock is taken.

Reported and tested by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

8 years agoWhen devfs dirent is freed, a vnode might still keep a pointer to it,
kib [Fri, 22 Jan 2016 20:30:51 +0000 (20:30 +0000)]
When devfs dirent is freed, a vnode might still keep a pointer to it,
apparently.  Interlock and clear the pointer to avoid free memory
dereference.

Submitted by: bde (previous version)
MFC after: 3 weeks

8 years agoRemove printf only useful for debugging.
kib [Fri, 22 Jan 2016 20:28:24 +0000 (20:28 +0000)]
Remove printf only useful for debugging.

Requested by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

8 years agosh: Clean a readonly local, even if the variable does not exist outside.
jilles [Fri, 22 Jan 2016 20:10:08 +0000 (20:10 +0000)]
sh: Clean a readonly local, even if the variable does not exist outside.

If a local variable has been made read-only, this should not prevent its
removal when the function returns.

8 years agoUpdate whois synopsis and usage with new options
fanf [Fri, 22 Jan 2016 19:06:43 +0000 (19:06 +0000)]
Update whois synopsis and usage with new options

8 years agoRestore libunwind.cpp to LLVM libunwind build (reverts r294576)
emaste [Fri, 22 Jan 2016 19:03:39 +0000 (19:03 +0000)]
Restore libunwind.cpp to LLVM libunwind build (reverts r294576)

The unw_* functions are not exported, but are used internally.

8 years agosh: Add already working test for local-readonly interaction.
jilles [Fri, 22 Jan 2016 18:10:36 +0000 (18:10 +0000)]
sh: Add already working test for local-readonly interaction.

8 years agoBump .Dd after r294575
bjk [Fri, 22 Jan 2016 17:17:27 +0000 (17:17 +0000)]
Bump .Dd after r294575

8 years agoFix ix advertise value after media change
smh [Fri, 22 Jan 2016 17:03:32 +0000 (17:03 +0000)]
Fix ix advertise value after media change

When ifconfig sets media then the values displayed by the advertise_speed
value are invalidated.

Fix this by setting the bits correctly including setting advertise to 0 for
media = auto.

Reviewed by: sbruno
MFC after: 1 week
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D5034

8 years agoAdd support for RISC-V ISA.
br [Fri, 22 Jan 2016 16:59:06 +0000 (16:59 +0000)]
Add support for RISC-V ISA.

Reviewed by: emaste
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D5021

8 years agoDrop HP libunwind (unw_*) functions from LLVM libunwind
emaste [Fri, 22 Jan 2016 16:47:36 +0000 (16:47 +0000)]
Drop HP libunwind (unw_*) functions from LLVM libunwind

They are not needed for exception handling.

8 years agoA few `whois` usability improvements
fanf [Fri, 22 Jan 2016 16:43:49 +0000 (16:43 +0000)]
A few `whois` usability improvements

Look up AS numbers at ARIN.

Handle more referral formats.

Suppress spammy nameserver objects when querying the .com and .net
whois servers by explicitly querying for domain names by default.

8 years agoAdd stubs for RISC-V ISA so libunwind can be compiled.
br [Fri, 22 Jan 2016 16:42:06 +0000 (16:42 +0000)]
Add stubs for RISC-V ISA so libunwind can be compiled.

Reviewed by: emaste
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D5035

8 years agoAdd configuration for RISC-V ISA.
br [Fri, 22 Jan 2016 16:37:26 +0000 (16:37 +0000)]
Add configuration for RISC-V ISA.

Reviewed by: emaste
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D5020

8 years agoStop including fdt_common.h in the arm64 code. We don't use anything from
andrew [Fri, 22 Jan 2016 16:35:01 +0000 (16:35 +0000)]
Stop including fdt_common.h in the arm64 code. We don't use anything from
it, however may have relied on header pollution to pull in the needed
headers through it

Sponsored by: ABT Systems Ltd

8 years agoAdd support for RISC-V ISA.
br [Fri, 22 Jan 2016 16:32:22 +0000 (16:32 +0000)]
Add support for RISC-V ISA.

Reviewed by: andrew
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D5014

8 years agoChange the variable to a #define in order to make gcc happy which
bz [Fri, 22 Jan 2016 15:03:22 +0000 (15:03 +0000)]
Change the variable to a #define in order to make gcc happy which
otherwise will complain about "variably modified 'alias' at file scope".
Unbreaks the build on gcc platforms.

8 years agosem: Don't free nameinfo that is still in list when open() fails.
jilles [Fri, 22 Jan 2016 14:52:31 +0000 (14:52 +0000)]
sem: Don't free nameinfo that is still in list when open() fails.

This bug could be reproduced easily by calling sem_open() with O_CREAT |
O_EXCL on a semaphore that is already open in the process. The struct
sem_nameinfo would be freed while still in sem_list and later calls to
sem_open() or sem_close() could access freed memory.

PR: 206396
MFC after: 5 days

8 years agor294563 was incomplete; re-add the client-side options as well.
des [Fri, 22 Jan 2016 14:22:11 +0000 (14:22 +0000)]
r294563 was incomplete; re-add the client-side options as well.

8 years agoInstead of removing the NoneEnabled option, mark it as unsupported.
des [Fri, 22 Jan 2016 13:13:46 +0000 (13:13 +0000)]
Instead of removing the NoneEnabled option, mark it as unsupported.
(should have done this in r291198, but didn't think of it until now)

8 years agoOnly define fdt_pic_table on arm, and when not using intrng as this is
andrew [Fri, 22 Jan 2016 13:09:43 +0000 (13:09 +0000)]
Only define fdt_pic_table on arm, and when not using intrng as this is
the only place that uses it.

8 years agoStop defining fdt_pic_table with ARM_INTRNG, it's unused.
andrew [Fri, 22 Jan 2016 12:51:12 +0000 (12:51 +0000)]
Stop defining fdt_pic_table with ARM_INTRNG, it's unused.

8 years agoDo not generate RSA1 or DSA keys by default.
des [Fri, 22 Jan 2016 12:14:08 +0000 (12:14 +0000)]
Do not generate RSA1 or DSA keys by default.

8 years agoStop calling fdt_immr_addr from the xlp startup code. It's used to set
andrew [Fri, 22 Jan 2016 12:00:56 +0000 (12:00 +0000)]
Stop calling fdt_immr_addr from the xlp startup code. It's used to set
fdt_immr_{va,pa,size}, but these are not used outside a single ARM SoC.

8 years agoHide "soconnect() error" messages under bootverbose.
mav [Fri, 22 Jan 2016 09:32:19 +0000 (09:32 +0000)]
Hide "soconnect() error" messages under bootverbose.

They can be too noisy.

8 years agohyperv/stor: Verify returned inquiry data before further dispatching
sephe [Fri, 22 Jan 2016 09:06:40 +0000 (09:06 +0000)]
hyperv/stor: Verify returned inquiry data before further dispatching

Windows 10 and Window 2016 will return all zero inquiry data for
non-existing slots.  If we dispatched them, then a lot of useless
(0 sized) disks would be created.  So we verify the returned inquiry
data (valid type, non-empty vendor/product/revision etc.), before
further dispatching.

Minor white space cleanup and wording fix.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
Reviewed by: adrian, sephe, Jun Su <junsu microsoft com>
Approved by: adrian (mentor)
Modified by: sephe
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4928

8 years agoSwitch to syscall; HEAD lacks fbt for kill(2)
dteske [Fri, 22 Jan 2016 08:29:23 +0000 (08:29 +0000)]
Switch to syscall; HEAD lacks fbt for kill(2)

MFC after: 3 days
X-MFC-to: stable/10
X-MFC-with: 294548

8 years agoMFV r294491: ntp 4.2.8p6.
delphij [Fri, 22 Jan 2016 07:32:39 +0000 (07:32 +0000)]
MFV r294491: ntp 4.2.8p6.

Security: CVE-2015-7973, CVE-2015-7974, CVE-2015-7975
Security: CVE-2015-7976, CVE-2015-7977, CVE-2015-7978
Security: CVE-2015-7979, CVE-2015-8138, CVE-2015-8139
Security: CVE-2015-8140, CVE-2015-8158
With hat: so

8 years agohyperv/vmbus: Lookup channel through id table
sephe [Fri, 22 Jan 2016 07:29:31 +0000 (07:29 +0000)]
hyperv/vmbus: Lookup channel through id table

Vmbus event handler will need to find the channel by its relative
id, when software interrupt for event happens.  The original lookup
searches the channel list, which is not very efficient.  We now
create a table indexed by the channel relative id to speed up
the channel lookup.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
Reviewed by: delphij, adrain, sephe, Dexuan Cui <decui microsoft com>
Approved by: adrian (mentor)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4802

8 years agoFix bad title on script (caused by copy/paste)
dteske [Fri, 22 Jan 2016 07:22:30 +0000 (07:22 +0000)]
Fix bad title on script (caused by copy/paste)

MFC after: 3 days
X-MFC-to: stable/10
X-MFC-with: r294548

8 years agoAdd scripts for watching common entry points.
dteske [Fri, 22 Jan 2016 07:19:30 +0000 (07:19 +0000)]
Add scripts for watching common entry points.

MFC after: 3 days
X-MFC-to: stable/10

8 years agoProvide busdma stubs for loader/kshim
wma [Fri, 22 Jan 2016 06:26:11 +0000 (06:26 +0000)]
Provide busdma stubs for loader/kshim

    Simple bus space stubs require the VA-PA mapping
    to be identical.

Approved by:           hselasky, cognet (mentor)
Differential revision: https://reviews.freebsd.org/D4314

8 years agoFix compilation errors in usb/kshim
wma [Fri, 22 Jan 2016 06:05:31 +0000 (06:05 +0000)]
Fix compilation errors in usb/kshim

    Remove old header from the include list and declare extern symbol
    for delay() function.

Approved by:           hselasky, cognet (mentor)
Differential revision: https://reviews.freebsd.org/D5012

8 years ago[flash] Teach mx25l SPI flash driver to interact with fdt_slicer and geom_flashmap
adrian [Fri, 22 Jan 2016 03:15:53 +0000 (03:15 +0000)]
[flash] Teach mx25l SPI flash driver to interact with fdt_slicer and geom_flashmap

This teaches the mx25l driver (sys/dev/flash/mx25l.c) to interact with
sys/dev/fdt/fdt_slicer.c and sys/geom/geom_flashmap.c.

This allows systems with SPI flash to benefit from the possibility to define
flash 'slices' via FDT, just the same way that it's currently possible for
CFI and NAND flashes.

Tested:

* Carambola 2, AR9331 + SPI NOR flash

PR: kern/206227
Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoSwitch from FD_SETSIZE to getdtablesize(2) as it can make the FD to be
araujo [Fri, 22 Jan 2016 03:02:38 +0000 (03:02 +0000)]
Switch from FD_SETSIZE to getdtablesize(2) as it can make the FD to be
tunable. Also it gets more close with the original implementation from
OpenBSD.

Requested by: rodrigc
Approved by: rodrigc (mentor)
Differential Revision: https://reviews.freebsd.org/D4970

8 years agoRemove old generated unwind.h when using LLVM libunwind
emaste [Fri, 22 Jan 2016 02:28:17 +0000 (02:28 +0000)]
Remove old generated unwind.h when using LLVM libunwind

When not using LLVM libunwind, unwind.h is a generated header and a stale
copy may remain in the OBJDIR after enabling LLVM libunwind. Explicitly
remove it.

Reported by: bz
Reviewed by: bdrewery
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5019

8 years ago- Separate sendfile(2) implementation from uipc_syscalls.c into
glebius [Fri, 22 Jan 2016 02:23:18 +0000 (02:23 +0000)]
- Separate sendfile(2) implementation from uipc_syscalls.c into
  separate file.  Claim my copyright.
- Provide more comments, better function and structure names.
- Sort out unneeded includes from resulting two files.

No functional changes.

8 years agoProvide new socket option TCP_CCALGOOPT, which stands for TCP congestion
glebius [Fri, 22 Jan 2016 02:07:48 +0000 (02:07 +0000)]
Provide new socket option TCP_CCALGOOPT, which stands for TCP congestion
control algorithm options.  The argument is variable length and is opaque
to TCP, forwarded directly to the algorithm's ctl_output method.

Provide new includes directory netinet/cc, where algorithm specific
headers can be installed.

The new API doesn't yet have any in tree consumers.

The original code written by lstewart.
Reviewed by: rrs, emax
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D711

8 years agoAdd an atomic_fetchadd_64() wrapper on sparc64.
jhb [Fri, 22 Jan 2016 00:29:11 +0000 (00:29 +0000)]
Add an atomic_fetchadd_64() wrapper on sparc64.

Reviewed by: marius

8 years agoRefactor TCP_CONGESTION setsockopt handling:
glebius [Thu, 21 Jan 2016 22:53:12 +0000 (22:53 +0000)]
Refactor TCP_CONGESTION setsockopt handling:
- Use M_TEMP instead of stack variable.
- Unroll error handling, removing several levels of indentation.

8 years ago- Rename cc.h to more meaningful tcp_cc.h.
glebius [Thu, 21 Jan 2016 22:34:51 +0000 (22:34 +0000)]
- Rename cc.h to more meaningful tcp_cc.h.
- Declare it a kernel only include, which it already is.
- Don't include tcp.h implicitly from tcp_cc.h

8 years agoCleanup TCP files from unnecessary interface related includes.
glebius [Thu, 21 Jan 2016 22:24:20 +0000 (22:24 +0000)]
Cleanup TCP files from unnecessary interface related includes.

8 years agoUpdate comment to note the function, prison_priv_check(), that needs to
mckusick [Thu, 21 Jan 2016 20:52:20 +0000 (20:52 +0000)]
Update comment to note the function, prison_priv_check(), that needs to
be updated in kern_jail.c when a new priviledge is added.

8 years agoAdd STB_GNU_UNIQUE symbol binding definition
emaste [Thu, 21 Jan 2016 20:44:21 +0000 (20:44 +0000)]
Add STB_GNU_UNIQUE symbol binding definition

Red Hat created STB_GNU_UNIQUE to handle certain special cases relating
to dynamically loading C++ DSOs[1].

We don't (currently) have support for STB_GNU_UNIQUE, but ought to
reserve the value in ELFNN_ST_BIND. This will also be used by an
upcoming ELF Tool Chain import.

[1] https://www.redhat.com/archives/posix-c++-wg/2009-August/msg00002.html

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoAdd missing atomic wrapper macro.
hselasky [Thu, 21 Jan 2016 18:22:50 +0000 (18:22 +0000)]
Add missing atomic wrapper macro.

Reviewed by: alfred @
Sponsored by: Mellanox Technologies
MFC after: 1 week

8 years agoFix panic on table/table entry delete. The panic could have happened
melifaro [Thu, 21 Jan 2016 18:20:40 +0000 (18:20 +0000)]
Fix panic on table/table entry delete. The panic could have happened
  if more than 64 distinct values had been used.

Table value code uses internal objhash API which requires unique key
  for each object. For value code, pointer to the actual value data
  is used. The actual problem arises from the fact that 'actual' e.g.
  runtime data is stored in array and that array is auto-growing. There is
  special hook (update_tvalue() function) which is used to update the pointers
  after the change. For some reason, object 'key' was not updated.
  Fix this by adding update code to the update_tvalue().

Sponsored by: Yandex LLC

8 years agoReplace the last non-optional use of sbrk() in the tree with mmap().
brooks [Thu, 21 Jan 2016 18:17:19 +0000 (18:17 +0000)]
Replace the last non-optional use of sbrk() in the tree with mmap().

All gmon want's is a region of memory without the overhead of malloc().
Just mapping some pages with mmap is an easy way to accomplish this.

Approved by: jhb, cem, emaste
Obtained from: CheriBSD (bf33e1e70b368ababde74aa3ac70d108c8a52c69)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D5005

8 years agoImplement 64-bit atomic operations for the LinuxKPI.
hselasky [Thu, 21 Jan 2016 17:56:23 +0000 (17:56 +0000)]
Implement 64-bit atomic operations for the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoLinuxKPI atomic fixes:
hselasky [Thu, 21 Jan 2016 17:52:55 +0000 (17:52 +0000)]
LinuxKPI atomic fixes:
- Fix implementation of atomic_add_unless(). The atomic_cmpset_int()
  function returns a boolean and not the previous value of the atomic
  variable.
- The atomic counters should be signed according to Linux.
- Some minor cosmetics and styling while at it.

Reviewed by: alfred @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoUse function macro instead of non-function macro to reduce chance of
hselasky [Thu, 21 Jan 2016 17:36:06 +0000 (17:36 +0000)]
Use function macro instead of non-function macro to reduce chance of
incorrect expansion.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoFix the implementations of PSEUDO_NOERROR and PSEUDO.
brooks [Thu, 21 Jan 2016 17:29:01 +0000 (17:29 +0000)]
Fix the implementations of PSEUDO_NOERROR and PSEUDO.

The PSEUDO* macros should not declare <syscall>, only _<syscall> and
__sys_<syscall>.  This was causing the interposing C wrappers to be
ignored due to link order.

Reviewed by: kib
Obtained from: CheriBSD (4e8e13c90fc6a80e1520de44a6864cfd78b3b56d)
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D4097

8 years agoThe variable is write once only and not used.
bz [Thu, 21 Jan 2016 17:25:41 +0000 (17:25 +0000)]
The variable is write once only and not used.
Recover the vertical space.

Sponsored by: The FreeBSD Foundation
MFC After: 3 days
Obtained from: p4 CH=180830
Reviewed by: gnn, hiren
Differential Revision: https://reviews.freebsd.org/D4898

8 years agoRemove fdt_fixup_table from architectures where it's unneeded. We only make
andrew [Thu, 21 Jan 2016 16:48:01 +0000 (16:48 +0000)]
Remove fdt_fixup_table from architectures where it's unneeded. We only make
use of fdt_fixup_table on PowerPC and ARM. As such we can remove it from
other architectures as it's unneeded.

Reviewed by: nwhitehorn
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D5013

8 years agoRemove an extra '!' found by clang 3.8.
andrew [Thu, 21 Jan 2016 16:42:52 +0000 (16:42 +0000)]
Remove an extra '!' found by clang 3.8.

8 years agoFill the ifAlias leaf of the ifXTable with the interface description
harti [Thu, 21 Jan 2016 16:11:20 +0000 (16:11 +0000)]
Fill the ifAlias leaf of the ifXTable with the interface description
if there is one available and it fits into the maximum size (64 characters).

8 years agoPrevent loader.conf load failure due to unknown console entries
smh [Thu, 21 Jan 2016 15:27:44 +0000 (15:27 +0000)]
Prevent loader.conf load failure due to unknown console entries

When processing loader.conf if console contained an entry for an unsupported
console then cons_set would return an error refusing to set any console.

This has two side effects:

1. Forth would throw a syntax error and stop processing loader.conf at that
  point.
2. The value of console is ignored.

#1 Means other important loader.conf entries may not be processed, which is
   clearly undesirable.
#2 Means the users preference for console aren't applied even if they did
   contain valid options. Now we have support for multi boot paths from a
   single image e.g. bios and efi mode the console preference needs to deal
   with the need to set preference for more than one source.

Fix this by:
* Returning CMD_OK where possible from cons_set.
* Allowing set with at least one valid console to proceed.

Reviewed by: allanjude
MFC after: 1 week
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D5018

8 years agoImplement idr_preload(), idr_preload_end(), idr_alloc() and
hselasky [Thu, 21 Jan 2016 14:57:45 +0000 (14:57 +0000)]
Implement idr_preload(), idr_preload_end(), idr_alloc() and
idr_alloc_cyclic() in the LinuxKPI. Bump the FreeBSD version to
force recompilation of all KLDs due to IDR structure size change.

MFC after: 2 weeks
Sponsored by: Mellanox Technologies

8 years agoext2fs: Bring back the htree dir_index implementation.
pfg [Thu, 21 Jan 2016 14:50:28 +0000 (14:50 +0000)]
ext2fs: Bring back the htree dir_index implementation.

The htree dir_index is perhaps one of the most characteristic
features of the linux ext3 implementation. It was removed
in r281670, due to repeated bug reports.

Damjan Jovanic detected and fixed three bugs and did some
stress testing by building Apache OpenOffice on top of it
so it is now in good shape to bring back.

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

Submitted by: Damjan Jovanovic
Reviewed by: pfg
Tested by: pho
Relnotes: Yes
MFC after: 2 months (only 10.x)

8 years agoDisable -mlong-calls for the clang libraries for now, it increases the
andrew [Thu, 21 Jan 2016 12:59:54 +0000 (12:59 +0000)]
Disable -mlong-calls for the clang libraries for now, it increases the
size of the clang binary for people with a crt1.o from before r293832.

8 years agoUpdate the instructions and the list of major local modifications.
des [Thu, 21 Jan 2016 12:42:31 +0000 (12:42 +0000)]
Update the instructions and the list of major local modifications.

8 years agoExplain why we don't include VersionAddendum in the debug mode banner.
des [Thu, 21 Jan 2016 12:41:02 +0000 (12:41 +0000)]
Explain why we don't include VersionAddendum in the debug mode banner.

8 years agoUpgrade to OpenSSH 7.1p2.
des [Thu, 21 Jan 2016 11:54:34 +0000 (11:54 +0000)]
Upgrade to OpenSSH 7.1p2.

8 years agoEnable DSA keys by default. They were disabled in OpenSSH 6.9p1.
des [Thu, 21 Jan 2016 11:10:14 +0000 (11:10 +0000)]
Enable DSA keys by default.  They were disabled in OpenSSH 6.9p1.

Noticed by: glebius

8 years agoTake care not to pick up the wrong version of OpenSSL when running in an
des [Thu, 21 Jan 2016 10:57:45 +0000 (10:57 +0000)]
Take care not to pick up the wrong version of OpenSSL when running in an
environment that has OpenSSL from ports in addition to the base version.

8 years agoFix EFI UFS caching
smh [Thu, 21 Jan 2016 08:58:39 +0000 (08:58 +0000)]
Fix EFI UFS caching

EFI was mixing caching in two separate places causing issues when multiple
partitions where tested.

Eliminate this by removing fsstat and re-factoring fsread into fsread_size,
adding basic parameter validation.

Also:
* Enhance some error print outs.
* Fix compilation under UFS1_ONLY and UFS2_ONLY
* Use sizeof on vars instead of structs.
* Add basic parameter validation to fsread_size.

MFC after: 1 week
X-MFC-With: r293268
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D4989

8 years agoVendor import of ntp-4.2.8p6.
delphij [Thu, 21 Jan 2016 08:50:56 +0000 (08:50 +0000)]
Vendor import of ntp-4.2.8p6.

8 years agoNote that new ssh(1) doesn't allow to use DSA keys by default.
glebius [Thu, 21 Jan 2016 07:54:05 +0000 (07:54 +0000)]
Note that new ssh(1) doesn't allow to use DSA keys by default.

8 years agoAIO daemons have always been kernel processes to facilitate switching to
jhb [Thu, 21 Jan 2016 02:20:38 +0000 (02:20 +0000)]
AIO daemons have always been kernel processes to facilitate switching to
user VM spaces while servicing jobs.  Update various comments and data
structures that refer to AIO daemons as threads to refer to processes
instead.

Reviewed by: kib
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D4999

8 years agoRemove unused variables for socket AIO.
jhb [Thu, 21 Jan 2016 01:28:31 +0000 (01:28 +0000)]
Remove unused variables for socket AIO.

In r55943, a per-process queue of pending socket AIO requests (requests
waiting for the socket to become ready) was added so that they could be
cancelled during process rundown.  In r154765, the rundown code was
changed to handle jobs in this state (JOBST_JOBQSOCK) directly removing
the need for the extra queue.  However, the per-process queue head and
global lock were never removed.

Reviewed by: kib
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D4997

8 years agocache: minor changes
mjg [Thu, 21 Jan 2016 01:09:39 +0000 (01:09 +0000)]
cache: minor changes

1. vhold and zap immediately instead of postponing few lines later
2. increment numneg after new entry is added

No functional changes.

No objections: kib