]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

9 years agoinstall the man page...
jmg [Mon, 16 Feb 2015 02:20:11 +0000 (02:20 +0000)]
install the man page...

Sponsored by: FreeBSD Foundation

9 years agoRemove this - I made it all work again a looong time ago.
adrian [Mon, 16 Feb 2015 02:05:34 +0000 (02:05 +0000)]
Remove this - I made it all work again a looong time ago.

9 years agoFactor out ip6_deletefraghdr() function, to be shared between IPv6
glebius [Mon, 16 Feb 2015 01:12:20 +0000 (01:12 +0000)]
Factor out ip6_deletefraghdr() function, to be shared between IPv6
stack and pf(4).

Submitted by: Kristof Provost
Reviewed by: ae
Differential Revision: D1764

9 years agoIf no arguments are passed to a subcommand that requires arguments,
sbruno [Sun, 15 Feb 2015 23:58:57 +0000 (23:58 +0000)]
If no arguments are passed to a subcommand that requires arguments,
error out before we deref a null pointer in the check for max length.

Thanks to otis in IRC for the bug report.

MFC after: 3 days

9 years agosh: Various cleanups to expand.c:
jilles [Sun, 15 Feb 2015 22:38:00 +0000 (22:38 +0000)]
sh: Various cleanups to expand.c:

* Remove some gotos.
* Remove unused parameter.
* Remove duplicate code.

9 years agoAdd new device ID.
hselasky [Sun, 15 Feb 2015 22:06:28 +0000 (22:06 +0000)]
Add new device ID.

9 years agoBugfixes. Check if a framebuffer is present before using it. Dequeue
hselasky [Sun, 15 Feb 2015 22:05:30 +0000 (22:05 +0000)]
Bugfixes. Check if a framebuffer is present before using it. Dequeue
element from correct head structure. No need to multiply framebuffer
offset by two. It is already given in bytes.

9 years agosh: Prefer "" to nullstr where possible.
jilles [Sun, 15 Feb 2015 21:47:43 +0000 (21:47 +0000)]
sh: Prefer "" to nullstr where possible.

9 years agoReally fix the pw_usernext tests.
brd [Sun, 15 Feb 2015 21:42:10 +0000 (21:42 +0000)]
Really fix the pw_usernext tests.

PR: 197612
Approved by: will

9 years agosh: Add stsavestr(), like savestr() but allocates using stalloc().
jilles [Sun, 15 Feb 2015 21:41:29 +0000 (21:41 +0000)]
sh: Add stsavestr(), like savestr() but allocates using stalloc().

9 years agotouch: Fix some subtle bugs related to NULL times fallback:
jilles [Sun, 15 Feb 2015 21:28:00 +0000 (21:28 +0000)]
touch: Fix some subtle bugs related to NULL times fallback:

* Do not subvert vfs.timestamp_precision by reading the time and passing
  that to utimensat(). Instead, pass UTIME_NOW. A fallback to a NULL times
  pointer is no longer used.

* Do not ignore -a/-m if the user has write access but does not own the
  file. Leave timestamps unchanged using UTIME_OMIT and do not fall back to
  a NULL times pointer (which would set both timestamps) if that fails.

Reviewed by: bde

9 years agoAdd initial support to the AR9300 HAL to support FreeBSD's intmit API.
adrian [Sun, 15 Feb 2015 21:15:09 +0000 (21:15 +0000)]
Add initial support to the AR9300 HAL to support FreeBSD's intmit API.

I don't like having it in this function; I may migrate it to ar9300_freebsd.c
at some point to keep the HAL code pollution down.

This allows ANI to be disabled via a sysctl.

Tested:

* AR9331, STA/TDMA modes

9 years agoReplace strcpy() with strlcpy()
pfg [Sun, 15 Feb 2015 21:11:07 +0000 (21:11 +0000)]
Replace strcpy() with strlcpy()

The risk of an overrun here is very low but check the
length, JIC.

CID: 1019039

9 years agoReverse one of the initializations from r278804.
pfg [Sun, 15 Feb 2015 21:03:49 +0000 (21:03 +0000)]
Reverse one of the initializations from r278804.

It does no harm but this is not needed after the
correction in r278805 and I prefer to keep this
code very similar to it's original state.

9 years agotimeout: handle zombie grandchildren
emaste [Sun, 15 Feb 2015 20:10:53 +0000 (20:10 +0000)]
timeout: handle zombie grandchildren

timeout previously collected only one child status with wait(2). If this
was one of the grandchildren timeout would return to sigsuspend and wait
until the timeout expired. Instead, loop for all children.

PR: kern/197608
Reviewed by: bapt, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 years agoAdd ath_hal_setbeacontimers() to the AR9300 HAL.
adrian [Sun, 15 Feb 2015 19:56:31 +0000 (19:56 +0000)]
Add ath_hal_setbeacontimers() to the AR9300 HAL.

This is a custom FreeBSD HAL method that is used by the TDMA code
to program the beacon timers directly without any guesswork/assumptions
by the HAL.

This brings up basic TDMA master/slave support on the AR9380 HAL,
however there are other issues preventing it from being stable.
(I'm seeing beacon interval instability, which may be due to
busy 2GHz air, but also may be due to some HAL configuration
issues with regards to ANI, or hardware timer programming, etc.)

Tested:

* AR9331 (Carambola2), STA, AP, adhoc and TDMA master mode.

9 years agosh: Add simple tests for globbing/splitting command substitution.
jilles [Sun, 15 Feb 2015 19:48:29 +0000 (19:48 +0000)]
sh: Add simple tests for globbing/splitting command substitution.

9 years agoMismatch in r278804.
pfg [Sun, 15 Feb 2015 18:02:05 +0000 (18:02 +0000)]
Mismatch in r278804.

9 years agoMore tidy-ups on uninitialized scalar variable
pfg [Sun, 15 Feb 2015 16:50:21 +0000 (16:50 +0000)]
More tidy-ups on uninitialized scalar variable

As a followup to r278363, there is one more case where
stayopen can be accessed uninitialized, but even after
swapping arguments, access is possible in some other
cases so prevent it completely by initializing stayopen.

CID: 1018729
CID: 1018732

9 years agoulimit(3): Fix broken check.
pfg [Sun, 15 Feb 2015 14:31:50 +0000 (14:31 +0000)]
ulimit(3): Fix broken check.

The existing implementation had a broken comparison that could
overflow and return confusing values.  Replace this with a check
that avoids the overflow before it happens.

Consistently return a maximum value also on the case of negative
arguments since negative is considered an overflow and means
infinity for our current setrlimit().

New revamped version is credited to Bruce Evans.

CID: 1199295
MFC after: 1 week

9 years agoext2fs: Plug small memory leak
pfg [Sun, 15 Feb 2015 14:25:00 +0000 (14:25 +0000)]
ext2fs: Plug small memory leak

free() e2fs_contigdirs upon error.
Undo zeroing of e2fs_gd as this was actually a false positive.

X-MFC with: 278790

9 years agoImport USB display link driver from OpenBSD. Support for compression
hselasky [Sun, 15 Feb 2015 12:02:17 +0000 (12:02 +0000)]
Import USB display link driver from OpenBSD. Support for compression
has been removed and the driver has been greatly simplified and
optimised for FreeBSD. The driver is currently not built by default.

Requested by: Bruce Simpson <bms@fastmail.net>

9 years agoImport videomode code from NetBSD which is needed by USB display link drivers.
hselasky [Sun, 15 Feb 2015 11:37:40 +0000 (11:37 +0000)]
Import videomode code from NetBSD which is needed by USB display link drivers.

9 years agoAdd the structures needed to get/set the power state. These can be used
andrew [Sun, 15 Feb 2015 11:23:27 +0000 (11:23 +0000)]
Add the structures needed to get/set the power state. These can be used
when, for example, we boot without U-Boot and wish to enable USB, or to
suspend an unneeded device.

MFC after: 1 week

9 years agoReparenting done by debugger attach can leave reaper without direct
kib [Sun, 15 Feb 2015 08:44:30 +0000 (08:44 +0000)]
Reparenting done by debugger attach can leave reaper without direct
children.  Handle the situation instead asserting that it is
impossible.

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

9 years agoReturn with the process locked, caller expects p still locked after
kib [Sun, 15 Feb 2015 08:43:19 +0000 (08:43 +0000)]
Return with the process locked, caller expects p still locked after
the call.

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

9 years agoReuse value of cursize instead of recalculating.
pfg [Sun, 15 Feb 2015 01:34:00 +0000 (01:34 +0000)]
Reuse value of cursize instead of recalculating.

Reported by: Clang static checker
MFC after: 1 week

9 years agoInitialize the allocation of variables related to the ext2 allocator.
pfg [Sun, 15 Feb 2015 01:12:15 +0000 (01:12 +0000)]
Initialize the allocation of variables related to the ext2 allocator.

The e2fs_gd struct was not being initialized and garbage was
being used for hinting the ext2 allocator variant.
Use malloc to clear the values and also initialize e2fs_contigdirs
during allocation to keep consistency.

While here clean up small style issues.

Reported by: Clang static analyser
MFC after: 1 week

9 years agoQuirk based support of Chromebook keyboard found in Acer C720
grembo [Sat, 14 Feb 2015 22:12:17 +0000 (22:12 +0000)]
Quirk based support of Chromebook keyboard found in Acer C720

This probably supports other devices based on SeaBIOS, which need
to be added to the smbios based quirks table.

The functionality has been ported from DragonFlyBSD and adapted
to FreeBSD's more general purpose environment.

Devices not covered by a quirk shouldn't be affected at all. Thanks
to jhb and kostikbel for reviewing the code.

Reviewed by: kostikbel, jhb
Approved by: jhb, kostikbel
Differential Revision: https://reviews.freebsd.org/D1802

9 years agoDon't access sockbuf fields directly, use accessor functions instead.
davide [Sat, 14 Feb 2015 20:00:57 +0000 (20:00 +0000)]
Don't access sockbuf fields directly, use accessor functions instead.
It is safe to move the call to socantsendmore_locked() after
sbdrop_locked() as long as we hold the sockbuf lock across the two
calls.

CR: D1805
Reviewed by: adrian, kmacy, julian, rwatson

9 years agoRefactor pkill-j_test to reflect the relevant changes done to pgrep-j_test
ngie [Sat, 14 Feb 2015 19:21:04 +0000 (19:21 +0000)]
Refactor pkill-j_test to reflect the relevant changes done to pgrep-j_test

r278742:

Simplify jail_name_to_jid and try to be more fault tolerant when scanning for
the jail ID (poll up to 10 times for the jail IDs to become available)

If the scan fails, the code will fall through and fail as it does with Jenkins
today

r278636:

Parameterize out the amount of sleep done in each test

Set the value in each test to a different amount to avoid potential
side-effects with other instances of the test (or lingering processes) still
being present on the system

r278633:

Refactor the tests

1. `id -u` -> 0 is now only checked once; the entire test script is now skipped
   if this assertion is violated
2. De-dent whitespace, based on 1.
3. Only setup the symlink for $sleep once at the top of the script, and tear it
   down once at the bottom of the script

9 years agotwo minor changes from the master netmap version:
luigi [Sat, 14 Feb 2015 19:03:11 +0000 (19:03 +0000)]
two minor changes from the master netmap version:
1. handle errors from nm_config(), if any (none of the FreeBSD drivers
   currently returns an error on this function, so this change
   is a no-op at this time
2. use a full memory barrier on ioctls

9 years agowhitespace change:
luigi [Sat, 14 Feb 2015 18:59:31 +0000 (18:59 +0000)]
whitespace change:
clarify the role of MAKEDEV_ETERNAL_KLD, and remove an old
#ifdef __FreeBSD__ since the code is valid on all platforms.

9 years agoAdd logic for handling new-style ARM cpu ID info.
ian [Sat, 14 Feb 2015 18:54:52 +0000 (18:54 +0000)]
Add logic for handling new-style ARM cpu ID info.

Submitted by: Michal Meloun <meloun@miracle.cz>

9 years agoRemove an extra curly bracket that was causing intermittent failures.
brd [Sat, 14 Feb 2015 18:22:31 +0000 (18:22 +0000)]
Remove an extra curly bracket that was causing intermittent failures.

PR: 197612
Submitted by: Robert O'Niel <oneil.rs@gmail.com>
Approved by: will

9 years agoFix a panic when tearing down a vnet on a VIMAGE-enabled kernel.
hrs [Sat, 14 Feb 2015 18:15:14 +0000 (18:15 +0000)]
Fix a panic when tearing down a vnet on a VIMAGE-enabled kernel.
There was a race that bridge_ifdetach() could be called via
ifnet_departure event handler after vnet_bridge_uninit().

PR: 195859
Reported by: Danilo Egea Gondolfo

9 years agoMove the lock destruction/creation to earlier in the process - if
adrian [Sat, 14 Feb 2015 18:14:45 +0000 (18:14 +0000)]
Move the lock destruction/creation to earlier in the process - if
interrupts are enabled and the NIC is awake (think: loading a module)
then there's a not-quite-zero window where we'll get an interrupt
for the device before the attach method is called to finish setting
up the hardware.

Since I grab locks in ath_intr() to check various things, the locks
need to be ready much earlier.

9 years agoMore fixes to wpi(4), again not by me! Woo!
adrian [Sat, 14 Feb 2015 17:45:53 +0000 (17:45 +0000)]
More fixes to wpi(4), again not by me! Woo!

- Use IEEE80211_F_DATAPAD;
- (c->ic_flags & IEEE80211_CHAN_PASSIVE) -> IEEE80211_IS_CHAN_PASSIVE(c);
- Convert ackfailcnt to int (there is dereference to *(int *) in ieee80211_ratectl_tx_complete());
- Fix & move cleanup to the end in wpi_rx_done();
- Add missed lock in wpi_update_beacon();
- Try to fix powersave.

PR: kern/197143
Submitted by:  Andriy Voskoboinyk <s3erios@gmail.com>

9 years agoComment out a double declaration of this particular function name.
adrian [Sat, 14 Feb 2015 17:44:24 +0000 (17:44 +0000)]
Comment out a double declaration of this particular function name.
It trips up gcc builds.

Pointy-hat-from: jenkins, kib

9 years agoQuieten a clang warning.
adrian [Sat, 14 Feb 2015 17:43:54 +0000 (17:43 +0000)]
Quieten a clang warning.

9 years agoInclude OBJT_PHYS VM objects in ELF core dumps. In particular this
jhb [Sat, 14 Feb 2015 17:12:31 +0000 (17:12 +0000)]
Include OBJT_PHYS VM objects in ELF core dumps. In particular this
includes the shared page allowing debuggers to use the signal trampoline
code to identify signal frames in core dumps.

Differential Revision: https://reviews.freebsd.org/D1828
Reviewed by: alc, kib
MFC after: 1 week

9 years agoAdd two new counters for vnode life cycle events:
jhb [Sat, 14 Feb 2015 17:02:51 +0000 (17:02 +0000)]
Add two new counters for vnode life cycle events:
- vfs.recycles counts the number of vnodes forcefully recycled to avoid
  exceeding kern.maxvnodes.
- vfs.vnodes_created counts the number of vnodes created by successful
  calls to getnewvnode().

Differential Revision: https://reviews.freebsd.org/D1671
Reviewed by: kib
MFC after: 1 week

9 years agoRemove the reserved pin 11 from the HAL check.
adrian [Sat, 14 Feb 2015 16:23:04 +0000 (16:23 +0000)]
Remove the reserved pin 11 from the HAL check.

The QCA9565 can have RFKILL on GPIO Pin 11, and thus we need to configure
it up correctly or the NIC may not function.

I'm not sure why the AR9382 can't use GPIO 8 / GPIO 11 ; it's likely
hooked up to some external LNA or filter.  The real solution is to
make it only block pin 8 / pin 11 for AR9382, but the AR9382 probes
like an AR9380.  Sigh.

Submitted by: Anthony Jenkins <scoobi_doo@yahoo.com>

9 years agoThe ld(1) flag is -Bsymbolic not -Wsymbolic.
tijl [Sat, 14 Feb 2015 15:14:41 +0000 (15:14 +0000)]
The ld(1) flag is -Bsymbolic not -Wsymbolic.

9 years agoProperly interpose libc spinlocks, was missed in r276630. In
kib [Sat, 14 Feb 2015 11:47:40 +0000 (11:47 +0000)]
Properly interpose libc spinlocks, was missed in r276630.  In
particular, stdio locking was affected.

Reported and tested by: "Matthew D. Fuller" <fullermd@over-yonder.net>
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

9 years agoDetect whether x2APIC on VMWare is usable without interrupt
kib [Sat, 14 Feb 2015 09:00:12 +0000 (09:00 +0000)]
Detect whether x2APIC on VMWare is usable without interrupt
redirection support.  Older versions of the hypervisor mis-interpret
the cpuid format in ioapic registers when x2APIC is turned on, but IR
is not used by the guest OS.

Based on: Linux commit 4cca6ea04d31c22a7d0436949c072b27bde41f86
Tested by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 months

9 years agoSimplify jail_name_to_jid and try to be more fault tolerant when scanning for
ngie [Sat, 14 Feb 2015 06:19:24 +0000 (06:19 +0000)]
Simplify jail_name_to_jid and try to be more fault tolerant when scanning for
the jail ID (poll up to 10 times for the jail IDs to become available)

If the scan fails, the code will fall through and fail as it does with Jenkins
today

9 years agoUpdate the AR9300 HAL to the latest public available HAL from QCA.
adrian [Sat, 14 Feb 2015 04:28:51 +0000 (04:28 +0000)]
Update the AR9300 HAL to the latest public available HAL from QCA.

I've been sitting on this for a year or so now; I've finally
tested it on enough devices to be reasonably sure it won't
cause too much drama.  But, if you see issues, please email me.

Tested (all STA mode):

PCIe:

* AR9380
* AR9390
* AR9580
* AR9462
* AR9485

SoC:

* QCA9550
* AR9331
* AR9342

9 years agoDisallow pattern spaces which would cause intermediate calculations to
delphij [Sat, 14 Feb 2015 00:23:53 +0000 (00:23 +0000)]
Disallow pattern spaces which would cause intermediate calculations to
overflow size_t.

Obtained from: DragonFly (2841837793bd095a82f477e9c370cfe6cfb3862c dillon)
Security: CERT VU#695940
MFC after: 3 days

9 years agoTweak the fds test program so that it actually compiles. Also use 0 instead
markj [Sat, 14 Feb 2015 00:03:43 +0000 (00:03 +0000)]
Tweak the fds test program so that it actually compiles. Also use 0 instead
of -1 for the bogus ioctl command so that dmesg doesn't get spammed with
sign extension warnings when the test program runs.

MFC after: 1 week

9 years agoUse less ugly code to allocate buffer of SORCVBUF_SIZE.
glebius [Fri, 13 Feb 2015 23:57:20 +0000 (23:57 +0000)]
Use less ugly code to allocate buffer of SORCVBUF_SIZE.

9 years agoRemove disconnected (and broken) directory libiconv. It was added in the
bdrewery [Fri, 13 Feb 2015 23:35:58 +0000 (23:35 +0000)]
Remove disconnected (and broken) directory libiconv.  It was added in the
initial citrus import in r219019 but never used as iconv is just built with
libc.  A libiconv.so was handled by lib/libiconv_compat for a while but removed
in r257583.

9 years agosbspace: size of bleft, mleft must match sockbuf fields to avoid
sjg [Fri, 13 Feb 2015 23:19:35 +0000 (23:19 +0000)]
sbspace: size of bleft, mleft must match sockbuf fields to avoid
overflow on amd64

Submitted by: anshukla@juniper.net
Obtained from: Juniper Networks

9 years ago(backup_kernel_finddir, backup_kernel, install_files):
thomas [Fri, 13 Feb 2015 22:55:25 +0000 (22:55 +0000)]
(backup_kernel_finddir, backup_kernel, install_files):
Add missing references to $BASEDIR, in order to allow correct operation
when updating a system mounted at another location than / (e.g. when
updating an alternate Boot Environment).

Reviewed by: cperciva
MFC after: 1 week

9 years agoUnbreak rcorder when MK_UTX == no by moving utx from REQUIRE: in LOGIN to
ngie [Fri, 13 Feb 2015 20:52:23 +0000 (20:52 +0000)]
Unbreak rcorder when MK_UTX == no by moving utx from REQUIRE: in LOGIN to
BEFORE: in utx

MFC after: 1 week

9 years agoUnbreak rcorder when MK_UNBOUND == no by moving local_unbound from REQUIRE:
ngie [Fri, 13 Feb 2015 20:49:43 +0000 (20:49 +0000)]
Unbreak rcorder when MK_UNBOUND == no by moving local_unbound from REQUIRE:
in NETWORKING to BEFORE: in the script

MFC after: 2 weeks

9 years agoPreset the object's color, or alignment, to maximize superpage usage.
alc [Fri, 13 Feb 2015 19:58:53 +0000 (19:58 +0000)]
Preset the object's color, or alignment, to maximize superpage usage.

MFC after: 5 days

9 years agosrandom has no influence on read_random, at least not this late...
jmg [Fri, 13 Feb 2015 19:44:04 +0000 (19:44 +0000)]
srandom has no influence on read_random, at least not this late...

9 years agoAdd an auto-generated file to CLEANFILES.
markj [Fri, 13 Feb 2015 18:34:04 +0000 (18:34 +0000)]
Add an auto-generated file to CLEANFILES.

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

9 years agoCheck for an error from daemon(3), and correct the check for an error from
markj [Fri, 13 Feb 2015 18:32:55 +0000 (18:32 +0000)]
Check for an error from daemon(3), and correct the check for an error from
socket(2).

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

9 years agoMake the extra dependencies in DPADD be dependencies of PROG_FULL and
jhb [Fri, 13 Feb 2015 17:33:27 +0000 (17:33 +0000)]
Make the extra dependencies in DPADD be dependencies of PROG_FULL and
SHLIB_NAME_FULL so that the full binary is relinked when a dependency
changes.  Right now the existing full binary is left as-is and only
the objcopy to remove debug symbols is run.

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

9 years agoAdd more functions to the Linux kernel compatibility layer. Add some
hselasky [Fri, 13 Feb 2015 16:35:12 +0000 (16:35 +0000)]
Add more functions to the Linux kernel compatibility layer. Add some
missing includes which are needed when the header files are not
included in a particular order.

MFC after: 1 month
Sponsored by: Mellanox Technologies