freebsd.git
9 years agoBump config(8) minor version for r277567.
will [Sat, 24 Jan 2015 00:04:34 +0000 (00:04 +0000)]
Bump config(8) minor version for r277567.

Config files built using this version that take advantage of the bugfix
won't be buildable using older config(8).

Submitted by: imp
MFC after: 1 week
MFC with: 277567

9 years agoFix panic in firewire and creation of invalid config ROM.
will [Fri, 23 Jan 2015 23:53:56 +0000 (23:53 +0000)]
Fix panic in firewire and creation of invalid config ROM.
(This change was supposed to be included in r277508.)

sys/boot/i386/libfirewire/firewire.c:
Fix configuration ROM generation count wrapping logic
so that the generation count is never outside of
allowed limits (0x2 -> 0xF).

Submitted by: gibbs
MFC after: 1 week
MFC with: 277508
Sponsored by: Spectra Logic
MFSpectraBSD: 1110685 on 2015/01/05

9 years agoRestore addr2line to cross tools
emaste [Fri, 23 Jan 2015 21:34:08 +0000 (21:34 +0000)]
Restore addr2line to cross tools

Addr2line is not required for the build, and a per-arch binary is no
longer required with the switch to the ELF Tool Chain. However, building
these tools during the cross tools stage can be useful for developers
who cross build HEAD from stable/10, and adds very little to the build
time.

Reviewed by: ian, imp
Differential Revision: https://reviews.freebsd.org/D1583

9 years agoRun make sysent.
jilles [Fri, 23 Jan 2015 21:08:24 +0000 (21:08 +0000)]
Run make sysent.

9 years agoAdd futimens and utimensat system calls.
jilles [Fri, 23 Jan 2015 21:07:08 +0000 (21:07 +0000)]
Add futimens and utimensat system calls.

The core kernel part is patch file utimes.2008.4.diff from
pluknet@FreeBSD.org. I updated the code for API changes, added the manual
page and added compatibility code for old kernels. There is also audit and
Capsicum support.

A new UTIME_* constant might allow setting birthtimes in future.

Differential Revision: https://reviews.freebsd.org/D1426
Submitted by: pluknet (partially)
Reviewed by: delphij, pluknet, rwatson
Relnotes: yes

9 years agoWhen iterating through VMFORMATS, the VMBASE file is
gjb [Fri, 23 Jan 2015 21:04:59 +0000 (21:04 +0000)]
When iterating through VMFORMATS, the VMBASE file is
not removed or truncated to a zero-size file, which
if used to create more than one disk image format, can
result in accidental pollution of the target formatted
disk image.

Instead of using a single VMBASE image (vm.img, by
default), use a single base file for each format, named
as VMFORMAT.img, which produces VMBASE.VMFORMAT as the
final formatted image.

Reported by: cperciva
MFC after: 1 month
X-MFC-with: r277458, r277536
Sponsored by: The FreeBSD Foundation

9 years agoMFV r277607:
pfg [Fri, 23 Jan 2015 20:40:31 +0000 (20:40 +0000)]
MFV r277607:

GDB: Fix memset thinkos.

2005-03-25  Anthony Green  <green@redhat.com>

       * remote.c (remote_store_registers): Fix memset usage.
       * std-regs.c (value_of_builtin_frame_reg): Ditto.
       (value_of_builtin_frame_fp_reg): Ditto.
       (value_of_builtin_frame_reg): Ditto.

Reported by: Dirk Engling
CID: 604160, 604161, 604162, 604163
MFC after: 5 days

9 years agoProvide a recipe of "true" for building the "release" target once its
cperciva [Fri, 23 Jan 2015 20:24:13 +0000 (20:24 +0000)]
Provide a recipe of "true" for building the "release" target once its
prerequisites are satisfied, in order to avoid having an implicit rule
triggered by the presence of release.sh.

Approved by: gjb

9 years agoUpdate the latest revision.
gjb [Fri, 23 Jan 2015 19:33:46 +0000 (19:33 +0000)]
Update the latest revision.

Sponsored by: The FreeBSD Foundation

9 years agoDocument r277458, support for cloud hosting providers added to
gjb [Fri, 23 Jan 2015 19:33:08 +0000 (19:33 +0000)]
Document r277458, support for cloud hosting providers added to
the Release Engineering build tools.

Sponsored by: The FreeBSD Foundation

9 years agoDocument r277166, ptrace(2) Altivec register support.
gjb [Fri, 23 Jan 2015 19:33:05 +0000 (19:33 +0000)]
Document r277166, ptrace(2) Altivec register support.

Sponsored by: The FreeBSD Foundation

9 years agoDocument r276881, libedit UTF-8 support.
gjb [Fri, 23 Jan 2015 19:33:03 +0000 (19:33 +0000)]
Document r276881, libedit UTF-8 support.

Sponsored by: The FreeBSD Foundation

9 years agoSimplify retry loops. No functional change.
jkim [Fri, 23 Jan 2015 18:55:04 +0000 (18:55 +0000)]
Simplify retry loops.  No functional change.

9 years agoRevert r216942. This commit was premature and caused too many complaints.
jkim [Fri, 23 Jan 2015 18:12:44 +0000 (18:12 +0000)]
Revert r216942.  This commit was premature and caused too many complaints.

PR: 162859
MFC after: 3 days

9 years agoUse clock_gettime to measure the time that we spent asleep during
will [Fri, 23 Jan 2015 16:21:31 +0000 (16:21 +0000)]
Use clock_gettime to measure the time that we spent asleep during
"vmstat -i" instead of assuming it's what we asked for.

Submitted by: asomers
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1066751 on 2014/06/04

9 years agoUse CLOCK_UPTIME to get the uptime instead of CLOCK_MONOTONIC.
will [Fri, 23 Jan 2015 16:18:39 +0000 (16:18 +0000)]
Use CLOCK_UPTIME to get the uptime instead of CLOCK_MONOTONIC.

Submitted by: asomers
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1066740 on 2014/06/04

9 years agoMake "vmstat -i" respect the -c <count> and -i <interval> options together.
will [Fri, 23 Jan 2015 16:15:55 +0000 (16:15 +0000)]
Make "vmstat -i" respect the -c <count> and -i <interval> options together.

Submitted by: asomers
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1066735 on 2014/06/04

9 years agoAdd pinctrl driver support for the encoded input register config words
ian [Fri, 23 Jan 2015 16:05:47 +0000 (16:05 +0000)]
Add pinctrl driver support for the encoded input register config words
that the linux guys made up on the fly (but didn't document) last August.
This type of encoded config now appears in the imx6 fdt data.

9 years agoAllow lists for "nooption" and "nooptions" keywords.
will [Fri, 23 Jan 2015 16:03:02 +0000 (16:03 +0000)]
Allow lists for "nooption" and "nooptions" keywords.

usr.sbin/config/config.y
According to config(5), the "device", "devices",
"nodevice", "nodevices", "option", "options",
"nooption", and "nooptions" keywords can all take a
comma-separated list of values.  However, the yacc code
did not allow lists for "nooption" and "nooptions", only
single values.  This commit fixes the yacc code to allow
comma separated values for all the above keywords.

Submitted by: asomers
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1095296 on 2014/10/07

9 years agoPrint transfer times for read, write, & overall independently.
will [Fri, 23 Jan 2015 15:55:03 +0000 (15:55 +0000)]
Print transfer times for read, write, & overall independently.

Round up calculated values for iops and average time per io to avoid a
shifting display if there are 1000+ (or even 10000+) iops, or if an
average time per io column is 1000+ ms.

Reviewed by: ken
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1089947 on 2014/09/26
1093625 on 2014/09/29
1093650 on 2014/09/29
1095662 on 2014/10/09

9 years agoRemove break after return.
kevlo [Fri, 23 Jan 2015 15:14:30 +0000 (15:14 +0000)]
Remove break after return.

9 years agoLog hardware interface up/down as "hardware" rather than just "hw".
will [Fri, 23 Jan 2015 14:30:24 +0000 (14:30 +0000)]
Log hardware interface up/down as "hardware" rather than just "hw".

Suggested by: glebius
MFC after: 1 week
MFC with: 277530

9 years agoWhen a CARP state change is caused by an ifconfig request, log it accordingly.
will [Fri, 23 Jan 2015 14:28:12 +0000 (14:28 +0000)]
When a CARP state change is caused by an ifconfig request, log it accordingly.

Suggested by: glebius
MFC after: 1 week
MFC with: 277530

9 years agoAfter r270929 RAW IP code assumes that all IP fields are in network
ae [Fri, 23 Jan 2015 13:26:35 +0000 (13:26 +0000)]
After r270929 RAW IP code assumes that all IP fields are in network
byte order. Fix ping(8) to pass an IP header with converted ip_off
and ip_len fields, when IP_HDRINCL socket option used.

9 years agoUse relocation-safe methods to determine the sizes of the exception handlers.
nwhitehorn [Fri, 23 Jan 2015 07:36:51 +0000 (07:36 +0000)]
Use relocation-safe methods to determine the sizes of the exception handlers.
A "size" symbol with its address set to the length of handler would be
shifted forward with all other addresses when relocations are processed.
Instead, just note the end and do the subtraction at runtime.

9 years agoFix usage example in kvprintf(9) and its copy in libstand(3): trailing '\n'
danfe [Fri, 23 Jan 2015 07:30:57 +0000 (07:30 +0000)]
Fix usage example in kvprintf(9) and its copy in libstand(3): trailing '\n'
in bitfield argument is wrong, as it will be treated as bit 10, causing any
code printing >=10 bits with bit 10 on as having a trailing comma.

Newline (intended one) should be part of the format string (already present
in the examples).

Also fix grammar and kill EOL whitespace in comment while here.

PR: 195005
Approved by: bdrewery

9 years agoEnable all the mmc/sd controllers, because there's no telling which ones
ian [Fri, 23 Jan 2015 01:18:08 +0000 (01:18 +0000)]
Enable all the mmc/sd controllers, because there's no telling which ones
any given board will be using.

Yes, changing source is an unusually primitive power control implementation.

9 years agoImprove the distribution of LAGG port traffic.
will [Fri, 23 Jan 2015 00:06:35 +0000 (00:06 +0000)]
Improve the distribution of LAGG port traffic.

I edited the original change to retain the use of arc4random() as a seed for
the hashing as a very basic defense against intentional lagg port selection.

The author's original commit message (edited slightly):

sys/net/ieee8023ad_lacp.c
sys/net/if_lagg.c
In lagg_hashmbuf, use the FNV hash instead of the old
hash32_buf.  The hash32 family of functions operate one octet
at a time, and when run on a string s of length n, their output
is equivalent to :

   ----- i=n-1
   \
       n    \           (n-i-1)              32
( seed^  +  /        33^        * s[i] ) % 2^
   /
   ----- i=0

The problem is that the last five bytes of input don't get
multiplied by sufficiently many powers of 33 to rollover 2^32.
That means that changing the last few bytes (but obviously not
the very last) of input will always change the value of the
hash by a multiple of 33.  In the case of lagg_hashmbuf() with
ipv4 input, the last four bytes are the TCP or UDP port
numbers.  Since the output of lagg_hashmbuf is always taken
modulo the port count, and 3 is a common port count for a lagg,
that's bad.  It means that the UDP or TCP source port will
never affect which lagg member is selected on a 3-port lagg.

At 10Gbps, I was not able to measure any difference in CPU
consumption between the old and new hash.

Submitted by: asomers (original commit)
Reviewed by: emaste, glebius
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1001723 on 2013/08/28 (original)
1114258 on 2015/01/22 (edit)

9 years agoAdd sample log rotation support for opensm
ngie [Thu, 22 Jan 2015 23:50:47 +0000 (23:50 +0000)]
Add sample log rotation support for opensm

Up to 7 archives of the log will be kept (just for consistency with the other
log rotation rules)

PR: 196788
MFC after: 1 week
Reviewed by: hselasky
Sponsored by: EMC / Isilon Storage Division

9 years agoAllow use of a pre-instantiated RTAS as well as a self-instantiated one. This
nwhitehorn [Thu, 22 Jan 2015 22:04:43 +0000 (22:04 +0000)]
Allow use of a pre-instantiated RTAS as well as a self-instantiated one. This
lets the kernel boot on RTAS-based systems by being kexec'ed from Linux.

9 years agoRename the 'release' target to 'real-release', and
gjb [Thu, 22 Jan 2015 19:43:05 +0000 (19:43 +0000)]
Rename the 'release' target to 'real-release', and
add two targets, 'vm-release' and 'cloudware-release',
that are invoked if WITH_VMIMAGES and WITH_CLOUDWARE
are not empty.

This fixes an issue where 'make release' would not
build the cloud provider targets because CLOUDWARE was
not yet set. [1]

Move the WITH_VMIMAGES and WITH_CLOUDWARE targets to
Makefile.vm.

Note: There is no 'cloudware-install' target yet, since
some of the disk image names may need to be specific to
the provider, so this is probably best handled by the
build scripts.

Reported by: cperciva [1]
MFC after: 1 month
X-MFC-with: r277458
Sponsored by: The FreeBSD Foundation

9 years agoUpdate reported elftoolchain version
emaste [Thu, 22 Jan 2015 17:53:30 +0000 (17:53 +0000)]
Update reported elftoolchain version

The last elftoolchain update is upstream rev 3136. Update our reported
version and add M (Modified) suffix as our elftoolchain contains
additional fixes not yet committed upstream.

Sponsored by: The FreeBSD Foundation

9 years agoDeclare Maxmem on arm. This should have been part of r277532.
ian [Thu, 22 Jan 2015 17:46:05 +0000 (17:46 +0000)]
Declare Maxmem on arm.  This should have been part of r277532.

9 years agoAdd the Maxmem global and set it to the highest physical page number plus 1.
ian [Thu, 22 Jan 2015 17:42:30 +0000 (17:42 +0000)]
Add the Maxmem global and set it to the highest physical page number plus 1.

9 years agoDon't include newvers.sh into freebsd-version.
ume [Thu, 22 Jan 2015 17:13:43 +0000 (17:13 +0000)]
Don't include newvers.sh into freebsd-version.

9 years agoImprove CARP logging so that all state transitions are logged.
will [Thu, 22 Jan 2015 17:09:54 +0000 (17:09 +0000)]
Improve CARP logging so that all state transitions are logged.

sys/netinet/ip_carp.c:
Add a "reason" string parameter to carp_set_state() and
carp_master_down_locked() allowing more specific logging
information to be passed into these apis.

Refactor existing state transition logging into a single
log call in carp_set_state().

Update all calls to carp_set_state() and
carp_master_down_locked() to pass an appropriate reason
string.  For state transitions that were previously logged,
the output should be unchanged.

Submitted by: gibbs (original), asomers (updated)
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1039697 on 2014/02/11 (original)
1049992 on 2014/03/21 (updated)

9 years agoDon't count requests with status sent as overlapping.
mav [Thu, 22 Jan 2015 14:49:36 +0000 (14:49 +0000)]
Don't count requests with status sent as overlapping.

While those requests are still in target OOA queue, for initiator they are
already completed, so tags can be reused.

MFC after: 1 week

9 years agoRevert for r277213:
hselasky [Thu, 22 Jan 2015 11:12:42 +0000 (11:12 +0000)]
Revert for r277213:

FreeBSD developers need more time to review patches in the surrounding
areas like the TCP stack which are using MPSAFE callouts to restore
distribution of callouts on multiple CPUs.

Bump the __FreeBSD_version instead of reverting it.

Suggested by: kmacy, adrian, glebius and kib
Differential Revision: https://reviews.freebsd.org/D1438

9 years agoMake this compile with WARNS=6 and clang/gcc
ngie [Thu, 22 Jan 2015 09:25:31 +0000 (09:25 +0000)]
Make this compile with WARNS=6 and clang/gcc

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

9 years agostyle(9) cleanup
rstone [Thu, 22 Jan 2015 03:56:23 +0000 (03:56 +0000)]
style(9) cleanup

9 years agoAdd last_fault_code used in pmap-v6.c if kernel is compiled with "option DEBUG"
gonzo [Thu, 22 Jan 2015 03:33:51 +0000 (03:33 +0000)]
Add last_fault_code used in pmap-v6.c if kernel is compiled with "option DEBUG"

9 years agoWrite ACK for all kinds of LCDC interrupts
gonzo [Thu, 22 Jan 2015 03:32:04 +0000 (03:32 +0000)]
Write ACK for all kinds of LCDC interrupts

9 years agoBack out r276841, r276756, r276747, r276746. The change in r276747 is very
glebius [Thu, 22 Jan 2015 01:23:16 +0000 (01:23 +0000)]
Back out r276841, r276756, r276747, r276746. The change in r276747 is very
very questionable, since it makes vimages more dependent on each other. But
the reason for the backout is that it screwed up shutting down the pf purge
threads, and now kernel immedially panics on pf module unload. Although module
unloading isn't an advertised feature of pf, it is very important for
development process.

I'd like to not backout r276746, since in general it is good. But since it
has introduced numerous build breakages, that later were addressed in
r276841, r276756, r276747, I need to back it out as well. Better replay it
in clean fashion from scratch.

9 years agoEnable nanobsd.sh to be executed when pwd != NANO_SRC.
will [Thu, 22 Jan 2015 00:52:34 +0000 (00:52 +0000)]
Enable nanobsd.sh to be executed when pwd != NANO_SRC.

While here, fix a bug in which NANO_PMAKE would not be appended at the
appropriate time.

Simply move both checks to after the call to set_defaults_and_export().

Tested by: lstewart
Sponsored by: Spectra Logic

9 years agoFix bootstrap on systems with old libdwarf and WITHOUT_CDDL
emaste [Wed, 21 Jan 2015 21:49:03 +0000 (21:49 +0000)]
Fix bootstrap on systems with old libdwarf and WITHOUT_CDDL

ELF Tool Chain tools need libelf and libdwarf.

Submitted by: jmallett (earlier version)
Reviewed by: jmallett
Sponsored by: The FreeBSD Foundation

9 years agoMove the __aligned() declaration to where it will actually do something.
ian [Wed, 21 Jan 2015 21:31:26 +0000 (21:31 +0000)]
Move the __aligned() declaration to where it will actually do something.

9 years agoFix SCSI status byte reporting on 4Gb and 8Gb Qlogic boards.
will [Wed, 21 Jan 2015 20:32:36 +0000 (20:32 +0000)]
Fix SCSI status byte reporting on 4Gb and 8Gb Qlogic boards.

The newer boards don't have the response field that indicates
whether the SCSI status byte is present.  You have to just look to
see whether it is non-zero.

The code was looking to see whether the sense length was valid
before propagating the SCSI status byte (and sense information) up
the stack.  With a status like Reservation Conflict, there is no
sense information, only the SCSI status byte.  So it wasn't getting
correctly returned.

isp.c:
In isp_intr(), if we are on a 2400 or 2500 type board and
get a response, look at the actual contents of the
SCSI status value and set the RQSF_GOT_STATUS flag
accordingly so that return any SCSI status value we get.  The
RQSF_GOT_SENSE flag will get set later on if there is
actual sense information returned.

Submitted by: ken
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1112791 on 2015/01/15

9 years agoForce commit to record the correct log for r277513.
will [Wed, 21 Jan 2015 20:27:11 +0000 (20:27 +0000)]
Force commit to record the correct log for r277513.

If the user sends an XPT_RESET_DEV CCB, make sure to reset the
Fibre Channel Command Reference Number if we're running on a FC
controller.

We send a SCSI Target Reset when we get this CCB, and as a result
need to reset the CRN to 1 on the next command.

isp_freebsd.c:
In the XPT_RESET_DEV implementation in isp_action(), reset
the CRN if we're on a FC controller.

Submitted by: ken
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1112787 on 2015/01/15

9 years agoChange 1112791 by kenm@ken.spectrabsd8 on 2015/01/15 16:45:13
will [Wed, 21 Jan 2015 20:22:53 +0000 (20:22 +0000)]
Change 1112791 by kenm@ken.spectrabsd8 on 2015/01/15 16:45:13

Fix SCSI status byte reporting on 4Gb and 8Gb Qlogic boards.

The newer boards don't have the response field that indicates
whether the SCSI status byte is present.  You have to just look to
see whether it is non-zero.

The code was looking to see whether the sense length was valid
before propagating the SCSI status byte (and sense information) up
the stack.  With a status like Reservation Conflict, there is no
sense information, only the SCSI status byte.  So it wasn't getting
correctly returned.

isp.c:
In isp_intr(), if we are on a 2400 or 2500 type board and
get a response, look at the actual contents of the
SCSI status value and set the RQSF_GOT_STATUS flag
accordingly so that return any SCSI status value we get.  The
RQSF_GOT_SENSE flag will get set later on if there is
actual sense information returned.

Submitted by: ken
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1112791 on 2015/01/15

9 years agoMicro-optimize the new arm inline bus_space implementation by grouping all
ian [Wed, 21 Jan 2015 20:12:35 +0000 (20:12 +0000)]
Micro-optimize the new arm inline bus_space implementation by grouping all
the data the inline functions access together at the start of the bus_space
struct.  The start-of part isn't so important, it's the grouping-together
that's the point: now all the most-accessed data should be in one cache line.

Suggested by:   cognet

9 years agoFix remote DMA based firewire debugging when targeting
will [Wed, 21 Jan 2015 20:08:24 +0000 (20:08 +0000)]
Fix remote DMA based firewire debugging when targeting
systems with more than 4GB of physical memory.

To remotely debug the system 'stealthy' which has a kernel
with this change installed and firewire properly configured:

% fwcontrol -m stealthy (or stealthy's firewire EUI64)
% kgdb kernel /dev/fwmem0.0

sys/dev/firewire/fwohci.c:
Rather than hard code the upper limit for hw based
automatic responses to remote DMA requests at 4GB,
program the hardware using Maxmem, the page number
one higher than the highest physical page detected
in the system.

While here, garbage collect more useless splfw()
calls.

Submitted by: gibbs
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1110994 on 2015/01/06

9 years agoFix firewire panic when issuing a reply to an unhandled
will [Wed, 21 Jan 2015 20:06:25 +0000 (20:06 +0000)]
Fix firewire panic when issuing a reply to an unhandled
asynchronous remote dma request (DMA request that the
hardware cannot automatically handle).

sys/dev/firewire/firewire.c
In fw_rcv(), add missing early return in the error
path for DMA requests to unregistered regions.

Submitted by: gibbs
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1110993 on 2015/01/06

9 years agoProperly lock accesss to the firewire_comm->devices list.
will [Wed, 21 Jan 2015 20:05:10 +0000 (20:05 +0000)]
Properly lock accesss to the firewire_comm->devices list.

sys/dev/firewire/firewire.c:
Add missing FW_GLOCK/UNLOCK() usage to fw_noderesolve_nodeid().

sys/dev/firewire/firewire.c:
sys/dev/firewire/fwmem.c:
Remove no-op splfw() calls from functions that have been
audited for proper lock usage.

Submitted by: gibbs
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1110992 on 2015/01/06

9 years agoFix panic in firewire and creation of invalid config ROM.
will [Wed, 21 Jan 2015 20:03:46 +0000 (20:03 +0000)]
Fix panic in firewire and creation of invalid config ROM.

sys/boot/i386/libfirewire/firewire.c:
sys/dev/firewire/firewire.c:
Fix configuration ROM generation count wrapping logic
so that the generation count is never outside of
allowed limits (0x2 -> 0xF).

sys/dev/firewire/firewire.c:
In fw_xfer_unload(), xfer->fc may be NULL.  Protect
against this before taking the fc lock.

Submitted by: gibbs
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1110685 on 2015/01/05

9 years agoFix a FWXF_INQ race in the firewire driver.
will [Wed, 21 Jan 2015 20:02:16 +0000 (20:02 +0000)]
Fix a FWXF_INQ race in the firewire driver.

sys/dev/firewire/firewire.c:
In fw_xfer_unload() expand lock coverage so that
the test for FWXF_INQ doesn't race with it being
cleared in another thread.

Submitted by: gibbs
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1110207 on 2015/01/02

9 years agoFix one cause of firewire panics.
will [Wed, 21 Jan 2015 19:59:09 +0000 (19:59 +0000)]
Fix one cause of firewire panics.

sys/dev/firewire/firewire.c:
In fw_xfer_unload(), clear the FWXF_INQ flag on the
xfer under protection of the FW_GMTX, after the
xfer is removeed from the tx/rx queue.  Otherwise
it is possible for the xfer to be removed again
(corrupting the list or immediately panicing) from
another thread that has found this xfer in the
transaction label table.

Submitted by: gibbs
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1110200 on 2015/01/02

9 years agoGarbage collect dragonfly and legacy FreeBSD system support from dcons(4).
will [Wed, 21 Jan 2015 19:53:52 +0000 (19:53 +0000)]
Garbage collect dragonfly and legacy FreeBSD system support from dcons(4).

Submitted by: gibbs
MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 1110990 on 2015/01/06

9 years agoRemove commented log messages.
will [Wed, 21 Jan 2015 19:30:01 +0000 (19:30 +0000)]
Remove commented log messages.

9 years agoIgnore sync requests from the system syncher, i.e. VFS_SYNC(waitfor=MNT_LAZY).
will [Wed, 21 Jan 2015 19:25:57 +0000 (19:25 +0000)]
Ignore sync requests from the system syncher, i.e. VFS_SYNC(waitfor=MNT_LAZY).

ZFS already commits outstanding data every zfs_txg_timeout seconds, so these
syncs are unnecessarily intrusive.

Submitted by: gibbs
Sponsored by: Spectra Logic
MFSpectraBSD: 1105759 on 2014/12/11

9 years agoRemove "#define DEBUG" that conflicts with "option DEBUG" in kernel config
gonzo [Wed, 21 Jan 2015 19:23:46 +0000 (19:23 +0000)]
Remove "#define DEBUG" that conflicts with "option DEBUG" in kernel config

9 years agoEliminate an #ifdef illumos for zfs_ioc_rename().
will [Wed, 21 Jan 2015 19:20:36 +0000 (19:20 +0000)]
Eliminate an #ifdef illumos for zfs_ioc_rename().

Since allow_mounted is a FreeBSD-specific change, default to B_TRUE, then
locally check for the magic bit.  Unconditionally check allow_mounted below.
Convert the setting of allow_mounted to an explicit boolean.

MFC after: 1 week
Sponsored by: Spectra Logic
MFSpectraBSD: 672578 (in part) on 2013/07/19

9 years agoAdd POWER7+ and POWER8 to the list of CPUs with 32 SLB slots. This is
nwhitehorn [Wed, 21 Jan 2015 19:11:15 +0000 (19:11 +0000)]
Add POWER7+ and POWER8 to the list of CPUs with 32 SLB slots. This is
mostly a no-op since all currently-supported instances of these CPUs give
the number of SLB slots in the device tree, but keep it here as well just
in case.

9 years agoMake sure to relocate tmpstk with everything else and avoid processing
nwhitehorn [Wed, 21 Jan 2015 19:09:15 +0000 (19:09 +0000)]
Make sure to relocate tmpstk with everything else and avoid processing
non-relative relocations that the UART code makes for absent modules.

9 years agoMake 64-bit AIM trap handlers relocatable by changing all absolute branch
nwhitehorn [Wed, 21 Jan 2015 19:07:45 +0000 (19:07 +0000)]
Make 64-bit AIM trap handlers relocatable by changing all absolute branch
instructions to call through pointers instead. In general, these are set
implicitly through relocation processing. One has to be set explicitly in
machdep.c, however, to fit one handler in the tiny (8 instruction) space
available.

Reviewed by: andreast
Differential revision: D1554
Tested on: UP and SMP G5, Cell, POWER5+

9 years agoRemove addr2line from cross elftoolchain tools list
emaste [Wed, 21 Jan 2015 19:04:55 +0000 (19:04 +0000)]
Remove addr2line from cross elftoolchain tools list

It is not required, and there is no reason to install it just because it
came with the binutils cross tools.

Sponsored by: The FreeBSD Foundation

9 years agofiledesc: avoid spurious copying of capabilities in fget_unlocked
mjg [Wed, 21 Jan 2015 18:32:53 +0000 (18:32 +0000)]
filedesc: avoid spurious copying of capabilities in fget_unlocked

We obtain a stable copy and store it in local 'fde' variable. Storing another
copy (based on aforementioned variable) does not serve any purpose.

No functional changes.

9 years agofiledesc: return 0 from badfo_close
mjg [Wed, 21 Jan 2015 18:05:42 +0000 (18:05 +0000)]
filedesc: return 0 from badfo_close

The only potential in-tree consumer (_fdrop) special-cased it and returns 0
0 on its own instead of calling badfo_close.

Remove the special case since it is not needed and very unlikely to encounter
anyway.

No objections from: kib

9 years agofiledesc: fix whitespace nits in fget and fget_read
mjg [Wed, 21 Jan 2015 18:02:28 +0000 (18:02 +0000)]
filedesc: fix whitespace nits in fget and fget_read

No functional changes.

9 years agoAdd vfs.zfs.reference_tracking_enable sysctl/tunable.
will [Wed, 21 Jan 2015 17:03:11 +0000 (17:03 +0000)]
Add vfs.zfs.reference_tracking_enable sysctl/tunable.

This is primarily for developer/debugging use; it enables built-in tagged
tracking of refcounts inside ZFS.  It can only be enabled from the loader,
since it modifies how in-core state is managed.  Default remains disabled.

MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoUpdate the parsing of the cpu node. We are unable to use the reg property
andrew [Wed, 21 Jan 2015 16:52:24 +0000 (16:52 +0000)]
Update the parsing of the cpu node. We are unable to use the reg property
as the cpu id on arm64 as it may use two cells. In it's place we can use
the device id.

It is expected we will use the reg data on arm64 to enable cores so we
still need to read and store it even if it is not yet used.

Differential Revision: https://reviews.freebsd.org/D1555
Reviewed by: nwhitehorn
Sponsored by: The FreeBSD Foundation

9 years agoMerge all the copies of _tcb_ctor and _tcb_dtor.
andrew [Wed, 21 Jan 2015 16:41:05 +0000 (16:41 +0000)]
Merge all the copies of _tcb_ctor and _tcb_dtor.

The amd64, i386, and sparc64 versions were identical, with the one
difference where the former two used inline asm instead of _tcb_get. I
have compared the function before and after replacing the asm with _tcb_get
and found the object files to be identical.

The arm, mips, and powerpc versions were almost identical. The only
difference was the powerpc version used an alignment of 1 where arm and
mips used 16. As this is an increase in alignment is will be safe.

Along with this arm, mips, and powerpc all passed, when initial was true,
the value returned from _tcb_get as the first argument to
_rtld_allocate_tls. This would then return this pointer back to the caller.
We can remove these extra calls by checking if initial is set and setting
the thread control block directly. As this is what the sparc64 code does
we can use it directly.

As after these observations all the architectures can now have identical
code we can merge them into a common file.

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

9 years agoDo not assert that the new pipepair mutex is not initialized. The
kib [Wed, 21 Jan 2015 16:32:54 +0000 (16:32 +0000)]
Do not assert that the new pipepair mutex is not initialized.  The
backing memory contains garbage and might trigger the assertion.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoFix bug in r276630. Do not allow pthread_sigmask() to block SIGCANCEL.
kib [Wed, 21 Jan 2015 16:13:37 +0000 (16:13 +0000)]
Fix bug in r276630.  Do not allow pthread_sigmask() to block SIGCANCEL.

Reported and tested by: royger
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

9 years agoAn update for the i915 GPU driver, which brings the code up to Linux
kib [Wed, 21 Jan 2015 16:10:37 +0000 (16:10 +0000)]
An update for the i915 GPU driver, which brings the code up to Linux
commit 4d93914ae3db4a897ead4b.  Some related drm infrastructure
changes are imported as needed.

Biggest update is the rewrite of the i915 gem io to more closely
follow Linux model, althought the mechanism used by FreeBSD port is
different.

Sponsored by: The FreeBSD Foundation
MFC after: 2 month

9 years ago"softc" is short for "software context", use that phrase in the
gavin [Wed, 21 Jan 2015 13:48:06 +0000 (13:48 +0000)]
"softc" is short for "software context", use that phrase in the
device_get_softc(9) man page.

MFC after: 1 week

9 years agoFix minor errors found by coverity. Thanks Gleb for
rrs [Wed, 21 Jan 2015 13:03:18 +0000 (13:03 +0000)]
Fix minor errors found by coverity. Thanks Gleb for
the pointers to the email!

9 years agoFollow up to r277449 by fixing the remaining NSEC_TO_TICK macro to have the same
ngie [Wed, 21 Jan 2015 10:47:28 +0000 (10:47 +0000)]
Follow up to r277449 by fixing the remaining NSEC_TO_TICK macro to have the same
named parameters

Reported by: Ben Perrault <ben.perrault@gmail.com>, Willem Jan Withagen <wjw@digiware.nl>

9 years agoTypo: ivalid -> invalid.
kevlo [Wed, 21 Jan 2015 09:01:48 +0000 (09:01 +0000)]
Typo: ivalid -> invalid.

9 years agoRemove a couple files that are no longer used (functionality take over by
ian [Wed, 21 Jan 2015 05:31:54 +0000 (05:31 +0000)]
Remove a couple files that are no longer used (functionality take over by
arm/bus_space_base.c).

9 years agoUse explicit initializer style, fill in missing functions as unimplemented.
ian [Wed, 21 Jan 2015 05:23:09 +0000 (05:23 +0000)]
Use explicit initializer style, fill in missing functions as unimplemented.

9 years agoUse the base arm bus_space instead of an identical local copy.
ian [Wed, 21 Jan 2015 05:10:23 +0000 (05:10 +0000)]
Use the base arm bus_space instead of an identical local copy.

9 years agoUse the base arm bus_space instead of an identical local copy.
ian [Wed, 21 Jan 2015 05:05:07 +0000 (05:05 +0000)]
Use the base arm bus_space instead of an identical local copy.

9 years agoUse the base arm bus_space instead of an identical local copy.
ian [Wed, 21 Jan 2015 04:28:19 +0000 (04:28 +0000)]
Use the base arm bus_space instead of an identical local copy.

9 years agoUse the base arm bus_space instead of an identical local copy.
ian [Wed, 21 Jan 2015 04:22:20 +0000 (04:22 +0000)]
Use the base arm bus_space instead of an identical local copy.

9 years agoRemove a no-longer-used include.
ian [Wed, 21 Jan 2015 04:19:54 +0000 (04:19 +0000)]
Remove a no-longer-used include.

9 years agoThe versatile platform had two copies of a bus_space that are essentially
ian [Wed, 21 Jan 2015 04:06:36 +0000 (04:06 +0000)]
The versatile platform had two copies of a bus_space that are essentially
duplicates of the standard arm base bus_space, so just use it.

9 years agoRename bus_space-v6.c to bus_space_base.c, because it's not v6-specific
ian [Wed, 21 Jan 2015 03:44:29 +0000 (03:44 +0000)]
Rename bus_space-v6.c to bus_space_base.c, because it's not v6-specific
and now some v5 Marvell systems are using it.  Only define fdt_bus_tag
if option FDT is defined.

9 years agoUse explicit initializer style, fill in missing functions.
ian [Wed, 21 Jan 2015 03:28:07 +0000 (03:28 +0000)]
Use explicit initializer style, fill in missing functions.

9 years agoMove bs_unimplemented() to bus_space_generic.c so it can be shared.
ian [Wed, 21 Jan 2015 03:24:18 +0000 (03:24 +0000)]
Move bs_unimplemented() to bus_space_generic.c so it can be shared.

9 years agoThe mv/bus_space.c file is essentially identical to arm/bus_space-v6.c,
ian [Wed, 21 Jan 2015 03:22:37 +0000 (03:22 +0000)]
The mv/bus_space.c file is essentially identical to arm/bus_space-v6.c,
so just use it.

9 years agoOn 64-bit PowerPC, use more native forms of the PPC 970 HID restore
nwhitehorn [Wed, 21 Jan 2015 02:57:54 +0000 (02:57 +0000)]
On 64-bit PowerPC, use more native forms of the PPC 970 HID restore
sequences, like are used to read the HIDs. This is both easier to read
and avoids a miscompilation by GCC in certain circumstances. Also avoid
double restoration of HID4 and HID5.

MFC after: 2 weeks

9 years agoFor some reason, all the arm bus_space functions that work with uint16
ian [Wed, 21 Jan 2015 02:56:13 +0000 (02:56 +0000)]
For some reason, all the arm bus_space functions that work with uint16
values have armv4 in the name.  There's nothing armv4-special about them,
so just use the same sort of names as all the other functions.

9 years agoUse arm/bus_space-v6.c for all armv6 systems, the essentially identical
ian [Wed, 21 Jan 2015 02:49:19 +0000 (02:49 +0000)]
Use arm/bus_space-v6.c for all armv6 systems, the essentially identical
files for lpc and xilinx aren't needed.  Also, fix a couple paste-os.

9 years agoUse the explicit member initializer style to init the bus_space struct.
ian [Wed, 21 Jan 2015 02:35:04 +0000 (02:35 +0000)]
Use the explicit member initializer style to init the bus_space struct.
Fill in some formerly NULL members where the implementation function
exists.  Add a dummy function that panics and use it as a placeholder
for thigns that are still unimplemented.  Remove a few unused includes.

9 years agoAdd missing R_X86_64_ constants to elf_common.h
emaste [Wed, 21 Jan 2015 01:12:21 +0000 (01:12 +0000)]
Add missing R_X86_64_ constants to elf_common.h

PR: 196918
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoFix xz handling for files larger than 32K.
delphij [Wed, 21 Jan 2015 01:11:37 +0000 (01:11 +0000)]
Fix xz handling for files larger than 32K.

Submitted by: Stefan Ehmann <shoesoft gmx net>
PR: bin/186861
MFC after: 2 weeks

9 years agoredelf: Add missing R_X86_64_ relocation types
emaste [Wed, 21 Jan 2015 01:07:58 +0000 (01:07 +0000)]
redelf: Add missing R_X86_64_ relocation types

PR: 196918
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1570

9 years agofiledesc: plug a test for impossible condition in _fget
mjg [Wed, 21 Jan 2015 01:06:14 +0000 (01:06 +0000)]
filedesc: plug a test for impossible condition in _fget

9 years agoRevise the arm bus_space implementation to avoid dereferencing the tag on
ian [Wed, 21 Jan 2015 01:06:08 +0000 (01:06 +0000)]
Revise the arm bus_space implementation to avoid dereferencing the tag on
every operation to retrieve the bs_cookie value almost nothing actually uses.

The bus_space struct contains a private data pointer (poorly named bs_cookie,
now renamed to bs_privdata) which is used only by a few old armv4 xscale
implementations.  The bus_space functions were all defined to take this
value as the first parameter instead of the bus_space_tag_t, requiring all
the inline macro and function expansions to dereference the tag to pass it
to another function, which never uses it.  Now all the functions take the tag
as the first parameter and retrieve the privdata if they need it.

Also fix a couple bus_space_unmap() implementations that were calling
kva_free() instead of pmap_unmapdev().

Discussed with:    cognet

9 years agoMerge the following revisions from ^/projects/release-vmimage:
gjb [Tue, 20 Jan 2015 23:56:04 +0000 (23:56 +0000)]
Merge the following revisions from ^/projects/release-vmimage:
 r273823-r273826, r273833, r273836, r273944, r274069-r274071,
 r274134, r274211, r274280-r274285, r274287-r274288, r274292,
 r274296-r274297, r274356, r274533, r274725, r274726, r274729,
 r274734, r274771, r274945-r274946, r277180, r277183-r277184,
 r277186-r277187, r277250-r277253, r277263-r277264, r277383-r277384,
 r277393-r277395, r277438-r277439, r277447, r277455:

 r273823:
  Move virtual machine / cloud provider targets and
  options from release/Makefile to their own Makefile.

 r273824:
  Add glue to allow enabling building cloud provider VM images
  by default.

  When WITH_CLOUDWARE is not empty, add CLOUDTARGETS to the
  release/Makefile 'release' target.

 r273825:
  Avoid hard-coding the Azure image file format.  While here,
  avoid using OSRELEASE for the output file name.

 r273826:
  Remove a few vestiges of passing an exit code to panic().

 r273833:
  Initial commit providing a mechanism to create openstack images
  as part of the release build.

 r273836:
  Fix output file name for openstack images.  No further conversion
  is necessary for this VM file target, so there is no need to append
  the '.raw' suffix here.

 r273944:
  Uncomment the cloudinit rc.conf(5) line.

 r274069:
  Add line continuation so OPENSTACKCONF is actually included in the env(1).

 r274070:
  Add a 'vm-cloudware' target, used to drive all targets in CLOUDTARGETS.

 r274071:
  Add examples for WITH_CLOUDWARE to release.conf.sample.
  Add WITH_CLOUDWARE evaluation to RELEASE_RMAKEFLAGS.

 r274134:
  Initial rewrite to consolidate VM image build scripts into one.

 r274211:
  Add write_partition_layout() used to populate the final image.

  Fix duplicated mkimg(1) call in vm_create_disk().

  Add primitive (untested) PowerPC/PowerPC64 VM image support.

  Note: As it is currently written, the /boot/pmbr and
  /boot/{gptboot,boot1.hfs} use the build host and not the target
  build.  Fixing this is likely going to be a hack in itself.

 r274280:
  Return if vm_create_disk() is unsuccessful.

 r274281:
  Add CLEANFILES entry for VM targets

 r274282:
  Add vm_extra_pre_umount() prototype to vmimage.subr.

 r274283:
  Fix DESTDIR for installworld, and make sure it is created before use.

 r274284:
  Move usage() from vmimage.subr to mk-vmimage.sh, in case vmimage.subr
  has not been sourced.

 r274285:
  Spell 'OPTARG' correctly.  Actually call vm_create_base().

 r274287:
  Fix line continuation in write_partition_layout().
  Remove variable test that is no longer needed.

 r274288:
  Fix scheme flag to mkimg(1).

 r274292:
  mount(8) and umount(8) devfs(5) as needed.

 r274296:
  Change path for mk-vmimage.sh from ${TARGET}/ to scripts/ now that
  it is consolidated into one file.

  Fix paths for the base image and output disk image files.

 r274297:
  Call cleanup() after everything is done.

 r274356:
  Remove a stray directory from CLEANFILES.

 r274533:
  Set the boot partition type to 'apple-boot' for powerpc.

 r274725:
  In vm_install_base(), copy the host resolv.conf into
  the build chroot before attempting to do anything that
  requires working DNS (i.e., pkg bootstrap).

  In vm_extra_pre_umount(), remove the resolv.conf before
  the disk image is unmounted from the backing md(4).

 r274726 (cperciva):
  Silence errors when umounting the chroot's /dev, since it
  probably doesn't exist when we're running this.

  Unmount filesystems before attempting to destroy the md which
  holds them.

 r274729 (cperciva):
  Unmount filesystem and destroy md before we read the vnode from
  disk and package it into a disk image.  Otherwise we end up
  packaging an unclean filesystem.

 r274734 (cperciva):
  Merge duplicative vm-CLOUDTYPE targets before additional duplication
  gets added by the impending arrival of ec2 and gcloud.

 r274771 (cperciva):
  Add NOSWAP option which can be set by a vmimage.conf file to specify
  that no swap space should be created in the image.  This will be used
  by EC2 builds, since FreeBSD/EC2 allocates swap space on "ephemeral"
  disks which are physically attached to the Xen host node.

 r274945:
  In vm_extra_install_packages(), only bootstrap pkg(8) if
  VM_EXTRA_PACKAGES is empty.

  In vm_extra_pre_umount(), cleanup downloaded packages if pkg(8) was
  bootstrapped earlier.

 r274946:
  Fix indentation nit.

 r277180:
  In vm_extra_install_base(), do not install waagent in the openstack
  image, because it is not used.  This appears to be a copy mistake.

  Remove vm_extra_install_base() from the openstack.conf entirely,
  since it does not need to be overridden.

 r277183:
  Enable the textmode console by default for VM images, since there is
  no way to tell if the environment will be able to use the
  graphics-mode console.

 r277184:
  Enable password-less sudo for openstack images.

 r277186:
  Update the VM_EXTRA_PACKAGES list for the openstack images.

  The documentation suggests doing a "just fetch this and run it"-style
  bootstrap, from which the list of dependencies was obtained (in
  github, at: pellaeon/bsd-cloudinit-installer)

  There is one Python dependency unmet, oslo.config, which is not in
  the Ports Collection.

 r277187:
  Add a comment to note that setting hw.vga.textmode=1 is temporary.

 r277250:
  Remove vm_extra_install_base() for the Azure image, now that the
  waagent exists in the ports tree.

  Add sysutils/azure-agent to the VM_EXTRA_PACKAGES list.

  In vm_extra_pre_umount(), remove the explicit pkg(8) install
  list, as dependencies are resolved by sysutils/azure-agent.

 r277251:
  Add a 'list-cloudware' target to print the list of supported CLOUDWARE
  values and a description.

  Add the AZURE_DESC and OPENSTACK_DESC descriptions.

 r277252:
  Update release(7)

 r277253:
  Add 'list-vmtargets' target, which produces a list of all supported
  VM and cloud provider images.

  Add VHD_DESC, VMDK_DESC, QCOW2_DESC, RAW_DESC image descriptions.

  Format the output to make a bit more readable.

  Update release(7) to document the list-vmtargets target.

 r277263:
  Add initial support for the GCE (Google Compute Engine) cloud hosting
  provider image.

 r277264:
  Style and line length cleanup.

 r277383:
  Remove the console setting from rc.conf(5), which is not used there.
  While here, set console to include vidconsole in the loader.conf(5).

 r277384:
  Fix an indentation nit.
  No functional changes.

 r277393:
  Remove the pkg-clean(8) call from vm_extra_pre_umount() since the
  function is often overridden.

  Add vm_extra_pkg_rmcache() to call pkg-clean(8) to avoid duplicated
  code.

 r277394:
  Move resolv.conf(5) removal back to vm_extra_pre_umount() where it
  belongs.

  The GCE image needs resolv.conf(5) to exist (created as part of the
  image setup), so it cannot be removed.

 r277395:
  Comment the line that configures ttys(5) to 'off', which makes it
  impossible to test that the image boots.

  Add a note explaining why the line is commented, and not (yet) removed
  entirely.

 r277438:
  Move the 'install' bits that are specific to virtual machine images
  from the Makefile to Makefile.vm.

  Rename the 'install' target to 'release-install', and add a new
  'vm-install' target.

  Add a new 'install' target that invokes the new targets.

 r277439:
  Add WITH_CLOUDWARE to the list of make(1) variables for the release
  build.

 r277447:
  Remove hw.vga.textmode=1 from the VM image loader.conf, which was
  included during test builds and not intended to be included when
  merging this project branch back to head.

 r277455:
  Remove mk-azure.sh, which is no longer needed.

MFC after: 1 month
X-MFC-To: stable/10 (requires mkimg(1))
Help from: cperciva, swills
Relnotes: yes
Sponsored by: The FreeBSD Foundation