]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoMFC
attilio [Sat, 22 Oct 2011 22:56:20 +0000 (22:56 +0000)]
MFC

12 years agoFix Buildworld WITHOUT_OPENSSL.
kientzle [Sat, 22 Oct 2011 22:22:46 +0000 (22:22 +0000)]
Fix Buildworld WITHOUT_OPENSSL.

PR: kern/160922
MFC after: 3 days

12 years agoVN_NRESERVLEVEL is used in this file but opt_vm is not included
attilio [Sat, 22 Oct 2011 22:00:35 +0000 (22:00 +0000)]
VN_NRESERVLEVEL is used in this file but opt_vm is not included
thus the stub switch won't be correctly handled.
Include opt_vm.h.

Submitted by: jeff
MFC after: 3 days

12 years agoCorrect the spelling of getgrgid and getpwuid in the man page.
kientzle [Sat, 22 Oct 2011 17:56:24 +0000 (17:56 +0000)]
Correct the spelling of getgrgid and getpwuid in the man page.

MFC after: 3 days

12 years agoTypo from previous commit. Urgh.
kientzle [Sat, 22 Oct 2011 16:53:29 +0000 (16:53 +0000)]
Typo from previous commit. Urgh.

12 years agoBring in the --gid --gname --uid and --uname implementation
kientzle [Sat, 22 Oct 2011 16:52:04 +0000 (16:52 +0000)]
Bring in the --gid --gname --uid and --uname implementation
from libarchive.googlecode.com.

MFC after: 3 days

12 years agoUpgrade our copy of llvm/clang to r142614, from upstream's release_30
dim [Sat, 22 Oct 2011 14:08:43 +0000 (14:08 +0000)]
Upgrade our copy of llvm/clang to r142614, from upstream's release_30
branch.  This brings us very close to the 3.0 release, which is expected
in a week or two.

MFC after: 1 week

12 years agoRevert the previous commit and add a comment explaining why it was wrong.
des [Sat, 22 Oct 2011 14:08:21 +0000 (14:08 +0000)]
Revert the previous commit and add a comment explaining why it was wrong.

12 years agoopenpam_static.c isn't auto-generated.
des [Sat, 22 Oct 2011 04:39:12 +0000 (04:39 +0000)]
openpam_static.c isn't auto-generated.

12 years agoFix a race: we should update sc_len before dropping the pf lock, otherwise a
glebius [Fri, 21 Oct 2011 22:28:15 +0000 (22:28 +0000)]
Fix a race: we should update sc_len before dropping the pf lock, otherwise a
number of packets can be queued on sc, while we are in ip_output(), and then
we wipe the accumulated sc_len. On next pfsync_sendout() that would lead to
writing beyond our mbuf cluster.

12 years agoUpdate per-thread I/O statistics collection in ZFS.
pjd [Fri, 21 Oct 2011 21:49:34 +0000 (21:49 +0000)]
Update per-thread I/O statistics collection in ZFS.
This allows to see processes I/O activity in 'top -m io' output.

PR kern/156218
Reported by: Marcus Reid <marcus@blazingdot.com>
Patch by: avg
MFC after: 3 days

12 years agoSpelling.
glebius [Fri, 21 Oct 2011 20:23:40 +0000 (20:23 +0000)]
Spelling.

Submitted by: dougb

12 years agoMinor corrections and clarifications regarding exceptions.
das [Fri, 21 Oct 2011 14:23:59 +0000 (14:23 +0000)]
Minor corrections and clarifications regarding exceptions.

12 years agozfs vdev_file_io_start: validate vdev before using vdev_tsd
pjd [Fri, 21 Oct 2011 14:00:48 +0000 (14:00 +0000)]
zfs vdev_file_io_start: validate vdev before using vdev_tsd

vdev_tsd can be NULL for certain vdev states.
At least in userland testing with ztest.

Submitted by: avg
MFC after: 3 days

12 years agozdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS
pjd [Fri, 21 Oct 2011 13:56:17 +0000 (13:56 +0000)]
zdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS

Submitted by: avg
MFC after: 3 days

12 years agothr_create: new_thread_ID may be NULL
pjd [Fri, 21 Oct 2011 13:54:58 +0000 (13:54 +0000)]
thr_create: new_thread_ID may be NULL

Submitted by: avg
MFC after: 3 days

12 years agoNote that it is still not possible to guard special kind of allocations, those
glebius [Fri, 21 Oct 2011 13:54:17 +0000 (13:54 +0000)]
Note that it is still not possible to guard special kind of allocations, those
that have special relationships with uma(9). Currently only mbuf clusters.

12 years agolibzpool task_alloc: pass only valid flags to kmem_alloc
pjd [Fri, 21 Oct 2011 13:53:06 +0000 (13:53 +0000)]
libzpool task_alloc: pass only valid flags to kmem_alloc

tqflags may contain other flags besided those that are suitable for
kmem_alloc == umem_alloc

Submitted by: avg
MFC after: 3 days

12 years agoBecause ZFS boot code was very fragile in the past and real PITA to debug,
pjd [Fri, 21 Oct 2011 13:44:26 +0000 (13:44 +0000)]
Because ZFS boot code was very fragile in the past and real PITA to debug,
introduce zfsboottest.sh script that will verify if it will be possible to boot
from the given pool.

# zfsboottest.sh system

Where "system" is pool name of the pool we want to boot from.

What is being verified by the script:
- Does the pool exist?
- Does it have bootfs property configured?
- Is mountpoint property of the boot dataset set to 'legacy'?

Dataset configured in bootfs property has to be mounted to perform more
checks:
- Does the /boot directory in boot dataset exist?
- Is this dataset configured as root file system in /etc/fstab or set
  in vfs.root.mountfrom variable in /boot/loader.conf?

By using zfsboottest tool the script will read all the files in /boot
directory using ZFS boot code and calculate their checksums.
Then, it will walk /boot directory using find(1) though regular file sytem
and also read all the files in /boot directory and calculate their checksums.
If any of the files cannot be looked up, read or checksum is invalid it will
be reported and booting off of this pool is probably not possible.

Some additional checks may be interesting as well. For example if the disks
contain proper pmbr and gptzfsboot code or if all expected files in /boot/
are present.

When upgrading FreeBSD, one should snapshot datasets that contain operating
system, upgrade (install new world and kernel) and use zfsboottest.sh to verify
if it will be possible to boot from new configuration. If all is good one
should upgrade boot blocks, by eg.:

# gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1

If something is wrong, one should rollback datasets and report the problems.

MFC after: 3 days

12 years ago- Allow to specify multiple files to check, eg.
pjd [Fri, 21 Oct 2011 13:13:18 +0000 (13:13 +0000)]
- Allow to specify multiple files to check, eg.

zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel /boot/zfsloader

- Instead of printing file's content calculate MD5 hash of the file,
  so it can be easly compared to the hash calculated via file system.
- Some other minor improvements.

MFC after: 3 days

12 years agoAdd missing #includes.
ed [Fri, 21 Oct 2011 12:58:34 +0000 (12:58 +0000)]
Add missing #includes.

According to POSIX, these two header files should be able to be included
by themselves, not depending on other headers. The <net/if.h> header
uses struct sockaddr when __BSD_VISIBLE=1, while <netinet/tcp.h> uses
integer datatypes (u_int32_t, u_short, etc).

MFC after: 2 months

12 years agoIn FreeBSD ip_output() expects ip_len and ip_off in host byte order
glebius [Fri, 21 Oct 2011 11:11:18 +0000 (11:11 +0000)]
In FreeBSD ip_output() expects ip_len and ip_off in host byte order

PR: kern/159029

12 years agoIt turns out that truss also used kdump's mkioctls script, and expected
des [Fri, 21 Oct 2011 11:08:25 +0000 (11:08 +0000)]
It turns out that truss also used kdump's mkioctls script, and expected
ioctlname() to return a pointer to the name rather than print it.  This did
not show up in testing because truss had its own prototype for ioctlname(),
so it would build fine and run fine as long as the program being traced did
not issue an ioctl.

Teach mkioctls to generate different versions of ioctlname() based on its
first command-line argument.

Pointed out by: Garrett Cooper <yanegomi@gmail.com>

12 years agoPeople porting FreeBSD to new architectures ought not have to
das [Fri, 21 Oct 2011 06:41:46 +0000 (06:41 +0000)]
People porting FreeBSD to new architectures ought not have to
implement a deprecated FPU control interface in addition to the
standard one.  To make this clearer, further deprecate ieeefp.h
by not declaring the function prototypes except on architectures
that implement them already.

Currently i386 and amd64 implement the ieeefp.h interface for
compatibility, and for fp[gs]etprec(), which doesn't exist on
most other hardware.  Powerpc, sparc64, and ia64 partially implement
it and probably shouldn't, and other architectures don't implement it
at all.

12 years agoReplace a proliferation of buggy MD implementations of modf() with a
das [Fri, 21 Oct 2011 06:40:36 +0000 (06:40 +0000)]
Replace a proliferation of buggy MD implementations of modf() with a
working MI one.  The MI one only needs to be overridden on machines
with non-IEEE754 arithmetic.  (The last supported one was the VAX.)
It can also be overridden if someone comes up with a faster one that
actually passes the regression tests -- but this is harder than it sounds.

12 years agoAdd regression tests for modf{,f,l}().
das [Fri, 21 Oct 2011 06:36:40 +0000 (06:36 +0000)]
Add regression tests for modf{,f,l}().

12 years agoAdd support for the 'x' mode option in fopen() as specified in the C1X
das [Fri, 21 Oct 2011 06:35:58 +0000 (06:35 +0000)]
Add support for the 'x' mode option in fopen() as specified in the C1X
draft standard.  The option is equivalent to O_EXCL.

MFC after: 1 month

12 years agoTests for complex trig and hyperbolic functions.
das [Fri, 21 Oct 2011 06:34:38 +0000 (06:34 +0000)]
Tests for complex trig and hyperbolic functions.

12 years agoTests for cancellation in fma(). Also include more tests for 128-bit
das [Fri, 21 Oct 2011 06:32:54 +0000 (06:32 +0000)]
Tests for cancellation in fma(). Also include more tests for 128-bit
long doubles. Thanks for clusteradm (simon) for making the needed
hardware available.

12 years agoFix a regression introduced in r226371: When the high part of x*y
das [Fri, 21 Oct 2011 06:30:43 +0000 (06:30 +0000)]
Fix a regression introduced in r226371: When the high part of x*y
exactly cancels with z, return the low part of x*y instead of
discarding it.

12 years agoFix a corner case: tan(large + Inf i) == NaN + NaN i.
das [Fri, 21 Oct 2011 06:30:16 +0000 (06:30 +0000)]
Fix a corner case: tan(large + Inf i) == NaN + NaN i.

12 years agoImproved handling of large x in ccosh{,f}():
das [Fri, 21 Oct 2011 06:29:32 +0000 (06:29 +0000)]
Improved handling of large x in ccosh{,f}():
- Handle cases where exp(x) would overflow, but ccosh(x) ~= exp(x) / 2
  shouldn't.
- Use the ccosh(x) ~= exp(x) / 2 approximation to simplify the calculation
  when x is large.

Similarly for csinh().  Also fixed the return value of csinh(-Inf +- 0i).

12 years agoUse __ldexp_exp() to simplify things and improve accuracy for x near
das [Fri, 21 Oct 2011 06:28:47 +0000 (06:28 +0000)]
Use __ldexp_exp() to simplify things and improve accuracy for x near
the overflow threshold.

12 years agoThe cexp() and {,c}{cos,sin}h functions all need to be able to compute
das [Fri, 21 Oct 2011 06:27:56 +0000 (06:27 +0000)]
The cexp() and {,c}{cos,sin}h functions all need to be able to compute
exp(x) scaled down by some factor, and the challenge is doing this
accurately when exp(x) would overflow.  This change replaces all of
the tricks we've been using with common __ldexp_exp() and
__ldexp_cexp() routines that handle all the scaling.

bde plans to improve on this further by moving the guts of exp() into
k_exp.c and handling the scaling in a more direct manner.  But the
current approach is simple and adequate for now.

12 years agoUse STRICT_ASSIGN() to ensure that the compiler doesn't screw things
das [Fri, 21 Oct 2011 06:26:38 +0000 (06:26 +0000)]
Use STRICT_ASSIGN() to ensure that the compiler doesn't screw things
up by storing x in a wider type than it's supposed to.

Submitted by: bde

12 years agoPer IEEE754r, pow(1, y) is 1 even if y is NaN, and pow(-1, +-Inf) is 1.
das [Fri, 21 Oct 2011 06:26:07 +0000 (06:26 +0000)]
Per IEEE754r, pow(1, y) is 1 even if y is NaN, and pow(-1, +-Inf) is 1.

MFC after: 2 weeks

12 years agoBugfix: feenableexcept() and fedisableexcept() should just return the
das [Fri, 21 Oct 2011 06:25:31 +0000 (06:25 +0000)]
Bugfix: feenableexcept() and fedisableexcept() should just return the
old exception mask, not mask | ~FE_ALL_EXCEPT.

MFC after: 2 weeks

12 years agoVendor import of clang release_30 branch r142614:
dim [Thu, 20 Oct 2011 21:14:49 +0000 (21:14 +0000)]
Vendor import of clang release_30 branch r142614:
http://llvm.org/svn/llvm-project/cfe/branches/release_30@142614

12 years agoVendor import of llvm release_30 branch r142614:
dim [Thu, 20 Oct 2011 21:10:27 +0000 (21:10 +0000)]
Vendor import of llvm release_30 branch r142614:
http://llvm.org/svn/llvm-project/llvm/branches/release_30@142614

12 years agoMake all the lines align properly.
pjd [Thu, 20 Oct 2011 21:01:50 +0000 (21:01 +0000)]
Make all the lines align properly.

MFC after: 3 days

12 years agoWith LOADER_MBR_SUPPORT defined and LOADER_GPT_SUPPORT undefined we would
pjd [Thu, 20 Oct 2011 15:46:54 +0000 (15:46 +0000)]
With LOADER_MBR_SUPPORT defined and LOADER_GPT_SUPPORT undefined we would
never call disk_openmbr().

Submitted by: avg
MFC after: 3 days

12 years ago- Correctly read gang header from raidz.
pjd [Thu, 20 Oct 2011 15:42:38 +0000 (15:42 +0000)]
- Correctly read gang header from raidz.
- Decompress assembled gang block data if compressed.
- Verify checksum of a gang header.
- Verify checksum of assembled gang block data.
- Verify checksum of uber block.

Submitted by: avg
MFC after: 3 days

12 years agoBuild 'dtc' by default for MIPS.
jchandra [Thu, 20 Oct 2011 13:41:37 +0000 (13:41 +0000)]
Build 'dtc' by default for MIPS.

The device tree compiler is needed during the kernel build to compile
DTS files to DTB.

Reviewed by: stas

12 years agoFix missing return when LOADER_GPT_SUPPORT is defined, but LOADER_MBR_SUPPORT
pjd [Wed, 19 Oct 2011 23:48:15 +0000 (23:48 +0000)]
Fix missing return when LOADER_GPT_SUPPORT is defined, but LOADER_MBR_SUPPORT
is not.

MFC after: 3 days

12 years agoAlways pass data size for checksum verification function, as using
pjd [Wed, 19 Oct 2011 23:44:38 +0000 (23:44 +0000)]
Always pass data size for checksum verification function, as using
physical block size declared in bp may not always be what we want.
For example in case of gang block header physical block size declared
in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum
calculation failed. This bug could lead to accessing unallocated
memory and resets/failures during boot.

MFC after: 3 days

12 years agoNever pass NULL block pointer when reading. This is neither expected nor
pjd [Wed, 19 Oct 2011 23:40:37 +0000 (23:40 +0000)]
Never pass NULL block pointer when reading. This is neither expected nor
handled by lower layers like vdev_raidz, which uses bp for checksum
verification. This bug could lead to NULL pointer reference and resets
during boot.

MFC after: 3 days

12 years agoDon't mark vdev as healthy too soon, so we won't try to use invalid vdevs.
pjd [Wed, 19 Oct 2011 23:37:30 +0000 (23:37 +0000)]
Don't mark vdev as healthy too soon, so we won't try to use invalid vdevs.

MFC after: 3 days

12 years agoInitialize 'rc' properly before using it. This error could lead to infinite
pjd [Wed, 19 Oct 2011 23:33:48 +0000 (23:33 +0000)]
Initialize 'rc' properly before using it. This error could lead to infinite
loop when data reconstruction was needed.

MFC after: 3 days

12 years agoRemove redundant size calculation.
pjd [Wed, 19 Oct 2011 23:31:50 +0000 (23:31 +0000)]
Remove redundant size calculation.

MFC after: 3 days

12 years agoAdd a warning about why sbp(4) is commented out so that curious folks
kensmith [Wed, 19 Oct 2011 21:55:20 +0000 (21:55 +0000)]
Add a warning about why sbp(4) is commented out so that curious folks
are forewarned they might wind up with a hole in their foot if they
decide to give it a try.

Suggested by: dougb

12 years agoIf ls was invoked with -i but neither -l nor -s, blocksize was used in
des [Wed, 19 Oct 2011 15:35:41 +0000 (15:35 +0000)]
If ls was invoked with -i but neither -l nor -s, blocksize was used in
display() to calculate column widths, but was not initialized in
main().  This resulted in a division by zero.

Noticed by: Michael Butler <imb@protected-networks.net>

12 years agoKeep FDT options commented until dtc is build by default for mips
jchandra [Wed, 19 Oct 2011 14:38:01 +0000 (14:38 +0000)]
Keep FDT options commented until dtc is build by default for mips

Otherwise automated builds will fail for XLP and XLP64

12 years agoFix recursive pf locking leading to panics. Splatter PF_LOCK_ASSERT()s
bz [Wed, 19 Oct 2011 13:13:56 +0000 (13:13 +0000)]
Fix recursive pf locking leading to panics.  Splatter PF_LOCK_ASSERT()s
to document where we are expecting to be called with a lock held to
more easily catch unnoticed code paths.
This does not neccessarily improve locking in pfsync, it just tries
to avoid the panics reported.

PR: kern/159390, kern/158873
Submitted by: pluknet (at least something that partly resembles
my patch ignoring other cleanup, which I only saw
too late on the 2nd PR)
MFC After: 3 days

12 years agolatin1 -> utf8
des [Wed, 19 Oct 2011 11:43:51 +0000 (11:43 +0000)]
latin1 -> utf8

12 years agoDe-virtualize the pf_task_mtx lock. At the current state of pf locking
bz [Wed, 19 Oct 2011 11:04:49 +0000 (11:04 +0000)]
De-virtualize the pf_task_mtx lock.  At the current state of pf locking
and virtualization it is not helpful but complicates things.

Current state of art is to not virtualize these kinds of locks -
inp_group/hash/info/.. are all not virtualized either.

MFC after: 3 days

12 years agoAdjust the PF_ASSERT() macro to what we usually use in the network stack:
bz [Wed, 19 Oct 2011 10:16:42 +0000 (10:16 +0000)]
Adjust the PF_ASSERT() macro to what we usually use in the network stack:
PF_LOCK_ASSERT() and PF_UNLOCK_ASSERT().

MFC after: 3 days

12 years agoAdd new USB IDs to RUN driver. Update usb.conf.
hselasky [Wed, 19 Oct 2011 10:09:01 +0000 (10:09 +0000)]
Add new USB IDs to RUN driver. Update usb.conf.

PR: usb/161798
MFC after: 3 days

12 years agoIn the non-FreeBSD case we do not expect PF_LOCK and friends to do anything.
bz [Wed, 19 Oct 2011 10:08:58 +0000 (10:08 +0000)]
In the non-FreeBSD case we do not expect PF_LOCK and friends to do anything.

MFC after: 3 days

12 years agoPseudo interfaces should go at SI_SUB_PSEUDO. However at least
bz [Wed, 19 Oct 2011 10:04:24 +0000 (10:04 +0000)]
Pseudo interfaces should go at SI_SUB_PSEUDO.  However at least
pfsync also depends on pf to be initialized already so pf goes at
FIRST and the interfaces go at ANY.
Then the (VNET_)SYSINIT startups for pf stays at SI_SUB_PROTO_BEGIN
and for pfsync we move to the later SI_SUB_PROTO_IF.

This is not ideal either but at least an order that should work for
the moment and can be re-fined with the VIMAGE merge, once this will
actually work with more than one network stack.

MFC after: 3 days

12 years agoFix an obvious locking bug where we would lock again rather than unlock.
bz [Wed, 19 Oct 2011 09:34:40 +0000 (09:34 +0000)]
Fix an obvious locking bug where we would lock again rather than unlock.

MFC after: 3 days

12 years agoFix a bug when NPFSYNC > 0 that on FreeBSD we would always return
bz [Wed, 19 Oct 2011 08:57:17 +0000 (08:57 +0000)]
Fix a bug when NPFSYNC > 0 that on FreeBSD we would always return
and never remove state.

This fixes the problem some people are seeing that state is removed when pf
is loaded as a module but not in situations when compiled into the kernel.

Reported by: many on freebsd-pf
Tested by: flo
MFC after: 3 days

12 years agoFix indentation in a loop and a tiny maze of #ifdefs for just the
bz [Wed, 19 Oct 2011 08:37:48 +0000 (08:37 +0000)]
Fix indentation in a loop and a tiny maze of #ifdefs for just the
__FreeBSD__ parts that had it wrong.

MFC after: 3 days

12 years agoAdd missing DEBUG define from r226514.
fabient [Wed, 19 Oct 2011 07:16:57 +0000 (07:16 +0000)]
Add missing DEBUG define from r226514.

12 years agoFix breakage introduced by r226518.
dim [Wed, 19 Oct 2011 06:24:53 +0000 (06:24 +0000)]
Fix breakage introduced by r226518.

Spotted by: tinderbox, yanefbsd at gmail.com
Pointy hat to: dim

12 years agoFix some memory errors in *at() regression tests.
jilles [Tue, 18 Oct 2011 22:51:40 +0000 (22:51 +0000)]
Fix some memory errors in *at() regression tests.

12 years agoAllow to dump on Solaris swap partitions.
marius [Tue, 18 Oct 2011 20:16:02 +0000 (20:16 +0000)]
Allow to dump on Solaris swap partitions.

PR: 161764
Submitted by: Peter Jeremy

12 years agoThe current /etc/dumpdates file restricts device names to 32 characters.
mckusick [Tue, 18 Oct 2011 18:42:26 +0000 (18:42 +0000)]
The current /etc/dumpdates file restricts device names to 32 characters.
With the addition of various GEOM layers some device names now exceed
this length, for example /dev/mirror/encrypted.elig.journal. This
change expands the field to 53 bytes which brings the /etc/dumpdates
lines to 80 characters. Exceeding 80 characters makes the /etc/dumpdates
file much less human readable. A test is added to dump so that it
verifies that the device name will fit in the 53 character field
failing the dump if it is too long.

This change has been checked to verify that its /etc/dumpdates file
is compatible with older versions of dump.

Reported by: Martin Sugioarto <martin@sugioarto.com>
PR:          kern/160678
MFC after:   3 weeks

12 years agoUpdate gcc's __FreeBSD__ and __FreeBSD_cc_version macros for FreeBSD 10.
dim [Tue, 18 Oct 2011 17:38:25 +0000 (17:38 +0000)]
Update gcc's __FreeBSD__ and __FreeBSD_cc_version macros for FreeBSD 10.

12 years agoFix the way clang retrieves the major FreeBSD release number from the
dim [Tue, 18 Oct 2011 17:37:18 +0000 (17:37 +0000)]
Fix the way clang retrieves the major FreeBSD release number from the
target triple, so that the __FreeBSD__ and __FreeBSD_cc_version builtin
macros return the expected results.

Spotted by: nalitoja at gmail.com

12 years agoFix wakeup latency when sleeping with 'wait'
jchandra [Tue, 18 Oct 2011 16:37:28 +0000 (16:37 +0000)]
Fix wakeup latency when sleeping with 'wait'

If we handle an interrupt just before the 'wait' and the interrupt
schedules some work, we need to skip the 'wait' call. The simple solution
of calling sched_runnable() with interrupts disabled immediately before
wait still leaves a window after the call and before 'wait' in which
the same issue can occur.

The solution implemented is to check the EPC in the interrupt handler, and
if it is in a region before the 'wait' call, to fix up the EPC to skip the
wait call.

Reported/analysed by: adrian
Fix suggested by: kib

Reviewed by: jmallett, imp

12 years agoAdd a flush of the current PMC log buffer before displaying the next top.
fabient [Tue, 18 Oct 2011 15:25:43 +0000 (15:25 +0000)]
Add a flush of the current PMC log buffer before displaying the next top.

As the underlying block is 4KB if the PMC throughput is low the measurement
will be reported on the next tick. pmcstat(8) use the modified flush API to
reclaim current buffer before displaying next top.

MFC after: 1 month

12 years agoFix XLP compile failure on n32 abi.
jchandra [Tue, 18 Oct 2011 14:05:18 +0000 (14:05 +0000)]
Fix XLP compile failure on n32 abi.

Reported by: bz@

12 years agoImport fix for Illumos bug #1475 to reduce diff against upstream.
mm [Tue, 18 Oct 2011 13:58:22 +0000 (13:58 +0000)]
Import fix for Illumos bug #1475 to reduce diff against upstream.

Panic caused by this bug was already partially fixed by pjd@
in p4 CH 185940 and 185942.

Reference:
1475 zfs spill block hold can access invalid spill blkptr
https://www.illumos.org/issues/1475

Reviewed by: delphij
Obtained from: Illumos (issue 1475, changeset 13469:b8e89e5c4167)
MFC after: 1 week

12 years agoComment out the sbp(4) driver for architectures that support it.
kensmith [Tue, 18 Oct 2011 13:45:16 +0000 (13:45 +0000)]
Comment out the sbp(4) driver for architectures that support it.

As part of the 8.0-RELEASE cycle this was done in stable/8 (r199112)
but was left alone in head so people could work on fixing an issue that
caused boot failure on some motherboards.  Apparently nobody has worked
on it and we are getting reports of boot failure with the 9.0 test builds.
So this time I'll comment out the driver in head (still hoping someone
will work on it) and MFC to stable/9.

Submitted by: Alberto Villa <avilla at FreeBSD dot org>

12 years agoWhen calculating the width of the blocksize column, ls(1) used 512-byte
des [Tue, 18 Oct 2011 13:10:46 +0000 (13:10 +0000)]
When calculating the width of the blocksize column, ls(1) used 512-byte
units (as returned by stat(2)) instead of BLOCKSIZE units.

Submitted by: Paul Schenkeveld
MFC after: 3 weeks

12 years agoEscape the newline so we get a proper line continuation. Without this
kensmith [Tue, 18 Oct 2011 11:29:10 +0000 (11:29 +0000)]
Escape the newline so we get a proper line continuation.  Without this
the text of the menu selections doesn't get displayed properly and it
makes the installer appear to lock up for no obvious reason.

Reviewed by: nwhitehorn

12 years agoLook for /boot/config in addition to /boot.config, with the former taking
des [Tue, 18 Oct 2011 09:46:52 +0000 (09:46 +0000)]
Look for /boot/config in addition to /boot.config, with the former taking
precedence over the latter if it exists.

MFC after: 3 weeks

12 years agoFix copy-pasto in CAPFAIL_INCREASE case.
des [Tue, 18 Oct 2011 09:39:41 +0000 (09:39 +0000)]
Fix copy-pasto in CAPFAIL_INCREASE case.

Noticed by: pjd

12 years agoMake ktrace(1) build cleanly at WARNS level 6 by completely rethinking the
des [Tue, 18 Oct 2011 08:26:12 +0000 (08:26 +0000)]
Make ktrace(1) build cleanly at WARNS level 6 by completely rethinking the
way in which it handles the -C, -c, -g and -p options.

MFC after: 3 weeks

12 years agoMinor clarification
des [Tue, 18 Oct 2011 08:20:36 +0000 (08:20 +0000)]
Minor clarification

MFC after: 3 weeks

12 years agoSimplify df(1) by factoring out most of the common code:
des [Tue, 18 Oct 2011 08:18:26 +0000 (08:18 +0000)]
Simplify df(1) by factoring out most of the common code:

 - In the argc == 0 case, just populate the mount list as before, but
   do not calculate widths, update totals or print anything.

 - In the argv > 0 case, collect information about the requested file
   systems and store it in the mount list, but do not calculate
   widths, update totals or print anything.

 - In either case, once all the information has been collected,
   iterate once through the mount list to calculate widths and totals,
   then once more to print everything.

This also fixes two bugs: firstly, column widths were not calculated
correctly if more than one file system was specified on the command
line; and secondly, file systems with MNT_IGNORE were included in the
totals even if -a was not specified.

Noticed by: Paul Schenkeveld
MFC after: 3 weeks

12 years agoSupport for booting XLP using FDT.
jchandra [Tue, 18 Oct 2011 08:10:23 +0000 (08:10 +0000)]
Support for booting XLP using FDT.

- update xlp_machdep.c to read arguments from FDT if FDT support is
  compiled in.
- define rmi_uart_bus_space, and use it as fdtbus_bs_tag
- update conf files for FDT support
- add default dts file xlp-basic.dts

12 years agoGet rid of D_PSEUDO.
ed [Tue, 18 Oct 2011 08:09:44 +0000 (08:09 +0000)]
Get rid of D_PSEUDO.

It seems the D_PSEUDO flag was meant to allow make_dev() to return NULL.
Nowadays we have a different interface for that; make_dev_p(). There's
no need to keep it there.

While there, remove an unneeded D_NEEDMINOR from the gpio driver.

Discussed with: gonzo@ (gpio)

12 years agoTrace attempts to call restricted MD syscalls.
des [Tue, 18 Oct 2011 07:39:27 +0000 (07:39 +0000)]
Trace attempts to call restricted MD syscalls.

12 years agoTrace attempts to open a portal device.
des [Tue, 18 Oct 2011 07:31:49 +0000 (07:31 +0000)]
Trace attempts to open a portal device.

Ceterum censeo portalfs esse delendam.

12 years agoFDT support for MIPS.
jchandra [Tue, 18 Oct 2011 07:29:21 +0000 (07:29 +0000)]
FDT support for MIPS.

Add architecture specific files needed to compile MIPS with
flattened device tree support.

12 years agoRevisit the capability failure trace points. The initial implementation
des [Tue, 18 Oct 2011 07:28:58 +0000 (07:28 +0000)]
Revisit the capability failure trace points.  The initial implementation
only logged instances where an operation on a file descriptor required
capabilities which the file descriptor did not have.  By adding a type enum
to struct ktr_cap_fail, we can catch other types of capability failures as
well, such as disallowed system calls or attempts to wrap a file descriptor
with more capabilities than it had to begin with.

12 years agoAdd in a currently-disabled WAR for PCI NICs.
adrian [Tue, 18 Oct 2011 03:32:18 +0000 (03:32 +0000)]
Add in a currently-disabled WAR for PCI NICs.

Some earlier series (~AR5212?) play badly with BIOSes.

In these instances, they may require a forced reset (by transitioning
the NIC through D0 -> D3 -> D0) before they probe/attach correctly.

This is currently disabled because:

* I haven't figured out the "right" code to ensure this only happens
  for PCI NICs (not PCIe or Cardbus);
* I haven't at all done wide scale testing for this, and I'm not yet
  ready for said wide-scale testing.

I'm documenting this primarily so users with misbehaving NICs have
something to tinker with.

Obtained from: Atheros

12 years agoAdd a WAR from the reference code - clear the PCI error status
adrian [Tue, 18 Oct 2011 03:24:17 +0000 (03:24 +0000)]
Add a WAR from the reference code - clear the PCI error status
upon detach.

Obtained from: Atheros

12 years agoPort over some missing code from the ar5212 reference driver reset path.
adrian [Tue, 18 Oct 2011 03:17:06 +0000 (03:17 +0000)]
Port over some missing code from the ar5212 reference driver reset path.

The final missing bit here is enabling the PCI configuration register
read, but there's currently no glue available for the HAL to read (and
write) PCI configuration space registers.

Obtained from: Atheros

12 years agoImplement the first part of the BB read workaround.
adrian [Tue, 18 Oct 2011 03:01:41 +0000 (03:01 +0000)]
Implement the first part of the BB read workaround.

The AR5008/AR9001 series NICs have a bug where BB register reads
will occasionally be corrupted. This could cause issues with things
such as ANI, which adjust operational parameters based on the
BB radio register reads. This was introduced in the AR5008 chip
and fixed with the first released AR9002 series NIC (AR9280v2.)

A followup commit will implement the acutal WAR when reading
BB registers. I'm still not sure how I'll implement it - whether
it should be done in the osdep layer, or whether it should just
live in the AR5416 HAL. Either way, they can use this capability
bit to determine whether to implement the WAR or not.

Thankyou to various sources inside Atheros who have helped me track
down what this particular issue is.

Obtained from: Atheros

12 years agoAdd in OS_REG_BIT_SET, a macro which does what it says it does.
adrian [Tue, 18 Oct 2011 02:46:26 +0000 (02:46 +0000)]
Add in OS_REG_BIT_SET, a macro which does what it says it does.

This will be used in an upcoming commit to the ar5212 HAL.

12 years agoInclude opt_ah.h when compiling the driver.
adrian [Tue, 18 Oct 2011 02:43:59 +0000 (02:43 +0000)]
Include opt_ah.h when compiling the driver.

There are HAL methods which are actually direct register
access, rather than simply HAL calls. Because of this, these
register accesses would use the non-debug path in ah_osdep.h
as opt_ah.h isn't included.

With this, the correct register access methods are used,
so debugging traces show things such as TXDP checking and
TSF32 access.

12 years agoFix a bug in sa_find_sizes() which could lead to panic:
delphij [Mon, 17 Oct 2011 22:23:27 +0000 (22:23 +0000)]
Fix a bug in sa_find_sizes() which could lead to panic:

When calculating space needed for SA_BONUS buffers,
hdrsize is always rounded up to next 8-aligned boundary.
However, in two places the round up was done against
sum of 'total' plus hdrsize.  On the other hand,
hdrsize increments by 4 each time, which means in
certain conditions, we would end up returning with
will_spill == 0 and (total + hdrsize) larger than
full_space, leading to a failed assertion because
it's invalid for dmu_set_bonus.

Sponsored by: iXsystems, Inc.
Reviewed by: mm
MFC after: 3 days

12 years ago- remove device keyword from makefs manpage
eadler [Mon, 17 Oct 2011 21:31:03 +0000 (21:31 +0000)]
- remove device keyword from makefs manpage

PR: docs/144408
Submitted by: gcooper
Approved by: gjb
Approved by: sahil (mentor)
MFC after: 1 week

12 years agoMake sure to report media change status to caller. Previously it
yongari [Mon, 17 Oct 2011 20:03:38 +0000 (20:03 +0000)]
Make sure to report media change status to caller. Previously it
always reported success.

12 years agoAdd missing driver lock in media status handler.
yongari [Mon, 17 Oct 2011 19:58:34 +0000 (19:58 +0000)]
Add missing driver lock in media status handler.

12 years agoClose a race where SIOCGIFMEDIA ioctl get inconsistent link status.
yongari [Mon, 17 Oct 2011 19:51:38 +0000 (19:51 +0000)]
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in
mii_pollstat(), updating user supplied structure should be done
before dropping a driver lock.

Reported by: Karim (fodillemlinkarimi <> gmail dot com)

12 years agoClose a race where SIOCGIFMEDIA ioctl get inconsistent link status.
yongari [Mon, 17 Oct 2011 19:49:00 +0000 (19:49 +0000)]
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in
mii_pollstat(), updating user supplied structure should be done
before dropping a driver lock.

Reported by: Karim (fodillemlinkarimi <> gmail dot com)

12 years agoFix whitespace.
ed [Mon, 17 Oct 2011 19:40:26 +0000 (19:40 +0000)]
Fix whitespace.