]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoUse 'cc' for the C compiler instead of 'gcc'.
will [Thu, 18 Sep 2014 17:37:19 +0000 (17:37 +0000)]
Use 'cc' for the C compiler instead of 'gcc'.

MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1079507 on 2014/07/24

9 years agoStart the process of cleaning up FreeBSD's firewire driver.
will [Thu, 18 Sep 2014 17:28:21 +0000 (17:28 +0000)]
Start the process of cleaning up FreeBSD's firewire driver.

sys/dev/firewire/firewire.c:
sys/dev/firewire/firewire.h:
sys/dev/firewire/firewirereg.h:
sys/dev/firewire/fwcrom.c:
sys/dev/firewire/fwdev.c:
sys/dev/firewire/fwdma.c:
sys/dev/firewire/fwmem.c:
sys/dev/firewire/fwohci.c:
sys/dev/firewire/fwohci_pci.c:
sys/dev/firewire/fwohcivar.h:
sys/dev/firewire/if_fwe.c:
sys/dev/firewire/if_fwip.c:
sys/dev/firewire/sbp.c:
sys/dev/firewire/sbp_targ.c:
Unifdef the code, removing support for DragonflyBSD
and FreeBSD prior to version 5.

Submitted by: gibbs
MFC after: 1 month
Sponsored by: Spectra Logic
MFSpectraBSD: 1081188 on 2014/08/01

9 years agoWhen updating device media size use cached cdevsw pointer.
mav [Thu, 18 Sep 2014 17:25:20 +0000 (17:25 +0000)]
When updating device media size use cached cdevsw pointer.

Using pointer from the cdev directly is dangerous since we have no reference
on it, and it may change any time.  That caused panic if device has gone.

While there, report capacity change only if it really changed.

MFC after: 3 days

9 years agoSilence noisy firewire logging.
will [Thu, 18 Sep 2014 17:22:42 +0000 (17:22 +0000)]
Silence noisy firewire logging.

MFC after: 1 month
Sponsored by: Spectra Logic
MFSpectraBSD: 974594 on 2013/08/02

9 years agounistd: move setpgrp(2) to the __BSD_VISIBLE section
pfg [Thu, 18 Sep 2014 17:18:42 +0000 (17:18 +0000)]
unistd: move setpgrp(2) to the __BSD_VISIBLE section

Our setpgrp(2) differs from the specified by POSIX, which
only has one argument, and is only meant for compatibility
with BSD.

Reference:
http://pubs.opengroup.org/onlinepubs/009695399/functions/setpgrp.html

Pointed-out in: openbsd-tech (2014-09-16)
MFC after: 6 weeks

9 years agolpr: replace setpgrp(2) with setpgid(2).
pfg [Thu, 18 Sep 2014 17:01:45 +0000 (17:01 +0000)]
lpr: replace setpgrp(2) with setpgid(2).

setpgid(2) is more portable than setpgrp(2).
The BSD variant of setpgrp is a wrapper for
setpgid(2) anyways.

MFC after: 5 weeks

9 years agoEnable ZFS debug flags to be modified via vfs.zfs.debug_flags.
will [Thu, 18 Sep 2014 16:55:41 +0000 (16:55 +0000)]
Enable ZFS debug flags to be modified via vfs.zfs.debug_flags.

This is primarily only of interest to ZFS developers, but it makes it
easier to get additional debugging.

Submitted by: gibbs
MFC after: 1 month
Sponsored by: Spectra Logic
MFSpectraBSD: 517074 on 2011/12/15 (by will), 662343 on 2013/03/20 (by gibbs)

9 years agosimple_httpd: cosmetic cleanups.
pfg [Thu, 18 Sep 2014 16:53:44 +0000 (16:53 +0000)]
simple_httpd: cosmetic cleanups.

Many tab vs space cleanups.
Use setpgid() instead of setpgrp() which is more portable,

MFC after: 5 weeks

9 years ago- Use if_get_counter() to fetch ifnet statistics.
glebius [Thu, 18 Sep 2014 16:44:28 +0000 (16:44 +0000)]
- Use if_get_counter() to fetch ifnet statistics.
- Report IFCOUNTER_OQDROPS to linprocfs. Wasn't there before.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoReorder sysctls for spa.c global tunables; add sysctl for ccw_retry_interval.
will [Thu, 18 Sep 2014 16:38:03 +0000 (16:38 +0000)]
Reorder sysctls for spa.c global tunables; add sysctl for ccw_retry_interval.

MFC after: 1 month
Sponsored by: Spectra Logic

9 years agoFix the handling of EOP in status descriptors for if_igb(4) and don't
adrian [Thu, 18 Sep 2014 16:20:17 +0000 (16:20 +0000)]
Fix the handling of EOP in status descriptors for if_igb(4) and don't
double-free mbufs.

Like ixgbe(4) chipsets, EOP is only set on the final descriptor
in a chain of descriptors.  So, to free the whole list of descriptors,
we should free the current slot _and_ the assembled list of descriptors
that make up the fragment list.

The existing code was setting discard once it saw EOP + an error status;
it then freed all the subsequent descriptors until the next EOP. That's
totally the wrong order.

9 years agoRemove a bunch of methods that are superseded by if_inc_counter().
glebius [Thu, 18 Sep 2014 16:17:20 +0000 (16:17 +0000)]
Remove a bunch of methods that are superseded by if_inc_counter().

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years ago- Use if_inc_counter() to increment various counters.
glebius [Thu, 18 Sep 2014 15:56:14 +0000 (15:56 +0000)]
- Use if_inc_counter() to increment various counters.
- Do not ever set a counter to a value. For those counters
  that we don't increment, but return directly from hardware
  create cases in if_get_counter() method.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agobpobj_iterate_impl(): Close a refcount leak iterating on a sublist.
will [Thu, 18 Sep 2014 15:37:53 +0000 (15:37 +0000)]
bpobj_iterate_impl(): Close a refcount leak iterating on a sublist.

If bpobj_space() returned non-zero here, the sublist would have been
left open, along with the bonus buffer hold it requires.  This call
does not invoke any calls to bpobj_close() itself.

This bug doesn't have any known vector, but was found on inspection.

MFC after: 1 week
Sponsored by: Spectra Logic
Affects: All ZFS versions starting 21 May 2010 (illumos cde58dbc)
MFSpectraBSD: r1050998 on 2014/03/26

9 years agoFix incremental builds involving non-root users with read-only source files.
will [Thu, 18 Sep 2014 14:54:20 +0000 (14:54 +0000)]
Fix incremental builds involving non-root users with read-only source files.
This is a followup commit to r271771.

MFC after: 1 month

9 years agoFix incremental builds involving non-root users with read-only source files.
will [Thu, 18 Sep 2014 14:50:21 +0000 (14:50 +0000)]
Fix incremental builds involving non-root users with read-only source files.
This is a followup commit to r271771.

MFC after: 1 month

9 years agoWhile not too late rename 'ifnet_counter' to 'ift_counter'. One of the
glebius [Thu, 18 Sep 2014 14:47:13 +0000 (14:47 +0000)]
While not too late rename 'ifnet_counter' to 'ift_counter'. One of the
imporant moments that we discussed with Marcel and Anuranjan was that
a converted driver should return false for 'grep ifnet if_driver.c' :)

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoAccidentially, ng_ppp changes leaked out with r271770. The proper
glebius [Thu, 18 Sep 2014 14:43:23 +0000 (14:43 +0000)]
Accidentially, ng_ppp changes leaked out with r271770. The proper
commit message should have been:

In case if ng_ppp(4) runs only IPv4, with one link, w/o any
encryption and compression, set faster rcvhook method.

Submitted by: Dmitry Luhtionov <dmitryluhtionov gmail.com>

9 years agoFix incremental builds involving non-root users with read-only source files.
will [Thu, 18 Sep 2014 14:41:57 +0000 (14:41 +0000)]
Fix incremental builds involving non-root users with read-only source files.

Makefiles should not assume that source files can be overwritten.  This is the
common case for Perforce source trees.

This is a followup commit to r211243 in the same vein.

MFC after: 1 month
Sponsored by: Spectra Logic
MFSpectraBSD: r1036319 on 2014/01/29, r1046711 on 2014/03/06

9 years agoAdd a function to set if_get_counter method for an ifnet. To be used
glebius [Thu, 18 Sep 2014 14:38:28 +0000 (14:38 +0000)]
Add a function to set if_get_counter method for an ifnet. To be used
in the drivers that are already converted to "Juniper drvapi". This
can be revisited in future.

9 years agozfs_setprop_error(): Handle errno value E2BIG.
will [Thu, 18 Sep 2014 14:09:42 +0000 (14:09 +0000)]
zfs_setprop_error(): Handle errno value E2BIG.

This errno value is emitted by dsl_props_set_check() in
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c, and
is used to mean that the property value is too long.  For the record,
the maximum length is ZAP_MAXVALUELEN, which is 8*1024 bytes.

Instead of claiming an unknown error (and abort()ing), provide
something more specific to the scenario involved.  As far as I
can tell, E2BIG is not emitted for any other scenario.

MFC after: 1 week
Sponsored by: Spectra Logic
Affects: All ZFS versions starting 27 Feb 2009 (illumos ccba0801)
This change modified the value returned by
dsl_props_set_check(), so that it can distinguish between
a name that's too long and a value that's too long, but
libzfs was not updated accordingly.
MFSpectraBSD: r1051499 on 2014/03/28 11:07:59

9 years agoFix an assert to tolerate spare parents with more than 2 children.
will [Thu, 18 Sep 2014 14:02:25 +0000 (14:02 +0000)]
Fix an assert to tolerate spare parents with more than 2 children.

This can occur if a spare is being spared, which would yield three
children: the original pool drive, the previous spare, and the spare
that is replacing it.

MFC after: 1 week
Sponsored by: Spectra Logic
Affects: All ZFS versions starting 7 Jun 2006 (illumos 94de1d4c)
MFSpectraBSD: r668345 on 2013/06/04 17:10:43

9 years agoSwitch to text mode in UEFI boot
emaste [Thu, 18 Sep 2014 13:59:36 +0000 (13:59 +0000)]
Switch to text mode in UEFI boot

The loader previously failed to display on MacBooks and other systems
where the UEFI firmware remained in graphics mode.

Submitted by: Rafael EspĂ­ndola

9 years agoAdd missing link to TIMEOUT_TASK_INIT(9).
trasz [Thu, 18 Sep 2014 13:56:32 +0000 (13:56 +0000)]
Add missing link to TIMEOUT_TASK_INIT(9).

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoAdd missing links to taskqueue(9).
trasz [Thu, 18 Sep 2014 13:39:47 +0000 (13:39 +0000)]
Add missing links to taskqueue(9).

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agovt(4): Use strncpy() to copy into a fixed-size buffer
dumbbell [Thu, 18 Sep 2014 13:24:06 +0000 (13:24 +0000)]
vt(4): Use strncpy() to copy into a fixed-size buffer

CID: 1230007
MFC after: 3 days

9 years agoWrap long lines introduced in r268227
emaste [Thu, 18 Sep 2014 13:00:03 +0000 (13:00 +0000)]
Wrap long lines introduced in r268227

9 years agovt(4): Fix out-of-bounds array access in VT_ACTIVATE ioctl handling
dumbbell [Thu, 18 Sep 2014 12:20:19 +0000 (12:20 +0000)]
vt(4): Fix out-of-bounds array access in VT_ACTIVATE ioctl handling

CID: 1229964
MFC after: 3 days

9 years agoRemove unused ZFS ARC functions
smh [Thu, 18 Sep 2014 10:46:51 +0000 (10:46 +0000)]
Remove unused ZFS ARC functions

* arc_data_buf_alloc
* arc_data_buf_free

MFC after: 1 week
Sponsored by: Multiplay

9 years agoFix typos.
trasz [Thu, 18 Sep 2014 10:33:23 +0000 (10:33 +0000)]
Fix typos.

Sponsored by: The FreeBSD Foundation

9 years agoWhile not too late rename if_get_counter_compat() to if_get_counter_default().
glebius [Thu, 18 Sep 2014 10:01:56 +0000 (10:01 +0000)]
While not too late rename if_get_counter_compat() to if_get_counter_default().
The compat counters will go away, but the function will remain in its place,
and in all places where it is going to be called.

Discussed with: melifaro

9 years agoAdd if_inc_counter(), a generic method to update ifnet(9) counter
glebius [Thu, 18 Sep 2014 09:54:57 +0000 (09:54 +0000)]
Add if_inc_counter(), a generic method to update ifnet(9) counter
w/o dereferencing the struct.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years ago- Use NULL instead of 0 for fpcurthread.
kib [Thu, 18 Sep 2014 09:13:20 +0000 (09:13 +0000)]
- Use NULL instead of 0 for fpcurthread.
- Note the quirk with the interrupt enabled state of the dna handler.
- Use just panic() instead of printf() and panic().  Print tid instead
  of pid, the fpu state is per-thread.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoFor consistency with the shared header file (and to avoid confusion
bz [Thu, 18 Sep 2014 08:56:25 +0000 (08:56 +0000)]
For consistency with the shared header file (and to avoid confusion
with mbufs normally called *m in one place), rename the function
arguments to "mem".

This is a non-functional change.

Reviewed by: gnn, eric.joyner intel.com
MFC after: 3 days

9 years agoRe-gen after r271743 implementing most of
bz [Thu, 18 Sep 2014 08:40:00 +0000 (08:40 +0000)]
Re-gen after r271743 implementing most of
timer_{create,settime,gettime,getoverrun,delete}.

MFC after: 3 days
Sponsored by: DARPA, AFRL

9 years agoImplement most of timer_{create,settime,gettime,getoverrun,delete}
bz [Thu, 18 Sep 2014 08:36:45 +0000 (08:36 +0000)]
Implement most of timer_{create,settime,gettime,getoverrun,delete}
for amd64/linux32.  Fix the entirely bogus (untested) version from
r161310 for i386/linux using the same shared code in compat/linux.

It is unclear to me if we could support more clock mappings but
the current set allows me to successfully run commercial
32bit linux software under linuxolator on amd64.

Reviewed by: jhb
Differential Revision: D784
MFC after: 3 days
Sponsored by: DARPA, AFRL

9 years agoRevert r271735. The comment is absolutely correct, we do not support 802.1p priority...
araujo [Thu, 18 Sep 2014 05:43:19 +0000 (05:43 +0000)]
Revert r271735. The comment is absolutely correct, we do not support 802.1p priority tagging. I got confused with the packet tagged and packet to be tagged.

Spotted by: glebius

9 years agor258695 introduces a sanity check for makefs in order to verify that
davide [Thu, 18 Sep 2014 03:11:59 +0000 (03:11 +0000)]
r258695 introduces a sanity check for makefs in order to verify that
the minimum image size specified is always less than the maximum
image size. If makefs(1) is invoked specifying minimum image size,
but not maximum one, the program exits with an error. Example:

# sudo -E makefs -M 538968064 -B be /home/davide/disk.img $DESTDIR
makefs: `/home/davide/tftproot/mips' minsize of 538968064 rounded up
to ffs bsize of 8192 exceeds maxsize 0.  Lower bsize, or round the
minimum and maximum sizes to bsize.

Assert then that minsize < maxsize iff maxsize is specified.
This change allows me to build MIPS images using makefs(1) and following
what specified in the wiki again.

Reviewed by: jmallett, ngie

9 years agoRemove old comment, we already do 802.1q tagging.
araujo [Thu, 18 Sep 2014 03:09:34 +0000 (03:09 +0000)]
Remove old comment, we already do 802.1q tagging.

Phabric: D797
Reviewed by: kevlo
Approved by: kevlo
Sponsored by: QNAP Systems Inc.

9 years agoThe lagg(4) interface is based on trunk(4) interface from OpenBSD.
araujo [Thu, 18 Sep 2014 02:22:02 +0000 (02:22 +0000)]
The lagg(4) interface is based on trunk(4) interface from OpenBSD.
The FreeBSD is the only system that has the FEC protocol, that is a simple alias
to loadbalance protocol and does not implement the ancient Cisco FEC standard.

From now on, we remove the fec protocol from the documentation and keep the FEC
code only for compatibility.

Phabric: D539
Reviewed by: glebius, thompsa
Approved by: glebius
Sponsored by: QNAP Systems Inc.

9 years agoAdd laggproto broadcast, it allows sends frames to all ports of the lagg(4) group
araujo [Thu, 18 Sep 2014 02:12:48 +0000 (02:12 +0000)]
Add laggproto broadcast, it allows sends frames to all ports of the lagg(4) group
and receives frames on any port of the lagg(4).

Phabric: D549
Reviewed by: glebius, thompsa
Approved by: glebius
Obtained from: OpenBSD
Sponsored by: QNAP Systems Inc.

9 years agoFix a kernel panic when unloading isp(4).
will [Thu, 18 Sep 2014 02:01:36 +0000 (02:01 +0000)]
Fix a kernel panic when unloading isp(4).

In the current implementation, the isp_kthread() threads never exit.

The target threads do have an exit mode from isp_attach(), but it is
not invoked from isp_detach().

Ensure isp_detach() notifies threads started for each channel, such
that they exit before their parent device softc detaches, and thus
before the module does.  Otherwise, a page fault panic occurs later in:

sysctl_kern_proc
  sysctl_out_proc
    kern_proc_out
      fill_kinfo_proc
        fill_kinfo_thread
          strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg));

For isp_kthread() (and isp(4) target threads), td->td_wmesg references
now-unmapped memory after the module has been unloaded.  These threads
are typically msleep()ing at the time of unload, but they could also
attempt to execute now-unmapped code segments.

MFC after: 1 month
Sponsored by: Spectra Logic
MFSpectraBSD: r1070921 on 2014/06/22 13:01:17

9 years agoRoot the lib32 object tree under the overall object tree.
will [Thu, 18 Sep 2014 01:57:36 +0000 (01:57 +0000)]
Root the lib32 object tree under the overall object tree.

This enables a common root directory for all object files for a given tree,
which eases sharing a common MAKEOBJDIRPREFIX, and cleaning up of object trees.

In particular, one can simply (from the source directory) rm -rf /usr/obj$(pwd)
to destroy all object files for it.  Or to copy/sync files, etc.

Reviewed by: bdrewery
CR: https://reviews.freebsd.org/D796
MFC after: 1 month
Sponsored by: Spectra Logic

9 years agoFor ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag before
davidcs [Wed, 17 Sep 2014 22:49:29 +0000 (22:49 +0000)]
For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag before
printing error message.

MFC after:5 days

9 years agoRemove clean option
davidcs [Wed, 17 Sep 2014 22:26:01 +0000 (22:26 +0000)]
Remove clean option

MFC after:5 days

9 years agoRemove clean option
davidcs [Wed, 17 Sep 2014 22:24:51 +0000 (22:24 +0000)]
Remove clean option

MFC after:5 days

9 years agoThe vm_mmap_cdev() explicitely converts absence of both MAP_SHARED and
kib [Wed, 17 Sep 2014 21:04:50 +0000 (21:04 +0000)]
The vm_mmap_cdev() explicitely converts absence of both MAP_SHARED and
MAP_PRIVATE flags to MAP_SHARED.  Apparently, some code in tree, in
particular, libgeom, relied on this behaviour, see r271721.  For
regular file types, the absence of the flags is interpreted as
MAP_PRIVATE, and libc nlist used this (fixed in r271723).

Allow the implicit flags for legacy binaries.  Bump __FreeBSD_version
to get the ABI note on new binaries to check for in mmap code.

Remove the test for presence of one of the MAP_ANON, MAP_SHARED or
MAP_PRIVATE flags before fget_mmap().  For MAP_ANON, we already verify
that passed fd == -1.  For fd != -1, test after fget_mmap() (for newer
binaries) covers the case.

Reported by: bdrewery, pho
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation

9 years agoExplicitly set MAP_PRIVATE to avoid [EINVAL] after r271635.
bdrewery [Wed, 17 Sep 2014 20:26:27 +0000 (20:26 +0000)]
Explicitly set MAP_PRIVATE to avoid [EINVAL] after r271635.

X-MFC-With: r271635
Reviewed by: jhb

9 years ago- Remove mention of MAP_INHERIT. It hasn't been implemented for thirteen
jhb [Wed, 17 Sep 2014 19:45:34 +0000 (19:45 +0000)]
- Remove mention of MAP_INHERIT.  It hasn't been implemented for thirteen
  years.
- Remove mention of unimplemented MAP_SWAP.  There are no future plans to
  implement it.

Submitted by: alc (2)

9 years agoExplicitly specify MAP_SHARED when mapping the stats file descriptor.
jhb [Wed, 17 Sep 2014 19:37:58 +0000 (19:37 +0000)]
Explicitly specify MAP_SHARED when mapping the stats file descriptor.

Reviewed by: kib
MFC after: 1 week

9 years agoIf fgets(3) fails in getbounds(), show strerror(3) if not an EOF. Also fix
bdrewery [Wed, 17 Sep 2014 19:09:58 +0000 (19:09 +0000)]
If fgets(3) fails in getbounds(), show strerror(3) if not an EOF. Also fix
a FILE* leak in getbounds().

Submitted by: Conrad Meyer <conrad.meyer@isilon.com>
PR: 192032
Sponsored by: EMC / Isilon Storage Division
MFC after: 1 week

9 years agoFor targets that have a signed zero, lgamma_r(-0, &signgamp) should
kargl [Wed, 17 Sep 2014 19:01:22 +0000 (19:01 +0000)]
For targets that have a signed zero, lgamma_r(-0, &signgamp) should
set signgamp = -1.

Submitted by: enh at google dot com (e_lgamma[f]_r.c)

9 years agoCorrect a comment
bdrewery [Wed, 17 Sep 2014 18:59:25 +0000 (18:59 +0000)]
Correct a comment

9 years agoRevert unrelated changes accidentally committed in r271192.
jhb [Wed, 17 Sep 2014 18:55:39 +0000 (18:55 +0000)]
Revert unrelated changes accidentally committed in r271192.

9 years agoPresence of any VM_PROT bits in the permission argument on x86 implies
kib [Wed, 17 Sep 2014 18:49:57 +0000 (18:49 +0000)]
Presence of any VM_PROT bits in the permission argument on x86 implies
that the entry is readable and valid.

Reported by: markj
Submitted by: alc
Tested by: pho (previous version), markj
MFC after: 3 days

9 years agoReprase r271616 comments.
mav [Wed, 17 Sep 2014 17:43:32 +0000 (17:43 +0000)]
Reprase r271616 comments.

Submitted by: alc
MFC after: 1 month

9 years agoMigrate ie->ie_assign_cpu and associated code to use an int for CPU rather
adrian [Wed, 17 Sep 2014 17:33:22 +0000 (17:33 +0000)]
Migrate ie->ie_assign_cpu and associated code to use an int for CPU rather
than u_char.

Migrate post_filter to use an int for a CPU rather than u_char.

Change intr_event_bind() to use an int for CPU rather than u_char.

It touches the ppc, sparc64, arm and mips machdep code but it should
(hah!) be a no-op.

Tested:

* i386, AMD64 laptops

Reviewed by: jhb

9 years agoUpdate the bhyve(8) manual to reflect that it is no
gjb [Wed, 17 Sep 2014 16:45:20 +0000 (16:45 +0000)]
Update the bhyve(8) manual to reflect that it is no
longer considered 'experimental.'

Reviewed by: grehan
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agodrm/i915: Add HW context support
dumbbell [Wed, 17 Sep 2014 08:28:50 +0000 (08:28 +0000)]
drm/i915: Add HW context support

This feature is required by Mesa 9.2+. Without this, a GL application
crashes with the following message:
    # glxinfo
    name of display: :0.0
    Gen6+ requires Kernel 3.6 or later.
    Assertion failed: (ctx->Version > 0), function handle_first_current,
      file ../../src/mesa/main/context.c, line 1498.
    Abort (core dumped)

Now, Mesa 10.2.4 and 10.3-rc3 works fine:
    # glxinfo
    name of display: :0
    display: :0  screen: 0
    direct rendering: Yes
    ...
    OpenGL renderer string: Mesa DRI Intel(R) 965GM
    OpenGL version string: 2.1 Mesa 10.2.4
    ...

The code was imported from Linux 3.8.13.

Reviewed by: kib@
Tested by: kwm@, danfe@, Henry Hu,
Lundberg, Johannes <johannes@brilliantservice.co.jp>,
Johannes Dieterich <dieterich.joh@gmail.com>,
Lutz Bichler <lutz.bichler@gmail.com>,
MFC after: 3 days
Relnotes: yes

9 years agoFix LUN discovery for targets that don't support REPORT_LUNS, broken
trasz [Wed, 17 Sep 2014 07:55:23 +0000 (07:55 +0000)]
Fix LUN discovery for targets that don't support REPORT_LUNS, broken
in r263741.  At least with CTL (slightly modified to report SPC2) there
is still some problem: it doesn't seem to find LUNs higher than 7.

Sponsored by: The FreeBSD Foundation

9 years agoFix tpc_create_token() introduced in r269497 to encode CREATOR LOGICAL UNIT
mav [Wed, 17 Sep 2014 07:08:59 +0000 (07:08 +0000)]
Fix tpc_create_token() introduced in r269497 to encode CREATOR LOGICAL UNIT
DESCRIPTOR field as Identification Descriptor CSCD descriptor, not just as
Identification Descriptor.

MFC after: 3 days

9 years agoFix typo in defined ROD types in r269497.
mav [Wed, 17 Sep 2014 06:46:37 +0000 (06:46 +0000)]
Fix typo in defined ROD types in r269497.

MFC after: 3 days

9 years agoImplement a workaround to allow this test program to be compiled with clang.
markj [Wed, 17 Sep 2014 04:02:56 +0000 (04:02 +0000)]
Implement a workaround to allow this test program to be compiled with clang.
It seems that if a pragma is used to define a weak alias for a local
function, the pragma must appear after the function is defined.

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

9 years agoFix a number of typos and programming errors in the userland CTF tests. It
markj [Wed, 17 Sep 2014 03:40:49 +0000 (03:40 +0000)]
Fix a number of typos and programming errors in the userland CTF tests. It
seems that they would only pass by chance on illumos; on FreeBSD, they still
fail since userland CTF is not yet supported.

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

9 years agoFix the stack tracing for dtrace/powerpc.
jhibbits [Wed, 17 Sep 2014 02:43:47 +0000 (02:43 +0000)]
Fix the stack tracing for dtrace/powerpc.

Summary:
Fix the stack tracing for dtrace/powerpc by using the trapexit/asttrapexit
return address sentinels instead of checking within the kernel address space.

As part of this, I had to add new inline functions.  FBT traces the kernel, so
we have to have special case handling for this, since a trap will create a full
new trap frame, and there's no way to pass around the 'real' stack.  I handle
this by special-casing 'aframes == 0' with the trap frame.  If aframes counts
out to the trap frame, then assume we're looking for the full kernel trap frame,
so switch to the real stack pointer.

Test Plan: Tested on powerpc64

Reviewers: rpaulo, markj, nwhitehorn

Reviewed By: markj, nwhitehorn

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

MFC after: 3 week
Relnotes: Yes

9 years agoUse a devd event to start hv_kvpd instead of doing so in rc.d script.
delphij [Wed, 17 Sep 2014 02:32:22 +0000 (02:32 +0000)]
Use a devd event to start hv_kvpd instead of doing so in rc.d script.
This is cleaner and eliminates the unneeded startup of KVP daemon on
systems that do not run as a Hyper-V guest.

Submitted by: hrs
X-MFC-with: 271493, 271688, 271699

9 years agoFix some incorrect endianness checks.
markj [Wed, 17 Sep 2014 00:54:00 +0000 (00:54 +0000)]
Fix some incorrect endianness checks.

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

9 years agoFix elfdump(1) usage in the userland CTF tests.
markj [Tue, 16 Sep 2014 22:54:15 +0000 (22:54 +0000)]
Fix elfdump(1) usage in the userland CTF tests.

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

9 years agoFix a typo.
markj [Tue, 16 Sep 2014 22:26:01 +0000 (22:26 +0000)]
Fix a typo.

MFC after: 3 days

9 years ago* Fix if_omcast handling
melifaro [Tue, 16 Sep 2014 21:48:48 +0000 (21:48 +0000)]
* Fix if_omcast handling
* Convert if_oerrors to pcpu.

Suggested by: glebius
MFC after: 2 weeks

9 years agoSuch typo, many email, very spelling. wow.
sbruno [Tue, 16 Sep 2014 20:48:13 +0000 (20:48 +0000)]
Such typo, many email, very spelling.  wow.

MFC with 271688 271493
Submitted by: ngie ian
MFC after: 2 weeks
Relnotes: yes

9 years agoAdd proper disable/enable hooks to the default scripts so that this is only
sbruno [Tue, 16 Sep 2014 20:02:16 +0000 (20:02 +0000)]
Add proper disable/enable hooks to the default scripts so that this is only
run when asked for by the user.  Right now, hv_kvpd is run on every boot.

Don't do that.

Add hv_kvpd_enable= for this script to be run.

MFC with 271493

MFC after: 2 weeks
Relnotes: yes

9 years agoBump __FreeBSD_version after SA-14:19.tcp
gjb [Tue, 16 Sep 2014 19:20:06 +0000 (19:20 +0000)]
Bump __FreeBSD_version after SA-14:19.tcp

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

9 years agovt(4): Use vt_fb_drawrect() and vt_fb_setpixel() in all vt_fb-derivative
dumbbell [Tue, 16 Sep 2014 18:02:24 +0000 (18:02 +0000)]
vt(4): Use vt_fb_drawrect() and vt_fb_setpixel() in all vt_fb-derivative

Review: https://reviews.freebsd.org/D789
Reviewed by: nwhitehorn
Approved by: nwhitehorn
MFC after: 2 days

9 years agovt(4): Fix a LOR which occurs during a call to vt_upgrade()
dumbbell [Tue, 16 Sep 2014 17:42:37 +0000 (17:42 +0000)]
vt(4): Fix a LOR which occurs during a call to vt_upgrade()

Reported by: kib@
Review: https://reviews.freebsd.org/D785
Reviewed by: ray@
Approved by: ray@
MFC after: 2 days

9 years agoPermit MAP_RENAME and MAP_NORESERVE for now. These flags should be removed, but...
jhb [Tue, 16 Sep 2014 17:21:06 +0000 (17:21 +0000)]
Permit MAP_RENAME and MAP_NORESERVE for now.  These flags should be removed, but at least
Chromium and OpenJDK use MAP_NORESERVE.

9 years agoFix some extra whitespace noticed when reviewing git diffs.
brooks [Tue, 16 Sep 2014 17:07:32 +0000 (17:07 +0000)]
Fix some extra whitespace noticed when reviewing git diffs.

9 years agoMerge atse(4) interrupt handling and race condition fixes from cheribsd:
bz [Tue, 16 Sep 2014 15:45:53 +0000 (15:45 +0000)]
Merge atse(4) interrupt handling and race condition fixes from cheribsd:

commit 8bd88585ed8e3f7def0d780a1bc30d96fe642b9c

    Rework atse_rx_cycles handling: count packets instead of fills, and use the
    limit only when polling, not when in interrupt mode.  Otherwise, we may
    stop reading the FIFO midpacket and clear the event mask even though the
    FIFO still has data to read, which could stall receive when a large packet
    arrives.  Add a comment about races in the Altera FIFO interface: we may
    need to do a little more work to handle races than we are.

commit 20b39086cc612f8874dc9e6ef4c0c2eb777ba92a

    Use 'sizeof(data)' rather than '4' when checking an mbuf bound, as is the
    case for adjusting length/etc.

commit e18953174a265f40e9ba60d76af7d288927f5382

    Break out atse_intr() into two separate routines, one for each of the two
    interrupt sources: receive and transmit.

commit 6deedb43246ab3f9f597918361831fbab7fac4ce

    For the RX interrupt, take interest only in ALMOSTEMPTY and OVERFLOW.
    For the TX interrupt, take interest only in ALMOSTFULL and UNDERFLOW.

    Perform TX atse_start_locked() once rather than twice in TX interrupt
    handling -- and only if !FULL, rather than unconditionally.

commit 12601972ba08d4380201a74f5b967bdaeb23092c

    Experimentation suggests that the Altera Triple-Speed Ethernet documentation
    is incorrect and bits in the event and interrupt-enable registers are not
    irrationally rearranged relative to the status register.

commit 3cff2ffad769289fce3a728152e7be09405385d8

    Substantially rework interrupt handling in the atse(4) driver:

    - Introduce a new macro ATSE_TX_PENDING() which checks whether there is
      any pending data to transmit, either in an in-progress packet or in
      the TX queue.
    - Introduce new ATSE_RX_STATUS_READ() and ATSE_TX_STAUTS_WRITE() macros
      that query the FIFO status registers rather than event registers,
      offering level- rather than edge-triggered FIFO conditions.
    - For RX, interrupt only on full/overflow/underflow; for TX, interrupt
      only on empty/overflow/underflow.
    - Add new ATSE_RX_INTR_READ() and ATSE_RX_INTR_WRITE() macros useful for
      debugging interrupt behaviour.
    - Add a debug.atse_intr_debug_enable sysctl that causes various pieces
      of FIFO state to be printed out on each RX or TX interrupt.  This is
      disabled by default but good to turn on if the interface appears to
      wedge.  Also print debugging information when polling.
    - In the watchdog handler, do receive, not just transmit, processing, to
      ensure that the rx, not just tx, queue is being handled -- and, in
      particular, will be drained such that interrupts can resume.
    - Rework both atse_rx_intr() and atse_tx_intr() to eliminate many race
      conditions, and add comments on why various things are in various
      orders.  Interactions between modifications to the event and interrupt
      masks are quite subtle indeed, and we must actively check for a number
      of races (e.g., event mask cleared; packet arrives; interrupts enabled).
      We also now use the status registers rather than event registers for
      FIFO status checks to avoid other races; we continue to use event
      registers for underflow/overflow.

    With this change, interrupt-driven operation of atse appears (for the
    time being) robust.

commit 3393bbff5c68a4e61699f9b4a62af5d2a5f918f8

    atse: Fix build after 3cff2ffa

Obtained from: cheribsd
Submitted by: rwatson, emaste
Sponsored by: DARPA/AFRL
MFC after: 3 days

9 years agoSet a static revision of the Crochet checkout to avoid
gjb [Tue, 16 Sep 2014 15:35:13 +0000 (15:35 +0000)]
Set a static revision of the Crochet checkout to avoid
surprise build failures.

MFC after: 3 days
X-10.1-MFC: yes
X-MFC-With: r271676, r271677
Sponsored by: The FreeBSD Foundation

9 years agoCatch up with Crochet changes to fix the WANDBOARD-QUAD
gjb [Tue, 16 Sep 2014 15:31:50 +0000 (15:31 +0000)]
Catch up with Crochet changes to fix the WANDBOARD-QUAD
build.

Tested on: stable/10@r271618
MFC after: 3 days
X-10.1-MFC: yes
X-MFC-With: r271676
Sponsored by: The FreeBSD Foundation

9 years agoCatch up with Crochet changes to fix the BEAGLEBONE
gjb [Tue, 16 Sep 2014 15:31:12 +0000 (15:31 +0000)]
Catch up with Crochet changes to fix the BEAGLEBONE
build.

Tested on: stable/10@r271618
MFC after: 3 days
X-10.1-MFC: yes
Sponsored by: The FreeBSD Foundation

9 years agoFix source address selection on unbound sockets in the presence of multiple
asomers [Tue, 16 Sep 2014 15:28:19 +0000 (15:28 +0000)]
Fix source address selection on unbound sockets in the presence of multiple
fibs. Use the mbuf's or the socket's fib instead of RT_ALL_FIBS. Fixes PR
187553. Also fixes netperf's UDP_STREAM test on a nondefault fib.

sys/netinet/ip_output.c
In ip_output, lookup the source address using the mbuf's fib instead
of RT_ALL_FIBS.

sys/netinet/in_pcb.c
in in_pcbladdr, lookup the source address using the socket's fib,
because we don't seem to have the mbuf fib. They should be the same,
though.

tests/sys/net/fibs_test.sh
Clear the expected failure on udp_dontroute.

PR: 187553
CR: https://reviews.freebsd.org/D772
MFC after: 3 weeks
Sponsored by: Spectra Logic

9 years agoAdd a explict cast to silence a warning when building
tuexen [Tue, 16 Sep 2014 14:39:24 +0000 (14:39 +0000)]
Add a explict cast to silence a warning when building
the userland stack on Windows.
This issue was reported by Peter Kasting from Google.

MFC after: 3 days

9 years agoUse a consistent type for the number of HMAC algorithms.
tuexen [Tue, 16 Sep 2014 14:20:33 +0000 (14:20 +0000)]
Use a consistent type for the number of HMAC algorithms.
This fixes a bug which resulted in a warning on the userland
stack, when compiled on Windows.
Thanks to Peter Kasting from Google for reporting the issue and
provinding a potential fix.

MFC after: 3 days

9 years agoSmall cleanup which addresses a warning regaring the truncation
tuexen [Tue, 16 Sep 2014 13:48:46 +0000 (13:48 +0000)]
Small cleanup which addresses a warning regaring the truncation
of a 64-bit entity to a 32-bit entity. This issue was reported by
Peter Kasting from Google.

MFC after: 3 days

9 years agoFreeBSD-SA-14:19.tcp raised attention to the state of our stack
glebius [Tue, 16 Sep 2014 11:07:25 +0000 (11:07 +0000)]
FreeBSD-SA-14:19.tcp raised attention to the state of our stack
towards blind SYN/RST spoofed attack.

Originally our stack used in-window checks for incoming SYN/RST
as proposed by RFC793. Later, circa 2003 the RST attack was
mitigated using the technique described in P. Watson
"Slipping in the window" paper [1].

After that, the checks were only relaxed for the sake of
compatibility with some buggy TCP stacks. First, r192912
introduced the vulnerability, just fixed by aforementioned SA.
Second, r167310 had slightly relaxed the default RST checks,
instead of utilizing net.inet.tcp.insecure_rst sysctl.

In 2010 a new technique for mitigation of these attacks was
proposed in RFC5961 [2]. The idea is to send a "challenge ACK"
packet to the peer, to verify that packet arrived isn't spoofed.
If peer receives challenge ACK it should regenerate its RST or
SYN with correct sequence number. This should not only protect
against attacks, but also improve communication with broken
stacks, so authors of reverted r167310 and r192912 won't be
disappointed.

[1] http://bandwidthco.com/whitepapers/netforensics/tcpip/TCP Reset Attacks.pdf
[2] http://www.rfc-editor.org/rfc/rfc5961.txt

Changes made:

o Revert r167310.
o Implement "challenge ACK" protection as specificed in RFC5961
  against RST attack. On by default.
  - Carefully preserve r138098, which handles empty window edge
    case, not described by the RFC.
  - Update net.inet.tcp.insecure_rst description.
o Implement "challenge ACK" protection as specificed in RFC5961
  against SYN attack. On by default.
  - Provide net.inet.tcp.insecure_syn sysctl, to turn off
    RFC5961 protection.

The changes were tested at Netflix. The tested box didn't show
any anomalies compared to control box, except slightly increased
number of TCP connection in LAST_ACK state.

Reviewed by: rrs
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

9 years agoMake a type conversion explicit. When compiling this code on
tuexen [Tue, 16 Sep 2014 10:57:55 +0000 (10:57 +0000)]
Make a type conversion explicit. When compiling this code on
Windows as part of the SCTP userland stack, this fixes a
warning reported by Peter Kasting from Google.

MFC after: 3 days

9 years agoFix Denial of Service in TCP packet processing.
delphij [Tue, 16 Sep 2014 09:48:24 +0000 (09:48 +0000)]
Fix Denial of Service in TCP packet processing.

Submitted by: glebius
Security: FreeBSD-SA-14:19.tcp

9 years agoThe MTU is handled as a 32-bit entity within the SCTP stack.
tuexen [Tue, 16 Sep 2014 09:22:43 +0000 (09:22 +0000)]
The MTU is handled as a 32-bit entity within the SCTP stack.
This was reported by Peter Kasting from Google.

MFC after: 3 days

9 years agoCache GELI passphrases entered at the console during the boot process,
cperciva [Tue, 16 Sep 2014 08:40:52 +0000 (08:40 +0000)]
Cache GELI passphrases entered at the console during the boot process,
in order to improve user-friendliness when a system has multiple disks
encrypted using the same passphrase.

When examining a new GELI provider, the most recently used passphrase
will be attempted before prompting for a passphrase; and whenever a
passphrase is entered, it is cached for later reference.  When the root
disk is mounted, the cached passphrase is zeroed (triggered by the
"mountroot" event), in order to minimize the possibility of leakage
of passphrases.  (After root is mounted, the "taste and prompt for
passphrases on the console" code path is disabled, so there is no
potential for a passphrase to be stored after the zeroing takes place.)

This behaviour can be disabled by setting kern.geom.eli.boot_passcache=0.

Reviewed by: pjd, dteske, allanjude
MFC after: 7 days

9 years agoFix a typo; master server for iprop service should be singular.
hrs [Tue, 16 Sep 2014 05:45:38 +0000 (05:45 +0000)]
Fix a typo; master server for iprop service should be singular.

9 years agoEnsure the correct software IPv4 hash is done based on the configured
adrian [Tue, 16 Sep 2014 03:26:42 +0000 (03:26 +0000)]
Ensure the correct software IPv4 hash is done based on the configured
RSS parameters, rather than assuming we're hashing IPv4+UDP and IPv4+TCP.

9 years agoModify cpuset_setithread() to take a CPU ID as an integer, not a char.
adrian [Tue, 16 Sep 2014 01:21:47 +0000 (01:21 +0000)]
Modify cpuset_setithread() to take a CPU ID as an integer, not a char.

We're going to end up having > 254 CPUs at some point.

9 years agoBump __FreeBSD_version for the change made in r271655
ngie [Tue, 16 Sep 2014 00:59:56 +0000 (00:59 +0000)]
Bump __FreeBSD_version for the change made in r271655

PR: 181155
Sponsored by: EMC / Isilon Storage Division

9 years agoBump .Dd for the content change done to access(2) in r271655
ngie [Tue, 16 Sep 2014 00:59:08 +0000 (00:59 +0000)]
Bump .Dd for the content change done to access(2) in r271655

PR: 181155
Sponsored by: EMC / Isilon Storage Division

9 years agoValidate the mode argument in access, eaccess, and faccessat for optional
ngie [Tue, 16 Sep 2014 00:56:47 +0000 (00:56 +0000)]
Validate the mode argument in access, eaccess, and faccessat for optional
POSIX compliance and to improve compatibility with Linux and NetBSD

The issue was identified with lib/libc/sys/t_access:access_inval from
NetBSD

Update the manpage accordingly

PR: 181155
Reviewed by: jilles (code), jmmv (code), wblock (manpage), wollman (code)
MFC after: 4 weeks
Phabric: D678 (code), D786 (manpage)
Sponsored by: EMC / Isilon Storage Division

9 years ago* Makefile:
kargl [Mon, 15 Sep 2014 23:21:57 +0000 (23:21 +0000)]
* Makefile:
  . Hook e_lgammal[_r].c to the build.
  . Create man page links for lgammal[-r].3.

* Symbol.map:
  . Sort lgammal to its rightful place.
  . Add FBSD_1.4 section for the new lgamal_r symbol.

* ld128/e_lgammal_r.c:
  . 128-bit implementataion of lgammal_r().

* ld80/e_lgammal_r.c:
  . Intel 80-bit format implementation of lgammal_r().

* src/e_lgamma.c:
  . Expose lgammal as a weak reference to lgamma for platforms
    where long double is mapped to double.

* src/e_lgamma_r.c:
  . Use integer literal constants instead of real literal constants.
    Let compiler(s) do the job of conversion to the appropriate type.
  . Expose lgammal_r as a weak reference to lgamma_r for platforms
    where long double is mapped to double.

* src/e_lgammaf_r.c:
  . Fixed the Cygnus Support conversion of e_lgamma_r.c to float.
    This includes the generation of new polynomial and rational
    approximations with fewer terms.  For each approximation, include
    a comment on an estimate of the accuracy over the relevant domain.
  . Use integer literal constants instead of real literal constants.
    Let compiler(s) do the job of conversion to the appropriate type.
    This allows the removal of several explicit casts of double values
    to float.

* src/e_lgammal.c:
  . Wrapper for lgammal() about lgammal_r().

* src/imprecise.c:
  . Remove the lgamma.

* src/math.h:
  . Add a prototype for lgammal_r().

* man/lgamma.3:
  . Document the new functions.

Reviewed by: bde

9 years agodocument mqueuefs is required for mq_open...
jmg [Mon, 15 Sep 2014 22:32:35 +0000 (22:32 +0000)]
document mqueuefs is required for mq_open...

9 years agoDisable flow-director support until it's been debugged and verified.
adrian [Mon, 15 Sep 2014 21:09:19 +0000 (21:09 +0000)]
Disable flow-director support until it's been debugged and verified.

The flowdirector feature shares on-chip memory with other things
such as the RX buffers.  In theory it should be configured in a way
that doesn't interfere with the rest of operation.  In practice,
the RX buffer calculation didn't take the flow-director allocation
into account and there'd be overlap.  This lead to various garbage
frames being received containing what looks like internal NIC state.

What _I_ saw was traffic ending up in the wrong RX queues.
If I was doing a UDP traffic test with only one NIC ring receiving
traffic, everything is fine.  If I fired up a second UDP stream
which came in on another ring, there'd be a few percent of traffic
from both rings ending up in the wrong ring.  Ie, the RSS hash would
indicate it was supposed to come in ring X, but it'd come in ring Y.

However, when the allocation was fixed up, the developers at Verisign
still saw traffic stalls.

The flowdirector feature ends up fiddling with the NIC to do various
attempts at load balancing connections by populating flow table rules
based on sampled traffic.  It's likely that all of that has to be
carefully reviewed and made less "magic".

So for now the flow director feature is disabled (which fixes both
what I was seeing and what they were seeing) until it's all much
more debugged and verified.

Tested:

* (me) 82599EB 2x10G NIC, RSS UDP testing.
* (verisign) not sure on the NIC (but likely 82599), 100k-200k/sec TCP
  transaction tests.

Submitted by: Marc De La Gueronniere <mdelagueronniere@verisign.com>
MFC after: 1 week
Sponsored by: Verisign, Inc.

9 years agoThe error bits are not valid with EOP=0; so intermediary fragments should
adrian [Mon, 15 Sep 2014 20:54:12 +0000 (20:54 +0000)]
The error bits are not valid with EOP=0; so intermediary fragments should
not be discarded.

Submitted by: Marc De La Gueronniere <mdelagueronniere@verisign.com>
MFC after: 1 week
Sponsored by: Verisign, Inc.