marius [Sat, 26 May 2012 09:31:23 +0000 (09:31 +0000)]
MFC: r234524
o Fixes:
- When switching to 4-bit operation, send a SET_CLR_CARD_DETECT command
to disconnect the card-detect pull-up resistor from the DAT3 line before
sending the SET_BUS_WIDTH command.
- Add the missing "reserved" zero entry to the mantissa table used to
decode various CSD fields. This was causing SD cards to report that they
could run at 30 MHz instead of the maximum 25 MHz mandated in the spec.
o Enhancements:
- At the MMC layer, format various info from the CID into a string that
uniquely identifies the card instance (manufacturer number, serial
number, product name and revision, etc). Export it as an instance
variable.
- At the MMCSD layer, display the formatted card ID string, and also
report the clock speed of the hardware (not the card's max speed), and
the number of bits and number of blocks per transfer. It comes out like
this now:
mmcsd0: 968MB <SD SD01G 8.0 SN 276886905 MFG 08/2008 by 3 SD> at mmc0
22.5MHz/4bit/128-block
o Use DEVMETHOD_END.
o Use NULL instead of 0 for pointers.
marius [Sat, 26 May 2012 09:16:37 +0000 (09:16 +0000)]
MFC: r234901
- Add missing locking in at91_usart_getc().
- Align the RX buffers on the cache line size, otherwise the requirement
of partial cache line flushes on every are pretty much guaranteed. [1]
- Make the code setting the RX timeout match its comment (apparently,
start and stop bits were missed in the previous calculation). [1]
- Cover the busdma operations in at91_usart_bus_{ipend,transmit}() with
the hardware mutex, too, so these don't race against each other.
- In at91_usart_bus_ipend(), reduce duplication in the code dealing with
TX interrupts.
- In at91_usart_bus_ipend(), turn the code dealing with RX interrupts
into an else-if cascade in order reduce its complexity and to improve
its run-time behavior.
- In at91_usart_bus_ipend(), add missing BUS_DMASYNC_PREREAD calls on
the RX buffer map before handing things over to the hardware again. [1]
- In at91_usart_bus_getsig(), used a variable of sufficient width for
storing the contents of USART_CSR.
- Use KOBJMETHOD_END.
- Remove an unused header.
Submitted by: Ian Lepore [1]
Reviewed by: Ian Lepore
marius [Sat, 26 May 2012 09:13:24 +0000 (09:13 +0000)]
MFC: r234561
Interrupts must be disabled while handling a partial cache line flush,
as otherwise the interrupt handling code may modify data in the non-DMA
part of the cache line while we have it stashed away in the temporary
stack buffer, then we end up restoring a stale value.
marius [Sat, 26 May 2012 09:11:45 +0000 (09:11 +0000)]
MFC: r234560
- Add support for MCI1 revision 2xx controllers and a work-around for their
"Data Write Operation and number of bytes" erratum.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
marius [Sat, 26 May 2012 09:05:45 +0000 (09:05 +0000)]
MFC: r234291, r234292
Add support for the Atmel SAM9XE family of microcontrollers, which
consist of a ARM926EJ-S processor core with up to 512 Kbytes of on-chip
flash. Tested with SAM9XE512.
marius [Sat, 26 May 2012 08:54:26 +0000 (08:54 +0000)]
MFC: r234898, r235207
Add initial support for booting from ZFS on sparc64. At least on Sun Fire
V100, the firmware is known to be broken and not allowing to simultaneously
open disk devices, causing attempts to boot from a mirror or RAIDZ to cause
a crash. This will be worked around later. The firmwares of newer sun4u models
don't seem to exhibit this problem though.
thompsa [Sat, 26 May 2012 08:44:26 +0000 (08:44 +0000)]
MFC r234936 (emaste)
Relax restriction on direct tx to child ports
Lagg(4) restricts the type of packet that may be sent directly to a child
port, to avoid undesired output from accidental misconfiguration.
Previously only ETHERTYPE_PAE was permitted.
BPF writes to a lagg(4) child port are presumably intentional, so just
allow them, while still blocking other packets that should take the
aggregation path.
thompsa [Sat, 26 May 2012 08:25:25 +0000 (08:25 +0000)]
MFC r232321
Correct the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a
system tunable has never been implemented. This flag is only used by sysctl(8)
to provide a helpful error message.
thompsa [Sat, 26 May 2012 07:44:35 +0000 (07:44 +0000)]
MFC r235147
Do not reinitialise the interface if it is already running, this prevents the
bootp+nfs code from working as it calls init on each dhcp send and rx fails to
start in time.
thompsa [Sat, 26 May 2012 07:44:00 +0000 (07:44 +0000)]
MFC r235144
The DEVICE_POLLING dereference of sc->tsec_ifp needs to be checked for null
first or this will panic. Condense three blocks that check sc->tsec_ifp into
one while I am here.
thompsa [Sat, 26 May 2012 07:41:05 +0000 (07:41 +0000)]
MFC r234163
Set the proto to LAGG_PROTO_NONE before calling the detach routine so packets
are discarded, this is an issue because lacp drops the lock which may allow
network threads to access freed memory. Expand the lock coverage so the
detach/attach happen atomically.
thompsa [Sat, 26 May 2012 07:35:44 +0000 (07:35 +0000)]
MFC r232118
Only look for a usable MAC address for the bridge ID from ports within our
bridge, this allows us to have more than one independent bridge in the same
STP domain.
thompsa [Sat, 26 May 2012 07:34:46 +0000 (07:34 +0000)]
MFC r232014,r232030,r232070
- bstp_input() always consumes the packet so remove the mbuf handling dance
around it.
- Now that network interfaces advertise if they support linkstate notifications
we do not need to perform a media ioctl every 15 seconds.
- Indicate this function decrements the timer as well as testing for expiry.
marius [Fri, 25 May 2012 19:56:40 +0000 (19:56 +0000)]
MFC: r235681
Rewrite nd6_sysctl_{d,p}rlist() to avoid misaligned accesses to char arrays
casted to structs by getting rid of these buffers entirely. In r169832, it
was tried to paper over this issue by 32-bit aligning the buffers. Depending
on compiler optimizations that still was insufficient for 64-bit architectures
with strong alignment requirements though.
While at it, add comments regarding the total lack of locking in this area.
marius [Fri, 25 May 2012 17:50:50 +0000 (17:50 +0000)]
MFC: r228919
Add locally implemented atomic intrinsics to libcompiler_rt.
The built-in atomic operations are not implemented in our version of GCC
4.2 for the ARM and MIPS architectures. Instead of emitting locked
instructions, they generate calls to functions that can be implemented
in the C runtime.
Only implement the atomic operations that are used by <stdatomic.h> for
datatype sizes that are supported by atomic(9). This means that on these
architectures, we can only use atomic operations on 32-bits and 64-bits
variables, which is typically sufficient.
This makes <stdatomic.h> work on all architectures except MIPS, since
MIPS still uses libgcc.
marius [Fri, 25 May 2012 17:48:45 +0000 (17:48 +0000)]
MFC: r229135
Upgrade libcompiler_rt to upstream revision 147390.
This version of libcompiler_rt adds support for __mulo[sdt]i4(), which
computes a multiply and its overflow flag. There are also a lot of
cleanup fixes to headers that don't really affect us.
Updating to this revision should make it a bit easier to contribute
changes back to the LLVM developers.
marius [Fri, 25 May 2012 17:20:00 +0000 (17:20 +0000)]
MFC: r235487
Switch sparc64 to using libcompiler_rt; since r230021 (MFC'ed to stable/9 in
r236012) we have a workaround in place allowing it to be used there and since
r235388 (MFC'ed to stable/9 in r236002) we also have usable div/mod
optimizations like libgcc has.
marius [Fri, 25 May 2012 17:15:53 +0000 (17:15 +0000)]
MFC: r230021
Add a workaround to prevent endless recursion in compiler-rt.
SPARC and MIPS CPUs don't have special instructions to count
leading/trailing zeroes. The compiler-rt library provides fallback
rountines for these. The 64-bit routines, __clzdi2 and __ctzdi2, are
implemented as simple wrappers around the compiler built-in
__builtin_clz(), assuming these will expand to either 32-bit
CPU instructions or calls to __clzsi2 and __ctzsi2.
Unfortunately, our GCC 4.2 probably thinks that because the operand is
stored in a 64-bit register, it might just be a better idea to invoke
its 64-bit equivalent, simply resulting into endless recursion. Fix this
by defining __builtin_clz and __builtin_ctz to __clzsi2 and __ctzsi2
explicitly.
marius [Fri, 25 May 2012 17:14:47 +0000 (17:14 +0000)]
MFC: r222656
Upgrade libcompiler_rt from revision 117047 to 132478.
It seems there have only been a small amount to the compiler-rt source
code in the mean time. I'd rather have the code in sync as much as
possible by the time we release 9.0. Changes:
- The libcompiler_rt library is now dual licensed under both the
University of Illinois "BSD-Like" license and the MIT license.
- Our local modifications for using .hidden instead of .private_extern
have been upstreamed, meaning our changes to lib/assembly.h can now be
reverted.
- A possible endless recursion in __modsi3() has been fixed.
- Support for ARM EABI has been added, but it has no effect on FreeBSD
(yet).
- The functions __udivmodsi4 and __divmodsi4 have been added.
Requested by: many, including bf@ and Pedro Giffuni
bschmidt [Fri, 25 May 2012 16:07:39 +0000 (16:07 +0000)]
MFC r232946,232958,235233:
r232946:
Update the rt2860's firmware and add a Makefile for the module. While
here remove the ucode header file which was used to generate the fw files
but by now is outdated.
r232958:
Import the latest microcode.h which was used to generate the current
firmware files and adjust the Makefile.
r235233:
Add support for Ralink RT2800/RT3000 chipsets.
marius [Fri, 25 May 2012 15:15:25 +0000 (15:15 +0000)]
MFC: r235388
- Get rid of debugging support in order to get rid of the V8-specific C
compiler frame size used there so this whole thing is V8/V9-agnostic.
- Use 32-bit function alignment as GCC does when using UltraSPARC I or
higher optimizations.
- Don't waste delay slots when possible.
marius [Fri, 25 May 2012 15:14:22 +0000 (15:14 +0000)]
MFC: r230025
Add SPARC64 version of div/mod written in assembly.
This version is similar to the code shipped with libgcc. It is based on
the code from the SPARC64 architecture manual, provided without any
restrictions.
marius [Fri, 25 May 2012 14:40:56 +0000 (14:40 +0000)]
MFC: r234348
Turn on PREEMPTION by default. After fixing several bugs over time, the
last show-stopper keeping PREEMPTION from being usable on sparc64 should
have been dealt with in r230662 (MFC'ed to stable/9 in r230662).
At least on 2-way systems, PREEMPTION causes a little bit of a degradation
in worldstone performance. However, FreeBSD seems to have started building
up regressions in !PREEMPTION cases so sparc64 better should not be an
oddball in this regard.
fabient [Fri, 25 May 2012 07:25:30 +0000 (07:25 +0000)]
MFC r233611:
- Support inlined location in calltree output.
In case of multiple level of inlining all the locations are flattened.
Require recent binutils/addr2line (head works or binutils from ports
with the right $PATH order).
- Multiple fixes in the calltree output (recursion case, ...)
- Fix the calltree top view that previously hide some shared nodes.
Tested with Kcachegrind(kdesdk4)/qcachegrind(head).
GEOM_JOURNAL: Shutting down geom gjournal 3464572051.
panic: destroying non-empty racct: 1 allocated for resource 6
which were tracked by jh@ to be caused by checking p->p_flag,
while it wasn't initialised yet. Basically, during fork, the code
checked p_flag, concluded the process isn't marked as P_SYSTEM,
incremented the counter, and later on, when exiting, checked that
the process was marked as P_SYSTEM, and thus didn't decrement it.
Also, I believe there wasn't any good reason for checking P_SYSTEM
in the first place.
rmacklem [Thu, 24 May 2012 12:28:11 +0000 (12:28 +0000)]
MFC: r235568
A problem with the NFSv4 server was reported by Andrew Leonard
to freebsd-fs@, where the setfacl of an NFSv4 acl would fail.
This was caused by the VOP_ACLCHECK() call for ZFS replying
EOPNOTSUPP. After discussion with rwatson@, it was determined
that a call to VOP_ACLCHECK() before doing VOP_SETACL() is not
required. This patch fixes the problem by deleting the
VOP_ACLCHECK() call.
trasz [Thu, 24 May 2012 10:02:42 +0000 (10:02 +0000)]
MFC r234385:
Fix bug where NFSv4 ACL enforcement code wouldn't unconditionally
allow the owner to read and write ACL and file attributes when there
was no entry with subject matching the owner. In other words,
'getfacl meh' shouldn't fail for the owner if the ACL looks like this:
trasz [Thu, 24 May 2012 09:59:58 +0000 (09:59 +0000)]
MFC r226043:
Remove assertion against empty NFSv4 ACLs. An empty ACL is not exactly
valid - we don't allow for setting it on a file, for example - but it's
not something we should assert on.
For STABLE kernel, it changes nothing, because it's not compiled with
INVARIANTS. If it was, it would fix crashes. It also fixes an assert
in libc encountered with NFSv4 without nfsuserd(8) running.
alc [Thu, 24 May 2012 04:09:47 +0000 (04:09 +0000)]
MFC r232160
Simplify vmspace_fork()'s control flow by copying immutable data before
the vm map locks are acquired. Also, eliminate redundant initialization
of the new vm map's timestamp.
mav [Thu, 24 May 2012 03:45:13 +0000 (03:45 +0000)]
MFC r235226:
Add `options GEOM_RAID` into i386 and amd64 GENERIC kernels.
ataraid(4) previously was present there and having GEOM RAID is convinient.
Unlike other classes GEOM RAID can be set up from BIOS before install and
users are expecting it to be detected automatically.
alc [Thu, 24 May 2012 03:38:47 +0000 (03:38 +0000)]
MFC r235230
Give vm_fault()'s sequential access optimization a makeover.
There are two aspects to the sequential access optimization: (1) read ahead
of pages that are expected to be accessed in the near future and (2) unmap
and cache behind of pages that are not expected to be accessed again. This
revision changes both aspects.
The read ahead optimization is now more effective. It starts with the same
initial read window as before, but arithmetically grows the window on
sequential page faults. This can yield increased read bandwidth. For
example, on one of my machines, a program using mmap() to read a file that
is several times larger than the machine's physical memory takes about 17%
less time to complete.
The unmap and cache behind optimization is now more selectively applied.
The read ahead window must grow to its maximum size before unmap and cache
behind is performed. This significantly reduces the number of times that
pages are unmapped and cached only to be reactivated a short time later.
The unmap and cache behind optimization now clears each page's referenced
flag. Previously, in the case of dirty pages, if the containing file was
still mapped at the time that the page daemon examined the dirty pages,
they would be reactivated.
From a stylistic standpoint, this revision also cleanly separates the
implementation of the read ahead and unmap/cache behind optimizations.
mav [Thu, 24 May 2012 02:34:03 +0000 (02:34 +0000)]
MFC r234458, r234603, r234610, r234727, r234816, r234848, r234868,
r234869, r234899, r234940, r234993, r234994, r235071 -c r235076, r235080,
r235096:
- Add support for the DDF metadata format, as defined by the SNIA Common
RAID Disk Data Format Specification v2.0;
- Add support for reading non-degraded RAID4/5/5E/5EE/5R/6/MDF volumes.
mav [Thu, 24 May 2012 01:41:54 +0000 (01:41 +0000)]
MFC r235270:
- Prevent error status leak if write to some of the RAID1/1E volume disks
failed while write to some other succeeded. Instead mark disk as failed.
- Make RAID1E less aggressive in failing disks to avoid volume breakage.
mav [Thu, 24 May 2012 01:28:58 +0000 (01:28 +0000)]
MFC r235558, r235569:
Add support for writing to HID devices through the interrupt output pipe.
Supermicro LCD screen modules seem to not support accessing reports through
the control pipes, but working fine with the interrupt pipes.
iwasaki [Wed, 23 May 2012 14:44:57 +0000 (14:44 +0000)]
MFC 235692,235772:
- Don't start the sleep state transition procedure while sleep is
disabled or the system is in shutdown procedure.
- Ignore the power button press event for resuming rather than starting
shutdown.
pfg [Wed, 23 May 2012 02:43:28 +0000 (02:43 +0000)]
MFC: r235508
Fix a couple of issues that appear to be inherited from the old
8.x code:
- If the lock cannot be acquired immediately unlocks 'bar' vnode
and then locks both vnodes in order.
- wrong vnode type panics from cache_enter_time after calls by
ext2_lookup.
yongari [Wed, 23 May 2012 02:02:29 +0000 (02:02 +0000)]
MFC r235151:
Implement basic remote PHY support. Remote PHY allows the
controller to perform MDIO type accesses to a remote transceiver
using message pages defined through MRBE(multirate backplane
ethernet). It's used in blade systems(e.g Dell Blade m610) which
are connected to pass-through blades rather than traditional
switches.
This change directly manipulates firmware's mailboxes to control
remote PHY such that it does not use mii(4). Alternatively, as
David said, it could be implemented in brgphy(4) by creating a fake
PHY and let brgphy(4) do necessary mii accesses and bce(4) can
implement mailbox accesses based on the type of brgphy(4)'s mii
accesses. Personally, I think it would make brgphy(4) hard to
maintain since it would have to access many bce(4) registers in
brgphy(4). Given that there are users who are suffering from lack
of remote PHY support, it would be better to get working system
rather than waiting for complete/perfect implementation.
theraven [Tue, 22 May 2012 18:30:14 +0000 (18:30 +0000)]
Merged libcxxrt and libc++. Now available for testing on 9-stable with
-stdlib=libc++. Changes to libstdc++ not yet merged, so it is not yet possible
to mix libstdc++ and libc++ in the same program.
jhb [Mon, 21 May 2012 21:14:09 +0000 (21:14 +0000)]
MFC 234190,234196,234280:
- Extend the KDB interface to add a per-debugger callback to print a
backtrace for an arbitrary thread (rather than the calling thread).
A kdb_backtrace_thread() wrapper function uses the configured debugger
if possible, otherwise it falls back to using stack(9) if that is
available.
- Replace a direct call to db_trace_thread() in propagate_priority()
with a call to kdb_backtrace_thread() instead.
hselasky [Mon, 21 May 2012 14:47:34 +0000 (14:47 +0000)]
MFC r235451:
Move reset of USB mouse parameters from the USB mouse attach to
the USB mouse device open. Protect against multi character
device open. Some other nits.
bz [Sun, 20 May 2012 23:33:10 +0000 (23:33 +0000)]
MFC r232513:
Correct typo in the RFC number for the constants based on IANA assignments
for IPv6 Neighbor Discovery Option types for "IPv6 Router Advertisement
Options for DNS Configuration". It is RFC 6106.
bz [Sun, 20 May 2012 22:55:24 +0000 (22:55 +0000)]
MFC r232514:
In nd6_options() ignore the RFC 6106 options completely rather than printing
them if nd6_debug is enabled as unknown. Leave a comment about the RFC4191
option as I am undecided so far.
bz [Sun, 20 May 2012 20:25:22 +0000 (20:25 +0000)]
MFC r231532:
MFp4 204292:
Ignore the NAT_T extension types so we can at least dump the SADB from
the in-base libipsec/setkey without error when NAT_T support is present
in the kernel, though not printing the additional information yet.
However in case there is no NAT_T support in kernel still consider them
to be an error.
bz [Sat, 19 May 2012 22:18:45 +0000 (22:18 +0000)]
MFC r234643:
Do not toggle IFCAP_TSO4 if we would also do TSO6. Given the driver does
not currently announce/support TSO6 that cannot happen. Clean it up anyway
for consistency.