]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoo Makefile BSDfication.
maxim [Fri, 4 Jun 2010 08:19:43 +0000 (08:19 +0000)]
o Makefile BSDfication.

PR: misc/147461 (with my changes)
Submitted by: Erik Cederstrand

14 years agoo Fix typo: .uudef -> .undef.
maxim [Fri, 4 Jun 2010 08:14:30 +0000 (08:14 +0000)]
o Fix typo: .uudef -> .undef.

PR: misc/147462
Submitted by: Erik Cederstrand

14 years agoFix PCH chipset IDs. They are 0x3bxx, not 0x3axx.
mav [Fri, 4 Jun 2010 07:35:59 +0000 (07:35 +0000)]
Fix PCH chipset IDs. They are 0x3bxx, not 0x3axx.

Pointy hat to: me

14 years agoExplain that setting an absolute day value can fail and that the month should
brian [Fri, 4 Jun 2010 06:56:58 +0000 (06:56 +0000)]
Explain that setting an absolute day value can fail and that the month should
usually be set first when using -v.

Adjust an example that sets the day to 30 before setting the month to 3 in
accordance with this approach as the example would always fail in February!

PR: 147354
MFC after: 2 weeks

14 years agoMake vm_contig_grow_cache() extern, and use it when vm_phys_alloc_contig()
jchandra [Fri, 4 Jun 2010 06:35:36 +0000 (06:35 +0000)]
Make vm_contig_grow_cache() extern, and use it when vm_phys_alloc_contig()
fails to allocate MIPS page table pages.  The current usage of VM_WAIT in
case of vm_phys_alloc_contig() failure is not correct, because:

"There is no guarantee that any of the available free (or cached) pages
after the VM_WAIT will fall within the range of suitable physical
addresses.  Every time this function sleeps and a single page is freed
(or cached) by someone else, this function will be reawakened.  With
a little bad luck, you could spin indefinitely."

We also add low and high parameters to vm_contig_grow_cache() and
vm_contig_launder() so that we restrict vm_contig_launder() to the range
of pages we are interested in.

Reported by: alc

Reviewed by: alc
Approved by: rrs (mentor)

14 years ago- Add myself to committers-src.dot
ae [Thu, 3 Jun 2010 21:12:51 +0000 (21:12 +0000)]
- Add myself to committers-src.dot
- Add myself to calendar.freebsd

Approved by: kib (mentor)

14 years agoMake chown(1) emit more useful error message when user/group name is invalid.
trasz [Thu, 3 Jun 2010 20:46:23 +0000 (20:46 +0000)]
Make chown(1) emit more useful error message when user/group name is invalid.

14 years agoDo not leak vm page lock in vm_contig_launder(), vm_pageout_page_lock()
kib [Thu, 3 Jun 2010 18:34:34 +0000 (18:34 +0000)]
Do not leak vm page lock in vm_contig_launder(), vm_pageout_page_lock()
always returns with the page locked.

Submitted by: alc
Pointy hat to: kib

14 years agoUse -Wl,-N instead of the undocumented -N option for GCC.
ed [Thu, 3 Jun 2010 17:42:32 +0000 (17:42 +0000)]
Use -Wl,-N instead of the undocumented -N option for GCC.

GCC forwards the -N flag directly to ld. This flag is not documented and
not supported by (for example) Clang. Just use -Wl,-N.

Submitted by: Pawel Worach

14 years agoAssert that the thread lock is held in sched_pctcpu() instead of
jhb [Thu, 3 Jun 2010 16:02:11 +0000 (16:02 +0000)]
Assert that the thread lock is held in sched_pctcpu() instead of
recursively acquiring it.  All of the current callers already hold the
lock.

MFC after: 1 month

14 years agoDon't forget to free the string in error case.
trasz [Thu, 3 Jun 2010 14:51:29 +0000 (14:51 +0000)]
Don't forget to free the string in error case.

Found with: Coverity Prevent
CID: 6585

14 years ago_posix1e_acl_sort() never returns anything other than 0; change its
trasz [Thu, 3 Jun 2010 14:29:17 +0000 (14:29 +0000)]
_posix1e_acl_sort() never returns anything other than 0; change its
return type to void and update callers.  This simplifies code and
fixes one place where the returned value was not actually checked.

Found with: Coverity Prevent
CID: 4791

14 years agoFix usage of uninitialized variable.
trasz [Thu, 3 Jun 2010 14:27:18 +0000 (14:27 +0000)]
Fix usage of uninitialized variable.

Found with: Coverity Prevent
CID: 7517
MFC after: 2 weeks

14 years agoThe 'acl_cnt' field is unsigned; no point in checking if it's >= 0.
trasz [Thu, 3 Jun 2010 14:16:58 +0000 (14:16 +0000)]
The 'acl_cnt' field is unsigned; no point in checking if it's >= 0.

Found with: Coverity Prevent
CID: 6192

14 years agoThe 'acl_cnt' field is unsigned; no point in checking if it's >= 0.
trasz [Thu, 3 Jun 2010 14:15:08 +0000 (14:15 +0000)]
The 'acl_cnt' field is unsigned; no point in checking if it's >= 0.

Found with: Coverity Prevent
CID: 6193

14 years agoThe 'acl_cnt' field is unsigned; no point in checking if it's >= 0.
trasz [Thu, 3 Jun 2010 13:45:27 +0000 (13:45 +0000)]
The 'acl_cnt' field is unsigned; no point in checking if it's >= 0.

Found with: Coverity Prevent
CID: 3688

14 years agoThe 'acl_cnt' field is unsigned; no point in checking if it's >= 0.
trasz [Thu, 3 Jun 2010 13:43:58 +0000 (13:43 +0000)]
The 'acl_cnt' field is unsigned; no point in checking if it's >= 0.

Found with: Coverity Prevent
CID: 3684

14 years agoThe acl_cnt field is unsigned; no point in checking if it's >= 0.
trasz [Thu, 3 Jun 2010 13:41:55 +0000 (13:41 +0000)]
The acl_cnt field is unsigned; no point in checking if it's >= 0.

Found with: Coverity Prevent
CID: 3683

14 years ago- Mention that VTOC8 labels are found in Fujitsu SPARC64 machines as well.
marius [Thu, 3 Jun 2010 13:04:56 +0000 (13:04 +0000)]
- Mention that VTOC8 labels are found in Fujitsu SPARC64 machines as well.
- Add information regarding VTOC8 bootrstrap code and how it's handled with
  r208777 in place.
- Document the mapping of partition types to VTOC8 tags.
- Add examples for VTOC8 to the respective section.
- Eliminated hard sentence breaks.

Reviewed by: marcel (slightly buggy version)
MFC after: 3 days

14 years ago- In gpart_bootfile_read() fix an off-by-one error preventing the bootstrap
marius [Thu, 3 Jun 2010 13:01:55 +0000 (13:01 +0000)]
- In gpart_bootfile_read() fix an off-by-one error preventing the bootstrap
  file to be of maximum size.
- Add special handling required for SMI/VTOC8 disklabel partcode, i.e. avoid
  overwriting the label when writing the bootstrap code to the partition
  starting at 0 and install it to all partitions when the -i option is omitted
  just like geom_sunlabel(4) and sunlabel(8) do by default.
- Add missing prototypes.
- Add const where applicable.

Reviewed by: marcel
MFC after: 3 days

14 years agoAvoid possible NULL-dereferences.
marius [Thu, 3 Jun 2010 12:09:02 +0000 (12:09 +0000)]
Avoid possible NULL-dereferences.

Found with: Coverity Prevent(tm)
CID: 3428
MFC after: 3 days

14 years agoFix freeing space after deleting large files with holes.
mm [Thu, 3 Jun 2010 11:08:46 +0000 (11:08 +0000)]
Fix freeing space after deleting large files with holes.

OpenSolaris onnv revision: 9950:78fc41aa9bc5

Approved by: pjd, delphij (mentor)
Obtained from: OpenSolaris (Bug ID 6792701)
MFC after: 3 days

14 years agoExtend the scope of the lock on the quota file vnode in quotaon() to
kib [Thu, 3 Jun 2010 10:24:53 +0000 (10:24 +0000)]
Extend the scope of the lock on the quota file vnode in quotaon() to
cover the initial read by dqopen(). Assert that vnode is locked in
dqopen(). Remove VFS_LOCK_GIANT() from dqopen(), since quotaon() keeps
Giant locked if needed around the call.

14 years agoSometimes vnodes share the lock despite being different vnodes on
kib [Thu, 3 Jun 2010 10:20:08 +0000 (10:20 +0000)]
Sometimes vnodes share the lock despite being different vnodes on
different mount points, e.g. the nullfs vnode and the covered vnode
from the lower filesystem. In this case, existing assertion in
vop_rename_pre() may be triggered.

Check for vnode locks equiality instead of the vnodes itself to
not trip over the situation.

Submitted by: Mikolaj Golub <to.my.trociny@gmail.com>
Tested by: pho
MFC after: 2 weeks

14 years agoAdd assertion and comment in vm_page_flag_set() describing the expectations
kib [Thu, 3 Jun 2010 10:11:45 +0000 (10:11 +0000)]
Add assertion and comment in vm_page_flag_set() describing the expectations
when the PG_WRITEABLE flag is set.

Reviewed by: alc

14 years ago[0] Improve wording.
attilio [Thu, 3 Jun 2010 09:54:53 +0000 (09:54 +0000)]
[0] Improve wording.
[1] Following style for manpages, just do carriage return after a
    sentence.

Sponsored by: Sandvine Incorporated
[0] Submitted by: emaste
[1] Submitted by: rwatson

14 years agoopensolaris_kmem.c is already part of opensolaris.ko which zfs.ko depends on.
pjd [Thu, 3 Jun 2010 09:29:54 +0000 (09:29 +0000)]
opensolaris_kmem.c is already part of opensolaris.ko which zfs.ko depends on.

Reported by: avg
MFC after: 3 days

14 years agoIn the unlikely event that pmap_ts_referenced() demoted five superpage
alc [Thu, 3 Jun 2010 03:55:22 +0000 (03:55 +0000)]
In the unlikely event that pmap_ts_referenced() demoted five superpage
mappings to the same underlying physical page, the calling thread would be
left forever pinned to the same processor.

MFC after: 3 days

14 years agoMaintain the pretense that we support 32KB pages for the sake of the ia64
alc [Thu, 3 Jun 2010 02:24:53 +0000 (02:24 +0000)]
Maintain the pretense that we support 32KB pages for the sake of the ia64
LINT build.

14 years agoPlug possible memory leak.
kan [Thu, 3 Jun 2010 00:25:43 +0000 (00:25 +0000)]
Plug possible memory leak.

Found by:  Coverity
MFC after: 2 weeks

14 years agoFixes for panic experienced in test at Intel, when
jfv [Thu, 3 Jun 2010 00:00:45 +0000 (00:00 +0000)]
Fixes for panic experienced in test at Intel, when
doing bidirectional stress traffic on 82598.

Also a couple bug fixes from Michael Tuexen, thank you!!

Add a workaround into the header so that 8 REL can use
the driver (adds local copy of ALTQ fix).

MFC: in a few days

14 years agoVarious minor and not so minor fixes suggested by Coverity.
mjacob [Wed, 2 Jun 2010 23:31:27 +0000 (23:31 +0000)]
Various minor and not so minor fixes suggested by Coverity.
In at least one case, it's amazing that target mode worked at all.

Found by: Coverity.
MFC after: 2 weeks

14 years agoDocument import of xz.
mm [Wed, 2 Jun 2010 21:28:07 +0000 (21:28 +0000)]
Document import of xz.

Approved by: delphij (mentor)

14 years agoFix build for O32 systems without a TARGET_CPUTYPE defined. We must default to
jmallett [Wed, 2 Jun 2010 21:15:00 +0000 (21:15 +0000)]
Fix build for O32 systems without a TARGET_CPUTYPE defined.  We must default to
MIPS-III because FreeBSD relies on a number of MIPS-III features; the ABI
default would be MIPS-I which we don't intend to support.  Our old default
before I switched to using the ABI default was MIPS32.

14 years agosh: Pass TERM changes to libedit.
jilles [Wed, 2 Jun 2010 19:16:58 +0000 (19:16 +0000)]
sh: Pass TERM changes to libedit.

I have changed the patch slightly to ignore TERM changes in subshells.

PR: bin/146916
Submitted by: Guy Yur
Obtained from: NetBSD

14 years agoAdd required header for isalnum(3) to quench compiler warnings
uqs [Wed, 2 Jun 2010 18:31:04 +0000 (18:31 +0000)]
Add required header for isalnum(3) to quench compiler warnings

Forgotten in: r174678
Submitted by: Alexander Best alexbestms at wwu.de
Approved by: das

14 years agoProtect periph drivers list and rearrange things to minimize the chance of
mjacob [Wed, 2 Jun 2010 18:06:32 +0000 (18:06 +0000)]
Protect periph drivers list and rearrange things to minimize the chance of
stepping oneself during probing.

Don't blindly decrement a periph probe count.

Reviewed by: scsi@
Obtained from: Alexander Motin, Atillio Rao, Others
MFC after: 1 month

14 years agoProvide memchr() in the libkern.
raj [Wed, 2 Jun 2010 17:27:23 +0000 (17:27 +0000)]
Provide memchr() in the libkern.

This is required by libfdt and will be compiled in conditionally only for
FDT-enabled platforms.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

14 years agoProvide kernel level headers for the libfdt code.
raj [Wed, 2 Jun 2010 17:24:41 +0000 (17:24 +0000)]
Provide kernel level headers for the libfdt code.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

14 years agoFlattened Device Tree helper scripts.
raj [Wed, 2 Jun 2010 17:22:38 +0000 (17:22 +0000)]
Flattened Device Tree helper scripts.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

14 years agoFDT (simplebus) compatible attachment for uart(4).
raj [Wed, 2 Jun 2010 17:20:00 +0000 (17:20 +0000)]
FDT (simplebus) compatible attachment for uart(4).

This will be a single uart(4) attachment code shared by all FDT-enabled
platforms.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

14 years agoImport the common Flattened Device Tree infrastructure.
raj [Wed, 2 Jun 2010 17:17:45 +0000 (17:17 +0000)]
Import the common Flattened Device Tree infrastructure.

o fdtbus(4) - the main abstract bus driver for all FDT-compliant systems. This
  is a direct replacement for the many incompatible bus drivers grouping
  integrated peripherals on embedded platforms (like obio(4), ocpbus(4) etc.)

o simplebus(4) - bus driver representing ePAPR style 'simple-bus' node, which
  is an umbrella device for most of the integrated peripherals on a typical
  system-on-chip device.

o Other components (common routines library, PCI node processing helper
  functions)

Reviewed by: imp
Sponsored by: The FreeBSD Foundation

14 years agoDon't leak memory on destruction.
marius [Wed, 2 Jun 2010 17:17:11 +0000 (17:17 +0000)]
Don't leak memory on destruction.

Reviewed by: marcel
MFC after: 3 days

14 years agoMinimize the use of the page queues lock for synchronizing access to the
alc [Wed, 2 Jun 2010 15:46:37 +0000 (15:46 +0000)]
Minimize the use of the page queues lock for synchronizing access to the
page's dirty field.  With the exception of one case, access to this field
is now synchronized by the object lock.

14 years agoVirtualize the IPv4 multicast routing code.
zec [Wed, 2 Jun 2010 15:44:43 +0000 (15:44 +0000)]
Virtualize the IPv4 multicast routing code.

Submitted by: iprebeg
Reviewed by: bms, bz, Pavlin Radoslavov
MFC after: 30 days

14 years agoProvide a macro for registering a virtualized sysctl handler for
zec [Wed, 2 Jun 2010 15:29:21 +0000 (15:29 +0000)]
Provide a macro for registering a virtualized sysctl handler for
VNET opaque data.

MFC after: 30 days

14 years agoMFamd64: Add a new macro PCPU_XEN_FIELDS to hold XEN-specific per-CPU
jhb [Wed, 2 Jun 2010 15:09:36 +0000 (15:09 +0000)]
MFamd64: Add a new macro PCPU_XEN_FIELDS to hold XEN-specific per-CPU
fields that is always included in PCPU_MD_FIELDS.  The macro is empty for
non-XEN kernels.  This avoids duplicating non-XEN per-CPU fields in two
places.  While here, remove several unused fields from the XEN-specific
structure.

Reviewed by: kmacy, gibbs
MFC after: 1 month

14 years agoAdd/improve mips64r2, Octeon, n32 and n64 support in the toolchain.
jmallett [Wed, 2 Jun 2010 11:06:03 +0000 (11:06 +0000)]
Add/improve mips64r2, Octeon, n32 and n64 support in the toolchain.

o) Add TARGET_ABI to the MIPS toolchain build process.  This sets the default
   ABI to one of o32, n32 or n64.  If it is not set, o32 is assumed as that is
   the current default.
o) Set the default GCC cpu type to any specified TARGET_CPUTYPE.  This is
   necessary to have a working "cc" if e.g. mips64 is specified, as binutils
   will refuse to link objects using different ISAs in some cases.
o) Add support for n32 and n64 ABIs to binutils and GCC.
o) Add additional required libgcc2 stubs for n32 and n64.
o) Add support for the "mips64r2" architecture to GCC.  Add the "octeon"
o) When static linking, wrap default libraries in --start-group and
   --end-group.  This is required for static linking to work on n64 with the
   interdependencies between libraries there.  This is what other OSes that
   support n64 seem to do, as well.
o) Fix our GCC spec to define __mips64 for 64-bit targets, not __mips64__, the
   former being what libgcc, etc., check and the latter seemingly being a
   misspelling of a hand merge from a Linux spec.
o) When no TARGET_CPUTYPE is specified at build time, make GCC take the default
   ISA from the ABI.  Our old defaults were too liberal and assumed that 64-bit
   ABIs should default to the MIPS64 ISA and that 32-bit ABIs should default to
   the MIPS32 ISA, when we are supporting or will support some systems based on
   earlier 32-bit and 64-bit ISAs, most notably MIPS-III.
o) Merge a new opcode file (and support code) from a later version of binutils
   and add flags and code necessary to support Octeon-specific instructions.
   This should also make merging opcodes for other modern architectures easier.

Reviewed by: imp

14 years agomdoc: spell macros correctly, there's no need for the backslash escape
uqs [Wed, 2 Jun 2010 10:20:38 +0000 (10:20 +0000)]
mdoc: spell macros correctly, there's no need for the backslash escape

14 years agomdoc: use literal text, not a column table to present the
uqs [Wed, 2 Jun 2010 10:20:31 +0000 (10:20 +0000)]
mdoc: use literal text, not a column table to present the
configuration file snippet.

14 years agomdoc cleanup
uqs [Wed, 2 Jun 2010 10:20:23 +0000 (10:20 +0000)]
mdoc cleanup

Garbage collect unused sections, macros and arguments. Fix prologue and
remove empty lines.

Found by: mdocml

14 years agoAdd a facility to dynamically adjust or unconfigure p1003_1b mib.
kib [Wed, 2 Jun 2010 09:59:05 +0000 (09:59 +0000)]
Add a facility to dynamically adjust or unconfigure p1003_1b mib.
Use it to allow to tune sem_nsem_max at runtime, only when sem.ko
module is present in kernel.

Requested and tested by: amdmi3
Reviewed by: jhb
MFC after: 3 days

14 years agoZero struct before reading from it
uqs [Wed, 2 Jun 2010 09:34:41 +0000 (09:34 +0000)]
Zero struct before reading from it

PR:    140384
Found by:  clang static analyzer
MFC after: 3 weeks

14 years agoRecommend disabling LAPIC timer instead whole APIC for fixing C3 state.
mav [Wed, 2 Jun 2010 08:43:18 +0000 (08:43 +0000)]
Recommend disabling LAPIC timer instead whole APIC for fixing C3 state.

PR: docs/147180
Submitted by: Tobias Rehbein

14 years agoFix stuttering sequences and reverse ranges
brian [Wed, 2 Jun 2010 07:47:29 +0000 (07:47 +0000)]
Fix stuttering sequences and reverse ranges

PR: 123635
Submitted by: Ulrich Spörlein, uqs at spoerlein dot net

14 years agoMore commas
des [Tue, 1 Jun 2010 22:46:57 +0000 (22:46 +0000)]
More commas

14 years agoRemove unnecessary pointer type castings, shift operations and dead code.
jkim [Tue, 1 Jun 2010 21:15:05 +0000 (21:15 +0000)]
Remove unnecessary pointer type castings, shift operations and dead code.

14 years agoIn the case that mmu_booke_enter_locked() is changing the attributes of a
alc [Tue, 1 Jun 2010 19:56:02 +0000 (19:56 +0000)]
In the case that mmu_booke_enter_locked() is changing the attributes of a
mapping but not changing the physical page being mapped, the wrong flags
were being inspected in order to determine whether or not to flush the
instruction cache.  The effect of looking at the wrong flags was that the
instruction cache was never being flushed.

Reviewed by: marcel

14 years agoDon't try to call cdevsw d_close() method when devfs_close() is called
jh [Tue, 1 Jun 2010 18:57:21 +0000 (18:57 +0000)]
Don't try to call cdevsw d_close() method when devfs_close() is called
because of insmntque1() failure.

Found with: stress2
Suggested and reviewed by: kib

14 years agoAdjust the manpage after r207329.
attilio [Tue, 1 Jun 2010 18:27:48 +0000 (18:27 +0000)]
Adjust the manpage after r207329.

Sponsored by: Sandvine Incorporated
Reviewed by: cpercival, emaste, marcel
X-MFC: r207329

14 years agoRevert taskqueue(9) related commits until mdf@ is approved and can
zml [Tue, 1 Jun 2010 16:04:01 +0000 (16:04 +0000)]
Revert taskqueue(9) related commits until mdf@ is approved and can
resolve issues.

This reverts commits r207439, r208623, r208624

14 years agoRewrite ar9285SetBoardValues() to match what ath9k does and fix out of
rpaulo [Tue, 1 Jun 2010 15:47:57 +0000 (15:47 +0000)]
Rewrite ar9285SetBoardValues() to match what ath9k does and fix out of
bounds reads.

MFC after: 3 days

14 years agoBring in a couple of fixes from the Linux ath9k related to chip hangs.
rpaulo [Tue, 1 Jun 2010 15:33:10 +0000 (15:33 +0000)]
Bring in a couple of fixes from the Linux ath9k related to chip hangs.
While there, try to make the register write pattern look like what's
done by ath9k.

MFC after: 3 days

14 years agoMissing commas
des [Tue, 1 Jun 2010 15:11:29 +0000 (15:11 +0000)]
Missing commas

14 years agoFix an off by one in ar9285SetPowerCalTable().
rpaulo [Tue, 1 Jun 2010 14:37:11 +0000 (14:37 +0000)]
Fix an off by one in ar9285SetPowerCalTable().

Found with: Coverity Prevent(tm)
CID: 3979
MFC after: 3 days

14 years agoFix resource leaks in ieee80211_ioctl_setchanlist() in case of error.
rpaulo [Tue, 1 Jun 2010 14:20:58 +0000 (14:20 +0000)]
Fix resource leaks in ieee80211_ioctl_setchanlist() in case of error.

Found with: Coverity Prevent(tm)
CID: 4115
MFC after: 3 days

14 years agoCompare the address of the array, not the array.
rpaulo [Tue, 1 Jun 2010 14:17:08 +0000 (14:17 +0000)]
Compare the address of the array, not the array.

Found with: Coverity Prevent(tm)
CID: 3690
MFC after: 3 days

14 years agoDon't reference null pointer in hwmp_recv_preq().
rpaulo [Tue, 1 Jun 2010 14:13:59 +0000 (14:13 +0000)]
Don't reference null pointer in hwmp_recv_preq().

Found with: Coverity Prevent(tm)
CID: 3912
MFC after: 3 days

14 years agoProperly initialize stack variable sr in setmlme_assoc_adhoc().
rpaulo [Tue, 1 Jun 2010 14:04:00 +0000 (14:04 +0000)]
Properly initialize stack variable sr in setmlme_assoc_adhoc().

Found with: Coverity Prevent(tm)
CID 4365
MFC after: 3 days

14 years agoFix ZIL close when doing zfs rollback or zfs receive on a mounted dataset.
mm [Tue, 1 Jun 2010 08:43:46 +0000 (08:43 +0000)]
Fix ZIL close when doing zfs rollback or zfs receive on a mounted dataset.

The fix is a partial import and merge of OpenSolaris onnv revisions
8227:f7d7be9b1f56. and 9292:e112194b5b73

Approved by: pjd, delphij (mentor)
Obtained from: OpenSolaris (Bug ID 6798298)
MFC after: 3 days

14 years agoIn pmap_enter_locked(), don't require the vector page to be VPO_BUSY.
alc [Tue, 1 Jun 2010 05:32:59 +0000 (05:32 +0000)]
In pmap_enter_locked(), don't require the vector page to be VPO_BUSY.

14 years agoMerge portions of r208645 and supporting code from the i386 pmap:
alc [Tue, 1 Jun 2010 05:18:48 +0000 (05:18 +0000)]
Merge portions of r208645 and supporting code from the i386 pmap:
  When I pushed down the page queues lock into pmap_is_modified(), I created
  an ordering dependence: A pmap operation that clears PG_WRITEABLE and calls
  vm_page_dirty() must perform the call first.  Otherwise, pmap_is_modified()
  could return FALSE without acquiring the page queues lock because the page
  is not (currently) writeable, and the caller to pmap_is_modified() might
  believe that the page's dirty field is clear because it has not seen the
  effect of the vm_page_dirty() call.

  When I pushed down the page queues lock into pmap_is_modified(), I
  overlooked one place where this ordering dependence is violated:
  pmap_enter().  In a rare situation pmap_enter() can be called to replace a
  dirty mapping to one page with a mapping to another page.  (I say rare
  because replacements generally occur as a result of a copy-on-write fault,
  and so the old page is not dirty.)  This change delays clearing PG_WRITEABLE
  until after vm_page_dirty() has been called.

  Fixing the ordering dependency also makes it easy to introduce a small
  optimization: When pmap_enter() used to replace a mapping to one page with a
  mapping to another page, it freed the pv entry for the first mapping and
  later called the pv entry allocator for the new mapping.  Now, pmap_enter()
  attempts to recycle the old pv entry, saving two calls to the pv entry
  allocator.

  There is no point in setting PG_WRITEABLE on unmanaged pages, so don't.

14 years agoFix a KASSERT() that was broken in r208665.
alc [Tue, 1 Jun 2010 04:38:05 +0000 (04:38 +0000)]
Fix a KASSERT() that was broken in r208665.

Reported by: jmallett

14 years agoAllow to use 'jailed' property again.
pjd [Mon, 31 May 2010 23:29:56 +0000 (23:29 +0000)]
Allow to use 'jailed' property again.

Reported by: Eugene Mitrofanov <eugene@imedia.ru>
MFC after: 3 days

14 years agoFix a bug where resilver is not started automatically on pool import or load.
pjd [Mon, 31 May 2010 23:17:45 +0000 (23:17 +0000)]
Fix a bug where resilver is not started automatically on pool import or load.
If disk was missing on pool load or import and on next pool load or import
it was present, resilver wasn't started automatically and ZFS reported all disks
as ONLINE and healthy. Then, when another disk died, pool became unaccessible,
because if it was 2-way mirror or RAIDZ1 two vdevs were out of sync.

To fix the problem, start resilver automatically on pool load or import.

Obtained from: OpenSolaris
MFC after: 3 days

14 years agoFix panic when reading label from provider with non power of 2 sector size.
pjd [Mon, 31 May 2010 23:11:43 +0000 (23:11 +0000)]
Fix panic when reading label from provider with non power of 2 sector size.

Reported by: James R. Van Artsdalen <james-freebsd-fs2@jrv.org>
MFC after: 3 days

14 years agog_label: fix possible NULL pointer dereference
avg [Mon, 31 May 2010 09:10:39 +0000 (09:10 +0000)]
g_label: fix possible NULL pointer dereference

in case glabel debug level is >= 1 and gp->provider list is empty
for some reason

Found by: clang static analyzer
MFC after: 4 days

14 years agoudf_readlink: fix malloc call with uninitialized size parameter
avg [Mon, 31 May 2010 09:08:44 +0000 (09:08 +0000)]
udf_readlink: fix malloc call with uninitialized size parameter

Found by: clang static analyzer
MFC after: 4 days

14 years agoamdsbwd: fix nonsensical timeout calculations
avg [Mon, 31 May 2010 09:07:23 +0000 (09:07 +0000)]
amdsbwd: fix nonsensical timeout calculations

in case when sub-second interval is being programmed

Found by: clang static analyzer
MFC after: 4 days

14 years agozfs boot: fix error handling in zfs_readdir
avg [Mon, 31 May 2010 09:06:03 +0000 (09:06 +0000)]
zfs boot: fix error handling in zfs_readdir

Found by: clang static analyzer
MFC after: 4 days

14 years agoEliminate a stale comment.
alc [Mon, 31 May 2010 06:06:10 +0000 (06:06 +0000)]
Eliminate a stale comment.

14 years agoMerge portions of r208645 and supporting code from the i386 pmap:
alc [Mon, 31 May 2010 01:43:02 +0000 (01:43 +0000)]
Merge portions of r208645 and supporting code from the i386 pmap:
  When I pushed down the page queues lock into pmap_is_modified(), I created
  an ordering dependence: A pmap operation that clears PG_WRITEABLE and calls
  vm_page_dirty() must perform the call first.  Otherwise, pmap_is_modified()
  could return FALSE without acquiring the page queues lock because the page
  is not (currently) writeable, and the caller to pmap_is_modified() might
  believe that the page's dirty field is clear because it has not seen the
  effect of the vm_page_dirty() call.

  When I pushed down the page queues lock into pmap_is_modified(), I
  overlooked one place where this ordering dependence is violated:
  pmap_enter().  In a rare situation pmap_enter() can be called to replace a
  dirty mapping to one page with a mapping to another page.  (I say rare
  because replacements generally occur as a result of a copy-on-write fault,
  and so the old page is not dirty.)  This change delays clearing PG_WRITEABLE
  until after vm_page_dirty() has been called.

  Fixing the ordering dependency also makes it easy to introduce a small
  optimization: When pmap_enter() used to replace a mapping to one page with a
  mapping to another page, it freed the pv entry for the first mapping and
  later called the pv entry allocator for the new mapping.  Now, pmap_enter()
  attempts to recycle the old pv entry, saving two calls to the pv entry
  allocator.

14 years agoSimplify the inner loop of get_pv_entry(): While iterating over the page's
alc [Sun, 30 May 2010 20:31:12 +0000 (20:31 +0000)]
Simplify the inner loop of get_pv_entry(): While iterating over the page's
pv list, there is no point in checking whether or not the pv list is empty,
wait instead until the loop completes.

14 years agoSimplify the inner loop of pmap_collect(): While iterating over the page's
alc [Sun, 30 May 2010 18:48:41 +0000 (18:48 +0000)]
Simplify the inner loop of pmap_collect(): While iterating over the page's
pv list, there is no point in checking whether or not the pv list is empty.
Instead, wait until the loop completes.

14 years agosh: Fix a crash if a heredoc was not properly ended and parsing continued.
jilles [Sun, 30 May 2010 14:20:32 +0000 (14:20 +0000)]
sh: Fix a crash if a heredoc was not properly ended and parsing continued.

Example (in interactive mode):
  cat <<EOF && )
The next command typed caused sh to segfault, because the state for the here
document was not reset.

Like parser_temp, this uses the fact that the parser is not re-entered.

14 years agosh: Change interaction of command substitution and here documents.
jilles [Sun, 30 May 2010 14:11:27 +0000 (14:11 +0000)]
sh: Change interaction of command substitution and here documents.

If a command substitution contains a newline token, this no longer starts
here documents of outer commands. This way, we follow POSIX's idea of the
command substitution being a separate script more closely. It also matches
other shells better and is consistent with newline characters in quotes not
starting here documents.

The extension tested in parser/heredoc3.0 ($(cat <<EOF)\ntext\nEOF\n)
continues to be supported.

In particular, this change allows things like
  cat <<EOF && echo `pwd`
(a `` command substitution after a here document)
which formerly silently used an empty file as the here document, because the
EOF of the inner command "pwd" also forced an empty here document.

14 years agodevfs(5): Also mention when device nodes on ufs stopped working (6.0),
jilles [Sun, 30 May 2010 13:32:39 +0000 (13:32 +0000)]
devfs(5): Also mention when device nodes on ufs stopped working (6.0),
as requested by some people.

MFC after: 2 weeks

14 years agoMerge various changes from i386/i386/pmap.c:
alc [Sun, 30 May 2010 04:44:32 +0000 (04:44 +0000)]
Merge various changes from i386/i386/pmap.c:

The remaining, unmerged portions of r175404
  Retire PMAP_DIAGNOSTIC.  Any useful diagnostics that were conditionally
  compiled under PMAP_DIAGNOSTIC are now KASSERT()s.  (Note: The kernel
  option DIAGNOSTIC still disables inlining of certain pmap functions.)

  Eliminate dead code from pmap_enter().  This code implemented an assertion.
  On i386, an equivalent check is already implemented.  However, on amd64,
  a small change is required to implement an equivalent check.

  Eliminate \n from a nearby panic string.

  Use KASSERT() to reimplement pmap_copy()'s two assertions.

Merge portions of r177659
  To date, we have assumed that the TLB will only set the PG_M bit in a
  PTE if that PTE has the PG_RW bit set.  However, this assumption does
  not hold on recent processors from Intel.  For example, consider a PTE
  that has the PG_RW bit set but the PG_M bit clear.  Suppose this PTE
  is cached in the TLB and later the PG_RW bit is cleared in the PTE,
  but the corresponding TLB entry is not (yet) invalidated.
  Historically, upon a write access using this (stale) TLB entry, the
  TLB would observe that the PG_RW bit had been cleared and initiate a
  page fault, aborting the setting of the PG_M bit in the PTE.  Now,
  however, P4- and Core2-family processors will set the PG_M bit before
  observing that the PG_RW bit is clear and initiating a page fault.  In
  other words, the write does not occur but the PG_M bit is still set.

  The real impact of this difference is not that great.  Specifically,
  we should no longer assert that any PTE with the PG_M bit set must
  also have the PG_RW bit set, and we should ignore the state of the
  PG_M bit unless the PG_RW bit is set.

r208609
  Defer freeing any page table pages in pmap_remove_all() until after the
  page queues lock is released.  This may reduce the amount of time that the
  page queues lock is held by pmap_remove_all().

r208645
  When I pushed down the page queues lock into pmap_is_modified(), I created
  an ordering dependence: A pmap operation that clears PG_WRITEABLE and calls
  vm_page_dirty() must perform the call first.  Otherwise, pmap_is_modified()
  could return FALSE without acquiring the page queues lock because the page
  is not (currently) writeable, and the caller to pmap_is_modified() might
  believe that the page's dirty field is clear because it has not seen the
  effect of the vm_page_dirty() call.

  When I pushed down the page queues lock into pmap_is_modified(), I
  overlooked one place where this ordering dependence is violated:
  pmap_enter().  In a rare situation pmap_enter() can be called to replace a
  dirty mapping to one page with a mapping to another page.  (I say rare
  because replacements generally occur as a result of a copy-on-write fault,
  and so the old page is not dirty.)  This change delays clearing PG_WRITEABLE
  until after vm_page_dirty() has been called.

  Fixing the ordering dependency also makes it easy to introduce a small
  optimization: When pmap_enter() used to replace a mapping to one page with a
  mapping to another page, it freed the pv entry for the first mapping and
  later called the pv entry allocator for the new mapping.  Now, pmap_enter()
  attempts to recycle the old pv entry, saving two calls to the pv entry
  allocator.

  There is no point in setting PG_WRITEABLE on unmanaged pages, so don't.
  Update a comment to reflect this.

  Tidy up the variable declarations at the start of pmap_enter().

14 years agoFix a regression from r200554, which broke fdc(4) attachment to acpi(4).
jkim [Sun, 30 May 2010 03:45:41 +0000 (03:45 +0000)]
Fix a regression from r200554, which broke fdc(4) attachment to acpi(4).
I removed too many lines and a wrong pointer was accidentally passed down.

Tested by: Scott Allendorf (scott-allendorf at uiowa dot edu), kib
MFC after: 3 days

14 years agoAdd file include processing for newsyslog.
gordon [Sat, 29 May 2010 22:55:59 +0000 (22:55 +0000)]
Add file include processing for newsyslog.

Format for the include line in /etc/newsyslog.conf is:
<include> /etc/defaults/newsyslog.conf

Other notes of interest:
Globbing is supported in <include> statements.
Properly detect circular include loop dependencies.

Reviewed by: gad@
Approved by: wes@ (mentor)
MFC after: 2 months

14 years agoConvert newsyslog to using queue(3) macros instead of a home rolled version.
gordon [Sat, 29 May 2010 22:52:17 +0000 (22:52 +0000)]
Convert newsyslog to using queue(3) macros instead of a home rolled version.

Reviewed by: gad@
Approved by: wes@ (mentor)
MFC after: 2 months

14 years agoClarify devfs manpages slightly.
jilles [Sat, 29 May 2010 20:24:01 +0000 (20:24 +0000)]
Clarify devfs manpages slightly.

mount(8): add xref to devfs(5)
devfs(5): change example to something more likely to be useful (it is not
necessary to mount a devfs on /dev manually, but for chroots/jails it is
often needed), mention since when devfs is preferred to device nodes on ufs

PR: 146600
MFC after: 2 weeks

14 years agoDon't set PG_WRITEABLE in pmap_enter() unless the page is managed.
alc [Sat, 29 May 2010 18:26:44 +0000 (18:26 +0000)]
Don't set PG_WRITEABLE in pmap_enter() unless the page is managed.

14 years agoWhen I pushed down the page queues lock into pmap_is_modified(), I created
alc [Sat, 29 May 2010 17:10:45 +0000 (17:10 +0000)]
When I pushed down the page queues lock into pmap_is_modified(), I created
an ordering dependence: A pmap operation that clears PG_WRITEABLE and calls
vm_page_dirty() must perform the call first.  Otherwise, pmap_is_modified()
could return FALSE without acquiring the page queues lock because the page
is not (currently) writeable, and the caller to pmap_is_modified() might
believe that the page's dirty field is clear because it has not seen the
effect of the vm_page_dirty() call.

When I pushed down the page queues lock into pmap_is_modified(), I
overlooked one place where this ordering dependence is violated:
pmap_enter().  In a rare situation pmap_enter() can be called to replace a
dirty mapping to one page with a mapping to another page.  (I say rare
because replacements generally occur as a result of a copy-on-write fault,
and so the old page is not dirty.)  This change delays clearing PG_WRITEABLE
until after vm_page_dirty() has been called.

Fixing the ordering dependency also makes it easy to introduce a small
optimization: When pmap_enter() used to replace a mapping to one page with a
mapping to another page, it freed the pv entry for the first mapping and
later called the pv entry allocator for the new mapping.  Now, pmap_enter()
attempts to recycle the old pv entry, saving two calls to the pv entry
allocator.

There is no point in setting PG_WRITEABLE on unmanaged pages, so don't.
Update a comment to reflect this.

Tidy up the variable declarations at the start of pmap_enter().

14 years agoDue to the way HALDEBUG() is defined, we need to add curly brackets
rpaulo [Sat, 29 May 2010 16:14:02 +0000 (16:14 +0000)]
Due to the way HALDEBUG() is defined, we need to add curly brackets
when using it as a sole if clause instruction.
While there, fix 'const static' typo.

Submitted by: Arnaud Lacombe <alc@FreeBSD.org>
MFC after: 1 week

14 years agoDue to the way HALDEBUG() is defined, we need to add curly brackets when
rpaulo [Sat, 29 May 2010 16:11:51 +0000 (16:11 +0000)]
Due to the way HALDEBUG() is defined, we need to add curly brackets when
using it as a sole if clause instruction.

Submitted by: Arnaud Lacombe <alc@FreeBSD.org>
MFC after: 1 week

14 years agoDon't shadow the global variable 'version'.
rpaulo [Sat, 29 May 2010 16:10:07 +0000 (16:10 +0000)]
Don't shadow the global variable 'version'.

Submitted by: Arnaud Lacombe <alc@NetBSD.org>
MFC after: 1 week

14 years agoMFi386: the part of revision 181809
nyan [Sat, 29 May 2010 09:12:02 +0000 (09:12 +0000)]
MFi386: the part of revision 181809

  Use SEL_KPL macro.

14 years agoMFi386: revision 178471
nyan [Sat, 29 May 2010 09:07:40 +0000 (09:07 +0000)]
MFi386: revision 178471

 - Add an integer argument to idle to indicate how likely we are to wake
   from idle over the next tick.
 - Add a new MD routine, cpu_wake_idle() to wakeup idle threads who are
   suspended in cpu specific states.  This function can fail and cause the
   scheduler to fall back to another mechanism (ipi).
 - Implement support for mwait in cpu_idle() on i386/amd64 machines that
   support it.  mwait is a higher performance way to synchronize cpus
   as compared to hlt & ipis.
 - Allow selecting the idle routine by name via sysctl machdep.idle.  This
   replaces machdep.cpu_idle_hlt.  Only idle routines supported by the
   current machine are permitted.

14 years agoReduce diffs against i386.
nyan [Sat, 29 May 2010 03:40:00 +0000 (03:40 +0000)]
Reduce diffs against i386.