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
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.
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.
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
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.
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.
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().
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.
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.
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.
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.
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
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
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().
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.
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.
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.
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().
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>
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.
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.
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.
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.
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).
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
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.
danfe [Fri, 13 Feb 2015 13:55:38 +0000 (13:55 +0000)]
Improve vt(4) default mouse pointer image. Previous one looked rather ugly,
especially on native monitor resolutions. This one essentially matches X11
default pointer.
br [Fri, 13 Feb 2015 11:13:08 +0000 (11:13 +0000)]
o Correct the calculation how many pages we need
o Ensure we use correct bank for MSK register
o Save and restore current bank in interrupt handler
o Stop TX watchdog on fatal errors
o Use right register for EPH status
jmg [Fri, 13 Feb 2015 01:20:37 +0000 (01:20 +0000)]
add support for specifying an initial buffer size when fetching a
sysctl... This is useful for kern.arandom which (without -B) will
happily return 0 bytes, which isn't too useful or random...
fix spelling (thanks igor!) of settable while I'm here...
ngie [Thu, 12 Feb 2015 21:10:32 +0000 (21:10 +0000)]
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
pfg [Thu, 12 Feb 2015 21:07:42 +0000 (21:07 +0000)]
ulimit(3): Fix broken check.
The existing implementation had a broken comparison that could overflow.
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().
ngie [Thu, 12 Feb 2015 20:57:57 +0000 (20:57 +0000)]
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
rrs [Thu, 12 Feb 2015 13:31:08 +0000 (13:31 +0000)]
This fixes a bug I in-advertantly inserted when I updated the callout
code in my last commit. The cc_exec_next is used to track the next
when a direct call is being made from callout. It is *never* used
in the in-direct method. When macro-izing I made it so that it
would separate out direct/vs/non-direct. This is incorrect and can
cause panics as Peter Holm has found for me (Thanks so much Peter for
all your help in this). What this change does is restore that behavior
but also get rid of the cc_next from the array and instead make it
be part of the base callout structure. This way no one else will get
confused since we will never use it for non-direct.
Reviewed by: Peter Holm and more importantly tested by him ;-)
MFC after: 3 days.
Sponsored by: Netflix Inc.
cperciva [Thu, 12 Feb 2015 05:35:00 +0000 (05:35 +0000)]
Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;
update paths; and include everything in the "base" distribution.
The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive. Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.
The next steps will be:
2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities. I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.
emaste [Thu, 12 Feb 2015 02:08:44 +0000 (02:08 +0000)]
libdwarf: Handle .rel relocations
Some architectures use .rel relocations (for debug data), so they must
be handled.
This was discovered from ctfconvert on ARM object files. The lack of
relocation handling caused all string lookups to return the string at
offset 0 in .debug_str, typically "FreeBSD clang version ..."
Reviewed by: gnn, imp, rpaulo (earlier version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1819
kib [Wed, 11 Feb 2015 23:30:46 +0000 (23:30 +0000)]
Registers definitions for the new capabilities from the version 2.4 of
VT-d specification. Also add definitions for the interrupt remapping
table and IEC.
Print new capabilities on boot. although there is no hardware which
support it.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week