]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoWhen growing the file descriptor table, new larger memory chunk is
kib [Wed, 9 Oct 2013 18:41:35 +0000 (18:41 +0000)]
When growing the file descriptor table, new larger memory chunk is
allocated, but the old table is kept around to handle the case of
threads still performing unlocked accesses to it.

Grow the table exponentially instead of increasing its size by
sizeof(long) * 8 chunks when overflowing. This mode significantly
reduces the total memory use for the processes consuming large numbers
of the file descriptors which open them one by one.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (marius)

10 years agoReduce code duplication, introduce the getmaxfd() helper to calculate
kib [Wed, 9 Oct 2013 18:39:44 +0000 (18:39 +0000)]
Reduce code duplication, introduce the getmaxfd() helper to calculate
the max filedescriptor index.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (marius)

10 years agoRemove no longer useful debugging output and a stale comment.
trasz [Wed, 9 Oct 2013 17:34:45 +0000 (17:34 +0000)]
Remove no longer useful debugging output and a stale comment.

Approved by: re (gjb)
Sponsored by: FreeBSD Foundation

10 years agoUpdate the Intel igb driver to version 2.4.0
jfv [Wed, 9 Oct 2013 17:32:52 +0000 (17:32 +0000)]
Update the Intel igb driver to version 2.4.0
  - This version has support for the new Intel Avoton systems,
including 2.5Gb support, further it now has IPv6/TSO6 support as
well. Shared code has been updated where necessary as well. Thanks
to my new assistant Eric Joyner for doing the transmit path changes
to bring in the IPv6/TSO6 support. Thanks to Gleb for catching the
one bug and change needed in NETMAP.

Approved by: re

10 years agoInitialize a variable in sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c, to
dim [Wed, 9 Oct 2013 17:07:50 +0000 (17:07 +0000)]
Initialize a variable in sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c, to
silence a gcc warning.

Approved by: re (gjb)
X-MFC-With: r255332

10 years agoRevert r256095, r256120 (partial), r256121:
gjb [Wed, 9 Oct 2013 17:07:20 +0000 (17:07 +0000)]
Revert r256095, r256120 (partial), r256121:

r256095:
 - Add gnu/usr.bin/rcs back to the base system.

r256120:
 - Add WITHOUT_RCS back to src.conf.5.

r256121:
 - Remove UPDATING entry regarding gnu/usr.bin/rcs removal.

Requested by: many
Approved by: re (marius)
Discussed with: core

10 years agoMake the error handling more consistant. Shouldn't make any functional
trasz [Wed, 9 Oct 2013 17:06:03 +0000 (17:06 +0000)]
Make the error handling more consistant.  Shouldn't make any functional
difference.

Approved by: re (gjb)
Sponsored by: FreeBSD Foundation

10 years agoRemove redundant redeclarations of uart_s3c2410_class in
dim [Wed, 9 Oct 2013 17:05:02 +0000 (17:05 +0000)]
Remove redundant redeclarations of uart_s3c2410_class in
sys/arm/s3c2xx0/uart_bus_s3c2410.c and uart_cpu_s3c2410.c, to silence
two gcc warnings.

Approved by: re (gjb)
X-MFC-With: r252394

10 years agoTidy up, cache return value of a function, and add an assertion;
trasz [Wed, 9 Oct 2013 16:55:52 +0000 (16:55 +0000)]
Tidy up, cache return value of a function, and add an assertion;
shouldn't make any functional difference.

Approved by: re (gjb)
Sponsored by: FreeBSD Foundation

10 years agoPlug memory leak.
trasz [Wed, 9 Oct 2013 13:48:08 +0000 (13:48 +0000)]
Plug memory leak.

Coverity CID: 1087991
Approved by: re (gjb)
Sponsored by: FreeBSD Foundation

10 years agoFix memory overrun.
trasz [Wed, 9 Oct 2013 13:45:07 +0000 (13:45 +0000)]
Fix memory overrun.

Coverity CID: 1092478
Approved by: re (gjb)
Sponsored by: FreeBSD Foundation

10 years agoPlug memory leaks.
trasz [Wed, 9 Oct 2013 13:28:45 +0000 (13:28 +0000)]
Plug memory leaks.

Coverity CID: 10879931087992
Approved by: re (marius)
Sponsored by: FreeBSD Foundation

10 years agoFix two off-by-ones.
trasz [Wed, 9 Oct 2013 12:30:52 +0000 (12:30 +0000)]
Fix two off-by-ones.

Coverity CID: 10879991011375
Approved by: re (glebius)
Sponsored by: FreeBSD Foundation

10 years agoFix incorrect use of sizeof().
trasz [Wed, 9 Oct 2013 12:19:48 +0000 (12:19 +0000)]
Fix incorrect use of sizeof().

Coverity CID: 1011303
Approved by: re (glebius)
Sponsored by: FreeBSD Foundation

10 years agoFix off-by-one.
trasz [Wed, 9 Oct 2013 12:17:40 +0000 (12:17 +0000)]
Fix off-by-one.

Coverity CID: 1011375
Approved by: re (glebius)
Sponsored by: FreeBSD Foundation

10 years agoClose the race on path ID allocation in xpt_bus_register() if two buses are
mav [Wed, 9 Oct 2013 12:09:01 +0000 (12:09 +0000)]
Close the race on path ID allocation in xpt_bus_register() if two buses are
registered simultaneously. Due to topology unlock between the ID allocation
and the bus registration there is a chance that two buses may get the
same IDs. That is supposed reason of lock assertion panic in CAM during
initial bus scanning after new iscsid initiates two sessions same time.

Reported by: trasz
Approved by: re (glebus, marius)
MFC after: 2 weeks

10 years agoFix NOP-In/NOP-Out payload handling. Previous way didn't work at all; fortunately
trasz [Wed, 9 Oct 2013 12:03:04 +0000 (12:03 +0000)]
Fix NOP-In/NOP-Out payload handling.  Previous way didn't work at all; fortunately
nothing seems to actually use this feature, but it's required by standard.

Approved by: re (glebius)
Sponsored by: FreeBSD Foundation

10 years agoWhen processing ACK in tcp_do_segment, use sbcut_locked() instead of
glebius [Wed, 9 Oct 2013 12:00:38 +0000 (12:00 +0000)]
When processing ACK in tcp_do_segment, use sbcut_locked() instead of
sbdrop_locked() to cut acked mbufs from the socket buffer. Free this
chain a batch manner after the socket buffer lock is dropped.

This measurably reduces contention on socket buffer.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.
Approved by: re (marius)

10 years ago- Substitute sbdrop_internal() with sbcut_internal(). The latter doesn't free
glebius [Wed, 9 Oct 2013 11:57:53 +0000 (11:57 +0000)]
- Substitute sbdrop_internal() with sbcut_internal(). The latter doesn't free
  mbufs, but return chain of free mbufs to a caller. Caller can either reuse
  them or return to allocator in a batch manner.
- Implement sbdrop()/sbdrop_locked() as a wrapper around sbcut_internal().
- Expose sbcut_locked() for outside usage.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.
Approved by: re (marius)

10 years agoIntroduce centralized [X]dialog(1) exit codes to `dialog.subr' and make-use
dteske [Wed, 9 Oct 2013 08:12:26 +0000 (08:12 +0000)]
Introduce centralized [X]dialog(1) exit codes to `dialog.subr' and make-use
throughout the bsdconfig(8) code. While we're here, add an explicit argument
to lvalue-seeking invocations of "return" that previously had no argument.
Also, consolidate a single instance of double-newline and remove some
comments that are no longer required (given increased readability with new
exit codes).

Approved by: re (glebius)

10 years agoRemove redundant declaration of cmclass in
dim [Wed, 9 Oct 2013 07:02:03 +0000 (07:02 +0000)]
Remove redundant declaration of cmclass in
sys/ofed/drivers/infiniband/core/ucm.c, to silence a gcc warning.

Approved by: re (kib)
X-MFC-With: r255932

10 years agoParse the memory size parameter using expand_number() to allow specifying
neel [Wed, 9 Oct 2013 03:56:07 +0000 (03:56 +0000)]
Parse the memory size parameter using expand_number() to allow specifying
the memory size more intuitively (e.g. 512M, 4G etc).

Submitted by: rodrigc
Reviewed by: grehan
Approved by: re (blanket)

10 years agoAdd some missing AR934x register definitions.
adrian [Wed, 9 Oct 2013 03:19:05 +0000 (03:19 +0000)]
Add some missing AR934x register definitions.

These are needed for ethernet bootstrap.

Approved by: re@ (gjb)

10 years agoFix interrupt handling from the APB periperals (ie, UART) - it
adrian [Wed, 9 Oct 2013 02:01:20 +0000 (02:01 +0000)]
Fix interrupt handling from the APB periperals (ie, UART) - it
also requires an explicit acknowledgement.

Tested:

* AR9344 (DB120) SoC

Approved by: re@ (gjb)

10 years agoMark AR934x based boards to be mips74k.
adrian [Wed, 9 Oct 2013 00:27:33 +0000 (00:27 +0000)]
Mark AR934x based boards to be mips74k.

Reviewed by: imp@
Approved by: re@ (gjb)

10 years agoAdd "better" MIPS24k and MIPS74k barriers.
adrian [Wed, 9 Oct 2013 00:27:12 +0000 (00:27 +0000)]
Add "better" MIPS24k and MIPS74k barriers.

* the mips74k cores only need EHB (which is 'sll $0, $0, 3')
  here; NOPs don't actually work.

* add EHB as the last NOP for the default barriers/hazards;
  that is "better" behaviour and should work on a wider
  variety of processors.

This allows the existing (icky) TLB code to work, allowing
the AR9344 SoC (mips74k) to actually get through kernel startup.

Tested:

* AR9344 SoC - (mips74k)
* AR9331 SoC - (mips24k)

TODO:

* test on mips4k CPUs, just to be sure.

* document that sll $0, $0, 3 is actually "EHB" and that it
  falls back to being a NOP for pre-mips32r1.

* mips24k has an errata that we currently don't correctly explicitly
  state - ie, that after DERET/ERET, the only valid instruction is
  a NOP.

Reviewed by: imp@
Approved by: re@ (gjb)

10 years agoShuffle the includes around so they occur after opt_global.h is included;
adrian [Wed, 9 Oct 2013 00:22:21 +0000 (00:22 +0000)]
Shuffle the includes around so they occur after opt_global.h is included;
this way the CPU ABI / core #define items are there.

Reviewed by: imp@
Approved by: re@ (gjb)

10 years agoAdd two new MIPS CPU families - mips24k and mips74k.
adrian [Wed, 9 Oct 2013 00:21:21 +0000 (00:21 +0000)]
Add two new MIPS CPU families - mips24k and mips74k.

They're both different cores:

* mips24k is an 8-stage pipeline, mips32r1 ABI, non-superscalar core.
* mips74k is a dual-issue 15-stage superscalar design, mips32r2 ABI.

They have different sets of quirks and bugs; these #define entries
will be used to work around these.

Now, strictly speaking, we should have CPU ABI families (mips32r1, mips32r2,
etc) and CPU core types (mips4k, mips24k, mips74k, etc.)  But this is the
starting point of that particular tidy-up.

Reviewed by: imp@
Approved by: re@ (gjb)

10 years agoFix the LINT build.
jimharris [Tue, 8 Oct 2013 23:23:04 +0000 (23:23 +0000)]
Fix the LINT build.

Approved by: re (implicit)
MFC after: 1 week

10 years agoRemove mention of [fixed] known issue not-specific to updating.
dteske [Tue, 8 Oct 2013 20:39:38 +0000 (20:39 +0000)]
Remove mention of [fixed] known issue not-specific to updating.
Vendor update to [c]dialog-1.2-20130925 has fixed known problems.
Vendor update SVN revisions: 255917-255917, 255852, and 255958.

Reviewed by: gjb
Approved by: re (gjb)

10 years agoIn sys/amd64/amd64/pmap.c, fix several gcc warnings about uninitialized
dim [Tue, 8 Oct 2013 20:04:35 +0000 (20:04 +0000)]
In sys/amd64/amd64/pmap.c, fix several gcc warnings about uninitialized
variables in reclaim_pv_chunk().

Approved by: re (marius)
Reviewed by: neel, kib
X-MFC-With: r256072

10 years agoIn usr.sbin/bhyve/pci_ahci.c, fix several gcc warnings of the form
dim [Tue, 8 Oct 2013 19:39:21 +0000 (19:39 +0000)]
In usr.sbin/bhyve/pci_ahci.c, fix several gcc warnings of the form
"assignment makes pointer from integer without a cast", by changing the
cmd_lst and rbis members of struct ahci_port from integers to pointers.

Also surround a pow-of-2 test expression with parentheses to clarify it,
and avoid another gcc warning.

Approved by: re (glebius)
Reviewed by: grehan, mav

10 years agoProperly fix out of memory handling in the iSCSI target.
trasz [Tue, 8 Oct 2013 19:18:02 +0000 (19:18 +0000)]
Properly fix out of memory handling in the iSCSI target.

Approved by: re (glebius)
Sponsored by: FreeBSD Foundation

10 years agoAfter r256062, the static function fbsdrun_get_next_cpu() in
dim [Tue, 8 Oct 2013 18:09:00 +0000 (18:09 +0000)]
After r256062, the static function fbsdrun_get_next_cpu() in
usr.sbin/bhyve/bhyverun.c is no longer used, so remove it to silence a
gcc warning.

Approved by: re (glebius)

10 years agoNow our binutils's assembler supports the Intel Random Number Generator
dim [Tue, 8 Oct 2013 17:26:28 +0000 (17:26 +0000)]
Now our binutils's assembler supports the Intel Random Number Generator
extensions, we can change the .byte directives in sys/dev/random/ivy.c
to plain 'rdrand' mnemonics.  This already worked for clang users, but
now it will also work for gcc users.

Approved by: re (kib)
Approved by: so (des)
MFC after: 1 week

10 years agoChange the behavior of bhyve such that the gdb listening port is opt-in
neel [Tue, 8 Oct 2013 16:36:17 +0000 (16:36 +0000)]
Change the behavior of bhyve such that the gdb listening port is opt-in
rather than opt-out.

Prior to this change if the "-g" option was not specified then a listening
socket for tunneling gdb packets would be opened at port 6466. If a second
virtual machine is fired up, also without the "-g" option, then that would
fail because there is already a listener on port 6466.

After this change if a gdb tunnel port needs to be created it needs to be
explicitly specified with a "-g <portnum>" command line option.

Reviewed by: grehan@
Approved by: re@ (blanket)

10 years agoDo not leak resources during attach if nvme_ctrlr_construct() or the initial
jimharris [Tue, 8 Oct 2013 16:01:43 +0000 (16:01 +0000)]
Do not leak resources during attach if nvme_ctrlr_construct() or the initial
controller resets fail.

Sponsored by: Intel
Reviewed by: carl
Approved by: re (hrs)
MFC after: 1 week

10 years agoLog and then disable asynchronous notification of persistent events after
jimharris [Tue, 8 Oct 2013 16:00:12 +0000 (16:00 +0000)]
Log and then disable asynchronous notification of persistent events after
they occur.

This prevents repeated notifications of the same event.

Status of these events may be viewed at any time by viewing the
SMART/Health Info Page using nvmecontrol, whether or not asynchronous
events notifications for those events are enabled.  This log page can
be viewed using:

    nvmecontrol logpage -p 2 <ctrlr id>

Future enhancements may re-enable these notifications on a periodic basis
so that if the notified condition persists, it will continue to be logged.

Sponsored by: Intel
Reviewed by: carl
Approved by: re (hrs)
MFC after: 1 week

10 years agoDo not enable temperature threshold as an asynchronous event notification
jimharris [Tue, 8 Oct 2013 15:49:14 +0000 (15:49 +0000)]
Do not enable temperature threshold as an asynchronous event notification
on NVMe controllers that do not support it.

Sponsored by: Intel
Reviewed by: carl
Approved by: re (hrs)
MFC after: 1 week

10 years agoExtend some 32-bit fields and variables to 64-bit to prevent overflow
jimharris [Tue, 8 Oct 2013 15:47:22 +0000 (15:47 +0000)]
Extend some 32-bit fields and variables to 64-bit to prevent overflow
when calculating stats in nvmecontrol perftest.

Sponsored by: Intel
Reported by: Joe Golio <joseph.golio@emc.com>
Reviewed by: carl
Approved by: re (hrs)
MFC after: 1 week

10 years agoAdd driver-assisted striping for upcoming Intel NVMe controllers that can
jimharris [Tue, 8 Oct 2013 15:44:04 +0000 (15:44 +0000)]
Add driver-assisted striping for upcoming Intel NVMe controllers that can
benefit from it.

Sponsored by: Intel
Reviewed by: kib (earlier version), carl
Approved by: re (hrs)
MFC after: 1 week

10 years agoInitialize and free the DTrace taskqueue in the dtrace module load/unload
markj [Tue, 8 Oct 2013 12:56:46 +0000 (12:56 +0000)]
Initialize and free the DTrace taskqueue in the dtrace module load/unload
handlers rather than in the dtrace device open/close methods. The current
approach can cause a panic if the device is closed which the taskqueue
thread is active, or if a kernel module containing a provider is unloaded
while retained enablings are present and the dtrace device isn't opened.

Submitted by: gibbs (original version)
Reviewed by: gibbs
Approved by: re (glebius)
MFC after: 2 weeks

10 years agoAdd channel survey support to the AR5212 HAL.
adrian [Tue, 8 Oct 2013 11:28:59 +0000 (11:28 +0000)]
Add channel survey support to the AR5212 HAL.

The AR5212 series of MACs implement the same channel counters as the
later 11n chips - except, of course, the 11n specific counter (extension
channel busy.)

This allows users of these NICs to use 'athsurvey' to see how busy their
current channel is.

Tested:

* AR5212, AR2413 NICs, STA mode

Approved by: re@ (gleb)

10 years ago When destination parameter is missing, exit with a clear synopsis,
glebius [Tue, 8 Oct 2013 08:16:17 +0000 (08:16 +0000)]
  When destination parameter is missing, exit with a clear synopsis,
instead of writing to kernel and printing EINVAL description.

PR: bin/181532
Submitted by: Kurt Jaeger <fbsd-pr opsec.eu>
Approved by: re (hrs)

10 years agoFix an inverted check for the master user in "camcontrol security -U".
markj [Tue, 8 Oct 2013 04:16:22 +0000 (04:16 +0000)]
Fix an inverted check for the master user in "camcontrol security -U".

PR: bin/182703
Submitted by: Scott Burns <scott@bqinternet.com>
Approved by: re (gjb)
MFC after: 3 days

10 years agoImprove lzjb decompress performance by reorganizing the code
delphij [Tue, 8 Oct 2013 01:38:24 +0000 (01:38 +0000)]
Improve lzjb decompress performance by reorganizing the code
to tighten the copy loop.

Submitted by: Denis Ahrens <denis h3q com>
MFC after: 2 weeks
Approved by: re (gjb)

10 years agoFix kernel build on amd64 after r256118, since the machine/md_var.h
dim [Mon, 7 Oct 2013 22:30:03 +0000 (22:30 +0000)]
Fix kernel build on amd64 after r256118, since the machine/md_var.h
header is not implicitly included there.  So include it explicitly.

Approved by: re (delphij)
Pointy hat to: dim
MFC after: 3 days
X-MFC-With: r256118

10 years agodon't assert on bad args, instead return an error..
jmg [Mon, 7 Oct 2013 22:22:57 +0000 (22:22 +0000)]
don't assert on bad args, instead return an error..

Since so many programs don't check return value, always NUL terminate
the buf...

fix rounding when using base 1024 (the bug that started it all)...

add a set of test cases so we can make sure that things don't break
in the future...

Thanks to Clifton Royston for testing and the test program...

Approved by: re (hrs, glebius)
MFC after: 1 week

10 years agoReduce priority of host key exists message in sshd startup
delphij [Mon, 7 Oct 2013 21:39:42 +0000 (21:39 +0000)]
Reduce priority of host key exists message in sshd startup
script to info.

Approved by: re (gjb)

10 years agoMake isci(4) loadable.
kib [Mon, 7 Oct 2013 20:48:24 +0000 (20:48 +0000)]
Make isci(4) loadable.

Reviewed by: jimharris
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (gjb)

10 years agoAdd manpages for VOP_ADVISE() and VOP_ALLOCATE().
jhb [Mon, 7 Oct 2013 20:30:05 +0000 (20:30 +0000)]
Add manpages for VOP_ADVISE() and VOP_ALLOCATE().

Approved by: re (gjb)

10 years agoRemove a stale comment.
jhb [Mon, 7 Oct 2013 20:29:31 +0000 (20:29 +0000)]
Remove a stale comment.

Approved by: re (gjb)

10 years agoAdd the latest NetBSD and FreeBSD releases.
eadler [Mon, 7 Oct 2013 19:27:54 +0000 (19:27 +0000)]
Add the latest NetBSD and FreeBSD releases.

Approved by: re (glebius)

10 years agoAdd an UPDATING entry for the RCS removal.
eadler [Mon, 7 Oct 2013 19:23:43 +0000 (19:23 +0000)]
Add an UPDATING entry for the RCS removal.

Requested by: kargl
Approved by: re (glebius)

10 years agoThis regenerates src.conf.5 for both the RCS removal as well as r255784.
eadler [Mon, 7 Oct 2013 19:22:53 +0000 (19:22 +0000)]
This regenerates src.conf.5 for both the RCS removal as well as r255784.

Approved by: re (glebius)

10 years agoRemove redundant declarations of szsigcode and sigcode in
dim [Mon, 7 Oct 2013 16:57:48 +0000 (16:57 +0000)]
Remove redundant declarations of szsigcode and sigcode in
sys/i386/ibcs2/ibcs2_sysvec.c, to silence two gcc warnings.

Approved by: re (gjb)
MFC after: 3 days

10 years agoRemove redundant declaration of cpu_clflush_line_size in
dim [Mon, 7 Oct 2013 16:56:56 +0000 (16:56 +0000)]
Remove redundant declaration of cpu_clflush_line_size in
sys/dev/cxgbe/t4_sge.c, to silence a gcc warning.

Approved by: re (gjb)
MFC after: 3 days

10 years agoInitialize a variable in sys/dev/xen/control/control.c, to silence a gcc
dim [Mon, 7 Oct 2013 16:55:34 +0000 (16:55 +0000)]
Initialize a variable in sys/dev/xen/control/control.c, to silence a gcc
warning.

Approved by: re (gjb)
MFC after:      3 days

10 years agoGive an unnamed union in sys/ofed/include/rdma/ib_verbs.h a name, to
dim [Mon, 7 Oct 2013 16:54:29 +0000 (16:54 +0000)]
Give an unnamed union in sys/ofed/include/rdma/ib_verbs.h a name, to
silence a gcc warning.

Approved by: re (gjb)
MFC after:      3 days

10 years agoRemove redundant declaration of force_evtchn_callback() in the
dim [Mon, 7 Oct 2013 16:53:26 +0000 (16:53 +0000)]
Remove redundant declaration of force_evtchn_callback() in the
i386-specific xen-os.h, to silence a gcc warning.

Approved by: re (gjb)
MFC after: 3 days

10 years agoadd missing sections, de-Xr non-existent page, properly space
jmg [Mon, 7 Oct 2013 16:49:53 +0000 (16:49 +0000)]
add missing sections, de-Xr non-existent page, properly space
punctuation..

Approved by: re (joel)
MFC after: 3 days

10 years agoFix resource leaks
emaste [Mon, 7 Oct 2013 16:45:16 +0000 (16:45 +0000)]
Fix resource leaks

Found by: Coverity Scan, CID 10166731007118
Approved by: re

10 years agoAdd support for assembling and disassembling Intel Random Number
dim [Mon, 7 Oct 2013 16:33:16 +0000 (16:33 +0000)]
Add support for assembling and disassembling Intel Random Number
Generator extensions (e.g. the 'rdrand' mnemonic) to our copy of
binutils.

Approved by: re (kib)
Obtained from: OpenBSD, via pfg
MFC after: 1 week

10 years agoFix implicit declaration of jail_getid()
rmh [Mon, 7 Oct 2013 14:22:19 +0000 (14:22 +0000)]
Fix implicit declaration of jail_getid()

Approved by: re

10 years agoFix mbuf leak.
glebius [Mon, 7 Oct 2013 12:07:40 +0000 (12:07 +0000)]
Fix mbuf leak.

Submitted by: Loganaden Velvindron <logan elandsys.com>
Obtained from: NetBSD
Approved by: re (kib)

10 years agoWhen displaying a struct stat, if the -r option was not specified,
des [Mon, 7 Oct 2013 11:23:01 +0000 (11:23 +0000)]
When displaying a struct stat, if the -r option was not specified,
display the numeric rather than symbolic representation of st_mode.

Approved by: re (glebius)
MFC after: 1 week

10 years agoIntroduce the /libexec/freebsd-version script, which is intended to be
des [Mon, 7 Oct 2013 10:26:38 +0000 (10:26 +0000)]
Introduce the /libexec/freebsd-version script, which is intended to be
used by auditing tools to determine the userland patch level when it
differs from what `uname -r` reports.  This can happen when the system
is kept up-to-date using freebsd-update and the last SA did not touch
the kernel, or when a new kernel has been installed but the system has
not yet rebooted.

Approved by: re (glebius)

10 years agoAdd a va_copy() to our fall-back stdarg implementation for use with lint(1)
phk [Mon, 7 Oct 2013 10:01:23 +0000 (10:01 +0000)]
Add a va_copy() to our fall-back stdarg implementation for use with lint(1)

Approved by: re@ (glebius@)

10 years agoImplement support for the interpose dso flag.
kib [Mon, 7 Oct 2013 08:19:30 +0000 (08:19 +0000)]
Implement support for the interpose dso flag.

Requested by: bf
Reviewed by: kan
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (glebius)

10 years agoAdd the definition of DF_1_INTERPOSE flag.
kib [Mon, 7 Oct 2013 08:14:58 +0000 (08:14 +0000)]
Add the definition of DF_1_INTERPOSE flag.

Reviewed by: kan
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (glebius)

10 years agoAdd _atf and unbound and move smmsp and mailnull to where they belong.
des [Mon, 7 Oct 2013 07:32:16 +0000 (07:32 +0000)]
Add _atf and unbound and move smmsp and mailnull to where they belong.

Approved by: re (kib)

10 years agoWith r253139, firmware for urtwn(4) is in base system. Correct the man page to
hiren [Mon, 7 Oct 2013 06:50:00 +0000 (06:50 +0000)]
With r253139, firmware for urtwn(4) is in base system. Correct the man page to
reflect that.

Approved by: re (blackend)

10 years agoGood bye RCS. You will be missed.
eadler [Mon, 7 Oct 2013 02:23:00 +0000 (02:23 +0000)]
Good bye RCS.  You will be missed.

(devel/rcs and devel/rcs57 are available as alternatives)

Approved by: core
Approved by: re (hrs)

10 years agoUpdate head/ to 10.0-ALPHA5.
gjb [Sun, 6 Oct 2013 19:47:06 +0000 (19:47 +0000)]
Update head/ to 10.0-ALPHA5.

Approved by: re (implicit)

10 years agoPull in r192064 from upstream llvm trunk:
dim [Sun, 6 Oct 2013 16:12:45 +0000 (16:12 +0000)]
Pull in r192064 from upstream llvm trunk:

  X86: Don't fold spills into SSE operations if the stack is unaligned.

  Regalloc can emit unaligned spills nowadays, but we can't fold the
  spills into SSE ops if we can't guarantee alignment. PR12250.

This fixes unaligned SSE accesses (leading to a SIGBUS) which could
occur in the ffmpeg ports.

Approved by: re (kib)
Reported by: tijl
MFC after: 3 days

10 years agoDocument LK_TRYUPGRADE.
kib [Sun, 6 Oct 2013 15:59:06 +0000 (15:59 +0000)]
Document LK_TRYUPGRADE.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Approved by: re (marius)

10 years agoename internal function test() to avoid name clashes with
decke [Sun, 6 Oct 2013 10:12:11 +0000 (10:12 +0000)]
ename internal function test() to avoid name clashes with
common macros. This fixes ports like mysql 5.6 which has an
internal macro called test.

Approved by: re (gjb)
Discussed with: theraven

10 years agoRemove the uipc_cow.c file, which is not used since the zero copy
kib [Sun, 6 Oct 2013 06:57:28 +0000 (06:57 +0000)]
Remove the uipc_cow.c file, which is not used since the zero copy
sockets removal.

Noted by: alc
Sponsored by: The FreeBSD Foundation
Approved by: re (delphij)

10 years agoFormalize the concept of virtual CPU ids by adding a per-cpu vcpu_id
gibbs [Sat, 5 Oct 2013 23:11:01 +0000 (23:11 +0000)]
Formalize the concept of virtual CPU ids by adding a per-cpu vcpu_id
field.  Perform vcpu enumeration for Xen PV and HVM environments
and convert all Xen drivers to use vcpu_id instead of a hard coded
assumption of the mapping algorithm (acpi or apic ID) in use.

Submitted by: Roger Pau MonnĂ©
Sponsored by: Citrix Systems R&D
Reviewed by: gibbs
Approved by: re (blanket Xen)

amd64/include/pcpu.h:
i386/include/pcpu.h:
Add vcpu_id to the amd64 and i386 pcpu structures.

dev/xen/timer/timer.c
x86/xen/xen_intr.c
Use new vcpu_id instead of assuming acpi_id == vcpu_id.

i386/xen/mp_machdep.c:
i386/xen/mptable.c
x86/xen/hvm.c:
Perform Xen HVM and Xen full PV vcpu_id mapping.

x86/xen/hvm.c:
x86/acpica/madt.c
Change SYSINIT ordering of acpi CPU enumeration so that it
is guaranteed to be available at the time of Xen HVM vcpu
id mapping.

10 years agoMerge projects/bhyve_npt_pmap into head.
neel [Sat, 5 Oct 2013 21:22:35 +0000 (21:22 +0000)]
Merge projects/bhyve_npt_pmap into head.

Make the amd64/pmap code aware of nested page table mappings used by bhyve
guests. This allows bhyve to associate each guest with its own vmspace and
deal with nested page faults in the context of that vmspace. This also
enables features like accessed/dirty bit tracking, swapping to disk and
transparent superpage promotions of guest memory.

Guest vmspace:
Each bhyve guest has a unique vmspace to represent the physical memory
allocated to the guest. Each memory segment allocated by the guest is
mapped into the guest's address space via the 'vmspace->vm_map' and is
backed by an object of type OBJT_DEFAULT.

pmap types:
The amd64/pmap now understands two types of pmaps: PT_X86 and PT_EPT.

The PT_X86 pmap type is used by the vmspace associated with the host kernel
as well as user processes executing on the host. The PT_EPT pmap is used by
the vmspace associated with a bhyve guest.

Page Table Entries:
The EPT page table entries as mostly similar in functionality to regular
page table entries although there are some differences in terms of what
bits are used to express that functionality. For e.g. the dirty bit is
represented by bit 9 in the nested PTE as opposed to bit 6 in the regular
x86 PTE. Therefore the bitmask representing the dirty bit is now computed
at runtime based on the type of the pmap. Thus PG_M that was previously a
macro now becomes a local variable that is initialized at runtime using
'pmap_modified_bit(pmap)'.

An additional wrinkle associated with EPT mappings is that older Intel
processors don't have hardware support for tracking accessed/dirty bits in
the PTE. This means that the amd64/pmap code needs to emulate these bits to
provide proper accounting to the VM subsystem. This is achieved by using
the following mapping for EPT entries that need emulation of A/D bits:
               Bit Position           Interpreted By
PG_V               52                 software (accessed bit emulation handler)
PG_RW              53                 software (dirty bit emulation handler)
PG_A               0                  hardware (aka EPT_PG_RD)
PG_M               1                  hardware (aka EPT_PG_WR)

The idea to use the mapping listed above for A/D bit emulation came from
Alan Cox (alc@).

The final difference with respect to x86 PTEs is that some EPT implementations
do not support superpage mappings. This is recorded in the 'pm_flags' field
of the pmap.

TLB invalidation:
The amd64/pmap code has a number of ways to do invalidation of mappings
that may be cached in the TLB: single page, multiple pages in a range or the
entire TLB. All of these funnel into a single EPT invalidation routine called
'pmap_invalidate_ept()'. This routine bumps up the EPT generation number and
sends an IPI to the host cpus that are executing the guest's vcpus. On a
subsequent entry into the guest it will detect that the EPT has changed and
invalidate the mappings from the TLB.

Guest memory access:
Since the guest memory is no longer wired we need to hold the host physical
page that backs the guest physical page before we can access it. The helper
functions 'vm_gpa_hold()/vm_gpa_release()' are available for this purpose.

PCI passthru:
Guest's with PCI passthru devices will wire the entire guest physical address
space. The MMIO BAR associated with the passthru device is backed by a
vm_object of type OBJT_SG. An IOMMU domain is created only for guest's that
have one or more PCI passthru devices attached to them.

Limitations:
There isn't a way to map a guest physical page without execute permissions.
This is because the amd64/pmap code interprets the guest physical mappings as
user mappings since they are numerically below VM_MAXUSER_ADDRESS. Since PG_U
shares the same bit position as EPT_PG_EXECUTE all guest mappings become
automatically executable.

Thanks to Alan Cox and Konstantin Belousov for their rigorous code reviews
as well as their support and encouragement.

Thanks for John Baldwin for reviewing the use of OBJT_SG as the backing
object for pci passthru mmio regions.

Special thanks to Peter Holm for testing the patch on short notice.

Approved by: re
Discussed with: grehan
Reviewed by: alc, kib
Tested by: pho

10 years agoCorrect panic caused by attaching both Xen PV and HyperV virtualization
gibbs [Sat, 5 Oct 2013 19:51:09 +0000 (19:51 +0000)]
Correct panic caused by attaching both Xen PV and HyperV virtualization
aware drivers on Xen hypervisors that advertise support for some
HyperV features.

x86/xen/hvm.c:
When running in HVM mode on a Xen hypervisor, set vm_guest
to VM_GUEST_XEN so other virtualization aware components in
the FreeBSD kernel can detect this mode is active.

dev/hyperv/vmbus/hv_hv.c:
Use vm_guest to ignore Xen's HyperV emulation when Xen is
detected and Xen PV drivers are active.

Reported by: Shanker Balan
Submitted by: Roger Pau MonnĂ©
Sponsored by: Citrix Systems R&D
Reviewed by: gibbs
Approved by: re (Xen blanket)

10 years agoExpose system level ixgbe sysctls.
hiren [Sat, 5 Oct 2013 19:17:56 +0000 (19:17 +0000)]
Expose system level ixgbe sysctls.
Device level sysctls are already exposed as dev.ix.<device>

Fixing the case where number of queues for igb is auto-tuned and
hw.igb.num_queues does not return current/updated value.

Reviewed by: jfv
Approved by: re (delphij)
MFC after: 2 weeks

10 years agoTidy up kmeminit(): Since r245575, 'nmbclusters' is calculated after
alc [Sat, 5 Oct 2013 18:53:03 +0000 (18:53 +0000)]
Tidy up kmeminit(): Since r245575, 'nmbclusters' is calculated after
kmeminit() runs, so it contributes nothing to 'vm_kmem_size'; update a
comment to reflect that r254025 replaced the kmem submap with the kmem
arena.

Reviewed by: kib
Approved by: re (gjb)
Sponsored by: EMC / Isilon Storage Division

10 years agoDo not hold the vtnet Rx queue lock when calling up into the stack
bryanv [Sat, 5 Oct 2013 18:07:24 +0000 (18:07 +0000)]
Do not hold the vtnet Rx queue lock when calling up into the stack

This matches other similar drivers and avoids various LOR warnings.

Approved by: re (marius)

10 years agoSplit cfiscsi_datamove() in two; no functional changes.
trasz [Sat, 5 Oct 2013 16:22:33 +0000 (16:22 +0000)]
Split cfiscsi_datamove() in two; no functional changes.

Approved by: re (glebius)
Sponsored by: FreeBSD Foundation

10 years agoRemove obsolete cmd-line options and code associated with
grehan [Fri, 4 Oct 2013 23:29:07 +0000 (23:29 +0000)]
Remove obsolete cmd-line options and code associated with
these.
 The mux-vcpus option may return at some point, given it's utility
in finding bhyve (and FreeBSD) bugs.

Approved by: re@ (blanket)
Discussed with: neel@

10 years agoAdd padding to match the compat32 struct stat32 definition to the real
kib [Fri, 4 Oct 2013 22:05:23 +0000 (22:05 +0000)]
Add padding to match the compat32 struct stat32 definition to the real
struct stat on 32bit architectures.

Debugged and tested by: bsam
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Approved by: re (marius)

10 years agokldxref: Do not depend on the directory order.
jilles [Fri, 4 Oct 2013 21:25:55 +0000 (21:25 +0000)]
kldxref: Do not depend on the directory order.

Sort the filenames to get a consistent result between machines of the same
architecture.

Also, sort FTS_D entries after other entries so kldxref -R works properly in
the uncommon case that a directory contains both subdirectories and modules.
Previously, this may have happened to work, depending on the order of files
in the directory.

PR: bin/182098
Submitted by: Derek Schrock (original version)
Tested by: Derek Schrock
Approved by: re (delphij)
MFC after: 1 week

10 years agoDon't leak memory when removing an unconnected session, and remove useless
trasz [Fri, 4 Oct 2013 19:31:41 +0000 (19:31 +0000)]
Don't leak memory when removing an unconnected session, and remove useless
UMA_ZONE_NOFREE that caused another leak when unloading the module.

Approved by: re (glebius)
Sponsored by: FreeBSD Foundation

10 years agoHook up the AHCI and blockif code to the build.
grehan [Fri, 4 Oct 2013 18:44:47 +0000 (18:44 +0000)]
Hook up the AHCI and blockif code to the build.

Approved by: re@ (blanket)

10 years agoImport Zhixiang Yu's GSoC'13 AHCI emulation:
grehan [Fri, 4 Oct 2013 18:31:38 +0000 (18:31 +0000)]
Import Zhixiang Yu's GSoC'13 AHCI emulation:
   https://wiki.freebsd.org/SummerOfCode2013/bhyveAHCI

This provides ICH8 SATA disk and ATAPI ports, selectable
via the bhyve slot command-line parameter:

SATA
  -s <slot>,ahci-hd,<image-file>

ATAPI
  -s <slot>,ahci-cd,<image-file>

Slight modifications by: grehan@
Approved by: re@ (blanket)
Obtained from: FreeBSD GSoC'13

10 years agoDisable use of compiler atomic builtins. For APR, this is limited to
nwhitehorn [Fri, 4 Oct 2013 18:27:02 +0000 (18:27 +0000)]
Disable use of compiler atomic builtins. For APR, this is limited to
architectures where they are known not to work. For SVN itself, use
the least common denominator and disable them across the board. This
allows svnlite to build and run on all FreeBSD architectures.

Approved by: re (gjb)

10 years agoadd aesni module to i386 and amd64 NOTES...
jmg [Fri, 4 Oct 2013 17:21:01 +0000 (17:21 +0000)]
add aesni module to i386 and amd64 NOTES...

Approved by: re (gjb)

10 years agoBlock-layer backend interface for bhyve block-io device emulations.
grehan [Fri, 4 Oct 2013 16:52:03 +0000 (16:52 +0000)]
Block-layer backend interface for bhyve block-io device emulations.

Approved by: re@ (blanket)

10 years agomdoc: remove EOL whitespace.
joel [Fri, 4 Oct 2013 16:44:24 +0000 (16:44 +0000)]
mdoc: remove EOL whitespace.

Approved by: re (blanket)

10 years agoRemove useless check - ki_loginclass is an array; can't be NULL.
trasz [Fri, 4 Oct 2013 16:08:44 +0000 (16:08 +0000)]
Remove useless check - ki_loginclass is an array; can't be NULL.

CID: 1006559
Approved by: re (kib)
MFC after: 2 weeks
Sponsored by: FreeBSD Foundation

10 years agoFix make depend.
uqs [Fri, 4 Oct 2013 11:55:20 +0000 (11:55 +0000)]
Fix make depend.

Approved by: re (glebius)

10 years agoFixes for the Netlogic XLP on-chip RSA block driver
jchandra [Fri, 4 Oct 2013 11:11:51 +0000 (11:11 +0000)]
Fixes for the Netlogic XLP on-chip RSA block driver

The changes are to:
* Use contigmalloc/contigfree which handling microcode buffer
* Use a different buffer to send microcode to each engine
* Swap microcode in little-endian compilation
* Fix freeback message queue id field
* Simplify xlp_get_rsa_opsize() to remove unnecessary checks
* Fix NULL check after use in xlp_free_cmd_params()
* Do better error handling when the hardware returns error
* Fix error codes in few cases

Submitted by: Vekatesh J. V. <venkatesh.vivekanandan@broadcom.com>
Approved by: re (hrs)

10 years agoStyle fixes for the Netlogic XLP RSA driver
jchandra [Fri, 4 Oct 2013 10:01:20 +0000 (10:01 +0000)]
Style fixes for the Netlogic XLP RSA driver

Updates to the Netlogic XLP on-chp RSA block driver. The changes are
to follow style(9) guidelines, to improve readability and to remove
unnecessary initialization.

No changes to logic have been introduced by this commit.

Submitted by: Venkatesh J. V. <venkatesh.vivekanandan@broadcom.com>
Approved by: re (hrs)

10 years agoDo not attempt to do AF-specific configurations on a interface when
hrs [Fri, 4 Oct 2013 04:15:18 +0000 (04:15 +0000)]
Do not attempt to do AF-specific configurations on a interface when
noafif() is true.  The following warning message was displayed when
pflog0 interface existed, for example:

 ifconfig: ioctl(SIOCGIFINFO_IN6): Protocol family not supported

Reported by: bz
Approved by: re (gjb)