]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoxenbus: add a comment with the names of the generated accessors
Roger Pau Monné [Fri, 15 Jan 2016 14:34:31 +0000 (14:34 +0000)]
xenbus: add a comment with the names of the generated accessors

For easy grepping.

Sponsored by: Citrix Systems R&D

8 years agoClean up original route path selection logic a bit.
Alexander V. Chernikov [Fri, 15 Jan 2016 13:47:11 +0000 (13:47 +0000)]
Clean up original route path selection logic a bit.

NULL pointer dereference claimed by Coverity was possible
  if one (or several) next-hops for had their weights set to 0.

CID: 1348482

8 years agoUse the recently added "make_dev_s()" function to solve old race setting the
Hans Petter Selasky [Fri, 15 Jan 2016 12:09:15 +0000 (12:09 +0000)]
Use the recently added "make_dev_s()" function to solve old race setting the
si_drv1 field in "struct cdev" when creating new character devices.

8 years agoRemove the commented out sc device from the i.MX kernels, they both use
Andrew Turner [Fri, 15 Jan 2016 11:40:41 +0000 (11:40 +0000)]
Remove the commented out sc device from the i.MX kernels, they both use
vt(4).

8 years agoImplement support for PCI suspend, resume and shutdown events in the
Hans Petter Selasky [Fri, 15 Jan 2016 11:18:58 +0000 (11:18 +0000)]
Implement support for PCI suspend, resume and shutdown events in the
LinuxKPI. Fix a few spaces to tabs. Bump the FreeBSD version to force
recompilation of existing KMODs.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoMake nfscl_getmyip() use new routing KPI.
Alexander V. Chernikov [Fri, 15 Jan 2016 09:05:14 +0000 (09:05 +0000)]
Make nfscl_getmyip() use new routing KPI.

* Use standard IPv6 SAS instead of rt->rt_ifa address.
* Make address lookup work for IPv6 LLA.
* Save address into buffer provided by caller instead of using static vars.

Discussed with: rmacklem

8 years agosfxge: cleanup: simplify ef10_get_datapath_caps
Andrew Rybchenko [Fri, 15 Jan 2016 06:30:46 +0000 (06:30 +0000)]
sfxge: cleanup: simplify ef10_get_datapath_caps

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4938

8 years agosfxge: convert nvram rw_start method to use partition id
Andrew Rybchenko [Fri, 15 Jan 2016 06:28:58 +0000 (06:28 +0000)]
sfxge: convert nvram rw_start method to use partition id

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4937

8 years agosfxge: Medford still needs fallback for no privilege mask
Andrew Rybchenko [Fri, 15 Jan 2016 06:27:51 +0000 (06:27 +0000)]
sfxge: Medford still needs fallback for no privilege mask

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4936

8 years agosfxge: medford stores a single global copy of VPD
Andrew Rybchenko [Fri, 15 Jan 2016 06:26:37 +0000 (06:26 +0000)]
sfxge: medford stores a single global copy of VPD

Not per PF copies as on Huntington.

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4935

8 years agosfxge: support FATSOv2
Andrew Rybchenko [Fri, 15 Jan 2016 06:25:26 +0000 (06:25 +0000)]
sfxge: support FATSOv2

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4934

8 years agosfxge: rework MCDI request completion
Andrew Rybchenko [Fri, 15 Jan 2016 06:23:04 +0000 (06:23 +0000)]
sfxge: rework MCDI request completion

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4933

8 years agosfxge: rename hunt_link_state_t to ef10_link_state_t
Andrew Rybchenko [Fri, 15 Jan 2016 06:21:39 +0000 (06:21 +0000)]
sfxge: rename hunt_link_state_t to ef10_link_state_t

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4932

8 years agoConnect the ZFS boot environment menu to the UEFI loader
Allan Jude [Fri, 15 Jan 2016 05:45:45 +0000 (05:45 +0000)]
Connect the ZFS boot environment menu to the UEFI loader

MFC after: 3 days
Sponsored by: ScaleEngine Inc.

8 years agoMove init_zfs_bootenv to sys/boot/zfs/zfs.c instead of having a copy in each loader
Allan Jude [Fri, 15 Jan 2016 05:45:10 +0000 (05:45 +0000)]
Move init_zfs_bootenv to sys/boot/zfs/zfs.c instead of having a copy in each loader

While here, add a filter to ignore special datasets

MFC after: 3 days
Sponsored by: ScaleEngine Inc.

8 years agoAdd EFI ZFS boot support
Steven Hartland [Fri, 15 Jan 2016 02:33:47 +0000 (02:33 +0000)]
Add EFI ZFS boot support

This builds on the modular EFI loader support added r294060 adding a
module to provide ZFS boot support on EFI systems.

It should be noted that EFI uses a fixed size memory block for all
allocations performed by the loader so it may be necessary to tune this
size.

For example when building an image which uses mfs_root e.g. mfsbsd, adding
the following to /etc/make.conf would be needed to prevent EFI from running
out of memory when loading the mfs_root image.
EFI_STAGING_SIZE=128

Submitted by: Eric McCorkle
MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoioat(4): Add support for 'fence' bit with DMA_FENCE flag
Conrad Meyer [Fri, 15 Jan 2016 01:34:43 +0000 (01:34 +0000)]
ioat(4): Add support for 'fence' bit with DMA_FENCE flag

Some classes of IOAT hardware prefetch reads.  DMA operations that
depend on the result of prior DMA operations must use the DMA_FENCE flag
to prevent stale reads.

(E.g., I've hit this personally on Broadwell-EP.  The Broadwell-DE has a
different IOAT unit that is documented to not pipeline DMA operations.)

Sponsored by: EMC / Isilon Storage Division

8 years agoModularise EFI boot loader
Steven Hartland [Fri, 15 Jan 2016 01:22:36 +0000 (01:22 +0000)]
Modularise EFI boot loader

Make EFI boot loader modular in preparation for adding ZFS support.

This is a partial commit of the D4515.

Submitted by: Eric McCorkle
Reviewed by: emaste (in part)
MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D4515

8 years agoEnsure boot fsread correctly probes all partitions
Steven Hartland [Fri, 15 Jan 2016 01:06:37 +0000 (01:06 +0000)]
Ensure boot fsread correctly probes all partitions

The boot code fsread was caching the result of meta data request and
reusing it even for calls with inode = 0, which is used to partitions
trigger a probe.

The result was that success was incorrectly returned for all partition
probes after the first valid success, even for partitions which are not
UFS.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoMake common boot file_loadraw name parameter const
Steven Hartland [Fri, 15 Jan 2016 00:55:36 +0000 (00:55 +0000)]
Make common boot file_loadraw name parameter const

Fix compiler warnings about dropping const qualifier by changing file_loadraw
name param to const, and updating method to make that the case (it was
abusing the variable).

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoFix a bug in INIT handling on accepted 1-to-1 style sockets when the
Michael Tuexen [Fri, 15 Jan 2016 00:26:15 +0000 (00:26 +0000)]
Fix a bug in INIT handling on accepted 1-to-1 style sockets when the
listener is closed.
This fix allows the following packetdrill test to pass:
// Setup a connected, blocking 1-to-1 style socket
+0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3
// Check the handshake with en empty(!) cookie
+0.0 bind(3, ..., ...) = 0
+0.0 listen(3, 1) = 0
+0.0 < sctp: INIT[flgs=0, tag=1, a_rwnd=1500, os=1, is=1, tsn=1]
+0.0 > sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=..., os=..., is=..., tsn=1, ...]
+0.0 < sctp: COOKIE_ECHO[flgs=0, len=..., val=...]
+0.0 > sctp: COOKIE_ACK[flgs=0]
+0.0 accept(3, ..., ...) = 4
+0.0 close(3) = 0
// Inject an INIT chunk and expect an INIT-ACK
+0.0 < sctp: INIT[flgs=0, tag=3, a_rwnd=1500, os=1, is=1, tsn=1]
+0.0 > sctp: INIT_ACK[flgs=0, tag=..., a_rwnd=..., os=..., is=..., tsn=..., ...]

MFC after: 3 days

8 years agoAdjust VM_MAX_KERNEL_ADDRESS to the max address, not the minimum next.
Justin Hibbits [Thu, 14 Jan 2016 23:22:43 +0000 (23:22 +0000)]
Adjust VM_MAX_KERNEL_ADDRESS to the max address, not the minimum next.

VM_MAX_KERNEL_ADDERESS is the maximum KVA address.  0xf8000000 is the start of
device mapping space.  Since several conditional checks use '<=' against
VM_MAX_KERNEL_ADDRESS, bad things could feasibly happen.

8 years agoFix OpenSSH client information leak.
Gleb Smirnoff [Thu, 14 Jan 2016 22:40:46 +0000 (22:40 +0000)]
Fix OpenSSH client information leak.

Security: SA-16:07.openssh
Security: CVE-2016-0777

8 years agoMake it possible to specify the path to userboot.so with the -b flag.
Juli Mallett [Thu, 14 Jan 2016 22:07:35 +0000 (22:07 +0000)]
Make it possible to specify the path to userboot.so with the -b flag.

Reviewed by: neel

8 years agoAdd rotationrate to geom disk dumpconf
Ravi Pokala [Thu, 14 Jan 2016 21:52:21 +0000 (21:52 +0000)]
Add rotationrate to geom disk dumpconf

Parse and report the nominal rotation rate reported by the drive.

Reviewed by: sbruno, jhb
Approved by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4483
Requested by: Kevin Bowling < kevin.bowling @ kev009.com >

8 years agoRemove unused reg param from fdt_fixup_memory
Steven Hartland [Thu, 14 Jan 2016 21:39:10 +0000 (21:39 +0000)]
Remove unused reg param from fdt_fixup_memory

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoPrevent bogus compiler in ZFS boot code
Steven Hartland [Thu, 14 Jan 2016 21:31:26 +0000 (21:31 +0000)]
Prevent bogus compiler in ZFS boot code

Silence a bogus compiler warning about indexing past the end of dn_bonus.

The ZFS code ensures this is not possible but the compiler can't determine
this so added an additional check to prevent this warning.

Sponsored by: Multiplay

8 years agoRemove aiod_timeout.
John Baldwin [Thu, 14 Jan 2016 21:28:56 +0000 (21:28 +0000)]
Remove aiod_timeout.

It hasn't been used since the AIO code was made MPSAFE 10 years ago.

Reviewed by: kib
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D4946

8 years agoImprovements to the MDXFileChunk() template function:
Jonathan T. Looney [Thu, 14 Jan 2016 21:08:23 +0000 (21:08 +0000)]
Improvements to the MDXFileChunk() template function:
- Remove unneeded fstat()/lseek() calls.
- Return NULL and set errno to EINVAL on negative length.
- Fix small style problems and expand variable names.

After this change, it is possible to use this code for some irregular
files. For example, 'md5 /dev/md0' should now succeed.

Differential Revision: https://reviews.freebsd.org/D4748
Suggested by: bde
Reviewed by: bde, allanjude, delphij

8 years agoRename aiod_bio taskqueue to aiod_kick.
John Baldwin [Thu, 14 Jan 2016 20:51:48 +0000 (20:51 +0000)]
Rename aiod_bio taskqueue to aiod_kick.

This taskqueue is not used to handle bio requests.  It is only used to
run aio_kick_nowait() to spin up new aio daemon processes.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D4904

8 years agoFix order of last two arguments of mtx_init
Oleksandr Tymoshenko [Thu, 14 Jan 2016 20:25:22 +0000 (20:25 +0000)]
Fix order of last two arguments of mtx_init

Spotted by: jmcneill@NetBSD.org

8 years agoFix the handling of the "PDC write transfer length" erratum for at91. The
Ian Lepore [Thu, 14 Jan 2016 19:33:13 +0000 (19:33 +0000)]
Fix the handling of the "PDC write transfer length" erratum for at91.  The
problem affects revision 1xx hardware as well as later versions.  Also, the
recommended workaround is to set the PDC count register for a 12-byte
transfer when the actual size is less than that, but there is no need to
extend or zero-out the data buffer, because the blklen register contains
the real transfer size and only that many bytes will be transferred.

Also add a sysctl to turn debugging printfs on or off on the fly.

8 years agoSet -mlong-calls where needed to get a static clang and lldb 3.8.0
Andrew Turner [Thu, 14 Jan 2016 19:00:13 +0000 (19:00 +0000)]
Set -mlong-calls where needed to get a static clang and lldb 3.8.0
linking. These are too large for a branch instruction to branch from an
earlier point in the code to somewhere later.

This will also allow these to be build with Thumb-2 when we get this
infrastructure.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D4855

8 years agoOnly build EFI components on supported compilers
Steven Hartland [Thu, 14 Jan 2016 18:53:54 +0000 (18:53 +0000)]
Only build EFI components on supported compilers

As the in-tree GCC does not support __attribute__((ms_abi)) EFI can only
be built with Clang.

The EFI loader and boot1 validated this, but unused libefi was still built
causing issues under GCC after warnings where enabled by r293724.

Disable building all of EFI when the selected compiler is GCC.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoRevert r293903
Steven Hartland [Thu, 14 Jan 2016 18:46:57 +0000 (18:46 +0000)]
Revert r293903

Revert r293903 as EFI shouldn't be built on this platform that the this
was reported on.

Sponsored by: Multiplay

8 years agoFix race condition involving ZFS remove events
Alan Somers [Thu, 14 Jan 2016 18:19:05 +0000 (18:19 +0000)]
Fix race condition involving ZFS remove events

When a ZFS drive disappears, ZFS sends a resource.fs.zfs.removed event to
userland. A userland program like zfsd(8) can use that event, for example to
activate a hotspare. The current code contains a race condition: vdev_geom
will sent the sysevent _before_ spa.c would update the vdev's status,
causing userland processes to see pool state that does not reflect the
device removal. This change moves the sysevent to spa.c, closing the race.

Reviewed by: delphij, Sean Eric Fagan
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D4902

8 years agoFix spelling of IPMI
Enji Cooper [Thu, 14 Jan 2016 18:04:49 +0000 (18:04 +0000)]
Fix spelling of IPMI

Sponsored by: EMC / Isilon Storage Division

8 years agoUpdate .Dd, missed in r294011
Benjamin Kaduk [Thu, 14 Jan 2016 17:16:47 +0000 (17:16 +0000)]
Update .Dd, missed in r294011

8 years agoWrap overlong comment lines.
Edward Tomasz Napierala [Thu, 14 Jan 2016 16:55:07 +0000 (16:55 +0000)]
Wrap overlong comment lines.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix the code to retry mount attempt in mountcritlocal if there are
Edward Tomasz Napierala [Thu, 14 Jan 2016 16:53:17 +0000 (16:53 +0000)]
Fix the code to retry mount attempt in mountcritlocal if there are
any root mount holds.  The previous one used a wrong conditional - the
"err=$?" assignment resets "$?" to 0.

Submitted by: jilles@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix panic in IP redirect. Panic was introduced in r293466.
Alexander V. Chernikov [Thu, 14 Jan 2016 16:31:00 +0000 (16:31 +0000)]
Fix panic in IP redirect. Panic was introduced in r293466.

Found by: Yamagi Burmeister <lists at yamagi.org>>

8 years agoDocument how to enter the debugger here. I'm sure there's some better
Warner Losh [Thu, 14 Jan 2016 16:23:07 +0000 (16:23 +0000)]
Document how to enter the debugger here. I'm sure there's some better
canonical place, and the nit-pickers are welcome to move this
information there with a cross reference.

Differential Review: https://reviews.freebsd.org/D4860

8 years agoFix building with GCC since PAGE_MASK is signed on i386.
John Baldwin [Thu, 14 Jan 2016 15:51:13 +0000 (15:51 +0000)]
Fix building with GCC since PAGE_MASK is signed on i386.

Reviewed by: ngie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4772

8 years agoAdjust previous fix to conform to the existing style in this file.
John Baldwin [Thu, 14 Jan 2016 15:49:24 +0000 (15:49 +0000)]
Adjust previous fix to conform to the existing style in this file.

8 years agoMake ng_netflow(9) use new routing KPI.
Alexander V. Chernikov [Thu, 14 Jan 2016 13:14:12 +0000 (13:14 +0000)]
Make ng_netflow(9) use new routing KPI.

Netflow module is supposed to store (along with fields like
  gateway address and interface index) matched netmask for each record.
  This (currently) requires returning individual route entries, instead
  of optimized next-hop structure. Given that, use control-plane
  rib_lookup_info() function to avoid accessing rtentries directly.
While rib_lookup_info() might be slower, than fibX_lookup() flavours,
  it is more scalable than rtalloc1_fib(), because rtentry mutex is
  not acquired.

8 years agoFail the SCTP_GET_ASSOC_NUMBER and SCTP_GET_ASSOC_ID_LIST
Michael Tuexen [Thu, 14 Jan 2016 11:25:28 +0000 (11:25 +0000)]
Fail the SCTP_GET_ASSOC_NUMBER and SCTP_GET_ASSOC_ID_LIST
socket options for 1-to-1 style sockets as specified in RFC 6458.

MFC after: 3 days

8 years agoInstall /etc/snmpd.config with 0600 permissions.
Gleb Smirnoff [Thu, 14 Jan 2016 10:25:18 +0000 (10:25 +0000)]
Install /etc/snmpd.config with 0600 permissions.

Noticed by: Pierre Kim
Security: SA-16:06.snmpd
Pointy hat to: glebius in 2005

8 years agoThere is a bug in tcp_output()'s implementation of the TCP_SIGNATURE
Gleb Smirnoff [Thu, 14 Jan 2016 10:22:45 +0000 (10:22 +0000)]
There is a bug in tcp_output()'s implementation of the TCP_SIGNATURE
(RFC 2385/TCP-MD5) kernel option.

If a tcpcb has TF_NOOPT flag, then tcp_addoptions() is not called,
and to.to_signature is an uninitialized stack variable. The value
is later used as write offset, which leads to writing to random
address.

Submitted by: rstone, jtl
Security: SA-16:05.tcp

8 years agoCall crextend() before copying old credentials to the new credentials
Gleb Smirnoff [Thu, 14 Jan 2016 10:16:25 +0000 (10:16 +0000)]
Call crextend() before copying old credentials to the new credentials
and replace crcopysafe by crcopy as crcopysafe is is not intended to be
safe in a threaded environment, it drops PROC_LOCK() in while() that
can lead to unexpected results, such as overwrite kernel memory.

In my POV crcopysafe() needs special attention. For now I do not see
any problems with this function, but who knows.

Submitted by: dchagin
Found by: trinity
Security: SA-16:04.linux

8 years agoRegen after r293907.
Gleb Smirnoff [Thu, 14 Jan 2016 10:15:21 +0000 (10:15 +0000)]
Regen after r293907.

8 years agoChange linux get_robust_list system call to match actual linux one.
Gleb Smirnoff [Thu, 14 Jan 2016 10:13:58 +0000 (10:13 +0000)]
Change linux get_robust_list system call to match actual linux one.

The set_robust_list system call request the kernel to record the head
of the list of robust futexes owned by the calling thread. The head
argument is the list head to record.
The get_robust_list system call should return the head of the robust
list of the thread whose thread id is specified in pid argument.
The list head should be stored in the location pointed to by head
argument.

In contrast, our implemenattion of get_robust_list system call copies
the known portion of memory pointed by recorded in set_robust_list
system call pointer to the head of the robust list to the location
pointed by head argument.

So, it is possible for a local attacker to read portions of kernel
memory, which may result in a privilege escalation.

Submitted by: mjg
Security: SA-16:03.linux

8 years agoVerify the packet length in sctp6_input().
Gleb Smirnoff [Thu, 14 Jan 2016 10:11:10 +0000 (10:11 +0000)]
Verify the packet length in sctp6_input().

The sctp6_ctlinput() function does not properly check the length of the packet
it receives from the ICMP6 input routine. This means that an attacker can craft
a packet that will cause a kernel panic.

When the kernel receives an ICMP6 error message with one of the types/codes
it handles, it calls icmp6_notify_error() to deliver it to the upper-level
protocol. icmp6_notify_error() cycles through the extension headers (if any)
to find the protocol number of the first non-extension header. It does NOT
verify the length of the non-extension header.

It passes information about the packet (including the actual packet) to the
upper-level protocol's pr_ctlinput function. In the case of SCTP for IPv6,
icmp6_notify_error() calls sctp6_ctlinput().

sctp6_ctlinput() assumes that the incoming packet contains a sufficiently-long
SCTP header and calls m_copydata() to extract a copy of that header. In turn,
m_copydata() assumes that the caller has already verified that the offset and
length parameters are correct. If they are incorrect, it will dereference a
NULL pointer and cause a kernel panic.

In short, no one is sufficiently verifying the input, and the result is a
kernel panic.

Submitted by: jtl
Security: SA-16:01.sctp

8 years agoAllow file specific user-specified flag overrides
Steven Hartland [Thu, 14 Jan 2016 10:09:05 +0000 (10:09 +0000)]
Allow file specific user-specified flag overrides

Allow user-specified warning flag overrides for specific files under
bsd.sys.mk, in the same way kern.mk does.

This will to be used by future commits.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoFix GCC warnings causing build failure after r293724
Steven Hartland [Thu, 14 Jan 2016 09:22:01 +0000 (09:22 +0000)]
Fix GCC warnings causing build failure after r293724

Disable some compiler warnings for GCC (non-standard compiler) fixing
build failures introduced by r293724, which enabled WARNS in the EFI boot
code, when compiling with none standard compiler (GCC).

Raised by: ian
MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agosfxge: cleanup: quieten efx_mcdi_read_resonse_header error reporting
Andrew Rybchenko [Thu, 14 Jan 2016 09:20:25 +0000 (09:20 +0000)]
sfxge: cleanup: quieten efx_mcdi_read_resonse_header error reporting

The "mcdi_err_arg" probe still reports results of failed MCDI
commands, unless the caller invoked efx_mcdi_execute_quiet().

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4919

8 years agosfxge: add accessors for license-related MCDI calls to common code
Andrew Rybchenko [Thu, 14 Jan 2016 09:19:28 +0000 (09:19 +0000)]
sfxge: add accessors for license-related MCDI calls to common code

Add support for Huntington MCDI licensing interface to common code.
Ported from Linux net driver IOCTL functions with restructuring for
initial support for V3 licensing API.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4918

8 years agosfxge: add table entries for License NVRAM partition
Andrew Rybchenko [Thu, 14 Jan 2016 09:14:40 +0000 (09:14 +0000)]
sfxge: add table entries for License NVRAM partition

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4917

8 years agosfxge: cleanup: adjust efx_mcdi_get_port_modes() comment for clarity
Andrew Rybchenko [Thu, 14 Jan 2016 09:12:40 +0000 (09:12 +0000)]
sfxge: cleanup: adjust efx_mcdi_get_port_modes() comment for clarity

Fix an explanatory comment which did not explain very well.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4916

8 years agosfxge: fix common code VPD iterator and duplicate tag verification
Andrew Rybchenko [Thu, 14 Jan 2016 09:11:20 +0000 (09:11 +0000)]
sfxge: fix common code VPD iterator and duplicate tag verification

Fix efx_vpd_hunk_next() which has -- since its inception -- failed to
correctly iterate over the tags and keywords contained in the VPD data.
Only the first tag or keyword would be returned and the next call with
*contp == 1 would walk to the end of the data and finish.

This was spotted when fixing up errors spotted by Prefast code analysis
(which neglected to set all of the out parameters in all successful cases)

Also fix efx_vpd_verify() on Siena and EF10 which (as a side effect of
correctly iterating over all the tags and keywords) was failing as it
detected that both the static VPD and dynamic VPD storage contained an
RV keyword in the VPD-R tag.  This is intentional as the static VPD and
dynamic VPD are stored separately (firmware merges their contents and
computes a new RV keyword checksum for the data readable from the VPD
capability in PCIe configuration space).

Submitted by:   Andrew Lee <alee at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4915

8 years agosfxge: use correct register definitions for setting interrupt moderation on Medford
Andrew Rybchenko [Thu, 14 Jan 2016 09:07:40 +0000 (09:07 +0000)]
sfxge: use correct register definitions for setting interrupt moderation on Medford

The only value which has changed is the number of rows
(ER_DZ_EVQ_TMR_REG_ROWS is 2048 vs 1024 for FR_BZ_TIMER_COMMAND_REGP0_ROWS)
but that isn't used, so this shouldn't change behaviour.

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4913

8 years agosfxge: support FATSOv2 in common code
Andrew Rybchenko [Thu, 14 Jan 2016 09:05:51 +0000 (09:05 +0000)]
sfxge: support FATSOv2 in common code

Sponsored by:   Solarflare Communications, Inc.
Reviewed by:    gnn
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4912

8 years agosfxge: rx_prefix_pktlen methods do not require EFSYS_OPT_RX_SCALE
Andrew Rybchenko [Thu, 14 Jan 2016 09:03:02 +0000 (09:03 +0000)]
sfxge: rx_prefix_pktlen methods do not require EFSYS_OPT_RX_SCALE

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4911

8 years agosfxge: convert nvram size method to use partition id
Andrew Rybchenko [Thu, 14 Jan 2016 09:01:53 +0000 (09:01 +0000)]
sfxge: convert nvram size method to use partition id

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4910

8 years agosfxge: rework MCDI start request
Andrew Rybchenko [Thu, 14 Jan 2016 09:00:35 +0000 (09:00 +0000)]
sfxge: rework MCDI start request

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4909

8 years agosfxge: add Medford NIC methods
Andrew Rybchenko [Thu, 14 Jan 2016 08:59:38 +0000 (08:59 +0000)]
sfxge: add Medford NIC methods

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4908

8 years agoRemove now-unused wrappers for various routing functions.
Alexander V. Chernikov [Thu, 14 Jan 2016 08:54:44 +0000 (08:54 +0000)]
Remove now-unused wrappers for various routing functions.

8 years agoPID file support hasn't been committed for ggated(8) yet. Unbreak running
Enji Cooper [Thu, 14 Jan 2016 07:39:05 +0000 (07:39 +0000)]
PID file support hasn't been committed for ggated(8) yet. Unbreak running
the testcase more than once by restoring the "killall ggated"

MFC after: 15 days
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove an unneeded assignment of the return value.
Ed Schouten [Thu, 14 Jan 2016 07:27:42 +0000 (07:27 +0000)]
Remove an unneeded assignment of the return value.

tdelete() is supposed to return the address of the parent node that has
been deleted. We already keep track of this node in the loop between
lines 94-107. The GO_LEFT()/GO_RIGHT() macros are used later on as well,
so we must make sure not to change it to something else.

8 years agoRemove unnecessary kldload logic added to geom_subr.sh in r293028
Enji Cooper [Thu, 14 Jan 2016 07:27:14 +0000 (07:27 +0000)]
Remove unnecessary kldload logic added to geom_subr.sh in r293028

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoUnbreak `make depend` with sys/modules/hyperv/vmbus after r293870
Enji Cooper [Thu, 14 Jan 2016 05:02:33 +0000 (05:02 +0000)]
Unbreak `make depend` with sys/modules/hyperv/vmbus after r293870

Pointyhat to: sephe

8 years agohyperv: set receive buffer size according to NVSP protocol version
Sepherosa Ziehau [Thu, 14 Jan 2016 03:16:29 +0000 (03:16 +0000)]
hyperv: set receive buffer size according to NVSP protocol version

If the NVSP protocol version is not greater than NVSP_PROTOCOL_VERSION_2,
then the recv buffer size is 15MB, otherwise the buffer size is 16MB.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
Reviewed by: royger, Dexuan Cui <decui microsoft com>, adrian
Approved by: adrian (mentor)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4814

8 years agohyperv: add interrupt counters
Sepherosa Ziehau [Thu, 14 Jan 2016 03:11:35 +0000 (03:11 +0000)]
hyperv: add interrupt counters

Submitted by: Howard Su <howard0su gmail com>
Reviewed by: royger, Dexuan Cui <decui microsoft com>, adrian
Approved by: adrian (mentor)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4693

8 years agohyperv: implement an event timer
Sepherosa Ziehau [Thu, 14 Jan 2016 03:05:10 +0000 (03:05 +0000)]
hyperv: implement an event timer

Submitted by: Howard Su <howard0su@gmail.com>
Reviewed by: delphij, royger, adrian
Approved by: adrian (mentor)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4676

8 years ago[gpiobus] handle the case of there being a single GPIO pin available.
Adrian Chadd [Thu, 14 Jan 2016 02:58:28 +0000 (02:58 +0000)]
[gpiobus] handle the case of there being a single GPIO pin available.

PR: kern/206035
Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agohyperv: remove unused vmbus definitions
Sepherosa Ziehau [Thu, 14 Jan 2016 02:55:28 +0000 (02:55 +0000)]
hyperv: remove unused vmbus definitions

We don't need them at all.

Submitted by: Dexuan Cui <decui microsoft com>
Sponsored by: Microsoft OSTC
Reviewed by: royger, adrian, delphij
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D4595

8 years agohyperv: use x86 generic code to do the hypervisor detection
Sepherosa Ziehau [Thu, 14 Jan 2016 02:50:13 +0000 (02:50 +0000)]
hyperv: use x86 generic code to do the hypervisor detection

This is first step to move the generic part of HV code into kernel instead
of module, so that it is possible to use hypercall to implement some other
paravirtualization code in the kernel.

Submitted by: Howard Su <howard0su@gmail.com>
Reviewed by: royger, delphij, adrian
Approved by: adrian (mentor)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D3072

8 years agohyperv/hn: Unbreak LINT-NOIP
Sepherosa Ziehau [Thu, 14 Jan 2016 02:32:50 +0000 (02:32 +0000)]
hyperv/hn: Unbreak LINT-NOIP

Reported by: bz
Approved by: adrain (mentor)
Sponsored by: Microsoft OSTC

8 years agoDefault to en_US.ISO8859-1 if no locale
Devin Teske [Thu, 14 Jan 2016 01:59:20 +0000 (01:59 +0000)]
Default to en_US.ISO8859-1 if no locale

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

8 years agonumactl: fix CPU affinity when modifying an existing process or thread
Eric van Gyzen [Thu, 14 Jan 2016 01:34:41 +0000 (01:34 +0000)]
numactl: fix CPU affinity when modifying an existing process or thread

numactl was only modifying its own CPU affinity, which is fine
when creating a new process, but not very helpful when modifying
an existing processes.

Reviewed by: adrian
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D4927

8 years ago- Add the 'restrict' type qualifier to match function prototype.
Kevin Lo [Thu, 14 Jan 2016 01:33:16 +0000 (01:33 +0000)]
- Add the 'restrict' type qualifier to match function prototype.
- Remove sys/types.h.

8 years agoSuggest setting gateway_enable="YES" instead of sysctl net.inet.ip.forwarding=1 to...
Kevin Lo [Thu, 14 Jan 2016 01:32:17 +0000 (01:32 +0000)]
Suggest setting gateway_enable="YES" instead of sysctl net.inet.ip.forwarding=1 to enable packet forwarding.

Reviewed by: glebius

8 years agoRemove a dead local variable, missed in r274565.
Mark Johnston [Thu, 14 Jan 2016 00:34:37 +0000 (00:34 +0000)]
Remove a dead local variable, missed in r274565.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

8 years agobsdinstall: Suggest the GPT+Active workaround on Dell T5810
Eric van Gyzen [Thu, 14 Jan 2016 00:31:00 +0000 (00:31 +0000)]
bsdinstall: Suggest the GPT+Active workaround on Dell T5810

The Dell Precision Tower 5810 fails to boot from GPT in Legacy/BIOS mode
without the Active flag in the Protective MBR.  Suggest the workaround
during installation.

Since an increasing number of Dell systems exhibit this behavior,
I imagine all Dells past a certain date will do so.  I would like
to suggest the workaround for all Dells with a BIOS date of, say,
2014 or later, but I would need to test a variety of systems before
committing such a change.

Reviewed by: allanjude, dteske
MFC after: 5 days
Relnotes: We should probably suggest using GPT+Active on "recent" Dells.
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D4075

8 years agolibthr: const-ify two variables
Eric van Gyzen [Wed, 13 Jan 2016 22:34:55 +0000 (22:34 +0000)]
libthr: const-ify two variables

Make the default umutex and urwlock initializers const,
because they can be, and as a microoptimization.

MFC after: 5 days
Sponsored by: Dell Inc.

8 years agoAvoid reading pass the end of the source buffer when it is not NUL
Brooks Davis [Wed, 13 Jan 2016 21:50:08 +0000 (21:50 +0000)]
Avoid reading pass the end of the source buffer when it is not NUL
terminated.

If this buffer is adjacent to an unmapped page or a version of C with
bounds checked is used this may result in a crash.

PR: 206178
Submitted by: Alexander Cherepanov <cherepan@mccme.ru>
MFC after: 1 week

8 years agoAvoid reading pass the end of the source buffer when it is not NUL
Brooks Davis [Wed, 13 Jan 2016 21:49:01 +0000 (21:49 +0000)]
Avoid reading pass the end of the source buffer when it is not NUL
terminated.

If this buffer is adjacent to an unmapped page or a version of C with
bounds checked is used this may result in a crash.

PR: 206177
Submitted by: Alexander Cherepanov <cherepan@mccme.ru>
MFC after: 1 week

8 years agoGiven that em(4), lem(4) and igb(4) hardware doesn't require the
Marius Strobl [Wed, 13 Jan 2016 21:47:27 +0000 (21:47 +0000)]
Given that em(4), lem(4) and igb(4) hardware doesn't require the
alignment guarantees provided by m_defrag(9), use m_collapse(9)
instead for performance reasons.
While at it, sanitize the statistics softc members, i. e. retire
unused ones and add SYSCTL nodes missing for actually used ones.

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

8 years agoAdd support for relocating AArch64 modules to kldxref. This fixes an error
Andrew Turner [Wed, 13 Jan 2016 21:34:15 +0000 (21:34 +0000)]
Add support for relocating AArch64 modules to kldxref. This fixes an error
message where it fails to read the module as the unrelocated addresses
are zero.

Sponsored by: ABT Systems Ltd

8 years agodrm: Revert the part of r288653 about M_WAITOK vs M_NOWAIT
Jean-Sébastien Pédron [Wed, 13 Jan 2016 20:35:02 +0000 (20:35 +0000)]
drm: Revert the part of r288653 about M_WAITOK vs M_NOWAIT

Using M_NOWAIT could lead to transient failures with ioctls.

Suggested by: kib

8 years agodrm/i915: Further reduce the diff with Linux 3.8
Jean-Sébastien Pédron [Wed, 13 Jan 2016 19:52:25 +0000 (19:52 +0000)]
drm/i915: Further reduce the diff with Linux 3.8

There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.

8 years agoRemove dead code when the target processor has POPCNT instruction.
Jung-uk Kim [Wed, 13 Jan 2016 19:19:50 +0000 (19:19 +0000)]
Remove dead code when the target processor has POPCNT instruction.

8 years agoImprove non-interactive forth cmd error reporting
Steven Hartland [Wed, 13 Jan 2016 18:33:12 +0000 (18:33 +0000)]
Improve non-interactive forth cmd error reporting

Non-interactive forth command errors where silent even for critical issues
e.g. failing to load a required kernel module or mfs_root.

This resulted in later unexplained and hard to trace errors such as mount
root failures.

This introduces additional command return codes that are treated
appropriately by the non-interactive command processor (bf_command).
* CMD_CRIT = print error
* CMD_FATAL = panic

Also fix minor style(9) issues with command_load return codes.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoRemove some unneeded headers
Baptiste Daroussin [Wed, 13 Jan 2016 17:59:12 +0000 (17:59 +0000)]
Remove some unneeded headers

8 years agoFix Coverity warnings regarding r293229
Alan Somers [Wed, 13 Jan 2016 17:33:50 +0000 (17:33 +0000)]
Fix Coverity warnings regarding r293229

rpcbind/check_bound.c
Fix CID1347798, a memory leak in mergeaddr.

rpcbind/tests/addrmerge_test.c
Fix CID1347800 through CID1347803, memory leaks in ATF tests.  They
are harmless because each ATF test case runs in its own process, but
they are trivial to fix.  Fix a few other leaks that Coverity didn't
detect, too.

Coverity CID: 13477981347800134780113478021347803
MFC after: 2 weeks
X-MFC-With: 293229
Sponsored by: Spectra Logic Corp

8 years agoRemove the compat code to handle the kernel passing us an unalinged
Andrew Turner [Wed, 13 Jan 2016 15:54:17 +0000 (15:54 +0000)]
Remove the compat code to handle the kernel passing us an unalinged
stackpointer. Userland expects the kernel to pass it an aligned sp and
pass a pointer to the arguments in x0. The kernel side was updated in
r289502, 3 months ago.

Sponsored by: ABT Systems Ltd

8 years agoIncrease efiboot.img size used in ISO creation
Steven Hartland [Wed, 13 Jan 2016 14:47:13 +0000 (14:47 +0000)]
Increase efiboot.img size used in ISO creation

Due to recent and upcoming changes to add additional functionality to
the EFI loader its now bigger than the space allocates for efiboot.img
so increase this in line with boot1.efifat.

MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay

8 years agoFix the spelling of fueword* to eliminate compile warnings about mismatched
Ian Lepore [Wed, 13 Jan 2016 14:39:39 +0000 (14:39 +0000)]
Fix the spelling of fueword* to eliminate compile warnings about mismatched
begin/end symbols when the warning level is turned up.

Submitted by: Steve Kiernan <stevek@juniper.net>

8 years agoRemove RTF_RNH_LOCKED support from rtalloc1_fib().
Alexander V. Chernikov [Wed, 13 Jan 2016 14:32:48 +0000 (14:32 +0000)]
Remove RTF_RNH_LOCKED support from rtalloc1_fib().

Last caller using it was eliminated in r293471.

Sponsored by: Yandex LLC

8 years agoStore the timer type for logging, because the timer can be freed
Michael Tuexen [Wed, 13 Jan 2016 14:28:12 +0000 (14:28 +0000)]
Store the timer type for logging, because the timer can be freed
during processing the timerout.

MFC after: 3 days

8 years agoMake devfs_fpdrop() static. It was not a public KPI, and it has no
Konstantin Belousov [Wed, 13 Jan 2016 14:03:06 +0000 (14:03 +0000)]
Make devfs_fpdrop() static.  It was not a public KPI, and it has no
reason to remain exported for some time.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week