]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agostrftime() xlocale cleanups.
pfg [Sat, 26 Jul 2014 14:24:13 +0000 (14:24 +0000)]
strftime() xlocale cleanups.

Replace fprintf_l with fputs when output is unformatted.
Use locale_t in _conv() since it was using sprintf (now sprintf_l)
Use locale_t on _yconv() sinci it calls _conv()

Obtained from: Apple Inc. (Libc 997.90.3)
CR: D482
Reviewed by: theraven
MFC after: 1 week

9 years agoImplement separate I/O dispatch method for ZVOLs in "dev" mode.
mav [Sat, 26 Jul 2014 13:56:50 +0000 (13:56 +0000)]
Implement separate I/O dispatch method for ZVOLs in "dev" mode.

Unlike disk devices ZVOLs process all requests synchronously.  That makes
impossible sending multiple requests to them from single thread.  From the
other side ZVOLs have real d_read/d_write methods, which unlike d_strategy
can handle uio scatter/gather and have no strict I/O size limitations.

So, if ZVOL in "dev" mode is detected, use of d_read/d_write methods instead
of d_strategy allows to avoid pointless splitting of large requests into
MAXPHYS (128K) sized chunks.

MFC after: 1 week

9 years agoFix infinite loop, when doing WRITE SAME on file-backed LUN.
mav [Sat, 26 Jul 2014 13:43:25 +0000 (13:43 +0000)]
Fix infinite loop, when doing WRITE SAME on file-backed LUN.

MFC after: 3 days

9 years agoThe previous commit (r269119) introduced a regression: It removed the
se [Sat, 26 Jul 2014 13:14:28 +0000 (13:14 +0000)]
The previous commit (r269119) introduced a regression: It removed the
ability to specify the the full path name of the keymap file.

Instead leave the original search order intact, but insert the path for
newcons-specific fonts (if run on a system using newcons):

- KEYMAP_PATH in environment
- full path name
- /usr/share/vt/keymaps (only if newcons is in use!)
- /usr/share/syscons/keymaps (also as fall-back for newcons)

MFC after: 1 week

9 years agoFix obvious off by one error: prefix[1] should be set to the path of the
se [Sat, 26 Jul 2014 12:17:26 +0000 (12:17 +0000)]
Fix obvious off by one error: prefix[1] should be set to the path of the
newcons specific keymap files, not prefix[2]. The result of this bug was
that kbdcontrol ignored the files in the syscons keymap directory, which
apparently still work under newcons, for most locales.

MFC after: 1 week

9 years agoMFV r269010:
delphij [Sat, 26 Jul 2014 10:20:48 +0000 (10:20 +0000)]
MFV r269010:

Import Illumos changes to address the following Illumos issues:
  4976 zfs should only avoid writing to a failing non-redundant
       top-level vdev
  4978 ztest fails in get_metaslab_refcount()
  4979 extend free space histogram to device and pool
  4980 metaslabs should have a fragmentation metric
  4981 remove fragmented ops vector from block allocator
  4982 space_map object should proactively upgrade when feature
       is enabled
  4984 device selection should use fragmentation metric

MFC after: 2 weeks

9 years agoMake sysctls under vfs.zfs.zfetch writeable.
mav [Sat, 26 Jul 2014 09:09:14 +0000 (09:09 +0000)]
Make sysctls under vfs.zfs.zfetch writeable.

I don't see any reason for them to be read-only, while tuning them without
reboot is much more convenient for experiments.

MFC after: 2 weeks

9 years agoIn the "Too many open files" edge cases don't try to preserve old
ache [Sat, 26 Jul 2014 08:41:03 +0000 (08:41 +0000)]
In the "Too many open files" edge cases don't try to preserve old
number for non-std* descriptors, but close old file and retry.

Obtained from:  inspired by Apple's change from pfg@
MFC after:      2 weeks

9 years agoRemove useless getpwnam() call.
des [Sat, 26 Jul 2014 07:40:31 +0000 (07:40 +0000)]
Remove useless getpwnam() call.

Submitted by: Arthur Mesh <amesh@juniper.net>
MFC after: 1 week

9 years agoReviewed by: imp
sjg [Sat, 26 Jul 2014 04:38:09 +0000 (04:38 +0000)]
Reviewed by: imp

LDFLAGS is supposed to be given to CC not LD.
Define _LDFLAGS as a filtered version of LDFLAGS safe to give to LD

9 years agoEnable at91 systems to boot from high capacity SD cards.
ian [Sat, 26 Jul 2014 04:16:04 +0000 (04:16 +0000)]
Enable at91 systems to boot from high capacity SD cards.

This also fixes a few minor violations of the SD protocol, such as running
the bus at high speed during the card identification sequence.

The sdcard_init() routine now probes for SDHC cards so that later read
requests can make needed adjustments between block and byte offsets based
on card type.

There is a new MCI_readblocks() function that takes block number and block
count parameters instead of byte-offset values.  Using this routine, boot
loader code can load a kernel from any location on an SDHC or standard SD.

The old MCI_read() interface remains unchanged so that existing customized
boot loader code will still keep working without changes.  Using this
routine, boot loaders can load a kernel from anywhere in the first 4GB of
an SDHC card (or of course any location on a standard SD card).

A new sdcard_use4wire() routine allows boot loaders to request 4-bit
transfers; it should be called after sdcard_init().  The sdcard_init()
routine no longer assumes the hardware is 4-wire capable and by default
sets things up for 1-bit transfers.  (4-wire mode is unreliable on
at91rm9200, works on later SoCs.)

PR: 155894
Submitted by: me.  years ago.

9 years agoThe 'flags' variable is conflicting with some inline code in a header file
ian [Sat, 26 Jul 2014 04:09:43 +0000 (04:09 +0000)]
The 'flags' variable is conflicting with some inline code in a header file
("variable flags shadows a global..."), just rename this variable to
wish away the problem.

9 years agoEliminate "no previous prototype for main" warnings.
ian [Sat, 26 Jul 2014 03:33:19 +0000 (03:33 +0000)]
Eliminate "no previous prototype for main" warnings.

9 years agoSilence a clang warning about a while loop with an empty body.
ian [Sat, 26 Jul 2014 03:19:13 +0000 (03:19 +0000)]
Silence a clang warning about a while loop with an empty body.

9 years agoIf a vcpu has issued a HLT instruction with interrupts disabled then it sleeps
neel [Sat, 26 Jul 2014 02:53:51 +0000 (02:53 +0000)]
If a vcpu has issued a HLT instruction with interrupts disabled then it sleeps
forever in vm_handle_hlt().

This is usually not an issue as long as one of the other vcpus properly resets
or powers off the virtual machine. However, if the bhyve(8) process is killed
with a signal the halted vcpu cannot be woken up because it's sleep cannot be
interrupted.

Fix this by waking up periodically and returning from vm_handle_hlt() if
TDF_ASTPENDING is set.

Reported by: Leon Dang
Sponsored by: Nahanni Systems

9 years agoDon't return -1 from the push emulation handler. Negative return values are
neel [Sat, 26 Jul 2014 02:51:46 +0000 (02:51 +0000)]
Don't return -1 from the push emulation handler. Negative return values are
interpreted specially on return from sys_ioctl() and may cause undesirable
side-effects like restarting the system call.

9 years agoAdd a 'raw' parameter to the 'modinfo' subcommand. This is handy when
np [Sat, 26 Jul 2014 00:51:45 +0000 (00:51 +0000)]
Add a 'raw' parameter to the 'modinfo' subcommand.  This is handy when
trying to figure out why a QSFP+/SFP+ connector or cable wasn't
identified correctly by cxgbe(4).  Its output looks like this:

# cxgbetool t5nex0 modinfo 0 raw
00:  03 04 21 00  00 00 00 00  ..!. ....
08:  04 00 00 00  67 00 00 00  .... g...
10:  00 00 05 00  41 6d 70 68  .... Amph
18:  65 6e 6f 6c  20 20 20 20  enol
20:  20 20 20 20  00 41 50 48       .APH
28:  35 37 31 35  34 30 30 30  5715 4000
30:  33 20 20 20  20 20 20 20  3
38:  4b 20 20 20  01 00 00 fa  K    ....
40:  00 00 00 00  41 50 46 31  .... APF1
48:  30 30 34 30  30 33 30 30  0040 0300
50:  30 33 20 20  31 30 30 31  03   1001
58:  33 30 20 20  00 00 00 97  30   ....

MFC after: 3 days

9 years agoAdd error return to dumpsys(), and use it in doadump().
gavin [Fri, 25 Jul 2014 23:52:53 +0000 (23:52 +0000)]
Add error return to dumpsys(), and use it in doadump().

This commit does not add error returns to minidumpsys() or
textdump_dumpsys(); those can also be added later.

Submitted by: Conrad Meyer (EMC / Isilon storage division)

9 years agoDiff reduction against Illumos.
delphij [Fri, 25 Jul 2014 22:58:55 +0000 (22:58 +0000)]
Diff reduction against Illumos.

MFC after: 2 weeks

9 years agoDocument an important, but easy to overlook without grepping the
imp [Fri, 25 Jul 2014 21:10:30 +0000 (21:10 +0000)]
Document an important, but easy to overlook without grepping the
entire tree, detail about LDFLAGS.

9 years agoUse the right lengths.
delphij [Fri, 25 Jul 2014 20:54:10 +0000 (20:54 +0000)]
Use the right lengths.

Submitted by: Sascha Wildner
MFC after: 2 weeks

9 years agoUse the right length.
delphij [Fri, 25 Jul 2014 20:49:59 +0000 (20:49 +0000)]
Use the right length.

Submitted by: Sascha Wildner
MFC after: 2 weeks

9 years agoInsert new threads at the end of the thread list in the process
deischen [Fri, 25 Jul 2014 20:21:02 +0000 (20:21 +0000)]
Insert new threads at the end of the thread list in the process
instead of at the beginning.  This allows an intra process signal
to be sent to the oldest thread with the signal unmasked - which,
if it still exists, is the main thread.  This mimics behavior
found in Linux and Solaris.

9 years agoSimplify the meaning of return values from the inout handlers. After this
neel [Fri, 25 Jul 2014 20:18:35 +0000 (20:18 +0000)]
Simplify the meaning of return values from the inout handlers. After this
change 0 means success and non-zero means failure.

This also helps to eliminate VMEXIT_POWEROFF and VMEXIT_RESET as return values
from VM-exit handlers.

CR: D480
Reviewed by: grehan, jhb

9 years agoTransform the I/O when vdev_physical_ashift is greater than
delphij [Fri, 25 Jul 2014 18:41:56 +0000 (18:41 +0000)]
Transform the I/O when vdev_physical_ashift is greater than
SPA_MINBLOCKSHIFT.

MFC after: 2 weeks

9 years agoelfdump: Improve section type reporting
emaste [Fri, 25 Jul 2014 18:20:56 +0000 (18:20 +0000)]
elfdump: Improve section type reporting

The SHT range 0x70000000-0x7fffffff is processor-specific.  Pass the
ELF machine type header to sh_types so the section header type name can
be reported correctly for the given processor.

For all ranges report the actual value for unknown types.

Add MIPS-specific type SHT_MIPS_OPTIONS.

CR: D483
Reviewed by: sbruno, marcel
Sponsored by: DARPA, AFRL

9 years agoFix spelling of Camellia algorithm. While here, replace blank lines
wblock [Fri, 25 Jul 2014 17:09:48 +0000 (17:09 +0000)]
Fix spelling of Camellia algorithm.  While here, replace blank lines
between examples with actual .Pp breaks.

PR: 192067
Submitted by: dmitry2004@yandex.ru
MFC after: 1 week

9 years agoUpdate the freebsd-tips example to use drill instead of dig since bind is no longer...
allanjude [Fri, 25 Jul 2014 14:47:44 +0000 (14:47 +0000)]
Update the freebsd-tips example to use drill instead of dig since bind is no longer in base

CR: D460
Approved by: bcr (mentor)

9 years agoFix ctl(4) kldload failure that manifested like this:
trasz [Fri, 25 Jul 2014 11:29:45 +0000 (11:29 +0000)]
Fix ctl(4) kldload failure that manifested like this:

link_elf_obj: symbol icl_pdu_new_bhs undefined

PR: 192031
Submitted by: Nils Beyer (earlier version)
MFC after: 3 days
Sponsored by: FreeBSD Foundation

9 years agoAdd net80211 and minor cleanup.
kevlo [Fri, 25 Jul 2014 10:27:36 +0000 (10:27 +0000)]
Add net80211 and minor cleanup.

9 years agoAs of r268075, the responsibility of rounding up buffer to optimal size have
delphij [Fri, 25 Jul 2014 06:53:20 +0000 (06:53 +0000)]
As of r268075, the responsibility of rounding up buffer to optimal size have
been transferred from zio_compress_data to its caller.  Therefore, passing
the 'minblocksize' down will be a no-op.

Eliminate the parameter to reduce diff against upstream.

MFC after: 2 weeks

9 years agoFix structure of new tests (r268794) for usr.bin/units.
jmmv [Fri, 25 Jul 2014 01:29:22 +0000 (01:29 +0000)]
Fix structure of new tests (r268794) for usr.bin/units.

- Make sure the tests go into the right directory.  The location was
  wrong so they were overwriting the bin/chown tests!
- Use the right naming scheme for the test program.
- Remove the svn:executable property from the shell script.

9 years agoFix typo.
kib [Thu, 24 Jul 2014 23:14:03 +0000 (23:14 +0000)]
Fix typo.

MFC after: 3 days

9 years agoFix a couple of issues in the PUSH emulation:
neel [Thu, 24 Jul 2014 23:01:53 +0000 (23:01 +0000)]
Fix a couple of issues in the PUSH emulation:

It is not possible to PUSH a 32-bit operand on the stack in 64-bit mode. The
default operand size for PUSH is 64-bits and the operand size override prefix
changes that to 16-bits.

vm_copy_setup() can return '1' if it encounters a fault when walking the
guest page tables. This is a guest issue and is now handled properly by
resuming the guest to handle the fault.

9 years agoPOSIX says that passing a location returned by telldir() to seekdir()
jhb [Thu, 24 Jul 2014 20:44:30 +0000 (20:44 +0000)]
POSIX says that passing a location returned by telldir() to seekdir()
after an intervening call to rewinddir() is undefined, so reclaim any
pending telldir() cookies in the directory when rewinddir() is called.

CR: D459
Reviewed by: jilles
MFC after: 1 week

9 years agolibstand's qdivrem.c assumes that sizeof(int) == sizeof(long), this is not
sbruno [Thu, 24 Jul 2014 19:06:15 +0000 (19:06 +0000)]
libstand's qdivrem.c assumes that sizeof(int) == sizeof(long), this is not
true on amd64 I'm not quite positive this is the "correct" solution for
this but it does seem to compile and shut up the spew of warnings when
compiling libstand for userboot.

Add two _Static_asserts() so that in the future somebody will get a compile
failure if an architecture develops that violates the assumptions of this
code. (strongly suggested by jmg)

Change commetns to indicate int types instead of long.  (noted by ian in
phabric review)

Phabric: https://phabric.freebsd.org/D443

9 years agoSome hooks in cxgbe(4) for the offloaded iSCSI driver.
np [Thu, 24 Jul 2014 18:39:08 +0000 (18:39 +0000)]
Some hooks in cxgbe(4) for the offloaded iSCSI driver.

(I'm committing this on behalf of my colleagues in the Storage team
at Chelsio).

Submitted by: Sreenivasa Honnur <shonnur at chelsio dot com>
Sponsored by: Chelsio Communications.

9 years agoInitialize notification strucuture. This was missed in an earlier commit
tuexen [Thu, 24 Jul 2014 18:06:18 +0000 (18:06 +0000)]
Initialize notification strucuture. This was missed in an earlier commit

MFC after: 3 days

9 years agoStrip the patch level from the release name before trying to fetch the
des [Thu, 24 Jul 2014 17:43:42 +0000 (17:43 +0000)]
Strip the patch level from the release name before trying to fetch the
distribution.

PR: 170264
Approved by: nathanw
MFC after: 1 week

9 years agovtfontcvt will first ship in FreeBSD 10.1
emaste [Thu, 24 Jul 2014 15:16:03 +0000 (15:16 +0000)]
vtfontcvt will first ship in FreeBSD 10.1

9 years agoFix a typo in a comment
bapt [Thu, 24 Jul 2014 14:11:33 +0000 (14:11 +0000)]
Fix a typo in a comment

Reported by: jhb

9 years agoFix build with QUEUE_MACRO_DEBUG.
mav [Thu, 24 Jul 2014 14:10:58 +0000 (14:10 +0000)]
Fix build with QUEUE_MACRO_DEBUG.

Submitted by: benno@
MFC after: 3 days

9 years agoFix EtherIP. TOS field must be initialized when the inner protocol is
hrs [Thu, 24 Jul 2014 10:42:47 +0000 (10:42 +0000)]
Fix EtherIP.  TOS field must be initialized when the inner protocol is
PF_LINK, and multicast/broadcast flag should always be dropped because
the outer protocol uses unicast even when the inner address is not for
unicast.  It had been broken since r236951 when gif_output() started to
use IFQ_HANDOFF().

9 years agoCorrect assertion. The shadowing object cannot be tmpfs vm object,
kib [Thu, 24 Jul 2014 10:25:42 +0000 (10:25 +0000)]
Correct assertion.  The shadowing object cannot be tmpfs vm object,
and tmpfs object cannot shadow.  In other words, tmpfs vm object is
always at the bottom of the shadow chain.

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

9 years agoIntel desktop Haswell CPUs may report benign corrected parity errors (see
marius [Thu, 24 Jul 2014 10:14:51 +0000 (10:14 +0000)]
Intel desktop Haswell CPUs may report benign corrected parity errors (see
HSD131 erratum in [1]) at a considerable rate. So filter these (default),
unless logging is enabled. Unfortunately, there really is no better way to
reasonably implement suppressing these errors than to just skipping them
in mca_log(). Given that they are reported for bank 0, they'd need to be
masked in MSR_MC0_CTL. However, P6 family processors require that register
to be set to either all 0s or all 1s, disabling way more than the one error
in question when using all 0s there. Alternatively, it could be masked for
the corresponding CMCI, but that still wouldn't keep the periodic scanner
from detecting these spurious errors. Apart from that, register contents of
MSR_MC0_CTL{,2} don't seem to be publicly documented, neither in the Intel
Architectures Developer's Manual nor in the Haswell datasheets.

Note that while HSD131 actually is only about C0-stepping as of revision
014 of the Intel desktop 4th generation processor family specification
update, these corrected errors also have been observed with D0-stepping
aka "Haswell Refresh".

1: http://www.intel.de/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-desktop-specification-update.pdf

Reviewed by: jhb
MFC after: 3 days
Sponsored by: Bally Wulff Games & Entertainment GmbH

9 years agoCopying pages via temporary mappings in the !DMAP case of pmap_copy_pages()
marius [Thu, 24 Jul 2014 10:12:22 +0000 (10:12 +0000)]
Copying pages via temporary mappings in the !DMAP case of pmap_copy_pages()
involves updating the corresponding page tables followed by accesses to the
pages in question. This sequence is subject to the situation exactly described
in the "AMD64 Architecture Programmer's Manual Volume 2: System Programming"
rev. 3.23, "7.3.1 Special Coherency Considerations" [1, p. 171 f.]. Therefore,
issuing the INVLPG right after modifying the PTE bits is crucial (see also
r269050).
For the amd64 PMAP code, the order of instructions was already correct. The
above fact still is worth documenting, though.

1: http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/24593_APM_v21.pdf

Reviewed by: alc
Sponsored by: Bally Wulff Games & Entertainment GmbH

9 years ago- Copying and zeroing pages via temporary mappings involves updating the
marius [Thu, 24 Jul 2014 10:08:02 +0000 (10:08 +0000)]
- Copying and zeroing pages via temporary mappings involves updating the
  corresponding page tables followed by accesses to the pages in question.
  This sequence is subject to the situation exactly described in the "AMD64
  Architecture Programmer's Manual Volume 2: System Programming" rev. 3.23,
  "7.3.1 Special Coherency Considerations" [1, p. 171 f.]. Therefore, issuing
  the INVLPG right after modifying the PTE bits is crucial.
  For pmap_copy_page(), this has been broken in r124956 and later on carried
  over to pmap_copy_pages() derived from the former, while all other places
  in the i386 PMAP code use the correct order of instructions in this regard.
  Fixing the latter breakage solves the problem of data corruption seen with
  unmapped I/O enabled when running at least bare metal on AMD R-268D APUs.
  However, this might also fix similar corruption reported for virtualized
  environments.
- In pmap_copy_pages(), correctly set the cache bits on the source page being
  copied. This change is thought to be a NOP for the real world, though. [2]

1: http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/24593_APM_v21.pdf

Submitted by: kib [2]
Reviewed by: alc, kib
MFC after: 3 days
Sponsored by: Bally Wulff Games & Entertainment GmbH

9 years agoAdd compat shims for XDEV and XDEV_ARCH so we don't break all the
imp [Thu, 24 Jul 2014 06:16:51 +0000 (06:16 +0000)]
Add compat shims for XDEV and XDEV_ARCH so we don't break all the
users of them. Also, add a note to updating. We'll keep these shims at
least until the 12 branch.

9 years agoReduce the proliferation of VMEXIT_RESTART in task_switch.c.
neel [Thu, 24 Jul 2014 05:31:57 +0000 (05:31 +0000)]
Reduce the proliferation of VMEXIT_RESTART in task_switch.c.

This is in preparation for further simplification of the return values from
VM exit handlers in bhyve(8).

9 years agoFix fault injection in bhyve.
neel [Thu, 24 Jul 2014 01:38:11 +0000 (01:38 +0000)]
Fix fault injection in bhyve.

The faulting instruction needs to be restarted when the exception handler
is done handling the fault. bhyve now does this correctly by setting
'vmexit[vcpu].inst_length' to zero so the %rip is not advanced.

A minor complication is that the fault injection APIs are used by instruction
emulation code that is shared by vmm.ko and bhyve. Thus the argument that
refers to 'struct vm *' in kernel or 'struct vmctx *' in userspace needs to
be loosely typed as a 'void *'.

9 years agoClean symlinks created in sys/modules dirs when a make clean is invoked.
sbruno [Thu, 24 Jul 2014 00:25:25 +0000 (00:25 +0000)]
Clean symlinks created in sys/modules dirs when a make clean is invoked.

Phabric: https://phabric.freebsd.org/D474
Reviewed by: grehan sjg

9 years agoWhen producing fmake(1), `make clean' should remove fmake.1 (a copy of
dteske [Wed, 23 Jul 2014 23:01:54 +0000 (23:01 +0000)]
When producing fmake(1), `make clean' should remove fmake.1 (a copy of
make.1). Introduced initially via SVN r250699 (sjg).

Reviewed by: sjg, gjb
MFC after: 3 days
X-MFC-to: stable/10

9 years agoDelete the entire cleandepend/cleanmachine target thing now that its been
sbruno [Wed, 23 Jul 2014 22:58:00 +0000 (22:58 +0000)]
Delete the entire cleandepend/cleanmachine target thing now that its been
cleared out in r269029

Reviewed by: emaste@freebsd.org

9 years agoFake out the deprecation of XDEV and XDEV_ARCH by
gjb [Wed, 23 Jul 2014 22:35:23 +0000 (22:35 +0000)]
Fake out the deprecation of XDEV and XDEV_ARCH by
continuing to use the variables in the configuration
file, but switch XDEV= and XDEV_ARCH= to TARGET= and
TARGET_ARCH= appropriately.

Sponsored by: The FreeBSD Foundation

9 years agocxgbe(4): Keep track of the clusters that have to be freed by the
np [Wed, 23 Jul 2014 22:29:22 +0000 (22:29 +0000)]
cxgbe(4):  Keep track of the clusters that have to be freed by the
custom free routine (rxb_free) in the driver.  Fail MOD_UNLOAD with
EBUSY if any such cluster has been handed up to the kernel but hasn't
been freed yet.  This prevents a panic later when the cluster finally
needs to be freed but rxb_free is gone from the kernel.

MFC after: 1 week

9 years agoDeprecate the use of XDEV and XDEV_ARCH and just use TARGET/TARGET_ARCH
sbruno [Wed, 23 Jul 2014 22:18:43 +0000 (22:18 +0000)]
Deprecate the use of XDEV and XDEV_ARCH and just use TARGET/TARGET_ARCH
for the xdev build target, which is awesome and totally works.

Reapply svn R268377 with correct name of libsupc++ here as this does
resolve one dependancy race when building the xdev target.

the xdev target builds for amd64, i386, mips, mips64 and armv6 with this commit,
must be built as root, must be built from /usr/src, must not have a /usr/obj and
places the xdev tools in /usr/$TARGET_ARCH-freebsd

the xdev target still leaves some assorted files strewn about your /usr/src when
this is done and needs to be investigated further.

Phabric: https://phabric.freebsd.org/D385
Submitted by: bsdimp

9 years agoAdd .NOPATH to the machine target so that builds in sys/boot work and don't
sbruno [Wed, 23 Jul 2014 22:12:05 +0000 (22:12 +0000)]
Add .NOPATH to the machine target so that builds in sys/boot work and don't
error out building zfs loader.

Submitted by: sjg@freebsd.org

9 years agoUpdate so that clean target in sys/boot will delete the symlink
sbruno [Wed, 23 Jul 2014 22:11:04 +0000 (22:11 +0000)]
Update so that clean target in sys/boot will delete the symlink
created for machine

Reviewed by: emaste

9 years agoFix a bug where include file `networking/services.subr' was not being
dteske [Wed, 23 Jul 2014 21:08:04 +0000 (21:08 +0000)]
Fix a bug where include file `networking/services.subr' was not being
properly clustered.

Change `fixedsize' to `fixedsize = true' to satisfy newer versions of dot(1)
generating error "Warning: <stdin>: syntax error in line 27 near ','".

Remove bounding cluster surrounding various include-groupings, allowing
groups of include files to float freely to the greatest consumer (reducing
the density of rendered diagrams).

While here, change the bgcolor of include clusters from white to X11 color
`thistle' (a light purple).

Also, add the word "Subroutines" after include cluster labels.

Do not terminate the digraph definition with a semi-colon [;] after the
ending brace to satisfy newer versions of dot(1) generating error "Warning:
<stdin>: syntax error in line 940 near ';'".

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

9 years agoPrepare fget_unlocked for reading fd table only once.
mjg [Wed, 23 Jul 2014 19:33:49 +0000 (19:33 +0000)]
Prepare fget_unlocked for reading fd table only once.

Some capsicum functions accept fdp + fd and lookup fde based on that.
Add variants which accept fde.

Reviewed by: pjd
MFC after: 1 week

9 years ago- Use Rs/Re mdoc macros.
pluknet [Wed, 23 Jul 2014 18:54:18 +0000 (18:54 +0000)]
- Use Rs/Re mdoc macros.
- Remove duplicate and/or redundant content.

9 years agoFix builds on older FreeBSD versions and/or non-FreeBSD machines:
marcel [Wed, 23 Jul 2014 18:05:39 +0000 (18:05 +0000)]
Fix builds on older FreeBSD versions and/or non-FreeBSD machines:
don't use _Static_assert unconditionally.

9 years agoCosmetic changes to unp_internalize
mjg [Wed, 23 Jul 2014 18:04:52 +0000 (18:04 +0000)]
Cosmetic changes to unp_internalize

Don't throw away the result of fget_unlocked.
Move fdp increment to for loop to make it consistent with similar code
elsewhere.

MFC after: 1 week

9 years agoSimplify comment to remove multiple negative and passive voice.
imp [Wed, 23 Jul 2014 16:18:54 +0000 (16:18 +0000)]
Simplify comment to remove multiple negative and passive voice.

9 years agoFix typo in comment: noone -> no one.
imp [Wed, 23 Jul 2014 16:18:51 +0000 (16:18 +0000)]
Fix typo in comment: noone -> no one.
Fix minor style(9) nits.

9 years agodon't set CR4 PSE bit on amd64
royger [Wed, 23 Jul 2014 15:53:29 +0000 (15:53 +0000)]
don't set CR4 PSE bit on amd64

Setting PSE together with PAE or in long mode just makes the PSE bit
completely ignored, so don't set it.

Sponsored by: Citrix Systems R&D
Reviewed by: kib

9 years agoFix mismatch.
pfg [Wed, 23 Jul 2014 15:12:17 +0000 (15:12 +0000)]
Fix mismatch.

MFC after: 3 days

9 years agofparseln(3): Update from NetBSD sources.
pfg [Wed, 23 Jul 2014 14:57:15 +0000 (14:57 +0000)]
fparseln(3): Update from NetBSD sources.

-fix a condition so that fparseln() doesn't report spurious empty lines
 eg after 2 comment lines, or on EOF after a single comment line
-no escape character means no escaped characters

modify the previous fix so that no pointless realloc()s are done in
the case of multiple empty continuation lines, and comment the code
to make the logics obvious

fparseln is now part of libc in NetBSD so this changes the previous
revision numbering.

Obtained from: NetBSD (CVS Rev. 1.6-1.7)
MFC after: 2 weeks

9 years agoFix the igb(4) redirection table to correctly populate.
adrian [Wed, 23 Jul 2014 05:40:28 +0000 (05:40 +0000)]
Fix the igb(4) redirection table to correctly populate.

This is similar to the ixgbe(4) fix.

Tested:

* Intel I350 gigabit adapter

9 years agoEmulate instructions emitted by OpenBSD/i386 version 5.5:
neel [Wed, 23 Jul 2014 04:28:51 +0000 (04:28 +0000)]
Emulate instructions emitted by OpenBSD/i386 version 5.5:
- CMP REG, r/m
- MOV AX/EAX/RAX, moffset
- MOV moffset, AX/EAX/RAX
- PUSH r/m

9 years agoAvoid possible cast degradation.
pfg [Tue, 22 Jul 2014 23:29:54 +0000 (23:29 +0000)]
Avoid possible cast degradation.

For consistency with r268985 for fputs.c, assign iov_len
first, avoiding the cast to uio_resid (int in stdio)
from degrading the value.

We currently don't support lengths higher than INT_MAX so
this change is little more than cosmetic.

MFC after: 3 days

9 years agoAdd example script `add_some_packages.sh', demonstrating how to install
dteske [Tue, 22 Jul 2014 23:10:12 +0000 (23:10 +0000)]
Add example script `add_some_packages.sh', demonstrating how to install
a list of packages using the bsdconfig(8) API, providing dialog(8) based
user experience (versus plain console output were you to use pkg(8)
directly to install the same list of packages).

Remove example script `browse_packages_ftp.sh', made obsolete because
the digests.txz and packagesite.txz databases for pkg(8) are not
available via FTP (HTTP only to pkg.freebsd.org SRV hosts).

Update example script `browse_packages_http.sh', made to work with new
pkg(8) demonstrating how to generate a local package repository.

Fix a bug in `bsdconfig packages' where packages were listed twice. This
fix requires pkg(8) version 1.2.7_4 or higher.

NB: It is the introduction of pkg(8) 1.2.7_4 wherein I am also able to
drastically reduce the generation time of package dependencies prior to
the dialog display (by utilizing the new `-I' flag to pkg-rquery(8)).

While here, fix a positional argument nit for f_index_initialize() of
`packages/index.subr' include (the one and only argument is positional
argument 1 to state the by-ref handle, indicating the variable to set
in the caller's namespace; the nit I'm fixing here is that we were
querying positional argument 2 for this information incorrectly; caused
by a missing hunk back around SVN r257795).

Fix a bug in sysrc(8) described by PR bin/187458 "sysrc(8) silently and
unexpectedly bootstraps pkg". This was caused by an explicit entry in
`/usr/share/bsdconfig/common.subr' (used by sysrc(8)) that called pkg(8)
to populate the $PKG_ABI global (called in a way that allows implicit
bootstrap of pkg(8)). The solution to which was to find every place in
bsdconfig(8) that requires the $PKG_ABI global and add a layer of
protection by way of introducing the new API call f_musthavepkg_init()
(provided by new include, `/usr/share/bsdconfig/packages/musthavepkg.subr'
intented to mirror `/usr/share/bsdconfig/mustberoot.subr'). When the
$PKG_ABI global is required, you can use `f_musthavepkg_init' to cause
graceful premature termination in the event that pkg(8) has not yet been
bootstrapped, and thus cannot be used to populate $PKG_ABI.

NB: If running interactively ($nonInteractive is NULL or unset), the
f_musthavepkg_init() API call will attempt to bootstrap pkg(8), but only
if the user chooses "Yes" to a Yes/No dialog confirming it is ok to
bootstrap.

While here, simplify an if-conditional in `media/http.subr' include to
use sh(1) inline assignment-with-break.

Also, fix a bug in `media/http.subr' and `media/httpproxy.subr' wherein
the error messages for various HTTP failures were not finding their way
to the console (needed to pass stdout to pass-thru descriptor).

While here, remove the executable bit from `packages/categories.subr',
`packages/index.subr', and `packages/packages.subr' includes.

Fix issues where pkg(8) complains about PACKAGESITE being defined.
Previously, we would set $PACKAGESITE and export it. Now we only set
$PACKAGESITE for invocations of "pkg update" -- getting rid of all the
spurious warnings about PACKAGESITE being deprecated (it's still used
in the case of "pkg update" for simplicity versus having to configure
a config-file).

Remove the leading argument from invocations of f_index_initialize() in
`packages/packages.subr' include. The leading argument no longer means
what it used to, pre SVN r257995).

PR: bin/187458
Reviewed by: nwhitehorn
MFC after: 1 week
X-MFC-to: stable/10, stable/9

9 years ago/usr/bin/sendbug and the sendbug(1) man page were part of send-pr and
gavin [Tue, 22 Jul 2014 22:57:26 +0000 (22:57 +0000)]
/usr/bin/sendbug and the sendbug(1) man page were part of send-pr and
are no longer installed since r267486.  Add them to ObsoleteFiles.inc1,
which should have been done in r267486.

PR: 192010
Submitted by: Vick Khera
Pointyhat to: gavin
MFC after: 3 days

9 years agoFor "a"-mode files and rewind/fseek + fwrite combination return meaningful
ache [Tue, 22 Jul 2014 22:49:37 +0000 (22:49 +0000)]
For "a"-mode files and rewind/fseek + fwrite combination return meaningful
value now, like Apple does, but avoid their __sflush physical write
performance degradation as much as possible.

9 years agoRe-sort synopsis, add includes.
pluknet [Tue, 22 Jul 2014 22:39:59 +0000 (22:39 +0000)]
Re-sort synopsis, add includes.

9 years agos/PCBGROUPS/PCBGROUP/ manpage to match "options PCBGROUP".
pluknet [Tue, 22 Jul 2014 22:16:23 +0000 (22:16 +0000)]
s/PCBGROUPS/PCBGROUP/ manpage to match "options PCBGROUP".

9 years agoAdd FreeBSD to the list of environments that needs to handle R_ARM_TARGET2
ian [Tue, 22 Jul 2014 20:49:58 +0000 (20:49 +0000)]
Add FreeBSD to the list of environments that needs to handle R_ARM_TARGET2
relocations in unwind data as pc-relative indirect references.

MFC after: 1 week

9 years agoFix EABI unwind function declarations to match the function definitions.
ian [Tue, 22 Jul 2014 20:32:24 +0000 (20:32 +0000)]
Fix EABI unwind function declarations to match the function definitions.
The mismatch was noticed by clang, when using it to compile the in-tree
gcc and libstdc++.

9 years agoBack the whole change out until I figure out how to obtain O_APPEND,
ache [Tue, 22 Jul 2014 20:13:46 +0000 (20:13 +0000)]
Back the whole change out until I figure out how to obtain O_APPEND,
it can't be used in this field at all.

9 years agoChecking for __SAPP alone is not enough because it is emulated O_APPEND
ache [Tue, 22 Jul 2014 19:55:25 +0000 (19:55 +0000)]
Checking for __SAPP alone is not enough because it is emulated O_APPEND
only, so works for only special fdopen() case. Add real O_APPEND too.

9 years agoCleanup the definition of two structures which are
tuexen [Tue, 22 Jul 2014 19:54:22 +0000 (19:54 +0000)]
Cleanup the definition of two structures which are
exposed to userland. Therefore no MFC.

9 years agoAdd missing newline to an error message.
np [Tue, 22 Jul 2014 19:48:21 +0000 (19:48 +0000)]
Add missing newline to an error message.

MFC after: 3 days

9 years agoGrammar and spelling fixes.
pluknet [Tue, 22 Jul 2014 19:37:38 +0000 (19:37 +0000)]
Grammar and spelling fixes.

9 years agoRevert r268984:
pfg [Tue, 22 Jul 2014 18:37:59 +0000 (18:37 +0000)]
Revert r268984:
Check for __SAPP flag before calling sflush.   This avoids
performance degradation compared to the previous approach.

Submitted by: ache
MFC after: 2 weeks

9 years agoIn r264504, we prevented doing I/O for more than MAXPHYS by making
marcel [Tue, 22 Jul 2014 17:30:05 +0000 (17:30 +0000)]
In r264504, we prevented doing I/O for more than MAXPHYS by making
the assumption that consumers would respect bio_completed and/or
bio_resid to detect short reads. This assumption proved false and
file corruption was the result.
Create as many bios as we need to satisfy the original request.
Check the cached chunk every time we need to do I/O to increase the
hit rate.

Obtained from: junipre Networks, Inc.
MFC after: 1 week

9 years agoMostly cosmetic cleanups.
pfg [Tue, 22 Jul 2014 16:39:11 +0000 (16:39 +0000)]
Mostly cosmetic cleanups.

In fputs() avoid implcit casting on iov.iov_len.

MFC after: 3 days

9 years agoftello: return 1 when seeking offset on an append stream.
pfg [Tue, 22 Jul 2014 16:19:01 +0000 (16:19 +0000)]
ftello: return 1 when seeking offset on an append stream.

Obtained from: Apple Inc. (Libc 997.90.3)
Phabric: D442
MFC after: 2 weeks

9 years agorewind: always clear error indicator.
pfg [Tue, 22 Jul 2014 16:10:56 +0000 (16:10 +0000)]
rewind: always clear error indicator.

Required by POSIX:
http://pubs.opengroup.org/onlinepubs/009695399/functions/rewind.html

Obtained from: Apple Inc. (Libc 997.90.3)
MFC after: 1 week

9 years agoDon't pass null kmdp to preload_search_info
emaste [Tue, 22 Jul 2014 13:58:33 +0000 (13:58 +0000)]
Don't pass null kmdp to preload_search_info

On Xen PVH guests kmdp == NULL.

Submitted by: royger
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoRemove #ifdef-s to reduce difference to upstream.
ray [Tue, 22 Jul 2014 08:52:49 +0000 (08:52 +0000)]
Remove #ifdef-s to reduce difference to upstream.

Pointed by: kib

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 years agoCorrect typo introduced with r268855.
delphij [Tue, 22 Jul 2014 08:37:01 +0000 (08:37 +0000)]
Correct typo introduced with r268855.

MFC after: 10 days
X-MFC with: r268855

9 years agoDon't save entropy inside jails.
delphij [Tue, 22 Jul 2014 06:40:27 +0000 (06:40 +0000)]
Don't save entropy inside jails.

As of r126744, we no longer feed the entropy device in jails upon
start, and collecting them is no longer useful.

PR: conf/126744
Submitted by: Eugene Grosbein <eugen grosbein net> (with minor changes)
MFC after: 1 week
Approved by: so (des)

9 years agocopyin/copyout should return 0 if they are truly emulating copyin/copyout behavior.
sbruno [Tue, 22 Jul 2014 04:47:19 +0000 (04:47 +0000)]
copyin/copyout should return 0 if they are truly emulating copyin/copyout behavior.

remove stray %s in printf

rewrite printf to display 64bit type without warning.

9 years agoEnable Freescale i.MX I2C driver for i.MX6.
br [Tue, 22 Jul 2014 04:39:32 +0000 (04:39 +0000)]
Enable Freescale i.MX I2C driver for i.MX6.

9 years agoRemove boot1.efi during clean target.
sbruno [Tue, 22 Jul 2014 04:38:28 +0000 (04:38 +0000)]
Remove boot1.efi during clean target.

9 years agoSupress clang warning for FreeBSD printf %b and %D formats
sbruno [Tue, 22 Jul 2014 04:37:47 +0000 (04:37 +0000)]
Supress clang warning for FreeBSD printf %b and %D formats

MFC after: 2 weeks

9 years agoRename i.MX I2C driver file.
br [Tue, 22 Jul 2014 03:59:14 +0000 (03:59 +0000)]
Rename i.MX I2C driver file.

9 years agoSimplify r267600, there's no need to distinguish between allocated and
np [Tue, 22 Jul 2014 02:02:39 +0000 (02:02 +0000)]
Simplify r267600, there's no need to distinguish between allocated and
inlined mbufs.

MFC after: 1 week

9 years agobsd.lib.mk does not add OBJS etc to CLEANFILES so does not automatically
sjg [Tue, 22 Jul 2014 00:42:55 +0000 (00:42 +0000)]
bsd.lib.mk does not add OBJS etc to CLEANFILES so does not automatically
get them flagged as .NOPATH.  This hurts people who don't use obj dirs.
Since its clean target seprate rm's for things, use NOPATH_FILES as list
to collect things that need .NOPATH.

bsd.obj.mk will add CLEANFILES to NOPATH_FILES and do the deed if needed.

Reviewed by: sbruno

9 years agoMerge serf-1.3.6
peter [Mon, 21 Jul 2014 22:10:29 +0000 (22:10 +0000)]
Merge serf-1.3.6
+  Revert r2319 from serf 1.3.5: this change was making serf call handle_response
+    multiple times in case of an error response, leading to unexpected behavior.