]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoFix some incorrect #if conditions around older workarounds for bus
jhb [Wed, 22 Apr 2015 21:47:51 +0000 (21:47 +0000)]
Fix some incorrect #if conditions around older workarounds for bus
numbering goofs.

MFC after: 1 week

9 years agoThe minimim grant and maximum latency PCI config registers are only valid
jhb [Wed, 22 Apr 2015 21:41:59 +0000 (21:41 +0000)]
The minimim grant and maximum latency PCI config registers are only valid
for type 0 devices, not type 1 or 2 bridges.  Don't read them for bridge
devices during bus scans and return an error when attempting to read them
as ivars for bridge devices.

9 years agoCosmetic change: use PCIR_SECLAT_2 rather than PCIR_SECLAT_1.
jhb [Wed, 22 Apr 2015 21:38:21 +0000 (21:38 +0000)]
Cosmetic change: use PCIR_SECLAT_2 rather than PCIR_SECLAT_1.

9 years agoFetch the SDHCI frequency from videocore (our prefered source) and only if
loos [Wed, 22 Apr 2015 18:35:02 +0000 (18:35 +0000)]
Fetch the SDHCI frequency from videocore (our prefered source) and only if
it fails, fetch the clock-frequency from DTB.

If both methods fail, use the hardcoded default.

9 years agoMove zlib.c from net to libkern.
rodrigc [Wed, 22 Apr 2015 18:15:18 +0000 (18:15 +0000)]
Move zlib.c from net to libkern.

9 years agoAdd definition for the argument_with_type_tag attribute.
pfg [Wed, 22 Apr 2015 18:13:28 +0000 (18:13 +0000)]
Add definition for the argument_with_type_tag attribute.

This attribute originates in clang and brings support for checking types
of variadic functions' arguments for functions like fcntl() and ioctl().

Unfortunately lint(1) will complain about them: in particular as one of
the parameters is the function being tagged. For now define this attribute
in the lint-sensitive section.

Reference:
http://clang.llvm.org/docs/AttributeReference.html#type-safety-checking

9 years agoMake AIO to not allocate pbufs for unmapped I/O like r281825.
mav [Wed, 22 Apr 2015 18:11:34 +0000 (18:11 +0000)]
Make AIO to not allocate pbufs for unmapped I/O like r281825.

While there, make few more performance optimizations.

On 40-core system doing many 512-byte AIO reads from array of raw SSDs
this change removes lock congestions inside pbuf allocator and devfs,
and bottleneck on single AIO completion taskqueue thread.  It improves
peak AIO performance from ~600K to ~1.3M IOPS.

MFC after: 2 weeks

9 years agoFix the SDHCI clock frequency for RPI2, the default clock (for the newer
loos [Wed, 22 Apr 2015 17:35:58 +0000 (17:35 +0000)]
Fix the SDHCI clock frequency for RPI2, the default clock (for the newer
firmware versions) is 250MHz.

9 years agocomputematchjumps(): fix allocator sizeof operand mismatch.
pfg [Wed, 22 Apr 2015 17:09:02 +0000 (17:09 +0000)]
computematchjumps(): fix allocator sizeof operand mismatch.

Mostly cosmetical warning.

Found by: Clang static analyzer

9 years ago_pthread_cleanup_push: fix allocator sizeof operand mismatch
pfg [Wed, 22 Apr 2015 16:51:21 +0000 (16:51 +0000)]
_pthread_cleanup_push: fix allocator sizeof operand mismatch

Same fix appears to be in DragonFly's libthread_xu.

Found by: Clang Static Analyzer
MFC after: 1 week

9 years agoMove zlib.c from net to libkern.
rodrigc [Wed, 22 Apr 2015 14:38:58 +0000 (14:38 +0000)]
Move zlib.c from net to libkern.

It is not network-specific code and would
be better as part of libkern instead.
Move zlib.h and zutil.h from net/ to sys/
Update includes to use sys/zlib.h and sys/zutil.h instead of net/

Submitted by: Steve Kiernan stevek@juniper.net
Obtained from: Juniper Networks, Inc.
GitHub Pull Request: https://github.com/freebsd/freebsd/pull/28
Relnotes: yes

9 years agoRemove the gptboot partition from the arm64 memory stick image,
gjb [Wed, 22 Apr 2015 13:52:29 +0000 (13:52 +0000)]
Remove the gptboot partition from the arm64 memory stick image,
which is not needed/used.

Sponsored by: The FreeBSD Foundation

9 years agoMove some common code from sys/amd64/amd64/machdep.c and
kib [Wed, 22 Apr 2015 12:32:14 +0000 (12:32 +0000)]
Move some common code from sys/amd64/amd64/machdep.c and
sys/i386/i386/machdep.c to new file sys/x86/x86/cpu_machdep.c.  Most
of the code is related to the idle handling.

Discussed with: pluknet
Sponsored by: The FreeBSD Foundation

9 years agoAdd the null implementation of stack_save and stack_save_td.
andrew [Wed, 22 Apr 2015 12:24:38 +0000 (12:24 +0000)]
Add the null implementation of stack_save and stack_save_td.

Sponsored by: The FreeBSD Foundation

9 years agoRemove the calls to panic from pmap_object_init_pt and pmap_clear_modify.
andrew [Wed, 22 Apr 2015 09:52:51 +0000 (09:52 +0000)]
Remove the calls to panic from pmap_object_init_pt and pmap_clear_modify.

Sponsored by: The FreeBSD Foundation

9 years agoSupport file verification in MAC.
rodrigc [Wed, 22 Apr 2015 01:54:25 +0000 (01:54 +0000)]
Support file verification in MAC.

* Add VCREAT flag to indicate when a new file is being created
* Add VVERIFY to indicate verification is required
* Both VCREAT and VVERIFY are only passed on the MAC method vnode_check_open
  and are removed from the accmode after
* Add O_VERIFY flag to rtld open of objects
* Add 'v' flag to __sflags to set O_VERIFY flag.

Submitted by: Steve Kiernan <stevek@juniper.net>
Obtained from: Juniper Networks, Inc.
GitHub Pull Request: https://github.com/freebsd/freebsd/pull/27
Relnotes: yes

9 years agoQuiet compiler warnings in mbuf.h
rodrigc [Wed, 22 Apr 2015 01:35:29 +0000 (01:35 +0000)]
Quiet compiler warnings in mbuf.h

 * Mark unused arguments with __unused
 * Move inline before the return type (and use __inline to keep the file
   consistent in style.)

Submitted by: Steve Kiernan <stevek@juniper.net>
Obtained from: Juniper Networks, Inc.

9 years agoExtend DA_Q_NO_RC16 to MXUB3* devices.
delphij [Tue, 21 Apr 2015 22:55:52 +0000 (22:55 +0000)]
Extend DA_Q_NO_RC16 to MXUB3* devices.

PR: kern/198647
MFC after: 2 weeks

9 years agoImprove carp(4) locking:
glebius [Tue, 21 Apr 2015 20:25:12 +0000 (20:25 +0000)]
Improve carp(4) locking:
- Use the carp_sx to serialize not only CARP ioctls, but also carp_attach()
  and carp_detach().
- Use cif_mtx to lock only access to those the linked list.
- These locking changes allow us to do some memory allocations with M_WAITOK
  and also properly call callout_drain() in carp_destroy().
- In carp_attach() assert that ifaddr isn't attached. We always come here
  with a pristine address from in[6]_control().

Reviewed by: oleg
Sponsored by: Nginx, Inc.

9 years agoFor igb(4), when we are doing multiqueue, we are all setup to have full 32bit
hiren [Tue, 21 Apr 2015 20:24:15 +0000 (20:24 +0000)]
For igb(4), when we are doing multiqueue, we are all setup to have full 32bit
RSS hash from the card. We do not need to hide that under "ifdef RSS" and should
expose that by default so others like lagg(4) can use that and avoid hashing the
traffic by themselves.
While here, improve comments and get rid of hidden/unimplemented RSS support
code for UDP.

Differential Revision: https://reviews.freebsd.org/D2296
Reviewed by: jfv, erj
Discussed with: adrian
Sponsored by: Limelight Networks

9 years agoRevert r281809, which did more harm than good, and apply
gjb [Tue, 21 Apr 2015 14:48:38 +0000 (14:48 +0000)]
Revert r281809, which did more harm than good, and apply
a more proper fix when attempting to locate the /boot
files.

Sponsored by: The FreeBSD Foundation

9 years agoModify kern___getcwd() to take max pathlen limit as an additional
trasz [Tue, 21 Apr 2015 13:55:24 +0000 (13:55 +0000)]
Modify kern___getcwd() to take max pathlen limit as an additional
argument.  This will be used for the Linux emulation layer - for Linux,
PATH_MAX is 4096 and not 1024.

Differential Revision: https://reviews.freebsd.org/D2335
Reviewed by: kib@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoFix numerous issues in iic(4) and iicbus(4):
jah [Tue, 21 Apr 2015 11:50:31 +0000 (11:50 +0000)]
Fix numerous issues in iic(4) and iicbus(4):
--Allow multiple open iic fds by storing addressing state in cdevpriv
--Fix, as much as possible, the baked-in race conditions in the iic
ioctl interface by requesting bus ownership on I2CSTART, releasing it on
I2CSTOP/I2CRSTCARD, and requiring bus ownership by the current cdevpriv
to use the I/O ioctls
--Reduce internal iic buffer size and remove 1K read/write limit by
iteratively calling iicbus_read/iicbus_write
--Eliminate dynamic allocation in I2CWRITE/I2CREAD
--Move handling of I2CRDWR to separate function and improve error handling
--Add new I2CSADDR ioctl to store address in current cdevpriv so that
I2CSTART is not needed for read(2)/write(2) to work
--Redesign iicbus_request_bus() and iicbus_release_bus():
    --iicbus_request_bus() no longer falls through if the bus is already
owned by the requesting device.  Multiple threads on the same device may
want exclusive access.  Also, iicbus_release_bus() was never
device-recursive anyway.
    --Previously, if IICBUS_CALLBACK failed in iicbus_release_bus(), but
the following iicbus_poll() call succeeded, IICBUS_CALLBACK would not be
issued again
    --Do not hold iicbus mtx during IICBUS_CALLBACK call.  There are
several drivers that may sleep in IICBUS_CALLBACK, if IIC_WAIT is passed.
    --Do not loop in iicbus_request_bus if IICBUS_CALLBACK returns
EWOULDBLOCK; instead pass that to the caller so that it can retry if so
desired.

Differential Revision: https://reviews.freebsd.org/D2140
Reviewed by: imp, jhb, loos
Approved by: kib (mentor)

9 years agoRewrite physio() to not allocate pbufs for unmapped I/O.
mav [Tue, 21 Apr 2015 10:55:53 +0000 (10:55 +0000)]
Rewrite physio() to not allocate pbufs for unmapped I/O.

pbufs is a limited resource, and their allocator is not SMP-scalable.
So instead of always allocating pbuf to immediately convert it to bio,
allocate bio just here.  If buffer needs kernel mapping, then pbuf is
still allocated, but used only as a source of KVA and storage for a list
of held pages.

On 40-core system doing many 512-byte reads from user level to array of
raw SSDs this change removes huge lock congestion inside pbuf allocator.
It improves peak performance from ~300K to ~1.2M IOPS.  On my previous
24-core system this problem also existed, but was less serious.

Reviewed by: kib
MFC after: 2 weeks

9 years agoMake IFMEDIA_DEBUG a kernel option.
glebius [Tue, 21 Apr 2015 10:35:23 +0000 (10:35 +0000)]
Make IFMEDIA_DEBUG a kernel option.

Sponsored by: Nginx, Inc.

9 years agoSerialize all of _kerberos5_bootstrap_tools to avoid build failures involving
ngie [Tue, 21 Apr 2015 10:17:25 +0000 (10:17 +0000)]
Serialize all of _kerberos5_bootstrap_tools to avoid build failures involving
make bootstrap-tools

On the plus side, this also greatly reduces complexity

MFC after: 1 week
Pointyhat to: ngie
Reported by: Willem Jan Withagen <wjw@digiware.nl>

9 years agoInstead of storing mii_media_table array index in ifm_data, determine
glebius [Tue, 21 Apr 2015 09:39:48 +0000 (09:39 +0000)]
Instead of storing mii_media_table array index in ifm_data, determine
it in mii_phy_setmedia() functionally.

Sponsored by: Nginx, Inc.

9 years agoAdd hint about "volmode=dev" to ctl.conf(5).
trasz [Tue, 21 Apr 2015 09:11:28 +0000 (09:11 +0000)]
Add hint about "volmode=dev" to ctl.conf(5).

Differential Revision: https://reviews.freebsd.org/D2328
Reviewed by: allanjude@, bcr@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoThe comment on BMCR data in if_media entry is wrong. The ifm_data stores
glebius [Tue, 21 Apr 2015 08:54:14 +0000 (08:54 +0000)]
The comment on BMCR data in if_media entry is wrong. The ifm_data stores
the index array, not a value for BMCR register. In case of IFM_10_T there
could be either MII_MEDIA_10_T or MII_MEDIA_10_T_FDX, which are 1 and 2,
accordingly. Neither matches a valid BMCR value. My guessing is that this
write is harmless, since later mii_phy_setmedia() would write a proper
value there.

The code is here since the initial checkin. Note that case IFM_100_TX has
the same comment, but a proper value of BMCR_ISO is written. So, collapse
two cases into one, always writing there BMCR_ISO.

Sponsored by: Nginx, Inc.

9 years agoSince xmphy doesn't call mii_phy_setmedia(), there is no reason to set ifm_data.
glebius [Tue, 21 Apr 2015 06:59:40 +0000 (06:59 +0000)]
Since xmphy doesn't call mii_phy_setmedia(), there is no reason to set ifm_data.

Sponsored by: Nginx, Inc.

9 years agoSince brgphy doesn't call mii_phy_setmedia(), there is no reason to
glebius [Tue, 21 Apr 2015 06:46:11 +0000 (06:46 +0000)]
Since brgphy doesn't call mii_phy_setmedia(), there is no reason to
set any value to ifm_data.  If brgphy ever to call mii_phy_setmedia(),
then the value of BRGPHY_S1000 | BRGPHY_BMCR_FDX will trigger KASSERT.

While here, remove the obfuscating macro and wrap long lines.

Sponsored by: Nginx, Inc.

9 years agoDon't print uninitialized variables.
hselasky [Tue, 21 Apr 2015 06:11:47 +0000 (06:11 +0000)]
Don't print uninitialized variables.

CID: 1295242

9 years agoTweak BSS symbol handling from r281811 to not consider them unresolved
bdrewery [Tue, 21 Apr 2015 05:41:56 +0000 (05:41 +0000)]
Tweak BSS symbol handling from r281811 to not consider them unresolved

9 years agoSupport libraries linked by path.
bdrewery [Tue, 21 Apr 2015 05:10:18 +0000 (05:10 +0000)]
Support libraries linked by path.

Sponsored by: EMC / Isilon Storage Division

9 years agoMerge bmake-20150418
sjg [Tue, 21 Apr 2015 04:40:38 +0000 (04:40 +0000)]
Merge bmake-20150418

PR: 199486

9 years ago- For executables search for matching (B) global uninitialized BSS symbols from
bdrewery [Tue, 21 Apr 2015 03:29:03 +0000 (03:29 +0000)]
- For executables search for matching (B) global uninitialized BSS symbols from
  linked libraries. Only do this for BSS symbols that have a size which avoids
  __bss_start. Without this some libraries would be considered unneeded even
  though they were providing a B symbol.
- Add in the symbols from crt1.o to cover a handful of common unresolved symbols.
- Consider (C) common data symbols as provided by libraries/crt1.
- Move libkey() function to more appropriate place.

Sponsored by: EMC / Isilon Storage Division

9 years agoRevert r281805 for now as it breaks due to spaces in output
bdrewery [Tue, 21 Apr 2015 03:06:58 +0000 (03:06 +0000)]
Revert r281805 for now as it breaks due to spaces in output

9 years agoSimplify variable expansion in attempt to fix the vm-image build.
gjb [Tue, 21 Apr 2015 02:49:44 +0000 (02:49 +0000)]
Simplify variable expansion in attempt to fix the vm-image build.

Sponsored by: The FreeBSD Foundation

9 years agoPass full path to ldd(1) so it works on files in cwd.
bdrewery [Tue, 21 Apr 2015 02:02:25 +0000 (02:02 +0000)]
Pass full path to ldd(1) so it works on files in cwd.

9 years agoFix wpa/hostapd build without OpenSSL.
rpaulo [Tue, 21 Apr 2015 02:00:37 +0000 (02:00 +0000)]
Fix wpa/hostapd build without OpenSSL.

9 years agoMerge wpa_supplicant/hostapd 2.4.
rpaulo [Tue, 21 Apr 2015 01:45:11 +0000 (01:45 +0000)]
Merge wpa_supplicant/hostapd 2.4.

Major changes are: SAE, Suite B, RFC 7268, EAP-PKE, ACS, and tons of
bug fixes.

Relnotes: yes

9 years agoSupport demangling C++ symbols with -D flag.
bdrewery [Tue, 21 Apr 2015 01:37:14 +0000 (01:37 +0000)]
Support demangling C++ symbols with -D flag.

Sponsored by: EMC / Isilon Storage Division

9 years agoMerge the following from ^/projects/release-arm64 to allow
gjb [Tue, 21 Apr 2015 00:48:35 +0000 (00:48 +0000)]
Merge the following from ^/projects/release-arm64 to allow
building FreeBSD/arm64 VM images and memstick.img installation
medium:
r281786, r281788, r281792:

 r281786:
  Add support for building arm64/aarch64 virtual machine images.

 r281788:
  Copy amd64/make-memstick.sh to arm64/make-memstick.sh for
  aarch64 memory stick images.

  Although arm64 does not yet have USB support, the memstick
  image should be bootable with certain virtualization tools,
  such as qemu.

 r281792:

  Add a buildenv_setup() prototype, intended to be overridden as
  needed.

  For example, the arm64/aarch64 build needs devel/aarch64-binutils,
  so buildenv_setup() in the release.conf for this architecture
  handles the installation of the port before buildworld/buildkernel.

Sponsored by: The FreeBSD Foundation

9 years agopatch(1): small include changes.
pfg [Mon, 20 Apr 2015 22:15:18 +0000 (22:15 +0000)]
patch(1): small include changes.

Mostly to match OpenBSD, no functional change.

Obtained from: OpenBSD

9 years agoBuild and install the DTB for all the supported AllWinner SoCs.
loos [Mon, 20 Apr 2015 22:12:19 +0000 (22:12 +0000)]
Build and install the DTB for all the supported AllWinner SoCs.

We will need them when we start booting using ubldr.

9 years agoFix improbable memory leak in _citrus_prop_read_str().
pfg [Mon, 20 Apr 2015 22:09:50 +0000 (22:09 +0000)]
Fix improbable memory leak in _citrus_prop_read_str().

Found by: Clang Static Analyzer

9 years agoMove the definition of struct bpf_if to bpf.c.
markj [Mon, 20 Apr 2015 22:08:11 +0000 (22:08 +0000)]
Move the definition of struct bpf_if to bpf.c.

A couple of fields are still exposed via struct bpf_if_ext so that
bpf_peers_present() can be inlined into its callers. However, this change
eliminates some type duplication in the resulting CTF container, since
otherwise ctfmerge(1) propagates the duplication through all types that
contain a struct bpf_if.

Differential Revision: https://reviews.freebsd.org/D2319
Reviewed by: melifaro, rpaulo

9 years agoscsi_parse_transportid_rdma(): fix mismatch in memoty access size.
pfg [Mon, 20 Apr 2015 21:44:55 +0000 (21:44 +0000)]
scsi_parse_transportid_rdma(): fix mismatch in memoty access size.

Independently found by Coverity and gcc49.

CID: 1230006
Reviewed by: ken
MFC after: 5 days

9 years agoMinor mdoc fixes.
joel [Mon, 20 Apr 2015 21:19:26 +0000 (21:19 +0000)]
Minor mdoc fixes.

9 years ago- Speedup significantly by not using subshells for data already fetched.
bdrewery [Mon, 20 Apr 2015 20:51:19 +0000 (20:51 +0000)]
- Speedup significantly by not using subshells for data already fetched.
  Ran against /usr/local/sbin/pkg:
   Before:  25.12 real        12.41 user        33.14 sys
   After:   0.53 real         0.49 user         0.13 sys
- Exit with 1 if any missing or unresolved symbol is detected.
- Add option '-U' to skip looking up unresolved symbols.
- Don't consider provided weak objects as unresolved (nm V).

Sponsored by: EMC / Isilon Storage Division

9 years agoFix indentation to use tabs
bdrewery [Mon, 20 Apr 2015 20:45:10 +0000 (20:45 +0000)]
Fix indentation to use tabs

9 years agophabricator related changes:
eadler [Mon, 20 Apr 2015 20:33:22 +0000 (20:33 +0000)]
phabricator related changes:
- don't lint either contrib or crypto: these are both externally written
  directories
- add additional linters for spelling (check common typos like teh ->
  the)
- chmod linter checks for executible bit on bad files
- merge-conflict checks for merge conflict tokens then may have been
  resolved incorrectly
- filename checks for back characters in filenames
- json for json syntax correctness

- remove history.immutable: it is meaningless on subversion, and causes
  workflow problems when trying to use git.  It it set to 'true' by
  default with hg

9 years agoCopy amd64/make-memstick.sh to arm64/make-memstick.sh for
gjb [Mon, 20 Apr 2015 20:13:02 +0000 (20:13 +0000)]
Copy amd64/make-memstick.sh to arm64/make-memstick.sh for
aarch64 memory stick images.

Although arm64 does not yet have USB support, the memstick
image should be bootable with certain virtualization tools,
such as qemu.

Sponsored by: The FreeBSD Foundation

9 years agodmesg: accommodate message buffer growth between the sysctl calls
vangyzen [Mon, 20 Apr 2015 20:07:39 +0000 (20:07 +0000)]
dmesg: accommodate message buffer growth between the sysctl calls

Allocate 12.5% extra space to avoid ENOMEM when the message buffer
is growing steadily.

Reported by: Steve Wahl <steve_wahl@dell.com> (and tested)
Approved by: kib (mentor)
Obtained from: Dell Inc.
MFC after: 1 week

9 years agoAdd support for building arm64/aarch64 virtual machine images.
gjb [Mon, 20 Apr 2015 20:06:25 +0000 (20:06 +0000)]
Add support for building arm64/aarch64 virtual machine images.

Sponsored by: The FreeBSD Foundation

9 years agoAlways send log(9) messages to the message buffer.
vangyzen [Mon, 20 Apr 2015 20:03:26 +0000 (20:03 +0000)]
Always send log(9) messages to the message buffer.

It is truer to the semantics of logging for messages to *always*
go to the message buffer, where they can eventually be collected
and, in fact, be put into a log file.

This restores the behavior prior to r70239, which seems to have
changed it inadvertently.

Submitted by: Eric Badger <eric@badgerio.us>
Reviewed by: jhb
Approved by: kib (mentor)
Obtained from: Dell Inc.
MFC after: 1 week

9 years agoMFH: r281668 through r281783
gjb [Mon, 20 Apr 2015 20:03:07 +0000 (20:03 +0000)]
MFH: r281668 through r281783

Sponsored by: The FreeBSD Foundation

9 years agoWhen building VM disk images, vm_copy_base() uses tar(1) to
gjb [Mon, 20 Apr 2015 19:54:54 +0000 (19:54 +0000)]
When building VM disk images, vm_copy_base() uses tar(1) to
copy the userland from one md(4)-mounted filesystem to a clean
filesystem to prevent remnants of files that were added and
removed from resulting in an unclean filesystem.  When newfs(8)
creates the first filesystem with journaled soft-updates enabled,
the /.sujournal file in the new filesystem cannot be overwritten
by the /.sujournal in the original filesystem.

To avoid this particular error case, do not enable journaled
soft-updates when creating the md(4)-backed filesystems, and
instead use tunefs(8) to enable journaled soft-updates after
the new filesystem is populated in vm_copy_base().

While here, fix a long standing bug where the build environment
/boot files were used by mkimg(1) when creating the VM disk
images by using the files in .OBJDIR.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoDon't set bits that should be zero for SATA devices.
mav [Mon, 20 Apr 2015 19:11:27 +0000 (19:11 +0000)]
Don't set bits that should be zero for SATA devices.

Old value made Linux think that it is PATA device with SATA bridge.

MFC after: 2 weeks

9 years agocrunchide: Remove local EM_* ELF definitions provided by system ELF headers
emaste [Mon, 20 Apr 2015 18:30:06 +0000 (18:30 +0000)]
crunchide: Remove local EM_* ELF definitions provided by system ELF headers

Suggested by: imp (in review D2314)

9 years agoUpdate usage statement to align with post-r279624 functionality.
dteske [Mon, 20 Apr 2015 17:46:09 +0000 (17:46 +0000)]
Update usage statement to align with post-r279624 functionality.

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

9 years agovidcontrol: skip invalid video modes returned by vt(4)
emaste [Mon, 20 Apr 2015 17:43:55 +0000 (17:43 +0000)]
vidcontrol: skip invalid video modes returned by vt(4)

vt(4) has a stub CONS_MODEINFO ioctl that does not provide any data
but returns success. This needs to be fixed in the kernel, but address
it in vidcontrol(1) as well in case it's run on an older kernel.

Reviewed by: bde
Sponsored by: The FreeBSD Foundation

9 years agoAdd llvm patch corresponding to r281775.
dim [Mon, 20 Apr 2015 17:37:37 +0000 (17:37 +0000)]
Add llvm patch corresponding to r281775.

9 years agoPull in r229911 from upstream llvm trunk (by Benjamin Kramer):
dim [Mon, 20 Apr 2015 17:36:35 +0000 (17:36 +0000)]
Pull in r229911 from upstream llvm trunk (by Benjamin Kramer):

  MC: Allow multiple comma-separated expressions on the .uleb128 directive.

  For compatiblity with GNU as. Binutils documents this as
  '.uleb128 expressions'. Subtle, isn't it?

Reported by: sbruno
PR: 199554
MFC after: 3 days

9 years agoRemove unused variable.
araujo [Mon, 20 Apr 2015 17:30:13 +0000 (17:30 +0000)]
Remove unused variable.

Differential Revision: D2333
Reviewed by: royger

9 years agoAdd back ixgbe_rxeof, just remove the assignment to more.
araujo [Mon, 20 Apr 2015 17:24:39 +0000 (17:24 +0000)]
Add back ixgbe_rxeof, just remove the assignment to more.

9 years agoRemove unused variable.
araujo [Mon, 20 Apr 2015 17:21:15 +0000 (17:21 +0000)]
Remove unused variable.

Differential Revision: D2331
Reviewed by: erj

9 years agoEliminate an unused variable.
alc [Mon, 20 Apr 2015 16:48:21 +0000 (16:48 +0000)]
Eliminate an unused variable.

MFC after: 1 week

9 years agoPrevent a double free.
pfg [Mon, 20 Apr 2015 16:40:13 +0000 (16:40 +0000)]
Prevent a double free.

This is similar to r281756 so set the ptr NULL after free as a safety belt
against future changes.

Obtained from: HardenedBSD (b2e77ced9ae213d358b44d98f552d9ae4636ecac)
Submitted by: Oliver Pinter
Revewed by: rmacklem

9 years agog_uncompress_taste: prevent a double free.
pfg [Mon, 20 Apr 2015 16:31:27 +0000 (16:31 +0000)]
g_uncompress_taste: prevent a double free.

Found by: Clang Static Analyzer
MFC after: 1 week

9 years agoBump doc date missed in r281605.
brooks [Mon, 20 Apr 2015 16:23:59 +0000 (16:23 +0000)]
Bump doc date missed in r281605.

MFC after: 1 day

9 years agoReport link as up if tap device is not specified (black hole).
mav [Mon, 20 Apr 2015 14:55:01 +0000 (14:55 +0000)]
Report link as up if tap device is not specified (black hole).

MFC after: 2 weeks

9 years agoReport link as up only if we managed to open tap device.
mav [Mon, 20 Apr 2015 14:23:18 +0000 (14:23 +0000)]
Report link as up only if we managed to open tap device.

It would be cool to report tap device status, but it has no such API.

MFC after: 2 weeks

9 years agoActivate write-only optimization if bpf device opened with O_WRONLY.
mav [Mon, 20 Apr 2015 10:44:46 +0000 (10:44 +0000)]
Activate write-only optimization if bpf device opened with O_WRONLY.

dhclient opens bpf as write-only to send packets. It never reads received
packets from that descriptor, but processing them in kernel takes time.
Especially much time takes packet timestamping on systems with expensive
timecounter, such as bhyve guest, where network speed dropped in half.

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

9 years agoDisable RX/TX queues notifications when not needed.
mav [Mon, 20 Apr 2015 10:29:42 +0000 (10:29 +0000)]
Disable RX/TX queues notifications when not needed.

This reduces CPU load and doubles iperf throughput, reaching 2-3Gbit/s.

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

9 years agoRemove code to support the top of the stack layout for FreeBSD 1.x/2.x
kib [Mon, 20 Apr 2015 09:07:12 +0000 (09:07 +0000)]
Remove code to support the top of the stack layout for FreeBSD 1.x/2.x
kernel, but keep explanation of the old ps_strings structure to make
it clear what sanity check tries to accomplish.

Noted by: Oliver Pinter <oliver.pinter@hardenedbsd.org>
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoRemove duplicate definitions of MWAIT_CX hints. Identical defines in
kib [Mon, 20 Apr 2015 08:25:55 +0000 (08:25 +0000)]
Remove duplicate definitions of MWAIT_CX hints.  Identical defines in
specialreg.h are enough.

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

9 years agobmake-20150418
sjg [Mon, 20 Apr 2015 03:46:52 +0000 (03:46 +0000)]
bmake-20150418

9 years agoImport bmake-20150418
sjg [Mon, 20 Apr 2015 03:45:54 +0000 (03:45 +0000)]
Import bmake-20150418

9 years agofind.1: Add missing whitespace:
eadler [Mon, 20 Apr 2015 02:23:00 +0000 (02:23 +0000)]
find.1: Add missing whitespace:

Obtained from: Dragonfly (dee38d02d51cc8316f82b0263158d2546f2398bc)

9 years agoed(1): Fix [-Werror=logical-not-parentheses]
eadler [Mon, 20 Apr 2015 02:07:57 +0000 (02:07 +0000)]
ed(1): Fix [-Werror=logical-not-parentheses]
/usr/src/bin/ed/glbl.c:64:36: error: logical not is only applied to
theleft hand side of comparison [-Werror=logical-not-parentheses]

Obtained from: Dragonfly (1fff89cbaeaa43af720a1f23d9c466b756dd8a58)
MFC After: 1 month

9 years agonfsrpc_createv4: fix double free.
pfg [Sun, 19 Apr 2015 23:55:59 +0000 (23:55 +0000)]
nfsrpc_createv4: fix double free.

Reported by: Oliver Pinter, clang static checker
Obtained from: HardenedBSD (commit 63cac77c42c0c3fc67da62f97d5ab651d52ae707)
Reviewed by: rmacklem
MFC after: 5 days

9 years agoMake a comment reflect reality.
marius [Sun, 19 Apr 2015 20:20:52 +0000 (20:20 +0000)]
Make a comment reflect reality.

9 years agoRefine the workaround for Intel HSD131 [1] added in r269052:
marius [Sun, 19 Apr 2015 20:15:57 +0000 (20:15 +0000)]
Refine the workaround for Intel HSD131 [1] added in r269052:
- Use the full mask described by the erratum as with a sufficiently high
  number of these false-positives, the overflow bit (bit 62) additionally
  gets set [7].
- HSD131 has been brought into several other Haswell-derived CPUs including
  to the next generation, i. e. Intel Broadwell. Thus, also skip reporting of
  these benign errors by default on CPU models affected by HSM142, HSW131 and
  BDM48 [2 - 5], describing the HSD131 silicon bug for additional models.
  Also, Celeron 2955U with a CPU ID of 0x45 have been reported to be covered
  by this fault [6], with the specification update concerned with HSM142 [2]
  only referring to 0x3c and 0x46.

Submitted by: David Froehlich [7]
MFC after: 3 days

http://www.intel.de/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-desktop-specification-update.pdf [1]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-mobile-specification-update.pdf [2]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/5th-gen-core-family-spec-update.pdf [3]
http://www.intel.de/content/dam/www/public/us/en/documents/specification-updates/core-m-processor-family-spec-update.pdf [4]
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e3-1200v3-spec-update.pdf [5]
https://lists.freebsd.org/pipermail/freebsd-hackers/2015-January/046878.html [6]

9 years agoRefactor out the _PXM -> VM domain lookup done in ACPI, in preparation for
adrian [Sun, 19 Apr 2015 17:15:55 +0000 (17:15 +0000)]
Refactor out the _PXM -> VM domain lookup done in ACPI, in preparation for
its use in upcoming code.

This is inspired by something in jhb's NUMA IRQ allocation patchset.

However, the tricky bit here is that the PXM lookup for a node may
fail, requiring a lookup on the parent node.  So if it doesn't
exist, don't fail - just go up to the parent.  Only error out of the
lookup is the ACPI lookup returns an error.

Sponsored by: Norse Corp, Inc.

9 years agoUpdate pkt-gen to optionally use randomised source/destination
adrian [Sun, 19 Apr 2015 17:07:51 +0000 (17:07 +0000)]
Update pkt-gen to optionally use randomised source/destination
IPv4 addresses/ports.

When doing traffic testing of actual code that /does/ things to the
packet (rather than say, 'bridge.c'), it's typically a good idea to
use a variety of cache-busting and flow-tracking-busting packet
spreads.  The pkt-gen method of testing an IP range was to walk
it linearly - which is fine, but not useful enough.

This can be used to completely randomize the source/destination
addresses (eg to test out flow-tracking-busting) and to keep the
destination fixed whilst randomising the source (eg to test out
what a DDoS may look like.)

Tested:

* Intel ixgbe 10G (82599) netmap

Differential Revision: https://reviews.freebsd.org/D2309
MFC after: 2 weeks
Sponsored by: Norse Corp, Inc.

9 years agoAdd new USB ID.
kevlo [Sun, 19 Apr 2015 15:53:58 +0000 (15:53 +0000)]
Add new USB ID.

PR: 199522

9 years agoFix use-after-free.
melifaro [Sun, 19 Apr 2015 12:49:30 +0000 (12:49 +0000)]
Fix use-after-free.

Reported by: Coverity Scan, pfg
CID: 1245747

9 years agoChange wcommitsize default from one empirical value to another.
mav [Sun, 19 Apr 2015 11:34:41 +0000 (11:34 +0000)]
Change wcommitsize default from one empirical value to another.

The new value is more predictable with growing RAM size:

        hibufspace maxvnodes      old      new
i386:
  256MB   32980992     15800  2198732  2097152
    2GB   94027776    107677   878764  4194304
amd64:
  256MB   32980992     15800  2198732  2097152
    1GB  114114560     68062  1678155  4194304
    4GB  217055232    111807  1955452  4194304
   16GB 1717846016    337308  5097465 16777216
   64GB 1734918144   1164427  1490479 16777216
  256GB 1734918144   4426453   391983 16777216

Reviewed by: rmacklem
MFC after: 2 weeks

9 years agoidentd: restore memcpy
eadler [Sun, 19 Apr 2015 09:35:46 +0000 (09:35 +0000)]
identd: restore memcpy
I should not be committing at 2:30am....

Reported by: pluknet

9 years agoidentd: also zero se_rpc_highvers
eadler [Sun, 19 Apr 2015 09:27:47 +0000 (09:27 +0000)]
identd: also zero se_rpc_highvers

Reported by: pluknet

9 years agoidentd: remove redundant zeroing
eadler [Sun, 19 Apr 2015 09:07:57 +0000 (09:07 +0000)]
identd: remove redundant zeroing
se_rpc_lowvers was set to 0 twice, so remove one of them
I can not find any other variable which they may have been a typo of.

Reported by: gcc5.1

9 years agotzsetup: remove set but unused variable
eadler [Sun, 19 Apr 2015 08:45:37 +0000 (08:45 +0000)]
tzsetup: remove set but unused variable
- leave a comment explaining which variable it used to be

Reported by: gcc5.1

9 years agoconfig: remove set but unchecked variable
eadler [Sun, 19 Apr 2015 08:30:13 +0000 (08:30 +0000)]
config: remove set but unchecked variable
reported by: gcc5.1

9 years agoAdd back fdrop() missed in r281726.
trasz [Sun, 19 Apr 2015 07:35:18 +0000 (07:35 +0000)]
Add back fdrop() missed in r281726.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoREADME: changes and fixups
eadler [Sun, 19 Apr 2015 07:16:44 +0000 (07:16 +0000)]
README: changes and fixups
Two orthogonal goals:
- try to make README look a little nicer on phabricator by using
  Remarkup syntax for commands (using `` instead of using a closing ')
- try to make README look a little nicer on github.

- Don't encourage `make world` when the handbook specifies otherwise
- Change language around documentation to be a bit clearer

MFC After: 2 weeks

9 years agoOptimize the O_NOCTTY handling hack in linux_common_open().
trasz [Sun, 19 Apr 2015 07:12:16 +0000 (07:12 +0000)]
Optimize the O_NOCTTY handling hack in linux_common_open().

Differential Revision: https://reviews.freebsd.org/D2323
Reviewed by: kib@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoReplace "new NFS" with just "NFS" in some sysctl description strings.
trasz [Sun, 19 Apr 2015 06:18:41 +0000 (06:18 +0000)]
Replace "new NFS" with just "NFS" in some sysctl description strings.

Sponsored by: The FreeBSD Foundation

9 years agorpcgen: fix use use of strcmp
eadler [Sun, 19 Apr 2015 04:53:28 +0000 (04:53 +0000)]
rpcgen: fix use use of strcmp
strcmp only guarantee that it will return at least 1 if the string B
is greater than that of string A.

9 years agocalendar: remove useless check
eadler [Sun, 19 Apr 2015 04:27:50 +0000 (04:27 +0000)]
calendar: remove useless check
lineline checked for 0 in the while loop condition.  There is no need to
check for it additionally in the body.

CID: 1288959
MFC After: 1 week