]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoReturn early from bus_dmamap_load callback if the error indicator is set.
jmcneill [Mon, 11 Jul 2016 20:14:50 +0000 (20:14 +0000)]
Return early from bus_dmamap_load callback if the error indicator is set.

Reviewed by: andrew, manu

7 years agoAdd support for arm64. The allwinner_soc_family() function is not available
jmcneill [Mon, 11 Jul 2016 20:13:46 +0000 (20:13 +0000)]
Add support for arm64. The allwinner_soc_family() function is not available
on arm64 and all SoCs using the old FIFO register location are 32-bit only,
so unconditionally use the new location for arm64.

Reviewed by: andrew, manu

7 years agoAdd support for Allwinner A64 CPUx-PORT and CPUs-PORT Port Controllers.
jmcneill [Mon, 11 Jul 2016 20:09:17 +0000 (20:09 +0000)]
Add support for Allwinner A64 CPUx-PORT and CPUs-PORT Port Controllers.

Reviewed by: andrew, manu

7 years agoAdd Allwinner A64 padconf settings.
jmcneill [Mon, 11 Jul 2016 20:06:21 +0000 (20:06 +0000)]
Add Allwinner A64 padconf settings.

Reviewed by: andrew, manu

7 years agoAdd SOC_ALLWINNER_A64 option for Allwinner A64 (sun50i) SoCs.
jmcneill [Mon, 11 Jul 2016 20:05:03 +0000 (20:05 +0000)]
Add SOC_ALLWINNER_A64 option for Allwinner A64 (sun50i) SoCs.

7 years agoInclude sys/rman.h to fix build on arm64.
jmcneill [Mon, 11 Jul 2016 20:03:31 +0000 (20:03 +0000)]
Include sys/rman.h to fix build on arm64.

7 years agoAttach RSB early. Children of RSB may provide resources necessary for
jmcneill [Mon, 11 Jul 2016 20:02:51 +0000 (20:02 +0000)]
Attach RSB early. Children of RSB may provide resources necessary for
other devices such as interrupts, GPIOs, and regulators.

7 years agoBuild fix for arm64. The phy interface uses intptr_t for the "phy"
jmcneill [Mon, 11 Jul 2016 20:00:57 +0000 (20:00 +0000)]
Build fix for arm64. The phy interface uses intptr_t for the "phy"
parameter, not int.

7 years agoRemove unused bus_space prototypes.
jmcneill [Mon, 11 Jul 2016 19:58:00 +0000 (19:58 +0000)]
Remove unused bus_space prototypes.

7 years agoRemove redundant declaration for tcp_dooptions, similar to r302576
ngie [Mon, 11 Jul 2016 17:11:18 +0000 (17:11 +0000)]
Remove redundant declaration for tcp_dooptions, similar to r302576

netinet/tcp_var.h already defines this function

Differential Revision: https://reviews.freebsd.org/D7189
MFC after: 1 week
PR: 209920
Reported by: Mark Millard <markmi@dsl-only.net>
Reviewed by: np
Tested with: clang 3.8.0, gcc 4.2.1, gcc 5.3.0
Sponsored by: EMC / Isilon Storage Division

7 years agoFix grammar.
kib [Mon, 11 Jul 2016 17:04:22 +0000 (17:04 +0000)]
Fix grammar.

Submitted by: alc
MFC after: 2 weeks

7 years agoRemove dead code. This should have been removed in r297392, when these
nwhitehorn [Mon, 11 Jul 2016 17:02:17 +0000 (17:02 +0000)]
Remove dead code. This should have been removed in r297392, when these
files were moved to dev/ofw, but wasn't, apparently due to some version
control issue.

MFC after: 1 week

7 years agoAdd missing default case to capable(..) function definition
ngie [Mon, 11 Jul 2016 17:01:07 +0000 (17:01 +0000)]
Add missing default case to capable(..) function definition

By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN
aren't possible. Add in a KASSERT safety belt and return false in
!INVARIANTS case if an invalid value is passed in, as it would be a
programmer error.

This fixes a -Wreturn-type error with gcc 5.3.0.

Differential Revision: https://reviews.freebsd.org/D7188
MFC after: 1 week
Reported by: devel/amd64-gcc (5.3.0)
Reviewed by: dumbbell
Sponsored by: EMC / Isilon Storage Division

7 years ago(Re-do r302574 with corrected commit message..)
ngie [Mon, 11 Jul 2016 16:56:51 +0000 (16:56 +0000)]
(Re-do r302574 with corrected commit message..)

Remove redundant declaration for tcp_dooptions

netinet/tcp_var.h already defines this function

Differential Revision: https://reviews.freebsd.org/D7187
MFC after: 1 week
PR: 209920
Reported by: Mark Millard <markmi@dsl-only.net>
Reviewed by: np
Tested with: clang 3.8.0, gcc 4.2.1, gcc 5.3.0
Sponsored by: EMC / Isilon Storage Division

7 years agoRevert r302574. I botched the commit message in more way than 1
ngie [Mon, 11 Jul 2016 16:54:19 +0000 (16:54 +0000)]
Revert r302574. I botched the commit message in more way than 1

7 years agoRemove redundant declaration for tcp_dooptions
ngie [Mon, 11 Jul 2016 16:52:04 +0000 (16:52 +0000)]
Remove redundant declaration for tcp_dooptions

netinet/tcp_var.h already defines this function

PR: 209924
Reported by: Mark Millard <markmi@dsl-only.net>
Reviewed by: np
Tested with: clang 3.8.0, gcc 4.2.1, gcc 5.3.0
Sponsored by: EMC / Isilon Storage Division

7 years agoFill tf_trapno for trap frames created for syscall.
kib [Mon, 11 Jul 2016 15:52:52 +0000 (15:52 +0000)]
Fill tf_trapno for trap frames created for syscall.

If tf_trapno contains garbage which appears to be equal to T_NMI,
e.g. due to thread previously entered kernel due to NMI, doreti
sequence skips ast, and does so until a trap or hardware interrupt
occur.

The visible effects of the issue are quite confusing.  First, signals
delivery is postponed in observable ways.  In particular, the
guarantee that unblocked async signals queue is flushed before a
return from syscall, is broken.  Second, if there are pending signals,
all interruptible sleeps of the stuck thread are aborted immediately.

Since modern CPUs are relatively fast and tickless kernel generates
low interrupt rate, the faulty condition might exist for long time (in
an application time scale).

In collaboration with: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove redundant declarations for intel_fbc_enabled(..) and
ngie [Mon, 11 Jul 2016 15:50:06 +0000 (15:50 +0000)]
Remove redundant declarations for intel_fbc_enabled(..) and
i915_gem_dump_object(..) to fix -Wredundant-decls warning

MFC after: 1 week
PR: 209924
Reported by: Mark Millard <markmi@dsl-only.net>
Tested with: devel/amd64-gcc (5.3.0)
Sponsored by: EMC / Isilon Storage Division

7 years agoRemove redundant declaration for radeon_pm_acpi_event_handler(..) to fix
ngie [Mon, 11 Jul 2016 15:47:43 +0000 (15:47 +0000)]
Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix
-Wredundant-decls warning

MFC after: 1 week
PR: 209924
Reported by: Mark Millard <markmi@dsl-only.net>
Tested with: devel/amd64-gcc (5.3.0)
Sponsored by: EMC / Isilon Storage Division

7 years agoIn vgonel(), postpone setting BO_DEAD until VOP_RECLAIM() is called,
kib [Mon, 11 Jul 2016 14:19:09 +0000 (14:19 +0000)]
In vgonel(), postpone setting BO_DEAD until VOP_RECLAIM() is called,
if vnode is VMIO.  For VMIO vnodes, set BO_DEAD in vm_object_terminate().

The vnode_destroy_object(), when calling into vm_object_terminate(),
must be able to flush buffers.  BO_DEAD purpose is to quickly destroy
buffers on write when the underlying vnode is not operable any more
(one example is the devfs node after geom is gone).  Setting BO_DEAD
for reclaiming vnode before object is terminated is premature, and
results in unability to flush buffers with live SU dependencies from
vinvalbuf() in vm_object_terminate().

Reported by: David Cross <dcrosstech@gmail.com>
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoFix the naming of -CURRENT
gjb [Mon, 11 Jul 2016 14:07:24 +0000 (14:07 +0000)]
Fix the naming of -CURRENT

Sponsored by: The FreeBSD Foundation

7 years agor302561 broke buildworld. This patch fixes that.
cy [Mon, 11 Jul 2016 13:41:40 +0000 (13:41 +0000)]
r302561 broke buildworld. This patch fixes that.

MFC after: 3 days
X-MFC with: r302561

7 years agoAdd AUE_WAIT6 handling to the BSM conversion switch statement, reusing
rwatson [Mon, 11 Jul 2016 13:06:17 +0000 (13:06 +0000)]
Add AUE_WAIT6 handling to the BSM conversion switch statement, reusing
the BSM encoding used for AUE_WAIT4.

MFC after: 3 days
Sponsored by: DARPA, AFRL

7 years agoFlush buffer after output. This fixes adding new data to already
ae [Mon, 11 Jul 2016 12:44:58 +0000 (12:44 +0000)]
Flush buffer after output. This fixes adding new data to already
printed flows.

PR: 210882
MFC after: 3 days

7 years agoOFWPCI: Fix style(9).
mmel [Mon, 11 Jul 2016 08:24:04 +0000 (08:24 +0000)]
OFWPCI: Fix style(9).
No functional change.

MFC after: 3 weeks

7 years agohyperv/vmbus: Embed channel detach task in channel itself.
sephe [Mon, 11 Jul 2016 08:12:04 +0000 (08:12 +0000)]
hyperv/vmbus: Embed channel detach task in channel itself.

GC work queue stuffs.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6864

7 years agoDo not truncate lines longer than 512 chars.
gahr [Mon, 11 Jul 2016 08:05:46 +0000 (08:05 +0000)]
Do not truncate lines longer than 512 chars.

PR: 210344
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6881

7 years agohyperv/vmbus: Save vmbus softc to channels.
sephe [Mon, 11 Jul 2016 07:54:58 +0000 (07:54 +0000)]
hyperv/vmbus: Save vmbus softc to channels.

So that we don't need to access the global vmbus softc.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6863

7 years agohyperv/vmbus: Create channel synchronously.
sephe [Mon, 11 Jul 2016 07:45:31 +0000 (07:45 +0000)]
hyperv/vmbus: Create channel synchronously.

The device probe/attach has been move to a different thread, so the
reasons to create the channel asynchronously are no longer valid.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6862

7 years agohyperv/vmbus: Use post message Hypercall APIs for unload
sephe [Mon, 11 Jul 2016 07:28:15 +0000 (07:28 +0000)]
hyperv/vmbus: Use post message Hypercall APIs for unload

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6861

7 years agoDon't test for xpt not being NULL before calling svc_xprt_free(..)
ngie [Mon, 11 Jul 2016 07:24:56 +0000 (07:24 +0000)]
Don't test for xpt not being NULL before calling svc_xprt_free(..)

svc_xprt_alloc(..) will always return initialized memory as it uses
mem_alloc(..) under the covers, which uses malloc(.., M_WAITOK, ..).

MFC after: 1 week
Reported by: Coverity
CID: 1007341
Sponsored by: EMC / Isilon Storage Division

7 years agoConvert `svc_xprt_alloc(..)` and `svc_xprt_free(..)`'s prototypes to
ngie [Mon, 11 Jul 2016 07:17:52 +0000 (07:17 +0000)]
Convert `svc_xprt_alloc(..)` and `svc_xprt_free(..)`'s prototypes to
ANSI C style prototypes

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

7 years agoDeobfuscate cleanup path in clnt_vc_create(..)
ngie [Mon, 11 Jul 2016 07:07:15 +0000 (07:07 +0000)]
Deobfuscate cleanup path in clnt_vc_create(..)

Similar to r300836, r301800, and r302550, cl and ct will always
be non-NULL as they're allocated using the mem_alloc routines,
which always use `malloc(..., M_WAITOK)`.

MFC after: 1 week
Reported by: Coverity
CID: 1007342
Sponsored by: EMC / Isilon Storage Division

7 years agoDeobfuscate cleanup path in clnt_dg_create(..)
ngie [Mon, 11 Jul 2016 06:58:24 +0000 (06:58 +0000)]
Deobfuscate cleanup path in clnt_dg_create(..)

Similar to r300836 and r301800, cl and cu will always be non-NULL as they're
allocated using the mem_alloc routines, which always use
`malloc(..., M_WAITOK)`.

Deobfuscating the cleanup path fixes a leak where if cl was NULL and
cu was not, cu would not be free'd, and also removes a duplicate test for
cl not being NULL.

MFC after: 1 week
Reported by: Coverity
CID: 10070331007344
Sponsored by: EMC / Isilon Storage Division

7 years agohyperv/vmbus: Add sysctl to expose vmbus version.
sephe [Mon, 11 Jul 2016 06:55:02 +0000 (06:55 +0000)]
hyperv/vmbus: Add sysctl to expose vmbus version.

Requested by: Hongxiong Xian <v-hoxian microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6860

7 years agoBelatedly remove CSUM_IP_FRAGS and CSUM_FRAGMENT offloading
yongari [Mon, 11 Jul 2016 06:49:56 +0000 (06:49 +0000)]
Belatedly remove CSUM_IP_FRAGS and CSUM_FRAGMENT offloading
capabilities.  It was removed in r243624 and r254804/r271006
respectively.
This file and mbuf(9) needs updates for other offloading
capabilities(i.e. CSUM_SCTP and CSUM_TSO).

7 years agohyperv/vmbus: Explicitly assign channel message process array.
sephe [Mon, 11 Jul 2016 06:37:04 +0000 (06:37 +0000)]
hyperv/vmbus: Explicitly assign channel message process array.

While I'm here, remove the useless message type from message process
array, which is not used and serves no purposes at all.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6858

7 years agoImplement right shift/ctl, and convert the VNC/xorg scancode
grehan [Mon, 11 Jul 2016 06:31:15 +0000 (06:31 +0000)]
Implement right shift/ctl, and convert the VNC/xorg scancode
of 0xff03 into right-alt.

Reported by: lme@
MFC after: 1 week

7 years agohyperv/vmbus: Function renaming.
sephe [Mon, 11 Jul 2016 06:29:56 +0000 (06:29 +0000)]
hyperv/vmbus: Function renaming.

And pass vmbus_softc to vmbus_doattach()

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6842

7 years agohyperv/hn: Add tunable to allow tcp_lro_queue_mbuf()
sephe [Mon, 11 Jul 2016 06:23:01 +0000 (06:23 +0000)]
hyperv/hn: Add tunable to allow tcp_lro_queue_mbuf()

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6841

7 years agohyperv/vmbus: Use post message Hypercall APIs for channel request
sephe [Mon, 11 Jul 2016 06:11:24 +0000 (06:11 +0000)]
hyperv/vmbus: Use post message Hypercall APIs for channel request

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6831

7 years agoUse _PATH_DEVNULL instead of hardcoding.
delphij [Mon, 11 Jul 2016 05:44:58 +0000 (05:44 +0000)]
Use _PATH_DEVNULL instead of hardcoding.

MFC after: 2 weeks

7 years agohyperv/stor: Fix the INQUIRY checks
sephe [Mon, 11 Jul 2016 05:17:48 +0000 (05:17 +0000)]
hyperv/stor: Fix the INQUIRY checks

Don't check the area that the host has not filled.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209443
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210425
Submitted by: Hongjiang Zhang <honzhan microsoft com>
Reviewed by: sephe, Dexuan Cui <decui microsoft com>
MFC after: 3 days
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6955

7 years agohyperv/vmbus: Implement a new set of APIs for post message Hypercall
sephe [Mon, 11 Jul 2016 04:52:11 +0000 (04:52 +0000)]
hyperv/vmbus: Implement a new set of APIs for post message Hypercall

And use this new APIs for Initial Contact post message Hypercall.
More post message Hypercalls will be converted.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6830

7 years agoDo not allow whitespace in macro names.
araujo [Mon, 11 Jul 2016 03:34:32 +0000 (03:34 +0000)]
Do not allow whitespace in macro names.

Obtained from: OpenBSD (r1.19).

7 years agoAllow - in distribution names. This is needed for freebsd-update to work
delphij [Mon, 11 Jul 2016 03:31:12 +0000 (03:31 +0000)]
Allow - in distribution names.  This is needed for freebsd-update to work
with 11.0+, where the debugging symbols use a new naming scheme for release
distribution files.

Errata candidate.

Approved by: cperciva
Differential Revision: https://reviews.freebsd.org/D7170

7 years agomail(1): Fix a comment.
pfg [Mon, 11 Jul 2016 00:03:39 +0000 (00:03 +0000)]
mail(1): Fix a comment.

Obtained from: NetBSD (CVS Rev 1.29)

7 years agoCorrect OLD_LIBS change done in r298840
ngie [Sun, 10 Jul 2016 20:42:18 +0000 (20:42 +0000)]
Correct OLD_LIBS change done in r298840

libkvm.so lives in /lib, not /usr/lib

MFC after: 3 days
X-MFC note: ^/stable/11 only
X-MFC with: r298840
Submitted by: Herbert J. Skuhra <herbert@mailbox.org>
Sponsored by: EMC / Isilon Storage Division

7 years agoRevert odd change, setting limit registers before base.
mav [Sun, 10 Jul 2016 20:22:04 +0000 (20:22 +0000)]
Revert odd change, setting limit registers before base.

I don't know what errata is mentioned there, I was unable to find it, but
setting limit before the base simply does not work at all.  According to
specification attempt to set limit out of the present window range resets
it to zero, effectively disabling it.  And that is what I see in practice.

Fixing this properly disables access for remote side to our memory until
respective xlat is negotiated and set.  As I see, Linux does the same.

7 years agoFix wrong copy/paste in r302510.
mav [Sun, 10 Jul 2016 19:52:26 +0000 (19:52 +0000)]
Fix wrong copy/paste in r302510.

7 years agoRemove callout_reset(link_work) from ntb_transport_attach().
mav [Sun, 10 Jul 2016 19:15:29 +0000 (19:15 +0000)]
Remove callout_reset(link_work) from ntb_transport_attach().

At that point link is quite likely not established yet, so messing with
scratch registers is premature there.  Original commit message mentioned
code diff reduction from Linux, but this line is not present in Linux now.

7 years agoEXTRES: Add OF node as argument to all <foo>_get_by_ofw_<bar>() functions.
mmel [Sun, 10 Jul 2016 18:28:15 +0000 (18:28 +0000)]
EXTRES: Add OF node as argument to all <foo>_get_by_ofw_<bar>() functions.
In some cases, the driver must handle given properties located in
specific OF subnode. Instead of creating duplicate set of function, add
'node' as argument to existing functions, defaulting it to device OF node.

MFC after: 3 weeks

7 years agoIn process-descriptor close(2) and fstat(2), audit target process
rwatson [Sun, 10 Jul 2016 14:17:36 +0000 (14:17 +0000)]
In process-descriptor close(2) and fstat(2), audit target process
information.  pgkill(2) already audits target process ID.

MFC after: 3 days
Sponsored by: DARPA, AFRL

7 years agoDo allow auditing of read(2) and write(2) system calls, by assigning
rwatson [Sun, 10 Jul 2016 13:42:33 +0000 (13:42 +0000)]
Do allow auditing of read(2) and write(2) system calls, by assigning
those system calls audit event identifiers AUE_READ and AUE_WRITE.
While auditing file-descriptor I/O is not required by the Common
Criteria, in practice this proves useful for both live and forensic
analysis.

NB: freebsd32 already assigns AUE_READ and AUE_WRITE to read(2) and
write(2).

MFC after: 3 days
Sponsored by: DARPA, AFRL

7 years agoWhen mmap(2) is used with a vnode, capture vnode attributes in the
rwatson [Sun, 10 Jul 2016 11:49:10 +0000 (11:49 +0000)]
When mmap(2) is used with a vnode, capture vnode attributes in the
audit trail.  This was not required for Common Criteria auditing
(which requires only that the intent to read or write be audited
at the time of open(2)), but is useful for contemporary live
analysis and forensics.

MFC after: 3 days
Sponsored by: DARPA, AFRL

7 years agoAdd clk_get_by_ofw_node_index, which is like clk_get_by_ofw_index but
jmcneill [Sun, 10 Jul 2016 10:53:50 +0000 (10:53 +0000)]
Add clk_get_by_ofw_node_index, which is like clk_get_by_ofw_index but
operates on a specific OF node instead of the pass in device's OF node.

Reviewed by: andrew, mmel
Differential Revision: https://reviews.freebsd.org/D6957

7 years agoAlign descriptors and data buffers to 32 bits. This restriction is
jmcneill [Sun, 10 Jul 2016 10:38:28 +0000 (10:38 +0000)]
Align descriptors and data buffers to 32 bits. This restriction is
described in the A20 (and later) user manuals.

7 years agoIn the absence of a bus-width property, default to 4-bit bus width instead
jmcneill [Sun, 10 Jul 2016 10:21:22 +0000 (10:21 +0000)]
In the absence of a bus-width property, default to 4-bit bus width instead
of 1-bit.

7 years agoReplace NTB man page with more detailed and up to date.
mav [Sun, 10 Jul 2016 10:17:38 +0000 (10:17 +0000)]
Replace NTB man page with more detailed and up to date.

Sponsored by: iXsystems, Inc.

7 years agoAudit the file-descriptor number argument for openat(2). Remove a comment
rwatson [Sun, 10 Jul 2016 09:50:21 +0000 (09:50 +0000)]
Audit the file-descriptor number argument for openat(2).  Remove a comment
about the desirability of auditing the number, as it was in fact in the
wrong place (in the common path for open(2) and openat(2), and only the
latter accepts a file-descriptor argument).  Where other ABIs support
openat(2), it may be necessary to do additional argument auditing as it is
not performed in kern_openat(9).

MFC after: 3 days
Sponsored by: DARPA, AFRL

7 years agoAdd linux_mmap.c to the appropriate conf/files.
dchagin [Sun, 10 Jul 2016 08:38:10 +0000 (08:38 +0000)]
Add linux_mmap.c to the appropriate conf/files.

Reported by: kib@
MFC after: 1 week

7 years agoFix a copy/paste bug introduced during X86_64 Linuxulator work.
dchagin [Sun, 10 Jul 2016 08:22:04 +0000 (08:22 +0000)]
Fix a copy/paste bug introduced during X86_64 Linuxulator work.
FreeBSD support NX bit on X86_64 processors out of the box, for i386 emulation
use READ_IMPLIES_EXEC flag, introduced in r302515.

While here move common part of mmap() and mprotect() code to the files in compat/linux
to reduce code dupcliation between Linuxulator's.

Reported by:    Johannes Jost Meixner, Shawn Webb

MFC after: 1 week
XMFC with: r302515, r302516

7 years agoRegen for r302215 (Linux personality).
dchagin [Sun, 10 Jul 2016 08:17:16 +0000 (08:17 +0000)]
Regen for r302215 (Linux personality).

7 years agoImplement Linux personality() system call mainly due to READ_IMPLIES_EXEC flag.
dchagin [Sun, 10 Jul 2016 08:15:50 +0000 (08:15 +0000)]
Implement Linux personality() system call mainly due to READ_IMPLIES_EXEC flag.
In Linux if this flag is set, PROT_READ implies PROT_EXEC for mmap().
Linux/i386 set this flag automatically if the binary requires executable stack.

READ_IMPLIES_EXEC flag will be used in the next Linux mmap() commit.

7 years agoAudit file-descriptor arguments to I/O system calls such as
rwatson [Sun, 10 Jul 2016 08:04:02 +0000 (08:04 +0000)]
Audit file-descriptor arguments to I/O system calls such as
read(2), write(2), dup(2), and mmap(2).  This auditing is not
required by the Common Criteria (and hence was not being
performed), but is valuable in both contemporary live analysis
and forensic use cases.

MFC after: 3 days
Sponsored by: DARPA, AFRL

7 years agoRemove broken support for collation in [a-z] type ranges.
ache [Sun, 10 Jul 2016 03:49:38 +0000 (03:49 +0000)]
Remove broken support for collation in [a-z] type ranges.
Only first 256 wide chars are considered currently, all other are just
dropped from the range. Proper implementation require reverse tables
database lookup, since objects are really big as max UTF-8 (1114112
code points), so just the same scanning as it was for 256 chars will
slow things down.

POSIX does not require collation for [a-z] type ranges and does not
prohibit it for non-POSIX locales. POSIX require collation for ranges
only for POSIX (or C) locale which is equal to ASCII and binary for
other chars, so we already have it.

No other *BSD implements collation for [a-z] type ranges.

Restore ABI compatibility with unused now __collate_range_cmp() which
is visible from outside (will be removed later).

7 years agomail(1): Invert calloc(3) argument order.
pfg [Sun, 10 Jul 2016 02:46:20 +0000 (02:46 +0000)]
mail(1): Invert calloc(3) argument order.

calloc(3) is documented to have first a number and then a size.

Obtained from: OpenBSD (through NetBSD)

7 years agoSimplify MSIX MW BAR xlat setup, and don't forget to unlock its limit.
mav [Sun, 10 Jul 2016 01:09:16 +0000 (01:09 +0000)]
Simplify MSIX MW BAR xlat setup, and don't forget to unlock its limit.

The last fixes SB01BASE_LOCKUP workaround after driver reload.

7 years agoFix heap overflow in bhnd(4) SPROM parsing.
landonf [Sun, 10 Jul 2016 00:08:40 +0000 (00:08 +0000)]
Fix heap overflow in bhnd(4) SPROM parsing.

The bus_region_* APIs accept the number of data items to be read, while
the code was passing the total number of bytes, resulting in an overflow
of the SPROM parser's buffer.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7168

7 years agoDisable SB01BASE_LOCKUP workaround when split BARs disabled.
mav [Sat, 9 Jul 2016 23:22:44 +0000 (23:22 +0000)]
Disable SB01BASE_LOCKUP workaround when split BARs disabled.

For some reason hack with sending MSI-X interrupts by writing to remote
LAPIC memory works only for 32-bit BARs, that are available only if split
BARs mode is enabled in BIOS.  If it is not, complain loudly and fall back
to less efficient workaround.

7 years agoAvoid truncating the return value of DTrace predicates.
markj [Sat, 9 Jul 2016 22:41:21 +0000 (22:41 +0000)]
Avoid truncating the return value of DTrace predicates.

Predicates are DIF objects whose return value is compared with zero to
determine whether the corresponding probe body is to be executed. The return
value itself is the contents of a 64-bit DIF register, but it was being
truncated to an int before the comparison. This meant that a predicate such
as /0x100000000/ would evaluate to false.

Reported by: rwatson
MFC after: 3 days

7 years agoRemove HZ=<various> from all armv6 configs, put HZ=1000 in std.armv6.
ian [Sat, 9 Jul 2016 21:14:59 +0000 (21:14 +0000)]
Remove HZ=<various> from all armv6 configs, put HZ=1000 in std.armv6.
All armv6 processors are plenty fast enough for HZ=1000.

No changes are made for older arm systems, because some chips are a bit
wimpy for 1000 while others do fine, so it has to be set on a per-config
basis.

7 years agoConsolidate debugging options from all arm kernel configs to std.arm[v6].
ian [Sat, 9 Jul 2016 20:42:57 +0000 (20:42 +0000)]
Consolidate debugging options from all arm kernel configs to std.arm[v6].

7 years agoAdd emulation for Intel e1000 (e82545) network adapter.
mav [Sat, 9 Jul 2016 20:41:59 +0000 (20:41 +0000)]
Add emulation for Intel e1000 (e82545) network adapter.

The code was successfully tested with FreeBSD, Linux, Solaris and Windows
guests.  This interface is predictably slower (about 2x) then virtio-net,
but it is very helpful for guests not supporting virtio-net by default.

Thanks to Jeremiah Lott and Peter Grehan for doing original heavy lifting.

7 years agoFix ctld(8) to not exit when reloading configuration with invalid
trasz [Sat, 9 Jul 2016 20:01:07 +0000 (20:01 +0000)]
Fix ctld(8) to not exit when reloading configuration with invalid
initiator-portal clause.

MFC after: 3 days

7 years agoCorrect syntax errors that only show up when compiled with INVARIANTS.
ian [Sat, 9 Jul 2016 18:43:15 +0000 (18:43 +0000)]
Correct syntax errors that only show up when compiled with INVARIANTS.

7 years agodd(1): Enable access to SIZE_T_MAX character devices
cem [Sat, 9 Jul 2016 17:11:54 +0000 (17:11 +0000)]
dd(1): Enable access to SIZE_T_MAX character devices

On machines where SIZE_T_MAX exceeds OFF_MAX (signed 64-bit), permit seeking
character devices to negative off_t values.  This enables dd(1) to interact
with kernel KVA in /dev/kmem on amd64, for example.

Sponsored by: EMC / Isilon Storage Division

7 years agoImprove checksum "offload" support.
mav [Sat, 9 Jul 2016 14:59:16 +0000 (14:59 +0000)]
Improve checksum "offload" support.

For compatibility reasons make driver not report any checksum offload by
default, since there is indeed none.  But if administrator knows that
interface is used only for local traffic, he can enable fake checksum
offload manually on both sides to save some CPU cycles, since the data
are already protected by CRC32 of PCIe link.

Sponsored by: iXsystems, Inc.

7 years agoRemove an unneeded call to fdt_get_unit, the return value is unused.
andrew [Sat, 9 Jul 2016 13:27:14 +0000 (13:27 +0000)]
Remove an unneeded call to fdt_get_unit, the return value is unused.

MFC after: 1 month
Sponsored by: ABT Systems Ltd

7 years agopf: Map hook returns onto the correct error values
kp [Sat, 9 Jul 2016 12:17:01 +0000 (12:17 +0000)]
pf: Map hook returns onto the correct error values

pf returns PF_PASS, PF_DROP, ... in the netpfil hooks, but the hook callers
expect to get E<foo> error codes.
Map the returns values. A pass is 0 (everything is OK), anything else means
pf ate the packet, so return EACCES, which tells the stack not to emit an ICMP
error message.

PR: 207598

7 years agoRewrite if_ntb to use modern interface KPIs and features.
mav [Sat, 9 Jul 2016 12:10:08 +0000 (12:10 +0000)]
Rewrite if_ntb to use modern interface KPIs and features.

It includes: link state, if_transmit, buf_ring, multiple queues, bpf, etc.

Sponsored by: iXsystems, Inc.

7 years agoImprove memory allocation errors handling on receive.
mav [Sat, 9 Jul 2016 12:00:04 +0000 (12:00 +0000)]
Improve memory allocation errors handling on receive.

7 years agoSynchronize MTU code with Linux.
mav [Sat, 9 Jul 2016 11:58:59 +0000 (11:58 +0000)]
Synchronize MTU code with Linux.

It is mandatory for transport compatibility.

7 years agoReimplement doorbell register emulation for NTB_SB01BASE_LOCKUP.
mav [Sat, 9 Jul 2016 11:57:21 +0000 (11:57 +0000)]
Reimplement doorbell register emulation for NTB_SB01BASE_LOCKUP.

This allows at least first three doorbells to work very close to normal
hardware, properly signaling events to upper layers without spurious or
lost events.  Doorbells above the first three may still report spurious
events due to lack of reliable information, but they are rarely used.

8 years agoBring some more order into link and qp state handling.
mav [Sat, 9 Jul 2016 11:48:57 +0000 (11:48 +0000)]
Bring some more order into link and qp state handling.

Do not touch scratchpad registers until link is reported up.
Mask and do not handle doorbell events until respective qp is up.

8 years agoSwitch ctx_lock from mutex to rmlock.
mav [Sat, 9 Jul 2016 11:47:52 +0000 (11:47 +0000)]
Switch ctx_lock from mutex to rmlock.

It is odd idea to serialize different MSI-X vectors.  Use of rmlocks
here allows them to execute in parallel, but still protects ctx.
If upper layers require any additional serialization -- they can
do it by themselves.

8 years agoCreate separate RX taskqueue for each qp.
mav [Sat, 9 Jul 2016 11:46:32 +0000 (11:46 +0000)]
Create separate RX taskqueue for each qp.

8 years agoRemove rx_completion_task taskqueue.
mav [Sat, 9 Jul 2016 11:45:18 +0000 (11:45 +0000)]
Remove rx_completion_task taskqueue.

It is not needed after RX lock removed in previous commit.

8 years agoRemove unneeded RX lock, and make TX lock per-qp.
mav [Sat, 9 Jul 2016 11:43:51 +0000 (11:43 +0000)]
Remove unneeded RX lock, and make TX lock per-qp.

8 years agoReduce code divergence from Linux, preparing for DMA support.
mav [Sat, 9 Jul 2016 11:40:59 +0000 (11:40 +0000)]
Reduce code divergence from Linux, preparing for DMA support.

8 years agoFix operation with multiple qps.
mav [Sat, 9 Jul 2016 11:36:09 +0000 (11:36 +0000)]
Fix operation with multiple qps.

8 years agoAdd myself (tcberner) as ports committer, and update mentor/mentee relationships.
tcberner [Sat, 9 Jul 2016 11:22:11 +0000 (11:22 +0000)]
Add myself (tcberner) as ports committer, and update mentor/mentee relationships.

Approved by: rakuco (mentor)

8 years agoNewBus'ify NTB subsystem.
mav [Sat, 9 Jul 2016 11:20:42 +0000 (11:20 +0000)]
NewBus'ify NTB subsystem.

This follows NTB subsystem modularization in Linux, tuning it to FreeBSD
native NewBus interfaces.  This change allows to support different types
of hardware with different drivers, support multiple NTB instances in a
system, ntb_transport module use for needs other then if_ntb, etc.

Sponsored by: iXsystems, Inc.

8 years agoRemove some dead code found by Clang static analyzer.
mav [Sat, 9 Jul 2016 09:47:11 +0000 (09:47 +0000)]
Remove some dead code found by Clang static analyzer.

8 years agoFix NTB_SDOORBELL_LOCKUP workaround.
mav [Sat, 9 Jul 2016 09:34:24 +0000 (09:34 +0000)]
Fix NTB_SDOORBELL_LOCKUP workaround.

Since SBARxSZ register can be write-once, it can be unusable for disabling
the SBAR.  For such case also set SBARxBASE to zero to not intersect with
config BAR.

8 years agoRevert the change from errx/strerror to errc to appease gcc 4.2
bapt [Sat, 9 Jul 2016 06:52:55 +0000 (06:52 +0000)]
Revert the change from errx/strerror to errc to appease gcc 4.2

8 years agoAdd -P to pathchk usage
eadler [Sat, 9 Jul 2016 04:56:28 +0000 (04:56 +0000)]
Add -P to pathchk usage

8 years agong_mppc(4):: basic readability cleanups.
pfg [Sat, 9 Jul 2016 02:33:45 +0000 (02:33 +0000)]
ng_mppc(4):: basic readability cleanups.

In particular use __unreachable() to appease static analyzers.
No functional change.

CID: 1356591
MFC after: 3 days

8 years agolibunwind: limit stack usage in unwind cursor
emaste [Sat, 9 Jul 2016 00:35:20 +0000 (00:35 +0000)]
libunwind: limit stack usage in unwind cursor

This may be reworked upstream but in the interim should address the
stack usage issue reported in the PR.

PR: 206384
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoOn FreeBSD there is a setsockopt option SO_USER_COOKIE which allows
gnn [Fri, 8 Jul 2016 23:44:09 +0000 (23:44 +0000)]
On FreeBSD there is a setsockopt option SO_USER_COOKIE which allows
setting a 32 bit value on each socket. This can be used by applications
and DTrace as a rendezvous point so that an applicaton's data can
more easily be captured at run time. Expose the user cookie via
DTrace by updating the translator in tcp.d and add a quick test
program, a TCP server, that sets the cookie on each connection
accepted.

Reviewed by: hiren
MFC after: 1 week
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D7152