]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoFilemon: Fix panic when fork1() is called from kproc_create().
bdrewery [Tue, 16 Feb 2016 02:14:25 +0000 (02:14 +0000)]
Filemon: Fix panic when fork1() is called from kproc_create().

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

8 years agoRemove the need for overriding depend.
bdrewery [Tue, 16 Feb 2016 02:14:21 +0000 (02:14 +0000)]
Remove the need for overriding depend.

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd missing dependency on sys/conf/newvers.sh.
bdrewery [Tue, 16 Feb 2016 02:14:18 +0000 (02:14 +0000)]
Add missing dependency on sys/conf/newvers.sh.

Sponsored by: EMC / Isilon Storage Division

8 years agoAdd an .ORDER for all/install.
bdrewery [Tue, 16 Feb 2016 02:14:15 +0000 (02:14 +0000)]
Add an .ORDER for all/install.

Sponsored by: EMC / Isilon Storage Division

8 years agoUse built-in :tA here rather than realpath(1).
bdrewery [Tue, 16 Feb 2016 02:14:12 +0000 (02:14 +0000)]
Use built-in :tA here rather than realpath(1).

Sponsored by: EMC / Isilon Storage Division

8 years agoDon't descend into test directories for distribution->installconfig.
bdrewery [Tue, 16 Feb 2016 02:14:09 +0000 (02:14 +0000)]
Don't descend into test directories for distribution->installconfig.

Sponsored by: EMC / Isilon Storage Division

8 years agoTest directories can build in parallel fine.
bdrewery [Tue, 16 Feb 2016 02:13:59 +0000 (02:13 +0000)]
Test directories can build in parallel fine.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix a panic bug that cropped up in the PTE rewrite.
jhibbits [Tue, 16 Feb 2016 02:13:55 +0000 (02:13 +0000)]
Fix a panic bug that cropped up in the PTE rewrite.

PTE was getting overwritten by just the flags.

Pointy-hat to: jhibbits

8 years agoConsolidate common beforebuild logic.
bdrewery [Tue, 16 Feb 2016 02:09:48 +0000 (02:09 +0000)]
Consolidate common beforebuild logic.

Sponsored by: EMC / Isilon Storage Division

8 years agofputs: Return the number of bytes written.
pfg [Mon, 15 Feb 2016 21:18:52 +0000 (21:18 +0000)]
fputs: Return the number of bytes written.

Fix r295631: wrong value.

Pointy hat: pfg (me)
Pointed out by: bde

8 years agoCorrect the ABI name for Linux/i386 binaries under FreeBSD/i386.
jhb [Mon, 15 Feb 2016 20:27:16 +0000 (20:27 +0000)]
Correct the ABI name for Linux/i386 binaries under FreeBSD/i386.

This allows truss to work for these binaries again after r288424.

MFC after: 3 days

8 years agoSign extend the error value for failing Linux/i386 system calls. This
jhb [Mon, 15 Feb 2016 20:26:40 +0000 (20:26 +0000)]
Sign extend the error value for failing Linux/i386 system calls.  This
restores the mapping of Linux errors to native FreeBSD errno values after
the refactoring in r288424.

8 years agoAdd support for the Allwinner DMA controller. This will be used by the at
andrew [Mon, 15 Feb 2016 19:56:35 +0000 (19:56 +0000)]
Add support for the Allwinner DMA controller. This will be used by the at
least the audio codec driver currently in review.

Submitted by: Jared McNeill <jmcneill@invisible.ca>
Differential Revision: https://reviews.freebsd.org/D5050

8 years agoAdd support for the AXP209 Power System Management IC. This allows boards
andrew [Mon, 15 Feb 2016 19:31:23 +0000 (19:31 +0000)]
Add support for the AXP209 Power System Management IC. This allows boards
with this and an Allwinner SoC to power off.

Submitted by: Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision: https://reviews.freebsd.org/D4954

8 years agoSet sc->clkfreq removed in r295470
andrew [Mon, 15 Feb 2016 19:14:24 +0000 (19:14 +0000)]
Set sc->clkfreq removed in r295470

Reported by: Jared McNeill <jmcneill@invisible.ca>
Pointy-hat to: andrew

8 years agogetln: We cannot expand the buffer beyond INT_MAX.
pfg [Mon, 15 Feb 2016 18:14:21 +0000 (18:14 +0000)]
getln: We cannot expand the buffer beyond INT_MAX.

In such cases return ENOMEM. This is a limitation of our
implementation, alternatively you may consider getline(3).

Differential Revision: https://reviews.freebsd.org/D442 (Partial)
Obtained from: Apple Inc. (Libc 997.90.3)
Relnotes: yes

8 years agofputs: Return the number of bytes written.
pfg [Mon, 15 Feb 2016 18:13:33 +0000 (18:13 +0000)]
fputs: Return the number of bytes written.

POSIX.1-2008 requires that successful completion simply return a
non-negative integer. We have regularly returned a constant value.
Another, equally valid, implementation convention implies returning
the number of bytes written.

Adopt this last convention to be in line with what Apple's libc
does. POSIX also explicitly notes:

Note that this implementation convention cannot be adhered to for strings
longer than {INT_MAX} bytes as the value would not be representable in the
return type of the function. For backwards-compatibility, implementations
can return the number of bytes for strings of up to {INT_MAX} bytes, and
return {INT_MAX} for all longer strings.

Developers shouldn't depend specifically on either convention but
the change may help port software from Apple.

Differential Revision:  https://reviews.freebsd.org/D442 (Partial)
Obtained from:  Apple Inc. (Libc 997.90.3 with changes)
Relnotes: yes

8 years agoFix the spelling of OF_getencprop. It will fix the data correctly for the
andrew [Mon, 15 Feb 2016 17:14:10 +0000 (17:14 +0000)]
Fix the spelling of OF_getencprop. It will fix the data correctly for the
endian of the CPU so there is no need to call fdt32_to_cpu.

Sponsored by: ABT Systems Ltd

8 years agoRemove an unused FDT header, fdt_common.h should only be needed in a few
andrew [Mon, 15 Feb 2016 17:05:03 +0000 (17:05 +0000)]
Remove an unused FDT header, fdt_common.h should only be needed in a few
places, mostly in sys/dev/fdt and legacy code.

Sponsored by: ABT Systems Ltd

8 years agoRemove an unused static inline function.
andrew [Mon, 15 Feb 2016 16:55:44 +0000 (16:55 +0000)]
Remove an unused static inline function.

Sponsored by: ABT Systems Ltd

8 years agoInitial OMAP4 WUGEN pass-through driver. SPI interrupts are passed
skra [Mon, 15 Feb 2016 15:28:56 +0000 (15:28 +0000)]
Initial OMAP4 WUGEN pass-through driver. SPI interrupts are passed
through WUGEN to GIC. Hardware initialization is left in state after
reset as well as before.

This is needed after an update of Linux dts files.

8 years agoAdd support for the Allwinner i2c device. This is similar to the existing
andrew [Mon, 15 Feb 2016 15:11:26 +0000 (15:11 +0000)]
Add support for the Allwinner i2c device. This is similar to the existing
Marvell twsi part, however uses different register locations, as such split
the existing driver into Marvell and Allwinner attachments.

While here clean a few style issues.

Submitted by: Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision: https://reviews.freebsd.org/D4846

8 years agoAllow MIPS INTRNG code to be built without FDT support.
adrian [Mon, 15 Feb 2016 14:34:35 +0000 (14:34 +0000)]
Allow MIPS INTRNG code to be built without FDT support.

This patch allows the newly imported INTRNG code to be built without necessarily
having FDT support in the kernel.  This may be useful for some MIPS platforms
that wish to move to INTRNG, but not to FDT at the same time.

Basically all the code is already within ifdef's where FDT is concerned,
it's just the headers that aren't.

Submitted by: Stanislav Galabov <sgalabov@gmail.com>
Differential Revision: https://reviews.freebsd.org/D5249

8 years agoMove the twsi driver source to be under iicbus. It is in a separate
andrew [Sun, 14 Feb 2016 23:51:13 +0000 (23:51 +0000)]
Move the twsi driver source to be under iicbus. It is in a separate
directory as it is expected multiple attachments will be added for the SoC
families that use this hardware.

Sponsored by: ABT Systems Ltd

8 years agoCreate the twsi device option in preparation to move the driver to a common
andrew [Sun, 14 Feb 2016 23:42:07 +0000 (23:42 +0000)]
Create the twsi device option in preparation to move the driver to a common
location. The device is also found in Allwinner SoCs.

Sponsored by: ABT Systems Ltd

8 years agoNTB: workaround for high traffic hardware hang
cem [Sun, 14 Feb 2016 22:37:28 +0000 (22:37 +0000)]
NTB: workaround for high traffic hardware hang

This patch comes from Dave Jiang's Linux tree, davejiang/ntb.  It hasn't
been accepted into Linus' tree, so I do not have an authoritative SHA1
to point at.  Original commit log:

=====================================================================
A hardware errata causes the NTB to hang when heavy bi-directional
traffic in addition to the usage of BAR0/1 (where the registers reside,
including the doorbell registers to trigger interrupts).

This workaround is only available on Haswell and Broadwell platform.
The workaround is to enable split BAR in the BIOS to allow the 64bit
BAR4 to be split into two 32bit BAR4 and BAR5. The BAR4 shall be pointed
to LAPIC region of the remote host. We will bypass the db mechanism and
directly trigger the MSIX interrupts. The offsets and vectors are
exchanged during transport scratch pad negotiation. The scratch pads are
now overloaded in order to allow the exchange of the information. This
gets around using the doorbell and prevents the lockup with additional
pcode changes in BIOS.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
=====================================================================

Notable changes in the FreeBSD version of this patch:
* The MSIX BAR is configurable, like hw.ntb.b2b_mw_idx (msix_mw_idx).
  The Linux version of the patch only uses BAR4.
* MSIX negotiation aborts if the link goes down.

Obtained from: Linux (Dual BSD/GPL driver)
Sponsored by: EMC / Isilon Storage Division

8 years agoext2fs: Remove panics for rename() race conditions.
pfg [Sun, 14 Feb 2016 19:52:50 +0000 (19:52 +0000)]
ext2fs: Remove panics for rename() race conditions.

Sync with r84642 from UFS:

The panics are inappropriate because the IN_RENAME flag only fixes a
few of the huge number of race conditions that can result in the
source path becoming invalid even prior to the VOP_RENAME() call.

Found accidentally while checking an issue from PVS Static Analysis.

MFC after: 3 days

8 years agoRemove an unused include.
andrew [Sun, 14 Feb 2016 16:38:32 +0000 (16:38 +0000)]
Remove an unused include.

8 years agoRestore maximum number of host keys to 64.
hselasky [Sun, 14 Feb 2016 16:18:39 +0000 (16:18 +0000)]
Restore maximum number of host keys to 64.

Discussed with: adrian @ and avos @

8 years agoFix a bug that caused nothing to be skipped when skipping exactly the
kevlo [Sun, 14 Feb 2016 14:23:56 +0000 (14:23 +0000)]
Fix a bug that caused nothing to be skipped when skipping exactly the
number of bytes present in a regular file was requested.

Obtained from: OpenBSD

8 years agoDon't dereference a pointer immediately after determining that it is
cperciva [Sun, 14 Feb 2016 13:42:16 +0000 (13:42 +0000)]
Don't dereference a pointer immediately after determining that it is
equal to NULL. [1]

While I'm here, s/xb/xbd/ (the name changed a long time ago but this
instance wasn't corrected).

Reported by: PVS-Studio [1]

8 years agoFix variable assignment inside if-clause in the smsc driver.
hselasky [Sun, 14 Feb 2016 07:20:07 +0000 (07:20 +0000)]
Fix variable assignment inside if-clause in the smsc driver.
Found by D5245 / PVS.

MFC after: 1 week

8 years agoReduce the number of supported WLAN keys in the rum driver, else we
hselasky [Sun, 14 Feb 2016 07:16:36 +0000 (07:16 +0000)]
Reduce the number of supported WLAN keys in the rum driver, else we
risk bit shifting overflows. Found by D5245 / PVS.

MFC after: 1 week

8 years agohyperv/hn: Fix typo in comment
sephe [Sun, 14 Feb 2016 02:28:59 +0000 (02:28 +0000)]
hyperv/hn: Fix typo in comment

Noticed by: avos
Reviewed by: adrian, avos, Hongjiang Zhang <honzhan microsoft com>
Approved by: adrian
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5199

8 years agoioat(4): On error detected in ithread, defer HW reset to taskqueue
cem [Sat, 13 Feb 2016 22:51:25 +0000 (22:51 +0000)]
ioat(4): On error detected in ithread, defer HW reset to taskqueue

The I/OAT HW reset process may sleep, so it is invalid to perform a
channel reset from the software interrupt thread.

Sponsored by: EMC / Isilon Storage Division

8 years agoioat(4): Also check for errors if the channel is suspended
cem [Sat, 13 Feb 2016 22:51:17 +0000 (22:51 +0000)]
ioat(4): Also check for errors if the channel is suspended

Sponsored by: EMC / Isilon Storage Division

8 years agoioat(4): Decode/define more capabilities, operations
cem [Sat, 13 Feb 2016 19:01:56 +0000 (19:01 +0000)]
ioat(4): Decode/define more capabilities, operations

These are defined in the Intel Haswell EDS volume 2 (registers) (507849
v2.1).

Sponsored by: EMC / Isilon Storage Division

8 years agoHide ucontext_t and mcontext_t when neither POSIX nor XSI features are
kib [Sat, 13 Feb 2016 17:23:55 +0000 (17:23 +0000)]
Hide ucontext_t and mcontext_t when neither POSIX nor XSI features are
enabled in the compilation environment, i.e. for ANSI C use of
#include <signal.h>.

Requested and reviewed by: bde
Sponsored by: The FreeBSD Foundation
MFC after: 13 days

8 years agoioat(4): Recheck status register on zero-descriptor wakeups
cem [Sat, 13 Feb 2016 02:55:45 +0000 (02:55 +0000)]
ioat(4): Recheck status register on zero-descriptor wakeups

Errors that halt the channel don't necessarily result in a completion
update, apparently.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix missing description for command usage
dteske [Sat, 13 Feb 2016 00:28:48 +0000 (00:28 +0000)]
Fix missing description for command usage

While "jng" or "jib" without arguments told you what each sub-command does,
sub-command usage didn't tell you (e.g., "jng bridge" or "jib addm" gave
only usage and not description).

8 years agocd9660: More "check for NULL" cleaunps.
pfg [Fri, 12 Feb 2016 22:46:14 +0000 (22:46 +0000)]
cd9660: More "check for NULL" cleaunps.

Cleanup some checks for NULL. Most of these were always unnecessary and
starting with r294954 brelse() doesn't need any NULL checks at all.

For now keep the checks somewhat consistent with NetBSD in case we want to
merge the cleanups to older versions.

8 years agoAdd a missing newline to a log message.
markj [Fri, 12 Feb 2016 21:17:00 +0000 (21:17 +0000)]
Add a missing newline to a log message.

MFC after: 1 week

8 years agoRename the flags field of struct nd_defrouter to "raflags".
markj [Fri, 12 Feb 2016 21:15:57 +0000 (21:15 +0000)]
Rename the flags field of struct nd_defrouter to "raflags".

This field contains the flags inherited from the corresponding router
advertisement message and is not for storing private state.

MFC after: 1 week

8 years agoelfcopy: enable PE and EFI support
emaste [Fri, 12 Feb 2016 21:15:31 +0000 (21:15 +0000)]
elfcopy: enable PE and EFI support

Sponsored by: The FreeBSD Foundation

8 years agoAdd libpe for elfcopy(1) PE/COFF support
emaste [Fri, 12 Feb 2016 21:12:47 +0000 (21:12 +0000)]
Add libpe for elfcopy(1) PE/COFF support

Sponsored by: The FreeBSD Foundation

8 years agoSimplify defrtrlist_update() slightly in preparation for future changes.
markj [Fri, 12 Feb 2016 21:06:48 +0000 (21:06 +0000)]
Simplify defrtrlist_update() slightly in preparation for future changes.

No functional change intended.

MFC after: 1 week

8 years agoRemove a bogus comment from nd6_na_input().
markj [Fri, 12 Feb 2016 21:01:53 +0000 (21:01 +0000)]
Remove a bogus comment from nd6_na_input().

The splnet() call that it refers to has been removed, and a lock for the
default router list is in fact needed.

MFC after: 1 week

8 years agoRemove superfluous return statements from the neighbour discovery code.
markj [Fri, 12 Feb 2016 20:55:22 +0000 (20:55 +0000)]
Remove superfluous return statements from the neighbour discovery code.

MFC after: 1 week

8 years agoUpdate ELF Tool Chain to upstream rev 3400
emaste [Fri, 12 Feb 2016 20:54:02 +0000 (20:54 +0000)]
Update ELF Tool Chain to upstream rev 3400

Some notable improvements include:

readelf:
- Add AArch64 relocation definitions.
- Report value of unknown relocation types.

elfcopy:
- Consider symbols with STB_GNU_UNIQUE binding as global symbols.
- Fixed support for VMA adjustment for loadable sections found
  in relocatable objects.
- Handle nameless global symbols.
- Improve wildcard matching for !-prefixed symbols.
- Add PE/COFF support.

elfdump:
- Improve section type reporting.
- Add MIPS-specific section types.

This update also includes a significant number of bug fixes.

PR: 207091 [exp-run]
Sponsored by: The FreeBSD Foundation

8 years agoFix style around allocations from M_IP6NDP.
markj [Fri, 12 Feb 2016 20:52:53 +0000 (20:52 +0000)]
Fix style around allocations from M_IP6NDP.

- Don't cast the return value of malloc(9).
- Use M_ZERO instead of explicitly calling bzero(9).

MFC after: 1 week

8 years agoRemove some unreferenced NDP debug variable definitions.
markj [Fri, 12 Feb 2016 20:46:53 +0000 (20:46 +0000)]
Remove some unreferenced NDP debug variable definitions.

MFC after: 1 week

8 years agoClear the cookie pointer on error in tmpfs_readdir().
markj [Fri, 12 Feb 2016 20:43:53 +0000 (20:43 +0000)]
Clear the cookie pointer on error in tmpfs_readdir().

It is otherwise left dangling, and callers that request cookies always free
the cookie buffer, even when VOP_READDIR(9) returns an error. This results
in a double free if tmpfs_readdir() returns an error to the NFS server or
the Linux getdents(2) emulation code.

Reported by: pho
MFC after: 1 week
Security: double free of malloc(9)-backed memory
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove duplicate definition (CPL_TRACE_PKT_T5).
np [Fri, 12 Feb 2016 20:14:03 +0000 (20:14 +0000)]
Remove duplicate definition (CPL_TRACE_PKT_T5).

8 years agoDocument the new jail_reverse_stop parameter
feld [Fri, 12 Feb 2016 17:55:06 +0000 (17:55 +0000)]
Document the new jail_reverse_stop parameter

While here clean up the documentation for jail_list

PR: 196152
Approved by: jamie, wblock
MFC after: 1 week, with r295471
Differential Revision: https://reviews.freebsd.org/D5243

8 years agoStop adding an extra null terminator to strings, OF_getprop already returns
andrew [Fri, 12 Feb 2016 17:04:03 +0000 (17:04 +0000)]
Stop adding an extra null terminator to strings, OF_getprop already returns
a null terminated string.

8 years agoUpdate .Dd for r295565
bjk [Fri, 12 Feb 2016 17:03:24 +0000 (17:03 +0000)]
Update .Dd for r295565

8 years agoClarify the difference between 7- and 8-bit i2c addresses, used in FDT
ian [Fri, 12 Feb 2016 16:59:42 +0000 (16:59 +0000)]
Clarify the difference between 7- and 8-bit i2c addresses, used in FDT
versus hints-based configuration, respectively.

Reported by: Jukka Ukkonen <jau789@gmail.com>

8 years agoUse __uint64_t type for floating point registers
br [Fri, 12 Feb 2016 14:29:14 +0000 (14:29 +0000)]
Use __uint64_t type for floating point registers
as compiler don't know about __uint128_t yet.

Discussed with: theraven, kib

8 years agoOnly update curthread and curpcb after we have finished using the old
andrew [Fri, 12 Feb 2016 12:38:04 +0000 (12:38 +0000)]
Only update curthread and curpcb after we have finished using the old
values.

If switching from a thread that used floating-point registers to a thread
that is still running, but holding the blocked_lock lock we would switch
the curthread to the new (running) thread, then call critical_enter. This
will non-atomically increment td_critnest, and later call critical_exit to
non-atomically decrement this value.

This can happen at the same time as the new thread is still running on the
old core, also calling these functions. In this case there will be a race
between these non-atomic operations. This can be an issue as we could loose
one of these operations leading to the value to not return to zero.

If, later on, we then hit a data abort we check if the td_critnest is zero.
If this check fails we will panic the kernel.

This has been observed when running pcmstat on a Cavium ThunderX. The pcm
thread will use the blocked_lock lock and there is a high chance userspace
will use the floating-point registers. When, later on, pmcstat triggers a
data abort we will hit this panic.

The fix is to update these values after storing the floating-point state.
This means we use the correct curthread while storing the state so it will
not be an issue that the changes to td_critnest are non-atomic.

Sponsored by: ABT Systems Ltd

8 years agoDon't check CmdSN for initial login request.
mav [Fri, 12 Feb 2016 10:58:13 +0000 (10:58 +0000)]
Don't check CmdSN for initial login request.

This fixes connection errors for some initiators not starting CmdSN
from zero.

While there, fix wrong status details reported for couple errors.

MFC after: 3 days

8 years agoPOSIX states that #include <signal.h> shall make both mcontext_t and
kib [Fri, 12 Feb 2016 07:38:19 +0000 (07:38 +0000)]
POSIX states that #include <signal.h> shall make both mcontext_t and
ucontext_t available.  Our code even has XXX comment about this.

Add a bit of compliance by moving struct __ucontext definition into
sys/_ucontext.h and including it into signal.h and sys/ucontext.h.

Several machine/ucontext.h headers were changed to use namespace-safe
types (like uint64_t->__uint64_t) to not depend on sys/types.h.
struct __stack_t from sys/signal.h is made always visible in private
namespace to satisfy sys/_ucontext.h requirements.

Apparently mips _types.h pollutes global namespace with f_register_t
type definition.  This commit does not try to fix the issue.

PR: 207079
Reported and tested by: Ting-Wei Lan <lantw44@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoIf full width writes to the performance monitoring counters are
kib [Fri, 12 Feb 2016 07:27:24 +0000 (07:27 +0000)]
If full width writes to the performance monitoring counters are
supported, use full-width aliases MSRs for writes.  This fixes the
"[pmc,X] negative increment" assertion on the context switch when
clipped counter value is sign-extended.

Add definitions for the MSR IA32_PERF_CAPABILITIES needed to detect
the feature.

PR: 207068
Submitted by: joss.upton@yahoo.com
MFC after: 2 weeks

8 years agoAdjust the size of PMC_DEFAULT_DEBUG_FLAGS to match the size of the
kib [Fri, 12 Feb 2016 07:20:27 +0000 (07:20 +0000)]
Adjust the size of PMC_DEFAULT_DEBUG_FLAGS to match the size of the
structure.

PR: 207068
Submitted by: joss.upton@yahoo.com
MFC after: 2 weeks

8 years agoRemove tautological cast.
kib [Fri, 12 Feb 2016 07:19:59 +0000 (07:19 +0000)]
Remove tautological cast.

PR: 207068
Submitted by: joss.upton@yahoo.com
MFC after: 2 weeks

8 years agoUART: Fix spurious interrupts generated by ns8250 and lpc drivers:
mmel [Fri, 12 Feb 2016 05:14:58 +0000 (05:14 +0000)]
UART: Fix spurious interrupts generated by ns8250 and lpc drivers:
 - don't enable transmitter empty interrupt before filling TX FIFO.
 - add missing uart_barrier() call in interrupt service routine

8 years agoComments and fix small bug
dteske [Fri, 12 Feb 2016 02:53:44 +0000 (02:53 +0000)]
Comments and fix small bug

Reduce differences between jib/jng and fix a bug that would prevent
additional interfaces from being created if the first of many already
existed (counter wasn't incremented before calling only continue).

8 years agoInterpret vnet_interface/vnet.interface as array
dteske [Fri, 12 Feb 2016 02:50:36 +0000 (02:50 +0000)]
Interpret vnet_interface/vnet.interface as array

8 years agoAdd syntax to disable MAC allocation
dteske [Fri, 12 Feb 2016 01:41:40 +0000 (01:41 +0000)]
Add syntax to disable MAC allocation

Adding `!' before an interface name will disable MAC allocation, falling
back to driver mechanics. Alternatively adding `=' before an interface name
causes the MAC address to be cloned (for ng_bridge(4) back-end only). While
here, disable the auto-detection of wlan* since this knocks the host off;
requiring the host that defines the jail to explicitly enable this feature
by preceding the interface with `='.

8 years agoRefactor conversion to hex
dteske [Fri, 12 Feb 2016 01:12:44 +0000 (01:12 +0000)]
Refactor conversion to hex

8 years agoLoopback addresses are 127.0.0.0/8, not 127.0.0.1/32.
tuexen [Thu, 11 Feb 2016 22:29:39 +0000 (22:29 +0000)]
Loopback addresses are 127.0.0.0/8, not 127.0.0.1/32.

MFC after: 1 week

8 years agoAdd support for bridging iwn(4) based wlan(4)
dteske [Thu, 11 Feb 2016 22:10:54 +0000 (22:10 +0000)]
Add support for bridging iwn(4) based wlan(4)

Documented in iwn(4), "Only one virtual interface may be configured at any
time." However, netgraph with a cloned MAC address is able to communicate
over an ng_eiface attached to an ng_bridge linked to the wlan(4) interface.
While here, introduce syntax to specify the MAC address is to be cloned if
the named interface begins with equals [=].

8 years agoo Gather all mbuf(9) allocation functions into kern_mbuf.c, and all
glebius [Thu, 11 Feb 2016 21:32:23 +0000 (21:32 +0000)]
o Gather all mbuf(9) allocation functions into kern_mbuf.c, and all
  mbuf(9) manipulation functions into uipc_mbuf.c.  This looks like
  the initial intent, but had diffused in the last decade.

o Gather all declarations in mbuf.h in one place and sort them.

o Uninline m_clget() and m_cljget().

There are no functional changes in this patch.

The patch comes from a larger version, where all mbuf(9) allocation was
uninlined, which allowed to make mbuf(9) UMA zones private to kern_mbuf.c.
The performance impact of the total uninlining is still unclear, so we
are holding on now with larger version.

Together with: melifaro, olivier

8 years agoCentralize MAC derivation formula
dteske [Thu, 11 Feb 2016 21:28:34 +0000 (21:28 +0000)]
Centralize MAC derivation formula

8 years agoAdd example VIMAGE config required by vnet jails
dteske [Thu, 11 Feb 2016 18:37:02 +0000 (18:37 +0000)]
Add example VIMAGE config required by vnet jails

8 years agoUse 4 spaces instead of a tab.
tuexen [Thu, 11 Feb 2016 18:35:46 +0000 (18:35 +0000)]
Use 4 spaces instead of a tab.

8 years agoEnable ARM_INTRNG on all kernel configs where we use the Generic Interrupt
andrew [Thu, 11 Feb 2016 18:01:10 +0000 (18:01 +0000)]
Enable ARM_INTRNG on all kernel configs where we use the Generic Interrupt
Controller.

Sponsored by: ABT Systems Ltd

8 years agoFix double-free error: r289419 moved all error handling in http_connect()
des [Thu, 11 Feb 2016 17:48:15 +0000 (17:48 +0000)]
Fix double-free error: r289419 moved all error handling in http_connect()
to the end of the function, but did not remove a fetch_close() call which
was made redundant by the one in the shared error-handling code.

PR: 206774
Submitted by: Christian Heckendorf <heckendorfc@gmail.com>
MFC after: 3 days

8 years agoUse the new insecure-lan-zones option instead of listing each AS112 zone
des [Thu, 11 Feb 2016 17:37:02 +0000 (17:37 +0000)]
Use the new insecure-lan-zones option instead of listing each AS112 zone
separately.

MFC after: 3 days

8 years agoRemove unbound-contrl-setup since we use a local control socket which
des [Thu, 11 Feb 2016 17:33:55 +0000 (17:33 +0000)]
Remove unbound-contrl-setup since we use a local control socket which
does not require keys.

MFC after: 3 days
Relnotes: yes

8 years agonvme: avoid duplicate SET_NUM_QUEUES commands
jimharris [Thu, 11 Feb 2016 17:32:41 +0000 (17:32 +0000)]
nvme: avoid duplicate SET_NUM_QUEUES commands

nvme(4) issues a SET_NUM_QUEUES command during device
initialization to ensure enough I/O queues exists for each
of the MSI-X vectors we have allocated.  The SET_NUM_QUEUES
command is then issued again during nvme_ctrlr_start(), to
ensure that is properly set after any controller reset.

At least one NVMe drive exists which fails this second
SET_NUM_QUEUES command during device initialization.  So
change nvme_ctrlr_start() to only issue its SET_NUM_QUEUES
command when it is coming out of a reset - avoiding the
duplicate SET_NUM_QUEUES during device initialization.

Reported by: gallatin
MFC after: 3 days
Sponsored by: Intel

8 years agoApply upstream r3619, r3620, r3621: add insecure-lan-zone option
des [Thu, 11 Feb 2016 17:25:12 +0000 (17:25 +0000)]
Apply upstream r3619, r3620, r3621: add insecure-lan-zone option

8 years agoMerge SVN r295220 (bz) from projects/vnet/
dteske [Thu, 11 Feb 2016 17:07:19 +0000 (17:07 +0000)]
Merge SVN r295220 (bz) from projects/vnet/

Fix a panic that occurs when a vnet interface is unavailable at the time the
vnet jail referencing said interface is stopped.

Sponsored by: FIS Global, Inc.

8 years agoInclude the correct header to get a phandle_t needed by ofw_bus_if.h. While
andrew [Thu, 11 Feb 2016 16:43:23 +0000 (16:43 +0000)]
Include the correct header to get a phandle_t needed by ofw_bus_if.h. While
here only include opt_platform.h once.

Sponsored by: ABT Systems Ltd

8 years agoExt4: Use boolean type instead of '0' and '1'
pfg [Thu, 11 Feb 2016 15:27:14 +0000 (15:27 +0000)]
Ext4: Use boolean type instead of '0' and '1'

There are precedents of uses of bool in the kernel and
it is incorrect style to use integers as replacement for
a boolean type.

8 years agoExplain that boot1.efi prefers ZFS over UFS
emaste [Thu, 11 Feb 2016 14:45:18 +0000 (14:45 +0000)]
Explain that boot1.efi prefers ZFS over UFS

Reported by: smh

8 years agoo Move non-generic kernel configuration out from GENERIC.
br [Thu, 11 Feb 2016 13:28:52 +0000 (13:28 +0000)]
o Move non-generic kernel configuration out from GENERIC.
o Add kernel configuration for QEMU.

Both SPIKE and QEMU kernel configs are temporary (until
we will be able to obtain DTB from loader).

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoMigrate the PTE format for book-e to standardize on the 'indirect PTE' format
jhibbits [Thu, 11 Feb 2016 13:15:37 +0000 (13:15 +0000)]
Migrate the PTE format for book-e to standardize on the 'indirect PTE' format

Summary:
The revised Book-E spec, adding the specification for the MMUv2 and e6500,
includes a hardware PTE layout for indirect page tables.  In order to support
this in the future, migrate the PTE format to match the MMUv2 hardware PTE
format.

Test Plan: Boot tested on a P5020 board.  Booted to multiuser mode.

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

8 years agoSupport interrupts binding in GICv3 and ITS
zbb [Thu, 11 Feb 2016 12:04:58 +0000 (12:04 +0000)]
Support interrupts binding in GICv3 and ITS

- Add MOVI command and routine for the LPI migration
- Allow to search for the ITS device descriptor using
  not only devID but also LPI number.
- Bind SPIs in the Distributor
- Don't bind its_dev to collection. Keep track of the collection
  IDs for each LPI.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5231

8 years agoImplement finer locking in ITS
zbb [Thu, 11 Feb 2016 12:03:11 +0000 (12:03 +0000)]
Implement finer locking in ITS

- Change locks' names to be more suitable
- Don't use blocking mutex. Lock only basic operations such
  as lists or bitmaps modifications.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5230

8 years agoInitially bind all interrupts to the boot CPU when using GICv3
zbb [Thu, 11 Feb 2016 12:01:33 +0000 (12:01 +0000)]
Initially bind all interrupts to the boot CPU when using GICv3

This should be done by routing all interrupts to CPU0,
different assignment will be induced by either interrupts
shuffling or bus_bind_intr().

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5229

8 years agoCall pmc_hook() correctly in the ARM64 interrupt handler
zbb [Thu, 11 Feb 2016 11:59:32 +0000 (11:59 +0000)]
Call pmc_hook() correctly in the ARM64 interrupt handler

pmc_hook() was called only in case of the stray interrupt but should
rather be called on each interrupt. Move in to the arm_cpu_intr()
handler, out of the critical section too.

Reviewed by:   br
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5161

8 years agoIntroduce bus_bind_intr method for ARM64
zbb [Thu, 11 Feb 2016 11:58:27 +0000 (11:58 +0000)]
Introduce bus_bind_intr method for ARM64

It can be used to bind specific interrupt to a particular CPU.
Requires PIC support for interrupts binding.

Reviewed by:   wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5122

8 years agoFix bugs in interrupts allocation on ARM64
zbb [Thu, 11 Feb 2016 11:57:13 +0000 (11:57 +0000)]
Fix bugs in interrupts allocation on ARM64

Separate interrupt descriptors lookup from allocation. It was possible
to perform config on non-existing interrupt simply by allocating spurious
descriptor.
Must lock the interrupt descriptors table lookup to avoid mismatches.
This ought to prevent trouble while setting up new interrupt
and dispatching existing one.
Use spin mutex rather than sleep mutex. This is mainly due to lock in
arm_dispatch_intr.
This should be eventually changed to a lock-less solution without
walking through a linked list on each interrupt.

Reviewed by:   andrew, wma
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5121

8 years agoxen-netfront: remove useless NULL check in netif_free
royger [Thu, 11 Feb 2016 11:57:12 +0000 (11:57 +0000)]
xen-netfront: remove useless NULL check in netif_free

xn_ifp is allocated in create_netdev with if_alloc(IFT_ETHER).
According to the current arrangement it can't be NULL.

Coverity ID: 1349805
Submitted by: Wei Liu <wei.liu2@citrix.com>
Reviewed by: royger
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D5252

8 years agoMinor clean-ups for ARM64 GICv3 and GIC drivers
zbb [Thu, 11 Feb 2016 11:55:37 +0000 (11:55 +0000)]
Minor clean-ups for ARM64 GICv3 and GIC drivers

GICv3:
- move ICC_SGI1R_EL1 definitions to armreg.h and use proper system
  register's names
GIC:
- remove unused functions

Reviewed by:   andrew
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5119

8 years agoxen-netfront: rearrange error paths in setup_txqs
royger [Thu, 11 Feb 2016 11:53:32 +0000 (11:53 +0000)]
xen-netfront: rearrange error paths in setup_txqs

Coverity spotted double free errors in error path. Fix that by
removing the extraneous calls.

Coverity ID: 1349798
Submitted by: Wei Liu <wei.liu2@citrix.com>
Reviewed by: royger
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D5251

8 years agoxen-netfront: remove pointless assignment in xn_ioctl
royger [Thu, 11 Feb 2016 11:50:31 +0000 (11:50 +0000)]
xen-netfront: remove pointless assignment in xn_ioctl

The variable error is assigned to 0 before entering the switch.
Assigning error to 0 before break pointless rewrites the real error
value that should be returned.

Coverity ID: 1304974
Submitted by: Wei Liu <wei.liu2@citrix.com>
Reviewed by: royger
Sponsored by: Citrix Systems R&D
Differential revision: https://reviews.freebsd.org/D5250

8 years agoStop defining fdt_pic_table when building for ARM_INTRNG.
andrew [Thu, 11 Feb 2016 11:49:27 +0000 (11:49 +0000)]
Stop defining fdt_pic_table when building for ARM_INTRNG.

8 years agoStop device enumeration when we see first empty slot.
br [Thu, 11 Feb 2016 11:21:45 +0000 (11:21 +0000)]
Stop device enumeration when we see first empty slot.
This fixes operation in QEMU and saves some booting time as well.

Pointed out by: Sagar Karandikar <skarandikar@berkeley.edu>
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoRemove unused Zedboard config files. files.zedboard was empty other than
andrew [Thu, 11 Feb 2016 10:48:15 +0000 (10:48 +0000)]
Remove unused Zedboard config files. files.zedboard was empty other than
comments, and std.zedboard just pointed to files.zedboard and std.xilinx.