freebsd.git
9 years agoMerge ACPICA 20141107 and 20150204.
jkim [Wed, 18 Feb 2015 20:33:00 +0000 (20:33 +0000)]
Merge ACPICA 20141107 and 20150204.

9 years agoRestore the ability to use clang as an external compiler. This was
grehan [Wed, 18 Feb 2015 19:27:51 +0000 (19:27 +0000)]
Restore the ability to use clang as an external compiler. This was
inadvertently removed when support for external GCC was added.

Deprecate XFLAGS in favour of the newer XCFLAGS/XCXXFLAGS.

Tested with: make universe, make CROSS_COMPILER_PREFIX=/usr/bin/ buildworld
Reviewed by: imp, bapt

9 years agoMake sure that the flags for the XPT_DEV_ADVINFO CCB are initialized
ken [Wed, 18 Feb 2015 18:30:19 +0000 (18:30 +0000)]
Make sure that the flags for the XPT_DEV_ADVINFO CCB are initialized
properly.

If there is garbage in the flags field, it can sometimes include a
set CDAI_FLAG_STORE flag, which may cause either an error or
perhaps result in overwriting the field that was intended to be
read.

sys/cam/cam_ccb.h:
Add a new flag to the XPT_DEV_ADVINFO CCB, CDAI_FLAG_NONE,
that callers can use to set the flags field when no store
is desired.

sys/cam/scsi/scsi_enc_ses.c:
In ses_setphyspath_callback(), explicitly set the
XPT_DEV_ADVINFO flags to CDAI_FLAG_NONE when fetching the
physical path information.  Instead of ORing in the
CDAI_FLAG_STORE flag when storing the physical path, set
the flags field to CDAI_FLAG_STORE.

sys/cam/scsi/scsi_sa.c:
Set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE when
fetching extended inquiry information.

sys/cam/scsi/scsi_da.c:
When storing extended READ CAPACITY information, set the
XPT_DEV_ADVINFO flags field to CDAI_FLAG_STORE instead of
ORing it into a field that isn't initialized.

sys/dev/mpr/mpr_sas.c,
sys/dev/mps/mps_sas.c:
When fetching extended READ CAPACITY information, set the
XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE instead of
setting it to 0.

sbin/camcontrol/camcontrol.c:
When fetching a device ID, set the XPT_DEV_ADVINFO flags
field to CDAI_FLAG_NONE instead of 0.

sys/sys/param.h:
Bump __FreeBSD_version to 1100061 for the new XPT_DEV_ADVINFO
CCB flag, CDAI_FLAG_NONE.

Sponsored by: Spectra Logic
MFC after: 1 week

9 years agoIf malloc() sleeps, Giant is dropped. Recheck for another thread
kib [Wed, 18 Feb 2015 18:12:06 +0000 (18:12 +0000)]
If malloc() sleeps, Giant is dropped.  Recheck for another thread
doing our work.

Remove unneeded check for failed M_WAITOK allocation.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoAdd LIBXO.
marcel [Wed, 18 Feb 2015 17:28:55 +0000 (17:28 +0000)]
Add LIBXO.

9 years agoClean up a bit of the INET/INET6 mess wrt options.
imp [Wed, 18 Feb 2015 15:25:25 +0000 (15:25 +0000)]
Clean up a bit of the INET/INET6 mess wrt options.

9 years agoCleanup the way we include some files (in this case EISA) based on
imp [Wed, 18 Feb 2015 15:25:22 +0000 (15:25 +0000)]
Cleanup the way we include some files (in this case EISA) based on
kernel config. Also tidy up the ed options.

9 years agoPopulate new KERN_OPTS from all the opt_*.h files in
imp [Wed, 18 Feb 2015 15:25:19 +0000 (15:25 +0000)]
Populate new KERN_OPTS from all the opt_*.h files in
KERNBUILDDIR. Come up with some sensible defaults (though listing them
in kmod.mk may be unwise -- we have no easy way to know what are the
best sensible defaults for everything so we just catch the big stuff).
Append SRCS.${opt} for each option in KERN_OPTS to SRCS to allow easy
conditional compilation. Append any notion of KERN_OPTS_EXTRA to the
list of kernel opts.

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

9 years agoAdd copyright statement I should have had on these files in 2006,
imp [Wed, 18 Feb 2015 14:33:33 +0000 (14:33 +0000)]
Add copyright statement I should have had on these files in 2006,
based on the spibus_if.m file.

9 years agofiledesc: obtain a stable copy of credentials in fget_unlocked
mjg [Wed, 18 Feb 2015 13:37:28 +0000 (13:37 +0000)]
filedesc: obtain a stable copy of credentials in fget_unlocked

This was broken in r278930.

While here tidy up fget_mmap to use fdp from local var instead of obtaining
the same pointer from td.

9 years agoFix UP build.
kib [Wed, 18 Feb 2015 10:51:48 +0000 (10:51 +0000)]
Fix UP build.

Sponsored by: The FreeBSD Foundation
MFC after: 2 months

9 years agoBump revision again after my Fortuna change.
delphij [Wed, 18 Feb 2015 08:24:00 +0000 (08:24 +0000)]
Bump revision again after my Fortuna change.

9 years ago - fortuna.c: catch up with r278927 and fix a buffer overflow by using the
delphij [Wed, 18 Feb 2015 08:21:51 +0000 (08:21 +0000)]
 - fortuna.c: catch up with r278927 and fix a buffer overflow by using the
      temporary buffer when remaining space is not enough to hold
      a whole block.
 - yarrow.c:  add a comment that we intend to change the code and remove
      memcpy's in the future. (*)

Requested by: markm (*)
Reviewed by: markm
Approved by: so (self)

9 years agoMatch the right backlight driver.
jhibbits [Wed, 18 Feb 2015 07:34:32 +0000 (07:34 +0000)]
Match the right backlight driver.

Some ATI-based PowerBooks use the string 'mnca' in the backlight controller
device tree entry, so account for this and don't use nVidia when it's not an
nVidia device.

MFC after: 3 weeks

9 years agoDon't set the write bit if we're just reading.
jhibbits [Wed, 18 Feb 2015 06:53:40 +0000 (06:53 +0000)]
Don't set the write bit if we're just reading.

Also fix a couple typos.

MFC after: 3 weeks

9 years agosfxge: fix broken MCDI_EV_FIELD() macro
arybchik [Wed, 18 Feb 2015 06:26:07 +0000 (06:26 +0000)]
sfxge: fix broken MCDI_EV_FIELD() macro

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

9 years agosfxge: support variable-length response to MCDI GET_BOARD_CFG
arybchik [Wed, 18 Feb 2015 06:23:16 +0000 (06:23 +0000)]
sfxge: support variable-length response to MCDI GET_BOARD_CFG

Allocate the minimum or maximum response length for GET_BOARD_CFG as
appropriate.  When looking up firmware subtypes by partition ID,
check the ID against the actual response length.

Merge of the patch made by Ben Hutchings in 2011.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

9 years agosfxge: add driver context member with number of event queues
arybchik [Wed, 18 Feb 2015 06:21:59 +0000 (06:21 +0000)]
sfxge: add driver context member with number of event queues

Mainly to unify with similar member for transmit and receive queues.
It will be used in the future for resources allocation processing.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

9 years agosfxge: add driver context member with number of receive queues
arybchik [Wed, 18 Feb 2015 06:20:59 +0000 (06:20 +0000)]
sfxge: add driver context member with number of receive queues

Mainly to unify with similar member for transmit queues.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

9 years agosfxge: add driver context member with number of transmit queues
arybchik [Wed, 18 Feb 2015 06:19:35 +0000 (06:19 +0000)]
sfxge: add driver context member with number of transmit queues

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

9 years agosfxge: add TCP segment size to sfxge_tso_state
arybchik [Wed, 18 Feb 2015 06:18:51 +0000 (06:18 +0000)]
sfxge: add TCP segment size to sfxge_tso_state

It avoids access to m_pkthdr when TSO packet is started and also makes
tso_start_new_packet() function smaller.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

9 years agoOn my Lenovo T400, a Atheros 2413 has a problem powering up
imp [Wed, 18 Feb 2015 05:53:04 +0000 (05:53 +0000)]
On my Lenovo T400, a Atheros 2413 has a problem powering up
sometimes. It will power up wrong and identify itself badly:

cardbus0: <network, ethernet> at device 0.0 (no driver attached)
cardbus0: <simple comms, UART> at device 0.1 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.2 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.3 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.4 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.5 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.6 (no driver attached)
cardbus0: <old, non-VGA display device> at device 0.7 (no driver attached)

All the higher numbered functions (.2 and above) have a config space
of all 0's. This smells a bit like a special debug mode, but the
current atheros driver doesn't cope. It is unclear if this card is
just a flake, or if we're doing something wrong in the power-up
sequence.

Put a work around into the code that tests for this rather unusual
condition. If we power a CardBus device up, and the device says it is
multi-function, and any of the functions have a 0 device ID, try the
power-up sequence again.

9 years agoRemove drti.o's dependency on libelf. This makes it possible to add DTrace
markj [Wed, 18 Feb 2015 03:54:54 +0000 (03:54 +0000)]
Remove drti.o's dependency on libelf. This makes it possible to add DTrace
probes to userland programs and libraries without also needing to link
libelf.

dtrace -G places the __SUNW_dof symbol at the beginning of the DOF (DTrace
probe and provider metdata) section in the generated object file; drti.o
now just uses this symbol to locate the section. A complication occurs
when multiple dtrace-generated object files are linked together, since the
__SUNW_dof symbol defined in each file is global. This is handled by
using objcopy(1) to convert __SUNW_dof to a local symbol once drti.o has
been linked with the generated object file. Upstream, this is done using a
linker feature not present in GNU ld.

Differential Revision: https://reviews.freebsd.org/D1757
Reviewed by: rpaulo
MFC after: 1 month
Relnotes: yes

9 years agoFix a typo in ipv6_down().
rpaulo [Wed, 18 Feb 2015 03:46:43 +0000 (03:46 +0000)]
Fix a typo in ipv6_down().

We weren't skipping extraneous entries in the ifconfig | grep inet6 case.

Submitted by: Ashutosh Kumar AK0037447 at TechMahindra.com
MFC after: 1 week

9 years agolibc: clean some set-but-not-used errors.
pfg [Wed, 18 Feb 2015 03:33:17 +0000 (03:33 +0000)]
libc: clean some set-but-not-used errors.

These were found by gcc 5.0 on Dragonfly BSD, however I
made no attempt to silence the false positives.

Obtained from: DragonFly (cf515c3a6f3a8964ad592e524442bc628f8ed63b)

9 years agofiledesc: simplify fget_unlocked & friends
mjg [Tue, 17 Feb 2015 23:54:06 +0000 (23:54 +0000)]
filedesc: simplify fget_unlocked & friends

Introduce fget_fcntl which performs appropriate checks when needed.
This removes a branch from fget_unlocked.

Introduce fget_mmap dealing with cap_rights_to_vmprot conversion.
This removes a branch from _fget.

Modify fget_unlocked to pass sequence counter to interested callers so
that they can perform their own checks and make sure the result was
otained from stable & current state.

Reviewed by: silence on -hackers

9 years agobump the rev... ZFS is the first fall out of this bug, but there might
jmg [Tue, 17 Feb 2015 23:41:08 +0000 (23:41 +0000)]
bump the rev...  ZFS is the first fall out of this bug, but there might
be others...

9 years agoministat(1): replace malloc + memset with calloc.
pfg [Tue, 17 Feb 2015 23:20:19 +0000 (23:20 +0000)]
ministat(1): replace malloc + memset with calloc.

Reviewed by: phk

9 years agoFix a bug where this function overflowed it's buffer... This was
jmg [Tue, 17 Feb 2015 23:14:26 +0000 (23:14 +0000)]
Fix a bug where this function overflowed it's buffer...  This was
causing ZFS panics on boot...

This is purely reviewed and tested by peter.

Reviewed by: peter
Approved by: so (implicit), peter

9 years agorelease: use xz via pipe when compressing the tarballs.
rpaulo [Tue, 17 Feb 2015 23:13:45 +0000 (23:13 +0000)]
release: use xz via pipe when compressing the tarballs.

libarchive(3) doesn't support the new liblzma API yet, but this change
allows us to enable multi-threaded xz compression.
``make release'' should now finish in half the time on a machine with
several cores and fast disks (our typical build server).

This behaviour only applies when building a release and it doesn't
affect buildworld/installworld.  To disable threaded xz compression,
set XZ_THREADS=1.

Reviewed by: gjb
Tested by: gjb

9 years agoEven more fixes to !INET and !INET6 kernels.
glebius [Tue, 17 Feb 2015 22:33:22 +0000 (22:33 +0000)]
Even more fixes to !INET and !INET6 kernels.

In collaboration with: pluknet

9 years agoFix compilation of LINT-NOINET kernel target after r278886.
hselasky [Tue, 17 Feb 2015 21:59:15 +0000 (21:59 +0000)]
Fix compilation of LINT-NOINET kernel target after r278886.

Sponsored by: Mellanox Technologies
MFC after: 1 month

9 years agonote that you should update your kernel due to RNG issue, and what
jmg [Tue, 17 Feb 2015 21:18:17 +0000 (21:18 +0000)]
note that you should update your kernel due to RNG issue, and what
versions you should upgrade...

Suggested by: Ryan Stone

9 years agodu(1): replace malloc + memset with calloc.
pfg [Tue, 17 Feb 2015 21:12:45 +0000 (21:12 +0000)]
du(1): replace malloc + memset with calloc.

9 years ago Use anonymous unions and structs to organize shared space in mbuf(9),
glebius [Tue, 17 Feb 2015 20:52:51 +0000 (20:52 +0000)]
  Use anonymous unions and structs to organize shared space in mbuf(9),
instead of preprocessor macros.
  This will make debugger output of 'print *m' exactly match the names
we use in code, making life of a kernel hacker way more pleasant. And
this also allows to rename struct_m_ext back to m_ext.

9 years agoMake use of the newly introduced macros.
loos [Tue, 17 Feb 2015 20:37:21 +0000 (20:37 +0000)]
Make use of the newly introduced macros.

Update the copyright.

9 years agoReplace hardcoded sizes by sizeof() and nitems().
loos [Tue, 17 Feb 2015 20:29:42 +0000 (20:29 +0000)]
Replace hardcoded sizes by sizeof() and nitems().

Set all the sysctls as CTLFLAG_MPSAFE.

9 years agoFix the display of negative temperatures.
loos [Tue, 17 Feb 2015 20:08:40 +0000 (20:08 +0000)]
Fix the display of negative temperatures.

Fix the setting of TOS (overtemperature shutdown) and THYST (hysteresis
temperature).

9 years agoSet the #address-cells and #size-cells properties on I2C controllers of
loos [Tue, 17 Feb 2015 19:38:16 +0000 (19:38 +0000)]
Set the #address-cells and #size-cells properties on I2C controllers of
Raspberry-pi.

This fixes the issues of dtc(1) while compiling I2C addresses set in "reg"
property.

MFC after: 2 weeks

9 years agoUse anonymous unions to add possibility to put mbufs into queue(3)
glebius [Tue, 17 Feb 2015 19:32:11 +0000 (19:32 +0000)]
Use anonymous unions to add possibility to put mbufs into queue(3)
STAILQs and SLISTs using the same structure field as good old m_next
and m_nextpkt linkage occupy.

New code is encouraged to use queue(3) macros, instead of implementing
the wheel. However, better not to have a mixture of old style and
queue(3) in one file or subsystem.

Reviewed by: rwatson, rrs, rpaulo
Differential Revision: D1499

9 years ago Globally enable -fms-extensions when building kernel with gcc, and remove
glebius [Tue, 17 Feb 2015 19:27:14 +0000 (19:27 +0000)]
  Globally enable -fms-extensions when building kernel with gcc, and remove
this option from all modules that enable it theirselves.
  In C mode -fms-extensions option enables anonymous structs and unions,
allowing us to use this C11 feature in kernel. Of course, clang supports
it without any extra options.

Reviewed by: dim

9 years agolldb: workaround to permit cross-arch core file debugging
emaste [Tue, 17 Feb 2015 18:33:17 +0000 (18:33 +0000)]
lldb: workaround to permit cross-arch core file debugging

FreeBSD core files have no section table and thus LLDB's OS and vendor
detection logic does not work. If we encounter such an ELF file, update
an unknown OS to match the host.

This is not really the correct way to handle this, but more extensive
rework of ObjectFileELF will be needed and this change restores cross-
arch core debugging until that can be completed.

9 years agohd64570.h was installed, so add it here now that it is gone.
imp [Tue, 17 Feb 2015 18:10:46 +0000 (18:10 +0000)]
hd64570.h was installed, so add it here now that it is gone.

Submitted by: ae@

9 years agoWhen the new random adaptor code was brought it in r273872, a call to
jmg [Tue, 17 Feb 2015 17:37:00 +0000 (17:37 +0000)]
When the new random adaptor code was brought it in r273872, a call to
randomdev_init_reader to change read_random over to the newly installed
adaptor was missed.  This means both read_random and arc4random (seeded
from read_random) were not returning very random data.  This also
effects userland arc4random as it is seeded from kernel arc4random.

The random devices are uneffected and have returned good randomness
since the change.

All keys generated with a kernel of r273872 must be regenerated with
a kernel with this patch.  Keys generated may be predictable.

Remove the warning as log is too early to print anything, and it would
always get printed due to early use of arc4random...

Reviewed by: delphij, markm
Approved by:    so (delphij)

9 years agoulimit(3): simplify.
pfg [Tue, 17 Feb 2015 16:01:00 +0000 (16:01 +0000)]
ulimit(3): simplify.

rlim_t is at least as large as long, so we don't need the
extra variable to keep the intermediate step. We don't
need the volatile either.

The code was tested on i386 and amd64.

Suggested by: bde
X-MFC with: r278803

9 years agoUpdate elftoolchain to upstream revision 3163
emaste [Tue, 17 Feb 2015 15:19:58 +0000 (15:19 +0000)]
Update elftoolchain to upstream revision 3163

Most of our changes have now been committed upstream, so this change is
largely bookkeeping.

Sponsored by: The FreeBSD Foundation

9 years agoAdd tests for account and password expiration.
brd [Tue, 17 Feb 2015 14:48:16 +0000 (14:48 +0000)]
Add tests for account and password expiration.

Approved by: will

9 years agocompress,gzip,xz: Preserve timestamps with nanosecond precision.
jilles [Tue, 17 Feb 2015 13:12:54 +0000 (13:12 +0000)]
compress,gzip,xz: Preserve timestamps with nanosecond precision.

9 years agoPull the ARM ddb unwind code out to a new file. This will allow it to be
andrew [Tue, 17 Feb 2015 13:09:20 +0000 (13:09 +0000)]
Pull the ARM ddb unwind code out to a new file. This will allow it to be
used by other places that expect to unwind the stack, e.g. dtrace and
stack(9).

As I have written most of this code I'm changing the license to the
standard FreeBSD license. I have received approval from the other
developers who have changed any of the affected code.

Approved by: ian, imp, rpaulo, eadler (all license change)

9 years agoFix compilation of the SDP driver and a compile warning after r278886.
hselasky [Tue, 17 Feb 2015 10:00:15 +0000 (10:00 +0000)]
Fix compilation of the SDP driver and a compile warning after r278886.
Also fix the kernel build rule for mlx4_exp.c.
This fixes the LINT kernel target for amd64.

Sponsored by: Mellanox Technologies
MFC after: 1 month

9 years agoAdd the mnt_lockref field to the ddb(4) 'show mount' command
ngie [Tue, 17 Feb 2015 09:31:58 +0000 (09:31 +0000)]
Add the mnt_lockref field to the ddb(4) 'show mount' command

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D1688
Submitted by: Conrad Meyer <conrad.meyer@isilon.com>
Sponsored by: EMC / Isilon Storage Division

9 years agoFix compilation when DEBUG is defined.
hselasky [Tue, 17 Feb 2015 08:57:36 +0000 (08:57 +0000)]
Fix compilation when DEBUG is defined.

Sponsored by: Mellanox Technologies
MFC after: 1 month

9 years agoRestore the extern qualifier on __cleanup.
kib [Tue, 17 Feb 2015 08:54:03 +0000 (08:54 +0000)]
Restore the extern qualifier on __cleanup.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

9 years agoSome minor style(9) fixes (whitespace + comment)
ngie [Tue, 17 Feb 2015 08:50:26 +0000 (08:50 +0000)]
Some minor style(9) fixes (whitespace + comment)

MFC after: 3 days

9 years agoUpdate the infiniband stack to Mellanox's OFED version 2.1.
hselasky [Tue, 17 Feb 2015 08:40:27 +0000 (08:40 +0000)]
Update the infiniband stack to Mellanox's OFED version 2.1.

Highlights:
 - Multiple verbs API updates
 - Support for RoCE, RDMA over ethernet

All hardware drivers depending on the common infiniband stack has been
updated aswell.

Discussed with: np @
Sponsored by: Mellanox Technologies
MFC after: 1 month

9 years agoTry to resolve infinite interrupts by clearing an undocumented
hselasky [Tue, 17 Feb 2015 07:52:50 +0000 (07:52 +0000)]
Try to resolve infinite interrupts by clearing an undocumented
interrupt status bit. According to the UHCI controller specification
the host controller halted interrupt is non-maskable.

PR: 156596
Tested by: adrian @
MFC after: 1 week

9 years agoRemove compat code for pre-FreeBSD 7 systems.
imp [Tue, 17 Feb 2015 05:10:41 +0000 (05:10 +0000)]
Remove compat code for pre-FreeBSD 7 systems.

9 years agoThis should have been GC'd 6 years ago when ar(4) was removed.
imp [Tue, 17 Feb 2015 05:07:38 +0000 (05:07 +0000)]
This should have been GC'd 6 years ago when ar(4) was removed.

9 years agoImplement taskqueue_start_threads_cpuset().
adrian [Tue, 17 Feb 2015 02:35:06 +0000 (02:35 +0000)]
Implement taskqueue_start_threads_cpuset().

This is a more generic version of taskqueue_start_threads_pinned()
which only supports a single cpuid.

This originally came from John Baldwin <jhb@> who implemented it
as part of a push towards NUMA awareness in drivers.  I started implementing
something similar for RSS and NUMA, then found he already did it.

I'd like to axe taskqueue_start_threads_pinned() so it doesn't become
part of a longer-term API.  (Read: hps@ wants to MFC things, and
if I don't do this soon, he'll MFC what's here. :-)

I have a follow-up commit which converts the intel drivers over
to using the cpuset version of this function, so we can eventually
nuke the the pinned version.

Tested:

* igb, ixgbe

Obtained from: jhbbsd

9 years agoHaving the TOC pointer in kernel dbeugger printouts is useful.
nwhitehorn [Tue, 17 Feb 2015 01:23:38 +0000 (01:23 +0000)]
Having the TOC pointer in kernel dbeugger printouts is useful.

9 years ago- Improve INET/INET6 scope.
glebius [Mon, 16 Feb 2015 23:50:53 +0000 (23:50 +0000)]
- Improve INET/INET6 scope.
- style(9) declarations.
- Make couple of local functions static.

9 years agoFix a typo when invoking tar(1) to create the debug distributions.
rpaulo [Mon, 16 Feb 2015 23:29:56 +0000 (23:29 +0000)]
Fix a typo when invoking tar(1) to create the debug distributions.

9 years agoArray cannot be NULL, remove always true comparision. ACPI spec
kib [Mon, 16 Feb 2015 22:18:43 +0000 (22:18 +0000)]
Array cannot be NULL, remove always true comparision.  ACPI spec
identifies the tested condition for _PRT as "BYTE value of 0", so the
remaining part of the conditionals is sufficient.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoUnbreak sparc64 after r276630 by calling __sparc_sigtramp_setup signal
marius [Mon, 16 Feb 2015 22:13:03 +0000 (22:13 +0000)]
Unbreak sparc64 after r276630 by calling __sparc_sigtramp_setup signal
trampoline as part of the MD __sys_sigaction again.

Submitted by: kib (initial versions)
MFC after: 3 days

9 years agoInitialize x2APIC mode on the resume path before accessing LAPIC.
kib [Mon, 16 Feb 2015 21:56:19 +0000 (21:56 +0000)]
Initialize x2APIC mode on the resume path before accessing LAPIC.

Remove unneeded disable of LAPIC in the native_lapic_xapic_mode().  We
attempt to send wakeup IPI on the resume path right after BSP wakeup,
so disabling is wrong.

Reported and tested by: glebius, "Ranjan1018 ." <214748mv@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 2 months

9 years agoToss declarations to fix regular build and NO_INET6 build.
glebius [Mon, 16 Feb 2015 21:52:28 +0000 (21:52 +0000)]
Toss declarations to fix regular build and NO_INET6 build.

9 years agorexec(3): prevent uninitialized access to "port" variable.
pfg [Mon, 16 Feb 2015 21:35:29 +0000 (21:35 +0000)]
rexec(3): prevent uninitialized access to "port" variable.

CID: 1018716 (and clang static checker)

9 years agoDefine standard formatting strings to print GIDs
hselasky [Mon, 16 Feb 2015 21:26:16 +0000 (21:26 +0000)]
Define standard formatting strings to print GIDs
in a separate header file.

Sponsored by: Mellanox Technologies
MFC after: 3 days

9 years agoThe kasprintf() function cannot be inlined due to using a variable
hselasky [Mon, 16 Feb 2015 21:22:56 +0000 (21:22 +0000)]
The kasprintf() function cannot be inlined due to using a variable
number of arguments. Move it to a C-file in the linuxapi module to
make the function usable.

Sponsored by: Mellanox Technologies
MFC after: 3 days

9 years agoAdd example for upcoming aarch64/arm64 targets.
sbruno [Mon, 16 Feb 2015 20:55:37 +0000 (20:55 +0000)]
Add example for upcoming aarch64/arm64 targets.

9 years agoAdd a mask to match only the relative base address of BSC controllers.
loos [Mon, 16 Feb 2015 19:06:31 +0000 (19:06 +0000)]
Add a mask to match only the relative base address of BSC controllers.

This should fix the attach of BSC on RPI2 (based on andrew@ dmesg).

9 years agoremove NULL check as M_WAITOK will not return NULL
jmg [Mon, 16 Feb 2015 18:43:52 +0000 (18:43 +0000)]
remove NULL check as M_WAITOK will not return NULL

Reviewed by: jhb
Sponsored by: FreeBSD Foundation

9 years agoCommit a miss from r278843.
glebius [Mon, 16 Feb 2015 18:33:33 +0000 (18:33 +0000)]
Commit a miss from r278843.

Pointy hat to: glebius

9 years agoFix build.
brd [Mon, 16 Feb 2015 18:06:24 +0000 (18:06 +0000)]
Fix build.

Approved by: gibbs

9 years agokdump: sendfile(2) "flags" argument needs casting on 64-bit platforms.
pluknet [Mon, 16 Feb 2015 17:19:28 +0000 (17:19 +0000)]
kdump: sendfile(2) "flags" argument needs casting on 64-bit platforms.

MFC after: 1 week
Sponsored by: Nginx, Inc.

9 years agoThe "frag_info" pointer is already pointing to an array index.
hselasky [Mon, 16 Feb 2015 17:05:59 +0000 (17:05 +0000)]
The "frag_info" pointer is already pointing to an array index.
Don't index twice.

Sponsored by: Mellanox Technologies
MFC after: 3 days

9 years agoxen/intr: improve handling of legacy IRQs
royger [Mon, 16 Feb 2015 16:37:59 +0000 (16:37 +0000)]
xen/intr: improve handling of legacy IRQs

Devices that use ISA IRQs expect them to be already configured, and don't
call bus_config_intr, which prevents those IRQs from working on Xen. In
order to solve it pre-register all the legacy IRQs with the default values
(edge triggered, low polarity) if no override is found.

While there add a panic if the registration of an interrupt override fails.

Sponsored by: Citrix Systems R&D

9 years agoxen/intr: improve PIRQ handling
royger [Mon, 16 Feb 2015 16:30:42 +0000 (16:30 +0000)]
xen/intr: improve PIRQ handling

Improve and cleanup the Xen PIRQ event channel code:

 - Remove the xi_shared field as it is unused.
 - Clean the "pending" bit in the EOI handler, this is more similar to how
   native interrupts are handled.
 - Don't mask edge triggered PIRQs, edge trigger interrupts cannot be
   masked.
 - Panic if PHYSDEVOP_eoi fails.
 - Remove the usage of the PHYSDEVOP_alloc_irq_vector hypercall because
   it's just a no-op in the Xen versions that are supported by FreeBSD Dom0.

Sponsored by: Citrix Systems R&D

9 years agoReduce number of memory buffers a bit.
hselasky [Mon, 16 Feb 2015 15:47:55 +0000 (15:47 +0000)]
Reduce number of memory buffers a bit.

9 years agoAvoid recursive locking.
hselasky [Mon, 16 Feb 2015 15:46:16 +0000 (15:46 +0000)]
Avoid recursive locking.

9 years agoSwap screen dimensions back to normal.
hselasky [Mon, 16 Feb 2015 15:39:51 +0000 (15:39 +0000)]
Swap screen dimensions back to normal.

9 years agoHandle VBUS error interrupts.
hselasky [Mon, 16 Feb 2015 15:34:10 +0000 (15:34 +0000)]
Handle VBUS error interrupts.

Submitted by: SAITOU Toshihide <toshi@ruby.ocn.ne.jp>
PR: 190471
MFC after: 1 week

9 years agovt: move suspend/resume event handlers registration outside of mutex scope
avg [Mon, 16 Feb 2015 13:02:00 +0000 (13:02 +0000)]
vt: move suspend/resume event handlers registration outside of mutex scope

This is to avoid a witness warning about a waiting memory allocation in
the evnt hanlder registration code.

Reported by: markj
MFC after: 3 days
X-MFC with: r277795

9 years agosymlink(7): Mention chflagsat() (can take AT_SYMLINK_NOFOLLOW).
jilles [Mon, 16 Feb 2015 12:56:55 +0000 (12:56 +0000)]
symlink(7): Mention chflagsat() (can take AT_SYMLINK_NOFOLLOW).

MFC after: 1 week

9 years agoAllow the display port to be powered off.
hselasky [Mon, 16 Feb 2015 11:54:45 +0000 (11:54 +0000)]
Allow the display port to be powered off.

9 years agoForward the FBIO_BLANK IOCTL to framebuffer clients. Bump the FreeBSD
hselasky [Mon, 16 Feb 2015 11:49:48 +0000 (11:49 +0000)]
Forward the FBIO_BLANK IOCTL to framebuffer clients. Bump the FreeBSD
version to force re-compilation of external video driver kernel
modules.

Discussed with: ray @

9 years agoxen: fix xenstore dev
royger [Mon, 16 Feb 2015 09:53:43 +0000 (09:53 +0000)]
xen: fix xenstore dev

Xenstore user-space device has two problems currently:
 - It does not correctly handle concurrent clients, because it's storing
   each client data in dev->si_drv1.
 - It does not correctly free this data when the client closes the device.

In order to solve both of this issues store the per-client data using
cdevpriv, which also comes with a hook in order to perform the necessary
cleanup on device close.

While there also make the device eternal.

Sponsored by: Citrix Systems R&D
Reported and Tested by: thompsa
MFC after: 2 weeks

9 years agoIn the forwarding case refragment the reassembled packets with the same
glebius [Mon, 16 Feb 2015 07:01:02 +0000 (07:01 +0000)]
In the forwarding case refragment the reassembled packets with the same
size as they arrived in. This allows the sender to determine the optimal
fragment size by Path MTU Discovery.

Roughly based on the OpenBSD work by Alexander Bluhm.

Submitted by: Kristof Provost
Differential Revision: D1767

9 years agoFactor out ip6_fragment() function, to be used in IPv6 stack and pf(4).
glebius [Mon, 16 Feb 2015 06:30:27 +0000 (06:30 +0000)]
Factor out ip6_fragment() function, to be used in IPv6 stack and pf(4).

Submitted by: Kristof Provost
Differential Revision: D1766

9 years agosfxge: flush all Tx queues from if_qflush
arybchik [Mon, 16 Feb 2015 06:16:38 +0000 (06:16 +0000)]
sfxge: flush all Tx queues from if_qflush

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius

9 years agoXref the following in wlan(4):
kevlo [Mon, 16 Feb 2015 06:12:55 +0000 (06:12 +0000)]
Xref the following in wlan(4):

- rsu(4)
- urtwn(4)

9 years agosfxge: style fixes
arybchik [Mon, 16 Feb 2015 06:12:04 +0000 (06:12 +0000)]
sfxge: style fixes

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

9 years agosfxge: SYSCTL_IN/OUT should not be called with non-sleepable lock held
arybchik [Mon, 16 Feb 2015 06:10:17 +0000 (06:10 +0000)]
sfxge: SYSCTL_IN/OUT should not be called with non-sleepable lock held

The problem is found using WITNESS option enabled.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

9 years agosfxge: remove inline specifiers
arybchik [Mon, 16 Feb 2015 06:08:13 +0000 (06:08 +0000)]
sfxge: remove inline specifiers

Now compiler does not need any help.
The patch does not change generated code.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius

9 years agosfxge: remove used sfxge_tso_state member dma_seg_i
arybchik [Mon, 16 Feb 2015 06:07:01 +0000 (06:07 +0000)]
sfxge: remove used sfxge_tso_state member dma_seg_i

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)

9 years agosfxge: remove full_packet_size from sfxge_tso_state
arybchik [Mon, 16 Feb 2015 06:04:26 +0000 (06:04 +0000)]
sfxge: remove full_packet_size from sfxge_tso_state

It makes sfxge_tso_state smaller and even makes tso_start_new_packet()
few bytes smaller. Data used to calculate packet size are used nearby,
so it should be no problems with cache etc.

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius

9 years agoMissed from r278831.
glebius [Mon, 16 Feb 2015 06:02:46 +0000 (06:02 +0000)]
Missed from r278831.

9 years agosfxge: remove unused variable
arybchik [Mon, 16 Feb 2015 06:00:43 +0000 (06:00 +0000)]
sfxge: remove unused variable

Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor), glebius

9 years agoMove ip6_deletefraghdr() to frag6.c.
glebius [Mon, 16 Feb 2015 05:58:32 +0000 (05:58 +0000)]
Move ip6_deletefraghdr() to frag6.c.

Suggested by: bz

9 years agoUpdate the pf fragment handling code to closer match recent OpenBSD.
glebius [Mon, 16 Feb 2015 03:38:27 +0000 (03:38 +0000)]
Update the pf fragment handling code to closer match recent OpenBSD.
That partially fixes IPv6 fragment handling. Thanks to Kristof for
working on that.

Submitted by: Kristof Provost
Tested by: peter
Differential Revision: D1765