ian [Mon, 21 Mar 2016 14:21:32 +0000 (14:21 +0000)]
Garbage collect the bswap routines from libstand. The declaration was
wrapped in an i386 ifdef with a comment questioning their usefulness even
there. It turns out they aren't referenced anywhere, but their presence
prevents using sys/endian.h in libstand code.
These days, sys/endian.h provides much better support for such things, using
compiler builtins and inline functions (and creating connections between
libstand code and header files from sys/ would not be breaking new ground).
sephe [Mon, 21 Mar 2016 06:54:21 +0000 (06:54 +0000)]
hyperv: Factor out snprinf_hv_guid()
Submitted by: Ju Sun <junsu microsoft com>
Reviewed by: Dexuan Cui <decui microsoft com>, sephe
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5651
kib [Mon, 21 Mar 2016 06:46:16 +0000 (06:46 +0000)]
From libthr, remove special and strange code to set up session and
control terminal, activated when running with pid 1. It is
application duty to handle this, and unsuspecting init replacements
which are linked with libthr would be broken by this.
The pre-resolving of getpid() is restored, just in case.
Reviewed by: jilles
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
emaste [Mon, 21 Mar 2016 00:59:30 +0000 (00:59 +0000)]
i915: disable GEN6_MBCTL write in gen6_init_clock_gating
This write came from Linux commit b4ae3f22d238 which has been implicated
in Sandy Bridge power consumption issues (albeit under different
conditions on Linux). Disabling it restores normal power consumption on
my Sandy Bridge laptop (Thinkpad X220).
PR: 207889
Reviewed by: cem, dumbbell
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5665
ian [Mon, 21 Mar 2016 00:52:24 +0000 (00:52 +0000)]
Fix fallout from r292180 (Dec 2015)... ensure that every driver which has
a DRIVER_MODULE() referencing mmc_driver has a MODULE_DEPEND() on mmc. This
is because the kernel linker only searches for symbols in dependent modules,
so loading sdhci_pci (and other bus-flavors of sdhci) would fail when mmc
was not compiled into the kernel (even if you hand-loaded mmc first).
(Thanks to jilles@ for providing the vital clue about the kernel linker.)
jhibbits [Sun, 20 Mar 2016 14:21:07 +0000 (14:21 +0000)]
Convert a long to rman_res_t, fixing a sign extension bug.
ahci.c had one signed long, which was passed into rman, rather than u_long.
After the switch of rman_res_t from size u_long to size uintmax_t, the sign
extension caused ranges to get messed up, and ahcich* to not attach.
There may be more signed longs used in this way, which will be fixed as they're
reported.
dchagin [Sun, 20 Mar 2016 11:40:52 +0000 (11:40 +0000)]
Rework r296543:
1. Limit secs to INT32_MAX / 2 to avoid errors from kern_setitimer().
Assert that kern_setitimer() returns 0.
Remove bogus cast of secs.
Fix style(9) issues.
2. Increment the return value if the remaining tv_usec value more than 500000 as a Linux does.
adrian [Sun, 20 Mar 2016 03:54:57 +0000 (03:54 +0000)]
[urtwn] migrate urtwn out into sys/dev/urtwn/ .
There's some upcoming work to add new chipset support here and I'd
like to only add 802.11n support to one driver, instead of both
urtwn and rtwn.
There's also missing support for things like 802.11n, some powersave
work, bluetooth integration/coexistence, etc, and also newer parts
(like 8192EU, maybe some 11ac parts, not sure yet.)
So, this is hopefully the first step in a longer set of steps to unify
rtwn/urtwn and extend it with more interesting chipset and functionality
support.
pfg [Sun, 20 Mar 2016 03:27:06 +0000 (03:27 +0000)]
localedef(1): minor sorting to match Illumos.
Illumos recently included space in 'print' class. We already had
this but the code had slight sorting differences. Move it some
lines up to reduce diffs with Illumos.
jhb [Fri, 18 Mar 2016 19:48:49 +0000 (19:48 +0000)]
Check IPI status more frequently when waiting.
An IPI cannot be sent via the local APIC if a previous IPI is still
being delivered. Attempts to send an IPI will wait for a pending IPI
to clear. Prior to r278325 these checks used a spin loop with a
hardcoded maximum count which broke AP startup on some systems.
However, r278325 also enforced a minimum latency of 5 microseconds if an
IPI was still pending which resulted in a measurable performance hit.
This change reduces that minimum latency to 1 microsecond.
pfg [Fri, 18 Mar 2016 19:04:01 +0000 (19:04 +0000)]
aio_qphysio(): Avoid uninitialized pointer read on error.
For the !unmap case it may happen that pbuf gets called unreferenced
when vm_fault_quick_hold_pages() fails.
Initialize it so it doesn't cause trouble.
julian [Fri, 18 Mar 2016 14:49:11 +0000 (14:49 +0000)]
Add the ability to print out ht emodule specific information in likely formats.
Among other things this gives us the ability to find outthe syscall number of a dynamically loaded syscall that has a dynamicly allocated vector number.
ae [Fri, 18 Mar 2016 09:03:00 +0000 (09:03 +0000)]
Fix handling of net.inet.ipsec.dfbit=2 variable.
IP_DF macro is in host bytes order, but ip_off field is in network bytes
order. So, use htons() for correct check.
jhibbits [Fri, 18 Mar 2016 01:28:41 +0000 (01:28 +0000)]
Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.
On some architectures, u_long isn't large enough for resource definitions.
Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but
type `long' is only 32-bit. This extends rman's resources to uintmax_t. With
this change, any resource can feasibly be placed anywhere in physical memory
(within the constraints of the driver).
Why uintmax_t and not something machine dependent, or uint64_t? Though it's
possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on
32-bit architectures. 64-bit architectures should have plenty of RAM to absorb
the increase on resource sizes if and when this occurs, and the number of
resources on memory-constrained systems should be sufficiently small as to not
pose a drastic overhead. That being said, uintmax_t was chosen for source
clarity. If it's specified as uint64_t, all printf()-like calls would either
need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t
aren't horrible, but it would also bake into the API for
resource_list_print_type() either a hidden assumption that entries get cast to
uintmax_t for printing, or these calls would need the PRI*64 macros. Since
source code is meant to be read more often than written, I chose the clearest
path of simply using uintmax_t.
Tested on a PowerPC p5020-based board, which places all device resources in
0xfxxxxxxxx, and has 8GB RAM.
Regression tested on qemu-system-i386
Regression tested on qemu-system-mips (malta profile)
ae [Thu, 17 Mar 2016 11:10:44 +0000 (11:10 +0000)]
Reduce the number of local variables. Remove redundant check that inp
pointer isn't NULL, it is safe, because we are handling IPV6_PKTINFO
socket option in this block of code. Also, use in6ifa_withaddr() instead
of ifa_withaddr().
andrew [Thu, 17 Mar 2016 08:40:58 +0000 (08:40 +0000)]
Make it an error to build an ARM kernel with COMPAT_FREEBSDn where n < 10.
We changed the ABI for ARM in 10, an removed support for the old ABI in 11,
as such binaries from these releases are unable to be run on a head kernel.
np [Thu, 17 Mar 2016 01:15:16 +0000 (01:15 +0000)]
cxgbe(4): Tidy up PAUSE frame accounting.
Figure out if the chip is counting PAUSE frames in the "normal" stats
and take them out if it is. This fixes a bug in the tx stats because
the default hardware behavior is different for Tx and Rx but the driver
was treating both the same way. The result was that OPACKETS, OBYTES,
and OMCASTS were under-reported (if tx_pause > 0) before this change.
Note that the mac_stats sysctl still gives you the raw value of these
statistics straight from the device registers.
glebius [Wed, 16 Mar 2016 22:33:12 +0000 (22:33 +0000)]
Due to invalid use of a signed intermediate value in the bounds checking
during argument validity verification, unbound zero'ing of the process LDT
and adjacent memory can be initiated from usermode.
np [Wed, 16 Mar 2016 19:43:44 +0000 (19:43 +0000)]
cxgbe(4): Enable additional capabilities in the default configuration
files. All features with FreeBSD drivers of some kind are now in the
default configuration.
np [Wed, 16 Mar 2016 19:36:11 +0000 (19:36 +0000)]
cxgbe(4): Remove a couple of pointless assignments in sysctl_meminfo.
Do not display range if start = stop (this is a workaround for some
unused regions).
emaste [Wed, 16 Mar 2016 18:55:17 +0000 (18:55 +0000)]
Remove armeb FreeBSD 6 compat shim
r296861 addressed a build failure due to undefined SYS_freebsd6_lseek
by adding a COMPAT_FREEBSD6 conditional, but we do not support FreeBSD 6
compatibility on armeb anyway so remove it completely.
andrew [Wed, 16 Mar 2016 15:31:09 +0000 (15:31 +0000)]
Remove old COMPAT_FREEBSD options from the ARM kernel configs. We replaced
the ABI in 10.0, and have removed support for the old ABI in 11. As such
any of these options to provide compatibility prior to 10 are unneeded.