]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoEnforce -lpthread and -lc to always be the 2 last components of the link list
bapt [Sat, 22 Nov 2014 12:48:09 +0000 (12:48 +0000)]
Enforce -lpthread and -lc to always be the 2 last components of the link list

Differential Revision: https://reviews.freebsd.org/D1118
Suggested by: kib

9 years agoFix the following -Werror warnings from clang 3.5.0, while building
dim [Sat, 22 Nov 2014 12:13:05 +0000 (12:13 +0000)]
Fix the following -Werror warnings from clang 3.5.0, while building
usr.bin/locate:

usr.bin/locate/locate/util.c:249:29: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                            MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
                                                 ^
usr.bin/locate/locate/util.c:249:29: note: remove the call to 'abs' since unsigned values cannot be negative
                            MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
                                                 ^~~
usr.bin/locate/locate/util.c:274:32: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                            MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
                                                    ^
usr.bin/locate/locate/util.c:274:32: note: remove the call to 'abs' since unsigned values cannot be negative
                            MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
                                                    ^~~

The problem is that ntohl() always returns an unsigned quantity.  In
this case, it's expected to be cast back to a signed integer, but to
stop complaints about abs() we just store it into an integer, and don't
call ntohl() again.

Reviewed by: ngie
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D1196

9 years agoFix the following -Werror warning from clang 3.5.0, while building
dim [Sat, 22 Nov 2014 12:10:09 +0000 (12:10 +0000)]
Fix the following -Werror warning from clang 3.5.0, while building
usr.bin/cpio on amd64 (or any arch with 64-bit time_t):

contrib/libarchive/cpio/cpio.c:1143:6: error: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
        if (abs(mtime - now) > (365/2)*86400)
            ^
contrib/libarchive/cpio/cpio.c:1143:6: note: use function 'labs' instead
        if (abs(mtime - now) > (365/2)*86400)
            ^~~
            labs
1 error generated.

This is because time_t is a long on amd64. To avoid the warning, just
copy the equivalent test from a few lines before, which is used in the
Windows case, and which is type safe.

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D1198

9 years agoFix use-after-free introduced in r274843.
mav [Sat, 22 Nov 2014 09:45:32 +0000 (09:45 +0000)]
Fix use-after-free introduced in r274843.

I've missed that iscsi_outstanding_remove() frees the second pointer,
so it should no longer be used.  And in fact we don't really need to.

MFC after: 2 weeks

9 years agoMove icl_pdu_get_data() and xpt_done() out of initiator's session lock.
mav [Sat, 22 Nov 2014 09:05:54 +0000 (09:05 +0000)]
Move icl_pdu_get_data() and xpt_done() out of initiator's session lock.

During heavy reads data copying in icl_pdu_get_data() may consume large
percent of CPU time.  Moving it out of the lock significantly reduces
lock hold time and respectively lock congestion on read operations.

MFC after: 2 weeks

9 years agoUse correct length mask for split transactions. The hardware would
hselasky [Sat, 22 Nov 2014 08:47:04 +0000 (08:47 +0000)]
Use correct length mask for split transactions. The hardware would
sometimes put non-zero values in the upper length bits, which are
available for high-speed-only USB transactions, breaking the reception
of data.

9 years agoRemove examples of gif_interfaces and gifconfig. These have already been
hrs [Sat, 22 Nov 2014 08:09:26 +0000 (08:09 +0000)]
Remove examples of gif_interfaces and gifconfig.  These have already been
marked as deprecated in rc.conf(5) manual page but these examples
were still here.

Spotted by: jmg

9 years agoMake iSCSI frontend less chatty while waiting for tasks termination.
mav [Sat, 22 Nov 2014 04:40:24 +0000 (04:40 +0000)]
Make iSCSI frontend less chatty while waiting for tasks termination.

MFC after: 1 week

9 years agoWhen doing a PREREAD sync of an mbuf-type dma buffer, do a writeback of
ian [Sat, 22 Nov 2014 03:03:11 +0000 (03:03 +0000)]
When doing a PREREAD sync of an mbuf-type dma buffer, do a writeback of
the first cacheline if the buffer start address is not on a cacheline
boundary.  Normally a buffer which is not cacheline-aligned is bounced,
but a special rule applies for mbufs, which are always misaligned due to
the header.  We know the cpu will not write to the header while dma is in
progress (so we've been told anyway), but it may have written to the
header shortly before starting a read, so we need to flush that write out
to memory before invalidating the whole buffer.

In collaboration with Mical Meloun and Svata Kraus.

9 years agoRevert accidently message Makefile from 274836 and connect soeliminate(1)
bapt [Sat, 22 Nov 2014 01:27:45 +0000 (01:27 +0000)]
Revert accidently message Makefile from 274836 and connect soeliminate(1)

9 years agoAdd a new soeliminate(1) command
bapt [Sat, 22 Nov 2014 01:22:03 +0000 (01:22 +0000)]
Add a new soeliminate(1) command

mandoc(1) does not provide an equivalent of the GNU groff's soelim(1) as an
external binary. It does provide the funcitonnality but internally.

Lots if manpages in ports uses ".so" directives to include the content of
another manpage, which works properly if the manpages are not compressed.
With compressed manpages it will fail. So we need to preprocess those manpages
with soelim(1) before compressing them.

soeliminate(1) add the minimum functionnality from soelim(1) required for that
task, in order to still be able to prepare properly those manpages in case we
ship the base system only with mandoc as a manpage renderer.

soeliminate(1) accept all the arguments from soelim(1) for compatibility but
only '-I dir' is really functionnal.

Name it soeliminate and not soelim, so groff from base or ports can still call
soelim(1) for its internal use and avoid potential incompatibilities

MFC after: 1 month

9 years agoUse the correct variable name.
davide [Sat, 22 Nov 2014 00:42:30 +0000 (00:42 +0000)]
Use the correct variable name.

9 years agoMake ufs_dirhashreclaimperc a percentage for real and
davide [Sat, 22 Nov 2014 00:37:37 +0000 (00:37 +0000)]
Make ufs_dirhashreclaimperc a percentage for real and
rename it to ufs_dirhashreclaimpercent, as suggested
by jhb@. As an added bonus this avoids divide-by-zero
errors.

Requested by: jhb, markj
Reviewied by: jhb, markj

9 years agoSort -K option before -k rather than at the top.
imp [Fri, 21 Nov 2014 23:04:12 +0000 (23:04 +0000)]
Sort -K option before -k rather than at the top.

MFC after: 1 week

9 years agoMerge from CheriBSD:
brooks [Fri, 21 Nov 2014 21:34:19 +0000 (21:34 +0000)]
Merge from CheriBSD:

commit 6d3c4c09226ad6bdd662e3e52489ef294a6ce298
    Add terasic_mtl vt(4) framebuffer driver

    terasic_mtl can be built with syscons(4) and vt(4) attachments, selected
    at compile time.

commit 33240259b47a7c990a5a88a19f133a5600432a4c
    Clear terasic_mtl text buffer on attach

commit d188c2d2412953f949624aa35cd07082830943c9
    Update terasic vt(4) driver for FreeBSD r269783

commit d1cc54eee852fa4fc9d359d5bb2171d24ec73369
    Safety belt to ensure vt(4) fb parameters are correct

commit 76e6d468ef45711d7952786095fc4791289ebb4b
    Improve terasic_mtl_vt fdt parsing

    - Use OF_getencprop to avoid need for explicit endian handling
      (submitted by ray@freebsd.org)
    - Check for expected length and correct pointer type

commit 3e2524b8995ab66e8a9295e4c87cbc7126eeddf4
    Correct device_printf usage

commit 9e53e3c8e0766414e25662c95b09cc51c92443b0
    Switch framebuffer to match host endianness

    Xorg and xf86-video-scfb work much better with a native-endian
    framebuffer.

commit 0f49259d596321ed85288ac0e1fb4ee1c966df48
    Switch DE4 to vt(4) and enable kbdmux

commit 5bc96ebc89db7d134ad478335090c8477c1677c7
    Add missing \n in device_printf calls

Submitted by: emaste
Sponsored by: DARPA, AFRL

9 years agoDocument the recent enhancements for configuring bus speed in iicbus(4).
ian [Fri, 21 Nov 2014 21:30:08 +0000 (21:30 +0000)]
Document the recent enhancements for configuring bus speed in iicbus(4).

Differential Revision:        https://reviews.freebsd.org/D1182
PR: 195009

9 years agoMerge from CheriBSD:
brooks [Fri, 21 Nov 2014 21:14:05 +0000 (21:14 +0000)]
Merge from CheriBSD:

commit d0c7d235c09fc65dbdb278e7016a96f79c6a49cc
    Make the Altera JTAG UART device driver slightly more forgiving of
    the foibles of a sub-par hrdware interface by increasing the timeout
    for spotting JTAG polling from one to two seconds.

commit 19ed45a18832560dab967c179d83b71081c3a220
    Update comment.

commit 8edfe803f033cc8e33229f99894c2b7496a44d5f
    Add a comment about a device-driver race condition that could cause the BERI
    pipeline to wedge awaiting JTAG in the event that both the low-level console
    and the tty layer decide to write to the JTAG FIFO just before JTAG is
    disconnected.  Resolving this race is a bit tricky as it looks like there
    isn't a way to 'give the character back' to the tty layer when we discover
    the race.  The easy fix is to drop the character, which we don't yet do, but
    perhaps should as that is a better outcome than wedging the pipeline.

commit 2ea26cf579c9defcf31e413e7c9b0fbc159237fc
    Add a comment about an inherent race with hardware in the Altera JTAG
    UART's low-level console code.

Submitted by: rwatson
MFC after: 1 week
Sponsored by: DARPA, AFRL

9 years agoMerge from CheriBSD (2e28d2a3090239b30481f35dc452ad95a5c57389)
brooks [Fri, 21 Nov 2014 21:10:02 +0000 (21:10 +0000)]
Merge from CheriBSD (2e28d2a3090239b30481f35dc452ad95a5c57389)

Remove initalized, but unused devname variable

MFC after: 1 week
Sponsored by: DARPA, AFRL

9 years agoPrevent overflow issues in timeout processing
smh [Fri, 21 Nov 2014 21:01:24 +0000 (21:01 +0000)]
Prevent overflow issues in timeout processing

Previously, any timeout value for which (timeout * hz) will overflow the
signed integer, will give weird results, since callout(9) routines will
convert negative values of ticks to '1'. For unsigned integer overflow we
will get sufficiently smaller timeout values than expected.

Switch from callout_reset, which requires conversion to int based ticks
to callout_reset_sbt to avoid this.

Also correct isci to correctly resolve ccb timeout.

This was based on the original work done by Eygene Ryabinkin
<rea@freebsd.org> back in 5 Aug 2011 which used a macro to help avoid
the overlow.

Differential Revision: https://reviews.freebsd.org/D1157
Reviewed by: mav, davide
MFC after: 1 month
Sponsored by: Multiplay

9 years agoMerge from CheriBSD (3422ebe71b6c06fe78b1be73623b240c219e08e3):
brooks [Fri, 21 Nov 2014 20:54:12 +0000 (20:54 +0000)]
Merge from CheriBSD (3422ebe71b6c06fe78b1be73623b240c219e08e3):

Rename beripic to beripic0.

MFC after: 1 week
Sponsored by: DARPA, AFRL

9 years agoImprove support for XSAVE with debuggers.
jhb [Fri, 21 Nov 2014 20:53:17 +0000 (20:53 +0000)]
Improve support for XSAVE with debuggers.
- Dump an NT_X86_XSTATE note if XSAVE is in use. This note is designed
  to match what Linux does in that 1) it dumps the entire XSAVE area
  including the fxsave state, and 2) it stashes a copy of the current
  xsave mask in the unused padding between the fxsave state and the
  xstate header at the same location used by Linux.
- Teach readelf() to recognize NT_X86_XSTATE notes.
- Change PT_GET/SETXSTATE to take the entire XSAVE state instead of
  only the extra portion. This avoids having to always make two
  ptrace() calls to get or set the full XSAVE state.
- Add a PT_GET_XSTATE_INFO which returns the length of the current
  XSTATE save area (so the size of the buffer needed for PT_GETXSTATE)
  and the current XSAVE mask (%xcr0).

Differential Revision: https://reviews.freebsd.org/D1193
Reviewed by: kib
MFC after: 2 weeks

9 years agoAdd FPU support for MIPS setjmp(3)/longjmp(3).
brooks [Fri, 21 Nov 2014 20:02:06 +0000 (20:02 +0000)]
Add FPU support for MIPS setjmp(3)/longjmp(3).

This change saves/restores the callee-saved MIPS floating point
registers as documented by the o32/n32/n64 spec ("MIPSpro N32
ABI Handbook", Table 2-1) for the _setjmp(3), _longjmp(3),
setjmp(3) and longjmp(3) C library functions.  This is only
included when the C library is built with hardware floating point
support (or when "SOFTFLOAT" is not defined).

Submitted by: sson
MFC after: 1 month
Sponsored by: DARPA, AFRL

9 years agoSlightly alter the handling of LOCAL_LIB_DIRS to skip addition of
brooks [Fri, 21 Nov 2014 18:35:48 +0000 (18:35 +0000)]
Slightly alter the handling of LOCAL_LIB_DIRS to skip addition of
directories in LOCAL_LIB_DIRS if they are subdirectories of directories
listed in LOCAL_DIRS.  This allows a hierarchy like:

foo
foo/lib
foo/usr.bin
foo/usr.sbin

to be supported with LOCAL_DIRS=foo LOCAL_DIRS=foo/lib.

MFC after: 1 week
Sponsored by: DARPA, AFRL

9 years agoAdd a guard against attempting to invoke the buildenv target with -j# as
brooks [Fri, 21 Nov 2014 18:18:37 +0000 (18:18 +0000)]
Add a guard against attempting to invoke the buildenv target with -j# as
that silently exits rather than doing something useful.

MFC after: 1 week
Sponsored by: DARPA, AFRL

9 years agoMake cfiscsi_offline() synchronous, waiting for connections termination
mav [Fri, 21 Nov 2014 18:05:02 +0000 (18:05 +0000)]
Make cfiscsi_offline() synchronous, waiting for connections termination
before return.  This should make ctld restart more clean and predictable.

MFC after: 2 weeks

9 years agoIn conf_apply() remove iSCSI ports from kernel before removing LUNs.
mav [Fri, 21 Nov 2014 18:00:00 +0000 (18:00 +0000)]
In conf_apply() remove iSCSI ports from kernel before removing LUNs.

Previous order confused initiators with messages about "removed" LUNs
during simple ctld restart without any real config change.  After this
commit initiators only reestablish lost connection, receive "Power on
occurred" UNIT ATTENTION status and continue normal operation.

MFC after: 1 month

9 years agoCreate a vimage.9 link to vnet.9
rodrigc [Fri, 21 Nov 2014 17:57:37 +0000 (17:57 +0000)]
Create a vimage.9 link to vnet.9

Requested by: glebius

9 years agoMake MLINKS text match text in bsd.man.mk added by wosch@ in 1996.
rodrigc [Fri, 21 Nov 2014 17:55:38 +0000 (17:55 +0000)]
Make MLINKS text match text in bsd.man.mk added by wosch@ in 1996.

9 years agoFix error handling.
trasz [Fri, 21 Nov 2014 16:14:32 +0000 (16:14 +0000)]
Fix error handling.

MFC after: 1 month
Coverity CID: 1249768
Sponsored by: The FreeBSD Foundation

9 years agoDocument use of wildcards (*) and ampersands (&) in autofs map files.
trasz [Fri, 21 Nov 2014 15:49:41 +0000 (15:49 +0000)]
Document use of wildcards (*) and ampersands (&) in autofs map files.

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

9 years agoClose race between cfiscsi_offline() and new connection arrival.
mav [Fri, 21 Nov 2014 15:38:31 +0000 (15:38 +0000)]
Close race between cfiscsi_offline() and new connection arrival.

Incoming connection should be either rejected or accepted and terminated.

9 years agoSimply remove the tmp dir before creating the symlink. We are doing
n_hibma [Fri, 21 Nov 2014 14:53:42 +0000 (14:53 +0000)]
Simply remove the tmp dir before creating the symlink. We are doing
chroots all over the place, so there is bound to be a stale file lying
around in there (in my case samba lock files from creating accounts). If
we don't do that, the symlink later will fail.

9 years agoAdd missing error checking for kernel_port_{add,remove}(). Both can fail
trasz [Fri, 21 Nov 2014 12:35:18 +0000 (12:35 +0000)]
Add missing error checking for kernel_port_{add,remove}().  Both can fail
for reasons yet unknown; don't make it increment cumulated_error as a kind
of temporary workaround.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoRemove bunch of unused lun variables.
mav [Fri, 21 Nov 2014 11:21:39 +0000 (11:21 +0000)]
Remove bunch of unused lun variables.

MFC after: 1 week

9 years agoReduce race between LUN destruction and request arrival.
mav [Fri, 21 Nov 2014 11:20:24 +0000 (11:20 +0000)]
Reduce race between LUN destruction and request arrival.

MFC after: 1 week

9 years agoFix build for certain MIPS kernels hiding an unused variable under #ifndef.
bz [Fri, 21 Nov 2014 10:47:29 +0000 (10:47 +0000)]
Fix build for certain MIPS kernels hiding an unused variable under #ifndef.

9 years agoLog errors for absent LUNs too.
mav [Fri, 21 Nov 2014 08:24:37 +0000 (08:24 +0000)]
Log errors for absent LUNs too.

MFC after: 1 week

9 years agoPartially reconstruct Active/Standby clusting.
mav [Fri, 21 Nov 2014 06:27:37 +0000 (06:27 +0000)]
Partially reconstruct Active/Standby clusting.

In this mode one head is in Active state, supporting all commands, while
another is in Standby state, supporting only minimal LUN discovery subset.

It is still incomplete since Standby state requires reservation support,
which is impossible to do right without having interlink between heads.
But it allows to run some basic experiments.

9 years agoFix smbfs to not zero out statfs f_flags field. Previously, this
trasz [Fri, 21 Nov 2014 06:21:39 +0000 (06:21 +0000)]
Fix smbfs to not zero out statfs f_flags field. Previously, this
made getmntinfo() return empty flags for smbfs filesystems when
called with MNT_WAIT. It's not visible with mount(8), since it uses
MNT_NOWAIT, but broke autounmount(8) operation.

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

9 years agoFix the powerpc64 build.
jhibbits [Fri, 21 Nov 2014 02:45:39 +0000 (02:45 +0000)]
Fix the powerpc64 build.

Pointy-hat to: me
X-MFC-with: r274735

9 years agoUse canonical __PIC__ flag
emaste [Fri, 21 Nov 2014 02:05:48 +0000 (02:05 +0000)]
Use canonical __PIC__ flag

It is automatically set when -fPIC is passed to the compiler.

Reviewed by: dim, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1179

9 years agoRecommit r274750.
imp [Fri, 21 Nov 2014 01:43:55 +0000 (01:43 +0000)]
Recommit r274750.

9 years agoClamp too-large hwpmc callchaindepth to the maximum
emaste [Thu, 20 Nov 2014 23:16:19 +0000 (23:16 +0000)]
Clamp too-large hwpmc callchaindepth to the maximum

If the depth requested by the user is too large, it's better to provide
the maximum than the smaller default.

Sponsored by: The FreeBSD Foundation

9 years agoBack our r274750 until discussions on proper fix are over.
imp [Thu, 20 Nov 2014 21:18:19 +0000 (21:18 +0000)]
Back our r274750 until discussions on proper fix are over.

9 years agoLock the scsi_low code and the drivers which use it along with other
jhb [Thu, 20 Nov 2014 20:50:05 +0000 (20:50 +0000)]
Lock the scsi_low code and the drivers which use it along with other
related cleanups:
- Require each driver to initalize a mutex in the scsi_low_softc that
  is shared with the scsi_low code.  This mutex is used for CAM SIMs,
  timers, and interrupt handlers.
- Replace the osdep function switch with direct calls to the relevant
  CAM functions and direct manipulation of timers via callout(9).
- Collapse the CAM-specific scsi_low_osdep_interface substructure
  directly into scsi_low_softc.
- Use bus_*() instead of bus_space_*().
- Return BUS_PROBE_DEFAULT from probe routines instead of 0.
- No need to zero softcs.
- Pass 0ul and ~0ul instead of 0 and ~0 to bus_alloc_resource().
- Spell "dettach" as "detach".
- Remove unused 'dvname' variables.
- De-spl().

Tested by: no one

9 years agoLock spic(4) and mark it MPSAFE:
jhb [Thu, 20 Nov 2014 20:24:30 +0000 (20:24 +0000)]
Lock spic(4) and mark it MPSAFE:
- Add a per-softc mutex as a driver lock.
- Use callout(9) instead of timeout(9).
- Set softc pointer in si_drv1 of cdev instead of looking softc
  up via devclass in cdev methods.

Tested by: no one

9 years agoVarious fixes for wl(4):
jhb [Thu, 20 Nov 2014 20:09:18 +0000 (20:09 +0000)]
Various fixes for wl(4):
- Don't recurse driver mutex.
- Don't hold driver mutex across fubyte/subyte.
- Replace fubyte/subyte loops with copyin/copyout calls.
- Use relatively sane locking in wl_ioctl().
- Use bus space accessors instead of in*()/out*().
- Use callout(9) instead of timeout(9).
- Stop watchdog timer in detach and don't hold mutex across
  bus_teardown_intr().
- Use device_printf() and if_printf().
- De-spl().

Tested by: no one

9 years agoRemove residual xpt_release_device() call left after r272406 cleanup.
mav [Thu, 20 Nov 2014 19:28:42 +0000 (19:28 +0000)]
Remove residual xpt_release_device() call left after r272406 cleanup.

Excessive release here could trigger use-after-free condition and kernel
panic on LUN 0 disconnect.

MFC after: 1 week

9 years agoActually, that was a bad idea. Go back to MAXPARTITIONS.
imp [Thu, 20 Nov 2014 17:31:25 +0000 (17:31 +0000)]
Actually, that was a bad idea. Go back to MAXPARTITIONS.

Submitted by: bruce

9 years agoAdd L2-cache writeback/flush operations. Supported 32,128-byte line-size,
br [Thu, 20 Nov 2014 17:06:41 +0000 (17:06 +0000)]
Add L2-cache writeback/flush operations. Supported 32,128-byte line-size,
else ignored. Cavium Networks also ignored as it has non-standard config
registers.

Obtained from: NetBSD
Sponsored by: DARPA, AFRL

9 years agoThe ranges parent bus address may just be a tag to the entry in the parent
andrew [Thu, 20 Nov 2014 17:03:40 +0000 (17:03 +0000)]
The ranges parent bus address may just be a tag to the entry in the parent
node. Take this in to account by searching until we find the range for the
root node.

Differential Revision: https://reviews.freebsd.org/D1160
Reviewed by: ian
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

9 years agoUse geom attribute "PART::type" to determine partition type and choose
ae [Thu, 20 Nov 2014 16:31:31 +0000 (16:31 +0000)]
Use geom attribute "PART::type" to determine partition type and choose
relevant fsck_xxx utility.

MFC after: 1 week

9 years agoSpell out "Windows" - no need to censor it in a man page
emaste [Thu, 20 Nov 2014 14:18:07 +0000 (14:18 +0000)]
Spell out "Windows" - no need to censor it in a man page

9 years agoMFp4: @179066
rodrigc [Thu, 20 Nov 2014 09:56:34 +0000 (09:56 +0000)]
MFp4: @179066

Add page which describes VNET network stack virtualization infrastructure.

Submitted by: bz
Sponsored by: The FreeBSD Foundation
Sponsored by: CK Software GmbH

9 years agoSet the current vnet inside the ioctl handler for ipfilter.
rodrigc [Thu, 20 Nov 2014 08:11:54 +0000 (08:11 +0000)]
Set the current vnet inside the ioctl handler for ipfilter.

Without this fix, the vnet was NULL and would crash.
This fix is similar to what was done inside the ioctl handler for PF.

Tested by:
   (1) Boot a kernel with "options VIMAGE" enabled
   (2) Type:

   echo "map lo0 from 10.0.0.0/24 to ! 10.0.0.0/24 -> 127.0.0.1/32" > /etc/ipnat.rules ; service ipnat onerestart

PR: 176992
Differential Revision: https://reviews.freebsd.org/D1191
Reviewed by: cy

9 years agocpudep_ap_early_bootstrap() takes no arguments, so no need to give it one.
jhibbits [Thu, 20 Nov 2014 06:32:47 +0000 (06:32 +0000)]
cpudep_ap_early_bootstrap() takes no arguments, so no need to give it one.

MFC after: 3 weeks

9 years agoUniformly refer to a file system as "file system".
trasz [Thu, 20 Nov 2014 06:14:40 +0000 (06:14 +0000)]
Uniformly refer to a file system as "file system".

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoAdd example on how to use gpart before growfs. While here, reorder examples
trasz [Thu, 20 Nov 2014 06:12:11 +0000 (06:12 +0000)]
Add example on how to use gpart before growfs.  While here, reorder examples
so that the simplest one comes first.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years ago* Add a random device
adrian [Thu, 20 Nov 2014 05:54:29 +0000 (05:54 +0000)]
* Add a random device
* Use the same rootdev path as MALTA, so the same emulator setups
  can be used with minimal fuss.

9 years agoInclude a random device.
adrian [Thu, 20 Nov 2014 05:52:48 +0000 (05:52 +0000)]
Include a random device.

9 years agoDocument growfs(8) feature apparently nobody knows about.
trasz [Thu, 20 Nov 2014 05:31:41 +0000 (05:31 +0000)]
Document growfs(8) feature apparently nobody knows about.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoUse proper ordering in EXAMPLES section in growfs(8).
trasz [Thu, 20 Nov 2014 05:25:52 +0000 (05:25 +0000)]
Use proper ordering in EXAMPLES section in growfs(8).

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoI agree w/ tedu that this isn't a Bug.. it's like complaining that
jmg [Thu, 20 Nov 2014 04:15:58 +0000 (04:15 +0000)]
I agree w/ tedu that this isn't a Bug.. it's like complaining that
you can't use an ssh client to fetch a web page...

Submitted by: tedu (via -tech)

9 years agoUse db_printsym() instead of our own in backtraces
jhibbits [Thu, 20 Nov 2014 03:47:04 +0000 (03:47 +0000)]
Use db_printsym() instead of our own in backtraces

Summary:
Currently if there are problems finding a symbol, backtrace ends up printing
something like:

0xdeadbeef: at +0x12345

Which is pretty useless.  This on its own should be fixed (retrieving symbols),
but aside from that, using db_printsym() is a better solution anyway.  If it
can't find a valid symbol it prints the actual address, and it has the added
benefit that if it can find the symbol, it might be able to print the file and
line as well.

Test Plan: Tested on my G4 PowerBook

Reviewers: #powerpc, nwhitehorn

Reviewed By: nwhitehorn

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

MFC after: 3 weeks

9 years agoAdd support for Power Button PMU events on non-ADB macs, such as aluminum
jhibbits [Thu, 20 Nov 2014 03:23:33 +0000 (03:23 +0000)]
Add support for Power Button PMU events on non-ADB macs, such as aluminum
PowerBooks.

MFC after: 2 weeks
Relnotes: yes

9 years agoReplace the pw(1) calls with a variable, to make it easier to to change across all...
brd [Wed, 19 Nov 2014 23:07:46 +0000 (23:07 +0000)]
Replace the pw(1) calls with a variable, to make it easier to to change across all the tests as needed.

Reviewed by: will

9 years agocxgbe(4): figure out the max payload size and save it for later.
np [Wed, 19 Nov 2014 20:16:56 +0000 (20:16 +0000)]
cxgbe(4): figure out the max payload size and save it for later.

MFC after: 1 week

9 years agoMake the auto_master(5) man page clearer on how auto_master
trasz [Wed, 19 Nov 2014 19:46:58 +0000 (19:46 +0000)]
Make the auto_master(5) man page clearer on how auto_master
and map files work together, and add example for smbfs.

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

9 years agoRemove acl_size.c; apparently it was never used.
trasz [Wed, 19 Nov 2014 19:43:39 +0000 (19:43 +0000)]
Remove acl_size.c; apparently it was never used.

PR: 194398
Submitted by: ngie@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoThe number of BSD partitions is variable. Return the proper number
imp [Wed, 19 Nov 2014 18:55:27 +0000 (18:55 +0000)]
The number of BSD partitions is variable. Return the proper number
(which is in basetable->gpt_entries).

Submitted by: ae@

9 years agoFix improper .Fx macro usage.
trasz [Wed, 19 Nov 2014 18:19:21 +0000 (18:19 +0000)]
Fix improper .Fx macro usage.

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

9 years agoUse __func__ in KASSERTs, since the code is about to be moved to other place.
glebius [Wed, 19 Nov 2014 16:29:39 +0000 (16:29 +0000)]
Use __func__ in KASSERTs, since the code is about to be moved to other place.

Sponsored by: Nginx, Inc.

9 years agoIn vnode_pager_generic_getpages() vp->v_mount is dereferenced in the
glebius [Wed, 19 Nov 2014 15:17:19 +0000 (15:17 +0000)]
In vnode_pager_generic_getpages() vp->v_mount is dereferenced in the
beginning, thus can't be NULL.

Sponsored by: Nginx, Inc.

9 years agoAdd BERI-specific virtio mmio "platform" device.
br [Wed, 19 Nov 2014 14:49:29 +0000 (14:49 +0000)]
Add BERI-specific virtio mmio "platform" device.
This device provides a connector to Altera PIO allowing us
to interrupt software-implemented virtio mmio backend.

Sponsored by: DARPA, AFRL

9 years agoDo not allocate zero-length mbuf in sosend_generic().
glebius [Wed, 19 Nov 2014 14:27:38 +0000 (14:27 +0000)]
Do not allocate zero-length mbuf in sosend_generic().

Found by: pho
Sponsored by: Nginx, Inc.

9 years agoStop using early_putc immediately after configuring console with cninit()
zbb [Wed, 19 Nov 2014 14:23:29 +0000 (14:23 +0000)]
Stop using early_putc immediately after configuring console with cninit()

Early UART should be released right after system console initialization is
completed. Otherwise, after cninit() both early and system console coexist
what may lead to various issues (i.a. writing to unmapped early
UART address). This cannot be done in cninit_finish() since it can be
called late at the end of MI configuration.

Obtained from:   Semihalf
Reviewed by:     andrew
Sponsored by:    The FreeBSD Foundation

9 years agoExpose groups by default in ifconfig output. This was never hidden by
feld [Wed, 19 Nov 2014 13:57:39 +0000 (13:57 +0000)]
Expose groups by default in ifconfig output. This was never hidden by
OpenBSD; unsure why we chose to do so. As groups are a requirement for
pf, exposing them by default will make our pf implementation less
confusing.

While here add a missing free() that OpenBSD fixed 7 years ago.

PR: 194925
Differential Revision: https://reviews.freebsd.org/D1185
Approved by: des
Obtained from: OpenBSD

9 years agopf(4) needs to have a correct checksum during its processing.
eri [Wed, 19 Nov 2014 13:31:08 +0000 (13:31 +0000)]
pf(4) needs to have a correct checksum during its processing.
Calculate checksums for the IPv6 path when needed before
delving into pf(4) code as required.

PR:     172648, 179392
Reviewed by:    glebius@
Approved by:    gnn@
Obtained from:  pfSense
MFC after:      1 week
Sponsored by:   Netgate

9 years agoFix build without INVARIANTS, broken by r274675.
mav [Wed, 19 Nov 2014 13:04:25 +0000 (13:04 +0000)]
Fix build without INVARIANTS, broken by r274675.

9 years agoRevert r274635 as it's completely wrong.
dchagin [Wed, 19 Nov 2014 11:05:45 +0000 (11:05 +0000)]
Revert r274635 as it's completely wrong.
The parent of a pci dev device is a pciX device which do not
implement the PCIB_POWER_FOR_SLEEP method from pcib_if.m.

9 years agoFix typo.
trasz [Wed, 19 Nov 2014 08:59:49 +0000 (08:59 +0000)]
Fix typo.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoFix the following -Werror warning from clang 3.5.0, while building
dim [Wed, 19 Nov 2014 07:47:37 +0000 (07:47 +0000)]
Fix the following -Werror warning from clang 3.5.0, while building
lib/libngatm:

sys/contrib/ngatm/netnatm/saal/saal_sscop.c:4030:32: error: 'break' is bound to current loop, GCC binds it to the enclosing loop [-Werror,-Wgcc-compat]
                } while(sn < sscop->vr_h && !QFIND(&sscop->rbuf, sn));
                                             ^
sys/contrib/ngatm/netnatm/saal/saal_sscop.c:173:4: note: expanded from macro 'QFIND'
                        break;                                          \
                        ^
1 error generated.

The idea is to remove any ambiguity by replacing the macro with an
equivalent static inline function.

Reviewed by: emaste, rpaulo
See also: http://reviews.llvm.org/D2518
Differential Revision: https://reviews.freebsd.org/D1188

9 years agoFix the following -Werror warning from clang 3.5.0, while building cddl/lib/libctf:
dim [Wed, 19 Nov 2014 07:44:21 +0000 (07:44 +0000)]
Fix the following -Werror warning from clang 3.5.0, while building cddl/lib/libctf:

In file included from cddl/contrib/opensolaris/common/ctf/ctf_create.c:31:
In file included from sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h:34:
sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h:334:9: warning: '_ILP32' macro redefined [-Wmacro-redefined]
#define _ILP32
        ^
<built-in>:26:9: note: previous definition is here
#define _ILP32 1
        ^
1 warning generated.

This is because clang 3.5.0 started predefining _ILP32 and __ILP32__ for
the i386 arch.  (Earlier versions already predefined _LP64 and __LP64__
for the x86_64 arch.)

Reviewed by: emaste, avg, smh, delphij, markj
Differential Revision: https://reviews.freebsd.org/D1187

9 years agoAdd Trendnet TEW-646UBH.
kevlo [Wed, 19 Nov 2014 05:38:45 +0000 (05:38 +0000)]
Add Trendnet TEW-646UBH.

Submitted by: bolshakov_1 at yahoo dot com

9 years agoMake vfs.zfs.max_recordsize read-write at runtime.
delphij [Tue, 18 Nov 2014 22:35:19 +0000 (22:35 +0000)]
Make vfs.zfs.max_recordsize read-write at runtime.

MFC after: 2 weeks

9 years agoAdd locking to wds(4) and mark MPSAFE.
jhb [Tue, 18 Nov 2014 22:12:51 +0000 (22:12 +0000)]
Add locking to wds(4) and mark MPSAFE.
- Add per-softc mutex.
- Use mutex for CAM SIM lock.
- Use bus_*() instead of inb() and outb().
- Use bus_alloc_resource_any() when reasonable.

Tested by: no one

9 years agoAdd locking to scd(4) and mark MPSAFE.
jhb [Tue, 18 Nov 2014 22:02:37 +0000 (22:02 +0000)]
Add locking to scd(4) and mark MPSAFE.
- Actually use existing per-softc mutex.
- Use mutex in cdev routines and remove D_NEEDGIANT.
- Use callout(9) instead of timeout(9).
- Don't check for impossible conditions (e.g. SCDINIT being clear).
- Use bus_*() instead of bus_space_*().

Tested by: no one

9 years agoCleanups to pst(4):
jhb [Tue, 18 Nov 2014 21:58:57 +0000 (21:58 +0000)]
Cleanups to pst(4):
- Use callout(9) instead of timeout(9).
- Don't bother zero'ing the softc.
- Destroy mutex on detach.

Tested by: no one

9 years agoAdd locking to mly(4) and mark MPSAFE.
jhb [Tue, 18 Nov 2014 21:55:50 +0000 (21:55 +0000)]
Add locking to mly(4) and mark MPSAFE.
- Add a per-softc mutex.
- Use mutex as CAM sim lock.
- Use taskqueue_thread instead of taskqueue_swi_giant.
- Use callout(9) instead of timeout(9).
- Use bus_*() instead of bus_space_*().

Tested by: no one

9 years agoAdd locking to mcd(4) and mark MPSAFE.
jhb [Tue, 18 Nov 2014 21:51:01 +0000 (21:51 +0000)]
Add locking to mcd(4) and mark MPSAFE.
- Actually use existing per-softc mutex.
- Use mutex in cdev routines and remove D_NEEDGIANT.
- Use callout(9) instead of timeout(9).
- Don't check for impossible conditions (e.g. MCDINIT being clear).
- Remove critical_enter/exit when sending a PIO command.
- Use bus_*() instead of bus_space_*().

Tested by: no one

9 years agoConvert the refire_notify_ack timer from timeout(9) to callout(9).
jhb [Tue, 18 Nov 2014 21:03:46 +0000 (21:03 +0000)]
Convert the refire_notify_ack timer from timeout(9) to callout(9).

Tested by: no one

9 years agoAdd a tunable for spa_slop_shift which controls how much space we
delphij [Tue, 18 Nov 2014 18:52:38 +0000 (18:52 +0000)]
Add a tunable for spa_slop_shift which controls how much space we
would reserve by default.  Tuning is not recommended.

MFC after: 2 weeks

9 years agoAllow tuning zfs_max_recordsize via loader tunable. Tuning is NOT
delphij [Tue, 18 Nov 2014 18:40:01 +0000 (18:40 +0000)]
Allow tuning zfs_max_recordsize via loader tunable.  Tuning is NOT
recommended.

Requested by: Slawa Olhovchenkov <slw zxy spb ru>
MFC after: 2 weeks

9 years agoUpgrade libxo to 0.1.6.
marcel [Tue, 18 Nov 2014 18:03:40 +0000 (18:03 +0000)]
Upgrade libxo to 0.1.6.

Summary of changes:
1.  Coverity defect fixes

Obtained from:  https://github.com/Juniper/libxo/releases/tag/0.1.6

9 years agoMake gpio_default_map_gpios() static. No functional changes.
loos [Tue, 18 Nov 2014 17:37:33 +0000 (17:37 +0000)]
Make gpio_default_map_gpios() static.  No functional changes.

9 years agoMoves all the duplicate code to a single function.
loos [Tue, 18 Nov 2014 17:22:08 +0000 (17:22 +0000)]
Moves all the duplicate code to a single function.

Verify for invalid modes and unwanted flags before pass the new flags to
driver.

9 years agoThese delays aren't needed. Elimate them. They should be on the order
imp [Tue, 18 Nov 2014 17:07:02 +0000 (17:07 +0000)]
These delays aren't needed. Elimate them. They should be on the order
of a few cycles at most, not 10us. They make it impossible to
implement half-duplex protocols that are faster than about 1KHz.

Sponsored by: Netflix

9 years agoopt_global.h is included automatically in the build. No need to
imp [Tue, 18 Nov 2014 17:06:56 +0000 (17:06 +0000)]
opt_global.h is included automatically in the build. No need to
explicitly include it in these places.

Sponsored by: Netflix

9 years agoNo need to list opt_global.h. No need to force ALTQ here, since that's
imp [Tue, 18 Nov 2014 17:06:54 +0000 (17:06 +0000)]
No need to list opt_global.h. No need to force ALTQ here, since that's
not the normal default for the system and nothing else forces it on.

Sponsored by: Netflix

9 years agoopt_global.h is never needed in SRCS lists.
imp [Tue, 18 Nov 2014 17:06:52 +0000 (17:06 +0000)]
opt_global.h is never needed in SRCS lists.

Sponsored by: Netflix