]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years ago* Handle ++x as well as x++ while converting.
Marcel Moolenaar [Wed, 25 Jun 2014 15:22:14 +0000 (15:22 +0000)]
* Handle ++x as well as x++ while converting.
* Add special case handling where normal conversion would not work
  (some APIs have special names)
* Fix conversion for function calls involving ifnet

Submitted by: Sreekanth Rupavatharam <rupavath@juniper.net>
Obtained from: Juniper Networks, Inc.

10 years agoMFV r260708
Pedro F. Giffuni [Wed, 25 Jun 2014 14:23:30 +0000 (14:23 +0000)]
MFV r260708

4427 pid provider rejects probes with valid UTF-8 names

This make use of Solaris' u8_validate() which we happen to
use since r185029 for ZFS.

Illumos Revision: 1444d846b126463eb1059a572ff114d51f7562e5

Reference:
https://www.illumos.org/issues/4427

Obtained from: Illumos
MFC after: 2 weeks

10 years agoRemove example cvsup config files.
Gavin Atkinson [Wed, 25 Jun 2014 12:32:41 +0000 (12:32 +0000)]
Remove example cvsup config files.

MFC after: 1 week

10 years agoDrop references to updating over csup from build(7).
Gavin Atkinson [Wed, 25 Jun 2014 12:28:22 +0000 (12:28 +0000)]
Drop references to updating over csup from build(7).

MFC after: 1 week

10 years agoDrop example variables for updating over csup. These have not functioned
Gavin Atkinson [Wed, 25 Jun 2014 12:23:16 +0000 (12:23 +0000)]
Drop example variables for updating over csup.  These have not functioned
since r251084.

MFC after: 1 week

10 years agoRemove an nunnecessary reference to csup.
Gavin Atkinson [Wed, 25 Jun 2014 12:17:00 +0000 (12:17 +0000)]
Remove an nunnecessary reference to csup.

10 years agoRemove csup(1) and its associated cpasswd(1) tool.
Gavin Atkinson [Wed, 25 Jun 2014 12:06:45 +0000 (12:06 +0000)]
Remove csup(1) and its associated cpasswd(1) tool.

With the move by the FreeBSD Project away from CVSup as a distribution
mechanism, there is no longer a need to keep this in base.

Approved by: mux (around a year ago), silence on -hackers
X-MFC-after: never

10 years agoMark send-pr info page as an obsolete file
Baptiste Daroussin [Wed, 25 Jun 2014 10:01:02 +0000 (10:01 +0000)]
Mark send-pr info page as an obsolete file

10 years agoxen/virtio: fix balloon drivers to not mark pages as WIRED
Roger Pau Monné [Wed, 25 Jun 2014 09:51:08 +0000 (09:51 +0000)]
xen/virtio: fix balloon drivers to not mark pages as WIRED

Prevent the Xen and VirtIO balloon drivers from marking pages as
wired. This prevents them from increasing the system wired page count,
which can lead to mlock failing because of hitting the limit in
vm.max_wired.

In the Xen case make sure pages are zeroed before giving them back to
the hypervisor, or else we might be leaking data. Also remove the
balloon_{append/retrieve} and link pages directly into the
ballooned_pages queue using the plinks.q field in the page struct.

Sponsored by: Citrix Systems R&D
Reviewed by: kib, bryanv
Approved by: gibbs

dev/virtio/balloon/virtio_balloon.c:
 - Don't allocate pages with VM_ALLOC_WIRED.

dev/xen/balloon/balloon.c:
 - Don't allocate pages with VM_ALLOC_WIRED.
 - Make sure pages are zeroed before giving them back to the
   hypervisor.
 - Remove the balloon_entry struct and the balloon_{append/retrieve}
   functions and use the page plinks.q entry to link the pages
   directly into the ballooned_pages queue.

10 years agoAdd fpu_kern.9 man page to the install.
Konstantin Belousov [Wed, 25 Jun 2014 07:57:01 +0000 (07:57 +0000)]
Add fpu_kern.9 man page to the install.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoAdd m_pulldown and m_unshare to MLINKS.
Kevin Lo [Wed, 25 Jun 2014 07:29:40 +0000 (07:29 +0000)]
Add m_pulldown and m_unshare to MLINKS.

10 years agoFixed an IIC timing issue between the glxiic master and a slave of
Daichi GOTO [Wed, 25 Jun 2014 05:39:30 +0000 (05:39 +0000)]
Fixed an IIC timing issue between the glxiic master and a slave of
peripheral devices.  When transmitting (rx) from slave to master,
sometimes nAKC delays. As a result, some slaves fails their
transmission.

Submitted by: Masanori OZAWA <ozawa@ongs.co.jp>
Reviewed by: brix
MFC after: 1 week

10 years agoContinue the crusade towards a dev_clone()-free kernel, removing its
Davide Italiano [Wed, 25 Jun 2014 03:54:02 +0000 (03:54 +0000)]
Continue the crusade towards a dev_clone()-free kernel, removing its
usage from dtrace. The dtrace code already uses cdevpriv(9) since FreeBSD
8, so this change should be quite harmless.

Reviewed by: markj
Approved by: markj
MFC after: never

10 years agoNow that vm_map_insert() sets MAP_ENTRY_GROWS_{DOWN,UP} on the stack entries
Alan Cox [Wed, 25 Jun 2014 03:30:03 +0000 (03:30 +0000)]
Now that vm_map_insert() sets MAP_ENTRY_GROWS_{DOWN,UP} on the stack entries
that it creates (r267645), we can place the check that blocks map entry
coalescing on stack entries in vm_map_simplify_entry() where it properly
belongs.

Reviewed by: kib

10 years agoMake sure that the sub-makes for unwind.h start from the CURDIR
Warner Losh [Tue, 24 Jun 2014 22:15:27 +0000 (22:15 +0000)]
Make sure that the sub-makes for unwind.h start from the CURDIR
(/usr/src) tree rather than the OBJDIR (/usr/obj) tree. This fixes
broken incremental builds with the canonical MAKESYSPATH workaround
of .../share/mk. This is a gross kludge.

10 years agoUnbreak installation of the rtld tests.
Mark Johnston [Tue, 24 Jun 2014 21:12:08 +0000 (21:12 +0000)]
Unbreak installation of the rtld tests.

X-MFC-With: r267679

10 years agoCatch up with many years of changes:
Garrett Wollman [Tue, 24 Jun 2014 20:23:18 +0000 (20:23 +0000)]
Catch up with many years of changes:

o Document PF_LOCAL as being an alias for PF_UNIX
o Document POSIX standardization of this interface using AF_*
  constants rather than PF_* constants, and note the three particular
  families which POSIX standardizes.
o Note anticipated POSIX standardization of SOCK_CLOEXEC.
o Delete from listing protocol families that FreeBSD doesn't support
  (in some cases, like PF_PUP, has never supported).
o Add to listing some current protocol families that have been
  introduced in the last decade or so.
o Document the correspondence of PF_* and AF_* constants.

We should probably change the documentation to make the AF_* constants
primary, but this commit does not do so.

Reviewed by: kevlo@
MFC after: 1 month

10 years agoApply vendor fixes for big endian support and 20GBps/25GBps link speeds.
Xin LI [Tue, 24 Jun 2014 20:11:22 +0000 (20:11 +0000)]
Apply vendor fixes for big endian support and 20GBps/25GBps link speeds.

Many thanks to Emulex for their continued support of FreeBSD!

Submitted by: Venkata Duvvuru <VenkatKumar.Duvvuru Emulex.Com>
MFC after: 3 days

10 years agoCorrect memset size.
Xin LI [Tue, 24 Jun 2014 20:09:02 +0000 (20:09 +0000)]
Correct memset size.

Submitted by: Sascha Wildner (swildner at dragonflybsd dot org)
Reviewed by: Kashyap Desai <kashyap.desai avagotech.com>
MFC after: 2 weeks

10 years agoClarify the expected usage of I2C 7-bit slave addresses on ioctl(2)
Luiz Otavio O Souza [Tue, 24 Jun 2014 19:42:37 +0000 (19:42 +0000)]
Clarify the expected usage of I2C 7-bit slave addresses on ioctl(2)
interface.

While here add the cross reference to iic(4) on iicbus(4).

CR: D210
Suggested by: jmg
MFC after: 1 week

10 years agoFix issues in config parser relating to lun serial numbers.
Josh Paetzel [Tue, 24 Jun 2014 19:12:55 +0000 (19:12 +0000)]
Fix issues in config parser relating to lun serial numbers.

Without this fix some serial numbers needed to be quoted
to avoid the config parser bailing out.

Submitted by: delphij
Sponsored by: iXsystems

10 years agoFix multiple vulnerabilities in file(1) and libmagic(3).
Xin LI [Tue, 24 Jun 2014 19:04:32 +0000 (19:04 +0000)]
Fix multiple vulnerabilities in file(1) and libmagic(3).

Security: FreeBSD-SA-14:16.file
Approved by: so

10 years agoDocument r267639 CTL ABI breakage.
Alexander Motin [Tue, 24 Jun 2014 18:56:45 +0000 (18:56 +0000)]
Document r267639 CTL ABI breakage.

10 years agoUse existing PHOLD() and PRELE() macros.
Hans Petter Selasky [Tue, 24 Jun 2014 18:25:43 +0000 (18:25 +0000)]
Use existing PHOLD() and PRELE() macros.

Submitted by: kib @

10 years agoRemove fixed path as part of suggestion. Three dots are fine for most
Warner Losh [Tue, 24 Jun 2014 16:10:48 +0000 (16:10 +0000)]
Remove fixed path as part of suggestion. Three dots are fine for most
uses. Add a note about a correct workaround.

10 years agosysctl subsystem uses sxlocks so avoid to setup dynamic sysctl nodes
Attilio Rao [Tue, 24 Jun 2014 15:16:55 +0000 (15:16 +0000)]
sysctl subsystem uses sxlocks so avoid to setup dynamic sysctl nodes
before sleepinit() has been fully executed in the SLEEPQUEUE_PROFILING
case.

Sponsored by: EMC / Isilon storage division

10 years agoAdd missing linefeed.
Gavin Atkinson [Tue, 24 Jun 2014 12:57:48 +0000 (12:57 +0000)]
Add missing linefeed.

10 years agoPut the aesni_cipher_setup() and aesni_cipher_process() functions into
Konstantin Belousov [Tue, 24 Jun 2014 06:55:49 +0000 (06:55 +0000)]
Put the aesni_cipher_setup() and aesni_cipher_process() functions into
the file which is compiled with SSE disabled.  The functions set up
the FPU context for kernel, and compiler optimizations which could
lead to use of XMM registers before the fpu_kern_enter(9) is called or
after fpu_kern_leave(9), panic the machine.

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

10 years agoMake cpuctl_do_cpuid() and cpuctl_do_cpuid_count() return void.
Konstantin Belousov [Tue, 24 Jun 2014 06:52:32 +0000 (06:52 +0000)]
Make cpuctl_do_cpuid() and cpuctl_do_cpuid_count() return void.
There is no error to report.

Requested by: attilio
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoFix ifname normalization. ifconfig_IF_alias{es,N} did not work if ifname has
Hiroki Sato [Tue, 24 Jun 2014 04:37:36 +0000 (04:37 +0000)]
Fix ifname normalization.  ifconfig_IF_alias{es,N} did not work if ifname has
any of [.-/+].

Spotted by: jhay

10 years agoProvide APIs to directly get 'lowmem' and 'highmem' size directly.
Neel Natu [Tue, 24 Jun 2014 02:02:51 +0000 (02:02 +0000)]
Provide APIs to directly get 'lowmem' and 'highmem' size directly.

Previously the sizes were inferred indirectly based on the size of the mappings
at 0 and 4GB respectively. This works fine as long as size of the allocation is
identical to the size of the mapping in the guest's address space. However, if
the mapping is disjoint then this assumption falls apart (e.g., due to the
legacy BIOS hole between 640KB and 1MB).

10 years agomdoc: remove superfluous paragraph macros.
Joel Dahl [Mon, 23 Jun 2014 18:40:21 +0000 (18:40 +0000)]
mdoc: remove superfluous paragraph macros.

10 years agoWith the move away from GNATS, drop the CTM config file for downloading
Gavin Atkinson [Mon, 23 Jun 2014 18:13:42 +0000 (18:13 +0000)]
With the move away from GNATS, drop the CTM config file for downloading
the GNATS database, it will be going away soon.

10 years agoMake nd6_gctimer tunable.
Hajimu UMEMOTO [Mon, 23 Jun 2014 16:27:29 +0000 (16:27 +0000)]
Make nd6_gctimer tunable.

MFC after: 1 week

10 years agoExclude IPv4 address from doing longest match.
Hajimu UMEMOTO [Mon, 23 Jun 2014 15:43:27 +0000 (15:43 +0000)]
Exclude IPv4 address from doing longest match.
It prevented DNS based load balancing.

MFC after: 1 week

10 years agoFix markup and grammar.
Christian Brueffer [Mon, 23 Jun 2014 13:24:00 +0000 (13:24 +0000)]
Fix markup and grammar.

10 years agoSeveral small fixes (typos, grammar, mdoc).
Christian Brueffer [Mon, 23 Jun 2014 12:43:30 +0000 (12:43 +0000)]
Several small fixes (typos, grammar, mdoc).

10 years agouse .Mt to mark up email addresses consistently (part6)
Baptiste Daroussin [Mon, 23 Jun 2014 08:27:27 +0000 (08:27 +0000)]
use .Mt to mark up email addresses consistently (part6)

PR: 191174
Submitted by: Franco Fichtner <franco at lastsummer.de>

10 years agouse .Mt to mark up email addresses consistently (part4)
Baptiste Daroussin [Mon, 23 Jun 2014 08:25:03 +0000 (08:25 +0000)]
use .Mt to mark up email addresses consistently (part4)

PR: 191174
Submitted by: Franco Fichtner  <franco at lastsummer.de>

10 years agouse .Mt to mark up email addresses consistently (part3)
Baptiste Daroussin [Mon, 23 Jun 2014 08:23:05 +0000 (08:23 +0000)]
use .Mt to mark up email addresses consistently (part3)

PR: 191174
Submitted by: Franco Fichtner  <franco at lastsummer.de>

10 years agoAdd documentation for the fpu_kern(9) interfaces.
Konstantin Belousov [Mon, 23 Jun 2014 07:45:44 +0000 (07:45 +0000)]
Add documentation for the fpu_kern(9) interfaces.

Many thanks to jmg for reviewing the (previous version) of the text
and providing grammar and content fixes.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoAdd FPU_KERN_KTHR flag to fpu_kern_enter(9), which avoids saving FPU
Konstantin Belousov [Mon, 23 Jun 2014 07:37:54 +0000 (07:37 +0000)]
Add FPU_KERN_KTHR flag to fpu_kern_enter(9), which avoids saving FPU
context into memory for the kernel threads which called
fpu_kern_thread(9).  This allows the fpu_kern_enter() callers to not
check for is_fpu_kern_thread() to get the optimization.

Apply the flag to padlock(4) and aesni(4).  In aesni_cipher_process(),
do not leak FPU context state on error.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoUse correct names for the flags. MAP_ENTRY_GROWS_* have the same
Konstantin Belousov [Mon, 23 Jun 2014 07:03:47 +0000 (07:03 +0000)]
Use correct names for the flags.  MAP_ENTRY_GROWS_* have the same
numerical values as MAP_STACK_GROWS_*, but the former is for entries'
eflags, while the later for the cow argument of vm_map_insert().

Submitted by: alc

10 years agoCatch up with r186809, correct comments.
Kevin Lo [Mon, 23 Jun 2014 05:17:39 +0000 (05:17 +0000)]
Catch up with r186809, correct comments.

10 years agoRestore the check for non-NULL dmatag in sndbuf_free.
Alexander Kabaev [Mon, 23 Jun 2014 03:45:39 +0000 (03:45 +0000)]
Restore the check for non-NULL dmatag in sndbuf_free.

The sound drivers that use own buffer management can use sndbuf_setup
and not do any busdma allocation, so the driver will end up with the
managed buffer but no valid dma map and tag for it. Avoid calling
bus_dmamem_free in such cases.

Reported by: ache
Missed in review by: kan

10 years agoFix some bugs when fetching probe arguments in i386. Firstly ensure that
Mark Johnston [Mon, 23 Jun 2014 02:00:14 +0000 (02:00 +0000)]
Fix some bugs when fetching probe arguments in i386. Firstly ensure that
the 4 byte-aligned dtrace_invop_callsite can be found and that it
immediately follows the call to dtrace_invop(). Secondly, fix some pointer
arithmetic to account for differences between struct i386_frame and illumos'
struct frame. Finally, ensure that dtrace_getarg() isn't inlined. It works
by following a fixed number of frame pointers to the probe site, so inlining
breaks it.

MFC after: 3 weeks

10 years agoTidy up fd-related functions called by do_execve
Mateusz Guzik [Mon, 23 Jun 2014 01:28:18 +0000 (01:28 +0000)]
Tidy up fd-related functions called by do_execve

o assert in each one that fdp is not shared
o remove unnecessary NULL checks - all userspace processes have fdtables
and kernel processes cannot execve
o remove comments about the danger of fd_ofiles getting reallocated - fdtable
is not shared and fd_ofiles could be only reallocated if new fd was about to be
added, but if that was possible the code would already be buggy as setugidsafety
work could be undone

MFC after: 1 week

10 years agoFix a couple of bugs on amd64 when fetching probe arguments beyond the
Mark Johnston [Mon, 23 Jun 2014 01:10:56 +0000 (01:10 +0000)]
Fix a couple of bugs on amd64 when fetching probe arguments beyond the
first five for probes entered through a UD fault (i.e. FBT probes).

Specifically, handle the fact that dtrace_invop_callsite must be
16 byte-aligned and thus may not immediately follow the call to
dtrace_invop() in dtrace_invop_start(). Also fetch register arguments and
the stack pointer through a struct trapframe instead of a struct reg.

PR: 191260
Submitted by: luke.tw@gmail.com
MFC after: 3 weeks

10 years agoChange suggestion how to set MAKESYSPATH as broken incremental build
Andrey A. Chernov [Mon, 23 Jun 2014 00:54:56 +0000 (00:54 +0000)]
Change suggestion how to set MAKESYSPATH as broken incremental build
workaround. Magic ".../share/mk" (search directories up to /)
does not work for f.e. /usr/src/gnu/lib/libgcc because the path
inside is starting from /usr/obj hierarchy and ends up in
/usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
IMHO proper fixing of incremental build is needed urgently.

10 years agocxgbe(4): Update the bundled T4 and T5 firmwares to versions 1.11.27.0.
Navdeep Parhar [Sun, 22 Jun 2014 23:40:20 +0000 (23:40 +0000)]
cxgbe(4): Update the bundled T4 and T5 firmwares to versions 1.11.27.0.

Obtained from: Chelsio
MFC after: 3 days

10 years agoMerge intermediate OpenBSD v1.25 changes (almost identical to ours)
Andrey A. Chernov [Sun, 22 Jun 2014 21:54:57 +0000 (21:54 +0000)]
Merge intermediate OpenBSD v1.25 changes (almost identical to ours)
to reduce diff and bump OpenBSD patch level to v1.26.

MFC after:      2 weeks

10 years agoDon't take filedesc lock in fdunshare().
Mateusz Guzik [Sun, 22 Jun 2014 21:37:27 +0000 (21:37 +0000)]
Don't take filedesc lock in fdunshare().

We can read refcnt safely and only care if it is equal to 1.

If it could suddenly change from 1 to something bigger the code would be
buggy even in the previous form and transitions from > 1 to 1 are equally racy
and harmless (we copy even though there is no need).

MFC after: 1 week

10 years agogetopt(3): recognize option:: as GNU extension for "optional options".
Pedro F. Giffuni [Sun, 22 Jun 2014 20:13:57 +0000 (20:13 +0000)]
getopt(3): recognize option:: as GNU extension for "optional options".

Also ANSIfy a function declaration.

While here update the OpenBSD patch level in getopt_long.c as we
already have the corresponding change.

Obtained from: NetBSD
MFC after: 2 weeks

10 years agoWith the migration from GNATS to Bugzilla, we no longer need a tool to
Gavin Atkinson [Sun, 22 Jun 2014 16:35:03 +0000 (16:35 +0000)]
With the migration from GNATS to Bugzilla, we no longer need a tool to
graph GNATS PR statistics.  It would be nice to have a similar tool for
the new bug database, but that would likely be a from-scratch rewrite.

10 years agoRemove the incomplete Tegra 2 code, nobody was maintaining it. The AC100
Andrew Turner [Sun, 22 Jun 2014 15:15:52 +0000 (15:15 +0000)]
Remove the incomplete Tegra 2 code, nobody was maintaining it. The AC100
never booted to single user mode.

It can be brought back if someone is willing to get it into a stable state
and maintain it.

10 years agoPermit changing cpu mask for cpu set 1 in presence of drivers
Alexander V. Chernikov [Sun, 22 Jun 2014 11:32:23 +0000 (11:32 +0000)]
Permit changing cpu mask for cpu set 1 in presence of drivers
binding their threads to particular CPU.

Changing ithread cpu mask is now performed by special cpuset_setithread().
It creates additional cpuset root group on first bind invocation.

No objection: jhb
Tested by: hiren
MFC after: 2 weeks
Sponsored by: Yandex LLC

10 years agoconvert to using pidfile... This prevents multiple wpa_supplicants
John-Mark Gurney [Sun, 22 Jun 2014 10:00:33 +0000 (10:00 +0000)]
convert to using pidfile...  This prevents multiple wpa_supplicants
running at the same time causing problems w/ wifi not working..

the patch will be submitted upstream...  The next step if someone wants
to push it upstream is to break os_unix.c up so that all these other
utilities don't need libutil..

Reviewed by: rpaulo

10 years agoadd support for MosChip MCS9922... This is found on an ExpressCard..
John-Mark Gurney [Sun, 22 Jun 2014 06:54:36 +0000 (06:54 +0000)]
add support for MosChip MCS9922...  This is found on an ExpressCard..

tested to work w/ cu talking to itself (the two ports connected via
null modem cable)...

10 years agoAdd note on SYSCTL VARIABLES.
Mitsuru IWASAKI [Sun, 22 Jun 2014 02:48:27 +0000 (02:48 +0000)]
Add note on SYSCTL VARIABLES.

10 years agofd: replace fd_nfiles with fd_lastfile where appropriate
Mateusz Guzik [Sun, 22 Jun 2014 01:31:55 +0000 (01:31 +0000)]
fd: replace fd_nfiles with fd_lastfile where appropriate

fd_lastfile is guaranteed to be the biggest open fd, so when the intent
is to iterate over active fds or lookup one, there is no point in looking
beyond that limit.

Few places are left unpatched for now.

MFC after: 1 week

10 years agodo_dup: plug redundant adjustment of fd_lastfile
Mateusz Guzik [Sun, 22 Jun 2014 00:53:33 +0000 (00:53 +0000)]
do_dup: plug redundant adjustment of fd_lastfile

By that time it was already set by fdalloc, or was there in the first place
if fd is replaced.

MFC after: 1 week

10 years agoAllow creation of SDT probes from a module in which no providers are
Mark Johnston [Sat, 21 Jun 2014 19:29:40 +0000 (19:29 +0000)]
Allow creation of SDT probes from a module in which no providers are
defined. This ensures that the sdt:zfs:: probes appear despite the fact
the sdt provider is defined in the kernel rather than in zfs.ko.

Reported by: hiren
Tested by: hiren
MFC after: 2 weeks

10 years agoAdd the llvm patch for r267704.
Dimitry Andric [Sat, 21 Jun 2014 18:47:30 +0000 (18:47 +0000)]
Add the llvm patch for r267704.

10 years agoPull in r211435 from upstream llvm trunk (by Benjamin Kramer):
Dimitry Andric [Sat, 21 Jun 2014 18:22:23 +0000 (18:22 +0000)]
Pull in r211435 from upstream llvm trunk (by Benjamin Kramer):

  Legalizer: Add support for splitting insert_subvectors.

  We handle this by spilling the whole thing to the stack and doing the
  insertion as a store.

  PR19492. This happens in real code because the vectorizer creates
  v2i128 when AVX is enabled.

This fixes a "fatal error: error in backend: Do not know how to split
the result of this operator!" message encountered during compilation of
the net-p2p/libtorrent-rasterbar port.

Reported by: Evgeniy <iron@mail.ua>
MFC after: 3 days

10 years agoDrop ifdef nonsense: just use setvbuf(3).
Pedro F. Giffuni [Sat, 21 Jun 2014 14:07:33 +0000 (14:07 +0000)]
Drop ifdef nonsense: just use setvbuf(3).

Pointed out by: kib, bde

10 years agoRevert r267675:
Pedro F. Giffuni [Sat, 21 Jun 2014 01:43:56 +0000 (01:43 +0000)]
Revert r267675:

The code doesn't really benefit of using reallocf() in this case.
Also, the realloc() results being assigned temporary variable which
makes blind replacement with reallocf() mostly useless.

Pointed out by: stefanf, bde

10 years agoNo need to check if devd is running before posting an event.
Justin Hibbits [Sat, 21 Jun 2014 00:53:56 +0000 (00:53 +0000)]
No need to check if devd is running before posting an event.

10 years agoFix a bug in bsdgrep(1) where patterns are not correctly
Glen Barber [Fri, 20 Jun 2014 21:53:50 +0000 (21:53 +0000)]
Fix a bug in bsdgrep(1) where patterns are not correctly
detected.

Certain criteria must be met for this bug to show up:

 * the -w flag is specified, and
 * neither -o or --color are specified, and
 * the pattern is part of another word in the line, and
 * the other word that contains the pattern occurs first

PR: 181973
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

10 years agoAdd -u (unbuffered output) after GNU sed.
Pedro F. Giffuni [Fri, 20 Jun 2014 21:41:30 +0000 (21:41 +0000)]
Add -u (unbuffered output) after GNU sed.

Obtained from: NetBSD
MFC after: 1 week

10 years agoHide a harmless "QUEUE FULL EVENT" message behind bootverbose.
Hiren Panchasara [Fri, 20 Jun 2014 21:18:35 +0000 (21:18 +0000)]
Hide a harmless "QUEUE FULL EVENT" message behind bootverbose.

Requested by: A bunch of users on mailing-lists
Suggested by: scottl
MFC after: 1 week
Sponsored by: Yahoo! inc.

10 years agoConsider the total number of descriptors available (and not just those
Navdeep Parhar [Fri, 20 Jun 2014 20:28:46 +0000 (20:28 +0000)]
Consider the total number of descriptors available (and not just those
that are ready to be reclaimed) when deciding whether to resume tx after
a stall.

MFC after: 3 days

10 years agoFix a bug which incorrectly allowed two listening SCTP sockets on
Michael Tuexen [Fri, 20 Jun 2014 20:17:39 +0000 (20:17 +0000)]
Fix a bug which incorrectly allowed two listening SCTP sockets on
the same port bound to the wildcard address.

MFC after: 3 days

10 years agoCap the percent CPU of individual threads at 100% to fix some of the
John Baldwin [Fri, 20 Jun 2014 19:54:23 +0000 (19:54 +0000)]
Cap the percent CPU of individual threads at 100% to fix some of the
more obvious imprecision in the previous top changes.

Specifically, top uses a delta of clock_gettime() calls right after
invoking the kern.proc sysctl to fetch the process/thread list to
compute the time delta between the fetches.  However, the kern.proc
sysctl handler does not run in constant time.  It can spin on locks,
be preempted by an interrupt handler, etc.  As a result, the time
between the gathering of stats for individual processes or threads
between subsequent kern.proc handlers can vary.  If a "slow" kern.proc
run is followed by a "fast" kern.proc run, then the threads/processes
at the start of the "slow" run will have a longer time delta than the
threads/processes at the end.  If the clock_gettime() time delta is
not itself skewed by preemption, then the delta may be too short for
a given thread/process resulting in a higher percent CPU than actual.
However, there is no good way to calculate the exact amount of overage,
nor to know which threads to subtract the overage from.  Instead, just
punt and fix the definitely-wrong case of an individual thread having
more than 100% CPU.

Discussed with: zonk

10 years agoFix a bug in the setsockopt()-handling of the SCTP
Michael Tuexen [Fri, 20 Jun 2014 17:45:00 +0000 (17:45 +0000)]
Fix a bug in the setsockopt()-handling of the SCTP
specific option SCTP_PEER_ADDR_THLDS: Use the
provided address as intended.

MFC after: 3 days

10 years agoFix a code typo that prevented mkdir from firing (unnoticed
Devin Teske [Fri, 20 Jun 2014 17:40:38 +0000 (17:40 +0000)]
Fix a code typo that prevented mkdir from firing (unnoticed
usually because another part of the code succeeded in making
the same directory).

MFC after:      3 days

10 years agoTest RTLD's new LD_LIBRARY_PATH_FDS variable.
Jonathan Anderson [Fri, 20 Jun 2014 17:14:59 +0000 (17:14 +0000)]
Test RTLD's new LD_LIBRARY_PATH_FDS variable.

Test LD_LIBRARY_PATH_FDS by linking a binary that requires a shared
library that isn't in any of the usual search paths.  Ensure this fails
when we don't supply LD_LIBRARY_PATH_FDS or we pass invalid information
in it.  Ensure it works when we pass the correct directory in various
places in the variable.

Approved by: rwatson (mentor)
MFC after: 3 weeks
Sponsored by: DARPA/AFRL

10 years agoAdd the LD_LIBRARY_PATH_FDS environmental variable.
Jonathan Anderson [Fri, 20 Jun 2014 17:08:32 +0000 (17:08 +0000)]
Add the LD_LIBRARY_PATH_FDS environmental variable.

This variable allows the loading of shared libraries via directory descriptors
rather than via library paths.  If LD_LIBRARY_PATH_FDS=3:4:12, the directories
represented by file descriptors 3, 4 and 12 will searched for shared libraries
before the normal path-based mechanisms are used.  This allows us to execute
unprivileged binaries from within a Capsicum sandbox even if they require
shared libraries.

Approved by: rwatson (mentor)
Reviewed by: kib
MFC after: 3 weeks
Sponsored by: DARPA/AFRL

10 years agoregex: Make use of reallocf().
Pedro F. Giffuni [Fri, 20 Jun 2014 15:29:09 +0000 (15:29 +0000)]
regex: Make use of reallocf().

Use of reallocf is useful in libraries as we are not certain the
application will exit after NULL.

This somewhat reduces portability but if since you are building
this as part of libc it is likely you have our non-standard
reallocf(3) already.

Reviewed by: ache
MFC after: 5 days

10 years agoHonor jails for unbound SCTP sockets when selecting source addresses,
Michael Tuexen [Fri, 20 Jun 2014 13:26:49 +0000 (13:26 +0000)]
Honor jails for unbound SCTP sockets when selecting source addresses,
reporting IP-addresses to the peer during the handshake, adding
addresses to the host, reporting the addresses via the sysctl
interface (used by netstat, for example) and reporting the
addresses to the application via socket options.
This issue was reported by Bernd Walter.

MFC after: 3 days

10 years agoRestore the ABI of the cpuctl(4) ioctl request CPUCTL_CPUID, use
Konstantin Belousov [Fri, 20 Jun 2014 13:13:38 +0000 (13:13 +0000)]
Restore the ABI of the cpuctl(4) ioctl request CPUCTL_CPUID, use
separate argument structure with added level_type field for
CPUID_CPUID_COUNT request.

Reviewed by: attilio (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

10 years agoRemove /etc/gnats from here, too.
Gavin Atkinson [Fri, 20 Jun 2014 11:47:49 +0000 (11:47 +0000)]
Remove /etc/gnats from here, too.

10 years agoStop creating /etc/gnats
Gavin Atkinson [Fri, 20 Jun 2014 11:46:42 +0000 (11:46 +0000)]
Stop creating /etc/gnats

10 years agoFix changing the username
Baptiste Daroussin [Fri, 20 Jun 2014 10:38:08 +0000 (10:38 +0000)]
Fix changing the username

PR: 189172
Submitted by: fullermd@over-yonder.net
MFC after: 1 week

10 years agoRemoved compatibility with pre FreeBSD 2.2 pw_mkdb command
Baptiste Daroussin [Fri, 20 Jun 2014 10:34:32 +0000 (10:34 +0000)]
Removed compatibility with pre FreeBSD 2.2 pw_mkdb command
Fix some broken indentattion

PR: 189173
Submitted by: fullermd@over-yonder.net
MFC after: 1 week

10 years agouse .Mt to mark up email addresses consistently (part2)
Baptiste Daroussin [Fri, 20 Jun 2014 09:57:27 +0000 (09:57 +0000)]
use .Mt to mark up email addresses consistently (part2)

PR: 191174
Submitted by: Franco Fichtner  <franco@lastsummer.de>

10 years agouse .Mt to mark up email addresses consistently (part1)
Baptiste Daroussin [Fri, 20 Jun 2014 09:40:43 +0000 (09:40 +0000)]
use .Mt to mark up email addresses consistently (part1)

PR: 191174
Submitted by: Franco Fichtner  <franco@lastsummer.de>

10 years agoAssert that the new entry is inserted into the right location in the
Konstantin Belousov [Fri, 20 Jun 2014 07:01:53 +0000 (07:01 +0000)]
Assert that the new entry is inserted into the right location in the
map entries list, and that it does not overlap with the previous and
next entries.

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

10 years agoIncrement the pending packets more aggressively for TSO
Bryan Venteicher [Fri, 20 Jun 2014 02:54:04 +0000 (02:54 +0000)]
Increment the pending packets more aggressively for TSO

Assume the number of description used is reasonable value to
increment this otherwise opaque field by.

While here, reduce a minor difference between the legacy and
multiqueue transmit paths.

MFC after: 1 week

10 years agoHandle multiple calls to rxq_eof for single packet completion
Bryan Venteicher [Fri, 20 Jun 2014 02:49:03 +0000 (02:49 +0000)]
Handle multiple calls to rxq_eof for single packet completion

This requires the VMware vmxnet3 device to flip the start of packet
descriptor's generation before the rest of the packet's descriptors
have been loaded into the Rx ring. I've never observed this behavior,
and it seems to make the most sense not to do it this way. But it is
not a lot of work for the driver to handle this situation just in case.

MFC after: 1 week

10 years agoRemove an unnecessary kick of the host at the end of transmitting
Bryan Venteicher [Fri, 20 Jun 2014 02:31:52 +0000 (02:31 +0000)]
Remove an unnecessary kick of the host at the end of transmitting

MFC after: 1 week

10 years agoSet target->sbp field to valid value when sbp device is created.
Alexander Kabaev [Fri, 20 Jun 2014 01:45:03 +0000 (01:45 +0000)]
Set target->sbp field to valid value when sbp device is created.

The sbp_cam_detach_target can be called from sbp_post_explore function
on the first target that is not really attached and it was written with
the corresponding safety check in place to tolerate that. Unfortunately
the recent locking cleanup did add a locking assertion that tries to
dereference the target->sbp pointer unconditionally, which causes less
than desirable outcome. Since the assertion is useful, just initialize
the target sbp pointer once when sbp device is being initialized instead
of when the target is being attached. This makes assertion work in all
cases and fixes the crash on boot.

10 years agoFollowing comments in r242565 add the possibility to specify ecx when
Attilio Rao [Thu, 19 Jun 2014 21:54:41 +0000 (21:54 +0000)]
Following comments in r242565 add the possibility to specify ecx when
performing cpuid calls.
Add also a new way to specify the level type to cpucontrol(8) as
reported in the manpage.

Sponsored by: EMC / Isilon storage division
Reviewed by: bdrewery, gcooper
Testerd by: bdrewery

10 years agoEliminate a pointless call to vm_map_clip_start() from vm_map_growstack().
Alan Cox [Thu, 19 Jun 2014 21:05:07 +0000 (21:05 +0000)]
Eliminate a pointless call to vm_map_clip_start() from vm_map_growstack().
For this call to do anything at all we would have to have two overlapping
map entries.

Submitted by: kib

10 years agoDon't dump core when the ELF file has no section headers. The ELF
Marcel Moolenaar [Thu, 19 Jun 2014 20:12:28 +0000 (20:12 +0000)]
Don't dump core when the ELF file has no section headers. The ELF
core files created by gcore are among those.

10 years agoserial_num and device_id fields are not necessarily null-terminated.
Alexander Motin [Thu, 19 Jun 2014 19:28:35 +0000 (19:28 +0000)]
serial_num and device_id fields are not necessarily null-terminated.

Before this it was impossible to use all 16 bytes of serial number, and
client always got serial number NULL-terminated, that is not required.

MFC after: 2 weeks

10 years agoTrust the state of a power resource that get from a working _STA method
John Baldwin [Thu, 19 Jun 2014 18:35:14 +0000 (18:35 +0000)]
Trust the state of a power resource that get from a working _STA method
instead of trying to cache it.

Previously, we only trusted the state if we did not have a cached state.
However, once a state was cached, the _STA method was always ignored.
Specifically, once a power resource had been turned on once (e.g.
during resume), the driver assumed it was always on even if _STA said it
was off and never turned it back on.  This prevented the power resource
from being turned back on if a laptop was resumed twice, for example.

To fix, just remove the cached state entirely and always use the results
of _STA.  The loops already skip any resources where _STA fails.

Submitted by: trasz (initial patch to invoke _ON)
MFC after: 1 week

10 years agoWhen MAP_STACK_GROWS_{DOWN,UP} are passed to vm_map_insert() set the
Alan Cox [Thu, 19 Jun 2014 16:26:16 +0000 (16:26 +0000)]
When MAP_STACK_GROWS_{DOWN,UP} are passed to vm_map_insert() set the
corresponding flag(s) in the new map entry.  Previously, the caller was
responsible for setting them after vm_map_insert() returned.

Pass MAP_STACK_GROWS_DOWN to vm_map_insert() from vm_map_growstack() when
extending the stack in the downward direction.

Together these changes slightly simplify the caller's task when creating a
downward growing stack.  In particular, the caller no longer needs to clip
the previous entry, because the new stack entry can't possibly coalesce
with the previous entry.

Reviewed by: kib
Sponsored by: EMC / Isilon Storage Division

10 years agoExecute task management request directly in ctl_queue() context.
Alexander Motin [Thu, 19 Jun 2014 13:19:35 +0000 (13:19 +0000)]
Execute task management request directly in ctl_queue() context.

From one side it allows to remove CTL_FLAG_TASK_PENDING flag, handling of
which significantly complicates fine-grained locking.  From the other side
it reduces task management requests latency even below then that flag could.
As downside, it denies task management code to sleep, but that is not needed
any way now.

Discussed with: ken

10 years agoUse Mt macro to properly format mailto links
Steven Kreuzer [Thu, 19 Jun 2014 13:18:23 +0000 (13:18 +0000)]
Use Mt macro to properly format mailto links

Approved by: hrs (mentor)

10 years agoAdd some more CTL_FLAG_ABORT check points.
Alexander Motin [Thu, 19 Jun 2014 12:43:41 +0000 (12:43 +0000)]
Add some more CTL_FLAG_ABORT check points.

This should allow to abort commands doing mostly disk I/O, such as VERIFY
or WRITE SAME.  Before this change CTL_FLAG_ABORT was only checked around
data moves, which for these commands may not happen for a very long time.

MFC after: 2 weeks