freebsd.git
9 years agoAdd pthread_md.h for arm64.
andrew [Mon, 30 Mar 2015 19:10:09 +0000 (19:10 +0000)]
Add pthread_md.h for arm64.

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

9 years agoSigh. s/AutoSize/Growfs/ following upstream commit r761.
gjb [Mon, 30 Mar 2015 19:08:37 +0000 (19:08 +0000)]
Sigh.  s/AutoSize/Growfs/ following upstream commit r761.

MFH: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoSwitch to ELF toolchain readelf(1)
emaste [Mon, 30 Mar 2015 17:38:25 +0000 (17:38 +0000)]
Switch to ELF toolchain readelf(1)

ELF toolchain readelf lacked some functionality at the time other tools
(like size, strip, nm, etc.) were switched over to the ELF toolchain
versions. That has been addressed as of the last update, so we can add
it to the list.

PR: 198950 [exp-run]
Reviewed by: bapt, imp, rpaulo
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2156

9 years agoFill out arm64 dynamic relocation #defines
emaste [Mon, 30 Mar 2015 17:15:48 +0000 (17:15 +0000)]
Fill out arm64 dynamic relocation #defines

Sponsored by: The FreeBSD Foundation

9 years agoCorrect mrs_fpcr and mrs_fpsr macros in arm64 fenv.h
emaste [Mon, 30 Mar 2015 16:42:08 +0000 (16:42 +0000)]
Correct mrs_fpcr and mrs_fpsr macros in arm64 fenv.h

Submitted by: andrew
Sponsored by: The FreeBSD Foundation

9 years agocompiler-rt: Build additional quad precision floating point builtins
emaste [Mon, 30 Mar 2015 14:28:31 +0000 (14:28 +0000)]
compiler-rt: Build additional quad precision floating point builtins

These are needed for arm64

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2160

9 years ago- Remove more files when MK_INET6 == no
amdmi3 [Mon, 30 Mar 2015 14:13:01 +0000 (14:13 +0000)]
- Remove more files when MK_INET6 == no

MFC after: 1 week
Reviewed by: ngie
Approved by: ngie
Differential Revision: D1600

9 years ago- Remove more files when MK_FORTH == no
amdmi3 [Mon, 30 Mar 2015 14:00:17 +0000 (14:00 +0000)]
- Remove more files when MK_FORTH == no

MFC after: 1 week
Reviewed by: ngie
Approved by: ngie
Differential Revision: D1600

9 years agoPeriodically wake up threads waiting for vmem(9) resources, so they could
mav [Mon, 30 Mar 2015 13:30:53 +0000 (13:30 +0000)]
Periodically wake up threads waiting for vmem(9) resources, so they could
ask for resource reclamation again.

This is kind of dirty hack, but as last resort this is better then stuck
indefinitely because of KVA fragmentation, waiting until some random event
free something sufficient.  OpenSolaris also has this hack in its vmem(9).

MFC after: 2 weeks

9 years agoMFV ntp 4.2.8p1 (r258945, r275970, r276091, r276092, r276093, r278284)
cy [Mon, 30 Mar 2015 13:30:15 +0000 (13:30 +0000)]
MFV ntp 4.2.8p1 (r258945, r275970, r276091, r276092, r276093, r278284)

Thanks to roberto for providing pointers to wedge this into HEAD.

Approved by: roberto

9 years agoFix bug in xrefinfo_find() for 64-bit platforms
zbb [Mon, 30 Mar 2015 09:49:54 +0000 (09:49 +0000)]
Fix bug in xrefinfo_find() for 64-bit platforms

uintptr_t may be 64-bit on some platforms, therefore when
finding xrefinfo by pointer to device the high word is being
cut off due to cast to phandle_t which is 32-bit long by definition.
Due to that we loose the high word of the address to compare with
xi->dev's address.
To fix that, first argument of xrefinfo_find() is extended to
uintptr_t and is being cast to appropriate type (phandle_t)
when compared.

Submitted by:  Zbigniew Bodek <zbb@semihalf.com>
Reviewed by:   nwhitehorn
Obtained from: Semihalf

9 years agoRemove support for CPU_XSCALE_80200. None of our configs support it, and
andrew [Mon, 30 Mar 2015 09:29:45 +0000 (09:29 +0000)]
Remove support for CPU_XSCALE_80200. None of our configs support it, and
there wasn;t an option to enable it.

While here remove a check for CPU_ARM10 being defined as it has also been
removed.

9 years agoImprove check for whether ${DESTDIR}/dev is mounted.
cperciva [Mon, 30 Mar 2015 09:08:24 +0000 (09:08 +0000)]
Improve check for whether ${DESTDIR}/dev is mounted.

Submitted by: gcooper

9 years agoAdd some additional quirks for various Western Digital Caviar MHDDs
eadler [Mon, 30 Mar 2015 09:05:20 +0000 (09:05 +0000)]
Add some additional quirks for various Western Digital Caviar MHDDs

Submitted by: Jeremy Chadwick
PR: 188685
MFC After: 1 month

9 years agoAnd it turns out someone beat me to it....
eadler [Mon, 30 Mar 2015 08:54:59 +0000 (08:54 +0000)]
And it turns out someone beat me to it....

PR: 199013

9 years agoAdd support for "MosChip MCS9922 PCIe to Peripheral Controller" to uart
eadler [Mon, 30 Mar 2015 08:48:35 +0000 (08:48 +0000)]
Add support for "MosChip MCS9922 PCIe to Peripheral Controller" to uart

Submitted by: <mlsemon35@gmail.com>
PR: 199013
MFC After: 1 month

9 years agoRemove support for CPU_FA626TE. It's unused by any of our kernel configs.
andrew [Mon, 30 Mar 2015 08:38:18 +0000 (08:38 +0000)]
Remove support for CPU_FA626TE. It's unused by any of our kernel configs.

9 years agoOnly build cpufunc_asm_armv4.S when needed.
andrew [Mon, 30 Mar 2015 08:37:03 +0000 (08:37 +0000)]
Only build cpufunc_asm_armv4.S when needed.

9 years agoClean up filesystem unmounting in vmimage builds:
cperciva [Mon, 30 Mar 2015 08:33:19 +0000 (08:33 +0000)]
Clean up filesystem unmounting in vmimage builds:
* Remove vm_umount_base function which is currently unused.
* Add umount_loop function which loops attempting to unmount one filesystem.
* Replace calls to umount with calls to umount_loop.
* Don't attempt to unmount ${DESTDIR}/dev if it isn't mounted.

The looping is necessary because sometimes umount fails due to filesystems
being busy.  The most common cause of such busyness is periodic(8) jobs
running `find / ...`.

Reviewed by: gjb

9 years agoxen: add a handler for the debug interrupt
royger [Mon, 30 Mar 2015 07:09:07 +0000 (07:09 +0000)]
xen: add a handler for the debug interrupt

Handle the VIRQ_DEBUG signal and print a stack trace of each vCPU on the Xen
console. This is only used for debug purposes and is triggered by the
administrator of the Xen host.

Sponsored by: Citrix Systems R&D
MFC after: 1 week

9 years agoFix ping(8) and ping6(8) usage in a couple of ip provider tests, and
markj [Mon, 30 Mar 2015 04:06:36 +0000 (04:06 +0000)]
Fix ping(8) and ping6(8) usage in a couple of ip provider tests, and
update expected test output to reflect differences in default TTL and
payload length.

MFC after: 1 week

9 years agoFix ping(8) usage in funcs/tst.system.d so that the test actually completes.
markj [Mon, 30 Mar 2015 04:03:01 +0000 (04:03 +0000)]
Fix ping(8) usage in funcs/tst.system.d so that the test actually completes.

MFC after: 1 week

9 years agoReplace dtest.pl, the upstream DTrace test suite harness, with a shell
markj [Mon, 30 Mar 2015 04:01:49 +0000 (04:01 +0000)]
Replace dtest.pl, the upstream DTrace test suite harness, with a shell
script. This reimplementation is much simpler than dtest.pl and is more
amenable to being run under Kyua - dtest.pl writes error output to a
temporary directory that is deleted when the run finishes, making it hard
to debug test failures. This change also removes the test suite's dependency
on perl.

9 years agoImport a missing piece of commit b8fac8e162eda7e98d from illumos-gate.
markj [Mon, 30 Mar 2015 03:55:51 +0000 (03:55 +0000)]
Import a missing piece of commit b8fac8e162eda7e98d from illumos-gate.

This adds an upper bound, dtrace_ustackdepth_max, to the number of frames
traversed when computing the userland stack depth. Some programs - notably
firefox - are otherwise able to trigger an infinite loop in
dtrace_getustack_common(), causing a panic.

MFC after: 1 week

9 years agoarm11_sleep is no longer needed, remove it.
andrew [Sun, 29 Mar 2015 22:46:07 +0000 (22:46 +0000)]
arm11_sleep is no longer needed, remove it.

9 years agopj4b_config and pj4bv7_setup are only used when CPU_MV_PJ4B is defined.
andrew [Sun, 29 Mar 2015 22:45:33 +0000 (22:45 +0000)]
pj4b_config and pj4bv7_setup are only used when CPU_MV_PJ4B is defined.

9 years agoBuild the cpufunc_asm_* files based on the cpu type, not which config file
andrew [Sun, 29 Mar 2015 22:43:39 +0000 (22:43 +0000)]
Build the cpufunc_asm_* files based on the cpu type, not which config file
we happen to be building.

9 years agowordexp(): Add testcase for non-default IFS in environment.
jilles [Sun, 29 Mar 2015 22:00:24 +0000 (22:00 +0000)]
wordexp(): Add testcase for non-default IFS in environment.

The non-default IFS is expected to be used.

MFC after: 1 week

9 years agoAdd initial support for the HAL channel survey support to the AR9300 HAL.
adrian [Sun, 29 Mar 2015 21:53:08 +0000 (21:53 +0000)]
Add initial support for the HAL channel survey support to the AR9300 HAL.

This is used by the 'athsurvey' command to print out channel survey
statistics - % busy times transmit, receive and airtime.

It's as buggy and incomplete as the rest of the HAL survey support -
notably, tying into the ANI code to read channel stats and occasionally
getting garbage counters isn't very nice.  It also doesn't (yet!) get
channel survey information during a scan.  But it's good enough for
basic air-time debugging, which is why I'm committing it in this state.

Tested:

* AR9380, STA mode

9 years agoMove the HAL channel survey support out to be in the top-level HAL,
adrian [Sun, 29 Mar 2015 21:50:21 +0000 (21:50 +0000)]
Move the HAL channel survey support out to be in the top-level HAL,
rathe than private in each HAL module.

Whilst here, modify ath_hal_private to always have the per-channel
noisefloor stats, rather than conditionally.  This just makes
life easier in general (no strange ABI differences between different
HAL compile options.)

Add a couple of methods (clear/reset, add) rather than using
hand-rolled versions of things.

9 years agoAdd a new field to HAL_ANISTATS - the extension channel busy count.
adrian [Sun, 29 Mar 2015 21:45:48 +0000 (21:45 +0000)]
Add a new field to HAL_ANISTATS - the extension channel busy count.

This is only used by the AR9300 HAL for now - but just be careful if
you decide to recompile the kernel with NO_CLEAN=1.

9 years agoRemove cpufunc_asm_arm11.S from the ARMv7 configs, it's not used.
andrew [Sun, 29 Mar 2015 21:45:28 +0000 (21:45 +0000)]
Remove cpufunc_asm_arm11.S from the ARMv7 configs, it's not used.

9 years agoFix more ticks wrapping bugs exposed by the ticks wrapping bug check.
adrian [Sun, 29 Mar 2015 21:41:05 +0000 (21:41 +0000)]
Fix more ticks wrapping bugs exposed by the ticks wrapping bug check.

This symptom is "calibrations don't ever run", which may cause some
pretty spectacularly bad behaviour in noisy environments or with longer
uptimes.

Thanks to dtrace to make it easy to check if specific non-inlined functions
are getting called by things like the ANI and calibration HAL methods.
Grr.

Tested:

* AR9380, STA mode

9 years agoRemove arm1136 support. We don't have any configs that use it, and I don't
andrew [Sun, 29 Mar 2015 21:12:59 +0000 (21:12 +0000)]
Remove arm1136 support. We don't have any configs that use it, and I don't
expect us to add support for any more arm11 SoCs.

9 years agoRemove the bootconfig parsing. We never used it and always passed either an
andrew [Sun, 29 Mar 2015 20:37:28 +0000 (20:37 +0000)]
Remove the bootconfig parsing. We never used it and always passed either an
empty string or NULL to the setup functions that called into it.

9 years agoSome cosmetic polishing. No functional change.
mav [Sun, 29 Mar 2015 20:28:18 +0000 (20:28 +0000)]
Some cosmetic polishing.  No functional change.

MFC after: 1 week

9 years agoWe only need cpufunc_asm_arm11.S on bcm2835, not bcm2836
andrew [Sun, 29 Mar 2015 20:21:59 +0000 (20:21 +0000)]
We only need cpufunc_asm_arm11.S on bcm2835, not bcm2836

9 years agoClean some spaces vs tabs.
pfg [Sun, 29 Mar 2015 20:20:45 +0000 (20:20 +0000)]
Clean some spaces vs tabs.

No, this file doesn't conform with KNF at all.

9 years agoFormatting changes to the pthread_testcancel(3).
kib [Sun, 29 Mar 2015 19:37:41 +0000 (19:37 +0000)]
Formatting changes to the pthread_testcancel(3).

Use list for the cancellation points enumeration.  Move notes about
functions into the list inline.

The discussion of the idiomatic use of cancellation facilities does
not belong to RETURN VALUES section, move it to NOTES.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoMake kevent(2) a cancellation point.
kib [Sun, 29 Mar 2015 19:14:41 +0000 (19:14 +0000)]
Make kevent(2) a cancellation point.

Note that to cancel blocked kevent(2) call, changelist must be empty,
since we cannot cancel a call which already made changes to the
process state.  And in reverse, call which only makes changes to the
kqueue state, without waiting for an event, is not cancellable.  This
makes a natural usage model to migrate kqueue loop to support
cancellation, where existing single kevent(2) call must be split into
two: first uncancellable update of kqueue, then cancellable wait for
events.

Note that this is ABI-incompatible change, but it is believed that
there is no cancel-safe code that relies on kevent(2) not being a
cancellation point.  Option to preserve the ABI would be to keep
kevent(2) as is, but add new call with flags to specify cancellation
behaviour, which only value seems to add complications.

Suggested and reviewed by: jilles
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoRemove ARM9_CACHE_WRITE_THROUGH, none of our configs define it.
andrew [Sun, 29 Mar 2015 18:59:04 +0000 (18:59 +0000)]
Remove ARM9_CACHE_WRITE_THROUGH, none of our configs define it.

9 years agoChange compiler setting to make default visibility of the symbols for
kib [Sun, 29 Mar 2015 18:53:21 +0000 (18:53 +0000)]
Change compiler setting to make default visibility of the symbols for
rtld on x86 to be hidden.  This is a micro-optimization, which allows
intrinsic references inside rtld to be handled without indirection
through PLT.  The visibility of rtld symbols for other objects in the
symbol namespace is controlled by a version script.

Reviewed by: kan, jilles
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoRemove the unused armv5 cpufunc code.
andrew [Sun, 29 Mar 2015 18:46:12 +0000 (18:46 +0000)]
Remove the unused armv5 cpufunc code.

9 years agodrm: Import Linux commit 9bc3cd5673d84d29272fa7181a4dfca83cbb48c1
dumbbell [Sun, 29 Mar 2015 18:45:51 +0000 (18:45 +0000)]
drm: Import Linux commit 9bc3cd5673d84d29272fa7181a4dfca83cbb48c1

Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
Date:   Fri May 31 12:17:08 2013 +0000

    drm: Sort connector modes based on vrefresh

    Keeping the modes sorted by vrefresh before the pixel clock makes the
    mode list somehow more pleasing to the eye.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
PR: 198936
Obtained from: Linux
MFC after: 1 month
MFC with: r280183

9 years agoRemove unused cpufunc arm11 and armv6 code. While here only define the
andrew [Sun, 29 Mar 2015 18:44:15 +0000 (18:44 +0000)]
Remove unused cpufunc arm11 and armv6 code. While here only define the
remaining functions in the context we use them in.

9 years agoWe don't use cpufunc_asm_armv5.S in any of these configs, remove it.
andrew [Sun, 29 Mar 2015 18:41:43 +0000 (18:41 +0000)]
We don't use cpufunc_asm_armv5.S in any of these configs, remove it.

9 years agoRemove unused arm10_* functions. The remaining functions are only used in
andrew [Sun, 29 Mar 2015 17:42:32 +0000 (17:42 +0000)]
Remove unused arm10_* functions. The remaining functions are only used in
mv configs.

9 years agoStop building unused cpuvunc_* files, we don't need anything from these.
andrew [Sun, 29 Mar 2015 17:33:03 +0000 (17:33 +0000)]
Stop building unused cpuvunc_* files, we don't need anything from these.

9 years agoRemove support for CPU_ARM10. No kernel configs could possibly use this as
andrew [Sun, 29 Mar 2015 17:13:44 +0000 (17:13 +0000)]
Remove support for CPU_ARM10. No kernel configs could possibly use this as
it's not an available option. Along with this we will never support this
cpu type as very few arm10 chips were made.

9 years agoReorder to help with moving the efi loader parts to sys/boot/efi. As these
andrew [Sun, 29 Mar 2015 15:43:24 +0000 (15:43 +0000)]
Reorder to help with moving the efi loader parts to sys/boot/efi. As these
will depend on ficl having been built, and are set via bsd.arch.inc.mk we
need to place this after ficl.

As Makefile.amd64 is now late enough we can add the i386 directory to this.

9 years agosfxge: fix bug in TSO when a DMA segment has both header and data
arybchik [Sun, 29 Mar 2015 15:18:04 +0000 (15:18 +0000)]
sfxge: fix bug in TSO when a DMA segment has both header and data

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D2163

9 years agoAdd four new DDB commands to display vmem(9) statistics.
mav [Sun, 29 Mar 2015 10:02:29 +0000 (10:02 +0000)]
Add four new DDB commands to display vmem(9) statistics.

In particular, such DDB commands were added:
        show vmem <addr>
        show all vmem
        show vmemdump <addr>
        show all vmemdump

As possible usage, that allows to see KVA usage and fragmentation.

9 years agoFix a long-standing bug with the early MAC address initialisation path,
adrian [Sun, 29 Mar 2015 06:05:00 +0000 (06:05 +0000)]
Fix a long-standing bug with the early MAC address initialisation path,
which showed up after I started changing addresses this early.

It turns out that there's some other malarky going on behind the scenes
in the HAL and merely setting the net80211/ifp mac address this early
isn't enough.  If the MAC is set from kenv at attach time, the HAL
also needs to be programmed early.

Without this, the VAP wouldn't work enough for finishing association -
probe requests would be fine as they're broadcast, but association
request would fail.

9 years agocdefs.h: Fix macros for pre-C99 compilers.
pfg [Sun, 29 Mar 2015 03:16:52 +0000 (03:16 +0000)]
cdefs.h: Fix macros for pre-C99 compilers.

Older compilers, and compatibility modes, may not support variadic macros.
I normally wouldn't go out of my way to support those old compilers but
there is a prescendent in other system headers for using the same macro
multiple times, and the solution (although non-elegant IMHO) works.

Requested by: bde
Solution by: tijl

9 years agoAdd hints to set the board MAC address and derived values for each interface.
adrian [Sat, 28 Mar 2015 23:42:59 +0000 (23:42 +0000)]
Add hints to set the board MAC address and derived values for each interface.

This allows the TL-WDR3600 to use the correct MAC address for ath0, ath1
and arge0.  arge1 isn't used; until I disable it entirely it'll just
show up with a randomly generated MAC.

9 years agoUpdate if_ath(4) to check for "hint.ath.X.macaddr" for an override MAC address.
adrian [Sat, 28 Mar 2015 23:41:23 +0000 (23:41 +0000)]
Update if_ath(4) to check for "hint.ath.X.macaddr" for an override MAC address.

This is used by the AR71xx platform code to choose a local MAC based on
the "board MAC address", versus whatever potentially invalid/garbage
values are stored in the Atheros calibration data.

9 years agoBegin moving support for board MAC addresses over to being explicitly defined.
adrian [Sat, 28 Mar 2015 23:40:29 +0000 (23:40 +0000)]
Begin moving support for board MAC addresses over to being explicitly defined.

A lot of these dinky atheros based MIPS boards don't have a nice, well,
anything consistent defining their MAC addresses for things.

The Atheros reference design boards will happily put MAC addresses
into the wifi module calibration data like they should, and individual
ethernet MAC addresses into the calibration area in flash.
That makes my life easy - "hint.arge.X.eeprommac=<addr>" reads from
that flash address to extract a MAC, and everything works fine.

However, aside from some very well behaved vendors (eg the Carambola 2
board), everyone else does something odd.

eg:

* a MAC address in the environment (eg ubiquiti routerstation/RSPRO)
   that you derive arge0/arge1 MAC addresses from.
* a MAC address in flash that you derive arge0/arge1 MAC addresses from.
* The wifi devices having their own MAC addresses in calibration data,
  like normal.
* The wifi devices having a fixed, default or garbage value for a MAC
  address in calibration data, and it has to be derived from the
  system MAC.

So to support this complete nonsense of a situation, there needs to be
a few hacks:

* The "board" MAC address needs to be derived from somewhere and squirreled
  away.  For now it's either redboot or a MAC address stored in calibration
  flash.

* Then, a "map" set of hints to populate kenv with some MAC addresses
  that are derived/local, based on the board address.  Each board has
  a totally different idea of what you do to derive things, so each
  map entry has an "offset" (+ve or -ve) that's added to the board
  MAC address.

* Then if_arge (and later, if_ath) should check kenv for said hint and
  if it's found, use that rather than the EEPROM MAC address - which may
  be totally garbage and not actually work right.

In order to do this, I've undone some of the custom redboot expecting
hacks in if_arge and the stuff that magically adds one to the MAC
address supplied by the board - instead, as I continue to test this
out on more hardware, I'll update the hints file with a map explaining
(a) where the board MAC should come from, and (b) what offsets to use
for each device.

The aim is to have all of the tplink, dlink and other random hardware
we run on have valid MAC addresses at boot, so (a) people don't get
random B:S:D:x:x:x ethernet MACs, and (b) the wifi MAC is valid
so it works rather than trying to use an invalid address that
actually upsets systems (think: multicast bit set in BSSID.)

Tested:

* TP-Link TL_WDR3600 - subsequent commits will add the hints map
  and the if_ath support.

TODO:

* Since this is -HEAD, and I'm all for debugging, there's a lot of
  printf()s in here.  They'll eventually go under bootverbose.
* I'd like to turn the macaddr routines into something available
  to all drivers - too many places hand-roll random MAC addresses
  and parser stuff.  I'd rather it just be shared code.
  However, that'll require more formal review.
* More boards.

9 years agoMake debug.vmem_check a tunable. It is useful to set it early.
kib [Sat, 28 Mar 2015 23:30:51 +0000 (23:30 +0000)]
Make debug.vmem_check a tunable.  It is useful to set it early.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoTurns out the AR933x looks like the AR7240/AR7241 switch as far as VLAN
adrian [Sat, 28 Mar 2015 23:20:46 +0000 (23:20 +0000)]
Turns out the AR933x looks like the AR7240/AR7241 switch as far as VLAN
configuration is concerned.

So, remove the now-erroneous comment.

Tested:

* AR9331 - Carambola2, with transmitting dot1q tagged packets around.

9 years agoRemove the second MODULES_OVERRIDE; add if_vlan to the list.
adrian [Sat, 28 Mar 2015 23:01:59 +0000 (23:01 +0000)]
Remove the second MODULES_OVERRIDE; add if_vlan to the list.

9 years agoWrap #ifdef guards around pmap_bootstrap ap. It's only used in SMP, and
jhibbits [Sat, 28 Mar 2015 21:39:42 +0000 (21:39 +0000)]
Wrap #ifdef guards around pmap_bootstrap ap.  It's only used in SMP, and
building without SMP causes a build failure.

MFC after: 1 month

9 years agopmcstat.8: fix -a flag description; improve -m flag to match
vangyzen [Sat, 28 Mar 2015 21:28:22 +0000 (21:28 +0000)]
pmcstat.8: fix -a flag description; improve -m flag to match

The -a flag reads a file saved by -O, not -o.

The -m flag requires the -R flag.  Copy that paragraph from -a.

Reviewed by: adrian
Approved by: kib (mentor)
MFC after: 1 week
Sponsored by: Dell Inc

9 years agoClean up some cosmetic nits in kern_umtx.c, found during recent work
vangyzen [Sat, 28 Mar 2015 21:21:40 +0000 (21:21 +0000)]
Clean up some cosmetic nits in kern_umtx.c, found during recent work
in this area and by the Clang static analyzer.

Remove some dead assignments.

Fix a typo in a panic string.

Use umtx_pi_disown() instead of duplicate code.

Use an existing variable instead of curthread.

Approved by: kib (mentor)
MFC after: 3 days
Sponsored by: Dell Inc

9 years agoAdd the MAC address hints for arge0/arge1 on the CARAMBOLA2.
adrian [Sat, 28 Mar 2015 19:59:33 +0000 (19:59 +0000)]
Add the MAC address hints for arge0/arge1 on the CARAMBOLA2.

Obtained from: Linux OpenWRT

9 years agoRemove all the handcrafted assembly in hwpmc_armv7.c and use the
bz [Sat, 28 Mar 2015 18:57:13 +0000 (18:57 +0000)]
Remove all the handcrafted assembly in hwpmc_armv7.c and use the
common (autogenerated) versions.   Removes extra vertical space,
and makes it easier to grep for usage throughout the tree.
Conditionally compile only for arm6 [1] (yes sounds odd but is right).

Submitted by: andrew [1]
Reviewed by: gnn, andrew (ian earlier version I think)
Differential Revision: https://reviews.freebsd.org/D2159
Obtained from: Cambridge/L41
Sponsored by: DARPA, AFRL

9 years agoImport lldb r233478: Fix build failure on Freebsd with gcc 4.9.
emaste [Sat, 28 Mar 2015 18:29:13 +0000 (18:29 +0000)]
Import lldb r233478: Fix build failure on Freebsd with gcc 4.9.

llvm.org/pr23051

Submitted by: rodrigc

9 years agoVNETalize random IP ID engine.
glebius [Sat, 28 Mar 2015 16:59:57 +0000 (16:59 +0000)]
VNETalize random IP ID engine.

Sponsored by: Nginx, Inc.

9 years agoInitialize random IP ID engine via SYSINIT() instead of doing that on
glebius [Sat, 28 Mar 2015 16:06:46 +0000 (16:06 +0000)]
Initialize random IP ID engine via SYSINIT() instead of doing that on
first packet.  This allow to use M_WAITOK and cut down some error handling.

Sponsored by: Nginx, Inc.

9 years agoTry to unbreak !SMP kernels broken in r280785 by using the proper macros
bz [Sat, 28 Mar 2015 15:07:19 +0000 (15:07 +0000)]
Try to unbreak !SMP kernels  broken in r280785 by using the proper macros
to access cc_cpu.

9 years agoChange the callout to supply -1 to indicate we are not changing
rrs [Sat, 28 Mar 2015 12:50:24 +0000 (12:50 +0000)]
Change the callout to supply -1 to indicate we are not changing
CPU, also add protection against invalid CPU's as well as
split c_flags and c_iflags so that if a user plays with the active
flag (the one expected to be played with by callers in MPSAFE) without
a lock, it won't adversely affect the callout system by causing a corrupt
list. This also means that all callers need to use the macros and *not*
play with the falgs directly (like netgraph used to).

Differential Revision: htts://reviews.freebsd.org/D1894
Reviewed by: .. timed out but looked at by jhb, imp, adrian hselasky
             tested by hiren and netflix.
Sponsored by: Netflix Inc.

9 years agoRe-enable using -mllvm -enable-load-pre=false in CLANG_OPT_SMALL for
dim [Sat, 28 Mar 2015 12:23:15 +0000 (12:23 +0000)]
Re-enable using -mllvm -enable-load-pre=false in CLANG_OPT_SMALL for
clang versions before 3.5.0.  This should enable building head's version
of sys/boot/i386/boot2 on 9.x and 10.x again.

Reported by: bz

9 years agosfxge: set correct RSS hash type instead of opaque
arybchik [Sat, 28 Mar 2015 10:20:20 +0000 (10:20 +0000)]
sfxge: set correct RSS hash type instead of opaque

Reviewed by:    adrian, gnn
Sponsored by:   Solarflare Communications, Inc.
Differential Revision: https://reviews.freebsd.org/D2124

9 years agoAdd an SCTP symbol which was missed in
tuexen [Sat, 28 Mar 2015 09:08:57 +0000 (09:08 +0000)]
Add an SCTP symbol which was missed in
https://svnweb.freebsd.org/base?view=revision&revision=169622
This fixes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197783
Thanks to Jukka Ukkonen for reporting the bug and providing a fix.

MFC after: 3 days

9 years agoMake it possible for the signal handler to act on #ss. Load the
kib [Sat, 28 Mar 2015 09:03:54 +0000 (09:03 +0000)]
Make it possible for the signal handler to act on #ss.  Load the
canonical user data segment' selector into %ss when calling the
handler.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

9 years agoThe #ss fault handler erronously does not check for the fault
kib [Sat, 28 Mar 2015 09:02:19 +0000 (09:02 +0000)]
The #ss fault handler erronously does not check for the fault
originated from the return to usermode. #ss must be handled same as
#np.

Reported by: Andrew Lutomirski through secteam
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

9 years agoSet VM_KMEM_SIZE_SCALE=1 for the AR91xx SoCs.
adrian [Sat, 28 Mar 2015 06:54:18 +0000 (06:54 +0000)]
Set VM_KMEM_SIZE_SCALE=1 for the AR91xx SoCs.

Without this the autotuning fails for small amounts of RAM (32mb),
which all the AR91xx shipping products seemed to have.

Thanks to gjb for reminding me to re-test this stuff.

Tested:

* AR91xx, TP-Link TL-WR1043nd v1

9 years agoFix the RTC device model to operate correctly in 12-hour mode. The following
neel [Sat, 28 Mar 2015 02:55:16 +0000 (02:55 +0000)]
Fix the RTC device model to operate correctly in 12-hour mode. The following
table documents the values in the RTC 'hour' field in the two modes:

Hour-of-the-day 12-hour mode 24-hour mode
12 AM 12 0
[1-11] AM [1-11] [1-11]
12 PM 0x80 | 12 12
[1-11] PM 0x80 | [1-11] [13-23]

Reported by: Julian Hsiao (madoka@nyanisore.net)
MFC after: 1 week

9 years ago - Eliminate pagequeue locking in the dirty code in vm_pageout_scan().
jeff [Sat, 28 Mar 2015 02:36:49 +0000 (02:36 +0000)]
 - Eliminate pagequeue locking in the dirty code in vm_pageout_scan().
 - Use a more precise series of tests to see if the page changed while we
   were locking the vnode.

Reviewed by: alc
Sponsored by: EMC / Isilon

9 years agotcp provider tests: sleep for a bit after closing the socket so that
markj [Sat, 28 Mar 2015 01:11:18 +0000 (01:11 +0000)]
tcp provider tests: sleep for a bit after closing the socket so that
libdtrace has a chance to capture the traced data.

MFC after: 1 week

9 years agoMake simplebus a base class of ofwbus. This allows the elimination of
ian [Fri, 27 Mar 2015 23:10:15 +0000 (23:10 +0000)]
Make simplebus a base class of ofwbus.  This allows the elimination of
duplicated code in the two classes, and also allows devices in FDT-based
systems to declare simplebus as their parent and still work correctly
when the FDT data describes the device at the root of the tree rather
than as a child of a simplebus (which is common for interrupt, clock,
and power controllers).

Differential Revision: https://reviews.freebsd.org/D1990
Submitted by: Michal Meloun

9 years agoRevert the __ALWAYS_NO stuff. It had already been committed as BROKEN.
imp [Fri, 27 Mar 2015 21:47:15 +0000 (21:47 +0000)]
Revert the __ALWAYS_NO stuff. It had already been committed as BROKEN.

9 years agolldb: Move debug register output into __amd64__
emaste [Fri, 27 Mar 2015 19:42:38 +0000 (19:42 +0000)]
lldb: Move debug register output into __amd64__

This debug register diagnostic is really only applicable to amd64 at
present.

Sponsored by: The FreeBSD Foundation

9 years agocrunchide: arm64 support
emaste [Fri, 27 Mar 2015 19:34:24 +0000 (19:34 +0000)]
crunchide: arm64 support

Submitted by: andrew@
Sponsored by: The FreeBSD Foundation

9 years agoFix variable casting:
hselasky [Fri, 27 Mar 2015 19:08:11 +0000 (19:08 +0000)]
Fix variable casting:
- Jiffies or ticks in FreeBSD have integer type and are not long.

MFC after: 1 week
Sponsored by: Mellanox Technologies

9 years agoFix remaining warnings.
delphij [Fri, 27 Mar 2015 18:23:06 +0000 (18:23 +0000)]
Fix remaining warnings.

MFC after: 2 weeks

9 years agoAdd a note of clarification. MK_* variables only control what modules
imp [Fri, 27 Mar 2015 17:36:22 +0000 (17:36 +0000)]
Add a note of clarification. MK_* variables only control what modules
are built by default. You can still override that with MODULES_EXTRA
for experimental features like ZFS and dtrace on some
architectures. Also note that kernel config files are not affected by
MK_ options listed, though some targets might be.

9 years agoMention support for 16h family processors, added in r263169.
brueffer [Fri, 27 Mar 2015 17:15:17 +0000 (17:15 +0000)]
Mention support for 16h family processors, added in r263169.

PR: 198933
Submitted by: isoa@kapsi.fi
MFC after: 1 week

9 years agoFixes for the LinuxAPI completion wrappers:
hselasky [Fri, 27 Mar 2015 16:16:23 +0000 (16:16 +0000)]
Fixes for the LinuxAPI completion wrappers:
- make sure the timeout computations are always above zero by using
the existing "linux_timer_jiffies_until()" function. Negative timeouts
can result in undefined behaviour.
- declare all completion functions like external symbols and move the
code to the LinuxAPI kernel module.
- add a proper prefix to all LinuxAPI kernel functions to avoid
namespace collision with other parts of the FreeBSD kernel.
- clean up header file inclusions in the linux/completion.h, linux/in.h
and linux/fs.h header files.

MFC after: 1 week
Sponsored by: Mellanox Technologies

9 years agoFix build (with gcc).
kib [Fri, 27 Mar 2015 15:49:21 +0000 (15:49 +0000)]
Fix build (with gcc).

Reported by: bz, ian
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoRemove ALPHA leftover
emaste [Fri, 27 Mar 2015 14:40:58 +0000 (14:40 +0000)]
Remove ALPHA leftover

9 years agoFix the hand after the immediate reboot when the following command
kib [Fri, 27 Mar 2015 13:55:56 +0000 (13:55 +0000)]
Fix the hand after the immediate reboot when the following command
sequence is performed on UFS SU+J rootfs:
cp -Rp /sbin/init /sbin/init.old
mv -f /sbin/init.old /sbin/init

Hang occurs on the rootfs unmount.  There are two issues:

1. Removed init binary, which is still mapped, creates a reference to
the removed vnode. The inodeblock for such vnode must have active
inodedep, which is (eventually) linked through the unlinked list. This
means that ffs_sync(MNT_SUSPEND) cannot succeed, because number of
softdep workitems for the mp is always > 0.  FFS is suspended during
unmount, so unmount just hangs.

2. As noted above, the inodedep is linked eventually.  It is not
linked until the superblock is written.  But at the vfs_unmountall()
time, when the rootfs is unmounted, the call is made to
ffs_unmount()->ffs_sync() before vflush(), and ffs_sync() only calls
ffs_sbupdate() after all workitems are flushed.  It is masked for
normal system operations, because syncer works in parallel and
eventually flushes superblock.  Syncer is stopped when rootfs
unmounted, so ffs_sync() must do sb update on its own.

Correct the issues listed above. For MNT_SUSPEND, count the number of
linked unlinked inodedeps (this is not a typo) and substract the count
of such workitems from the total. For the second issue, the
ffs_sbupdate() is called right after device sync in ffs_sync() loop.

There is third problem, occuring with both SU and SU+J. The
softdep_waitidle() loop, which waits for softdep_flush() thread to
clear the worklist, only waits 20ms max. It seems that the 1 tick,
specified for msleep(9), was a typo.

Add fsync(devvp, MNT_WAIT) call to softdep_waitidle(), which seems to
significantly help the softdep thread, and change the MNT_LAZY update
at the reboot time to MNT_WAIT for similar reasons.  Note that
userspace cannot create more work while devvp is flushed, since the
mount point is always suspended before the call to softdep_waitidle()
in unmount or remount path.

PR: 195458
In collaboration with: gjb, pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

9 years agoOn multi CPU systems, we may emit successive packets with the same id.
fabient [Fri, 27 Mar 2015 13:26:59 +0000 (13:26 +0000)]
On multi CPU systems, we may emit successive packets with the same id.
Fix the race by using an atomic operation.

Differential Revision: https://reviews.freebsd.org/D2141
Obtained from: emeric.poupon@stormshield.eu
MFC after: 1 week
Sponsored by: Stormshield

9 years agoRemove extra semicolon.
mav [Fri, 27 Mar 2015 12:45:20 +0000 (12:45 +0000)]
Remove extra semicolon.

MFC after: 1 week

9 years agoRemove request sorting from GEOM_MIRROR and GEOM_RAID.
mav [Fri, 27 Mar 2015 12:44:28 +0000 (12:44 +0000)]
Remove request sorting from GEOM_MIRROR and GEOM_RAID.

When CPU is not busy, those queues are typically empty.  When CPU is busy,
then one more extra sorting is the last thing it needs.  If specific device
(HDD) really needs sorting, then it will be done later by CAM.

This supposed to fix livelock reported for mirror of two SSDs, when UFS
fires zillion of BIO_DELETE requests, that totally blocks I/O subsystem by
pointless sorting of requests and responses under single mutex lock.

MFC after: 2 weeks

9 years agoFix bug on memory allocation error in split method.
mav [Fri, 27 Mar 2015 11:14:12 +0000 (11:14 +0000)]
Fix bug on memory allocation error in split method.

While there, use bioq_takefirst() in place where it is convenient.

MFC after: 1 week

9 years agoRather than defining our own magic checks here use INKERNEL() for
bz [Fri, 27 Mar 2015 08:47:16 +0000 (08:47 +0000)]
Rather than defining our own magic checks here use INKERNEL() for
the PMC_IN_KERNEL() macro definition.

Add missing macros to extract the return address (LR) from the trapframe.

Discussed with: andrew
Obtained from: Cambridge/L41
Sponsored by: DARPA, AFRL
MFC after: 2 weeks

9 years agosym and cxgb build on arm, add them to the build.
imp [Fri, 27 Mar 2015 02:35:33 +0000 (02:35 +0000)]
sym and cxgb build on arm, add them to the build.

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

9 years agoCategorize certain kernel builds as being broken in certain places.
imp [Fri, 27 Mar 2015 02:35:25 +0000 (02:35 +0000)]
Categorize certain kernel builds as being broken in certain places.

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

9 years agoAdd support for specifying unsupported / broken options that override
imp [Fri, 27 Mar 2015 02:35:11 +0000 (02:35 +0000)]
Add support for specifying unsupported / broken options that override
any defaults or user specified actions on the command line. This would
be useful for specifying features that are always broken or that
cannot make sense on a specific architecture, like ACPI on pc98 or
EISA on !i386 (!x86 usage of EISA is broken and there's no supported
hardware that could have it in any event). Any items in
__ALWAYS_NO_OPTIONS are forced to "no" regardless of other settings.

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

9 years agoFix __size_alloc()
pfg [Fri, 27 Mar 2015 02:01:22 +0000 (02:01 +0000)]
Fix __size_alloc()

Use underscore for the attributes name: this should fix the use of the
attributes in macros for lint(1).

Suggested by: bde

X-MFC with: r280700