]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoAdd a sync to the shutdown step. In the common case this will be harmless
Doug Barton [Thu, 25 Nov 2010 18:20:28 +0000 (18:20 +0000)]
Add a sync to the shutdown step. In the common case this will be harmless
at worst. On a heavily loaded server it will give the fs a chance to do
its business without the axe hanging over its head.

Submitted by: ivoras

13 years agoUse unambiguous inline assembly to load a float variable. GNU as
Dimitry Andric [Thu, 25 Nov 2010 18:14:18 +0000 (18:14 +0000)]
Use unambiguous inline assembly to load a float variable.  GNU as
silently converts 'fld' to 'flds', without taking the actual variable
type into account (!), but clang's integrated assembler rightfully
complains about it.

Discussed with: cperciva

13 years agoAdd a missing CTL description from CVS revision 1.147.
Attilio Rao [Thu, 25 Nov 2010 15:56:05 +0000 (15:56 +0000)]
Add a missing CTL description from CVS revision 1.147.

Sponsored by: Sandvine Incorporated
Discussed with: Jeremie Le Hen <jeremie at le-hen dot org>
MFC after: 3 days

13 years agoAdd device IDs for two more ServerWorks Host-PCI bridges so that we can
John Baldwin [Thu, 25 Nov 2010 15:42:33 +0000 (15:42 +0000)]
Add device IDs for two more ServerWorks Host-PCI bridges so that we can
read their starting PCI bus number for older systems that do not support
ACPI (or have a broken _BBN method).

PR: kern/148108
MFC after: 1 week

13 years agoWork around paging bug. Somehow we seem to be ending up with entries in
Colin Percival [Thu, 25 Nov 2010 15:41:34 +0000 (15:41 +0000)]
Work around paging bug.  Somehow we seem to be ending up with entries in
the TLB which don't correspond to ptes with PG_V set; prior to this commit
I'm sometimes getting the wrong data when pages are loaded into the buffer
cache (they're being loaded, but the missing TLB invalidation is causing
the wrong data to be visible).

13 years agoRename HYPERVISOR_multicall (which performs the multicall hypercall) to
Colin Percival [Thu, 25 Nov 2010 15:05:21 +0000 (15:05 +0000)]
Rename HYPERVISOR_multicall (which performs the multicall hypercall) to
_HYPERVISOR_multicall, and create a new HYPERVISOR_multicall function which
invokes _HYPERVISOR_multicall and checks that the individual hypercalls all
succeeded.

13 years agoAdds new dtrace for cwnd functions and lay's
Randall Stewart [Thu, 25 Nov 2010 13:39:55 +0000 (13:39 +0000)]
Adds new dtrace for cwnd functions and lay's
groundwork for future dtrace points (rwnd flightsize etc).

MFC after: 2 months

13 years agoRemove vestigal debugging code which, in fork-heavy workloads, can cause
Colin Percival [Thu, 25 Nov 2010 04:45:31 +0000 (04:45 +0000)]
Remove vestigal debugging code which, in fork-heavy workloads, can cause
a 30x slowdown.

13 years agoHandles the unit number correctly that the previous commit had a problem
Weongyo Jeong [Thu, 25 Nov 2010 03:30:43 +0000 (03:30 +0000)]
Handles the unit number correctly that the previous commit had a problem
(wrong unit number for a host controller) when the module is load /
unloaded repeatly.  Attaching the USB pf is moved to usbus device's
attach.

Pointed by: yongari

13 years agoGive a bit of a hint of the failure (read != expected) but don't make
Ed Maste [Thu, 25 Nov 2010 03:16:31 +0000 (03:16 +0000)]
Give a bit of a hint of the failure (read != expected) but don't make
the error message needlessly more verbose.

Discussed with: attilio

13 years agoAssigning the unit number for each interfaces could not use ubus->parent
Weongyo Jeong [Thu, 25 Nov 2010 03:02:53 +0000 (03:02 +0000)]
Assigning the unit number for each interfaces could not use ubus->parent
because it could differ depending on the host controller type.  It could
lead the duplicate unit number assignment.

13 years agoThe purpose of this change is to add a routine to
Jack F Vogel [Wed, 24 Nov 2010 22:24:07 +0000 (22:24 +0000)]
The purpose of this change is to add a routine to
disable ASPM L0S and L1 LINK states on 82573, 82574,
and 82583. The theory is that this is behind certain
hangs being experienced by some customers.

Also included a small optimization in the rxeof routine
that was in my internal code.

Change the PBA size for pchlan, it was incorrect.

MFC after: 3 days

13 years agoFixes a compiler warning when it's compiled with INVARIANTS.
Weongyo Jeong [Wed, 24 Nov 2010 21:43:36 +0000 (21:43 +0000)]
Fixes a compiler warning when it's compiled with INVARIANTS.

Pointy hat to: me

13 years agoAs a refection of r215802 it should use BPF interfaces because the
Weongyo Jeong [Wed, 24 Nov 2010 19:15:26 +0000 (19:15 +0000)]
As a refection of r215802 it should use BPF interfaces because the
duplication code of USB pf is removed.

13 years agoRemoves all duplicated code with BPF that it's greatly simplified and
Weongyo Jeong [Wed, 24 Nov 2010 19:11:32 +0000 (19:11 +0000)]
Removes all duplicated code with BPF that it's greatly simplified and
take all benefits whenever BPF code is improved.

Pointed by: jkim
Reviewed by: thompsa

13 years agoChange ambiguous (or invalid, depending on how strict you want to be :)
Dimitry Andric [Wed, 24 Nov 2010 18:35:11 +0000 (18:35 +0000)]
Change ambiguous (or invalid, depending on how strict you want to be :)
assembly instruction "movw %rcx,2(%rax)" to "movw %cx,2(%rax)", since
the intent was to move 16 bits of data, in this case.

Found by: clang
Reviewed by: kib

13 years agoSimplify ng_pipe locking model by relying on the netgraph framework
Marko Zec [Wed, 24 Nov 2010 16:02:58 +0000 (16:02 +0000)]
Simplify ng_pipe locking model by relying on the netgraph framework
to provide serialization of calls into the node, which is accomplished
by markng the node as single-threaded (NGF_FORCE_WRITER).

The price we pay is that each ng_pipe instance now has its own callout
handler which polls for queued frames on each clock tick, as long as
the pipe has any frames in its internal queues.  OTOH, we got rid of
the global ng_pipe mutex, so from now on multiple ng_pipe instances
can operate in parallel.  This change also fixes counting of forwarded
frames when an ng_pipe node is not enforcing any packet impairments.

While here, attempt to improve adherance to style(9) throughout
otherwise mostly unreadable code.

MFC after: 3 days

13 years agoAdd gptboot_enable rc variable, which allows to turn gptboot reporting off in
Pawel Jakub Dawidek [Wed, 24 Nov 2010 15:25:17 +0000 (15:25 +0000)]
Add gptboot_enable rc variable, which allows to turn gptboot reporting off in
case user wants to implement his own actions and doesn't want the attributes to
vanish.

Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
MFC after: 3 days

13 years agoRemove the note about possible unlocking during vunref(9). It might
Konstantin Belousov [Wed, 24 Nov 2010 12:34:25 +0000 (12:34 +0000)]
Remove the note about possible unlocking during vunref(9). It might
only happen if VOP_INACTIVATE() drops the vnode lock, which is quite
unreasonable behaviour for filesystem, and should not be mentioned
in the description of VFS primitives.

MFC after: 1 week

13 years agoAllow shared-locked vnode to be passed to vunref(9).
Konstantin Belousov [Wed, 24 Nov 2010 12:30:41 +0000 (12:30 +0000)]
Allow shared-locked vnode to be passed to vunref(9).
When shared-locked vnode is supplied as an argument to vunref(9) and
resulting usecount is 0, set VI_OWEINACT and do not try to upgrade vnode
lock. The later could cause vnode unlock, allowing the vnode to be
reclaimed meantime.

Tested by: pho
MFC after: 1 week

13 years agoAfter the sleep caused by encountering a busy page, relookup the page.
Konstantin Belousov [Wed, 24 Nov 2010 12:25:17 +0000 (12:25 +0000)]
After the sleep caused by encountering a busy page, relookup the page.

Submitted and reviewed by: alc
Reprted and tested by: pho
MFC after: 5 days

13 years agoo Swap descriptions for net.bpf.bufsize and net.bpf.maxbufsize.
Maxim Konovalov [Wed, 24 Nov 2010 05:50:19 +0000 (05:50 +0000)]
o Swap descriptions for net.bpf.bufsize and net.bpf.maxbufsize.

PR: misc/152531
MFC after: 1 week

13 years agoRedo r166423. It is important not only skip freeing multicast
Gleb Smirnoff [Wed, 24 Nov 2010 05:24:36 +0000 (05:24 +0000)]
Redo r166423. It is important not only skip freeing multicast
entires when underlying interface is detached, but also purge
pointers to them, to avoid double-free in future.

13 years agoAdd shared code glue for new 82580 devices.
Jack F Vogel [Wed, 24 Nov 2010 01:13:55 +0000 (01:13 +0000)]
Add shared code glue for new 82580 devices.

13 years agoClarify a few details about iostat(8) behavior:
Yaroslav Tykhiy [Wed, 24 Nov 2010 00:05:19 +0000 (00:05 +0000)]
Clarify a few details about iostat(8) behavior:

- The default repeat count for iostat(8) is 1 unless there
  was a -w on the command line.

- A -x display doesn't include TTY or CPU stats by default
  but they can be turned on with a -T or -C, respectively.

Submitted by: arundel (initial version)
Reviewed by: arundel
MFC after: 1 week

13 years agosh: Code size optimizations to "stack string" memory allocation:
Jilles Tjoelker [Tue, 23 Nov 2010 22:17:39 +0000 (22:17 +0000)]
sh: Code size optimizations to "stack string" memory allocation:
* Prefer one CHECKSTRSPACE with multiple USTPUTC to multiple STPUTC.
* Add STPUTS macro (based on function) and use it instead of loops that add
  nul-terminated strings to the stack string.

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

13 years agoAdd prototype for InitializeSListHead().
Bernhard Schmidt [Tue, 23 Nov 2010 22:17:06 +0000 (22:17 +0000)]
Add prototype for InitializeSListHead().

13 years ago- New 82580 devices supported
Jack F Vogel [Tue, 23 Nov 2010 22:12:02 +0000 (22:12 +0000)]
- New 82580 devices supported
- Fixes from John Baldwin: vlan shadow tables made per/interface,
  make vlan hw setup only happen when capability enabled, and
  finally, make a tuneable interrupt rate. Thanks John!
- Tweaked watchdog handling to avoid any false positives, now
  detection is in the TX clean path, with only the final check
  and init happening in the local timer.
- limit queues to 8 for all devices, with 82576 or 82580 on
  larger machines it can get greater than this, and it seems
  mostly a resource waste to do so. Even 8 might be high but
  it can be manually reduced.
- use 2k, 4k and now 9k clusters based on the MTU size.
- rework the igb_refresh_mbuf() code, its important to
  make sure the descriptor is rewritten even when reusing
  mbufs since writeback clobbers things.

MFC: in a few days, this delta needs to get to 8.2

13 years agoRemove the description of the link0 link option, since r215297 the master
Marius Strobl [Tue, 23 Nov 2010 22:07:10 +0000 (22:07 +0000)]
Remove the description of the link0 link option, since r215297 the master
media option generally should be used instead. Actually I think the lists
of media types should be removed from the manual pages of MAC drivers
altogether and users just pointed to the output of `ifconfig -m` instead;
even before r215297 there were several outdated descriptions, technically
it's wrong most of the time as not the MAC drivers support these media
types but actually the PHY drivers do and it generally doesn't make sense
to maintain these lists in every manual page of a driver as the media is
auto-detected.

13 years agoAdd a few functions used in newer drivers. Fix RtlCompareMemory() while
Bernhard Schmidt [Tue, 23 Nov 2010 21:49:32 +0000 (21:49 +0000)]
Add a few functions used in newer drivers. Fix RtlCompareMemory() while
here.

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

13 years agoDon't checksum distfiles twice if they match the first time.
Poul-Henning Kamp [Tue, 23 Nov 2010 21:21:56 +0000 (21:21 +0000)]
Don't checksum distfiles twice if they match the first time.

13 years ago- Sprinkle const on tables.
Marius Strobl [Tue, 23 Nov 2010 21:09:42 +0000 (21:09 +0000)]
- Sprinkle const on tables.
- Remove an alpha remnant.
- Minor comment and style fixes.

13 years agoOptimize the ports recurser a bit more.
Poul-Henning Kamp [Tue, 23 Nov 2010 20:47:39 +0000 (20:47 +0000)]
Optimize the ports recurser a bit more.

13 years agosh: Pass multiple bytes at a time to lex.
Jilles Tjoelker [Tue, 23 Nov 2010 20:46:06 +0000 (20:46 +0000)]
sh: Pass multiple bytes at a time to lex.

This speeds up the expansion/arith6.0 test considerably.

13 years agoImprove the ports-dependency resolver by truncating the recursion if
Poul-Henning Kamp [Tue, 23 Nov 2010 20:28:21 +0000 (20:28 +0000)]
Improve the ports-dependency resolver by truncating the recursion if
we already did the target port, and by leaving behind a /tmp/_.plist.dot
which documents which ports pulled in what other ports.

13 years agoFixes a kernel crash when usb module is reloaded after unload that it
Weongyo Jeong [Tue, 23 Nov 2010 20:23:25 +0000 (20:23 +0000)]
Fixes a kernel crash when usb module is reloaded after unload that it
didn't destroy the cdev properly.

Pointy hat to: me
Reported by: Brandon Gooch <jamesbrandongooch at gmail dot com>, jkim

13 years agoMake this printfoutput more verbose.
Attilio Rao [Tue, 23 Nov 2010 18:52:27 +0000 (18:52 +0000)]
Make this printfoutput more verbose.

Sponsored by: Sandvine Incorporated
Submitted by: Sandvine Incorporated
MFC after: 3 days

13 years agoRemove a stale tunable introduced in r215703.
Jung-uk Kim [Tue, 23 Nov 2010 17:28:23 +0000 (17:28 +0000)]
Remove a stale tunable introduced in r215703.

13 years agoReinitialize PAT MSR via pmap_init_pat() while resuming. This function does
Jung-uk Kim [Tue, 23 Nov 2010 16:12:35 +0000 (16:12 +0000)]
Reinitialize PAT MSR via pmap_init_pat() while resuming.  This function does
better job since r215703 and it is safer now.

13 years agoProperly use SCHAR_MAX instead of CHAR_MAX for 0x7f. This fixes operation
Nathan Whitehorn [Tue, 23 Nov 2010 15:08:56 +0000 (15:08 +0000)]
Properly use SCHAR_MAX instead of CHAR_MAX for 0x7f. This fixes operation
of locate(1) on systems on which char is unsigned by default (ARM and
PowerPC).

Reported by: Paul Mather
MFC after: 4 days

13 years agox86/local_apic: use newly added ARAT bit definition
Andriy Gapon [Tue, 23 Nov 2010 14:36:14 +0000 (14:36 +0000)]
x86/local_apic: use newly added ARAT bit definition

ARAT: APIC-Timer-always-running feature.

Suggested by: mav
MFC after: 12 days

13 years agotaskqueue: drop unused tq_name field
Andriy Gapon [Tue, 23 Nov 2010 14:30:22 +0000 (14:30 +0000)]
taskqueue: drop unused tq_name field

tq_name was used write-only and besides it was just a pointer, so it
could point to some garbage in a temporary buffer that's gone.
This change shouldn't change KPI/KBI as struct taskqueue is private to
subr_taskqueue.c.
If we find a need for tq_name it can be resurrected at any moment.
taskqueue_create() interface is preserved for this purpose.

Suggested by: jhb
MFC after: 10 days

13 years agospecialreg.h: add definitions for some useful bits found in CPUID.6 EAX and ECX
Andriy Gapon [Tue, 23 Nov 2010 13:55:30 +0000 (13:55 +0000)]
specialreg.h: add definitions for some useful bits found in CPUID.6 EAX and ECX

CPUID.6 is defined as Thermal and Power Management Leaf by both Intel
and AMD.

Reviewed by: jhb
MFC after: 7 days

13 years agoUpdate MNT_ROOTFS comments after changes in the root mount logic.
Sergey Kandaurov [Tue, 23 Nov 2010 13:49:15 +0000 (13:49 +0000)]
Update MNT_ROOTFS comments after changes in the root mount logic.

Reported by: arundel
Suggested by: marcel (phrasing)
Approved by: kib (mentor)

13 years agoAdd PT_GNU_STACK definition.
Konstantin Belousov [Tue, 23 Nov 2010 12:51:08 +0000 (12:51 +0000)]
Add PT_GNU_STACK definition.

MFC after: 3 days

13 years agoAdd include guards.
Konstantin Belousov [Tue, 23 Nov 2010 12:47:15 +0000 (12:47 +0000)]
Add include guards.

MFC after: 3 days

13 years agoMake the Huawei E1820 work (Emile Coetzee).
Nick Hibma [Tue, 23 Nov 2010 08:15:14 +0000 (08:15 +0000)]
Make the Huawei E1820 work (Emile Coetzee).
Shorten the descriptive strings for Huawei devices. The vendor or
operator name should not be included in the device name.

Submitted by: Emile Coetzee
MFC after: 3 days

13 years agoo NetBSD 5.1 added.
Maxim Konovalov [Tue, 23 Nov 2010 06:31:09 +0000 (06:31 +0000)]
o NetBSD 5.1 added.

13 years agoAdd parentheses for clarity. The parentheses around the two terms of the &&
Colin Percival [Tue, 23 Nov 2010 04:50:01 +0000 (04:50 +0000)]
Add parentheses for clarity.  The parentheses around the two terms of the &&
are unnecessary but I'm leaving them in for the sake of avoiding confusion
(I confuse easily).

Submitted by: bde

13 years agosh: Fix confusing behaviour if chdir succeeded but getcwd failed in cd -P.
Jilles Tjoelker [Mon, 22 Nov 2010 23:49:06 +0000 (23:49 +0000)]
sh: Fix confusing behaviour if chdir succeeded but getcwd failed in cd -P.

If getcwd fails, do not treat this as an error, but print a warning and
unset PWD. This is similar to the behaviour when starting the shell in a
directory whose name cannot be determined.

13 years agoAllow for vlan(4) ifnets to have overlapping unit numbers if they are
Marko Zec [Mon, 22 Nov 2010 23:35:29 +0000 (23:35 +0000)]
Allow for vlan(4) ifnets to have overlapping unit numbers if they are
created in separated vnets.  As a side-effect of having a separated
if_cloner instance for each vnet, all vlan ifnets created in a vnet
will be automatically destroyed when vnet teardown is initiated.

Disallow SIOCSETVLAN and SIOCGETVLAN ioctls on vlan ifnets which are
associated with physical ifnets residing in parent vnets.

This is an interim vlan-specific solution which will be superseded by a
more generic if_cloner V_irtualization change from p4.  For nooptions
VIMAGE builds, this should be a no-op change.

Discussed with: bz
MFC after: 3 days

13 years agoFix small typo.
Alexander Motin [Mon, 22 Nov 2010 23:04:25 +0000 (23:04 +0000)]
Fix small typo.

Submitted by: Artem Belevich

13 years agoRestore the (state) and \n printout when not using -T.
George V. Neville-Neil [Mon, 22 Nov 2010 22:55:43 +0000 (22:55 +0000)]
Restore the (state) and \n printout when not using -T.

Pointed out by: brucec@
MFC after: 3 weeks

13 years ago- Fix and enable support for flow control.
Marius Strobl [Mon, 22 Nov 2010 22:13:26 +0000 (22:13 +0000)]
- Fix and enable support for flow control.
- Partially revert r172334; as it turns out the DELAYs in gem_reset_{r,t}x()
  are actually necessary although bus space barriers and gem_bitwait() are
  used, otherwise the controller may trigger an IOMMU errors on at least
  sparc64. This is in line with what Linux and OpenSolaris do.

13 years ago- Fix and enable support for flow control.
Marius Strobl [Mon, 22 Nov 2010 22:06:30 +0000 (22:06 +0000)]
- Fix and enable support for flow control.
- Fix compilation with CAS_DEBUG defined.

13 years ago- Also probe BCM5214 and BCM5222.
Marius Strobl [Mon, 22 Nov 2010 22:03:11 +0000 (22:03 +0000)]
- Also probe BCM5214 and BCM5222.
- Add some DSP init code for BCM5221. The values derived from Apple's GMAC
  driver and the same init code also exists in Linux's sungem_phy driver.
- Only read media status bits when they are valid.

Obtained from: NetBSD, OpenBSD

13 years agoResume critical PCI devices (and their children) first, then everything else
Jung-uk Kim [Mon, 22 Nov 2010 21:58:00 +0000 (21:58 +0000)]
Resume critical PCI devices (and their children) first, then everything else
later.  This give us better chance to catch device driver problems.

13 years agoRemove kernbb(8) from the source tree.
Ulrich Spörlein [Mon, 22 Nov 2010 21:39:35 +0000 (21:39 +0000)]
Remove kernbb(8) from the source tree.

It's been broken for several years and with all the binutils/toolchain
changes in flight, it might make more sense to put efforts into dtrace and
hwpmc instead.

Discussed with: phk
PR: bin/83558

13 years agoAdd support for flow control.
Marius Strobl [Mon, 22 Nov 2010 21:24:29 +0000 (21:24 +0000)]
Add support for flow control.

Obtained from: NetBSD (partially)

13 years agoGiven that unlike f.e. rgephy(4) these drivers doen't explicitly start an
Marius Strobl [Mon, 22 Nov 2010 21:20:11 +0000 (21:20 +0000)]
Given that unlike f.e. rgephy(4) these drivers doen't explicitly start an
autonegotiation along with manual media selection and also only report flow
control status when BMCR_AUTOEN is set (at least with gentbi(4) determining
the flow control status results in false-positives when not set), use
MIIF_NOMANPAUSE.

13 years agoGiven that unlike f.e. rgephy(4) this driver doesn't explicitly start an
Marius Strobl [Mon, 22 Nov 2010 21:13:42 +0000 (21:13 +0000)]
Given that unlike f.e. rgephy(4) this driver doesn't explicitly start an
autonegotiation along with manual media selection and ukphy_status() also
only reports flow control status when BMCR_AUTOEN is set (at least with
gentbi(4) determining the flow control status results in false-positives
when not set), use MIIF_NOMANPAUSE.

13 years agoAdd missing newlines.
Marius Strobl [Mon, 22 Nov 2010 20:57:44 +0000 (20:57 +0000)]
Add missing newlines.

MFC after: 3 days

13 years agoResurrect amd64 support.
Bernhard Schmidt [Mon, 22 Nov 2010 20:46:38 +0000 (20:46 +0000)]
Resurrect amd64 support.
- Many drivers on amd64 are picking system uptime, interrupt time and ticks
  via global data structure instead of calling functions for performance
  reasons. For now just patch such address so driver will not trigger page
  fault when trying to access such data. In future, additional callout may
  be added to update data in periodic intervals.
- On amd64 we need to allocate "shadow space" on stack before calling any
  function.

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

13 years agoPrefer pmap_extract() over pmap_kextract() as done in MmIsAddressValid().
Bernhard Schmidt [Mon, 22 Nov 2010 20:39:29 +0000 (20:39 +0000)]
Prefer pmap_extract() over pmap_kextract() as done in MmIsAddressValid().
According to the comment for MmIsAddressValid() there are issues on PAE
kernels using pmap_kextract().

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

13 years agoFix linux kernel module breakage introduced in r215675, by including
Dimitry Andric [Mon, 22 Nov 2010 20:23:18 +0000 (20:23 +0000)]
Fix linux kernel module breakage introduced in r215675, by including
<sys/sysent.h>.

Noticed by: many
Pointy hat to: netchild

13 years agohdr.elf.e_ident[EI_OSABI] is not a bitmask so '==' should been used.
Rebecca Cran [Mon, 22 Nov 2010 20:18:46 +0000 (20:18 +0000)]
hdr.elf.e_ident[EI_OSABI] is not a bitmask so '==' should been used.

Reported by: Artem Belevich <fbsdlist at src.cx>

13 years agoFix some more warnings found by clang.
Rebecca Cran [Mon, 22 Nov 2010 20:10:48 +0000 (20:10 +0000)]
Fix some more warnings found by clang.

13 years ago- Disable caches and flush caches/TLBs when we update PAT as we do for MTRR.
Jung-uk Kim [Mon, 22 Nov 2010 19:52:44 +0000 (19:52 +0000)]
- Disable caches and flush caches/TLBs when we update PAT as we do for MTRR.
Flushing TLBs is required to ensure cache coherency according to the AMD64
architecture manual.  Flushing caches is only required when changing from a
cacheable memory type (WB, WP, or WT) to an uncacheable type (WC, UC, or
UC-).  Since this function is only used once per processor during startup,
there is no need to take any shortcuts.
- Leave PAT indices 0-3 at the default of WB, WT, UC-, and UC.  Program 5 as
WP (from default WT) and 6 as WC (from default UC-).  Leave 4 and 7 at the
default of WB and UC.  This is to avoid transition from a cacheable memory
type to an uncacheable type to minimize possible cache incoherency.  Since
we perform flushing caches and TLBs now, this change may not be necessary
any more but we do not want to take any chances.
- Remove Apple hardware specific quirks.  With the above changes, it seems
this hack is no longer needed.
- Improve pmap_cache_bits() with an array to map PAT memory type to index.
This array is initialized early from pmap_init_pat(), so that we do not need
to handle special cases in the function any more.  Now this function is
identical on both amd64 and i386.

Reviewed by: jhb
Tested by: RM (reuf_m at hotmail dot com)
Ryszard Czekaj (rychoo at freeshell dot net)
army.of.root (army dot of dot root at googlemail dot com)
MFC after: 3 days

13 years agoFix use of AND operator: should be bitwise instead of logical.
Rebecca Cran [Mon, 22 Nov 2010 19:40:27 +0000 (19:40 +0000)]
Fix use of AND operator: should be bitwise instead of logical.

13 years agoAfter some off-list discussion, revert a number of changes to the
Dimitry Andric [Mon, 22 Nov 2010 19:32:54 +0000 (19:32 +0000)]
After some off-list discussion, revert a number of changes to the
DPCPU_DEFINE and VNET_DEFINE macros, as these cause problems for various
people working on the affected files.  A better long-term solution is
still being considered.  This reversal may give some modules empty
set_pcpu or set_vnet sections, but these are harmless.

Changes reverted:

------------------------------------------------------------------------
r215318 | dim | 2010-11-14 21:40:55 +0100 (Sun, 14 Nov 2010) | 4 lines

Instead of unconditionally emitting .globl's for the __start_set_xxx and
__stop_set_xxx symbols, only emit them when the set_vnet or set_pcpu
sections are actually defined.

------------------------------------------------------------------------
r215317 | dim | 2010-11-14 21:38:11 +0100 (Sun, 14 Nov 2010) | 3 lines

Apply the STATIC_VNET_DEFINE and STATIC_DPCPU_DEFINE macros throughout
the tree.

------------------------------------------------------------------------
r215316 | dim | 2010-11-14 21:23:02 +0100 (Sun, 14 Nov 2010) | 2 lines

Add macros to define static instances of VNET_DEFINE and DPCPU_DEFINE.

13 years agoThe meshid element is memcpy()'ed into se_meshid if included in either
Bernhard Schmidt [Mon, 22 Nov 2010 19:01:47 +0000 (19:01 +0000)]
The meshid element is memcpy()'ed into se_meshid if included in either
beacon or probe-response frames. Fix the condition by checking for the
the array's content instead of the always existing array itself.

Reviewed by: rpaulo, stefanf
MFC after: 3 days

13 years agoRegenerate manual pages for OpenSSL 0.9.8p.
Simon L. B. Nielsen [Mon, 22 Nov 2010 18:29:00 +0000 (18:29 +0000)]
Regenerate manual pages for OpenSSL 0.9.8p.

13 years agoMerge OpenSSL 0.9.8p into head.
Simon L. B. Nielsen [Mon, 22 Nov 2010 18:23:44 +0000 (18:23 +0000)]
Merge OpenSSL 0.9.8p into head.

Security: CVE-2010-3864
Security: http://www.openssl.org/news/secadv_20101116.txt

13 years agoUse g_eventlock to protect against losing wakeups in the g_event process
Jaakko Heinonen [Mon, 22 Nov 2010 16:47:53 +0000 (16:47 +0000)]
Use g_eventlock to protect against losing wakeups in the g_event process
and replace tsleep(9) with msleep(9) which doesn't use a timeout. The
previously used timeout caused the event process to wake up ten times
per second on an idle system.

one_event() is now called with the topology lock held and it returns
with both the topology and event locks held when there are no more
events in the queue.

Reported by: mav, Marius Nünnerich
Reviewed by: freebsd-geom

13 years agoFix a TSO checksum bug on mxge(4):
Andrew Gallatin [Mon, 22 Nov 2010 16:43:05 +0000 (16:43 +0000)]
Fix a TSO checksum bug on mxge(4):

The Myri10GE NIC will assume all TSO frames contain partial checksum,
and will emit TSO segments with bad TCP checksums if a TSO frame
contains a full checksum.  The mxge driver takes care to make sure
that TSO is disabled when checksum offload is disabled for this
reason.  However, modules that modify packet contents (like pf) may
end up completing a checksum on a TSO frame, leading to the NIC emitting
TSO segments with bad checksums.

To workaround this, restore the partial checksum in the mxge driver
when we're fed a TSO frame with a full checksum.

Reported by: Bob Healey

MFC after: 3 days

13 years agoStyle fix.
Attilio Rao [Mon, 22 Nov 2010 15:28:54 +0000 (15:28 +0000)]
Style fix.

Sponsored by: Sandvine Incorporated
Requested by: jhb
Reviewed by: jhb
MFC after: 1 week
X-MFC: 215544

13 years agoAdd <time.h> for ctime(), which we accidentally picked up through
Dag-Erling Smørgrav [Mon, 22 Nov 2010 14:45:16 +0000 (14:45 +0000)]
Add <time.h> for ctime(), which we accidentally picked up through
<sys/time.h>.

Submitted by: Garrett Cooper <yanegomi@gmail.com>
MFC after: 3 days

13 years agoAdd the ability for GDB to printout the thread name along with other
Attilio Rao [Mon, 22 Nov 2010 14:42:13 +0000 (14:42 +0000)]
Add the ability for GDB to printout the thread name along with other
thread specific informations.

In order to do that, and in order to avoid KBI breakage with existing
infrastructure the following semantic is implemented:
- For live programs, a new member to the PT_LWPINFO is added (pl_tdname)
- For cores, a new ELF note is added (NT_THRMISC) that can be used for
  storing thread specific, miscellaneous, informations. Right now it is
  just popluated with a thread name.

GDB, then, retrieves the correct informations from the corefile via the
BFD interface, as it groks the ELF notes and create appropriate
pseudo-sections.

Sponsored by: Sandvine Incorporated
Tested by: gianni
Discussed with: dim, kan, kib
MFC after: 2 weeks

13 years agoSimilar to mfiutil, drop local definition of powerof2() and use version
John Baldwin [Mon, 22 Nov 2010 14:36:04 +0000 (14:36 +0000)]
Similar to mfiutil, drop local definition of powerof2() and use version
from <sys/param.h> instead.

13 years agoRemove an apparently redundant CURVNET_SET() / CURVNET_RESTORE() pair.
Marko Zec [Mon, 22 Nov 2010 14:16:23 +0000 (14:16 +0000)]
Remove an apparently redundant CURVNET_SET() / CURVNET_RESTORE() pair.

MFC after: 3 days

13 years agoDon't generate input() since it's not used.
Rebecca Cran [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
Alexander Leidinger [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.
Rebecca Cran [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
Marko 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.
Andrey V. Elsukov [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`
Andrey V. Elsukov [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
Alexander Leidinger [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
Alexander Leidinger [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
Colin Percival [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
Alexander Leidinger [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
Colin Percival [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
Kevin Lo [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
David Xu [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 Jeong [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 Jeong [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 agoImport OpenSSL 0.9.8p.
Simon L. B. Nielsen [Sun, 21 Nov 2010 22:45:18 +0000 (22:45 +0000)]
Import OpenSSL 0.9.8p.

13 years agoVarious syntactic tweaks to satisfy style(9). No change to execution.
Stephen 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.
Bjoern A. Zeeb [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:
Rebecca Cran [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 L. B. Nielsen [Sun, 21 Nov 2010 11:50:16 +0000 (11:50 +0000)]
Fix a typo in a comment.

MFC after: 3 days