]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoCorrect cpu_monitor() and cpu_mwait() for amd64. These instructions take
Jung-uk Kim [Tue, 5 Jul 2011 18:42:10 +0000 (18:42 +0000)]
Correct cpu_monitor() and cpu_mwait() for amd64.  These instructions take
%rcx as "extensions" in long mode.  If any unused bit is set in %rcx, these
instructions cause general protection fault.  Fix style nits and synchronize
i386 with amd64.

13 years agoCall pmap_qremove() before freeing or unwiring the pages, otherwise
Marius Strobl [Tue, 5 Jul 2011 18:40:37 +0000 (18:40 +0000)]
Call pmap_qremove() before freeing or unwiring the pages, otherwise
there's a window during which a page can be re-used before its previous
mapping is removed.

Reviewed by: alc
MFC after: 1 week

13 years agoDelete files made obsolete by the change in default NFS client
Rick Macklem [Tue, 5 Jul 2011 18:40:19 +0000 (18:40 +0000)]
Delete files made obsolete by the change in default NFS client
and the move of nfs_kdtrace.h to sys/nfs.

13 years agoFollow Linux by unconditionally stripping the RX vlan tag from incoming
Nathan Whitehorn [Tue, 5 Jul 2011 15:00:55 +0000 (15:00 +0000)]
Follow Linux by unconditionally stripping the RX vlan tag from incoming
packets. It turns out that all firmware versions insert it, whether or not
they support VLAN tagging.

Submitted by: glevand <geoffrey.levand at mail dot ru>

13 years agoUpdate manual page. Mention IPv6 support, and notice that main
Gleb Smirnoff [Tue, 5 Jul 2011 14:55:17 +0000 (14:55 +0000)]
Update manual page. Mention IPv6 support, and notice that main
argument isn't actually a node, but a netgraph path.

13 years agoRewrite the flowctl utility to add it support for displaying
Gleb Smirnoff [Tue, 5 Jul 2011 14:50:06 +0000 (14:50 +0000)]
Rewrite the flowctl utility to add it support for displaying
both IPv4 and IPv4 flows.

13 years agoo Eliminate flow6_hash_entry in favor of flow_hash_entry. We don't need
Gleb Smirnoff [Tue, 5 Jul 2011 14:48:39 +0000 (14:48 +0000)]
o Eliminate flow6_hash_entry in favor of flow_hash_entry. We don't need
  a separate struct to start a slist of semi-opaque structs. This
  makes some code more compact.
o Rewrite ng_netflow_flow_show() and its API/ABI:
  - Support for IPv6 is added.
  - Request and response now use same struct. Structure specifies
    version (6 or 4), index of last retrieved hash, and also index
    of last retrieved entry in the hash entry.

13 years agoOnly print entries for which ut_host points to a character device.
Ed Schouten [Tue, 5 Jul 2011 14:12:48 +0000 (14:12 +0000)]
Only print entries for which ut_host points to a character device.

Now that we use utmpx, we more often have entries for which the ut_line
is left blank. To prevent us from returning struct stat for "/dev/",
check that the resulting stat structure belongs to a character device.

13 years agoRework _fget to accept capability parameters.
Jonathan Anderson [Tue, 5 Jul 2011 13:45:10 +0000 (13:45 +0000)]
Rework _fget to accept capability parameters.

This new version of _fget() requires new parameters:
- cap_rights_t needrights
    the rights that we expect the capability's rights mask to include
    (e.g. CAP_READ if we are going to read from the file)

- cap_rights_t *haverights
    used to return the capability's rights mask (ignored if NULL)

- u_char *maxprotp
    the maximum mmap() rights (e.g. VM_PROT_READ) that can be permitted
    (only used if we are going to mmap the file; ignored if NULL)

- int fget_flags
    FGET_GETCAP if we want to return the capability itself, rather than
    the underlying object which it wraps

Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc

13 years agoRemove useless initialization.
Mikolaj Golub [Tue, 5 Jul 2011 06:12:28 +0000 (06:12 +0000)]
Remove useless initialization.

Approved by: pjd (mentor)
MFC after: 3 days

13 years agoThe algorithm used by nfscl_getopen() could have resulted in
Rick Macklem [Mon, 4 Jul 2011 23:32:09 +0000 (23:32 +0000)]
The algorithm used by nfscl_getopen() could have resulted in
multiple instances of the same lock_owner when a process both
inherited an open file descriptor plus opened the same file itself.
Since some NFSv4 servers cannot handle multiple instances of
the same lock_owner string, this patch changes the algorithm
used by nfscl_getopen() in the new NFSv4 client to keep that
from happening. The new algorithm is simpler, since there is
no longer any need to ascend the process's parentage tree because
all NFSv4 Closes for a file are done at VOP_INACTIVE()/VOP_RECLAIM(),
making the Opens indistinct w.r.t. use with Lock Ops.
This problem was discovered at the recent NFSv4 interoperability
Bakeathon.

MFC after: 2 weeks

13 years ago- General grammar and mdoc(7) fixes. [1] [2]
Glen Barber [Mon, 4 Jul 2011 23:00:26 +0000 (23:00 +0000)]
- General grammar and mdoc(7) fixes. [1] [2]
- While here, remove a paragraph about userspace operation that
  has been outdated for some time. [2]

PR: 158623
Submitted by: Ben Kudak (kaduk % mit!edu) [1]
Reviewed by: glebius [2]
MFC after: 1 week

13 years ago - Speed up pendingblock processing again. Having too much delay between
Jeff Roberson [Mon, 4 Jul 2011 22:08:04 +0000 (22:08 +0000)]
 - Speed up pendingblock processing again.  Having too much delay between
   ffs_blkfree() and the pending adjustment causes all kinds of
   space related problems.

13 years ago - Handle D_JSEGDEP in the softdep_sync_buf() switch. These can now
Jeff Roberson [Mon, 4 Jul 2011 21:04:25 +0000 (21:04 +0000)]
 - Handle D_JSEGDEP in the softdep_sync_buf() switch.  These can now
   find themselves on snapshot vnodes.

Reported by: pho

13 years ago - It is impossible to run request_cleanup() while doing a copyonwrite.
Jeff Roberson [Mon, 4 Jul 2011 20:53:55 +0000 (20:53 +0000)]
 - It is impossible to run request_cleanup() while doing a copyonwrite.
   This will most likely cause new block allocations which can recurse
   into request cleanup.
 - While here optimize the ufs locking slightly.  We need only acquire and
   drop once.
 - process_removes() and process_truncates() also is only needed once.
 - Attempt to flush each item on the worklist once but do not loop forever
   if some can not be completed.

Discussed with: mckusick

13 years ago - Fix an inode quota leak. We need to decrement the quota once and only
Jeff Roberson [Mon, 4 Jul 2011 20:52:23 +0000 (20:52 +0000)]
 - Fix an inode quota leak.  We need to decrement the quota once and only
   once.

Tested by: pho
Reviewed by: mckusick

13 years agoFix build with NETGRAPH_DEBUG.
Gleb Smirnoff [Mon, 4 Jul 2011 20:50:09 +0000 (20:50 +0000)]
Fix build with NETGRAPH_DEBUG.

13 years agopf(4) tags now store the state key but tcp_respond tries to reuse a mbuf as an optimi...
Ermal Luçi [Mon, 4 Jul 2011 17:43:04 +0000 (17:43 +0000)]
pf(4) tags now store the state key but tcp_respond tries to reuse a mbuf as an optimization.
This makes pf find the wrong state and cause errors reported with state mismatches.
Clear the cached state link on the pf(4) tag to avoid the state mismatches.

Approved by: bz

13 years agoAdd a trivial script for creating memstick images. These are not
Marcel Moolenaar [Mon, 4 Jul 2011 17:03:19 +0000 (17:03 +0000)]
Add a trivial script for creating memstick images. These are not
bootable yet, but proven to be useful without it already.

13 years agoDisable PREEMPTION for now. See also PR ia64/147501.
Marcel Moolenaar [Mon, 4 Jul 2011 16:59:26 +0000 (16:59 +0000)]
Disable PREEMPTION for now. See also PR ia64/147501.

13 years agoAdd kernel functions to unwrap capabilities.
Jonathan Anderson [Mon, 4 Jul 2011 14:40:32 +0000 (14:40 +0000)]
Add kernel functions to unwrap capabilities.

cap_funwrap() and cap_funwrap_mmap() unwrap capabilities, exposing the
underlying object. Attempting to unwrap a capability with an inadequate
rights mask (e.g. calling cap_funwrap(fp, CAP_WRITE | CAP_MMAP, &result)
on a capability whose rights mask is CAP_READ | CAP_MMAP) will result in
ENOTCAPABLE.

Unwrapping a non-capability is effectively a no-op.

These functions will be used by Capsicum-aware versions of _fget(), etc.

Approved by: mentor (rwatson), re (Capsicum blanket)
Sponsored by: Google Inc

13 years agoFix build with NETGRAPH_DEBUG.
Gleb Smirnoff [Mon, 4 Jul 2011 13:55:55 +0000 (13:55 +0000)]
Fix build with NETGRAPH_DEBUG.

13 years ago- Remove the now unused CPU_NAND_ATOMIC()
Attilio Rao [Mon, 4 Jul 2011 12:18:12 +0000 (12:18 +0000)]
- Remove the now unused CPU_NAND_ATOMIC()
- Add a comment explaining that CPU_OR_ATOMIC() and
  CPU_COPY_STORE_REL() are special wrappers used to cater particular
  cases.

13 years agoWith retirement of cpumask_t and usage of cpuset_t for representing a
Attilio Rao [Mon, 4 Jul 2011 12:04:52 +0000 (12:04 +0000)]
With retirement of cpumask_t and usage of cpuset_t for representing a
mask of CPUs, pc_other_cpus and pc_cpumask become highly inefficient.

Remove them and replace their usage with custom pc_cpuid magic (as,
atm, pc_cpumask can be easilly represented by (1 << pc_cpuid) and
pc_other_cpus by (all_cpus & ~(1 << pc_cpuid))).

This change is not targeted for MFC because of struct pcpu members
removal and dependency by cpumask_t retirement.

MD review by: marcel, marius, alc
Tested by: pluknet
MD testing by: marcel, marius, gonzo, andreast

13 years agoMFC
Attilio Rao [Mon, 4 Jul 2011 11:13:00 +0000 (11:13 +0000)]
MFC

13 years agoCompletely remove now unused pc_other_cpus, pc_cpumask.
Attilio Rao [Mon, 4 Jul 2011 10:45:54 +0000 (10:45 +0000)]
Completely remove now unused pc_other_cpus, pc_cpumask.

Tested by: pluknet

13 years agoMake the USB keyboard driver more HID compliant.
Hans Petter Selasky [Mon, 4 Jul 2011 07:37:28 +0000 (07:37 +0000)]
Make the USB keyboard driver more HID compliant.
Try to auto-detect keyboards which should use the BOOT protocol.

MFC after: 2 weeks

13 years ago- Use refcount(9) API to manage node and hook refcounting.
Gleb Smirnoff [Mon, 4 Jul 2011 07:03:44 +0000 (07:03 +0000)]
- Use refcount(9) API to manage node and hook refcounting.
- Make ng_unref_node() void, since caller shouldn't be
  interested in whether node is valid after call or not,
  since it can't be guaranteed to be valid. [1]

Ok from: julian [1]

13 years agoARP code reuses mbuf from ARP request to make a reply, but it does not
Andrey V. Elsukov [Mon, 4 Jul 2011 05:47:48 +0000 (05:47 +0000)]
ARP code reuses mbuf from ARP request to make a reply, but it does not
reset rcvif to NULL. Since rcvif is not NULL, ipfw(4) supposes that ARP
replies were received on specified interface.
Reset rcvif to NULL for ARP replies to fix this issue.

PR: kern/131817
Reviewed by: glebius
MFC after: 1 month

13 years agoAdd sanity check for ifm_version in struct if_msghdr.
Hiroki Sato [Mon, 4 Jul 2011 03:19:06 +0000 (03:19 +0000)]
Add sanity check for ifm_version in struct if_msghdr.

13 years agoModify the new NFSv4 client so that it appends a file handle
Rick Macklem [Sun, 3 Jul 2011 21:44:26 +0000 (21:44 +0000)]
Modify the new NFSv4 client so that it appends a file handle
to the lock_owner4 string that goes on the wire. Also, add
code to do a ReleaseLockOwner Op on the lock_owner4 string
before a Close. Apparently not all NFSv4 servers handle multiple
instances of the same lock_owner4 string, at least not in a
compatible way. This patch avoids having multiple instances,
except for one unusual case, which will be fixed by a future commit.
Found at the recent NFSv4 interoperability Bakeathon.

Tested by: tdh at excfb.com
MFC after: 2 weeks

13 years agoImprove portability of config(8).
Ed Schouten [Sun, 3 Jul 2011 20:59:57 +0000 (20:59 +0000)]
Improve portability of config(8).

- Use strlen(dp->d_name) instead of the unportable dp->d_namlen. Rename
  i to len to make it slightly more descriptive and prevent negative
  indexing of the array.
- Replace index() by strchr().

This supposedly fixes compilation on GNU systems.

Submitted by: Robert Millan <rmh debian org> (original patch)
MFC after: 3 weeks

13 years agoTag mbufs of all incoming frames or packets with the interface's FIB
Bjoern A. Zeeb [Sun, 3 Jul 2011 16:08:38 +0000 (16:08 +0000)]
Tag mbufs of all incoming frames or packets with the interface's FIB
setting (either default or if supported as set by SIOCSIFFIB, e.g.
from ifconfig).

Submitted by: Alexander V. Chernikov (melifaro ipfw.ru)
Reviewed by: julian
MFC after: 2 weeks

13 years agoRemove extra white space to comply with style for the rest of the struct.
Bjoern A. Zeeb [Sun, 3 Jul 2011 15:34:09 +0000 (15:34 +0000)]
Remove extra white space to comply with style for the rest of the struct.

MFC after: 2 weeks

13 years agoIntroduce a quirk for broken USB MIDI hardware instead of limiting performance
Hans Petter Selasky [Sun, 3 Jul 2011 13:27:23 +0000 (13:27 +0000)]
Introduce a quirk for broken USB MIDI hardware instead of limiting performance
in general.

MFC after: 1 week

13 years agoAdd infrastructure to allow all frames/packets received on an interface
Bjoern A. Zeeb [Sun, 3 Jul 2011 12:22:02 +0000 (12:22 +0000)]
Add infrastructure to allow all frames/packets received on an interface
to be assigned to a non-default FIB instance.

You may need to recompile world or ports due to the change of struct ifnet.

Submitted by: cjsp
Submitted by: Alexander V. Chernikov (melifaro ipfw.ru)
(original versions)
Reviewed by: julian
Reviewed by: Alexander V. Chernikov (melifaro ipfw.ru)
MFC after: 2 weeks
X-MFC: use spare in struct ifnet

13 years agoWhen iterating over a paging queue, explicitly check for PG_MARKER, instead
Alan Cox [Sat, 2 Jul 2011 23:42:04 +0000 (23:42 +0000)]
When iterating over a paging queue, explicitly check for PG_MARKER, instead
of relying on zeroed memory being interpreted as an empty PV list.

Reviewed by: kib

13 years agoInitialize marker pages as held rather than fictitious/wired. Marking the
Alan Cox [Sat, 2 Jul 2011 23:34:47 +0000 (23:34 +0000)]
Initialize marker pages as held rather than fictitious/wired.  Marking the
page as held is more useful as a safety precaution in case someone forgets
to check for PG_MARKER.

Reviewed by: kib

13 years agoFix for "nomatch" event for ums and ukbd drivers when uhid is loaded.
Hans Petter Selasky [Sat, 2 Jul 2011 20:58:33 +0000 (20:58 +0000)]
Fix for "nomatch" event for ums and ukbd drivers when uhid is loaded.

MFC after: 3 days

13 years agoFix problem about USB MIDI TX data format, that some devices only accept
Hans Petter Selasky [Sat, 2 Jul 2011 20:26:37 +0000 (20:26 +0000)]
Fix problem about USB MIDI TX data format, that some devices only accept
a maximum of 4 bytes (one command) per short terminated USB transfer.
Optimise the TX case by sending multiple USB frames.

MFC after: 1 week

13 years agoDefine the CAPABILITIES kernel option.
Jonathan Anderson [Sat, 2 Jul 2011 15:41:22 +0000 (15:41 +0000)]
Define the CAPABILITIES kernel option.

This option will enable Capsicum capabilities, which provide a fine-grained
mask on operations that can be performed on file descriptors.

Approved by: mentor (rwatson), re (Capsicum blanket ok)
Sponsored by: Google Inc

13 years agoReintroduce the cioctl() hook in the TTY layer for digi(4).
Ed Schouten [Sat, 2 Jul 2011 13:54:20 +0000 (13:54 +0000)]
Reintroduce the cioctl() hook in the TTY layer for digi(4).

The cioctl() hook can be used by drivers to add ioctls to the *.init and
*.lock devices. This commit breaks the ttydevsw ABI, since this
structure didn't provide any padding. To prevent ABI breakage in the
future, add a tsw_spare.

Submitted by: Peter Jeremy <peter jeremy alcatel lucent com>
Obtained from: kern/152254 (slightly modified)

13 years agoUltraSPARC-IV CPUs seem to be affected by a not publicly documented
Marius Strobl [Sat, 2 Jul 2011 12:56:03 +0000 (12:56 +0000)]
UltraSPARC-IV CPUs seem to be affected by a not publicly documented
erratum causing them to trigger stray vector interrupts accompanied by a
state in which they even fault on locked TLB entries. Just retrying the
instruction in that case gets the CPU back on track though. OpenSolaris
also just ignores a certain number of stray vector interrupts.
While at it, implement the stray vector interrupt handling for SPARC64-VI
which use these for indicating uncorrectable errors in interrupt packets.

13 years agoDon't waste a delay slot.
Marius Strobl [Sat, 2 Jul 2011 11:46:23 +0000 (11:46 +0000)]
Don't waste a delay slot.

13 years ago- For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from
Marius Strobl [Sat, 2 Jul 2011 11:14:54 +0000 (11:14 +0000)]
- For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from
  the TLBs in order to get rid of the user mappings but instead traverse
  them an flush only the latter like we also do for the Spitfire-class.
  Also flushing the unlocked kernel entries can cause instant faults which
  when called from within cpu_switch() are handled with the scheduler lock
  held which in turn can cause timeouts on the acquisition of the lock by
  other CPUs. This was easily seen with a 16-core V890 but occasionally
  also happened with 2-way machines.
  While at it, move the SPARC64-V support code entirely to zeus.c. This
  causes a little bit of duplication but is less confusing than partially
  using Cheetah-class bits for these.
- For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024-
  entry, 2-way set associative TLB.
- In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure
  that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back.

Tested by:      Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V)

13 years agoUsing .comm to declare intrnames and eintrnames causes binutils 2.17.50 to
Marius Strobl [Sat, 2 Jul 2011 10:17:26 +0000 (10:17 +0000)]
Using .comm to declare intrnames and eintrnames causes binutils 2.17.50 to
merge the two.

13 years ago- Fix typo in check_for_nested_with_variably_modified present
Ulrich Spörlein [Fri, 1 Jul 2011 20:45:55 +0000 (20:45 +0000)]
- Fix typo in check_for_nested_with_variably_modified present
- Implement -Wvariable-decl.
- Port -Wtrampolines support from gcc3.
(all three also via OpenBSD)

PR: gnu/127136, gnu/157019
Submitted by: Henning Petersen, Pedro Giffuni
MFC after: 6 weeks

13 years agoFix a typo.
Sergey Matveychuk [Fri, 1 Jul 2011 19:22:27 +0000 (19:22 +0000)]
Fix a typo.

Approved by: kib

13 years agoFix r223695 to compile on architectures which don't use the MBR scheme; wrap
Marius Strobl [Fri, 1 Jul 2011 18:31:59 +0000 (18:31 +0000)]
Fix r223695 to compile on architectures which don't use the MBR scheme; wrap
the MBR support in the common part of the loader in #ifdef's and enable it
only for userboot for now.

13 years agoDefine cap_rights_t and DTYPE_CAPABILITY, which are required to
Jonathan Anderson [Fri, 1 Jul 2011 12:13:48 +0000 (12:13 +0000)]
Define cap_rights_t and DTYPE_CAPABILITY, which are required to
implement Capsicum capabilities.

Approved by: mentor (rwatson), re (bz)

13 years agoBump date after the previous commit.
Sergey Kandaurov [Fri, 1 Jul 2011 10:57:10 +0000 (10:57 +0000)]
Bump date after the previous commit.

13 years agoUpdate and sort the list of the available keywords.
Sergey Kandaurov [Fri, 1 Jul 2011 10:54:47 +0000 (10:54 +0000)]
Update and sort the list of the available keywords.

13 years agoFix double free.
Gleb Smirnoff [Fri, 1 Jul 2011 08:27:03 +0000 (08:27 +0000)]
Fix double free.

Submitted by: Alexander V. Chernikov <melifaro ipfw.ru>

13 years agoMake lukemftpd properly set login class and cpumask.
Edward Tomasz Napierala [Thu, 30 Jun 2011 20:58:38 +0000 (20:58 +0000)]
Make lukemftpd properly set login class and cpumask.

13 years agoMake Sendmail properly set login class and cpumask.
Edward Tomasz Napierala [Thu, 30 Jun 2011 20:55:16 +0000 (20:55 +0000)]
Make Sendmail properly set login class and cpumask.

13 years agoChange the management of nested faults by switching to physical
Marcel Moolenaar [Thu, 30 Jun 2011 20:34:55 +0000 (20:34 +0000)]
Change the management of nested faults by switching to physical
addressing while reading or writing the trap frame. It's not
possible to guarantee that the one translation cache entry that
we depend on is not going to get purged by the CPU. We already
know that global shootdowns (ptc.g and/or ptc.ga) can (and will)
cause multiple TC entries to get purged and we initialize tried
to handle that by serializing kernel entry with these operations.
However, we need to serialize kernel exit as well.

But even if we can serialize, it appears that CPU threads within
a core can affect each other's TC entries beyond the global
shootdown. This would mean serializing any and all translatation
cache updates with the threads in a core with the kernel entry
and exit of any thread in that core. This is just too painful
and complicated.

Since we already properly coded for the 2 nested faults that we
can get, all we need to do is use those to obtain the physical
address of the trap frame, switch to physical mode and in that
way eliminate any further faults. The trap frame is already
aligned to 1KB boundaries to make sure we don't cross the page
boundary, this is safe to do.

We still need to serialize ptc.g or ptc.ga across CPUs because
the platform can only have 1 such operation outstanding at the
same time. We can now use a regular (spin) lock for this.

Also, it has been observed that we can get a nested TLB faults
for region 7 virtual addresses. This was unexpected. For now,
we enhance the nested TLB fault handler to deal with those as
well, but it needs to be understood.

13 years agoAdd ID for Marvell 88SE9125 SATA controller.
Alexander Motin [Thu, 30 Jun 2011 19:23:17 +0000 (19:23 +0000)]
Add ID for Marvell 88SE9125 SATA controller.

PR: kern/157843
MFC after: 1 week

13 years agoAdd the missing sca_keylength field to the sctp_authkey structure,
Michael Tuexen [Thu, 30 Jun 2011 16:56:55 +0000 (16:56 +0000)]
Add the missing sca_keylength field to the sctp_authkey structure,
which is used the the SCTP_AUTH_KEY socket option.

MFC after: 1 month.

13 years agoAdd a version of the FreeBSD bootloader which can run in userland, packaged
Doug Rabson [Thu, 30 Jun 2011 16:08:56 +0000 (16:08 +0000)]
Add a version of the FreeBSD bootloader which can run in userland, packaged
as a shared library. This is intended to be used by BHyVe to load FreeBSD
kernels into new virtual machines.

13 years agoWhen Capsicum starts creating capabilities to wrap existing file
Jonathan Anderson [Thu, 30 Jun 2011 15:22:49 +0000 (15:22 +0000)]
When Capsicum starts creating capabilities to wrap existing file
descriptors, we will want to allocate a new descriptor without installing
it in the FD array.

Split falloc() into falloc_noinstall() and finstall(), and rewrite
falloc() to call them with appropriate atomicity.

Approved by: mentor (rwatson), re (bz)

13 years agoAdd some checks to ensure that Capsicum is behaving correctly, and add some
Jonathan Anderson [Thu, 30 Jun 2011 10:56:02 +0000 (10:56 +0000)]
Add some checks to ensure that Capsicum is behaving correctly, and add some
more explicit comments about what's going on and what future maintainers
need to do when e.g. adding a new operation to a sys_machdep.c.

Approved by: mentor(rwatson), re(bz)

13 years agoMFC
Attilio Rao [Thu, 30 Jun 2011 10:19:43 +0000 (10:19 +0000)]
MFC

13 years agoFix quota(1) output.
Sergey Kandaurov [Thu, 30 Jun 2011 09:20:26 +0000 (09:20 +0000)]
Fix quota(1) output.

- Fix calculation of 1024-byte sized blocks from disk blocks shown when -h
option isn't specified. It was broken with quota64 integration.
- In prthumanval(): limit the size of a buffer passed to humanize_number()
to a width of 5 bytes but allow a shorter length if requested. That's what
users expect.

PR: bin/150151
Reviewed by: Kirk McKusick

13 years ago - Handle the JOP_SYNC case as appropriate.
Jeff Roberson [Thu, 30 Jun 2011 05:28:10 +0000 (05:28 +0000)]
 - Handle the JOP_SYNC case as appropriate.

Reported by: pho

13 years agoAdd detection for the Marvel 88E1149R and treat it just like the
Warner Losh [Thu, 30 Jun 2011 05:20:02 +0000 (05:20 +0000)]
Add detection for the Marvel 88E1149R and treat it just like the
88E1149.

13 years agoHandle the FREEDEP case in softdep_sync_buf().
Kirk McKusick [Wed, 29 Jun 2011 22:12:43 +0000 (22:12 +0000)]
Handle the FREEDEP case in softdep_sync_buf().
This fix failed to get added in -r223325.

Submitted by: Peter Holm

13 years agoDocument two known hardware errata which requires manual link
Pyun YongHyeon [Wed, 29 Jun 2011 17:32:52 +0000 (17:32 +0000)]
Document two known hardware errata which requires manual link
configuration.

Submitted by: Aries Lee (arieslee <> jmicron com)

13 years agoAdd a new option, OBJPR_NOTMAPPED, to vm_object_page_remove(). Passing this
Alan Cox [Wed, 29 Jun 2011 16:40:41 +0000 (16:40 +0000)]
Add a new option, OBJPR_NOTMAPPED, to vm_object_page_remove().  Passing this
option to vm_object_page_remove() asserts that the specified range of pages
is not mapped, or more precisely that none of these pages have any managed
mappings.  Thus, vm_object_page_remove() need not call pmap_remove_all() on
the pages.

This change not only saves time by eliminating pointless calls to
pmap_remove_all(), but it also eliminates an inconsistency in the use of
pmap_remove_all() versus related functions, like pmap_remove_write().  It
eliminates harmless but pointless calls to pmap_remove_all() that were being
performed on PG_UNMANAGED pages.

Update all of the existing assertions on pmap_remove_all() to reflect this
change.

Reviewed by: kib

13 years ago- Add read-only sysctls for all of the tunables supported by the igb and
John Baldwin [Wed, 29 Jun 2011 16:20:52 +0000 (16:20 +0000)]
- Add read-only sysctls for all of the tunables supported by the igb and
  em drivers.
- Make the per-instance 'enable_aim' sysctl truly per-instance by having it
  change a per-instance variable (which is used to control AIM) rather
  than having all of the per-instance sysctls operate on a single global
  variable.

Reviewed by: jfv (earlier version)
MFC after: 1 week

13 years agoSet proper root device name when legacy NFS client is compiled into kernel.
Grzegorz Bernacki [Wed, 29 Jun 2011 15:17:29 +0000 (15:17 +0000)]
Set proper root device name when legacy NFS client is compiled into kernel.

Approved by:     cognet (mentor)

13 years agoAdd support for a MosChip PCI express serial port adapter.
Hans Petter Selasky [Wed, 29 Jun 2011 14:47:20 +0000 (14:47 +0000)]
Add support for a MosChip PCI express serial port adapter.

MFC after: 1 week

13 years agoFix a corner case in STA beacon processing when a CSA is received but
Adrian Chadd [Wed, 29 Jun 2011 13:21:52 +0000 (13:21 +0000)]
Fix a corner case in STA beacon processing when a CSA is received but
the AP doesn't transmit beacons.

If the AP requests a CSA (ie, a channel switch) and then enters CAC
(channel availability check) for 60 seconds, it doesn't send beacons
and it just listens for radar events (and other things which we don't
do yet.)

Now, ath_newstate() was not resetting the beacon timer config on
a transition to the RUN state when in STA mode - it was setting
sc_syncbeacon, which simply updates the beacon config from the
contents of the next received beacon.

This means the STA never generates beacon miss events.

If the AP goes into CAC for 60 seconds and recovers, the STA will
happily receive the first beacon and reconfigure timers.
But if it gets a radar event after that, it'll change channel
again, not notify the station that it's changed channel..
and since the station is happily waiting for the first beacon
to configure the beacon timer details from, it won't ever
generate a beacon miss interrupt and it'll sit there forever
(or until the AP appears on that channel once again.)

This change forces the last known beacon timer config to be
written to hardware on a transition from CSA->RUN in STA mode.
This forces bmiss events to occur and the STA will eventually
(after a handful of beacon miss events) begin scanning for
another access point.

13 years agoClarify that we broke pfsync(4) backward compat with the pf commit r223637.
Bjoern A. Zeeb [Wed, 29 Jun 2011 13:12:15 +0000 (13:12 +0000)]
Clarify that we broke pfsync(4) backward compat with the pf commit r223637.

Suggested by: Anton Yuzhaninov (citrin citrin.ru)

13 years agoWe may split today's CAPABILITIES into CAPABILITY_MODE (which has
Jonathan Anderson [Wed, 29 Jun 2011 13:03:05 +0000 (13:03 +0000)]
We may split today's CAPABILITIES into CAPABILITY_MODE (which has
to do with global namespaces) and CAPABILITIES (which has to do with
constraining file descriptors). Just in case, and because it's a better
name anyway, let's move CAPABILITIES out of the way.

Also, change opt_capabilities.h to opt_capsicum.h; for now, this will
only hold CAPABILITY_MODE, but it will probably also hold the new
CAPABILITIES (implying constrained file descriptors) in the future.

Approved by: rwatson
Sponsored by: Google UK Ltd

13 years agoIn case ntp cannot resolve a hostname on startup it will queue the entry
Bjoern A. Zeeb [Wed, 29 Jun 2011 13:01:10 +0000 (13:01 +0000)]
In case ntp cannot resolve a hostname on startup it will queue the entry
for resolving by a child process that, upon success, will add the entry
to the config of the running running parent process.

Unfortunately there are a couple of bugs with this, fixed in various
later versions of upstream in potentially different ways due to other
code changes:

1) Upon server [-46] <FQDN> the [-46] are used as FQDN for later resolving
   which does not work.  Make sure we always pass the name (or IP there).

2) The intermediate file to carry the information to the child process
   does not know about -4/-6 restrictions, so that a dual-stacked host
   could resolve to an IPv6 address but that might be unreachable (see
   r223626) leading to no working synchronization ignoring a IPv4 record.
   Thus alter the intermediate format to also pass the address family
   (AF_UNSPEC (default), AF_INET or AF_INET6) to the child process
   depending on -4 or -6.

3) Make the child process to parse the new intermediate file format and
   save the address family for getaddrinfo() hints flags.

4) Change child to always reload resolv.conf calling res_init() before
   trying to resolve names.  This will pick up resolv.conf changes or
   new resolv.confs should they have not existed or been empty or
   unusable on ntp startup.  This fix is more conditional in upstream
   versions but given FreeBSD has res_init there is no need for the
   configure logic as well.

Approved by: roberto
Sponsored by: Sandvine Incorporated
MFC after: 9 days

13 years agoAdd new rule actions "call" and "return" to ipfw. They make
Andrey V. Elsukov [Wed, 29 Jun 2011 10:06:58 +0000 (10:06 +0000)]
Add new rule actions "call" and "return" to ipfw. They make
possible to organize subroutines with rules.

The "call" action saves the current rule number in the internal
stack and rules processing continues from the first rule with
specified number (similar to skipto action). If later a rule with
"return" action is encountered, the processing returns to the first
rule with number of "call" rule saved in the stack plus one or higher.

Submitted by: Vadim Goncharov
Discussed by: ipfw@, luigi@

13 years agoTypo
Kevin Lo [Wed, 29 Jun 2011 09:35:40 +0000 (09:35 +0000)]
Typo

Submitted by: Damjan Marion <damjan dot marion at gmail dot com>
MFC after: 3 days

13 years agoMFC
Attilio Rao [Wed, 29 Jun 2011 08:50:57 +0000 (08:50 +0000)]
MFC

13 years agoadd SNDCTL_DSP_HALT specified by OSS
Andriy Gapon [Wed, 29 Jun 2011 08:32:37 +0000 (08:32 +0000)]
add SNDCTL_DSP_HALT specified by OSS

This is really a new name for SNDCTL_DSP_RESET.
And this what commit r222723 should really have been in the first place.

PR: kern/156874
Submitted by: gerald
MFC after: 1 week

13 years agorevert r222723: wrong change was committed
Andriy Gapon [Wed, 29 Jun 2011 08:28:39 +0000 (08:28 +0000)]
revert r222723: wrong change was committed

The commit intended to add SNDCTL_DSP_HALT, but actually added
SNDCTL_SEQ_HALT, which is not defined in the OSS specs.

Reported by: Pan Tsu <inyaoo@gmail.com>
Pointyhat to: gerald, avg

13 years agoImprove error reporting. Use corresponding error message when file to be
Andrey V. Elsukov [Wed, 29 Jun 2011 06:45:44 +0000 (06:45 +0000)]
Improve error reporting. Use corresponding error message when file to be
preprocessed is missing. Also suggest to use absolute pathname if -p option
is specified.

PR:             bin/156653
MFC after:      2 weeks

13 years agoInitialize elements of state array when creating the GPT table.
Andrey V. Elsukov [Wed, 29 Jun 2011 05:41:14 +0000 (05:41 +0000)]
Initialize elements of state array when creating the GPT table.
This fixes the problem, when the secondary GPT header is not erased when
partition table destroyed. Move equal operations from g_part_gpt_create
and g_part_gpt_recover to the separate function g_gpt_set_defaults.

Reported by: dwhite
MFC after: 1 week

13 years agoFix the new NFSv4 client so that it doesn't fill the cached
Rick Macklem [Tue, 28 Jun 2011 22:52:38 +0000 (22:52 +0000)]
Fix the new NFSv4 client so that it doesn't fill the cached
mode attribute in as 0 when doing writes. The change adds
the Mode attribute plus the others except Owner and Owner_group
to the list requested by the NFSv4 Write Operation. This fixed
a problem where an executable file built by "cc" would get mode
0111 instead of 0755 for some NFSv4 servers.
Found at the recent NFSv4 interoperability Bakeathon.

Tested by: tdh at excfb.com
MFC after: 2 weeks

13 years agoCheck the returned value of activemap_write_complete() and update matadata on
Mikolaj Golub [Tue, 28 Jun 2011 21:01:32 +0000 (21:01 +0000)]
Check the returned value of activemap_write_complete() and update matadata on
disk if needed. This should fix a potential case when extents are cleared in
activemap but metadata is not updated on disk.

Suggested by: pjd
Approved by: pjd (mentor)

13 years agoMake activemap_write_start/complete check the keepdirty list, when
Mikolaj Golub [Tue, 28 Jun 2011 20:57:54 +0000 (20:57 +0000)]
Make activemap_write_start/complete check the keepdirty list, when
stating if we need to update activemap on disk. This makes keepdirty
serve its purpose -- to reduce number of metadata updates.

Discussed with: pjd
Approved by: pjd (mentor)

13 years agoRevert the mechanical change from 'file system' to 'filesystem', committed
Edward Tomasz Napierala [Tue, 28 Jun 2011 19:59:46 +0000 (19:59 +0000)]
Revert the mechanical change from 'file system' to 'filesystem', committed
in r223429.  As bde@ pointed out, it was mostly backwards.

13 years agoFix typo in r223648 which was accidentally committed
Marius Strobl [Tue, 28 Jun 2011 16:44:02 +0000 (16:44 +0000)]
Fix typo in r223648 which was accidentally committed

13 years ago- In gem_reset_rx() also reset the RX MAC which is necessary in order to
Marius Strobl [Tue, 28 Jun 2011 16:16:43 +0000 (16:16 +0000)]
- In gem_reset_rx() also reset the RX MAC which is necessary in order to
  get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW.
- In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX
  filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it
  consistently use the newly introduced sc_mac_rxcfg throughout the driver
  instead of reading the its old content.
- Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation
  failure.
- According to the GEM datasheet the RX MAC should also be disabled in
  gem_setladrf() before changing its configuration.
- Add error messages to gem_disable_{r,t}x() and take advantage of these
  throughout the driver instead of duplicating their functionality all over
  the place.

In joint forces with: yongari

13 years agoMFC
Attilio Rao [Tue, 28 Jun 2011 14:40:17 +0000 (14:40 +0000)]
MFC

13 years agoRun load_rc_config before stop_cmd definition, so that ${quotaoff_flags}
Sergey Kandaurov [Tue, 28 Jun 2011 14:26:34 +0000 (14:26 +0000)]
Run load_rc_config before stop_cmd definition, so that ${quotaoff_flags}
is correctly expanded inside stop_cmd instead of getting nothing.

PR: conf/157687
Reported by: Dmitry Banschikov <d.banschikov peterhost ru>
MFC after: 1 week

13 years agoLibUSB v1.0: Need at least one frame when doing the dummy open
Hans Petter Selasky [Tue, 28 Jun 2011 14:07:28 +0000 (14:07 +0000)]
LibUSB v1.0: Need at least one frame when doing the dummy open
else clear stall won't work in that case.

13 years agoRemove pc_cpumask usage from dtrace MD support
Attilio Rao [Tue, 28 Jun 2011 13:14:39 +0000 (13:14 +0000)]
Remove pc_cpumask usage from dtrace MD support

13 years agoRemove pc_cpumask usage from i386 and XEN.
Attilio Rao [Tue, 28 Jun 2011 13:13:06 +0000 (13:13 +0000)]
Remove pc_cpumask usage from i386 and XEN.

Tested by: pluknet

13 years agoRemove pc_cpumask and pc_other_cpus from MIPS support.
Attilio Rao [Tue, 28 Jun 2011 12:51:08 +0000 (12:51 +0000)]
Remove pc_cpumask and pc_other_cpus from MIPS support.

Tested by: gonzo

13 years agoRemove needless file due to Russia scraps DST in 2011.
Sergey A. Osokin [Tue, 28 Jun 2011 12:32:24 +0000 (12:32 +0000)]
Remove needless file due to Russia scraps DST in 2011.

13 years agoUpdate packet filter (pf) code to OpenBSD 4.5.
Bjoern A. Zeeb [Tue, 28 Jun 2011 11:57:25 +0000 (11:57 +0000)]
Update packet filter (pf) code to OpenBSD 4.5.

You need to update userland (world and ports) tools
to be in sync with the kernel.

Submitted by: mlaier
Submitted by: eri

13 years agoRemove AN again now that tzdata2011h has been imported.
Edwin Groothuis [Tue, 28 Jun 2011 10:38:12 +0000 (10:38 +0000)]
Remove AN again now that tzdata2011h has been imported.

13 years agoMFV of tzdata2011h, r223627
Edwin Groothuis [Tue, 28 Jun 2011 10:24:01 +0000 (10:24 +0000)]
MFV of tzdata2011h, r223627

- Russia scraps DST in 2011
- Remove Netherlands Antilles, add Bonaire, Curacao, Sint Maarten

13 years agoVendor import of tzdata2011h:
Edwin Groothuis [Tue, 28 Jun 2011 10:11:40 +0000 (10:11 +0000)]
Vendor import of tzdata2011h:

- Russia scraps DST in 2011
- Remove Netherlands Antilles, add Bonaire, Curacao, Sint Maarten

Obtained from: ftp://elsie.nci.nih.gov/pub/

13 years agoCompare port numbers correctly. They are stored by SRCPORT()
Bjoern A. Zeeb [Tue, 28 Jun 2011 09:46:25 +0000 (09:46 +0000)]
Compare port numbers correctly.  They are stored by SRCPORT()
in host byte order, so we need to compare them as such.
Properly compare IPv6 addresses as well.

This allows the, by default, 8 badaddrs slots per address
family to work correctly and only print sendto() errors once.

The change is no longer applicable to any latest upstream versions.

Approved by: roberto
Sponsored by: Sandvine Incorporated
MFC after: 1 week