Dimitry Andric [Fri, 9 Nov 2012 18:56:27 +0000 (18:56 +0000)]
Reduce LLVM's default stack alignment for i386 from 16 to 4 bytes, as
the FreeBSD ABI requires. This is essentially a revert of upstream llvm
commit r126226, and it will be reverted by upstream too.
Attilio Rao [Fri, 9 Nov 2012 18:02:25 +0000 (18:02 +0000)]
Complete MPSAFE VFS interface and remove MNTK_MPSAFE flag.
Porters should refer to __FreeBSD_version 1000021 for this change as
it may have happened at the same timeframe.
Fix LOW and FULL speed USB INTERRUPT endpoint support for the
DWC OTG driver. Fix a hang issue when using LOW and FULL speed
BULK traffic. Make sure we don't ask for data in the last
microframe. This allows using devices like USB mice and USB
keyboards connected to the RPI-B.
Do not try to enable new features in the %cr4 if running under
hypervisor. Apparently, hypervisors failed to filter out 'Standard
Extended Features' report from CPUID, but deliver #gp when
corresponding bit in %cr4 is toggled.
This shall be reconsidered later, after hypervisors correct the bug.
Reported and tested by: joel
Reviewed by: avg
MFC after: 2 weeks
Dimitry Andric [Thu, 8 Nov 2012 23:21:02 +0000 (23:21 +0000)]
Shrink boot2 by 8 bytes, by eliminating some unneeded instructions in
sio.S. This is not particularly needed for head right now, but it is
intended to merge to stable/9, to fix boot2 build with clang there.
Adrian Chadd [Thu, 8 Nov 2012 18:11:31 +0000 (18:11 +0000)]
Add some hooks into the driver to attach, detach and record EDMA descriptor
events.
This is primarily for the TX EDMA and TX EDMA completion. I haven't yet
tied it into the EDMA RX path or the legacy TX/RX path.
Things that I don't quite like:
* Make the pointer type 'void' in ath_softc and have if_ath_alq*()
return a malloc'ed buffer. That would remove the need to include
if_ath_alq.h in if_athvar.h.
* The sysctl setup needs to be cleaned up.
Zero the newly allocated md(4) swap-backed page to prevent random
kernel memory leakage to userspace. For the typical use, when a
filesystem put on the md disk, the change only results in CPU and
memory bandwidth spent to zero the page, since filsystems make sure
that user never see unwritten content. But if md disk is used as raw
device by userspace, the garbage is exposed.
Reported by: Paul Schenkeveld <freebsd@psconsult.nl>
MFC after: 2 weeks
Jeff Roberson [Thu, 8 Nov 2012 01:46:47 +0000 (01:46 +0000)]
- Change ULE to use dynamic slice sizes for the timeshare queue in order
to further reduce latency for threads in this queue. This should help
as threads transition from realtime to timeshare. The latency is
bound to a max of sched_slice until we have more than sched_slice / 6
threads runnable. Then the min slice is allotted to all threads and
latency becomes (nthreads - 1) * min_slice.
Jeff Roberson [Thu, 8 Nov 2012 01:41:04 +0000 (01:41 +0000)]
- Implement BIO_FLUSH support around journal entries. This will not 100%
solve power loss problems with dishonest write caches. However, it
should improve the situation and force a full fsck when it is unable
to resolve with the journal.
- Resolve a case where the journal could wrap in an unsafe way causing
us to prematurely lose journal entries in very specific scenarios.
Attilio Rao [Thu, 8 Nov 2012 00:32:49 +0000 (00:32 +0000)]
- Current caching mode is completely broken because it simply relies
on timing of the operations and not real lookup, bringing too many
false positives. Remove the whole mechanism. If it needs to be
implemented, next time it should really be done in the proper way.
- Fix VOP_GETATTR() in order to cope with userland bugs that would
change the type of file and not panic. Instead it gets the entry as
if it is not existing.
Greg Lehey [Thu, 8 Nov 2012 00:24:26 +0000 (00:24 +0000)]
Add y flag and environment variable LS_SAMESORT to specify the same
sorting order for time and name with the -t option. IEEE Std 1003.2
(POSIX.2) mandates that the -t option sort in descending order, and
that if two files have the same timestamp, they should be sorted in
ascending order of their names. The -r flag reverses both of these
sort orders, so they're never the same. This creates significant
problems for sequentially named files stored on FAT file systems,
where it can be impossible to list them in the order in which they
were created.
Add , (comma) option to print file sizes grouped and separated by
thousands using the non-monetary separator returned by localeconv(3),
typically a comma or period.
Justin Hibbits [Wed, 7 Nov 2012 23:45:09 +0000 (23:45 +0000)]
Implement DTrace for PowerPC. This includes both 32-bit and 64-bit.
There is one known issue: Some probes will display an error message along the
lines of: "Invalid address (0)"
I tested this with both a simple dtrace probe and dtruss on a few different
binaries on 32-bit. I only compiled 64-bit, did not run it, but I don't expect
problems without the modules loaded. Volunteers are welcome.
Alexander Motin [Wed, 7 Nov 2012 23:12:53 +0000 (23:12 +0000)]
Use information about suported diagnostic pages to avoid reading optional
Element Descriptor page if it is not supported. This removes one error
message from verbose logs during boot on systems with some enclosures.
Dimitry Andric [Wed, 7 Nov 2012 22:45:34 +0000 (22:45 +0000)]
For kernel builds with PROFLEVEL >= 2, such as LINT, don't attempt to
use the -mprofiler-epilogue option if the compiler is clang, as the flag
is not supported. While here, fix up the value indentations.
Disable automatic attachment of arswitch. It can't be auto-detected (like PHYs
do) and cause a problems trying to attach another instance to child mdio.
Submitted by: Luiz Otavio O Souza
Approved by: adrian (menthor)
Dimitry Andric [Wed, 7 Nov 2012 22:15:28 +0000 (22:15 +0000)]
For kernel builds with PROFLEVEL >= 1, such as LINT, don't attempt to
use the -falign-functions option if the compiler is clang, as the flag
is not supported.
Michael Tuexen [Wed, 7 Nov 2012 22:11:38 +0000 (22:11 +0000)]
Add per outgoing stream accounting for chunks in the send
and sent queue. This provides no functional change, but is
a preparation for an upcoming stream reset improvement.
Done with rrs@.
Dimitry Andric [Wed, 7 Nov 2012 19:51:53 +0000 (19:51 +0000)]
Put in a band-aid to get the pc98 bootstraps building, now clang is the
default compiler. This has two parts:
- Make sys/boot/pc98/boot2 always build with gcc for now, until we can
figure out a way to shrink it enough when building with clang.
- Since sys/boot/p98/cdboot uses .code16 directives, which are not yet
supported by clang's integrated assembler, use -no-integrated-as,
similar to sys/boot/i386/cdboot.
Warren Block [Wed, 7 Nov 2012 19:26:32 +0000 (19:26 +0000)]
Remove fifteen-year-old notes on media selection (suggested by simon@).
Add commas after "e.g." and "i.e.". Change "silent" to "silence" in
wireless create section (reviewed by adri@).
Warren Block [Wed, 7 Nov 2012 15:59:24 +0000 (15:59 +0000)]
Add devd.conf(5) and devd(8) to SEE ALSO xrefs. Give users a pointer to
seemingly mysterious actions that are not done by ifconfig itself, but
by devd triggering on events caused by ifconfig.
Gleb Smirnoff [Wed, 7 Nov 2012 07:35:05 +0000 (07:35 +0000)]
Merge rev. 1.125 from OpenBSD:
date: 2009/06/12 02:03:51; author: dlg; state: Exp; lines: +59 -69
rewrite the way states from pfsync are merged into the local state tree
and the conditions on which pfsync will notify its peers on a stale update.
each side (ie, the sending and receiving side) of the state update is
compared separately. any side that is further along than the local state
tree is merged. if any side is further along in the local state table, an
update is sent out telling the peers about it.
Gleb Smirnoff [Wed, 7 Nov 2012 07:30:40 +0000 (07:30 +0000)]
It may happen that pfsync holds the last reference on a state. In this
case keys had already been freed. If encountering such state, then
just release last reference.
Not sure this can happen as a runtime race, but can be reproduced by
the following scenario:
- enable pfsync
- disable pfsync
- wait some time
- enable pfsync
Doug Ambrisko [Tue, 6 Nov 2012 23:25:06 +0000 (23:25 +0000)]
- Extend the prior commit to use the generic SCSI command building
function use that for JBOD and Thunderbolt disk write command. Now
we only have one implementation in mfi.
- Fix dumping on Thunderbolt cards. Polled IO commands do not seem to
be normally acknowledged by changing cmd_status to MFI_STAT_OK.
In order to get acknowledgement of the IO is complete, the Thunderbolt
command queue needs to be run through. I added a flag MFI_CMD_SCSI
to indicate this command is being polled and to complete the
Thunderbolt wrapper and indicate the result. This flag needs to be
set in the JBOD case in case if that us using Thunderbolt card.
When in the polling loop check for completed commands.
- Remove mfi_tbolt_is_ldio and just do the check when needed.
- Fix an issue when attaching of disk device happens when a device is
already scheduled to be attached but hasn't attached.
- add a tunable to allow raw disk attachment to CAM via:
hw.mfi.allow_cam_disk_passthrough=1
- fixup aborting of commands (AEN and LD state change). Use a generic
abort function and only wait the command being aborted not both.
Thunderbolt cards don't seem to abort commands so the abort times
out.
Guy Helmer [Tue, 6 Nov 2012 21:07:04 +0000 (21:07 +0000)]
Work around a race in bpfread() by validating the hold buffer pointer
before freeing it. Otherwise, we can lose a buffer and cause a panic
in catchpacket().
Navdeep Parhar [Tue, 6 Nov 2012 18:58:57 +0000 (18:58 +0000)]
Remove the tid from the software table (and bump down the in-use
counter) when the syncache doesn't want the driver to reply to an
incoming SYN. This fixes a harmless bug where tids_in_use would
go out of sync with the hardware counter.
Adrian Chadd [Tue, 6 Nov 2012 06:19:11 +0000 (06:19 +0000)]
Convert the aggregate descriptor path over to use the same API as
the non-aggregate path.
I "cheated" by using some TX setup code in our HAL that isn't present
in the atheros HAL (or Linux ath9k.)
The old path for forming aggregates was:
* setup the rate control in the first descriptor;
* call chaintxdesc() on all the frames;
* call setupfirsttxdesc() on the first descrpitor in the first
frame;
* call setuplasttxdesc() on the last descriptor in the last frame.
The new path for forming aggregates looks like the non-aggregate path:
* call setuptxdesc() on the first descriptor in the first frame;
* setup the rate control in the first descriptor;
* call filltxdesc() on each descriptor in the frame;
* if it's an aggregate - call set11n_aggr_{first, middle, last} as
appropriate (see the code for a description of what is "appropriate".)
Now, this is done primarily for the AR9300 HAL - it doesn't implement
the first set of aggregate functions. It just has the older methods
and the "first/middle/last" aggregate methods. So, let's convert the
code to use these.
Note: the AR5416 HAL in FreeBSD had that code (from me, a while ago)
and a previous commit brought it up to behave the same as the AR9300
HAL routines.
There's some further tidyups to be done - specifically, avoid doing
multiple calls to the 11n descriptor functions. I shouldn't call
clr11n_aggr(), then set11n_aggr_middle(), then also set11n_aggr_first().
On (at least MIPS) the TX descriptors are in non-cachable memory and
this will cause multiple slow writes.
I'll debug/tidy that up in a future commit.
Tested:
* AR9280, STA
* AR9280/AR9160, AP
* AR9380, STA (using a local, closed source HAL, sorry!)
Alexander Motin [Mon, 5 Nov 2012 23:20:48 +0000 (23:20 +0000)]
Rise priority of the informational messages from LOG_INFO to LOG_NOTICE,
same as used for OK status. Otherwise it looks strange when OK status is
reported, while informational is not.