]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoDon't clobber td->td_retval[0] in proc_reap().
Ed Schouten [Thu, 9 Jul 2015 12:04:45 +0000 (12:04 +0000)]
Don't clobber td->td_retval[0] in proc_reap().

While writing tests for CloudABI, I noticed that close() on process
descriptors returns the process ID of the child process. This is
interesting, as close() is only allowed to return 0 or -1. It turns out
that we clobber td->td_retval[0] in proc_reap(), so that wait*()
properly returns the process ID.

Change proc_reap() to leave td->td_retval[0] alone. Set the return value
in kern_wait6() instead, by keeping track of the PID before we
(potentially) reap the process.

Differential Revision: https://reviews.freebsd.org/D3032
Reviewed by: kib

9 years agoRework CPU identification on ARM64
Zbigniew Bodek [Thu, 9 Jul 2015 11:32:29 +0000 (11:32 +0000)]
Rework CPU identification on ARM64

This commit reworks the code responsible for identification of
the CPUs during runtime.
It is necessary to provide a way for workarounds and erratums
to be applied only for certain HW versions.

The copy of MIDR is now stored in pcpu to provide a fast and
convenient way for assambly code to read it (pcpu is used quite often
so there is a chance it's inside the cache).
The MIDR is also better way of identification than using user-friendly
cpu_desc structure, because it can be compiled into comparision of
single u32 with only one access to the memory - this is crucial
for some erratums which are called from performance-critical
places.

Changes in cpu_identify makes this function safe to be called
on non-boot CPUs.

New function CPU_MATCH was implemented which returns boolean
value based on mathing masked MIDR with chip identification.
Example of usage:

printf("is thunder: %d\n", CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK,
        CPU_IMPL_CAVIUM, CPU_PART_THUNDER, 0, 0));
printf("is generic: %d\n", CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK,
        CPU_IMPL_ARM, CPU_PART_FOUNDATION, 0, 0));

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

9 years agoCover a race between doselwakeup() and selfdfree(). If doselwakeup()
Konstantin Belousov [Thu, 9 Jul 2015 09:22:21 +0000 (09:22 +0000)]
Cover a race between doselwakeup() and selfdfree().  If doselwakeup()
loop finds the selfd entry and clears its sf_si pointer, which is
handled by selfdfree() in parallel, NULL sf_si makes selfdfree() free
the memory.  The result is the race and accesses to the freed memory.

Refcount the selfd ownership.  One reference is for the sf_link
linkage, which is unconditionally dereferenced by selfdfree().
Another reference is for sf_threads, both selfdfree() and
doselwakeup() race to deref it, the winner unlinks and than frees the
selfd entry.

Reported by: Larry Rosenman <ler@lerctr.org>
Tested by: Larry Rosenman <ler@lerctr.org>, pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoAdd forward declaration of struct thread.
Ed Schouten [Thu, 9 Jul 2015 07:31:40 +0000 (07:31 +0000)]
Add forward declaration of struct thread.

This structure is used in some of the functions in this header, but we
don't depend on any header that pulls it i.

9 years agoGenerate CloudABI system call table with proper $FreeBSD$ tags.
Ed Schouten [Thu, 9 Jul 2015 07:21:33 +0000 (07:21 +0000)]
Generate CloudABI system call table with proper $FreeBSD$ tags.

9 years agoImport the CloudABI datatypes and create a system call table.
Ed Schouten [Thu, 9 Jul 2015 07:20:15 +0000 (07:20 +0000)]
Import the CloudABI datatypes and create a system call table.

CloudABI is a pure capability-based runtime environment for UNIX. It
works similar to Capsicum, except that processes already run in
capabilities mode on startup. All functionality that conflicts with this
model has been omitted, making it a compact binary interface that can be
supported by other operating systems without too much effort.

CloudABI is 'secure by default'; the idea is that it should be safe to
run arbitrary third-party binaries without requiring any explicit
hardware virtualization (Bhyve) or namespace virtualization (Jails). The
rights of an application are purely determined by the set of file
descriptors that you grant it on startup.

The datatypes and constants used by CloudABI's C library (cloudlibc) are
defined in separate files called syscalldefs_mi.h (pointer size
independent) and syscalldefs_md.h (pointer size dependent). We import
these files in sys/contrib/cloudabi and wrap around them in
cloudabi*_syscalldefs.h.

We then add stubs for all of the system calls in sys/compat/cloudabi or
sys/compat/cloudabi64, depending on whether the system call depends on
the pointer size. We only have nine system calls that depend on the
pointer size. If we ever want to support 32-bit binaries, we can simply
add sys/compat/cloudabi32 and implement these nine system calls again.

The next step is to send in code reviews for the individual system call
implementations, but also add a sysentvec, to allow CloudABI executabled
to be started through execve().

More information about CloudABI:
- GitHub: https://github.com/NuxiNL/cloudlibc
- Talk at BSDCan: https://www.youtube.com/watch?v=SVdF84x1EdA

Differential Revision: https://reviews.freebsd.org/D2848
Reviewed by: emaste, brooks
Obtained from: https://github.com/NuxiNL/freebsd

9 years agoMFV r285292:
Patrick Kelsey [Wed, 8 Jul 2015 23:57:58 +0000 (23:57 +0000)]
MFV r285292:

Merge upstream fix to eliminate build-breaking gcc warnings of no
importance.

commit: cab33b7a0acba7d2268a23c4383be6167106e549

Update ND_TTEST2 to fix issue 443

Add IS_NOT_NEGATIVE macro.
Avoid these warnings:
- comparison of unsigned expression >= 0 is always true [-Wtype-limits],
- comparison is always true due to limited range of data type [-Wtype-limits].

Reviewed by: adrian
Approved by: jmallett (mentor)
MFC after: 1 month

9 years agoupon further examination, it turns out that _unregister_all already
John-Mark Gurney [Wed, 8 Jul 2015 22:48:41 +0000 (22:48 +0000)]
upon further examination, it turns out that _unregister_all already
provides the guarantee that no threads will be in the _newsession code..
This is provided by the CRYPTODRIVER lock...  This makes the pause
unneeded...

9 years agoyet more documentation improvements... Many changes were made to the
John-Mark Gurney [Wed, 8 Jul 2015 22:46:45 +0000 (22:46 +0000)]
yet more documentation improvements...  Many changes were made to the
OCF w/o documentation...

Document the new (8+ year old) device_t way of handling things, that
_unregister_all will leave no threads in newsession, the _SYNC flag,
the requirement that a flag be specified...

Other minor changes like breaking up a wall of text into paragraphs...

9 years agoFix typo which breaks build of manpages when WITHOUT_MANCOMPRESS is set
Baptiste Daroussin [Wed, 8 Jul 2015 22:24:55 +0000 (22:24 +0000)]
Fix typo which breaks build of manpages when WITHOUT_MANCOMPRESS is set

PR: 201153
Reported by: Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoseq: use seq_consistent_nomb in seq_consistent
Mateusz Guzik [Wed, 8 Jul 2015 22:21:25 +0000 (22:21 +0000)]
seq: use seq_consistent_nomb in seq_consistent

Constify seqp argument for seq_consistent_nomb.

No functional changes.

9 years agoStyle cleanups after r285270
Zbigniew Bodek [Wed, 8 Jul 2015 22:09:47 +0000 (22:09 +0000)]
Style cleanups after r285270

There should be no semicolons in added macro definitions.
Define empty macro as "do {} while (0)".

Pointed out by: jmg

9 years agoMerge upstream fix to eliminate build-breaking gcc warnings of no
Patrick Kelsey [Wed, 8 Jul 2015 21:32:57 +0000 (21:32 +0000)]
Merge upstream fix to eliminate build-breaking gcc warnings of no
importance.

commit: cab33b7a0acba7d2268a23c4383be6167106e549

Update ND_TTEST2 to fix issue 443

Add IS_NOT_NEGATIVE macro.
Avoid these warnings:
- comparison of unsigned expression >= 0 is always true [-Wtype-limits],
- comparison is always true due to limited range of data type [-Wtype-limits].

Approved by: jmallett (mentor)

9 years agoNow that aesni won't reuse fpu contexts (D3016), add seatbelts to the
John-Mark Gurney [Wed, 8 Jul 2015 19:26:36 +0000 (19:26 +0000)]
Now that aesni won't reuse fpu contexts (D3016), add seatbelts to the
fpu code to prevent other reuse of the contexts in the future...

Differential Revision:        https://reviews.freebsd.org/D3015
Reviewed by: kib, gnn

9 years agoaddress an issue where consumers, like IPsec, can reuse the same
John-Mark Gurney [Wed, 8 Jul 2015 19:15:29 +0000 (19:15 +0000)]
address an issue where consumers, like IPsec, can reuse the same
session in multiple threads w/o locking..  There was a single fpu
context shared per session, if multiple threads were using the session,
and both migrated away, they could corrupt each other's fpu context...

This patch adds a per cpu context and a lock to protect it...

It also tries to better address unloading of the aesni module...
The pause will be removed once the OpenCrypto Framework provides a
better method for draining callers into _newsession...

I first discovered the fpu context sharing issue w/ a flood ping over
an IPsec tunnel between two bhyve machines...  The patch in D3015
was used to verify that this fix does fix the issue...

Reviewed by: gnn, kib (both earlier versions)
Differential Revision:        https://reviews.freebsd.org/D3016

9 years agoAddress review.
Mark Murray [Wed, 8 Jul 2015 18:46:44 +0000 (18:46 +0000)]
Address review.

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

9 years agoReimplement the ordering requirements for the timehands updates, and
Konstantin Belousov [Wed, 8 Jul 2015 18:42:08 +0000 (18:42 +0000)]
Reimplement the ordering requirements for the timehands updates, and
for timehands consumers, by using fences.

Ensure that the timehands->th_generation reset to zero is visible
before the data update is visible [*].  tc_setget() allowed data update
writes to become visible before generation (but not on TSO
architectures).

Remove tc_setgen(), tc_getgen() helpers, use atomics inline [**].

Noted by: alc [*]
Requested by: bde [**]
Reviewed by: alc, bde
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoUse atomic_fence_fence_rel() to ensure ordering in the
Konstantin Belousov [Wed, 8 Jul 2015 18:37:08 +0000 (18:37 +0000)]
Use atomic_fence_fence_rel() to ensure ordering in the
seq_write_begin(), instead of the load_rmb/rbm_load functions.  The
update does not need to be atomic due to the write lock owned.

Similarly, in seq_write_end(), update of *seqp needs not be atomic.
Only store must be atomic with release.

For seq_read(), the natural operation is the load acquire of the
sequence value, express this directly with atomic_load_acq_int()
instead of using custom partial fence implementation
atomic_load_rmb_int().

In seq_consistent, use atomic_thread_fence_acq() which provides the
desired semantic of ordering reads before fence before the re-reading
of *seqp, instead of custom atomic_rmb_load_int().

Reviewed by: alc, bde
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoonly enable immintrin when clang is used. The base gcc does not support it.
Luigi Rizzo [Wed, 8 Jul 2015 18:36:37 +0000 (18:36 +0000)]
only enable immintrin when clang is used. The base gcc does not support it.

Reviewed by: delphij

9 years agoAdd the atomic_thread_fence() family of functions with intent to
Konstantin Belousov [Wed, 8 Jul 2015 18:12:24 +0000 (18:12 +0000)]
Add the atomic_thread_fence() family of functions with intent to
provide a semantic defined by the C11 fences with corresponding
memory_order.

atomic_thread_fence_acq() gives r | r, w, where r and w are read and
write accesses, and | denotes the fence itself.

atomic_thread_fence_rel() is r, w | w.

atomic_thread_fence_acq_rel() is the combination of the acquire and
release in single operation.  Note that reads after the acq+rel fence
could be made visible before writes preceeding the fence.

atomic_thread_fence_seq_cst() orders all accesses before/after the
fence, and the fence itself is globally ordered against other
sequentially consistent atomic operations.

Reviewed by: alc
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

9 years agoThe intention of r254304 was to scan the active queue continuously.
Alan Cox [Wed, 8 Jul 2015 17:45:59 +0000 (17:45 +0000)]
The intention of r254304 was to scan the active queue continuously.
However, I've observed the active queue scan stopping when there are
frequent free page shortages and the inactive queue is steadily refilled
by other mechanisms, such as the sequential access heuristic in vm_fault()
or madvise(2).  To remedy this problem, record the time of the last active
queue scan, and always scan a number of pages proportional to the time
since the last scan, regardless of whether that last scan was a
timeout-triggered ("pass == 0") or free-page-shortage-triggered ("pass >
0") scan.

Also, on a timeout-triggered scan, allow a full scan of the active queue
when the system is short of inactive pages.

Reviewed by: kib
MFC after: 6 weeks
Sponsored by: EMC / Isilon Storage Division

9 years agoadd an extra tty for picobsd builds
Luigi Rizzo [Wed, 8 Jul 2015 16:42:28 +0000 (16:42 +0000)]
add an extra tty for picobsd builds

9 years agotrap some errors when building picobsd
Luigi Rizzo [Wed, 8 Jul 2015 16:41:25 +0000 (16:41 +0000)]
trap some errors when building picobsd

9 years agoImplement PF_IMMUTABLE flag and apply it to "name" and "jid" in
Hiroki Sato [Wed, 8 Jul 2015 16:37:48 +0000 (16:37 +0000)]
Implement PF_IMMUTABLE flag and apply it to "name" and "jid" in
jail.conf parameters.  This flag disallows redefinition of the parameter.

"name" and/or "jid" are automatically defined in jail.conf by using
the jail names at the front of jail parameter definitions.  However,
one could override them by using a variable with the same name like
$name = "foo".  This confused the parser and could end up with SIGSEGV.

Note that this change also affects a case when all of parameters are
defined in the command line arguments, not in jail.conf.  Specifically,
"jail -c name=j1 name=j2" no longer works.  This should be harmless.

PR: 196574
Reviewed by: jamie
Differential Revision: https://reviews.freebsd.org/D3017

9 years agocosmetic: whitespaces-tab before EOL
Pedro F. Giffuni [Wed, 8 Jul 2015 16:35:24 +0000 (16:35 +0000)]
cosmetic: whitespaces-tab before EOL

Obtained from: cpi-llvm project

9 years agoUse the __sentinel attribute.
Pedro F. Giffuni [Wed, 8 Jul 2015 16:21:10 +0000 (16:21 +0000)]
Use the __sentinel attribute.

Start using the gcc sentinel attribute, which can be used to
mark varargs function that need a NULL pointer to mark argument
termination, like execl(3).

Relnotes: yes

9 years agoMFV r285191: tcpdump 4.7.4.
Patrick Kelsey [Wed, 8 Jul 2015 16:19:32 +0000 (16:19 +0000)]
MFV r285191: tcpdump 4.7.4.

Also, the changes made in r272451 and r272653 that were lost in the
merge of 4.6.2 (r276788) have been restored.

PR: 199568
Differential Revision: https://reviews.freebsd.org/D3007
Reviewed by: brooks, hiren
Approved by: jmallett (mentor)
MFC after: 1 month

9 years agoCorrectly set __WCHAR_MIN, there is no __UINT_MIN, it's 0.
Andrew Turner [Wed, 8 Jul 2015 16:18:28 +0000 (16:18 +0000)]
Correctly set __WCHAR_MIN, there is no __UINT_MIN, it's 0.

Sponsored by: ABT Systems Ltd

9 years agoReplace use of .Po Pc with the preferred .Pq for single line
Patrick Kelsey [Wed, 8 Jul 2015 16:16:44 +0000 (16:16 +0000)]
Replace use of .Po Pc with the preferred .Pq for single line
enclosures in iovctl.conf(5), iovctl(8), pci(9), and
pci_iov_schema(9).

Differential Revision: https://reviews.freebsd.org/D3000
Reviewed by: wblock
Approved by: jmallett (mentor)

9 years agoAdd support for ipi_all_but_self on arm64.
Andrew Turner [Wed, 8 Jul 2015 15:32:59 +0000 (15:32 +0000)]
Add support for ipi_all_but_self on arm64.

Obtained from: ABT Systems Ltd
Sponsored by: The freeBSD Foundation

9 years agoAdd an implementation of savectx that doesn't just call panic.
Andrew Turner [Wed, 8 Jul 2015 14:07:06 +0000 (14:07 +0000)]
Add an implementation of savectx that doesn't just call panic.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoAdd memory barrier to bus_dmamap_sync()
Zbigniew Bodek [Wed, 8 Jul 2015 13:52:59 +0000 (13:52 +0000)]
Add memory barrier to bus_dmamap_sync()

On platforms which are fully IO-coherent, the map might be null.
We need to guarantee that all data is observable after the
sync operation is called. Add a memory barrier to ensure that on ARM.

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

9 years agoHandle copyout for the fcntl(F_OGETLK) using oflock structure.
Konstantin Belousov [Wed, 8 Jul 2015 13:19:13 +0000 (13:19 +0000)]
Handle copyout for the fcntl(F_OGETLK) using oflock structure.
Otherwise, kernel overwrites a word past the destination.

Submitted by: walter@pelissero.de
PR: 196718
MFC after: 1 week

9 years agoSend the correct signal when vm_fault fails. While here also set the code
Andrew Turner [Wed, 8 Jul 2015 12:42:44 +0000 (12:42 +0000)]
Send the correct signal when vm_fault fails. While here also set the code
and address fields.

Sponsored by: ABT Systems Ltd

9 years agoDocument r283961, pw(8) '-R' option.
Glen Barber [Wed, 8 Jul 2015 12:07:50 +0000 (12:07 +0000)]
Document r283961, pw(8) '-R' option.

Sponsored by: The FreeBSD Foundation

9 years agoAdd myself to committers-src.dot
Conrad Meyer [Wed, 8 Jul 2015 03:20:28 +0000 (03:20 +0000)]
Add myself to committers-src.dot

Approved by: markj (mentor)

9 years agoFix offset calculation in variable substitution
Hiroki Sato [Wed, 8 Jul 2015 00:51:53 +0000 (00:51 +0000)]
Fix offset calculation in variable substitution
in jail.conf.  The following did not work correctly:

 A="A_${B}_C_${D}"
 B="BBBBB"
 D="DDDD_${E}_FFFFF"
 E="EEEEE"

PR: 189139
Reviewed by: jamie
Differential Revision: https://reviews.freebsd.org/D3018

9 years agoSince the case where secflavor < 0 indicates the security flavor is
Rick Macklem [Tue, 7 Jul 2015 23:41:25 +0000 (23:41 +0000)]
Since the case where secflavor < 0 indicates the security flavor is
to be negotiated, it could be a Kerberized mount. As such, filling
in the "principal" argument using the canonized host name makes sense.
If it is negotiated as AUTH_SYS, the "principal" argument is meaningless
but harmless.

Requested by: masato@itc.naist.jp
Tested by: masato@itc.naist.jp
PR: 201073
MFC after: 1 month

9 years agopw: fail if an invalid entry is found while parsing master.passwd and group
Baptiste Daroussin [Tue, 7 Jul 2015 21:05:20 +0000 (21:05 +0000)]
pw: fail if an invalid entry is found while parsing master.passwd and group

PR: 198554
Reported by: diaran <fbsd@centraltech.co.uk>
MFC after: 2 days

9 years agounroll the loop slightly... This improves performance enough to
John-Mark Gurney [Tue, 7 Jul 2015 20:31:09 +0000 (20:31 +0000)]
unroll the loop slightly...  This improves performance enough to
justify, especially for CBC performance where we can't pipeline..  I
don't happen to have my measurements handy though...

Sponsored by: Netflix, Inc.

9 years ago- Add IPv6 support in quota(1). While rpc.rquotad has supported PF_INET6
Hiroki Sato [Tue, 7 Jul 2015 20:15:09 +0000 (20:15 +0000)]
- Add IPv6 support in quota(1).  While rpc.rquotad has supported PF_INET6
  for a long time, quota(1) utility supported only PF_INET.

- Clean up confusing changes in f_mntfromname.

- Add an entry for rquotad with rpc/udp6 to inetd.conf.

PR: 194084

9 years agoFix an incorrect assertion in witness.
Mark Johnston [Tue, 7 Jul 2015 19:29:18 +0000 (19:29 +0000)]
Fix an incorrect assertion in witness.

The number of available lock list entries for a thread is LOCK_CHILDCOUNT,
and each entry can record up to LOCK_NCHILDREN locks. When iterating over
the locks held by a thread, a bound on the loop index is therefore given
by LOCK_CHILDCOUNT * LOCK_NCHILDREN; WITNESS_COUNT is an unrelated
constant.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D2974

9 years agoFix markup.
Edward Tomasz Napierala [Tue, 7 Jul 2015 19:23:59 +0000 (19:23 +0000)]
Fix markup.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 years agoAdd the Banana Pi DTS.
Luiz Otavio O Souza [Tue, 7 Jul 2015 19:01:54 +0000 (19:01 +0000)]
Add the Banana Pi DTS.

The Banana Pi support is in progress and this is intended to help the early
adopters.

9 years agolldb: use .PATH to find man page instead of symlinking it
Ed Maste [Tue, 7 Jul 2015 18:46:41 +0000 (18:46 +0000)]
lldb: use .PATH to find man page instead of symlinking it

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 years agowe may get here w/ non-sleepable locks held, so switch to _NOWAIT when
John-Mark Gurney [Tue, 7 Jul 2015 18:45:32 +0000 (18:45 +0000)]
we may get here w/ non-sleepable locks held, so switch to _NOWAIT when
doing this memory allocation...

Reviewed by: ae

9 years agoAvoid creating invalid UEFI device path
Ed Maste [Tue, 7 Jul 2015 18:44:27 +0000 (18:44 +0000)]
Avoid creating invalid UEFI device path

The UEFI loader on the 10.1 release install disk (disc1) modifies an
existing EFI_DEVICE_PATH_PROTOCOL instance in an apparent attempt to
truncate the device path.  In doing so it creates an invalid device
path.

Perform the equivalent action without modification of structures
allocated by firmware.

PR: 197641
MFC After: 1 week
Submitted by: Chris Ruffin <chris.ruffin@intel.com>

9 years agoAdd the GMAC entries to sun7i (A20) DTS.
Luiz Otavio O Souza [Tue, 7 Jul 2015 18:32:23 +0000 (18:32 +0000)]
Add the GMAC entries to sun7i (A20) DTS.

While here make EMAC disabled unless explicitly enabled.

9 years agoFix rfcomm_sppd regression I could reproduced.
Takanori Watanabe [Tue, 7 Jul 2015 15:56:51 +0000 (15:56 +0000)]
Fix rfcomm_sppd regression I could reproduced.
To reproduce it, Two machine running FreeBSD and
run
rfcomm_sppd -c 3 -S
rfcomm_sppd -a ${PEER} -c 3
on each side.

9 years agoRelocate sched_random() within the SMP section.
Pedro F. Giffuni [Tue, 7 Jul 2015 15:22:29 +0000 (15:22 +0000)]
Relocate sched_random() within the SMP section.

Place sched_random nearer to where it's first used: moving the
code nearer to where it  is used makes the code easier to read
and we can reduce the initial "#ifdef SMP" island.

Reword a little the comment and clean some whitespaces
while here.

9 years agoRemove reboot.S (part of libc). It's not needed and was actually
Edward Tomasz Napierala [Tue, 7 Jul 2015 09:25:51 +0000 (09:25 +0000)]
Remove reboot.S (part of libc).  It's not needed and was actually
broken - returning 0 from reboot(2) resulted in SIGBUS.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoExport the ssthresh value per SCTP path via the sysctl interface.
Michael Tuexen [Tue, 7 Jul 2015 06:34:28 +0000 (06:34 +0000)]
Export the ssthresh value per SCTP path via the sysctl interface.

MFC after: 1 month

9 years agoSort by svn revision.
Glen Barber [Tue, 7 Jul 2015 04:09:35 +0000 (04:09 +0000)]
Sort by svn revision.
Fix a few FDP style nits.

Sponsored by: The FreeBSD Foundation

9 years agoAttempt to make 5GHz HT/40 work on the 6xxx series NICs.
Adrian Chadd [Tue, 7 Jul 2015 03:51:29 +0000 (03:51 +0000)]
Attempt to make 5GHz HT/40 work on the 6xxx series NICs.

The 6205 (Taylor Peak) in the Lenovo X230 works fine in 5GHz 11a and 11n HT20,
but not 11n HT40.  The NIC goes RX deaf the moment HT40 is configured.
It's so RX deaf that it doesn't even hear beacons and the firmware sends
"BEACON MISS" events.  That's pretty deaf.

I tried configuring up the HT40 flags in monitor mode and it worked - so
I assumed that doing the transition from 20 -> 40MHz channel configuration
when going auth->assoc (ie, after the NIC has been partially configured)
is a problem.

So for now, let's just always set them if they're available.

Tested:

* Intel 5300, STA mode, 5GHz HT/40 AP; 2GHz HT/20 AP
* Intel 6205, STA mode, 5GHz HT/40, HT20, 11a AP; 2GHz HT/20 AP

This was pointed out to me by coworkers trying to use FreeBSD-HEAD
in the office on their Thinkpad T420p laptops.

TODO:

* I don't like how the HT40 flags are configured - the whole interop/
  protection config should be re-checked.  Notably, I think curhtprotmode
  is 0 in a lot of cases, which means "no interoperability" and i think
  that's busted.

Sponsored by: Norse Corp, Inc.

9 years agoNote merge to head for sendmail 8.15.2 along with a special note for those
Gregory Neil Shapiro [Tue, 7 Jul 2015 03:06:56 +0000 (03:06 +0000)]
Note merge to head for sendmail 8.15.2 along with a special note for those
upgrading to FreeBSD 11.

MFC after: 3 days

9 years agoAdd warning about change of behavior for sendmail 8.15.2 under FreeBSD 11
Gregory Neil Shapiro [Tue, 7 Jul 2015 03:03:17 +0000 (03:03 +0000)]
Add warning about change of behavior for sendmail 8.15.2 under FreeBSD 11
with regards to IPv6 address representation in configuration/maps/rulesets.

9 years agoUpdate for sendmail 8.15.2 import
Gregory Neil Shapiro [Tue, 7 Jul 2015 03:02:07 +0000 (03:02 +0000)]
Update for sendmail 8.15.2 import

MFC after: 3 days

9 years agoMinor changes to force commit these files so new freebsd*.cf files are
Gregory Neil Shapiro [Tue, 7 Jul 2015 03:00:57 +0000 (03:00 +0000)]
Minor changes to force commit these files so new freebsd*.cf files are
built to use the new sendmail-8.15.2/cf tree.

MFC after: 3 days

9 years agoMerge sendmail 8.15.2 to HEAD
Gregory Neil Shapiro [Tue, 7 Jul 2015 02:59:02 +0000 (02:59 +0000)]
Merge sendmail 8.15.2 to HEAD

MFC after: 3 days

9 years agoEnable the wireless on attach.
Justin Hibbits [Tue, 7 Jul 2015 02:42:48 +0000 (02:42 +0000)]
Enable the wireless on attach.

This comes from the archives of "forgotten in the original commit, and probably
pointless now because nobody uses it, and the driver's broken anyway."

9 years agostyle(9) cleanups.
Justin Hibbits [Tue, 7 Jul 2015 02:37:29 +0000 (02:37 +0000)]
style(9) cleanups.

Don't use PRIxPTR, these registers are 32-bits, cast to u_long instead.

Pointed out by: bde

9 years agolibsm/path.c is about to disappear in the merge of sendmail 8.15.2. It is an
Gregory Neil Shapiro [Tue, 7 Jul 2015 02:35:06 +0000 (02:35 +0000)]
libsm/path.c is about to disappear in the merge of sendmail 8.15.2.  It is an
empty file now so it is safe to remove before the merge.

MFC after: 3 days

9 years agoTemporarily disable WARNS while addressing a non-issue with the upstream code
Gregory Neil Shapiro [Tue, 7 Jul 2015 02:30:35 +0000 (02:30 +0000)]
Temporarily disable WARNS while addressing a non-issue with the upstream code

9 years agocxgbe(4): Add a new knob that controls the congestion response of netmap
Navdeep Parhar [Mon, 6 Jul 2015 20:56:59 +0000 (20:56 +0000)]
cxgbe(4): Add a new knob that controls the congestion response of netmap
rx queues.  The default is to drop rather than backpressure.

This decouples the congestion settings of NIC and netmap rx queues.

MFC after: 3 days

9 years agocxgbe(4): Do not override the the global defaults for congestion drops.
Navdeep Parhar [Mon, 6 Jul 2015 20:28:42 +0000 (20:28 +0000)]
cxgbe(4): Do not override the the global defaults for congestion drops.
The hw.cxgbe.cong_drop knob is not affected by this change because the
driver sets up congestion drop on a per-queue basis.

MFC after: 3 days

9 years agoThe results of the vote are in. This reflects that vote. Single
Warner Losh [Mon, 6 Jul 2015 20:10:47 +0000 (20:10 +0000)]
The results of the vote are in. This reflects that vote. Single
line statements inside of braces is recognized as an acceptable
style.
http://reviews.freebsd.org/V3
As always, this isn't license for wholesale change, etc.

9 years agoMove the 'devmem' device nodes from /dev/vmm to /dev/vmm.io
Neel Natu [Mon, 6 Jul 2015 19:41:43 +0000 (19:41 +0000)]
Move the 'devmem' device nodes from /dev/vmm to /dev/vmm.io

Some external tools just do a 'ls /dev/vmm' to figure out the bhyve virtual
machines on the host. These tools break if the devmem device nodes also
appear in /dev/vmm.

Requested by: grehan

9 years agoAlways assert DCD and DSR in bhyve's uart emulation.
Neel Natu [Mon, 6 Jul 2015 19:33:29 +0000 (19:33 +0000)]
Always assert DCD and DSR in bhyve's uart emulation.

The /etc/ttys entry for a serial console in FreeBSD/x86 is as follows:
ttyu0   "/usr/libexec/getty 3wire"      vt100   onifconsole secure

The initial terminal type passed to getty(8) is "3wire" which sets the
CLOCAL flag. However reset(1) clears this flag and any programs that try
to open the terminal will hang waiting for DCD to be asserted.

Fix this by always asserting DCD and DSR in the emulated uart.

The following discussion on virtualization@ has more details:
https://lists.freebsd.org/pipermail/freebsd-virtualization/2015-June/003666.html

Reported by: jmg
Discussed with: grehan

9 years agoFix for non-random IV's when CRD_F_IV_PRESENT and CRD_F_IV_EXPLICIT
John-Mark Gurney [Mon, 6 Jul 2015 19:30:29 +0000 (19:30 +0000)]
Fix for non-random IV's when CRD_F_IV_PRESENT and CRD_F_IV_EXPLICIT
flags are not specified... This bug was introduced in r275732...

This only affects IPsec ESP only policies w/ the aesni module loaded,
other subsystems specify one or both of the flags...

Reviewed by: gnn, delphij, eri

9 years agoremove _NORMAL flag which isn't suppose to be used w/ _alloc_ctx...
John-Mark Gurney [Mon, 6 Jul 2015 19:17:56 +0000 (19:17 +0000)]
remove _NORMAL flag which isn't suppose to be used w/ _alloc_ctx...

Reviewed by: kib (a while ago)

9 years agotty: replace several curthread->td_proc with stored curproc
Mateusz Guzik [Mon, 6 Jul 2015 18:53:56 +0000 (18:53 +0000)]
tty: replace several curthread->td_proc with stored curproc

No functional changes.

9 years agoIntroduce ITS support for ARM64
Zbigniew Bodek [Mon, 6 Jul 2015 18:27:41 +0000 (18:27 +0000)]
Introduce ITS support for ARM64

Add ARM ITS (Interrupt Translation Services) support required
to bring-up message signalled interrupts on some ARM64 platforms.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation

9 years agoAdd more tlb invalidations. We currently invalidate when we may not need
Andrew Turner [Mon, 6 Jul 2015 18:27:18 +0000 (18:27 +0000)]
Add more tlb invalidations. We currently invalidate when we may not need
to, but with this I can boot on a simulator that models the tlb.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoWhen initializing the (unused) TX descriptors it is not necessary set the
Luiz Otavio O Souza [Mon, 6 Jul 2015 17:13:17 +0000 (17:13 +0000)]
When initializing the (unused) TX descriptors it is not necessary set the
chain bit.

Obtained from: NetBSD

9 years agoUse uint32_t consistently to store registers values.
Luiz Otavio O Souza [Mon, 6 Jul 2015 16:45:48 +0000 (16:45 +0000)]
Use uint32_t consistently to store registers values.

Always use unsigned numbers to avoid undefined behavior on (1 << 31).

Remove unused variables and some stray semicolons.

No functional changes.

9 years agoDon't acquire sysctlmemlock in userland_sysctl() when the old value
Patrick Kelsey [Mon, 6 Jul 2015 16:07:21 +0000 (16:07 +0000)]
Don't acquire sysctlmemlock in userland_sysctl() when the old value
pointer is NULL, as in that case there are no userland pages that
could potentially be wired.  It is common for old to be NULL and
oldlenp to be non-NULL in calls to userland_sysctl(), as this is used
to probe for the length of a variable-length sysctl entry before
retrieving a value.  Note that it is typical for such calls to be made
with an uninitialized value in *oldlenp, so sysctlmemlock was
essentially being acquired at random (depending on the uninitialized
value in *oldlenp being > PAGE_SIZE or not) for these calls prior to
this patch.

Differential Revision: https://reviews.freebsd.org/D2987
Reviewed by: mjg, kib
Approved by: jmallett (mentor)
MFC after: 1 month

9 years agoMutex memory is not zeroed, add MTX_NEW.
Konstantin Belousov [Mon, 6 Jul 2015 14:09:00 +0000 (14:09 +0000)]
Mutex memory is not zeroed, add MTX_NEW.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoFill the port and protocol information in the SADB_ACQUIRE message
Andrey V. Elsukov [Mon, 6 Jul 2015 12:40:31 +0000 (12:40 +0000)]
Fill the port and protocol information in the SADB_ACQUIRE message
in case when security policy has it as required by RFC 2367.

PR: 192774
Differential Revision: https://reviews.freebsd.org/D2972
MFC after: 1 week

9 years agoAdd hton and ntoh to the arm64 Symbols.map file, they exist but were not
Andrew Turner [Mon, 6 Jul 2015 09:57:40 +0000 (09:57 +0000)]
Add hton and ntoh to the arm64 Symbols.map file, they exist but were not
exported.

9 years agoCorrect bit offsets for ahci quirks
Steven Hartland [Mon, 6 Jul 2015 09:44:07 +0000 (09:44 +0000)]
Correct bit offsets for ahci quirks

Fix bit offsets causing incorrect quirks being reported on boot for ahci
introduced by r280184.

MFC after: 3 days
Sponsored by: Multiplay

9 years agoMerge booke and aim interrupt.c files.
Justin Hibbits [Mon, 6 Jul 2015 05:08:57 +0000 (05:08 +0000)]
Merge booke and aim interrupt.c files.

Summary:
Both booke and AIM interrupt.c files contain nearly identical code.  This merges
the two files, to reduce duplication.

Reviewers: #powerpc, marcel

Reviewed By: marcel

Subscribers: imp

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

9 years agoImport sendmail 8.15.2
Gregory Neil Shapiro [Mon, 6 Jul 2015 04:29:34 +0000 (04:29 +0000)]
Import sendmail 8.15.2

9 years agoFix the sent packets statistics for if_dwc.
Luiz Otavio O Souza [Mon, 6 Jul 2015 03:06:13 +0000 (03:06 +0000)]
Fix the sent packets statistics for if_dwc.

9 years agoVendor import of tcpdump 4.7.4.
Patrick Kelsey [Mon, 6 Jul 2015 02:16:08 +0000 (02:16 +0000)]
Vendor import of tcpdump 4.7.4.

Approved by: jmallett (mentor)

9 years agoFix if_loop so bpfwrite() can use it regardless of the state of
Patrick Kelsey [Mon, 6 Jul 2015 02:12:49 +0000 (02:12 +0000)]
Fix if_loop so bpfwrite() can use it regardless of the state of
bd_hdrcmplt.  As if_loop does not use link-level headers, its behavior
when used by bpfwrite() should be the same regardless of the state of
bd_hdrcmplt.  Without this change, libpcap (and other BPF users that
work like it) fail when writing to loopback interfaces.

Differential Revision: https://reviews.freebsd.org/D2989
Reviewed by: gnn, melifaro
Approved by: jmallett (mentor)
MFC after: 3 days

9 years agoFix range upper bound for uint32_t and uint64_t, and reformat range
Patrick Kelsey [Mon, 6 Jul 2015 01:48:23 +0000 (01:48 +0000)]
Fix range upper bound for uint32_t and uint64_t, and reformat range
description for uint8_t, uint16_t, uint32_t, and uint64_t.

Differential Revision: https://reviews.freebsd.org/D2988
Reviewed by: rstone, wblock
Approved by: jmallett (mentor)
Sponsored by: Norse Corp, Inc.

9 years agoFix sysctl(3) so it returns the intended values for all mib names in
Patrick Kelsey [Mon, 6 Jul 2015 01:42:12 +0000 (01:42 +0000)]
Fix sysctl(3) so it returns the intended values for all mib names in
the 'user' sysctl tree, which have all been coming back 0 or empty
since r240176.

Differential Revision: https://reviews.freebsd.org/D2945
Reviewed by: sbruno
Approved by: jmallett (mentor)
MFC after: 3 days

9 years agoRemove a BUGS entry that was addressed by r282300.
Mark Johnston [Sun, 5 Jul 2015 23:24:52 +0000 (23:24 +0000)]
Remove a BUGS entry that was addressed by r282300.

9 years agoRename the dtrace-* man pages to dtrace_* for consistency with other
Mark Johnston [Sun, 5 Jul 2015 23:23:12 +0000 (23:23 +0000)]
Rename the dtrace-* man pages to dtrace_* for consistency with other
subsection man pages (e.g. geom_*, mac_*, snd_*).

9 years agoMove the comment describing namei(9) back to namei()'s definition.
Mark Johnston [Sun, 5 Jul 2015 22:56:41 +0000 (22:56 +0000)]
Move the comment describing namei(9) back to namei()'s definition.

MFC after: 3 days

9 years agoThe bug caught by flock's test 16 was fixed by r268384.
Mark Johnston [Sun, 5 Jul 2015 22:49:26 +0000 (22:49 +0000)]
The bug caught by flock's test 16 was fixed by r268384.

MFC after: 3 days

9 years agoRemove a stale descriptive comment for gbincore().
Mark Johnston [Sun, 5 Jul 2015 22:44:41 +0000 (22:44 +0000)]
Remove a stale descriptive comment for gbincore().

The splay trees referenced in the comment were converted to
path-compressed tries in r250551.

MFC after: 3 days

9 years agoCheck suspendability on the mountpoint returned by VOP_GETWRITEMOUNT.
Mark Johnston [Sun, 5 Jul 2015 22:37:33 +0000 (22:37 +0000)]
Check suspendability on the mountpoint returned by VOP_GETWRITEMOUNT.
This obviates the need for a MNTK_SUSPENDABLE flag, since passthrough
filesystems like nullfs and unionfs no longer need to inherit this
information from their lower layer(s). This change also restores the
pre-r273336 behaviour of using the presence of a susp_clean VFS method to
request suspension support.

Reviewed by: kib, mjg
Differential Revision: https://reviews.freebsd.org/D2937

9 years agoAdd a local variable initialization needed in the OBJT_DEFAULT case.
Mark Johnston [Sun, 5 Jul 2015 22:26:19 +0000 (22:26 +0000)]
Add a local variable initialization needed in the OBJT_DEFAULT case.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D2992

9 years agoDocument the locking context for the directly dispatched callouts.
Konstantin Belousov [Sun, 5 Jul 2015 19:29:24 +0000 (19:29 +0000)]
Document the locking context for the directly dispatched callouts.
Cross-reference timeout(9).

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agofd: make 'rights' a manadatory argument to fget* functions
Mateusz Guzik [Sun, 5 Jul 2015 19:05:16 +0000 (19:05 +0000)]
fd: make 'rights' a manadatory argument to fget* functions

9 years agoAdd the kernel functions needed to enable threading.
Andrew Turner [Sun, 5 Jul 2015 18:16:06 +0000 (18:16 +0000)]
Add the kernel functions needed to enable threading.

Sponsored by: ABT Systems Ltd

9 years agoUpdate ntp version number. (This is a manual update that was missed.)
Cy Schubert [Sun, 5 Jul 2015 16:48:40 +0000 (16:48 +0000)]
Update ntp version number. (This is a manual update that was missed.)

9 years agoMFV ntp-4.2.8p3 (r284990).
Cy Schubert [Sun, 5 Jul 2015 15:42:16 +0000 (15:42 +0000)]
MFV ntp-4.2.8p3 (r284990).

Approved by: roberto, delphij
Security: VuXML: 0d0f3050-1f69-11e5-9ba9-d050996490d0
Security: http://bugs.ntp.org/show_bug.cgi?id=2853
Security: https://www.kb.cert.org/vuls/id/668167
Security: http://support.ntp.org/bin/view/Main/SecurityNotice#June_2015_NTP_Security_Vulnerabi

9 years agoFix GENERIC64 and LINT64 powerpc builds after r285144.
Bjoern A. Zeeb [Sun, 5 Jul 2015 15:30:16 +0000 (15:30 +0000)]
Fix GENERIC64 and LINT64 powerpc builds after r285144.