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.
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.
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
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.
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
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