glebius [Tue, 5 Nov 2013 07:44:15 +0000 (07:44 +0000)]
Rewrite in_control(), so that it is comprehendable without getting mad.
o Provide separate functions for SIOCAIFADDR and for SIOCDIFADDR, with
clear code flow from beginning to the end. After that the rest of
in_control() gets very small and clear.
o Provide sx(9) lock to protect against parallel ioctl() invocations.
o Reimplement logic from r201282, that tried to keep localhost route in
table when multiple P2P interfaces with same local address are created
and deleted.
glebius [Tue, 5 Nov 2013 07:36:17 +0000 (07:36 +0000)]
In complemence to ifa_add_loopback_route() and ifa_del_loopback_route()
provide function ifa_switch_loopback_route() that will be used in case when
an interface address used for a loopback route goes away, but we have another
interface address with same address value and want to preserve loopback
route.
glebius [Tue, 5 Nov 2013 07:32:09 +0000 (07:32 +0000)]
Remove net.link.ether.inet.useloopback sysctl tunable. It was always on by
default from the very beginning. It was placed in wrong namespace
net.link.ether, originally it had been at another wrong namespace. It was
incorrectly documented at incorrect manual page arp(8). Since new-ARP commit,
the tunable have been consulted only on route addition, and ignored on route
deletion. Behaviour of a system with tunable turned off is not fully correct,
and has no advantages comparing to normal behavior.
edwin [Tue, 5 Nov 2013 06:32:23 +0000 (06:32 +0000)]
MFV of 255902, tzdata2013f
MFV of 257651, tzdata2013h
tzdata2013f
- Jordan goes to winter time on the last Friday in October.
- Tocantins in Brazil will not go into summer time in October.
- Indonesian time zones renames.
- Lots of cleanups in with regarding to links and historical data.
tzdata2013h
- Libya didn't go back to DST.
- Fix Morocco 2038 issue.
- Brazil/Acre and Western Amazonas are chaning timezones.
kib [Tue, 5 Nov 2013 06:18:50 +0000 (06:18 +0000)]
Do not coalesce if the swap object belongs to tmpfs vnode. The
coalesce would extend the object to keep pages for the anonymous
mapping created by the process. The pages has no relations to the
tmpfs file content which could be written into the corresponding
range, causing anonymous mapping and file content aliasing and
subsequent corruption.
Another lesser problem created by coalescing is over-accounting on the
tmpfs node destruction, since the object size is substracted from the
total count of the pages owned by the tmpfs mount.
Reported and tested by: bdrewery
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
markj [Tue, 5 Nov 2013 06:13:46 +0000 (06:13 +0000)]
Use suword32 and suword64 instead of copyout(9). This fixes a bug in the
emulation of the call instruction caused by reversing the uaddr and kaddr
arguments when copying data out to userland: the suword* functions take the
uaddr as the first argument whereas copyout(9) takes the kaddr as the first
argument. This also partially undoes the fixes from r257143.
ian [Tue, 5 Nov 2013 04:30:55 +0000 (04:30 +0000)]
Add new helper routines for arm static device mapping. The new code
allocates kva space from the top down for the device mappings and builds
entries in an internal table which is automatically used later by
arm_devmap_bootstrap(). The platform code just calls the new
arm_devmap_add_entry() function as many times as it needs to (up to 32
entries allowed; most platforms use 2 or 3 at most).
There is also a new arm_devmap_lastaddr() function that returns the lowest
kva address allocated; this can be used to implement initarm_lastaddr()
which is used to initialize vm_max_kernel_address.
The new code is based on a similar concept developed for the imx family
SoCs recently. They will soon be converted to use this new common code.
markj [Tue, 5 Nov 2013 03:23:54 +0000 (03:23 +0000)]
Modify the libproc breakpoint add/remove functions to stop the target
process if it has not already been stopped, since this is required for
ptrace(2) to work.
libdtrace does not seem to stop target processes before trying to remove
their breakpoints, so we were previously failing to remove the breakpoint
on r_debug_state() in rtld. This was causing processes to die with SIGTRAP
if they called dlopen(3) after dtrace(1) had detached.
ian [Tue, 5 Nov 2013 02:57:34 +0000 (02:57 +0000)]
Call initarm_lastaddr() later in the init sequence, after establishing
static device mappings, rather than as the first of the initializations
that a platform can hook into. This allows a platform to allocate KVA
from the top of the address space downwards for things like static device
mapping, and return the final "last usable address" result after that and
other early init work is done.
Because some platforms were doing work in initarm_lastaddr() that needs to
be done early, add a new initarm_early_init() routine and move the early
init code to that routine on those platforms.
Rename platform_devmap_init() to initarm_devmap_init() to match all the
other init routines called from initarm() that are designed to be
implemented by platform code.
Add a comment block that explains when these routines are called and the
type of work expected to be done in each of them.
neel [Mon, 4 Nov 2013 23:25:07 +0000 (23:25 +0000)]
Remove the 'vdev' abstraction that was meant to sit on top of device models
in the kernel. This abstraction was redundant because the only device emulated
inside vmm.ko is the local apic and it is always at a fixed guest physical
address.
ian [Mon, 4 Nov 2013 22:45:26 +0000 (22:45 +0000)]
Move remaining code and data related to static device mapping into the
new devmap.[ch] files. Emphasize the MD nature of these things by using
the prefix arm_devmap_ on the function and type names (already a few of
these things found their way into MI code, hopefully it will be harder to
do by accident in the future).
dim [Mon, 4 Nov 2013 21:54:56 +0000 (21:54 +0000)]
For C++ programs, don't emit any explicit dependency to libstdc++.a or
libc++.a during the early build stages (bootstrap-tools, build-tools,
cross-tools), since it is not possible to know in advance which C++
library is available on the host system.
Instead, just use the bootstrap compiler's built-in default. This
should eventually make it possible to build stable/9 on head, or on
stable/10, which ship without libstdc++ by default.
dteske [Mon, 4 Nov 2013 20:28:10 +0000 (20:28 +0000)]
Defer loading of kernel and modules if the beastie menu is enabled. Add a
kernel selection menu to the beastie menu. List of kernels is taken from
`kernels' in loader.conf(5) as a space (or comma) separated list of names
to display (up to 9). If not set, default value is "kernel kernel.old".
Does not validate that kernels exist because the next enhancement will be
to allow selection of the root device.
ian [Mon, 4 Nov 2013 19:44:37 +0000 (19:44 +0000)]
Begin reducing code duplication in arm pmap.c and pmap-v6.c by factoring
out common code related to mapping device memory into a new devmap.c file.
Remove the growing duplication of code that used pmap_devmap_find_pa() and
then did some math with the returned results to generate a virtual address,
and likewise in reverse to get a physical address. Now there are a pair
of functions, arm_devmap_vtop() and arm_devmap_ptov(), to do that. The
bus_space_map() implementations are rewritten in terms of these.
eadler [Mon, 4 Nov 2013 19:05:31 +0000 (19:05 +0000)]
Use OpenBSD's revamped description of strlcpy and strlcat.
This explanation is supposed to be simpler and better. In particular
"comparing it to the snprintf API provides lots of value, since it raises the
bar on understanding, so that programmers/auditors will a better job calling
all 3 of these functions."
sbruno [Mon, 4 Nov 2013 18:15:45 +0000 (18:15 +0000)]
Quiesce warning around gcc_assert() for an inline macro that uses
a static variable. This code has been moved around in gcc, but is still in
use in the latest trunk version of the compiler.
gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:208:36:
warning: static variable 'dwarf_reg_size_table' is used in an inline
function with external linkage [-Wstatic-in-inline]
gcc_assert (index < (int) sizeof(dwarf_reg_size_table));
sbruno [Mon, 4 Nov 2013 16:52:27 +0000 (16:52 +0000)]
Quiesce warning about unused argument in call to rl_message() by wrapping
this call with the same #if defined (PREFER_STDARG) directive as in display.c
Using -E to compile display.c/search.c shows that this is the code chosen by
the build when we create libreadline
ian [Mon, 4 Nov 2013 16:16:40 +0000 (16:16 +0000)]
Remove the duplicated implementations of some bus_space functions and use
the essentially identical generic implementations instead. The generic
implementations differ only in the spelling of a couple variable names
and some formatting differences.
ian [Mon, 4 Nov 2013 15:55:04 +0000 (15:55 +0000)]
Rework the aicasm build machinery so that it gets built along with toolchain
components instead of with the kernel and/or modules. This ensures that it
gets built with the host compiler, not the compiler in obj/... used to build
the target components (which may be a cross-compiler outputting code for a
different architecture and using header files with types and options set up
for the wrong architecture).
pjd [Mon, 4 Nov 2013 14:10:22 +0000 (14:10 +0000)]
- Add manual pages for capability rights (rights(4)), cap_rights_init(3)
family of functions and cap_rights_get(3) function.
- Update remaining Capsicum-related manual pages.
ian [Mon, 4 Nov 2013 03:39:23 +0000 (03:39 +0000)]
Rename WANDBOARD-COMMON to WANDBOARD.common and adjust the configs that
include it accordingly. The build machinery for universe and tinderbox
tries to build every kernel config whose name begins and ends with [A-Z0-9]
and the common include file that has most of the options isn't buildable
by itself, so the new lowercase .common will avoid building it.
rmacklem [Sun, 3 Nov 2013 23:17:30 +0000 (23:17 +0000)]
During code inspection, I spotted that there was a code path where
CLNT_CONTROL() would be called on "client" after it was
released via CLNT_RELEASE(). It was unlikely that this
code path gets executed and I have not heard of any problem
report caused by this bug. This patch fixes the code so that
this cannot happen.
sbruno [Sun, 3 Nov 2013 21:05:44 +0000 (21:05 +0000)]
This library uses macros to define fprintf behvavior for several object types
The compiler will see the non-string literal arguments to the fprintf calls and
omit warnings for them. Quiese these warnings in contrib code:
cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c:743:12: warning: format
string is not a string literal (potentially insecure) [-Wformat-security]
ARENDER(pctl, nvlist_array, nvl, name, val, nelem);
peter [Sun, 3 Nov 2013 19:04:57 +0000 (19:04 +0000)]
Remove the WITH_LIBICONV_COMPAT hack that seems to do more harm than
good. This caused libc to spoof the ports libiconv namespace and
provide a colliding libiconv.so.3 to fool rtld. This should have
been removed some time ago.
ian [Sat, 2 Nov 2013 20:14:39 +0000 (20:14 +0000)]
Arrange for uart_cpu_fdt's probe() routine to use the same table of compat
strings as uart_bus_fdt's probe().
The bus code uses ofw_bus_search_compatible() and that's not an option in
cpu (console) code -- it runs way before the ofw routines are usable. So
the console probe has its own loop to search the table, but now at least
there's only one table to be maintained when new devices are added.
luigi [Sat, 2 Nov 2013 18:03:21 +0000 (18:03 +0000)]
circumvent a couple of warnings:
- on line 2550 intentionally overriding a const qualifier
- on line 3219 intentionally converting uint64_t to a pointer
alc [Sat, 2 Nov 2013 17:08:20 +0000 (17:08 +0000)]
Don't create a distinct free page pool for segregating allocations that are
accessed through the direct map unless the kernel configuration actually
includes a direct map. Only a few configurations do, and for the rest the
unnecessary free page pool is a small pessimization.
kib [Sat, 2 Nov 2013 09:16:11 +0000 (09:16 +0000)]
Fix several issues with the busdma(9) KPI use in the e1000 drivers.
The problems do not affect bouncing busdma in a visible way, but are
critical for the dmar backend.
- The bus_dmamap_create(9) is not documented to take BUS_DMA_NOWAIT flag.
- Unload descriptor map after receive.
- Do not reset descriptor map to NULL, bus_dmamap_load(9) requires
valid map, and also this leaks the map.
Reported and tested by: pho
Approved by: jfv
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
delphij [Sat, 2 Nov 2013 01:16:10 +0000 (01:16 +0000)]
When zero'ing out a buffer, make sure we are using right size.
Without this change, in the worst but unlikely case scenario, certain
administrative operations, including change of configuration, set or
delete key from a GEOM ELI provider, may leave potentially sensitive
information in buffer allocated from kernel memory.
We believe that it is not possible to actively exploit these issues, nor
does it impact the security of normal usage of GEOM ELI providers when
these operations are not performed after system boot.
Security: possible sensitive information disclosure
Submitted by: Clement Lecigne <clecigne google com>
MFC after: 3 days
brooks [Fri, 1 Nov 2013 22:03:20 +0000 (22:03 +0000)]
Reimplement r257525 such that it work with the historic FreeBSD make
implementation. This fixes the toolchain and kernel-toolchain targets
when building from older FreeBSD versions where make is fmake.
Reported by: luigi
Sponsored by: DARPA/AFRL
MFC after: 3 days
luigi [Fri, 1 Nov 2013 21:21:14 +0000 (21:21 +0000)]
update to the latest netmap snapshot.
This includes the following:
- use separate memory regions for VALE ports
- locking fixes
- some simplifications in the NIC-specific routines
- performance improvements for the VALE switch
- some new features in the pkt-gen test program
- documentation updates
There are small API changes that require programs to be recompiled
(NETMAP_API has been bumped so you will detect old binaries at runtime).
In particular:
- struct netmap_slot now is 16 bytes to support an extra pointer,
which may save one data copy when using VALE ports or VMs;
- the struct netmap_if has two extra fields;
ian [Fri, 1 Nov 2013 19:22:06 +0000 (19:22 +0000)]
TI sdhci driver improvements, mostly related to fdt data...
Use the published compatible strings (our own invention, "ti,mmchs" is
still accepted as well, for now).
Don't blindly turn on 8-bit bus mode, because even though the conroller
supports it, the board has to be wired appropriately as well. Use the
published property (bus-width=<n>) and honor all the valid values (1,4,8).
The eMMC device on a Beaglebone Black is wired for 8-bit, update the dts.
The mmchs controller can inherently do both 1.8v and 3.0v on the first
device and 1.8v only on other devices, unless an external transceiver is
used. Set the voltage automatically for the first device and honor
the published fdt property (ti,dualvolt) for other devices.
Thanks go to Ilya Bakulin for figuring out the voltage compatibility stuff.
luigi [Fri, 1 Nov 2013 18:29:27 +0000 (18:29 +0000)]
small cleanup for building picobsd-head without CLANG.
Note that svn 257268 gnu/usr.bin/binutils/ld/Makefile
seems to break the "toolchain" target when building HEAD
on RELENG_9, so until this is solved you may want to
mav [Fri, 1 Nov 2013 10:32:33 +0000 (10:32 +0000)]
Make getenv_*() functions and respectively TUNABLE_*_FETCH() macros not
allocate memory and so not require sleepable environment. getenv() has
already used on-stack temporary storage, so just use it more rationally.
getenv_string() receives buffer as argument, so don't need another one.
yongari [Fri, 1 Nov 2013 05:03:47 +0000 (05:03 +0000)]
Perform media change after setting IFF_DRV_RUNNING flag. Without it,
driver would ignore the first link state update if controller
already established a link.