]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoCompile fixes:
hselasky [Sat, 28 Jun 2014 17:36:18 +0000 (17:36 +0000)]
Compile fixes:

Remove duplicate "debug_ktr.mask" sysctl definition.
Remove now unused variable from "kern_ktr.c".
This fixes build of "ktr" which was broken by r267961.

Let the default value for "vm_kmem_size_scale" be zero. It is setup
after that the sysctl has been initialized from "getenv()" in the
"kmeminit()" function to equal the "VM_KMEM_SIZE_MAX" value, if
zero. On Sparc64 the "VM_KMEM_SIZE_MAX" macro is not a constant. This
fixes build of Sparc64 which was broken by r267961.

Add a special macro to dynamically create SYSCTL root nodes, because
root nodes have a special parent. This fixes build of existing OFED
module and CANBUS module for pc98 which was broken by r267961.

Add missing "sysctl.h" includes to get the needed sysctl header file
declarations. This is needed after r267961.

MFC after: 2 weeks

10 years agoDon't accidently skip every second line when calculating the
dwmalone [Sat, 28 Jun 2014 15:53:28 +0000 (15:53 +0000)]
Don't accidently skip every second line when calculating the
idle time.

MFC after: 2 weeks

10 years agoFix breakage after r267981.
dim [Sat, 28 Jun 2014 09:53:44 +0000 (09:53 +0000)]
Fix breakage after r267981.

Pointy hat to: dim
MFC after: 3 days
X-MFC-With: r267981

10 years agoCall fdcloseexec right after fdunshare.
mjg [Sat, 28 Jun 2014 05:51:45 +0000 (05:51 +0000)]
Call fdcloseexec right after fdunshare.

No functional changes.

MFC after: 1 week

10 years agoMake fdunshare accept only td parameter.
mjg [Sat, 28 Jun 2014 05:41:53 +0000 (05:41 +0000)]
Make fdunshare accept only td parameter.

Proc had to match the thread anyway and 2 parameters were inconsistent
with the rest.

MFC after: 1 week

10 years agoMake sure to always clear p_fd for process getting rid of its filetable.
mjg [Sat, 28 Jun 2014 05:18:03 +0000 (05:18 +0000)]
Make sure to always clear p_fd for process getting rid of its filetable.

Filetable can be shared with other processes. Previous code failed to
clear the pointer for all but the last process getting rid of the table.
This is mostly cosmetics.

Get rid of 'This should happen earlier' comment. Clearing the pointer in
this place is fine as consumers can reliably check for files availability
by inspecting fd_refcnt and vnodes availabity by NULL-checking them.

MFC after: 1 week

10 years agoFix regression issue after r267961. Handle special string case for
hselasky [Sat, 28 Jun 2014 03:59:04 +0000 (03:59 +0000)]
Fix regression issue after r267961. Handle special string case for
SYSCTLs like previously.

MFC after: 2 weeks
Reported by: several people

10 years agoPull in r267961 and r267973 again. Fix for issues reported will follow.
hselasky [Sat, 28 Jun 2014 03:56:17 +0000 (03:56 +0000)]
Pull in r267961 and r267973 again. Fix for issues reported will follow.

10 years agoMinimal update for cvsup -> svn change.
gavin [Sat, 28 Jun 2014 00:01:18 +0000 (00:01 +0000)]
Minimal update for cvsup -> svn change.

10 years agoRedefine SUNW based on SYSDIR in an attempt to fix a build problem.
rpaulo [Fri, 27 Jun 2014 22:38:42 +0000 (22:38 +0000)]
Redefine SUNW based on SYSDIR in an attempt to fix a build problem.

MFC after: 2 weeks

10 years agoRemove odd practice of inverting error codes.
mav [Fri, 27 Jun 2014 22:28:14 +0000 (22:28 +0000)]
Remove odd practice of inverting error codes.

-EPERM is equal to ERESTART, returning which from ioctl() handler causes
infinite syscall restart.

MFC after: 2 weeks

10 years agoRevert r267961, r267973:
gjb [Fri, 27 Jun 2014 22:05:21 +0000 (22:05 +0000)]
Revert r267961, r267973:

These changes prevent sysctl(8) from returning proper output,
such as:

 1) no output from sysctl(8)
 2) erroneously returning ENOMEM with tools like truss(1)
    or uname(1)
 truss: can not get etype: Cannot allocate memory

10 years agoUse Intel's official name (Secure Key) per IntelĀ® Digital Random Number
delphij [Fri, 27 Jun 2014 21:33:15 +0000 (21:33 +0000)]
Use Intel's official name (Secure Key) per IntelĀ® Digital Random Number
Generator (DRNG) Software Implementation Guide.

Reviewed by: kib
Approved by: so
MFC after: 2 weeks

10 years agoAdd the llvm patch for r267981.
dim [Fri, 27 Jun 2014 20:45:17 +0000 (20:45 +0000)]
Add the llvm patch for r267981.

10 years agoPull in r211627 from upstream llvm trunk (by Bill Schmidt):
dim [Fri, 27 Jun 2014 20:41:12 +0000 (20:41 +0000)]
Pull in r211627 from upstream llvm trunk (by Bill Schmidt):

  [PPC64] Fix PR20071 (fctiduz generated for targets lacking that
  instruction)

  PR20071 identifies a problem in PowerPC's fast-isel implementation
  for floating-point conversion to integer.  The fctiduz instruction
  was added in Power ISA 2.06 (i.e., Power7 and later).  However, this
  instruction is being generated regardless of which 64-bit PowerPC
  target is selected.

  The intent is for fast-isel to punt to DAG selection when this
  instruction is not available.  This patch implements that change.
  For testing purposes, the existing fast-isel-conversion.ll test adds
  a RUN line for -mcpu=970 and tests for the expected code generation.
  Additionally, the existing test fast-isel-conversion-p5.ll was found
  to be incorrectly expecting the unavailable instruction to be
  generated.  I've removed these test variants since we have adequate
  coverage in fast-isel-conversion.ll.

This is needed to compile clang with debug+asserts on older powerpc64
and ppc970 targets.

Requested by: jhibbits
MFC after: 3 days

10 years agoIn order to get vt(4) a bit closer to the feature set provided by sc(4),
marius [Fri, 27 Jun 2014 19:57:57 +0000 (19:57 +0000)]
In order to get vt(4) a bit closer to the feature set provided by sc(4),
implement options TERMINAL_{KERN,NORM}_ATTR. These are aliased to
SC_{KERNEL_CONS,NORM}_ATTR and like these latter, allow to change the
default colors of normal and kernel text respectively.
Note on the naming: Although affecting the output of vt(4), technically
kern/subr_terminal.c is primarily concerned with changing default colors
so it would be inconsistent to term these options VT_{KERN,NORM}_ATTR.
Actually, if the architecture and abstraction of terminal+teken+vt would
be perfect, dev/vt/* wouldn't be touched by this commit at all.

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

10 years agoAlways set UF_ARCHIVE on target (because they are by definition new files
delphij [Fri, 27 Jun 2014 19:57:54 +0000 (19:57 +0000)]
Always set UF_ARCHIVE on target (because they are by definition new files
and should be archived) and ignore error when we can't set it (e.g. NFS).

Reviewed by: ken
MFC after: 2 weeks

10 years agoAdd CTLFLAG_NOFETCH flag; console vty code runs before tunable fetch
emaste [Fri, 27 Jun 2014 19:07:35 +0000 (19:07 +0000)]
Add CTLFLAG_NOFETCH flag; console vty code runs before tunable fetch

Also remove redundant "" assignment for string in BSS.

Submitted by: hselasky@

10 years agoAdd missing variable declarations when using RSS.
adrian [Fri, 27 Jun 2014 19:07:00 +0000 (19:07 +0000)]
Add missing variable declarations when using RSS.

Reported by: bryanv@

10 years agoSimplify the code a little bit using the update_sensor_sysctl() routine to
loos [Fri, 27 Jun 2014 18:58:22 +0000 (18:58 +0000)]
Simplify the code a little bit using the update_sensor_sysctl() routine to
retrieve the sensor temperature.

This also avoid the overflow that could happen on sysctlnametomib(3)
because the code was not checking the length of the mib array.

CID: 1222504

10 years agopw: fix up deletion of users from groups
mjg [Fri, 27 Jun 2014 18:51:19 +0000 (18:51 +0000)]
pw: fix up deletion of users from groups

Previuosly given 'foo,bar' members, removing 'foo' would result in an
infinite loop.

PR: 191427
Submitted by: Voradesh Yenbut <yenbut cs.washington.edu>
MFC after: 1 week

10 years agoCorrect the buffer length check to avoid overflows.
loos [Fri, 27 Jun 2014 18:40:14 +0000 (18:40 +0000)]
Correct the buffer length check to avoid overflows.

Found with: Coverity Scan
CID: 12225021222503

10 years agoMinor mdoc fix.
joel [Fri, 27 Jun 2014 18:32:20 +0000 (18:32 +0000)]
Minor mdoc fix.

10 years ago- SC_NO_SYSMOUSE isn't currently supported by vt(4), so nuke it from vt.4.
marius [Fri, 27 Jun 2014 18:24:20 +0000 (18:24 +0000)]
- SC_NO_SYSMOUSE isn't currently supported by vt(4), so nuke it from vt.4.
- vt_vga(4) is a driver rather than a function so reference it accordingly.
- Uncomment HISTORY section given that vt(4) will first appear in 9.3.

Reviewed by: emaste (modulo last part)
MFC after: 3 days
Sponsored by: Bally Wulff Games & Entertainment GmbH

10 years agoAdd post-mortem debugging for "EPT Misconfiguration" VM-exit. This error
neel [Fri, 27 Jun 2014 18:00:38 +0000 (18:00 +0000)]
Add post-mortem debugging for "EPT Misconfiguration" VM-exit. This error
is hard to reproduce so try to collect all the breadcrumbs when it happens.

Reviewed by: grehan

10 years agoUse a common tunable to choose between vt(4)/sc(4)
emaste [Fri, 27 Jun 2014 17:50:33 +0000 (17:50 +0000)]
Use a common tunable to choose between vt(4)/sc(4)

With this change and previous work from ray@ it will be possible to put
both in GENERIC, and have one enabled by default, but allow the other to
be selected via the loader.

(The previous implementation had separate kern.vt.disable and
hw.syscons.disable tunables, and would panic if both drivers were
compiled in and neither was explicitly disabled.)

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

10 years agoAfter r267897 brought in a new version of file/libmagic, a filesystem image
neel [Fri, 27 Jun 2014 17:18:54 +0000 (17:18 +0000)]
After r267897 brought in a new version of file/libmagic, a filesystem image
is identified as "DOS/MBR boot sector" as opposed to "x86 boot sector".

This trips up vmrun.sh when using the new file(1) and makes it want to boot
into the installer instead.

Fix this by just looking for "boot sector" instead.

10 years agoExtend the meaning of the CTLFLAG_TUN flag to automatically check if
hselasky [Fri, 27 Jun 2014 16:33:43 +0000 (16:33 +0000)]
Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after: 2 weeks
Sponsored by: Mellanox Technologies

10 years agoDon't hide zero-length strings when doing sysctl listings.
hselasky [Fri, 27 Jun 2014 15:23:12 +0000 (15:23 +0000)]
Don't hide zero-length strings when doing sysctl listings.

MFC after: 1 week

10 years agoSort command flags in usage output and the manpages.
jhb [Fri, 27 Jun 2014 15:20:34 +0000 (15:20 +0000)]
Sort command flags in usage output and the manpages.

10 years agoAdd proper rangechecks in "axge_rx_frame()" function and
hselasky [Fri, 27 Jun 2014 10:24:36 +0000 (10:24 +0000)]
Add proper rangechecks in "axge_rx_frame()" function and
fix receive loop header parsing.

MFC after: 3 days
PR: 191432

10 years agoFix typo in r267481.
mav [Fri, 27 Jun 2014 06:52:37 +0000 (06:52 +0000)]
Fix typo in r267481.

MFC after: 3 days

10 years agoSet the version and date to fixed fields rather than using
grehan [Fri, 27 Jun 2014 05:27:37 +0000 (05:27 +0000)]
Set the version and date to fixed fields rather than using
preprocessor macros that don't allow reproducible builds.
As a side-effect, the date string is now spec-compliant.

root@bhyve:~ # dmidecode
# dmidecode 2.12
SMBIOS 2.4 present.
12 structures occupying 514 bytes.
Table at 0x000F101F.

Handle 0x0001, DMI type 0, 24 bytes
BIOS Information
        Vendor: BHYVE
        Version: 1.0
        Release Date: 03/14/2014

Submitted by: des (original version)
Reviewed by: tychon
MFC after: 1 week

10 years agoCheck lower bound of cmsg_len.
mjg [Fri, 27 Jun 2014 05:04:36 +0000 (05:04 +0000)]
Check lower bound of cmsg_len.

If passed cm->cmsg_len was below cmsghdr size the experssion:
datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data;

would give negative result. However, in practice it would not
result in a crash because the kernel would try to obtain garbage fds
for given process and would error out with EBADF.

PR: 124908
Submitted by: campbell mumble.net (modified a little)
MFC after: 1 week

10 years agoMFV illumos
rpaulo [Thu, 26 Jun 2014 23:24:59 +0000 (23:24 +0000)]
MFV illumos

4471 DTrace count() with histogram
4472 DTrace full width distribution histograms
4473 DTrace frequency trails

MFC after: 2 weeks

10 years agoMFV illumos
rpaulo [Thu, 26 Jun 2014 23:21:11 +0000 (23:21 +0000)]
MFV illumos

4474 DTrace Userland CTF Support
4475 DTrace userland Keyword
4476 DTrace tests should be better citizens
4479 pid provider types
4480 dof emulation is missing checks

MFC after: 2 weeks

10 years agoAdd stubs for CTF functions which are not yet implemented.
rpaulo [Thu, 26 Jun 2014 22:38:06 +0000 (22:38 +0000)]
Add stubs for CTF functions which are not yet implemented.

MFC after: 2 weeks

10 years agouse .Mt to mark up email addresses consistently (final part)
bapt [Thu, 26 Jun 2014 21:46:14 +0000 (21:46 +0000)]
use .Mt to mark up email addresses consistently (final part)

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

10 years agoMFV illumos
rpaulo [Thu, 26 Jun 2014 21:45:49 +0000 (21:45 +0000)]
MFV illumos

4477 DTrace should speak JSON

MFC after: 2 weeks

10 years agouse .Mt to mark up email addresses consistently (part6)
bapt [Thu, 26 Jun 2014 21:44:30 +0000 (21:44 +0000)]
use .Mt to mark up email addresses consistently (part6)

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

10 years agoSync the E1000 shared code with Intel internal, this adds fixes,
jfv [Thu, 26 Jun 2014 21:33:32 +0000 (21:33 +0000)]
Sync the E1000 shared code with Intel internal, this adds fixes,
and more importantly, new I218 adapter support to the em driver.

MFC after: 1 week

10 years ago- Document -b to enable the bvmcons console (but mark it as deprecated
jhb [Thu, 26 Jun 2014 20:12:38 +0000 (20:12 +0000)]
- Document -b to enable the bvmcons console (but mark it as deprecated
  similar to -g.)
- Document -U to set the SMBIOS UUID.
- Add missing options to the usage output and to the manpage Synopsis.
- Don't claim that bvmdebug is amd64-only (it is also a device, not an
  option).

10 years agoSimplify statistics calculation.
mav [Thu, 26 Jun 2014 20:06:37 +0000 (20:06 +0000)]
Simplify statistics calculation.

Instead of trying to guess size of disk I/O operations (it just won't work
that way for newly added commands, and is equal to data move size for old
ones), account data move traffic.  If disk I/Os are that interesting, then
backends have to account and provide that information.

Block backend already exports the information about disk I/Os via devstat,
so having it here too is excessive.

MFC after: 2 weeks

10 years ago OS-1723 DTrace should speak JSON
rpaulo [Thu, 26 Jun 2014 19:48:59 +0000 (19:48 +0000)]
OS-1723 DTrace should speak JSON
    Reviewed by: Bryan Cantrill <bmc@joyent.com>

illumos/illumos-gate@8017f1f8eea31bd1160b5e50755242a2a9aabc7d

10 years agoMFV illumos r266986:
rpaulo [Thu, 26 Jun 2014 19:38:16 +0000 (19:38 +0000)]
MFV illumos r266986:

2915 DTrace in a zone should see "cpu", "curpsinfo", et al
2916 DTrace in a zone should be able to access fds[]
2917 DTrace in a zone should have limited provider access

MFC after: 2 weeks

10 years agoRevert r267898.
rpaulo [Thu, 26 Jun 2014 17:34:42 +0000 (17:34 +0000)]
Revert r267898.

10 years agoUse dtrace -s instead of /bin/sh for DTrace scripts.
rpaulo [Thu, 26 Jun 2014 17:27:36 +0000 (17:27 +0000)]
Use dtrace -s instead of /bin/sh for DTrace scripts.

10 years agoFix whitspace indentation from spaces to tabs.
bz [Thu, 26 Jun 2014 17:26:33 +0000 (17:26 +0000)]
Fix whitspace indentation from spaces to tabs.

No functional changes.

MFC after: 2 weeks

10 years agoIntroduce opt_netfpga.h and allow setting NF10BMAC_64BIT from mips kernel
bz [Thu, 26 Jun 2014 17:20:45 +0000 (17:20 +0000)]
Introduce opt_netfpga.h and allow setting NF10BMAC_64BIT from mips kernel
configs.  Switch the BERI_NETFPGA_MDROOT to 64bit by default.

Give we have working interrupts also cleanup the extra polling CFLAGS from
the module Makefile.

MFC after: 2 weeks

10 years agoAdd support for emulating the move instruction: "mov r/m8, imm8".
tychon [Thu, 26 Jun 2014 17:15:41 +0000 (17:15 +0000)]
Add support for emulating the move instruction: "mov r/m8, imm8".

Reviewed by: neel

10 years agoAllow switching between 32bit and 64bit bus width data access at compile
bz [Thu, 26 Jun 2014 17:10:07 +0000 (17:10 +0000)]
Allow switching between 32bit and 64bit bus width data access at compile
time by setting NF10BMAC_64BIT and using a REGWTYPE #define to set correct
variable and return value widths.

Adjust comments to indicate the 32 or 64bit register widths.

MFC after: 2 weeks

10 years agoRather than using a constant use sizeof(val) allowing for the length
bz [Thu, 26 Jun 2014 17:03:08 +0000 (17:03 +0000)]
Rather than using a constant use sizeof(val) allowing for the length
to automatically change as we switch between 32/64bit.

MFC after: 2 weeks

10 years agoIn preparation for 64bit mode remove all the _4 from the function and
bz [Thu, 26 Jun 2014 16:49:45 +0000 (16:49 +0000)]
In preparation for 64bit mode remove all the _4 from the function and
macro names, rename val4 to val, and m4 to md.

No functional change.

MFC after: 2 weeks

10 years agoDelay the call to crhold() in vm_map_insert() until we know that we won't
alc [Thu, 26 Jun 2014 16:04:03 +0000 (16:04 +0000)]
Delay the call to crhold() in vm_map_insert() until we know that we won't
have to undo it by calling crfree().  This reduces the total number of calls
by vm_map_insert() to crhold() and crfree() by 45% in my tests.

Eliminate an unnecessary variable from vm_map_insert().

Reviewed by: kib
Tested by: pho

10 years agoFix build with WITHOUT_INET6.
ume [Thu, 26 Jun 2014 14:24:31 +0000 (14:24 +0000)]
Fix build with WITHOUT_INET6.

Spotted by: bf
MFC after: 1 week

10 years agoRemove duplicated includes.
pjd [Thu, 26 Jun 2014 13:57:44 +0000 (13:57 +0000)]
Remove duplicated includes.

Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>

10 years ago- Exclude loopback address rather than loopback interface.
ume [Thu, 26 Jun 2014 12:12:18 +0000 (12:12 +0000)]
- Exclude loopback address rather than loopback interface.
- style(9)

TODO: When AI_ADDRCONFIG is specified, getaddrinfo() can
be quite slow for system with many interfaces.  We should
have some kernel sysctls to report IPv4/IPv6 status.

Spotted by: melifaro
MFC after: 1 week

10 years agoRemove not needed initialisation code.
hselasky [Thu, 26 Jun 2014 10:48:01 +0000 (10:48 +0000)]
Remove not needed initialisation code.

10 years agoDocument EINVAL as per POSIX.
pluknet [Thu, 26 Jun 2014 10:21:00 +0000 (10:21 +0000)]
Document EINVAL as per POSIX.

This also follows r124335-r124336, r225827.

PR: 191382
MFC after: 1 week
Sponsored by: Nginx, Inc.

10 years agoAllow MODE SENSE commands through Write Exclusive persistent reservation,
mav [Thu, 26 Jun 2014 09:42:00 +0000 (09:42 +0000)]
Allow MODE SENSE commands through Write Exclusive persistent reservation,
as required by SPC-4.

Report that fact in persistent reservation capabilities.

MFC after: 2 weeks

10 years agoAdd READ BUFFER and improve WRITE BUFFER SCSI commands support.
mav [Thu, 26 Jun 2014 08:56:36 +0000 (08:56 +0000)]
Add READ BUFFER and improve WRITE BUFFER SCSI commands support.

This gives some use to 512KB per-LUN buffers, allocated for Copan-specific
processor code and not used.  It allows, for example, to test transport
performance and/or correctness without accessing the media, as supported
by Linux version of sg3_utils.

MFC after: 2 weeks

10 years agoBring the following change from the illumos-joyent repository:
rpaulo [Thu, 26 Jun 2014 07:06:43 +0000 (07:06 +0000)]
Bring the following change from the illumos-joyent repository:

commit 78e24ab6803bbe11ba37642624e1498ede5b239d
Author: Bryan Cantrill <bryan@joyent.com>
Date:   Thu Oct 31 01:20:54 2013

    OS-1688 DTrace count() with histogram
    OS-2360 DTrace full width distribution histograms
    OS-2361 DTrace frequency trails

MFC after: 2 weeks

10 years agoMFV r267843: update file/libmagic to 5.19.
delphij [Thu, 26 Jun 2014 06:03:39 +0000 (06:03 +0000)]
MFV r267843: update file/libmagic to 5.19.

MFC after: 2 weeks

10 years agoImprove r264388 removing namespace pollution previously introduced in
davide [Thu, 26 Jun 2014 05:23:48 +0000 (05:23 +0000)]
Improve r264388 removing namespace pollution previously introduced in
<sys/time.h>. INT64_MAX actually requires __INT64_C() hack to get the
type right on exotic architectures (e.g. on ones with 63-bit ints or long
0x7fffffffffffffff is unsigned int or long). The hardcoded LL suffix is
good enough to avoid these problems for SBT_MAX (it makes the type always
signed long long, without overflow since long long has at least 64 bits).
Many thanks to Bruce Evans for the time spent me to explain this.

Reported by: bde
Reviewed by: bde

10 years agoRetire IP_RSSCPUID ; the right thing to do is query the RSS bucket;
adrian [Thu, 26 Jun 2014 04:12:41 +0000 (04:12 +0000)]
Retire IP_RSSCPUID ; the right thing to do is query the RSS bucket;
map the bucket to an RSS queue, then map the queue to a CPU ID.
This way the bucket->queue and queue->CPU mapping can change
over time.

Introduce IP_RSSBUCKETID - which instead looks up the RSS bucket.
User applications can then map the RSS bucket to a CPU.

10 years agoAdd another RSS method to query the indirection table entries.
adrian [Thu, 26 Jun 2014 02:49:51 +0000 (02:49 +0000)]
Add another RSS method to query the indirection table entries.

There's 128 indirection table entries which correspond to the
low 7 bits of the 32 bit RSS hash.  Each value will correspond
to an RSS bucket.  (Then each RSS bucket currently will map
to a CPU.)

This is a more explicit way of figuring out which RSS bucket
is in each RSS indirection slot.  It can be inferred by the other
methods but I'd rather drivers use something more simplified and
explicit.

10 years agoCorrect buffer size.
delphij [Thu, 26 Jun 2014 00:31:58 +0000 (00:31 +0000)]
Correct buffer size.

Submitted by: Sascha Wildner <swildner dragonflybsd org>
MFC after: 2 weeks

10 years agoUse correct length for buffer.
delphij [Wed, 25 Jun 2014 23:42:53 +0000 (23:42 +0000)]
Use correct length for buffer.

Submitted by: Sascha Wildner <swildner dragonflybsd org>
MFC after: 2 weeks

10 years agoExpose the amount of resident and wired memory from the guest's vmspace.
grehan [Wed, 25 Jun 2014 22:13:35 +0000 (22:13 +0000)]
Expose the amount of resident and wired memory from the guest's vmspace.

This is different than the amount shown for the process e.g. by
/usr/bin/top - that is the mappings faulted in by the mmap'd region
of guest memory.

The values can be fetched with bhyvectl

 # bhyvectl --get-stats --vm=myvm
 ...
 Resident memory                          413749248
 Wired memory                             0
 ...

vmm_stat.[ch] -
 Modify the counter code in bhyve to allow direct setting of a counter
as opposed to incrementing, and providing a callback to fetch a
counter's value.

Reviewed by: neel

10 years agoExpand r261243 even further and ignore any I/O port resources assigned to
jhb [Wed, 25 Jun 2014 20:30:47 +0000 (20:30 +0000)]
Expand r261243 even further and ignore any I/O port resources assigned to
PCI root bridges except for the one known-valid case on x86 where bridges
claim the I/O port registers used for PCI config space access.

Tested by: Hilko Meyer <hilko.meyer@gmx.de>
MFC after: 1 week

10 years agoLock devstat updates in block backend to make it usable. Polish lock names.
mav [Wed, 25 Jun 2014 17:54:36 +0000 (17:54 +0000)]
Lock devstat updates in block backend to make it usable.  Polish lock names.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

10 years agoMFV r258381:
pfg [Wed, 25 Jun 2014 17:27:15 +0000 (17:27 +0000)]
MFV r258381:

4251 libdtrace leaks open file handles

Illumos commit: 93ed8d0d4b068b95d0bb50d57bb854df462a8485
(partial)
Reference:
https://www.illumos.org/issues/4251

Discussed with: Robert Mustacchi
Obtained from: Illumos
MFC after: 1 week

10 years agoIntroduce fine-grained CTL locking to improve SMP scalability.
mav [Wed, 25 Jun 2014 17:02:01 +0000 (17:02 +0000)]
Introduce fine-grained CTL locking to improve SMP scalability.

Split global ctl_lock, historically protecting most of CTL context:
 - remaining ctl_lock now protects lists of fronends and backends;
 - per-LUN lun_lock(s) protect LUN-specific information;
 - per-thread queue_lock(s) protect request queues.
This allows to radically reduce congestion on ctl_lock.

Create multiple worker threads, depending on number of CPUs, and assign
each LUN to one of them.  This allows to spread load between multiple CPUs,
still avoiging congestion on queues and LUNs locks.

On 40-core server, exporting 5 LUNs, each backed by gstripe of SATA SSDs,
accessed via 6 iSCSI connections, this change improves peak request rate
from 250K to 680K IOPS.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

10 years agoAllow to use iSCSI immediate data by several ctl_datamove() calls.
mav [Wed, 25 Jun 2014 16:12:14 +0000 (16:12 +0000)]
Allow to use iSCSI immediate data by several ctl_datamove() calls.

While for FreeBSD client that is only a minor optimization, VMWare client
doesn't support additional data requests after all data being sent once as
immediate.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

10 years agoIntroduce $RA_SERVER to set default whois server.
ume [Wed, 25 Jun 2014 15:39:08 +0000 (15:39 +0000)]
Introduce $RA_SERVER to set default whois server.

Requested by: nork
Reviewed by: nork
MFC after: 1 week

10 years ago* Handle ++x as well as x++ while converting.
marcel [Wed, 25 Jun 2014 15:22:14 +0000 (15:22 +0000)]
* Handle ++x as well as x++ while converting.
* Add special case handling where normal conversion would not work
  (some APIs have special names)
* Fix conversion for function calls involving ifnet

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

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

4427 pid provider rejects probes with valid UTF-8 names

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

Illumos Revision: 1444d846b126463eb1059a572ff114d51f7562e5

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

Obtained from: Illumos
MFC after: 2 weeks

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

MFC after: 1 week

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

MFC after: 1 week

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

MFC after: 1 week

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

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

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

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

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

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

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

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

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

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

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

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

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

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

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

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

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

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

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

Reviewed by: kib

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

10 years agoVendor import of file 5.19.
delphij [Tue, 24 Jun 2014 21:24:48 +0000 (21:24 +0000)]
Vendor import of file 5.19.

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

X-MFC-With: r267679

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

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

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

Reviewed by: kevlo@
MFC after: 1 month

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

Many thanks to Emulex for their continued support of FreeBSD!

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

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

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

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

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

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

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

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

Submitted by: delphij
Sponsored by: iXsystems

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

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

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

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

Submitted by: kib @