freebsd.git
8 years agoDocument x86 machine-specific ptrace(2) requests. Provide list of the
kib [Tue, 30 Jun 2015 18:53:42 +0000 (18:53 +0000)]
Document x86 machine-specific ptrace(2) requests.  Provide list of the
ppc requests.

Reviewed by: brueffer, emaste, gjb (previous version)
Sponsored by: The FreeBSD Foundation
Review: https://reviews.freebsd.org/D2962
MFC after: 2 weeks

8 years agoAdd missing DTrace scripts that exist in the source tree to the Makefile for
hiren [Tue, 30 Jun 2015 18:23:08 +0000 (18:23 +0000)]
Add missing DTrace scripts that exist in the source tree to the Makefile for
install.
While here, sort the list.

Differential Revision: D2950
Submitted by: Jason Wolfe <j at nitrology.com>
Reviewed by: gnn, markj, hiren
Sponsored by: Limelight Networks

8 years agoFix leak in tcp_lro_rx. Simply clearing M_PKTHDR isn't enough, any tags
np [Tue, 30 Jun 2015 17:19:58 +0000 (17:19 +0000)]
Fix leak in tcp_lro_rx.  Simply clearing M_PKTHDR isn't enough, any tags
hanging off the header need to be freed too.

Differential Revision: https://reviews.freebsd.org/D2708
Reviewed by: ae@, hiren@

8 years agoUpdated random(4) boot/shutdown scripting.
markm [Tue, 30 Jun 2015 17:09:41 +0000 (17:09 +0000)]
Updated random(4) boot/shutdown scripting.
Fix the man pages as well.

Differential Revision: https://reviews.freebsd.org/D2924
Approved by: so (delphij)

8 years agoHuge cleanup of random(4) code.
markm [Tue, 30 Jun 2015 17:00:45 +0000 (17:00 +0000)]
Huge cleanup of random(4) code.

* GENERAL
- Update copyright.
- Make kernel options for RANDOM_YARROW and RANDOM_DUMMY. Set
  neither to ON, which means we want Fortuna
- If there is no 'device random' in the kernel, there will be NO
  random(4) device in the kernel, and the KERN_ARND sysctl will
  return nothing. With RANDOM_DUMMY there will be a random(4) that
  always blocks.
- Repair kern.arandom (KERN_ARND sysctl). The old version went
  through arc4random(9) and was a bit weird.
- Adjust arc4random stirring a bit - the existing code looks a little
  suspect.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Redo read_random(9) so as to duplicate random(4)'s read internals.
  This makes it a first-class citizen rather than a hack.
- Move stuff out of locked regions when it does not need to be
  there.
- Trim RANDOM_DEBUG printfs. Some are excess to requirement, some
  behind boot verbose.
- Use SYSINIT to sequence the startup.
- Fix init/deinit sysctl stuff.
- Make relevant sysctls also tunables.
- Add different harvesting "styles" to allow for different requirements
  (direct, queue, fast).
- Add harvesting of FFS atime events. This needs to be checked for
  weighing down the FS code.
- Add harvesting of slab allocator events. This needs to be checked for
  weighing down the allocator code.
- Fix the random(9) manpage.
- Loadable modules are not present for now. These will be re-engineered
  when the dust settles.
- Use macros for locks.
- Fix comments.

* src/share/man/...
- Update the man pages.

* src/etc/...
- The startup/shutdown work is done in D2924.

* src/UPDATING
- Add UPDATING announcement.

* src/sys/dev/random/build.sh
- Add copyright.
- Add libz for unit tests.

* src/sys/dev/random/dummy.c
- Remove; no longer needed. Functionality incorporated into randomdev.*.

* live_entropy_sources.c live_entropy_sources.h
- Remove; content moved.
- move content to randomdev.[ch] and optimise.

* src/sys/dev/random/random_adaptors.c src/sys/dev/random/random_adaptors.h
- Remove; plugability is no longer used. Compile-time algorithm
  selection is the way to go.

* src/sys/dev/random/random_harvestq.c src/sys/dev/random/random_harvestq.h
- Add early (re)boot-time randomness caching.

* src/sys/dev/random/randomdev_soft.c src/sys/dev/random/randomdev_soft.h
- Remove; no longer needed.

* src/sys/dev/random/uint128.h
- Provide a fake uint128_t; if a real one ever arrived, we can use
  that instead. All that is needed here is N=0, N++, N==0, and some
  localised trickery is used to manufacture a 128-bit 0ULLL.

* src/sys/dev/random/unit_test.c src/sys/dev/random/unit_test.h
- Improve unit tests; previously the testing human needed clairvoyance;
  now the test will do a basic check of compressibility. Clairvoyant
  talent is still a good idea.
- This is still a long way off a proper unit test.

* src/sys/dev/random/fortuna.c src/sys/dev/random/fortuna.h
- Improve messy union to just uint128_t.
- Remove unneeded 'static struct fortuna_start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])

* src/sys/dev/random/yarrow.c src/sys/dev/random/yarrow.h
- Improve messy union to just uint128_t.
- Remove unneeded 'staic struct start_cache'.
- Tighten up up arithmetic.
- Provide a method to allow eternal junk to be introduced; harden
  it against blatant by compress/hashing.
- Assert that locks are held correctly.
- Fix the nasty pre- and post-read overloading by providing explictit
  functions to do these tasks.
- Turn into self-sufficient module (no longer requires randomdev_soft.[ch])
- Fix some magic numbers elsewhere used as FAST and SLOW.

Differential Revision: https://reviews.freebsd.org/D2025
Reviewed by: vsevolod,delphij,rwatson,trasz,jmg
Approved by: so (delphij)

8 years agoDo not calculate the stack's bottom address twice.
kib [Tue, 30 Jun 2015 15:22:47 +0000 (15:22 +0000)]
Do not calculate the stack's bottom address twice.

Submitted by: Olivц╘r Pintц╘r
Review: https://reviews.freebsd.org/D2953
MFC after: 1 week

8 years agoo DragonFly 4.2.0 added.
maxim [Tue, 30 Jun 2015 07:46:06 +0000 (07:46 +0000)]
o DragonFly 4.2.0 added.

8 years agoThe LDFLAGS isn't needed, and breaks the build on powerpc64.
jhibbits [Tue, 30 Jun 2015 06:02:42 +0000 (06:02 +0000)]
The LDFLAGS isn't needed, and breaks the build on powerpc64.

This hack is very fragile, and was broken on powerpc64 when metamode was
introduced.  Removing it survives a buildworld for all architectures, and
fixes the build on powerpc64.

8 years agoAdd Support for uploading Vagrant images to Hashicorp Atlas.
brd [Mon, 29 Jun 2015 21:26:41 +0000 (21:26 +0000)]
Add Support for uploading Vagrant images to Hashicorp Atlas.

Approved by: re (gjb)

8 years agoAvoid a situation where we do not set persist timer after a zero window
hiren [Mon, 29 Jun 2015 21:23:54 +0000 (21:23 +0000)]
Avoid a situation where we do not set persist timer after a zero window
condition.
If you send a 0-length packet, but there is data is the socket buffer, and
neither the rexmt or persist timer is already set, then activate the persist
timer.

PR: 192599
Differential Revision: D2946
Submitted by: jlott at averesystems dot com
Reviewed by: jhb, jch, gnn, hiren
Tested by: jlott at averesystems dot com, jch
MFC after: 2 weeks

8 years agoDelete the refernce to VLAN handling being disabled by default. This is
sbruno [Mon, 29 Jun 2015 17:59:00 +0000 (17:59 +0000)]
Delete the refernce to VLAN handling being disabled by default.  This is
no longer the case.

PR: 118693
MFC after: 3 days

8 years agoSet the initial system time to a sane (as in: not end of 21st century) value when
brueffer [Mon, 29 Jun 2015 17:02:09 +0000 (17:02 +0000)]
Set the initial system time to a sane (as in: not end of 21st century) value when
booting on a PC with CMOS clock set to a year before 2000.

This uses 1980 (instead of 1970 as in the initial patch) as pivot year as
suggested by imp in the PR followup.

PR: 195703
Submitted by: cs@soi.spb.ru
Reviewed by: imp
MFC after: 1 weeks

8 years agoAdd CouchDB ports (5984 TCP/UDP).
brueffer [Mon, 29 Jun 2015 15:38:34 +0000 (15:38 +0000)]
Add CouchDB ports (5984 TCP/UDP).

PR: 193268
Submitted by: yuri@rawbw.com
MFC after: 1 week

8 years agoFix issues that kept some of the examples from actually working.
brueffer [Mon, 29 Jun 2015 14:41:19 +0000 (14:41 +0000)]
Fix issues that kept some of the examples from actually working.

PR: 144534
Submitted by: Nicolas Edel
MFC after: 1 week

8 years agospeed up ar(1) on UFS file systems
emaste [Mon, 29 Jun 2015 13:48:44 +0000 (13:48 +0000)]
speed up ar(1) on UFS file systems

Fault in the buffer prior to writing to workaround poor performance due
to interaction with kernel fs deadlock avoidance code. See the comment
prior to vn_io_fault_doio() in sys/kern/vfs_vnops.c for details of the
issue.

On my stable/10 desktop with a 16MB obj.o and "ar r out.a obj.o" I see
the following run times (seconds):

x ar.r284891
+ ar.patched
+----------------------------------------------------------------------+
|+                                                                     |
|+                                                                    x|
|+                                                                   xx|
|A                                                                   |A|
+----------------------------------------------------------------------+
    N         Min          Max        Median           Avg        Stddev
x   3       1.307        1.321         1.315     1.3143333  0.0070237692
+   3       0.020        0.023         0.022   0.021666667  0.0015275252
Difference at 95.0% confidence
        -1.29267 +/- 0.0115203
        -98.3515% +/- 0.876513%
        (Student's t, pooled s = 0.00508265)

Thanks to kib for diagnosing and explaining the issue and suggesting
the workaround.

Reviewed by: eadler, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2933

8 years agoSimplify code, no need to test the flag before clearing it.
kib [Mon, 29 Jun 2015 13:06:24 +0000 (13:06 +0000)]
Simplify code, no need to test the flag before clearing it.

Submitted by: ed
MFC after: 12 days

8 years agoProvide npx_get_fsave(9) and npx_set_fsave(9) functions to obtain and
kib [Mon, 29 Jun 2015 12:06:36 +0000 (12:06 +0000)]
Provide npx_get_fsave(9) and npx_set_fsave(9) functions to obtain and
restore the FPU state from the format of machine FSAVE area.  The
intended use is for ABI emulators to provide FSAVE-formatted FPU state
to usermode requiring it, while kernel could use FXSAVE due to
XMM/XSAVE.

The core functionality to convert from/to FXSAVE format is shared with
the fill_fpregs_xmm() and set_fpregs_xmm().  Move the later functions
to npx.c and rename them to npx_fill_fpregs_xmm() and
npx_set_fpregs_xmm().  They differ from nptx_get/set_fsave(9) since
our mcontext contains padding to be zeroed or ignored.

fill_fpregs() and set_fpregs() could be converted to use the new
interface, but there are small differences to handle.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoMove CS_SECURE() and EFL_SECURE() macros to the machine/frame.h. They
kib [Mon, 29 Jun 2015 10:35:00 +0000 (10:35 +0000)]
Move CS_SECURE() and EFL_SECURE() macros to the machine/frame.h.  They
are useful for most implementations of sendsig().

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agosvr4 emulator has custom sendsig() implementation, it does not use
kib [Mon, 29 Jun 2015 10:33:04 +0000 (10:33 +0000)]
svr4 emulator has custom sendsig() implementation, it does not use
sv_sigtbl.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoRemove sv_sigtbl handling from the arm64 sendsig(). There is no ABI
kib [Mon, 29 Jun 2015 10:31:12 +0000 (10:31 +0000)]
Remove sv_sigtbl handling from the arm64 sendsig().  There is no ABI
emulators on arm64.

Reviewed by: andrew
Review: https://reviews.freebsd.org/D2889
Sponsored by: The FreeBSD Foundation

8 years agoAdd a comment about too strong semantic of atomic_load_acq() on x86.
kib [Mon, 29 Jun 2015 09:58:40 +0000 (09:58 +0000)]
Add a comment about too strong semantic of atomic_load_acq() on x86.

Submitted by: bde
MFC after: 2 weeks

8 years agopcb_gs32sd is unused for long time, remove it. Keep the padding in pcb.
kib [Mon, 29 Jun 2015 07:53:44 +0000 (07:53 +0000)]
pcb_gs32sd is unused for long time, remove it.  Keep the padding in pcb.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoSlight tidy up of comments before MFC
julian [Mon, 29 Jun 2015 07:43:09 +0000 (07:43 +0000)]
Slight tidy up of comments before MFC

MFC after: 2 days

8 years agoAdd x86 PT_GETFSBASE, PT_GETGSBASE machine-depended ptrace requests to
kib [Mon, 29 Jun 2015 07:07:24 +0000 (07:07 +0000)]
Add x86 PT_GETFSBASE, PT_GETGSBASE machine-depended ptrace requests to
obtain the thread %fs and %gs bases.  Add x86 PT_SETFSBASE and
PT_SETGSBASE requests to set the bases from debuggers.  The set
requests, similarly to the sysarch({I386,AMD64}_SET_FSBASE),
override the corresponding segment registers.

The main purpose of the operations is to retrieve and modify the tcb
address for debuggee.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoReduce code duplication. Add helper fill_based_sd(9) which creates a
kib [Mon, 29 Jun 2015 06:59:08 +0000 (06:59 +0000)]
Reduce code duplication.  Add helper fill_based_sd(9) which creates a
based user data descriptor covering whole VA.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoAdd a new __sentinel attribute.
pfg [Mon, 29 Jun 2015 00:30:30 +0000 (00:30 +0000)]
Add a new __sentinel attribute.

The sentinel attribute was originally implemented in OpenBSD's gcc and
later adopted by upstream GCC 4.0 (and clang). From the OpenBSD's
gcc-local manpage:

-   gcc recognizes the extra attribute __sentinel__, which can be used to
    mark varargs function that need a NULL pointer to mark argument
    termination, like execl(3).  This exposes latent bugs for 64-bit
    architectures, where a terminating 0 will expand to a 32-bit int, and
    not a full-fledged 64-bits pointer.

While here sort the visibility attributes.

Hinted-by: OpenBSD

8 years agomv: Improve message when moving two or more files to non-directory.
jilles [Sun, 28 Jun 2015 21:36:00 +0000 (21:36 +0000)]
mv: Improve message when moving two or more files to non-directory.

The message text is from cp, which has had a nicer message for this since
2007 (PR bin/50656).

As with cp, the exit status changes from 64 to 1.

PR: 201083
MFC after: 1 week

8 years agoMake the system queue header file fully usable within C++ programs by
hselasky [Sun, 28 Jun 2015 21:06:45 +0000 (21:06 +0000)]
Make the system queue header file fully usable within C++ programs by
adding macros to define class lists.

This change is backwards compatible for all use within C and C++
programs. Only C++ programs will have added support to use the queue
macros within classes. Previously the queue macros could only be used
within structures.

The queue.3 manual page has been updated to describe the new
functionality and some alphabetic sorting has been done while
at it.

Differential Revision: https://reviews.freebsd.org/D2745
PR: 200827 (exp-run)
MFC after: 2 weeks

8 years agoFix a couple of missing lines that obscured the -p description.
wblock [Sun, 28 Jun 2015 20:53:36 +0000 (20:53 +0000)]
Fix a couple of missing lines that obscured the -p description.

Submitted by: Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com>
MFC after: 1 week

8 years agodconschat(8): Use NULL instead of 0 for the last argument in execl(3)
pfg [Sun, 28 Jun 2015 20:32:03 +0000 (20:32 +0000)]
dconschat(8): Use NULL instead of 0 for the last argument in execl(3)

Found while experimenting with the gcc sentinel attribute.

MFC after: 3 days

8 years agoOnly initialize libedit when necessary
jmmv [Sun, 28 Jun 2015 16:43:07 +0000 (16:43 +0000)]
Only initialize libedit when necessary

The code path to support units conversions from the command line
need not initialize neither libedit nor the history.  Therefore, only do
that when in interactive mode.

This hides the issue reported in PR bin/201167 whereby running commands
of the form 'echo "$(units ft in)"' would corrupt the terminal.  The real
issue causing the corruption most likely still remains somewhere.

PR: bin/201167
Differential Revision: D2935
Reviewed by: eadler

8 years agoAdd const to char * pointers. This breaks nothing, and means const
markm [Sun, 28 Jun 2015 12:52:28 +0000 (12:52 +0000)]
Add const to char * pointers. This breaks nothing, and means const
chars can be passed with no warnings.

8 years agoAnsify another function. This is the last in the file, I hope.
markm [Sun, 28 Jun 2015 10:51:08 +0000 (10:51 +0000)]
Ansify another function. This is the last in the file, I hope.

8 years agoANSIfy the only function that uses K&R definition in this file.
markm [Sun, 28 Jun 2015 09:44:58 +0000 (09:44 +0000)]
ANSIfy the only function that uses K&R definition in this file.

8 years agoSteve KArgl's commit bit taken in at his own request
matthew [Sun, 28 Jun 2015 09:03:26 +0000 (09:03 +0000)]
Steve KArgl's commit bit taken in at his own request

With hat:     core-secretary
Approved by: core

8 years agoRemove unneeded data dependency, currently imposed by
kib [Sun, 28 Jun 2015 05:04:08 +0000 (05:04 +0000)]
Remove unneeded data dependency, currently imposed by
atomic_load_acq(9), on it source, for x86.

Right now, atomic_load_acq() on x86 is sequentially consistent with
other atomics, code ensures this by doing store/load barrier by
performing locked nop on the source.  Provide separate primitive
__storeload_barrier(), which is implemented as the locked nop done on
a cpu-private variable, and put __storeload_barrier() before load, to
keep seq_cst semantic but avoid introducing false dependency on the
no-modification of the source for its later use.

Note that seq_cst property of x86 atomic_load_acq() is not documented
and not carried by atomics implementations on other architectures,
although some kernel code relies on the behaviour.  This commit does
not intend to change this.

Reviewed by: alc
Discussed with: bde
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoMake all shared library a relative symlink
bapt [Sat, 27 Jun 2015 23:28:56 +0000 (23:28 +0000)]
Make all shared library a relative symlink

This makes sysroot usable for cross building, it also removes the need for
_SHLIBDIRPREFIX (keeps its definition since picobsd uses it and I have no time
to test it)

Differential Revision: https://reviews.freebsd.org/D2920
Submitted by: imp, adrian
Tested by: adrian

8 years agoInstead of hard-coding the PROVIDERS for upload, add the
gjb [Sat, 27 Jun 2015 23:03:28 +0000 (23:03 +0000)]
Instead of hard-coding the PROVIDERS for upload, add the
VAGRANT_PROVIDERS variable.  Right now, it defaults to only
vmware_desktop, virtualbox support is to follow at some point.

While here, fix the hashicorp URL: s/vagrant/atlas/, which
was result of a sed(1) replace (and my fault).

Sponsored by: The FreeBSD Foundation

8 years agoRemove _ACCOUNT and add _USERNAME, _NAME, _VERSION for the
gjb [Sat, 27 Jun 2015 22:59:29 +0000 (22:59 +0000)]
Remove _ACCOUNT and add _USERNAME, _NAME, _VERSION for the
VAGRANT_${VAR} variables extracted from VAGRANT_UPLOAD_CONF.

Set ATLAS_${VAR} to VAGRANT_${VAR} if VAGRANT_UPLOAD_CONF
is set.  There is intent to intentionally have separate
variants of configuration entries, but the defaults do not
yet have any reason to be different.

Sponsored by: The FreeBSD Foundation

8 years agoAdd default VAGRANT_IMG variable.
gjb [Sat, 27 Jun 2015 22:54:16 +0000 (22:54 +0000)]
Add default VAGRANT_IMG variable.

Sponsored by: The FreeBSD Foundation

8 years agoAdd initial support for building Vagrant images for VMWare. Next steps will be adding...
brd [Sat, 27 Jun 2015 20:39:13 +0000 (20:39 +0000)]
Add initial support for building Vagrant images for VMWare. Next steps will be adding Virtualbox support and uploading to Hashicorp Atlas for others to consume.

Approved by: re (gjb)

8 years agoFix issues detected by 'mandoc -Tlint bhyveload.8'
neel [Sat, 27 Jun 2015 18:24:23 +0000 (18:24 +0000)]
Fix issues detected by 'mandoc -Tlint bhyveload.8'

Pointed out by: wblock
Differential Revision: https://reviews.freebsd.org/D2762

8 years agoUse correct flag in iovctl_start().
pkelsey [Sat, 27 Jun 2015 18:01:50 +0000 (18:01 +0000)]
Use correct flag in iovctl_start().

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

8 years agoChange detection for the gnu_inline attribute.
pfg [Sat, 27 Jun 2015 15:13:14 +0000 (15:13 +0000)]
Change detection for the gnu_inline attribute.

According to the GCC documentation:
"This attribute is available in GCC 4.1.3 and later. It is available
if either of the preprocessor macros __GNUC_GNU_INLINE__ or
__GNUC_STDC_INLINE__ are defined."

We don't keep the gcc granularity up to the minor number so it's
better to use the documented way. Current clang defines both
macros.

Reference:
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes

8 years agoFix compilation without INET6 and without INET and INET6 after
bz [Sat, 27 Jun 2015 12:37:09 +0000 (12:37 +0000)]
Fix compilation without INET6 and without INET and INET6 after
offload support was introduced in r284746.

While here also fix the ioctl() handler for IPv4 added in r279819,
which was never compiled in given opt_inet.h was not included.

8 years agoHandle errors from background write of the cylinder group blocks.
kib [Sat, 27 Jun 2015 09:44:14 +0000 (09:44 +0000)]
Handle errors from background write of the cylinder group blocks.

First, on the write error, bufdone() call from ffs_backgroundwrite()
panics because pbrelvp() cleared bp->b_bufobj, while brelse() would
try to re-dirty the copy of the cg buffer.  Handle this by setting
B_INVAL for the case of BIO_ERROR.

Second, we must re-dirty the real buffer containing the cylinder group
block data when background write failed.  Real cg buffer was already
marked clean in ffs_bufwrite(). After the BV_BKGRDINPROG flag is
cleared on the real cg buffer in ffs_backgroundwrite(), buffer scan
may reuse the buffer at any moment. The result is lost write, and if
the write error was only transient, we get corrupted bitmaps.

We cannot re-dirty the original cg buffer in the
ffs_backgroundwritedone(), since the context is not sleepable,
preventing us from sleeping for origbp' lock.  Add BV_BKGDERR flag
(protected by the buffer object lock), which is converted into delayed
write by brelse(), bqrelse() and buffer scan.

In collaboration with: Conrad Meyer <cse.cem@gmail.com>
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation (kib),
  EMC/Isilon storage division (Conrad)
MFC after: 2 weeks

8 years agoMFi386: r278165
nyan [Sat, 27 Jun 2015 09:01:49 +0000 (09:01 +0000)]
MFi386: r278165

  Silence a coverity warning about ignoring a return value.

8 years agoMFi386: r284878
nyan [Sat, 27 Jun 2015 08:49:41 +0000 (08:49 +0000)]
MFi386: r284878

  Reduce warnings:

   - Add prototype for boot2 main()
   - Don't make assignment within if statement, split it into two.

8 years agoFix a vi-invoked typo.
gjb [Sat, 27 Jun 2015 05:18:08 +0000 (05:18 +0000)]
Fix a vi-invoked typo.

Submitted by: jkim (privately)
Sponsored by: The FreeBSD Foundation

8 years agoAdd the ntfs alias and support it with the MBR and GPT schemes
marcel [Sat, 27 Jun 2015 03:28:04 +0000 (03:28 +0000)]
Add the ntfs alias and support it with the MBR and GPT schemes
as DOSPTYP_NTFS and GPT_ENT_TYPE_MS_BASIC_DATA (resp).

8 years agoAdd initial support for automatically uploading GCE virtual
gjb [Sat, 27 Jun 2015 01:29:59 +0000 (01:29 +0000)]
Add initial support for automatically uploading GCE virtual
machine images to the Google Compute Engine platform.

By default, gcutil/gsutil requires an Oauth2 login generated
from a URL that must be opened in a browser, a verification
code copied back to the terminal from which it was invoked,
etc., etc., making it near impossible for automation.

I've hacked together an evil solution to work around this,
so unless GCE_LOGIN_SKIP is set to a non-empty value, this
Makefile will not do anything useful.

As a result of this commit, remove the gce-package.sh script
that was never, nor will ever be, used.

MFC after: 3 days
X-MFC-Note: (hopefully)
Sponsored by: The FreeBSD Foundation

8 years agoshort circuit install -l rs
bapt [Fri, 26 Jun 2015 23:55:02 +0000 (23:55 +0000)]
short circuit install -l rs

When requesting install(1) to only make relative symlinks, by pass all the
done to actually compute the relative symlink if the path given in argument is
already a relative path

8 years agoReduce warnings:
delphij [Fri, 26 Jun 2015 18:03:19 +0000 (18:03 +0000)]
Reduce warnings:

 - Add prototype for boot2 main()
 - Don't make assignment within if statement, split it into two.

No functional or binary change -- verified with sha256(1).

MFC after: 2 weeks

8 years agoverify_gla() needs to account for non-zero segment base addresses.
tychon [Fri, 26 Jun 2015 18:00:29 +0000 (18:00 +0000)]
verify_gla() needs to account for non-zero segment base addresses.

Reviewed by: neel

8 years agoPlug minor memory leak at r284765.
mav [Fri, 26 Jun 2015 16:14:00 +0000 (16:14 +0000)]
Plug minor memory leak at r284765.

Reported by: Coverity
CID: 1308401
MFC after: 3 days

8 years agoClarify the note about Thumb-2 kernel support.
gjb [Fri, 26 Jun 2015 13:33:46 +0000 (13:33 +0000)]
Clarify the note about Thumb-2 kernel support.

Submitted by: andrew
Sponsored by: The FreeBSD Foundation

8 years agoCounter part of mfi driver commit in mrsas
kadesai [Fri, 26 Jun 2015 12:00:51 +0000 (12:00 +0000)]
Counter part of mfi driver commit in mrsas

Switch from make_dev_alias to make_dev_alias_p since make_dev_alias_p can
gracefully fail if the /dev/megaraid_sas_ioctl_node symlink already exists.
This can happen if mfi(4) and mrsas(4) are both attached to cards and
providing Linux emulation support.  Let the first one win.  An equivalent
change has been done in mfi(4).  Extra credit would be to pass the
Linux emulation call to the other driver when appropriate.  This will
probably be a rare case and the user can manually change where the symlink
points to.

MFC after:  3 days

8 years agoKernel panic may be observed by user, if MR controller is under Chip reset (OCR)
kadesai [Fri, 26 Jun 2015 11:58:42 +0000 (11:58 +0000)]
Kernel panic may be observed by user, if MR controller is under Chip reset (OCR)
and there are some pending IOs at the time of OCR. This is mainly because of
recursive mutext in OCR and IO completion function call. Generic IO completion (from ISR) needs
sim_lock to be held before it calls completion to CAM (xpt_done), but in case of OCR path mrsas_ocr thread
itself take sim_lock, so this condition is now handled in this patch.

MFC after:  3 days

8 years agopc_curpmap is only in the armv6 pcpu data.
andrew [Fri, 26 Jun 2015 09:02:40 +0000 (09:02 +0000)]
pc_curpmap is only in the armv6 pcpu data.

8 years agoamd64: set the correct LMA values
royger [Fri, 26 Jun 2015 07:12:17 +0000 (07:12 +0000)]
amd64: set the correct LMA values

The current linker script generates program headers with VMA == LMA:

Entry point 0xffffffff802e7000
There are 6 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0xffffffff80200040 0xffffffff80200040
                 0x0000000000000150 0x0000000000000150  R E    8
  INTERP         0x0000000000000190 0xffffffff80200190 0xffffffff80200190
                 0x000000000000000d 0x000000000000000d  R      1
      [Requesting program interpreter: /red/herring]
  LOAD           0x0000000000000000 0xffffffff80200000 0xffffffff80200000
                 0x00000000010559b0 0x00000000010559b0  R E    200000
  LOAD           0x0000000001056000 0xffffffff81456000 0xffffffff81456000
                 0x0000000000132638 0x000000000052ecf8  RW     200000
  DYNAMIC        0x0000000001056000 0xffffffff81456000 0xffffffff81456000
                 0x00000000000000d0 0x00000000000000d0  RW     8
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RWE    8

This is fine for the FreeBSD loader, because it completely ignores p_paddr
and instead uses p_vaddr with a hardcoded offset. Other loaders however
acknowledge p_paddr (like the Xen ELF loader), in which case they will try
to load the kernel at the wrong place. Fix this by adding an AT keyword to
the first section specifying the physical address, other sections will
follow suit, so it ends up looking like:

Entry point 0xffffffff802e7000
There are 6 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0xffffffff80200040 0x0000000000200040
                 0x0000000000000150 0x0000000000000150  R E    8
  INTERP         0x0000000000000190 0xffffffff80200190 0x0000000000200190
                 0x000000000000000d 0x000000000000000d  R      1
      [Requesting program interpreter: /red/herring]
  LOAD           0x0000000000000000 0xffffffff80200000 0x0000000000200000
                 0x00000000010559b0 0x00000000010559b0  R E    200000
  LOAD           0x0000000001056000 0xffffffff81456000 0x0000000001456000
                 0x0000000000132638 0x000000000052ecf8  RW     200000
  DYNAMIC        0x0000000001056000 0xffffffff81456000 0x0000000001456000
                 0x00000000000000d0 0x00000000000000d0  RW     8
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RWE    8

Tested on bare metal using the native FreeBSD loader and grub2 from TRUEOS.

Sponsored by: Citrix Systems R&D
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D2783

8 years agoSplit the DMAR unit domains and contexts. Domains carry address space
kib [Fri, 26 Jun 2015 07:01:29 +0000 (07:01 +0000)]
Split the DMAR unit domains and contexts.  Domains carry address space
and related data structures.  Contexts attach requests initiators to
domains.  There is still 1:1 correspondence between contexts and
domains on the running system, since only busdma currently allocates
them, using dmar_get_ctx_for_dev().

Large part of the change is formal rename of the ctx to domain, but
patch also reworks the context allocation and free to allow for
independent domain creation.

The helper dmar_move_ctx_to_domain() is introduced for future use, to
reassign request initiator from one domain to another.  The hard issue
which is not yet resolved with the context move is proper handling (or
reserving) RMRR entries in the destination domain as required by ACPI
DMAR table for moved context.

Tested by: pho
Sponsored by: The FreeBSD Foundation

8 years agoUn-static cpuset_which() - it's useful in other contexts, such as some
adrian [Fri, 26 Jun 2015 04:14:05 +0000 (04:14 +0000)]
Un-static cpuset_which() - it's useful in other contexts, such as some
CPU set operations in my upcoming NUMA work.

Tested/compiled:

* i386 (run)
* amd64 (run)
* mips (run)
* mips64 (run)
* armv6 (built)

Sponsored by: Norse Corp, Inc.

8 years agoRename seq_* to mseq_*, to avoid clashes with seq.h (namely, seq_read.)
adrian [Fri, 26 Jun 2015 04:12:06 +0000 (04:12 +0000)]
Rename seq_* to mseq_*, to avoid clashes with seq.h (namely, seq_read.)

8 years agoAdd support for additional architectures in ntp.
cy [Fri, 26 Jun 2015 03:29:23 +0000 (03:29 +0000)]
Add support for additional architectures in ntp.

Differential Revision: D2720
Reviewed by: jmg, reoberto, andrew, ian, imp

8 years agoAnother attempt to make this compile on more architectures after r284777.
bz [Thu, 25 Jun 2015 23:16:01 +0000 (23:16 +0000)]
Another attempt to make this compile on more architectures after r284777.

8 years agoRevert r284860. I was looking at the wrong files.
gjb [Thu, 25 Jun 2015 20:46:11 +0000 (20:46 +0000)]
Revert r284860.  I was looking at the wrong files.
Sigh.

Sponsored by: The FreeBSD Foundation

8 years agoIf INVARIANTS is specified, add ctor/dtor to junk memory if they are
jmg [Thu, 25 Jun 2015 20:44:46 +0000 (20:44 +0000)]
If INVARIANTS is specified, add ctor/dtor to junk memory if they are
unspecified...

Submitted by: Suresh Gumpula at Netapp
Differential Revision: https://reviews.freebsd.org/D2725

8 years agoFix an incorrect revision number.
gjb [Thu, 25 Jun 2015 20:40:51 +0000 (20:40 +0000)]
Fix an incorrect revision number.

Sponsored by: The FreeBSD Foundation

8 years agoEnable the use of __builtin_va_* for ICC.
tijl [Thu, 25 Jun 2015 19:39:07 +0000 (19:39 +0000)]
Enable the use of __builtin_va_* for ICC.

PR: 198822
Submitted by: Sergey Melnikov <sergey.melnikov@intel.com>
MFC after: 5 days

8 years agoDocument r284237, file(1) updated to 5.23.
gjb [Thu, 25 Jun 2015 18:44:59 +0000 (18:44 +0000)]
Document r284237, file(1) updated to 5.23.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r283092, ACPICA updated to 20150515.
gjb [Thu, 25 Jun 2015 18:44:57 +0000 (18:44 +0000)]
Document r283092, ACPICA updated to 20150515.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r284329, OpenSSL update to 1.0.1o.
gjb [Thu, 25 Jun 2015 18:44:55 +0000 (18:44 +0000)]
Document r284329, OpenSSL update to 1.0.1o.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r258431, boot-time memory test on amd64 platforms is now
gjb [Thu, 25 Jun 2015 18:44:53 +0000 (18:44 +0000)]
Document r258431, boot-time memory test on amd64 platforms is now
disabled by default.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r279955, autofs(5) '-noauto' map addition.
gjb [Thu, 25 Jun 2015 18:44:50 +0000 (18:44 +0000)]
Document r279955, autofs(5) '-noauto' map addition.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r275681, autofs(5) '-media' map addition.
gjb [Thu, 25 Jun 2015 18:44:48 +0000 (18:44 +0000)]
Document r275681, autofs(5) '-media' map addition.

Sponsored by: The FreeBSD Foundation

8 years agoUpdate the svn revision marker.
gjb [Thu, 25 Jun 2015 18:44:46 +0000 (18:44 +0000)]
Update the svn revision marker.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r284746, TSO and checksum offloading support in hv_netvsc(4).
gjb [Thu, 25 Jun 2015 18:44:44 +0000 (18:44 +0000)]
Document r284746, TSO and checksum offloading support in hv_netvsc(4).

Sponsored by: The FreeBSD Foundation

8 years agoAdd missing '-' in Hyper-V.
gjb [Thu, 25 Jun 2015 18:44:42 +0000 (18:44 +0000)]
Add missing '-' in Hyper-V.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r284702, uart(4) update to support AMT on newer systems.
gjb [Thu, 25 Jun 2015 18:44:40 +0000 (18:44 +0000)]
Document r284702, uart(4) update to support AMT on newer systems.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r284589, fstyp(8) now recognizes ZFS and GELI filesystems.
gjb [Thu, 25 Jun 2015 18:44:38 +0000 (18:44 +0000)]
Document r284589, fstyp(8) now recognizes ZFS and GELI filesystems.

Sponsored by: The FreeBSD Foundation

8 years agoMove the crypt(3) entries from userland-programs to
gjb [Thu, 25 Jun 2015 18:44:36 +0000 (18:44 +0000)]
Move the crypt(3) entries from userland-programs to
userland-libraries.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r284483, Blowfish crypt(3) now supports $2y$ format.
gjb [Thu, 25 Jun 2015 18:44:34 +0000 (18:44 +0000)]
Document r284483, Blowfish crypt(3) now supports $2y$ format.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r284297, lockstat(1) improvements.
gjb [Thu, 25 Jun 2015 18:44:31 +0000 (18:44 +0000)]
Document r284297, lockstat(1) improvements.
Add ClusterHQ to sponsors.ent.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r284273, initial ACPI support for aarch64.
gjb [Thu, 25 Jun 2015 18:44:29 +0000 (18:44 +0000)]
Document r284273, initial ACPI support for aarch64.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r284254, bmake updated to 20150606.
gjb [Thu, 25 Jun 2015 18:44:27 +0000 (18:44 +0000)]
Document r284254, bmake updated to 20150606.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r283959, EM_MULTIQUEUE kernel configuration option.
gjb [Thu, 25 Jun 2015 18:44:25 +0000 (18:44 +0000)]
Document r283959, EM_MULTIQUEUE kernel configuration option.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r283766, improved hang detection in em(4).
gjb [Thu, 25 Jun 2015 18:44:22 +0000 (18:44 +0000)]
Document r283766, improved hang detection in em(4).

Sponsored by: The FreeBSD Foundation

8 years agoDocument r283766, ig4(4) addition.
gjb [Thu, 25 Jun 2015 18:44:20 +0000 (18:44 +0000)]
Document r283766, ig4(4) addition.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r283136, net.inet.tcp.hostcache.purgenow addition.
gjb [Thu, 25 Jun 2015 18:44:18 +0000 (18:44 +0000)]
Document r283136, net.inet.tcp.hostcache.purgenow addition.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r282988, alloc_align() added to malloc.h and stdlib.h.
gjb [Thu, 25 Jun 2015 18:44:16 +0000 (18:44 +0000)]
Document r282988, alloc_align() added to malloc.h and stdlib.h.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r282973, libgomp no longer built by default, unless building
gjb [Thu, 25 Jun 2015 18:44:14 +0000 (18:44 +0000)]
Document r282973, libgomp no longer built by default, unless building
the base system GCC.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r282901, RACCT/RCTL in GENERIC by default.
gjb [Thu, 25 Jun 2015 18:44:12 +0000 (18:44 +0000)]
Document r282901, RACCT/RCTL in GENERIC by default.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r282827, BeagleBone Black power button support added.
gjb [Thu, 25 Jun 2015 18:44:10 +0000 (18:44 +0000)]
Document r282827, BeagleBone Black power button support added.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r282783, freescale PCI Root Complex support added.
gjb [Thu, 25 Jun 2015 18:44:08 +0000 (18:44 +0000)]
Document r282783, freescale PCI Root Complex support added.

Sponsored by: The FreeBSD Foundation

8 years agoDocument r282779, Thumb-2 support for ARMv7 added.
gjb [Thu, 25 Jun 2015 18:44:06 +0000 (18:44 +0000)]
Document r282779, Thumb-2 support for ARMv7 added.

Sponsored by: The FreeBSD Foundation

8 years agoFix support for the null encryption algorithm which now requires
gnn [Thu, 25 Jun 2015 18:38:58 +0000 (18:38 +0000)]
Fix support for the null encryption algorithm which now requires
a key.

Sponsored by: Rubicon Communications (Netgate)

8 years agoSort the cpu architectures by name rather than a combination of
andrew [Thu, 25 Jun 2015 16:47:11 +0000 (16:47 +0000)]
Sort the cpu architectures by name rather than a combination of
alphabetical order and appending new architectures to the end of the list.

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

8 years agoCorrect r284777 to use proper includes and remove dead code to unbreak kernel builds.
eri [Thu, 25 Jun 2015 15:05:58 +0000 (15:05 +0000)]
Correct r284777 to use proper includes and remove dead code to unbreak kernel builds.

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

8 years agoChange the hour:minute delimiter from ':' to '-', since
gjb [Thu, 25 Jun 2015 14:24:06 +0000 (14:24 +0000)]
Change the hour:minute delimiter from ':' to '-', since
the former is an invalid character in EC2 images.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoConsider PRERELEASE builds snapshots, in addition to CURRENT and
gjb [Thu, 25 Jun 2015 13:40:00 +0000 (13:40 +0000)]
Consider PRERELEASE builds snapshots, in addition to CURRENT and
STABLE.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation