]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoDon't generate input() since it's not used.
brucec [Mon, 22 Nov 2010 14:16:22 +0000 (14:16 +0000)]
Don't generate input() since it's not used.

13 years agoDo not take the process lock. The assignment to u_short inside the
netchild [Mon, 22 Nov 2010 12:42:32 +0000 (12:42 +0000)]
Do not take the process lock. The assignment to u_short inside the
properly aligned structure is atomic on all supported architectures, and
the thread that should see side-effect of assignment is the same thread
that does assignment.

Use a more appropriate conditional to detect the linux ABI.

Suggested by: kib
X-MFC: together with r215664

13 years agoDon't generate input() since it's not used.
brucec [Mon, 22 Nov 2010 12:33:48 +0000 (12:33 +0000)]
Don't generate input() since it's not used.

13 years agoAllow for MTU sizes of up to ETHER_MAX_LEN_JUMBO (i.e. 9018) bytes to be
zec [Mon, 22 Nov 2010 12:32:19 +0000 (12:32 +0000)]
Allow for MTU sizes of up to ETHER_MAX_LEN_JUMBO (i.e. 9018) bytes to be
configured on ng_eiface ifnets.  The default MTU remains unchanged at
1500 bytes.

Mark ng_eiface ifnets as IFCAP_VLAN_MTU capable, so that the associated
vlan(4) ifnets may use full-sized Ethernet MTUs (1500 bytes).

MFC after: 3 days

13 years agoAdd SIGINT handler to `gpart restore` action.
ae [Mon, 22 Nov 2010 11:24:11 +0000 (11:24 +0000)]
Add SIGINT handler to `gpart restore` action.

MFC after: 1 week

13 years agoAlways dump partition labels with `gpart backup`, but `gpart restore`
ae [Mon, 22 Nov 2010 10:08:33 +0000 (10:08 +0000)]
Always dump partition labels with `gpart backup`, but `gpart restore`
does restore them only when -l option is specified [1]. Make number of
entries field in backup format optional. Document -l and -r options of
`gpart show` action.

Suggested by: pjd [1]
MFC after: 1 week

13 years ago1) Add a hint to check for duplicates with optional files. The committed
netchild [Mon, 22 Nov 2010 09:37:52 +0000 (09:37 +0000)]
1) Add a hint to check for duplicates with optional files. The committed
   text is a little bit modified to what was submitted.
   The code example to automate a part of this was proposed by
   Dmitry Morozovsky.
2) Remove trailing whitespace.

Submitted by: arundel

13 years agoRemove trailing dot from the unimplemented futex messages to make
netchild [Mon, 22 Nov 2010 09:25:32 +0000 (09:25 +0000)]
Remove trailing dot from the unimplemented futex messages to make
them consistent with the syscall and ipc messages.

Submitted by: arundel
MFC after: 3 days

13 years agoIn tc_windup, handle the case where the previous call to tc_windup was
cperciva [Mon, 22 Nov 2010 09:13:25 +0000 (09:13 +0000)]
In tc_windup, handle the case where the previous call to tc_windup was
more than 1s earlier.  Prior to this commit, the computation of
th_scale * delta (which produces a 64-bit value equal to the time since
the last tc_windup call in units of 2^(-64) seconds) would overflow and
any complete seconds would be lost.

We fix this by repeatedly converting tc_frequency units of timecounter
to one seconds; this is not exactly correct, since it loses the NTP
adjustment, but if we find ourselves going more than 1s at a time between
clock interrupts, losing a few seconds worth of NTP adjustments is the
least of our problems...

13 years agoBy using the 32-bit Linux version of Sun's Java Development Kit 1.6
netchild [Mon, 22 Nov 2010 09:06:59 +0000 (09:06 +0000)]
By using the 32-bit Linux version of Sun's Java Development Kit 1.6
on FreeBSD (amd64), invocations of "javac" (or "java") eventually
end with the output of "Killed" and exit code 137.

This is caused by:
1. After calling exec() in multithreaded linux program threads are not
   destroyed and continue running. They get killed after program being
   executed finishes.

2. linux_exit_group doesn't return correct exit code when called not
   from group leader. Which happens regularly using sun jvm.

The submitters fix this in a similar way to how NetBSD handles this.

I took the PRs away from dchagin, who seems to be out of touch of
this since a while (no response from him).

The patches committed here are from [2], with some little modifications
from me to the style.

PR: 141439 [1], 144194 [2]
Submitted by: Stefan Schmidt <stefan.schmidt@stadtbuch.de>, gk
Reviewed by: rdivacky (in april 2010)
MFC after: 5 days

13 years agoIn xen_get_timecount, return the full ns-precision time rather than
cperciva [Mon, 22 Nov 2010 09:04:29 +0000 (09:04 +0000)]
In xen_get_timecount, return the full ns-precision time rather than
rounding to 1/HZ precision.

I have no idea why the rounding was introduced in the first place, but
it makes FreeBSD unhappy.

13 years agoPlug an fd leak
kevlo [Mon, 22 Nov 2010 07:00:47 +0000 (07:00 +0000)]
Plug an fd leak

13 years agoUse atomic instruction to set _has_writer, otherwise there is a race
davidxu [Mon, 22 Nov 2010 02:42:02 +0000 (02:42 +0000)]
Use atomic instruction to set _has_writer, otherwise there is a race
causes userland to not wake up a thread sleeping in kernel.

MFC after: 3 days

13 years agoAdds usbdump(8) tool that currently it only supports the very basic
weongyo [Mon, 22 Nov 2010 01:28:29 +0000 (01:28 +0000)]
Adds usbdump(8) tool that currently it only supports the very basic
feature set.  It's not connected to the build yet.

Reviewed by: hps

13 years agoAdds a USB packet filter feature to the stack that it could capture
weongyo [Mon, 22 Nov 2010 01:11:28 +0000 (01:11 +0000)]
Adds a USB packet filter feature to the stack that it could capture
packets which go through each USB host controllers.  Its implementations
are almost based on BPF code and very similar with it except it's
little bit customized for USB packet only.  The userland program
usbdump(8) would be committed soon.

Discussed with: hps, thompsa, yongari

13 years agoVarious syntactic tweaks to satisfy style(9). No change to execution.
mckay [Sun, 21 Nov 2010 21:31:29 +0000 (21:31 +0000)]
Various syntactic tweaks to satisfy style(9).  No change to execution.

Submitted by: gcooper@

13 years agoAdd a missing ';' and change the debugging sysctl from xint to int.
bz [Sun, 21 Nov 2010 19:33:19 +0000 (19:33 +0000)]
Add a missing ';' and change the debugging sysctl from xint to int.

Submitted by: Mikolaj Golub (to.my.trociny gmail.com)
MFC after: 3 days

13 years agodispatch_add_command:
brucec [Sun, 21 Nov 2010 14:34:25 +0000 (14:34 +0000)]
dispatch_add_command:
Modify the logic so there's only one exit point instead of two.
Only insert valid (non-NULL) values into the queue.

dispatch_free_command:
Ensure that item is not NULL before removing it from the queue and
dereferencing the pointer.
NULL out free'd pointers to catch any use-after-free bugs.

PR: bin/146855
Submitted by: gcooper
MFC after: 3 days

13 years agoFix a typo in a comment.
simon [Sun, 21 Nov 2010 11:50:16 +0000 (11:50 +0000)]
Fix a typo in a comment.

MFC after: 3 days

13 years agoxargs can be fooled by exiting children that it did not start, causing
mckay [Sun, 21 Nov 2010 10:55:16 +0000 (10:55 +0000)]
xargs can be fooled by exiting children that it did not start, causing
it to kick off a new command before the previous has finished, resulting
in corrupted (interleaved) output.  It is also fooled by non-exiting
children it did not start, failing to exit until all extraneous children
have exited.

This patch makes xargs keep track of children it starts, ignoring
pre-existing ones.

13 years agoEliminate the mab, maf arrays and related variables.
kib [Sun, 21 Nov 2010 10:18:28 +0000 (10:18 +0000)]
Eliminate the mab, maf arrays and related variables.

The change also fixes off-by-one error in the calculation of mreq.

Suggested and reviewed by: alc
Tested by: pho
MFC after: 5 days

13 years agoFix missing closedir()
kevlo [Sun, 21 Nov 2010 04:02:37 +0000 (04:02 +0000)]
Fix missing closedir()

Reviewed by: imp

13 years agoAdd lex and yacc sources to things cscope'd.
obrien [Sun, 21 Nov 2010 03:58:11 +0000 (03:58 +0000)]
Add lex and yacc sources to things cscope'd.

13 years agoAdd x86 to ALL_ARCH.
obrien [Sun, 21 Nov 2010 03:56:41 +0000 (03:56 +0000)]
Add x86 to ALL_ARCH.

13 years agoOptimize vm_object_terminate().
alc [Sat, 20 Nov 2010 22:30:09 +0000 (22:30 +0000)]
Optimize vm_object_terminate().

Reviewed by: kib
MFC after: 1 week

13 years agoUnifdef XEN. This file is only compiled with the XEN kernel option set,
cperciva [Sat, 20 Nov 2010 21:36:12 +0000 (21:36 +0000)]
Unifdef XEN.  This file is only compiled with the XEN kernel option set,
and the !XEN bits get in the way of understanding the code.

13 years agoAdd VTOM(va) macro as xpmap_ptom(VTOP(va)) to convert to machine addresses.
cperciva [Sat, 20 Nov 2010 20:04:29 +0000 (20:04 +0000)]
Add VTOM(va) macro as xpmap_ptom(VTOP(va)) to convert to machine addresses.

Clean up the code by converting xpmap_ptom(VTOP(...)) to VTOM(...) and
converting xpmap_ptom(VM_PAGE_TO_PHYS(...)) to VM_PAGE_TO_MACH(...).  In
a few places we take advantage of the fact that xpmap_ptom can commute with
setting PG_* flags.

This commit should have no net effect save to improve the readability of
this code.

13 years agoCheck the OF_getprop() return value before proceeding. Allocate only as
andreast [Sat, 20 Nov 2010 19:23:16 +0000 (19:23 +0000)]
Check the OF_getprop() return value before proceeding. Allocate only as
much space as needed for the mode buffer. Use strcmp, relying on OF giving
back NULL terminated strings.

Submitted by: marius
Approved by: nwhitehorn (mentor)

13 years agoDelete /sys/ufs/ffs/README.snapshot as it is no longer relevant.
mckusick [Sat, 20 Nov 2010 18:40:50 +0000 (18:40 +0000)]
Delete /sys/ufs/ffs/README.snapshot as it is no longer relevant.
Drop reference to it in mount(8).

MFC: 3 days

13 years agoThe runlen returned from vm_pageout_flush() might be zero legitimately,
kib [Sat, 20 Nov 2010 17:27:38 +0000 (17:27 +0000)]
The runlen returned from vm_pageout_flush() might be zero legitimately,
when mreq page has status VM_PAGER_AGAIN.

MFC after: 5 days

13 years agoAdd to gpart(8) an ability to backup partition table and
ae [Sat, 20 Nov 2010 16:03:53 +0000 (16:03 +0000)]
Add to gpart(8) an ability to backup partition table and
restore it from given backup.

Discussed with: geom@
Approved by: kib (mentor)
MFC after: 1 week

13 years agoRemove unused variable
kevlo [Sat, 20 Nov 2010 15:22:16 +0000 (15:22 +0000)]
Remove unused variable

13 years agosh: Remove the check that alpha/name/in_name chars are not CTL* bytes.
jilles [Sat, 20 Nov 2010 14:30:28 +0000 (14:30 +0000)]
sh: Remove the check that alpha/name/in_name chars are not CTL* bytes.

Since is_alpha/is_name/is_in_name were made ASCII-only, this can no longer
happen.

Additionally, the check was wrong because it did not include the new
CTLQUOTEEND.

13 years agosh: Code size optimizations to buffered output.
jilles [Sat, 20 Nov 2010 14:14:52 +0000 (14:14 +0000)]
sh: Code size optimizations to buffered output.

This is mainly less use of the outc macro.

No functional change is intended, but code size is about 2K less on i386.

13 years agoIn case of an early return from the function there is no need to zero
bz [Sat, 20 Nov 2010 12:27:40 +0000 (12:27 +0000)]
In case of an early return from the function there is no need to zero
the route upfront, so defer as long as we can.

MFC after: 3 days

13 years agoFix a minor code redundancy nit.
lstewart [Sat, 20 Nov 2010 08:40:37 +0000 (08:40 +0000)]
Fix a minor code redundancy nit.

MFC after: 3 days

13 years agoWhen enabling or disabling SIFTR with a VIMAGE kernel, ensure we add or remove
lstewart [Sat, 20 Nov 2010 07:36:43 +0000 (07:36 +0000)]
When enabling or disabling SIFTR with a VIMAGE kernel, ensure we add or remove
the SIFTR pfil(9) hook functions to or from all network stacks. This patch
allows packets inbound or outbound from a vnet to be "seen" by SIFTR.

Additional work is required to allow SIFTR to actually generate log messages for
all vnet related packets because the siftr_findinpcb() function does not yet
search for inpcbs across all vnets. This issue will be fixed separately.

Reported and tested by: David Hayes <dahayes at swin edu au>
MFC after: 3 days

13 years agosh: Add a test that manipulates various long strings.
jilles [Fri, 19 Nov 2010 22:25:32 +0000 (22:25 +0000)]
sh: Add a test that manipulates various long strings.

It is quite effective at detecting mistakes in memalloc.c and code using it.

It is somewhat slow, but some of the patches in my queue improve it.

13 years agoRemove prtactive variable and related printf()s in the vop_inactive
kib [Fri, 19 Nov 2010 21:17:34 +0000 (21:17 +0000)]
Remove prtactive variable and related printf()s in the vop_inactive
and vop_reclaim() methods. They seems to be unused, and the reported
situation is normal for the forced unmount.

MFC after:   1 week
X-MFC-note:  keep prtactive symbol in vfs_subr.c

13 years agosh: Add another simple test for the wait builtin.
jilles [Fri, 19 Nov 2010 21:15:06 +0000 (21:15 +0000)]
sh: Add another simple test for the wait builtin.

13 years agoScan the list in reverse order for the shutdown handlers of loaded modules.
attilio [Fri, 19 Nov 2010 19:43:56 +0000 (19:43 +0000)]
Scan the list in reverse order for the shutdown handlers of loaded modules.
This way, when there is a dependency between two modules, the handler of the
latter probed runs first.

This is a similar approach as the modules are unloaded in the same
linkerfile.

Sponsored by: Sandvine Incorporated
Submitted by: Nima Misaghian <nmisaghian at sandvine dot com>
MFC after: 1 week

13 years agoSet the POSIX semaphore capability when the semaphore module is enabled.
jhb [Fri, 19 Nov 2010 17:57:50 +0000 (17:57 +0000)]
Set the POSIX semaphore capability when the semaphore module is enabled.
This is ignored in HEAD where semaphores are marked as always enabled in
<unistd.h>.

MFC after: 1 week

13 years agoSet various POSIX capability sysctls to the version of the API that is
jhb [Fri, 19 Nov 2010 17:56:16 +0000 (17:56 +0000)]
Set various POSIX capability sysctls to the version of the API that is
supported rather than 1.  They are supposed to return a suitable value
for sysconf(3).  While here, make the fsync sysctl match <unistd.h>.

MFC after: 1 week

13 years agoReduce the amount of detail printed by vm_page_free_toq() when it panics.
alc [Fri, 19 Nov 2010 17:49:08 +0000 (17:49 +0000)]
Reduce the amount of detail printed by vm_page_free_toq() when it panics.

Reviewed by: kib

13 years agoHandle malloc() failures more gracefully by error'ing out rather than
jhb [Fri, 19 Nov 2010 15:39:59 +0000 (15:39 +0000)]
Handle malloc() failures more gracefully by error'ing out rather than
segfaulting.

Submitted by: gcooper
MFC after: 1 week

13 years agoMake pmap_release consistent with pmap_pinit with respect to unpinning
cperciva [Fri, 19 Nov 2010 15:12:19 +0000 (15:12 +0000)]
Make pmap_release consistent with pmap_pinit with respect to unpinning
pages.  The pinning of NPGPTD pages is #if 0ed out in pmap_pinit (I'm
not quite sure why...) and this commit adds a corresponding #if 0 in
pmap_release to avoid unpinning those pages.

Some versions of Xen seem to silently ignore requests to unpin pages
which were never pinned in the first place, but some return an error
(causing FreeBSD to panic) prior to this commit.

13 years agospecialreg.h: add definitions for MPERF/APERF pair of MSRs
avg [Fri, 19 Nov 2010 15:07:36 +0000 (15:07 +0000)]
specialreg.h: add definitions for MPERF/APERF pair of MSRs

These MSRs can be used to determine actual (average) performance as
compared to a maximum defined performance.
Availability of these MSRs is indicated by bit0 in CPUID.6.ECX on both
Intel and AMD processors.

MFC after: 5 days

13 years agospecialreg.h: add AMD-specific "Hardware Configuration Register" MSR
avg [Fri, 19 Nov 2010 15:00:20 +0000 (15:00 +0000)]
specialreg.h: add AMD-specific "Hardware Configuration Register" MSR

It seems that this MSR has been available in a range of AMD processors
families for quite a while now.

Note1: not all AMD MSRs that are found in amd64 specialreg.h are also in
the i386 version.
Note2: perhaps some additional name component is needed to distinguish
AMD-specific MSRs.

MFC after: 5 days

13 years agospecialreg.h: add definition for AMD Core Performance Boost bit
avg [Fri, 19 Nov 2010 14:46:17 +0000 (14:46 +0000)]
specialreg.h: add definition for AMD Core Performance Boost bit

This bit indicates availability of the feature.

MFC after: 4 days

13 years agosh: Add printf builtin.
jilles [Fri, 19 Nov 2010 12:56:13 +0000 (12:56 +0000)]
sh: Add printf builtin.

This was removed in 2001 but I think it is appropriate to add it back:
* I do not want to encourage people to write fragile and non-portable echo
  commands by making printf much slower than echo.
* Recent versions of Autoconf use it a lot.
* Almost no software still wants to support systems that do not have
  printf(1) at all.
* In many other shells printf is already a builtin.

Side effect: printf is now always the builtin version (which behaves
identically to /usr/bin/printf) and cannot be overridden via PATH (except
via the undocumented %builtin mechanism).

Code size increases about 5K on i386. Embedded folks might want to replace
/usr/bin/printf with a hard link to /usr/bin/alias.

13 years agoFix fd leak
kevlo [Fri, 19 Nov 2010 10:18:58 +0000 (10:18 +0000)]
Fix fd leak

MFC after: 3 days

13 years agoClose file and directory descriptors
kevlo [Fri, 19 Nov 2010 10:15:29 +0000 (10:15 +0000)]
Close file and directory descriptors

MFC after: 3 days

13 years agoRemove obsoleted private symbol.
mm [Fri, 19 Nov 2010 09:59:55 +0000 (09:59 +0000)]
Remove obsoleted private symbol.

Approved by: delphij (mentor)
MFC after: together with 5.0.0 update

13 years agoOff by one page in vm_reserv_reclaim_contig(): Also reclaim reservations
mlaier [Fri, 19 Nov 2010 04:30:33 +0000 (04:30 +0000)]
Off by one page in vm_reserv_reclaim_contig(): Also reclaim reservations
with only a single free page if that satisfies the requested size.

MFC after: 3 days
Reviewed by: alc

13 years agoWhen doing a camcontrol rescan all or a camcontrol reset all, use the wildcard
rstone [Fri, 19 Nov 2010 03:47:10 +0000 (03:47 +0000)]
When doing a camcontrol rescan all or a camcontrol reset all, use the wildcard
path id for enumerating the available busses.  Previously camcontrol was
implicitly passing 0 as the first path id, which meant that if bus 0 was not
present camcontrol would fail with EINVAL instead of rescanning/resetting any
busses that were present.

Approved by: emaste (mentor)
MFC after: 1 week

13 years agoWhen netstat was run with -i/-I and -w1 to produce running counters, the idrop
rstone [Thu, 18 Nov 2010 23:46:55 +0000 (23:46 +0000)]
When netstat was run with -i/-I and -w1 to produce running counters, the idrop
field printed an absolute value rather than the delta from the last value

Approved by: emaste (mentor)
MFC after: 1 week

13 years agoVarious small typos and grammar nits in comments.
jhb [Thu, 18 Nov 2010 22:17:20 +0000 (22:17 +0000)]
Various small typos and grammar nits in comments.

13 years agoMake pmap_release match pmap_pinit by invoking pmap_qremove(pmap->pm_pdpt)
cperciva [Thu, 18 Nov 2010 21:29:43 +0000 (21:29 +0000)]
Make pmap_release match pmap_pinit by invoking pmap_qremove(pmap->pm_pdpt)
to match pmap_pinit's pmap_qenter(pmap->pm_pdpt) call in the case of PAE.

13 years agovm_pageout_flush() might cache the pages that finished write to the
kib [Thu, 18 Nov 2010 21:09:02 +0000 (21:09 +0000)]
vm_pageout_flush() might cache the pages that finished write to the
backing storage. Such pages might be then reused, racing with the
assert in vm_object_page_collect_flush() that verified that dirty
pages from the run (most likely, pages with VM_PAGER_AGAIN status) are
write-protected still. In fact, the page indexes for the pages that
were removed from the object page list should be ignored by
vm_object_page_clean().

Return the length of successfully written run from vm_pageout_flush(),
that is, the count of pages between requested page and first page
after requested with status VM_PAGER_AGAIN. Supply the requested page
index in the array to vm_pageout_flush(). Use the returned run length
to forward the index of next page to clean in vm_object_page_clean().

Reported by: avg
Reviewed by: alc
MFC after: 1 week

13 years agoDon't KASSERT in pmap_release that
cperciva [Thu, 18 Nov 2010 21:02:40 +0000 (21:02 +0000)]
Don't KASSERT in pmap_release that
  xpmap_ptom(VM_PAGE_TO_PHYS(m)) == (pmap->pm_pdpt[i] & PG_FRAME)
for i = NPGPTD, since pmap->pm_pdpt[i] is only initialized for
0 <= i < NPGPTD.

This fixes an inevitable panic with XEN && PAE && INVARIANTS when
pmap_release is called (e.g., when /sbin/init is launched).

13 years agoOnly increment object generation count when inserting the page into
kib [Thu, 18 Nov 2010 20:46:28 +0000 (20:46 +0000)]
Only increment object generation count when inserting the page into
object page list.  The only use of object generation count now is a
restart of the scan in vm_object_page_clean(), which makes sense to do
on the page addition. Page removals do not affect the dirtiness of the
object, as well as manipulations with the shadow chain.

Suggested and reviewed by: alc
MFC after:    1 week

13 years agoMake ATA_CAM wrapper to report SATA power management capabilities to CAM to
mav [Thu, 18 Nov 2010 19:28:45 +0000 (19:28 +0000)]
Make ATA_CAM wrapper to report SATA power management capabilities to CAM to
make it configure device to initiate transitions if controller configured
to accept them. This makes hint.ata.X.pm_level=1 mode working.

13 years agoFix paths for example files.
markm [Thu, 18 Nov 2010 18:22:58 +0000 (18:22 +0000)]
Fix paths for example files.

13 years agoAdd VIA VX900 to the list of supported chipsets.
mav [Thu, 18 Nov 2010 18:09:25 +0000 (18:09 +0000)]
Add VIA VX900 to the list of supported chipsets.

13 years agoFix a bug introduced with r215298; when atphy_reset() is called from
marius [Thu, 18 Nov 2010 17:58:59 +0000 (17:58 +0000)]
Fix a bug introduced with r215298; when atphy_reset() is called from
atphy_attach() the current media has not been set, yet, leading to a
NULL-dereference in atphy_setmedia().

Submitted by: jkim (initial version)

13 years agoDo not lint code beyond necessity (with apologies to Wiliam of Ockham).
markm [Thu, 18 Nov 2010 16:32:52 +0000 (16:32 +0000)]
Do not lint code beyond necessity (with apologies to Wiliam of Ockham).

Don't lint externally maintained CDDL code, or relint the 32-bit libraries
in amd64 mode.

13 years agoIf HBA doesn't report user-enabled SATA capabilies (like ATA_CAM wrapper) -
mav [Thu, 18 Nov 2010 13:38:33 +0000 (13:38 +0000)]
If HBA doesn't report user-enabled SATA capabilies (like ATA_CAM wrapper) -
handle all of them as disabled. This was original cause of the problem,
workarounded by r215453.

MFC after: 1 week

13 years agoEven if we are skipping SATA hard reset - set power management bits in
mav [Thu, 18 Nov 2010 11:58:17 +0000 (11:58 +0000)]
Even if we are skipping SATA hard reset - set power management bits in
SControl register. This should make things consistent and help to avoid
unexpected PHY events that I've noticed in some cases on VIA controllers.

13 years agoRecord that there is no devices if SATA reset found none.
mav [Thu, 18 Nov 2010 10:34:18 +0000 (10:34 +0000)]
Record that there is no devices if SATA reset found none.

13 years agoCorrect description of the return values of
hselasky [Thu, 18 Nov 2010 08:32:47 +0000 (08:32 +0000)]
Correct description of the return values of
the LibUSB v1.0 libusb_control_transfer() function.

PR: usb/151851
Submitted by: HIROSHI OOTA
Approved by: thompsa (mentor)

13 years agoSome VIA SATA controllers provide access to non-standard SATA registers via
mav [Thu, 18 Nov 2010 08:03:40 +0000 (08:03 +0000)]
Some VIA SATA controllers provide access to non-standard SATA registers via
PCI config space. Use them to implement hot-plug and link speed reporting.
Tested on ASRock PV530 board with VX900 chipset.

13 years agoAdd a resource_list_reserved() method that returns true if a resource
jhb [Wed, 17 Nov 2010 22:28:04 +0000 (22:28 +0000)]
Add a resource_list_reserved() method that returns true if a resource
list entry contains a reserved resource.

13 years agoRevert r215435. We need to figure out the exact value to be loaded.
andreast [Wed, 17 Nov 2010 20:37:16 +0000 (20:37 +0000)]
Revert r215435. We need to figure out the exact value to be loaded.

Approved by:  nwhitehorn (mentor)

13 years agoLet gcc and ld know where to find 32 bit libraries on amd64.
tijl [Wed, 17 Nov 2010 19:54:01 +0000 (19:54 +0000)]
Let gcc and ld know where to find 32 bit libraries on amd64.

Reviewed by: arch@
Approved by: kib (mentor)

13 years agoCheck the real-mode? OF property to find out whether we operate in real or
andreast [Wed, 17 Nov 2010 19:35:56 +0000 (19:35 +0000)]
Check the real-mode? OF property to find out whether we operate in real or
virtual mode. In virtual mode we have to do memory mapping. On PowerMacs it is
usually false while on pSeries we have found that it is true. The real-mode?
property is not available on sparc64.

Approved by:  nwhitehorn (mentor)

13 years agoMove the declaration of the eh struct (used only when debugging is enabled)
andreast [Wed, 17 Nov 2010 19:31:48 +0000 (19:31 +0000)]
Move the declaration of the eh struct (used only when debugging is enabled)
from ofwn_put into the debug section.

Approved by: nwhitehorn (mentor)

13 years agoMake sure the .bss is cleared at the beginning. The pSeries OF ELF loader does
andreast [Wed, 17 Nov 2010 19:28:48 +0000 (19:28 +0000)]
Make sure the .bss is cleared at the beginning. The pSeries OF ELF loader does
not clear .bss automatically.

Approved by: nwhitehorn (mentor)

13 years agoLoad the full 16k stack space.
andreast [Wed, 17 Nov 2010 19:25:37 +0000 (19:25 +0000)]
Load the full 16k stack space.

Approved by: nwhitehorn (mentor)

13 years agoAdd new, per connection, statistics for TCP, including:
gnn [Wed, 17 Nov 2010 18:55:12 +0000 (18:55 +0000)]
Add new, per connection, statistics for TCP, including:
Retransmitted Packets
Zero Window Advertisements
Out of Order Receives

These statistics are available via the -T argument to
netstat(1).
MFC after: 2 weeks

13 years agoMCP55 is the only NVIDIA controller that supports VLAN tag
yongari [Wed, 17 Nov 2010 18:09:02 +0000 (18:09 +0000)]
MCP55 is the only NVIDIA controller that supports VLAN tag
insertion/stripping and it also supports TSO over VLAN. Implement
TSO over VLAN support for MCP55 controller.

While I'm here clean up SIOCSIFCAP ioctl handler. Since nfe(4)
sets ifp capabilities based on various hardware flags in device
attach, there is no need to check hardware flags again in
SIOCSIFCAP ioctl handler. Also fix a bug which toggled both TX and
RX checksum offloading even if user requested either TX or RX
checksum configuration change.

Tested by: Rob Farmer ( rfarmer <> predatorlabs dot net )

13 years agoAdd IDs for VIA VX900 chipset SATA controller.
mav [Wed, 17 Nov 2010 17:52:04 +0000 (17:52 +0000)]
Add IDs for VIA VX900 chipset SATA controller.
(Missed part of r215428)

13 years agoAdd IDs for VIA VX900 chipset SATA controller.
mav [Wed, 17 Nov 2010 16:17:35 +0000 (16:17 +0000)]
Add IDs for VIA VX900 chipset SATA controller.

MFC after: 1 week

13 years agoOnly save FPU context when not executing in the context of the crypto
kib [Wed, 17 Nov 2010 16:17:15 +0000 (16:17 +0000)]
Only save FPU context when not executing in the context of the crypto
thread.

Tested by: Mike Tancsa

13 years agoRemove unused autofs userland bits.
jhb [Wed, 17 Nov 2010 15:42:47 +0000 (15:42 +0000)]
Remove unused autofs userland bits.

Approved by: core

13 years agoChange "wait" banner to "qlen" to be more indicative of its purpose and to
ivoras [Wed, 17 Nov 2010 15:12:10 +0000 (15:12 +0000)]
Change "wait" banner to "qlen" to be more indicative of its purpose and to
be more inline with what gstat uses.

Reviewed by: gnn
Silence from: phk, keramida

13 years agoDo not initialize flag variables before needed.
bz [Wed, 17 Nov 2010 10:43:20 +0000 (10:43 +0000)]
Do not initialize flag variables before needed.
Consistently use the LLE_ prefix for lla_lookup() and the ND6_ prefix
for nd6_lookup() even though both are defined the same. Use the right
flag variable when checking each.

No real functional change.

MFC after: 4 days

13 years agoFix a panic on i386 for drivers using MmAllocateContiguousMemory()
bschmidt [Wed, 17 Nov 2010 09:32:39 +0000 (09:32 +0000)]
Fix a panic on i386 for drivers using MmAllocateContiguousMemory()
and MmAllocateContiguousMemorySpecifyCache().

Those two functions take 64-bit variable(s) for their arguments. On i386
that takes additional 32-bit variable per argument. This is required so
that windrv_wrap() can correctly wrap function that miniport driver calls
with stdcall convention. Similar explanation is provided in subr_ndis.c for
other functions.

Submitted by:  Paul B Mahol <onemda at gmail.com>

13 years agoUse kmem_alloc_contig() to honour the cache_type variable.
bschmidt [Wed, 17 Nov 2010 09:28:17 +0000 (09:28 +0000)]
Use kmem_alloc_contig() to honour the cache_type variable.

Pointed out by: alc

13 years agoNo need to re-initialize the callout. We initially do it in in6_lltable_new()
bz [Wed, 17 Nov 2010 09:25:08 +0000 (09:25 +0000)]
No need to re-initialize the callout.  We initially do it in in6_lltable_new()
right after allocation.  Worse, we are losing the right flags here.

MFC after: 4 days

13 years agoRestore CR0 after MTRR initialization for correctness sakes. There will be
jkim [Tue, 16 Nov 2010 23:26:02 +0000 (23:26 +0000)]
Restore CR0 after MTRR initialization for correctness sakes.  There will be
no noticeable change because we enable caches before we enter here for both
BSP and AP cases.  Remove another pointless optimization for CR4.PGE bit
while I am here.

13 years agoInvalidate TLBs explicitly. r1.4 of sys/i386/i386/i686_mem.c removed this
jkim [Tue, 16 Nov 2010 22:44:58 +0000 (22:44 +0000)]
Invalidate TLBs explicitly.  r1.4 of sys/i386/i386/i686_mem.c removed this
code but probably it only worked by chance because modifying CR4.PGE bit
causes invlidation of entire TLBs.  Since these are very rare events, this
micro-optimization seems useless.

Reviewed by: jhb

13 years agoRe-enable generating links.
adrian [Tue, 16 Nov 2010 22:23:20 +0000 (22:23 +0000)]
Re-enable generating links.

13 years ago.. and then notice that the list of mk files is ordered, and update to suit.
adrian [Tue, 16 Nov 2010 22:22:16 +0000 (22:22 +0000)]
.. and then notice that the list of mk files is ordered, and update to suit.

13 years agoAdd in forgotten install rule.
adrian [Tue, 16 Nov 2010 22:21:14 +0000 (22:21 +0000)]
Add in forgotten install rule.

13 years agoAdd an SCTP socket option to retrieve the number of timeouts
tuexen [Tue, 16 Nov 2010 22:16:38 +0000 (22:16 +0000)]
Add an SCTP socket option to retrieve the number of timeouts
of an association.

MFC after: 3 days.

13 years agoFix an error in our results printing.
gnn [Tue, 16 Nov 2010 20:39:52 +0000 (20:39 +0000)]
Fix an error in our results printing.

13 years agozfs+sendfile: populate all requested pages, not just those already cached
avg [Tue, 16 Nov 2010 15:53:44 +0000 (15:53 +0000)]
zfs+sendfile: populate all requested pages, not just those already cached

kern_sendfile() uses vm_rdwr() to read-ahead blocks of data to populate
page cache.  When sendfile stumbles upon a page that is not populated
yet, it sends out all the mbufs that it collected so far.  This
resulted in very poor performance with ZFS when file data is not in the
page cache, because ZFS vop_read for UIO_NOCOPY case populated only
those pages that are already in cache, but not valid.  Which means that
most of the time it populated only the first requested page in the
described above scenario.

Reported by: Alexander Zagrebin <alexz@visp.ru>
Tested by: Alexander Zagrebin <alexz@visp.ru>,
Artemiev Igor <ai@kliksys.ru>
MFC after: 12 days

13 years agoNo need to include sys/systm.h twice.
cognet [Tue, 16 Nov 2010 14:08:21 +0000 (14:08 +0000)]
No need to include sys/systm.h twice.

13 years agohwpstate: use CPU_FOREACH when binding to all available processors
avg [Tue, 16 Nov 2010 12:43:45 +0000 (12:43 +0000)]
hwpstate: use CPU_FOREACH when binding to all available processors

Also, add a comment mentioning _PSD - on some systems it's enough to
put one logical CPU into a particular P-state to make other CPUs in
the same domain to enter that P-state.

Also, call sched_unbind() after the loop - sched_bind() automatically
rebinds from previous CPU to a new one, and the new arrangement of code
is safer against early loop exit.

Plus one minor style nit.

MFC after: 10 days

13 years agofix misspelling in a comment
avg [Tue, 16 Nov 2010 12:30:47 +0000 (12:30 +0000)]
fix misspelling in a comment

Reported by: Daniel Braniss <danny@cs.huji.ac.il>
MFC after: 3 days