Commit Graph

199358 Commits

Author SHA1 Message Date
Craig Rodrigues
d9db52256e 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
2015-04-22 14:38:58 +00:00
Glen Barber
e19e678123 Remove the gptboot partition from the arm64 memory stick image,
which is not needed/used.

Sponsored by:	The FreeBSD Foundation
2015-04-22 13:52:29 +00:00
Konstantin Belousov
dfe7b3bfbc 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
2015-04-22 12:32:14 +00:00
Andrew Turner
6c2d9cea22 Add the null implementation of stack_save and stack_save_td.
Sponsored by:	The FreeBSD Foundation
2015-04-22 12:24:38 +00:00
Andrew Turner
6dd719a463 Remove the calls to panic from pmap_object_init_pt and pmap_clear_modify.
Sponsored by:	The FreeBSD Foundation
2015-04-22 09:52:51 +00:00
Craig Rodrigues
d5fec48956 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
2015-04-22 01:54:25 +00:00
Craig Rodrigues
fff9fa1935 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.
2015-04-22 01:35:29 +00:00
Xin LI
90f851d22f Extend DA_Q_NO_RC16 to MXUB3* devices.
PR:		kern/198647
MFC after:	2 weeks
2015-04-21 22:55:52 +00:00
Gleb Smirnoff
9c2cd1aa84 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.
2015-04-21 20:25:12 +00:00
Hiren Panchasara
270538b2b6 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
2015-04-21 20:24:15 +00:00
Glen Barber
bf93ac7884 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
2015-04-21 14:48:38 +00:00
Edward Tomasz Napierala
6289b482ec 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
2015-04-21 13:55:24 +00:00
Jason A. Harmening
0afebee290 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)
2015-04-21 11:50:31 +00:00
Alexander Motin
869fd29a7b 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
2015-04-21 10:55:53 +00:00
Gleb Smirnoff
41c1a23326 Make IFMEDIA_DEBUG a kernel option.
Sponsored by:	Nginx, Inc.
2015-04-21 10:35:23 +00:00
Enji Cooper
9dc634de35 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>
2015-04-21 10:17:25 +00:00
Gleb Smirnoff
27e1f92dbf Instead of storing mii_media_table array index in ifm_data, determine
it in mii_phy_setmedia() functionally.

Sponsored by:	Nginx, Inc.
2015-04-21 09:39:48 +00:00
Edward Tomasz Napierala
6775608bea 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
2015-04-21 09:11:28 +00:00
Gleb Smirnoff
ac55afa3ca 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.
2015-04-21 08:54:14 +00:00
Gleb Smirnoff
2eba9bbe06 Since xmphy doesn't call mii_phy_setmedia(), there is no reason to set ifm_data.
Sponsored by:	Nginx, Inc.
2015-04-21 06:59:40 +00:00
Gleb Smirnoff
4a473e462c 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.
2015-04-21 06:46:11 +00:00
Hans Petter Selasky
30b44000d9 Don't print uninitialized variables.
CID:	1295242
2015-04-21 06:11:47 +00:00
Bryan Drewery
64ee145b7d Tweak BSS symbol handling from r281811 to not consider them unresolved 2015-04-21 05:41:56 +00:00
Bryan Drewery
5f6c4518c8 Support libraries linked by path.
Sponsored by:	EMC / Isilon Storage Division
2015-04-21 05:10:18 +00:00
Simon J. Gerraty
db29cad815 Merge bmake-20150418
PR: 199486
2015-04-21 04:40:38 +00:00
Bryan Drewery
3554283a7b - 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
2015-04-21 03:29:03 +00:00
Bryan Drewery
60b38ce2b5 Revert r281805 for now as it breaks due to spaces in output 2015-04-21 03:06:58 +00:00
Glen Barber
fa56961588 Simplify variable expansion in attempt to fix the vm-image build.
Sponsored by:	The FreeBSD Foundation
2015-04-21 02:49:44 +00:00
Bryan Drewery
c668010e3f Pass full path to ldd(1) so it works on files in cwd. 2015-04-21 02:02:25 +00:00
Rui Paulo
cd4308d21f Fix wpa/hostapd build without OpenSSL. 2015-04-21 02:00:37 +00:00
Rui Paulo
5b9c547c07 Merge wpa_supplicant/hostapd 2.4.
Major changes are: SAE, Suite B, RFC 7268, EAP-PKE, ACS, and tons of
bug fixes.

Relnotes:	yes
2015-04-21 01:45:11 +00:00
Bryan Drewery
9d273a1ffc Support demangling C++ symbols with -D flag.
Sponsored by:	EMC / Isilon Storage Division
2015-04-21 01:37:14 +00:00
Glen Barber
6b1cf1b2c2 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
2015-04-21 00:48:35 +00:00
Pedro F. Giffuni
df6e4074c0 patch(1): small include changes.
Mostly to match OpenBSD, no functional change.

Obtained from:	OpenBSD
2015-04-20 22:15:18 +00:00
Luiz Otavio O Souza
14c1e97f57 Build and install the DTB for all the supported AllWinner SoCs.
We will need them when we start booting using ubldr.
2015-04-20 22:12:19 +00:00
Pedro F. Giffuni
4194e4e371 Fix improbable memory leak in _citrus_prop_read_str().
Found by:	Clang Static Analyzer
2015-04-20 22:09:50 +00:00
Mark Johnston
b23cbbe6db 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
2015-04-20 22:08:11 +00:00
Pedro F. Giffuni
8188e2e04e 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
2015-04-20 21:44:55 +00:00
Joel Dahl
ac074de850 Minor mdoc fixes. 2015-04-20 21:19:26 +00:00
Bryan Drewery
3844bbe29e - 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
2015-04-20 20:51:19 +00:00
Bryan Drewery
972b622794 Fix indentation to use tabs 2015-04-20 20:45:10 +00:00
Eitan Adler
db29be839a 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
2015-04-20 20:33:22 +00:00
Glen Barber
47a5593e1b 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
2015-04-20 20:13:02 +00:00
Eric van Gyzen
f8ee95484e 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
2015-04-20 20:07:39 +00:00
Glen Barber
6a3afe6924 Add support for building arm64/aarch64 virtual machine images.
Sponsored by:	The FreeBSD Foundation
2015-04-20 20:06:25 +00:00
Eric van Gyzen
c207ff9319 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
2015-04-20 20:03:26 +00:00
Glen Barber
7fffcb0d48 MFH: r281668 through r281783
Sponsored by:	The FreeBSD Foundation
2015-04-20 20:03:07 +00:00
Glen Barber
4b8175ee8f 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
2015-04-20 19:54:54 +00:00
Alexander Motin
fdd86701e5 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
2015-04-20 19:11:27 +00:00
Ed Maste
a8da2875c6 crunchide: Remove local EM_* ELF definitions provided by system ELF headers
Suggested by:	imp (in review D2314)
2015-04-20 18:30:06 +00:00