]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agosh: Fix integer overflow check, it checked an uninitialized variable.
Jilles Tjoelker [Sun, 26 Dec 2010 13:41:53 +0000 (13:41 +0000)]
sh: Fix integer overflow check, it checked an uninitialized variable.

13 years agosh: Allow arbitrary large numbers in CHECKSTRSPACE.
Jilles Tjoelker [Sun, 26 Dec 2010 13:25:47 +0000 (13:25 +0000)]
sh: Allow arbitrary large numbers in CHECKSTRSPACE.
Reduce "stack string" API somewhat and simplify code.
Add a check for integer overflow of the "stack string" length (probably
incomplete).

13 years agoLock the vm page queue mutex in pmap_pte_release around the call
Colin Percival [Sun, 26 Dec 2010 13:05:43 +0000 (13:05 +0000)]
Lock the vm page queue mutex in pmap_pte_release around the call
to PMAP_SET_VA; this fixes a mutex-not-held panic when a process
which called mlock(2) exits, and parallels a change made in
pmap_pte 10 months ago (svn r204160).

Note: The locking in this code is utterly broken.  We should not
be using the VM page queue mutex to protect the queue of pending
Xen page mapping hypervisor calls.  Even if it made sense to do
so, this commit and r204160 introduce LORs between the vm page
queue mutex and PMAP2mutex.

(However, a possible deadlock is better than a guaranteed panic,
and this change will hopefully make life easier for whoever fixes
the Xen pmap locking in the future.)

PR: kern/140313
MFC after: 3 days

13 years agoCorrect the order of the arguments to vm_fault_quick_hold_pages().
Alan Cox [Sun, 26 Dec 2010 01:42:52 +0000 (01:42 +0000)]
Correct the order of the arguments to vm_fault_quick_hold_pages().

13 years agoRetire vm_fault_quick(). It's no longer used.
Alan Cox [Sat, 25 Dec 2010 23:54:50 +0000 (23:54 +0000)]
Retire vm_fault_quick().  It's no longer used.

Reviewed by: kib@

13 years agoModify the experimental NFS server so that it uses LK_SHARED
Rick Macklem [Sat, 25 Dec 2010 21:56:25 +0000 (21:56 +0000)]
Modify the experimental NFS server so that it uses LK_SHARED
for RPC operations when it can. Since VFS_FHTOVP() currently
always gets an exclusively locked vnode and is usually called
at the beginning of each RPC, the RPCs for a given vnode will
still be serialized. As such, passing a lock type argument to
VFS_FHTOVP() would be preferable to doing the vn_lock() with
LK_DOWNGRADE after the VFS_FHTOVP() call.

Reviewed by: kib
MFC after: 2 weeks

13 years agoIntroduce and use a new VM interface for temporarily pinning pages. This
Alan Cox [Sat, 25 Dec 2010 21:26:56 +0000 (21:26 +0000)]
Introduce and use a new VM interface for temporarily pinning pages.  This
new interface replaces the combined use of vm_fault_quick() and
pmap_extract_and_hold() throughout the kernel.

In collaboration with: kib@

13 years agoo Fix -u flag description: it takes a username as an argument.
Maxim Konovalov [Sat, 25 Dec 2010 17:35:30 +0000 (17:35 +0000)]
o Fix -u flag description: it takes a username as an argument.

PR: docs/153416
Submitted by: Eitan Adler
MFC after: 1 week

13 years agoFix typo (Pashka -> Paskha).
Sergey A. Osokin [Sat, 25 Dec 2010 11:52:04 +0000 (11:52 +0000)]
Fix typo (Pashka -> Paskha).

13 years agoSlightly improve output of lock(1).
Ed Schouten [Sat, 25 Dec 2010 11:24:27 +0000 (11:24 +0000)]
Slightly improve output of lock(1).

- Remove the /dev/ portion of the TTY name.
- In case we use lock -p, print the username that was used to obtain the
  password hash.

13 years agoImplement support for ELF filters in rtld. Both normal and auxillary
Konstantin Belousov [Sat, 25 Dec 2010 08:51:20 +0000 (08:51 +0000)]
Implement support for ELF filters in rtld. Both normal and auxillary
filters are implemented.

Filtees are loaded on demand, unless LD_LOADFLTR environment variable
is set or -z loadfltr was specified during the linking. This forces
rtld to upgrade read-locked rtld_bind_lock to write lock when it
encounters an object with filter during symbol lookup.

Consolidate common arguments of the symbol lookup functions in the
SymLook structure.  Track the state of the rtld locks in the
RtldLockState structure. Pass local RtldLockState through the rtld
symbol lookup calls to allow lock upgrades.

Reviewed by: kan
Tested by: Mykola Dzham <i levsha me>, nwhitehorn (powerpc)

13 years agoAdd a hook to pass debug flags to the build of rtld when doing make in
Konstantin Belousov [Sat, 25 Dec 2010 08:42:38 +0000 (08:42 +0000)]
Add a hook to pass debug flags to the build of rtld when doing make in
the rtld directory.

Reviewed by: kan

13 years agoAdd an argument to nfsvno_getattr() in the experimental
Rick Macklem [Fri, 24 Dec 2010 21:31:18 +0000 (21:31 +0000)]
Add an argument to nfsvno_getattr() in the experimental
NFS server, so that it can avoid calling VOP_ISLOCKED()
when the vnode is known to be locked. This will allow
LK_SHARED to be used for these cases, which happen to
be all the cases that can use LK_SHARED. This does not
fix any bug, but it reduces the number of calls to
VOP_ISLOCKED() and prepares the code so that it can be
switched to using LK_SHARED in a future patch.

Reviewed by: kib
MFC after: 2 weeks

13 years agoSimplify vnode locking in the expeimental NFS server's
Rick Macklem [Fri, 24 Dec 2010 20:24:07 +0000 (20:24 +0000)]
Simplify vnode locking in the expeimental NFS server's
readdir functions. In particular, get rid of two bogus
VOP_ISLOCKED() calls. Removing the VOP_ISLOCKED() calls
is the only actual bug fixed by this patch.

Reviewed by: kib
MFC after: 2 weeks

13 years agoSince VOP_READDIR() for ZFS does not return monotonically
Rick Macklem [Fri, 24 Dec 2010 18:46:44 +0000 (18:46 +0000)]
Since VOP_READDIR() for ZFS does not return monotonically
increasing directory offset cookies, disable the UFS related
loop that skips over directory entries at the beginning of
the block for the experimental NFS server. This loop is
required for UFS since it always returns directory entries
starting at the beginning of the block that
the requested directory offset is in. In discussion with pjd@
and mckusick@ it seems that this behaviour of UFS should maybe
change, with this fix being an interim patch until then.
This patch only fixes the experimental server, since pjd@ is
working on a patch for the regular server.

Discussed with: pjd, mckusick
MFC after: 5 days

13 years agoAlways clear flag PMUTEX_FLAG_DEFERED when unlocking, as it is only
David Xu [Fri, 24 Dec 2010 07:41:39 +0000 (07:41 +0000)]
Always clear flag PMUTEX_FLAG_DEFERED when unlocking, as it is only
significant for lock owner.

13 years agoRedirect stderr from config to /dev/null. config -m is printing lots
Warner Losh [Fri, 24 Dec 2010 04:55:56 +0000 (04:55 +0000)]
Redirect stderr from config to /dev/null.  config -m is printing lots
of annoying warnings when dealing with arm.  The arm config files need
to be fixed, but this restricts the output to a more useful place.

13 years agoIXP4XX_GPIO_{,UN}LOCK() don't take args. Remove the sc here to make
Warner Losh [Thu, 23 Dec 2010 19:28:50 +0000 (19:28 +0000)]
IXP4XX_GPIO_{,UN}LOCK() don't take args.  Remove the sc here to make
this compile again.

13 years agoDon't try to reserve a resource that is already allocated. If the ECDT
John Baldwin [Thu, 23 Dec 2010 18:50:14 +0000 (18:50 +0000)]
Don't try to reserve a resource that is already allocated.  If the ECDT
table is present, then the acpi_ec(4) driver will allocate its resources
from nexus0 before the acpi0 device reserves resources for child devices.

Reviewed by: jkim

13 years agoDrop the icu_lock spinlock while pausing briefly after masking the
John Baldwin [Thu, 23 Dec 2010 15:17:28 +0000 (15:17 +0000)]
Drop the icu_lock spinlock while pausing briefly after masking the
interrupt in the I/O APIC before moving it to a different CPU.  If the
interrupt had been triggered by the I/O APIC after locking icu_lock but
before we masked the pin in the I/O APIC, then this could cause the
interrupt to be pending on the "old" CPU and it would finally trigger
after we had moved the interrupt to the new CPU.  This could cause us to
panic as there was no interrupt source associated with the old IDT vector
on the old CPU.  Dropping the lock after the interrupt is masked but
before it is moved allows the interrupt to fire and be handled in this
case before it is moved.

Tested by: Daniel Braniss  danny of cs huji ac il
MFC after: 1 week

13 years agoEnlarge hash table for new condition variable.
David Xu [Thu, 23 Dec 2010 03:12:03 +0000 (03:12 +0000)]
Enlarge hash table for new condition variable.

13 years agostyle.Makefile says tab between var= and value.
Xin LI [Thu, 23 Dec 2010 01:45:48 +0000 (01:45 +0000)]
style.Makefile says tab between var= and value.

13 years agoThis patch fixes a soft update panic while running perl 5.12 tests
Kirk McKusick [Thu, 23 Dec 2010 00:38:57 +0000 (00:38 +0000)]
This patch fixes a soft update panic while running perl 5.12 tests
which produced:

    panic: indir_trunc: Index out of range -148 parent -2061 lbn -305164

Reported by: Dimitry Andric
Fixed by: Jeff Roberson

13 years agoAllow overriding pidfile and dumpfile.
Xin LI [Wed, 22 Dec 2010 23:58:21 +0000 (23:58 +0000)]
Allow overriding pidfile and dumpfile.

PR: bin/153362
Submitted by: Joe Holden <joe rewt org uk>
MFC after: 1 month

13 years agoUse resource_list_reserve() to reserve I/O port and memory resources for
John Baldwin [Wed, 22 Dec 2010 20:27:20 +0000 (20:27 +0000)]
Use resource_list_reserve() to reserve I/O port and memory resources for
ACPI devices even if they are not allocated by a device driver since the
resources are in use and should not be allocated to another device.

13 years agoIncrease size of pcb_flags to four bytes.
Jung-uk Kim [Wed, 22 Dec 2010 19:57:03 +0000 (19:57 +0000)]
Increase size of pcb_flags to four bytes.

Requested by: bde, jhb

13 years agoProvide a possibility to configure the inital congestion window to the
Michael Tuexen [Wed, 22 Dec 2010 19:04:14 +0000 (19:04 +0000)]
Provide a possibility to configure the inital congestion window to the
value defined in RFC 4960.

MFC after: 3 months.

13 years agoInclude std.sentry5 from the SENTRY5 kernel configuration. This was
Nathan Whitehorn [Wed, 22 Dec 2010 19:01:48 +0000 (19:01 +0000)]
Include std.sentry5 from the SENTRY5 kernel configuration. This was
apparently missed in r215270.

13 years agoImprove plausibility check in sctp_handle_sack().
Michael Tuexen [Wed, 22 Dec 2010 17:59:38 +0000 (17:59 +0000)]
Improve plausibility check in sctp_handle_sack().
Allow cmt_on_off to support values 0 (no CMT), 1 (CMT), and 2 (CMT/RP).

MFC after: 3 months.

13 years agoFix date, broken in r216667.
Edward Tomasz Napierala [Wed, 22 Dec 2010 17:12:58 +0000 (17:12 +0000)]
Fix date, broken in r216667.

Submitted by: stefanf@

13 years agoThe 'kern.corefile="whatever"' syntax won't work with sysctl.conf; remove
Edward Tomasz Napierala [Wed, 22 Dec 2010 17:02:01 +0000 (17:02 +0000)]
The 'kern.corefile="whatever"' syntax won't work with sysctl.conf; remove
the quotes to not mislead people.

MFC after: 1 month

13 years agoAdd package directories used for the upcoming 8.2 and 7.4 releases,
Ken Smith [Wed, 22 Dec 2010 15:44:25 +0000 (15:44 +0000)]
Add package directories used for the upcoming 8.2 and 7.4 releases,
and catch up on a few from previous releases.

13 years agoEnable build of FDT components by default. dtc is a required build tool
Nathan Whitehorn [Wed, 22 Dec 2010 14:59:22 +0000 (14:59 +0000)]
Enable build of FDT components by default. dtc is a required build tool
for all FDT-enabled kernels, and having it off by default means that
building these kernels fails by default. This fixes FDT-related build
failures in make universe on ARM and PowerPC.

Reviewed by: imp

13 years agoAdd an option to disable the screensaver.
Rebecca Cran [Wed, 22 Dec 2010 13:06:51 +0000 (13:06 +0000)]
Add an option to disable the screensaver.

13 years agoAdd IFT_L2VLAN to the list that is capable of supplying the ingredients
John Hay [Wed, 22 Dec 2010 11:58:31 +0000 (11:58 +0000)]
Add IFT_L2VLAN to the list that is capable of supplying the ingredients
of the EUI64 part of an IPv6 address. Otherwise vlans will all use the
MAC address of the first ethernet interface of the system.

MFC after: 1 week

13 years agoAdd sleep queue code.
David Xu [Wed, 22 Dec 2010 05:03:24 +0000 (05:03 +0000)]
Add sleep queue code.

13 years agoMFp4:
David Xu [Wed, 22 Dec 2010 05:01:52 +0000 (05:01 +0000)]
MFp4:

- Add flags CVWAIT_ABSTIME and CVWAIT_CLOCKID for umtx kernel based
  condition variable, this should eliminate an extra system call to get
  current time.

- Add sub-function UMTX_OP_NWAKE_PRIVATE to wake up N channels in single
  system call. Create userland sleep queue for condition variable, in most
  cases, thread will wait in the queue, the pthread_cond_signal will defer
  thread wakeup until the mutex is unlocked, it tries to avoid an extra
  system call and a extra context switch in time window of pthread_cond_signal
  and pthread_mutex_unlock.

The changes are part of process-shared mutex project.

13 years agoImprove PCB flags handling and make it more robust. Add two new functions
Jung-uk Kim [Wed, 22 Dec 2010 00:18:42 +0000 (00:18 +0000)]
Improve PCB flags handling and make it more robust.  Add two new functions
for manipulating pcb_flags.  These inline functions are very similar to
atomic_set_char(9) and atomic_clear_char(9) but without unnecessary LOCK
prefix for SMP.  Add comments about the rationale[1].  Use these functions
wherever possible.  Although there are some places where it is not strictly
necessary (e.g., a PCB is copied to create a new PCB), it is done across
the board for sake of consistency.  Turn pcb_full_iret into a PCB flag as
it is safe now.  Move rarely used fields before pcb_flags and reduce size
of pcb_flags to one byte.  Fix some style(9) nits in pcb.h while I am in
the neighborhood.

Reviewed by: kib
Submitted by: kib[1]
MFC after: 2 months

13 years agoUse newly added NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() to keep mount point
Pawel Jakub Dawidek [Tue, 21 Dec 2010 23:15:40 +0000 (23:15 +0000)]
Use newly added NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() to keep mount point
busy. This fixes a race where we can pass invalid mount point to VFS_VGET()
via vp->v_mount when exported file system was forcibly unmounted between
nfsrv_fhtovp() and VFS_VGET().

Reviewed by: kib
MFC after: 5 days

13 years ago- Move pubflag and lockflag handling from nfsrv_fhtovp() to nfs_namei() -
Pawel Jakub Dawidek [Tue, 21 Dec 2010 23:12:45 +0000 (23:12 +0000)]
- Move pubflag and lockflag handling from nfsrv_fhtovp() to nfs_namei() -
  this is the only place that is different from all the other nfsrv_fhtovp()
  consumers.
  This simplifies nfsrv_fhtovp() a bit and also eliminates one
  vn_lock/VOP_UNLOCK() cycle in case of NFSv3.
- Implement NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() that tells it to leave
  mount point busy.

Reviewed by: kib
MFC after: 5 days

13 years agoOn error, unbusy file system and jump to the end, so we won't try to unlock
Pawel Jakub Dawidek [Tue, 21 Dec 2010 23:04:04 +0000 (23:04 +0000)]
On error, unbusy file system and jump to the end, so we won't try to unlock
NULL *vpp.

Reviewed by: kib
MFC after: 5 days

13 years agosh(1): Explain why it is a bad idea to use aliases in scripts.
Jilles Tjoelker [Tue, 21 Dec 2010 22:48:56 +0000 (22:48 +0000)]
sh(1): Explain why it is a bad idea to use aliases in scripts.

13 years agosh: Add kill builtin.
Jilles Tjoelker [Tue, 21 Dec 2010 22:47:34 +0000 (22:47 +0000)]
sh: Add kill builtin.

This allows specifying a %job (which is equivalent to the corresponding
process group).

Additionally, it improves reliability of kill from sh in high-load
situations and ensures "kill" finds the correct utility regardless of PATH,
as required by POSIX (unless the undocumented %builtin mechanism is used).

Side effect: fatal errors (any error other than kill(2) failure) now return
exit status 2 instead of 1. (This is consistent with other sh builtins, but
not in NetBSD.)

Code size increases about 1K on i386.

Obtained from: NetBSD

13 years agoExtend the hack of r182730 to trick GAS/GCC into compiling access to
Marius Strobl [Tue, 21 Dec 2010 22:03:12 +0000 (22:03 +0000)]
Extend the hack of r182730 to trick GAS/GCC into compiling access to
STICK/STICK_COMPARE independently of the selected instruction set by
TICK_COMPARE so tick.c as of r214358 once again can be compiled with
gcc -mcpu=v9 for reference purposes.

13 years agoAfter r216626 no extra { } are needed with VFS_UNLOCK_GIANT().
Pawel Jakub Dawidek [Tue, 21 Dec 2010 22:01:26 +0000 (22:01 +0000)]
After r216626 no extra { } are needed with VFS_UNLOCK_GIANT().

13 years agoClose body of the VFS_UNLOCK_GIANT() macro into do { } while (0) loop,
Pawel Jakub Dawidek [Tue, 21 Dec 2010 21:59:21 +0000 (21:59 +0000)]
Close body of the VFS_UNLOCK_GIANT() macro into do { } while (0) loop,
so it can be used in code like this:

if (cond)
VFS_UNLOCK_GIANT(vfslocked);
else
; /* Do something else. */

Before the change, compiler couldn't decide on its own if else should be
applied to the 'if (cond)' or to the if statement inside VFS_UNLOCK_GIANT()
macro.

13 years agoRevert r216080 so kmem_map is capped at 3/5 of the currently rather modest
Marius Strobl [Tue, 21 Dec 2010 21:32:17 +0000 (21:32 +0000)]
Revert r216080 so kmem_map is capped at 3/5 of the currently rather modest
kernel address space in order to leave space for the buffer cache, pipes,
thread stacks, etc on machines with more physical memory until we take
advantage of ASI_ATOMIC_QUAD_LDD_PHYS on CPUs providing it so we don't need
to lock the kernel TSB pages into the dTLB, basically making the entire
64-bit kernel address space available on relevant machines.

Submitted by: alc

13 years ago- Add a comment regarding the fact that as documented in the datasheet
Marius Strobl [Tue, 21 Dec 2010 21:12:18 +0000 (21:12 +0000)]
- Add a comment regarding the fact that as documented in the datasheet
  manual 1000BASE-T modes of DP83865 only work together with other National
  Semiconductor PHYs.
- Spell 10BASE-T correctly
- Remove some redundant braces.

13 years agosh: Add a function to print warnings (with command name and newline).
Jilles Tjoelker [Tue, 21 Dec 2010 20:47:06 +0000 (20:47 +0000)]
sh: Add a function to print warnings (with command name and newline).
This is like error() but without raising an exception.
It is particularly useful as a replacement for the warnx macro in
bltin/bltin.h.

13 years agoFix a typo in a comment.
John Baldwin [Tue, 21 Dec 2010 19:30:24 +0000 (19:30 +0000)]
Fix a typo in a comment.

MFC after: 1 week

13 years agoInitialize fp_location for explicitly managed fail points, and push
Matthew D Fleming [Tue, 21 Dec 2010 18:23:03 +0000 (18:23 +0000)]
Initialize fp_location for explicitly managed fail points, and push
the parentheses around the location for simple fail points into the
location string.  This makes the print on fail point set more
consistent between the two versions.

Also fix up fail.h a little for style(9): only use one of sys/param.h
and sys/types.h, and use the existing __XSTRING() macro instead of
rolling our own.  Also fix up a few tabs on changed and nearby lines.

Lastly, since KFAIL_POINT_{BEGIN,END} are not meant for use outside
this file, just eliminate the macros entirely.

MFC after: 1 week

13 years agoCheck number of arguments before trying to read arg0. This prevents access
Andrey V. Elsukov [Tue, 21 Dec 2010 17:24:32 +0000 (17:24 +0000)]
Check number of arguments before trying to read arg0. This prevents access
to arg0 and dumping core when `gpart bootcode` called without arguments.

13 years agoMove the fail_point_entry definition from fail.h to kern_fail.c, which
Matthew D Fleming [Tue, 21 Dec 2010 16:29:58 +0000 (16:29 +0000)]
Move the fail_point_entry definition from fail.h to kern_fail.c, which
allows putting the enumeration constants of fail point types with the
text string that matches them.

MFC after: 1 week

13 years ago- Introduce the Hhook (Helper Hook) KPI. The KPI is closely modelled on pfil(9),
Lawrence Stewart [Tue, 21 Dec 2010 13:45:29 +0000 (13:45 +0000)]
- Introduce the Hhook (Helper Hook) KPI. The KPI is closely modelled on pfil(9),
  and in many respects can be thought of as a more generic superset of pfil.
  Hhook provides a way for kernel subsystems to export hook points that Khelp
  modules can hook to provide enhanced or new functionality to the kernel. The
  KPI has been designed to ensure hook points pose no noticeable overhead when
  no hook functions are registered.

- Introduce the Khelp (Kernel Helpers) KPI. Khelp provides a framework for
  managing Khelp modules, which indirectly use the Hhook KPI to register their
  hook functions with hook points of interest within the kernel. Khelp modules
  aim to provide a structured way to dynamically extend the kernel at runtime in
  an ABI preserving manner. Depending on the subsystem providing hook points, a
  Khelp module may be able to associate per-object data for maintaining relevant
  state between hook calls.

- pjd's Object Specific Data (OSD) KPI is used to manage the per-object data
  allocated to Khelp modules. Create a new "OSD_KHELP" OSD type for use by the
  Khelp framework.

- Bump __FreeBSD_version to 900028 to mark the introduction of the new KPIs.

In collaboration with: David Hayes <dahayes at swin edu au> and
Grenville Armitage <garmitage at swin edu au>
Sponsored by: FreeBSD Foundation
Reviewed by: bz, others along the way
MFC after: 3 months

13 years agoOnly use the BIOS-supplied IRQ for the atkbdc device for a child atkbd
John Baldwin [Tue, 21 Dec 2010 12:49:37 +0000 (12:49 +0000)]
Only use the BIOS-supplied IRQ for the atkbdc device for a child atkbd
device.  Specifically, do not reuse it for a child psm device.

Tested by: many

13 years agoThe local variable "rv" is still required by vm_fault_hold_user_pages().
Alan Cox [Mon, 20 Dec 2010 23:41:31 +0000 (23:41 +0000)]
The local variable "rv" is still required by vm_fault_hold_user_pages().

13 years agosh: Make warnings in the printf builtin non-fatal, like in the program.
Jilles Tjoelker [Mon, 20 Dec 2010 23:06:57 +0000 (23:06 +0000)]
sh: Make warnings in the printf builtin non-fatal, like in the program.

The #define for warnx now behaves much like the libc function (except that
it uses sh command name and output).

Also, it now uses C99 __VA_ARGS__ so there is no need for three different
macros for 0, 1 or 2 parameters.

13 years agoUnbreak the build by temprorarily not using include directives in
Shteryana Shopova [Mon, 20 Dec 2010 22:56:50 +0000 (22:56 +0000)]
Unbreak the build by temprorarily not using include directives in
bsnmpd(1)' def files, until bsd.snmpmod.mk & Makefiles are fixed to
pass proper include path flags to gensnmptree.

13 years agoIntroduce vm_fault_hold() and use it to (1) eliminate a long-standing race
Alan Cox [Mon, 20 Dec 2010 22:49:31 +0000 (22:49 +0000)]
Introduce vm_fault_hold() and use it to (1) eliminate a long-standing race
condition in proc_rwmem() and to (2) simplify the implementation of the
cxgb driver's vm_fault_hold_user_pages().  Specifically, in proc_rwmem()
the requested read or write could fail because the targeted page could be
reclaimed between the calls to vm_fault() and vm_page_hold().

In collaboration with: kib@
MFC after: 6 weeks

13 years agorpc.lockd(8) WARNS cleanup
Ulrich Spörlein [Mon, 20 Dec 2010 21:12:18 +0000 (21:12 +0000)]
rpc.lockd(8) WARNS cleanup

- Provide function prototype for nlm_syscall
- Don't assign a variable from the stack to a global var[1]
- Remove unused vars

Found by: clang static analyser [1]
Reviewed by: dfr

13 years agolmcconfig(8): bump to WARNS=3, fix typo in usage while here
Ulrich Spörlein [Mon, 20 Dec 2010 19:08:15 +0000 (19:08 +0000)]
lmcconfig(8): bump to WARNS=3, fix typo in usage while here

Slight style(9) improvments
 - function definitions
 - sort #include

13 years agoFix type used to hold fgetc(3) output, this should help arm and powerpc
Ulrich Spörlein [Mon, 20 Dec 2010 19:08:07 +0000 (19:08 +0000)]
Fix type used to hold fgetc(3) output, this should help arm and powerpc
which have char == unsigned char

13 years agofactor(6): Check return values of BN_* functions.
Ulrich Spörlein [Mon, 20 Dec 2010 19:07:56 +0000 (19:07 +0000)]
factor(6): Check return values of BN_* functions.

Coverity Prevent: CID 4862, 8771, 8772, 8773

13 years agoRemove useless conditional.
Ulrich Spörlein [Mon, 20 Dec 2010 19:07:48 +0000 (19:07 +0000)]
Remove useless conditional.

`vga' cannot be less than 0x3f when reaching the check.

Coverity Prevent: CID 5196

13 years agoDocument limitation of station address reprogramming.
Pyun YongHyeon [Mon, 20 Dec 2010 17:39:39 +0000 (17:39 +0000)]
Document limitation of station address reprogramming.

13 years agoAdd (disabled) sample configuration lines needed to enable snmp_target(3) module
Shteryana Shopova [Mon, 20 Dec 2010 17:28:15 +0000 (17:28 +0000)]
Add (disabled) sample configuration lines needed to enable snmp_target(3) module
and configure minimal target addresses & notifications needed for bsnmpd(1)
to send SNMPv3 notifications.

Sponsored by: The FreeBSD Foundation
Reviewed by: philip
Approved by: philip

13 years agoBring in a SNMP module that allows configuration of SNMPv3 Notification targets.
Shteryana Shopova [Mon, 20 Dec 2010 17:13:14 +0000 (17:13 +0000)]
Bring in a SNMP module that allows configuration of SNMPv3 Notification targets.

Sponsored by: The FreeBSD Foundation
Reviewed by: philip
Approved by: philip

13 years agoMerge amd64 and i386 bus.h and move the resulting header to x86. Replace
Tijl Coosemans [Mon, 20 Dec 2010 16:39:43 +0000 (16:39 +0000)]
Merge amd64 and i386 bus.h and move the resulting header to x86. Replace
the original amd64 and i386 headers with stubs.

Rename (AMD64|I386)_BUS_SPACE_* to X86_BUS_SPACE_* everywhere.

Reviewed by: imp (previous version), jhb
Approved by: kib (mentor)

13 years agoSuggest to run the delete-old target after the second mergemaster. If you run
Alexander Leidinger [Mon, 20 Dec 2010 15:17:34 +0000 (15:17 +0000)]
Suggest to run the delete-old target after the second mergemaster. If you run
it before, your rc scripts may still reference old files/directories and
if you are in the unlucky situation to have triggered a reboot (intentionally
or not) between the delete-old run and the mergemaster, your system may not
start anymore.

While I'm here, give a hint about delete-old-libs.

Noticed by: bcr (luckily in a discussion and not by getting hit by this)
MFC after: 1 week

13 years agoDon't whine about child drivers calling pci_enable_busmaster(). That is
John Baldwin [Mon, 20 Dec 2010 14:54:24 +0000 (14:54 +0000)]
Don't whine about child drivers calling pci_enable_busmaster().  That is
perfectly normal.

MFC after: 1 week

13 years agoMemory can be laid out with large gaps on 64-bit PowerPC, so switch to
Nathan Whitehorn [Mon, 20 Dec 2010 14:25:01 +0000 (14:25 +0000)]
Memory can be laid out with large gaps on 64-bit PowerPC, so switch to
VM_PHYSSEG_SPARSE.

13 years agoAdd __unused. Ansi prototypes.
Philippe Charnier [Mon, 20 Dec 2010 09:36:54 +0000 (09:36 +0000)]
Add __unused. Ansi prototypes.

13 years agoAdd __unused. Ansi prototypes.
Philippe Charnier [Mon, 20 Dec 2010 09:28:28 +0000 (09:28 +0000)]
Add __unused. Ansi prototypes.

13 years agoAdd __unused. Ansi prototypes.
Philippe Charnier [Mon, 20 Dec 2010 08:54:30 +0000 (08:54 +0000)]
Add __unused. Ansi prototypes.

13 years agoAdd __unused
Philippe Charnier [Mon, 20 Dec 2010 08:47:43 +0000 (08:47 +0000)]
Add __unused

13 years agoAdd __unused
Philippe Charnier [Mon, 20 Dec 2010 08:44:08 +0000 (08:44 +0000)]
Add __unused

13 years agoAdd __unused
Philippe Charnier [Mon, 20 Dec 2010 08:37:26 +0000 (08:37 +0000)]
Add __unused

13 years agoAdd __unused. Ansi prototypes.
Philippe Charnier [Mon, 20 Dec 2010 08:29:54 +0000 (08:29 +0000)]
Add __unused. Ansi prototypes.

13 years agoOops, fwe(4) listed twice.
Pyun YongHyeon [Mon, 20 Dec 2010 00:27:40 +0000 (00:27 +0000)]
Oops, fwe(4) listed twice.

13 years agoAdd ae(4) to the list of drivers use the miibus interface.
Pyun YongHyeon [Mon, 20 Dec 2010 00:23:47 +0000 (00:23 +0000)]
Add ae(4) to the list of drivers use the miibus interface.

13 years agoigb(4), ixgbe(4), mxge(4) and nxge(4) support VLAN hardware tag
Pyun YongHyeon [Mon, 20 Dec 2010 00:10:53 +0000 (00:10 +0000)]
igb(4), ixgbe(4), mxge(4) and nxge(4) support VLAN hardware tag
insertion/stripping.
et(4) and fwe(4) support VLAN oversized frames.

13 years agoAdd .Xr to altq(4).
Pyun YongHyeon [Sun, 19 Dec 2010 23:54:31 +0000 (23:54 +0000)]
Add .Xr to altq(4).

13 years agoAdd .Xr to altq(4).
Pyun YongHyeon [Sun, 19 Dec 2010 23:53:23 +0000 (23:53 +0000)]
Add .Xr to altq(4).

13 years agoae(4), igb(4), ixgb(4) and ixgbe(4) supports altq(4).
Pyun YongHyeon [Sun, 19 Dec 2010 23:50:36 +0000 (23:50 +0000)]
ae(4), igb(4), ixgb(4) and ixgbe(4) supports altq(4).

13 years agoAdd --numeric-owner to tar extract operations in portsnap.
Simon L. B. Nielsen [Sun, 19 Dec 2010 23:09:42 +0000 (23:09 +0000)]
Add --numeric-owner to tar extract operations in portsnap.

This is done to speed up extraction significantly (both for portsnap
extract and update) in the case of slow NSS modules (like nss_ldap) as
it avoids having to look up uid and gid for root / wheel.

The reason this is a bigger problem for portsnap than for many other
system operations, is that portsnap executes tar(1) once for each port
so the internal uid/gid caching in tar(1) only helps a bit, resulting
in many user lookup calls.

Discussed with: cperciva

13 years agoRestore the ABI of struct kinfo_proc32 after r213536.
Konstantin Belousov [Sun, 19 Dec 2010 21:18:33 +0000 (21:18 +0000)]
Restore the ABI of struct kinfo_proc32 after r213536.

MFC after: 3 days

13 years agoCorrect cookie type to match reality.
Pawel Jakub Dawidek [Sun, 19 Dec 2010 18:07:10 +0000 (18:07 +0000)]
Correct cookie type to match reality.

13 years agoReduce lock scope a little.
Pawel Jakub Dawidek [Sun, 19 Dec 2010 18:06:20 +0000 (18:06 +0000)]
Reduce lock scope a little.

13 years agoAdd __unused. Ansi prototypes.
Philippe Charnier [Sun, 19 Dec 2010 16:25:23 +0000 (16:25 +0000)]
Add __unused. Ansi prototypes.

13 years agoGarbage-collect unused variable.
Nathan Whitehorn [Sun, 19 Dec 2010 16:07:53 +0000 (16:07 +0000)]
Garbage-collect unused variable.

13 years agoAdd __unused. Ansi prototypes.
Philippe Charnier [Sun, 19 Dec 2010 14:18:07 +0000 (14:18 +0000)]
Add __unused. Ansi prototypes.

13 years agoAdd __unused. Ansi prototypes.
Philippe Charnier [Sun, 19 Dec 2010 13:40:38 +0000 (13:40 +0000)]
Add __unused. Ansi prototypes.

13 years agoadd __unused
Philippe Charnier [Sun, 19 Dec 2010 13:05:17 +0000 (13:05 +0000)]
add __unused

13 years agoUpdate firmware for wpi(4) from version 2.14.4 to 15.32.2.9.
Bernhard Schmidt [Sun, 19 Dec 2010 11:37:44 +0000 (11:37 +0000)]
Update firmware for wpi(4) from version 2.14.4 to 15.32.2.9.

PR: kern/142907
Submitted by: Craig Butler <craig001 at lerwick.hopto.org>
MFC after: 2 weeks

13 years agoFix a bug introduced in r216518. The ndis_subsys field holds the PCI
Tijl Coosemans [Sun, 19 Dec 2010 11:14:34 +0000 (11:14 +0000)]
Fix a bug introduced in r216518. The ndis_subsys field holds the PCI
subdevice ID in addition to the subvendor ID.

Reported by: Paul B Mahol 'onemda gmail com'
Approved by: kib (mentor)

13 years agoFix panic trying to use monitor mode. The iwn_cmd() calls issued by
Bernhard Schmidt [Sun, 19 Dec 2010 10:36:06 +0000 (10:36 +0000)]
Fix panic trying to use monitor mode. The iwn_cmd() calls issued by
iwn_config() want to msleep() on the mutex.

PR: kern/138427
Submitted by: Henry Hu <henry.hu.sh at gmail.com>
MFC after: 3 days

13 years agoFix build on bigendian archs.
Bernhard Schmidt [Sun, 19 Dec 2010 09:18:14 +0000 (09:18 +0000)]
Fix build on bigendian archs.

13 years agoRedo some parts of r216333, specifically, the locking changes to
Alan Cox [Sun, 19 Dec 2010 07:31:56 +0000 (07:31 +0000)]
Redo some parts of r216333, specifically, the locking changes to
pmap_extract_and_hold(), and undo the rest.  In particular, I forgot
that PG_PS and PG_PTE_PAT are the same bit.

13 years agoDocument JMC251/JMC261 support.
Pyun YongHyeon [Sun, 19 Dec 2010 00:00:29 +0000 (00:00 +0000)]
Document JMC251/JMC261 support.

13 years agoAdd support for JMicron JMC251/JMC261 Gigabit/Fast ethernet
Pyun YongHyeon [Sat, 18 Dec 2010 23:52:50 +0000 (23:52 +0000)]
Add support for JMicron JMC251/JMC261  Gigabit/Fast ethernet
controller with Card Read Host Controller. These controllers are
multi-function devices and have the same ethernet core of
JMC250/JMC260. Starting from REVFM 5(chip full mask revision)
controllers have the following features.
 o eFuse support
 o PCD(Packet Completion Deferring)
 o More advanced PHY power saving

Because these controllers started to use eFuse, station address
modified by driver is permanent as if it was written to EEPROM. If
you have to change station address please save your controller
default address to safe place before reprogramming it. There is no
way to restore factory default station address.

Many thanks to JMicron for continuing to support FreeBSD.

HW donated by: JMicron