]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoMerge vendor/file/dist@191739, bringing FILE 5.00 to 8-CURRENT.
obrien [Mon, 4 May 2009 00:37:44 +0000 (00:37 +0000)]
Merge vendor/file/dist@191739, bringing FILE 5.00 to 8-CURRENT.

15 years agoRelax the condition for printing the lost state transition message. The new
thompsa [Sun, 3 May 2009 18:29:04 +0000 (18:29 +0000)]
Relax the condition for printing the lost state transition message. The new
state will be set before the EXT_STATEWAIT flag is cleared and its ok to
transition again at that point.

15 years agoRename statclock_disable variable to atrtcclock_disable that it actually is,
mav [Sun, 3 May 2009 17:47:21 +0000 (17:47 +0000)]
Rename statclock_disable variable to atrtcclock_disable that it actually is,
and hide it inside of atrtc driver. Add new tunable hint.atrtc.0.clock
controlling it. Setting it to 0 disables using RTC clock as stat-/
profclock sources.

Teach i386 and amd64 SMP platforms to emulate stat-/profclocks using i8254
hardclock, when LAPIC and RTC clocks are disabled.

This allows to reduce global interrupt rate of idle system down to about
100 interrupts per core, permitting C3 and deeper C-states provide maximum
CPU power efficiency.

15 years agoMake dev.cpu.X.cx_usage sysctl also report current average of sleep time.
mav [Sun, 3 May 2009 06:25:37 +0000 (06:25 +0000)]
Make dev.cpu.X.cx_usage sysctl also report current average of sleep time.

15 years agoRemove unused variable and fix spelling in comment.
mav [Sun, 3 May 2009 04:58:44 +0000 (04:58 +0000)]
Remove unused variable and fix spelling in comment.

15 years agoBring in Andrew Thompson's port of Sepherosa Ziehau's bwi driver for
imp [Sun, 3 May 2009 04:01:43 +0000 (04:01 +0000)]
Bring in Andrew Thompson's port of Sepherosa Ziehau's bwi driver for
Broadcom BCM43xx chipsets.  This driver uses the v3 firmware that
needs to be fetched separately.  A port will be committed to create
the bwi firmware module.

The driver matches the following chips: Broadcom BCM4301, BCM4307,
BCM4306, BCM4309, BCM4311, BCM4312, BCM4318, BCM4319

The driver works for 802.11b and 802.11g.

Limitations:
This doesn't support the 802.11a or 802.11n portion of radios.
Some BCM4306 and BCM4309 cards don't work with Channel 1, 2 or 3.
Documenation for this firmware is reverse engineered from
 http://bcm.sipsolutions.net/
V4 of the firmware is needed for 11a or 11n support
 http://bcm-v4.sipsolutions.net/
Firmware needs to be fetched from a third party, port to be committed

# I've tested this with a BCM4319 mini-pci and a BCM4318 CardBus card, and
# not connected it to the build until the firmware port is committed.

Obtained from: DragonFlyBSD, //depot/projects/vap
Reviewed by: sam@, thompsa@

15 years agoMFi386: revision 191745
nyan [Sun, 3 May 2009 02:37:13 +0000 (02:37 +0000)]
MFi386: revision 191745

  Add support for using i8254 and rtc timers as event sources for i386 SMP
  system. Redistribute hard-/stat-/profclock events to other CPUs using IPI.

15 years agoAvoid comparing negative signed to positive unsignad values. It was
mav [Sat, 2 May 2009 22:30:33 +0000 (22:30 +0000)]
Avoid comparing negative signed to positive unsignad values. It was
leading to a bug, when C-state does not decrease on sleep shorter then
declared transition latency. Fixing this deprecates workaround for broken
C-states on some hardware.

By the way, change state selecting logic a bit. Instead of last sleep
time use short-time average of it. Global interrupts rate in system is a
quite random value, to corellate subsequent sleeps so directly.

15 years agofix XEN compilation
kmacy [Sat, 2 May 2009 22:22:00 +0000 (22:22 +0000)]
fix XEN compilation

15 years agodon't say "ac WME_AC_BE"; remove "ac"
sam [Sat, 2 May 2009 20:28:55 +0000 (20:28 +0000)]
don't say "ac WME_AC_BE"; remove "ac"

15 years agopromote ieee80211_seq typedef
sam [Sat, 2 May 2009 20:25:22 +0000 (20:25 +0000)]
promote ieee80211_seq typedef

15 years agoo dump tx/rx seq#'s for qos tid's
sam [Sat, 2 May 2009 20:21:21 +0000 (20:21 +0000)]
o dump tx/rx seq#'s for qos tid's
o improve check for when to dump rx ampdu state

15 years agowhitespace
sam [Sat, 2 May 2009 20:18:18 +0000 (20:18 +0000)]
whitespace

15 years agomake superg/fast-frames state dynamically-allocated (and indirect off
sam [Sat, 2 May 2009 20:16:55 +0000 (20:16 +0000)]
make superg/fast-frames state dynamically-allocated (and indirect off
the com structure instead of embedded); this reduces the overhead when
not configured and reduces visibility of the contents

15 years agoCreate a taskqueue for each wireless interface which provides a serialised
thompsa [Sat, 2 May 2009 15:14:18 +0000 (15:14 +0000)]
Create a taskqueue for each wireless interface which provides a serialised
sleepable context for net80211 driver callbacks. This removes the need for USB
and firmware based drivers to roll their own code to defer the chip programming
for state changes, scan requests, channel changes and mcast/promisc updates.
When a driver callback completes the hardware state is now guaranteed to have
been updated and is in sync with net80211 layer.

This nukes around 1300 lines of code from the wireless device drivers making
them more readable and less race prone.

The net80211 layer has been updated as follows
 - all state/channel changes are serialised on the taskqueue.
 - ieee80211_new_state() always queues and can now be called from any context
 - scanning runs from a single taskq function and executes to completion. driver
   callbacks are synchronous so the channel, phy mode and rx filters are
   guaranteed to be set in hardware before probe request frames are
   transmitted.

Help and contributions from Sam Leffler.

Reviewed by: sam

15 years agoAdd support for using i8254 and rtc timers as event sources for i386 SMP
mav [Sat, 2 May 2009 12:59:47 +0000 (12:59 +0000)]
Add support for using i8254 and rtc timers as event sources for i386 SMP
system. Redistribute hard-/stat-/profclock events to other CPUs using IPI.

15 years agoAdd support for using i8254 and rtc timers as event sources for amd64 SMP
mav [Sat, 2 May 2009 12:20:43 +0000 (12:20 +0000)]
Add support for using i8254 and rtc timers as event sources for amd64 SMP
system. Redistribute hard-/stat-/profclock events to other CPUs using IPIs.

15 years agoFix typos:
hrs [Sat, 2 May 2009 11:59:56 +0000 (11:59 +0000)]
Fix typos:
s,Novatal,Novatel,
s,/sys/dev/u3g.c,/sys/dev/usb/serial/u3g.c,

MFC after:      3 days

15 years agoLinux socketpair() call expects explicit specified protocol for
dchagin [Sat, 2 May 2009 10:51:40 +0000 (10:51 +0000)]
Linux socketpair() call expects explicit specified protocol for
AF_LOCAL domain unlike FreeBSD which expects 0 in this case.

Approved by: kib (mentor)
MFC after: 1 month

15 years agoMove extern variable definitions to the header file.
dchagin [Sat, 2 May 2009 10:06:49 +0000 (10:06 +0000)]
Move extern variable definitions to the header file.

Approved by: kib (mentor)
MFC after: 1 month

15 years agoVirgin import of Christos Zoulas's FILE 5.00.
obrien [Sat, 2 May 2009 08:22:49 +0000 (08:22 +0000)]
Virgin import of Christos Zoulas's FILE 5.00.

15 years agoMake indentation more uniform accross vnet container structs.
zec [Sat, 2 May 2009 08:16:26 +0000 (08:16 +0000)]
Make indentation more uniform accross vnet container structs.

This is a purely cosmetic / NOP change.

Reviewed by: bz
Approved by: julian (mentor)
Verified by: svn diff -x -w producing no output

15 years agoMention -h in usage() and manpage. Rename term_{r,e} to term_{so,se}.
rdivacky [Sat, 2 May 2009 07:02:31 +0000 (07:02 +0000)]
Mention -h in usage() and manpage. Rename term_{r,e} to term_{so,se}.

Suggested by: ru
Approved by: ed (mentor)

15 years agoVirgin import of Christos Zoulas's FILE 5.00.
obrien [Sat, 2 May 2009 06:25:51 +0000 (06:25 +0000)]
Virgin import of Christos Zoulas's FILE 5.00.

15 years agoA variety of changes:
alc [Sat, 2 May 2009 06:12:38 +0000 (06:12 +0000)]
A variety of changes:

Reimplement "kernel_pmap" in the standard way.

Eliminate unused variables.  (These are mostly variables that were
discarded by the machine-independent layer after FreeBSD 4.x.)

Properly handle a vm_page_alloc() failure in pmap_init().

Eliminate dead or legacy (FreeBSD 4.x) code.

Eliminate unnecessary page queues locking.

Eliminate some excess white space.

Correct the synchronization of pmap_page_exists_quick().

Tested by: gonzo

15 years agoUnbreak options VIMAGE + nooptions INVARIANTS kernel builds.
zec [Sat, 2 May 2009 05:02:28 +0000 (05:02 +0000)]
Unbreak options VIMAGE + nooptions INVARIANTS kernel builds.

Submitted by: julian
Approved by: julian (mentor)

15 years agoAdd resume methods to i8254 and atrtc devices.
mav [Fri, 1 May 2009 21:43:04 +0000 (21:43 +0000)]
Add resume methods to i8254 and atrtc devices.

15 years agorevert wip
sam [Fri, 1 May 2009 21:31:39 +0000 (21:31 +0000)]
revert wip

15 years agoRename MAC Framework-internal macros used to invoke policy entry points:
rwatson [Fri, 1 May 2009 21:05:40 +0000 (21:05 +0000)]
Rename MAC Framework-internal macros used to invoke policy entry points:

  MAC_BOOLEAN           -> MAC_POLICY_BOOLEAN
  MAC_BOOLEAN_NOSLEEP   -> MAC_POLICY_BOOLEANN_NOSLEEP
  MAC_CHECK             -> MAC_POLICY_CHECK
  MAC_CHECK_NOSLEEP     -> MAC_POLICY_CHECK_NOSLEEP
  MAC_EXTERNALIZE       -> MAC_POLICY_EXTERNALIZE
  MAC_GRANT             -> MAC_POLICY_GRANT
  MAC_GRANT_NOSLEEP     -> MAC_POLICY_GRANT_NOSLEEP
  MAC_INTERNALIZE       -> MAC_POLICY_INTERNALIZE
  MAC_PERFORM           -> MAC_POLICY_PERFORM_CHECK
  MAC_PERFORM_NOSLEEP   -> MAC_POLICY_PERFORM_NOSLEEP

This frees up those macro names for use in wrapping calls into the MAC
Framework from the remainder of the kernel.

Obtained from: TrustedBSD Project

15 years agoSmall addition to r191720.
mav [Fri, 1 May 2009 20:53:37 +0000 (20:53 +0000)]
Small addition to r191720.

Restore previous behaviour for the case of unknown interrupt. Invocation
of IRQ -1 crashes my system on resume. Returning 0, as it was, is not
perfect also, but at least not so dangerous.

15 years agoReorder the bridge add and delete routines to avoid calling ifpromisc() with
thompsa [Fri, 1 May 2009 19:46:42 +0000 (19:46 +0000)]
Reorder the bridge add and delete routines to avoid calling ifpromisc() with
the bridge lock held.

15 years agoo add uath
sam [Fri, 1 May 2009 17:20:16 +0000 (17:20 +0000)]
o add uath
o sort usb wireless drivers

15 years agoadd more tdma fixed rate defaults
sam [Fri, 1 May 2009 17:18:45 +0000 (17:18 +0000)]
add more tdma fixed rate defaults

15 years agoadd uath; sort usb wireless drivers
sam [Fri, 1 May 2009 17:17:06 +0000 (17:17 +0000)]
add uath; sort usb wireless drivers

15 years agoadd uath
sam [Fri, 1 May 2009 17:16:33 +0000 (17:16 +0000)]
add uath

15 years agoadd ralfw
sam [Fri, 1 May 2009 17:15:29 +0000 (17:15 +0000)]
add ralfw

15 years agoUse value -1 instead of 0 for marking unused APIC vectors. This fixes
mav [Fri, 1 May 2009 17:05:49 +0000 (17:05 +0000)]
Use value -1 instead of 0 for marking unused APIC vectors. This fixes
IRQ0 routing on LAPIC-enabled systems.

Add hint.apic.0.clock tunable. Setting it 0 disables using LAPIC timers
as hard-/stat-/profclock sources falling back to using i8254 and rtc timers.

On modern CPUs LAPIC is a part of CPU core which is shutting down when CPU
enters C3 or deeper power state. It makes no problems for interrupt
processing, as chipset wakes up CPU on interrupt triggering. But entering
C3 state kills LAPIC timer and freezes system time, making C3 and deeper
states practically unusable. Using i8254 timer allows to avoid this
problem.

By using i8254 timer my T7700 C2D CPU with UP kernel successfully enters
C3 state, saving more then a Watt of total idle power (>10%) in addition to
all other power-saving techniques.

This technique is not working for SMP yet, as only one CPU receives
timer interrupts. But I think that problem could be fixed by forwarding
interrupts to other CPUs with IPI.

15 years agoReimplement futexes.
dchagin [Fri, 1 May 2009 15:36:02 +0000 (15:36 +0000)]
Reimplement futexes.
Old implemention used Giant to protect the kernel data structures,
but at the same time called malloc(M_WAITOK), that could cause the
calling thread to sleep and lost Giant protection. User-visible
result was the missed wakeup.

New implementation uses one sx lock per futex. The sx protects
the futex structures and allows to sleep while copyin or copyout
are performed.

Unlike linux, we return EINVAL when FUTEX_CMP_REQUEUE operation
is requested and either caller specified futexes are equial or
second futex already exists. This is acceptable since the situation
can only occur from the application error, and glibc falls back to
old FUTEX_WAKE operation when FUTEX_CMP_REQUEUE returns an error.

Approved by: kib (mentor)
MFC after: 1 month

15 years agoLimit scope of acquisition of INP_RLOCK for multicast input filter
bms [Fri, 1 May 2009 11:05:24 +0000 (11:05 +0000)]
Limit scope of acquisition of INP_RLOCK for multicast input filter
to the scope of its use, even though this may thrash the lock if
the INP is referenced for other purposes.

Tested by: David Wolfskill

15 years agoImprove kernel dumping reliability for busy ATA channels:
mav [Fri, 1 May 2009 08:03:46 +0000 (08:03 +0000)]
Improve kernel dumping reliability for busy ATA channels:
 - Generate fake channel interrupts even if channel busy with previous
request to let it finish. Without this, dumping requests were just queued
and never processed.
 - Drop pre-dump requests queue on dumping. ATA code, working in dumping
(interruptless) mode, unable to handle long request queue. Actually, to get
coherent dump we anyway should do as few unrelated actions as possible.

15 years agoSeparate multicast filtering of SysKonnect GENESIS and Marvell
yongari [Fri, 1 May 2009 03:24:03 +0000 (03:24 +0000)]
Separate multicast filtering of SysKonnect GENESIS and Marvell
Yukon from common multicast handling code. Yukon uses hash-based
multicast filtering(big endian form) but GENESIS uses perfect
multicast filtering as well as hash-based one(little endian form).
Due to the differences of multicast filtering there is no much
sense to have a common code.
 o Remove sk_setmulti() and introduce sk_rxfilter_yukon(),
   sk_rxfilter_yukon() that handles multicast filtering setup.
 o Have sk_rxfilter_{yukon, genesis} handle promiscuous mode and
   nuke sk_setpromisc(). This simplifies ioctl handler as well as
   giving a chance to check validity of Rx control register of
   Yukon.
 o Don't reinitialize controller when IFF_ALLMULTI flags is changed.
 o Nuke sk_gmchash(), it's not needed anymore.
 o Always reconfigure Rx control register whenever a new multicast
   filtering condition is changed. This fixes multicast filtering
   setup on Yukon.

PR: kern/134051

15 years agoDon't call the OSD destructor if the data slot is NULL
jamie [Thu, 30 Apr 2009 22:43:21 +0000 (22:43 +0000)]
Don't call the OSD destructor if the data slot is NULL
(since it's already not done on unused slots, which are indistinguishable
to the caller).

Approved by: bz (mentor)

15 years agoWe need to ref the bss node when sending the beacon since it goes through the
thompsa [Thu, 30 Apr 2009 22:30:01 +0000 (22:30 +0000)]
We need to ref the bss node when sending the beacon since it goes through the
normal tx path and will be decremented on the mbuf free.

15 years ago- Fix divide-by-zero panic when SMP kernel is used on UP system[1].
jkim [Thu, 30 Apr 2009 22:10:04 +0000 (22:10 +0000)]
- Fix divide-by-zero panic when SMP kernel is used on UP system[1].
- Avoid possible divide-by-zero panic on SMP system when the CPUID is
disabled, unsupported, or buggy.

Submitted by: pluknet (pluknet at gmail dot com)[1]

15 years agoFix off-by-one bug. S5 state must be checked as well.
jkim [Thu, 30 Apr 2009 18:00:53 +0000 (18:00 +0000)]
Fix off-by-one bug.  S5 state must be checked as well.

15 years agoo OpenBSD 4.5 added.
maxim [Thu, 30 Apr 2009 17:47:52 +0000 (17:47 +0000)]
o OpenBSD 4.5 added.

15 years agoFix style(9).
jkim [Thu, 30 Apr 2009 17:45:43 +0000 (17:45 +0000)]
Fix style(9).

15 years agoPrefer device_printf() over printf() where ever possible.
jkim [Thu, 30 Apr 2009 17:42:11 +0000 (17:42 +0000)]
Prefer device_printf() over printf() where ever possible.

15 years agoGeneral sleep state change clean up.
jkim [Thu, 30 Apr 2009 17:35:44 +0000 (17:35 +0000)]
General sleep state change clean up.

- Probe supported sleep states from acpi_attach() just once and do not
call AcpiGetSleepTypeData() again.  It is redundant because
AcpiEnterSleepStatePrep() does it any way.
- Treat UNKNOWN sleep state as NONE, i.e., "do nothing", and remove obscure
NONE state (ACPI_S_STATES_MAX + 1) to avoid confusions.
- Do not set unsupported sleep states as default button/switch events.
If the default sleep state is not supported, just set it as UNKNOWN/NONE.
- Do not allow sleep state change if the system is not fully up and running.
This should prevent entering S5 state multiple times, which causes strange
behaviours later.
- Make sleep states case-insensitive when they are used with sysctl(8).
For example,

sysctl hw.acpi.lid_switch_state=s1
sysctl hw.acpi.sleep_button_state=none

are now legal and equivalent to the uppercase ones.

15 years agoDo no spam the ifconfig output for the aggregated interface with 'laggdev laggX'.
thompsa [Thu, 30 Apr 2009 14:31:52 +0000 (14:31 +0000)]
Do no spam the ifconfig output for the aggregated interface with 'laggdev laggX'.

15 years agoUse the flowid if its available for selecting the tx port.
thompsa [Thu, 30 Apr 2009 14:25:44 +0000 (14:25 +0000)]
Use the flowid if its available for selecting the tx port.

15 years agoFixed multi-byte character support to actually work.
ru [Thu, 30 Apr 2009 13:53:00 +0000 (13:53 +0000)]
Fixed multi-byte character support to actually work.

15 years agoPermit buiding kernels with options VIMAGE, restricted to only a single
zec [Thu, 30 Apr 2009 13:36:26 +0000 (13:36 +0000)]
Permit buiding kernels with options VIMAGE, restricted to only a single
active network stack instance.  Turning on options VIMAGE at compile
time yields the following changes relative to default kernel build:

1) V_ accessor macros for virtualized variables resolve to structure
fields via base pointers, instead of being resolved as fields in global
structs or plain global variables.  As an example, V_ifnet becomes:

    options VIMAGE:          ((struct vnet_net *) vnet_net)->_ifnet
    default build:           vnet_net_0._ifnet
    options VIMAGE_GLOBALS:  ifnet

2) INIT_VNET_* macros will declare and set up base pointers to be used
by V_ accessor macros, instead of resolving to whitespace:

    INIT_VNET_NET(ifp->if_vnet); becomes

    struct vnet_net *vnet_net = (ifp->if_vnet)->mod_data[VNET_MOD_NET];

3) Memory for vnet modules registered via vnet_mod_register() is now
allocated at run time in sys/kern/kern_vimage.c, instead of per vnet
module structs being declared as globals.  If required, vnet modules
can now request the framework to provide them with allocated bzeroed
memory by filling in the vmi_size field in their vmi_modinfo structures.

4) structs socket, ifnet, inpcbinfo, tcpcb and syncache_head are
extended to hold a pointer to the parent vnet.  options VIMAGE builds
will fill in those fields as required.

5) curvnet is introduced as a new global variable in options VIMAGE
builds, always pointing to the default and only struct vnet.

6) struct sysctl_oid has been extended with additional two fields to
store major and minor virtualization module identifiers, oid_v_subs and
oid_v_mod.  SYSCTL_V_* family of macros will fill in those fields
accordingly, and store the offset in the appropriate vnet container
struct in oid_arg1.
In sysctl handlers dealing with virtualized sysctls, the
SYSCTL_RESOLVE_V_ARG1() macro will compute the address of the target
variable and make it available in arg1 variable for further processing.

Unused fields in structs vnet_inet, vnet_inet6 and vnet_ipfw have
been deleted.

Reviewed by: bz, rwatson
Approved by: julian (mentor)

15 years agoFixed missing dependency.
ru [Thu, 30 Apr 2009 13:30:27 +0000 (13:30 +0000)]
Fixed missing dependency.

15 years agoo Correct ng_hole(4) control messages names.
maxim [Thu, 30 Apr 2009 10:01:13 +0000 (10:01 +0000)]
o Correct ng_hole(4) control messages names.

PR: docs/134100
Submitted by: Eugene Mychlo
MFC after: 1 week

15 years agoo NetBSD 5.0 added.
maxim [Thu, 30 Apr 2009 07:48:49 +0000 (07:48 +0000)]
o NetBSD 5.0 added.
> Description of fields to fill in above:                     76 columns --|
> PR:            If a GNATS PR is affected by the change.
> Submitted by:  If someone else sent in the change.
> Reviewed by:   If someone else reviewed your modification.
> Approved by:   If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after:     N [day[s]|week[s]|month[s]].  Request a reminder email.
> Security:      Vulnerability reference (one per line) or description.
> Empty fields above will be automatically removed.

M    bsd-family-tree

15 years agoReport the next directory being scanned when a ^T is pressed (or any
imp [Thu, 30 Apr 2009 01:24:53 +0000 (01:24 +0000)]
Report the next directory being scanned when a ^T is pressed (or any
SIGINFO).  Provides some progress report for the impatient.  This
won't report that we're blocking in our walk due to disk/network
problems, however.  There's no really good way to report that
condition that I'm aware of...

15 years ago - Fix non-SMP build by encapsulating idle spin logic in a macro.
jeff [Wed, 29 Apr 2009 23:04:31 +0000 (23:04 +0000)]
 - Fix non-SMP build by encapsulating idle spin logic in a macro.

Pointy hat to: me

15 years agoRegen for new jail system calls in r191673.
jamie [Wed, 29 Apr 2009 21:50:13 +0000 (21:50 +0000)]
Regen for new jail system calls in r191673.

Approved by: bz (mentor)

15 years agoAdd experimental support for SATA interface power management.
mav [Wed, 29 Apr 2009 21:17:18 +0000 (21:17 +0000)]
Add experimental support for SATA interface power management.
Feature is controlled by hint.ata.X.pm_level tunable:
 0 - PM disabled, old behaviour, default.
 1 - device is allowed to initiate PM state change, host is passive.
 2 - host initiates PARTIAL state transition every time port is idle.
 3 - host initiates SLUMBER state transition every time port is idle.

PARTIAL state has up to 100us (50us for me) wakeup latency, but for my
ICH8M saves 0.5W of power per drive. SLUMBER state has up to 10ms (3.5ms
for me) wakeup latency, but saves 0.8W of power.

Modes 2 and 3 are implemented only for AHCI driver now.

Interface power management is incompatible with device presence detection
(host receives no signal from drive, so unable to monitor it), so later is
disabled when PM is used.

15 years agoIntroduce the extensible jail framework, using the same "name=value"
jamie [Wed, 29 Apr 2009 21:14:15 +0000 (21:14 +0000)]
Introduce the extensible jail framework, using the same "name=value"
interface as nmount(2).  Three new system calls are added:
* jail_set, to create jails and change the parameters of existing jails.
  This replaces jail(2).
* jail_get, to read the parameters of existing jails.  This replaces the
  security.jail.list sysctl.
* jail_remove to kill off a jail's processes and remove the jail.
Most jail parameters may now be changed after creation, and jails may be
set to exist without any attached processes.  The current jail(2) system
call still exists, though it is now a stub to jail_set(2).

Approved by: bz (mentor)

15 years agoBite the bullet, and make the IPv6 SSM and MLDv2 mega-commit:
bms [Wed, 29 Apr 2009 19:19:13 +0000 (19:19 +0000)]
Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit:
import from p4 bms_netdev.  Summary of changes:

 * Connect netinet6/in6_mcast.c to build.
   The legacy KAME KPIs are mostly preserved.
 * Eliminate now dead code from ip6_output.c.
   Don't do mbuf bingo, we are not going to do RFC 2292 style
   CMSG tricks for multicast options as they are not required
   by any current IPv6 normative reference.
 * Refactor transports (UDP, raw_ip6) to do own mcast filtering.
   SCTP, TCP unaffected by this change.
 * Add ip6_msource, in6_msource structs to in6_var.h.
 * Hookup mld_ifinfo state to in6_ifextra, allocate from
   domifattach path.
 * Eliminate IN6_LOOKUP_MULTI(), it is no longer referenced.
   Kernel consumers which need this should use in6m_lookup().
 * Refactor IPv6 socket group memberships to use a vector (like IPv4).
 * Update ifmcstat(8) for IPv6 SSM.
 * Add witness lock order for IN6_MULTI_LOCK.
 * Move IN6_MULTI_LOCK out of lower ip6_output()/ip6_input() paths.
 * Introduce IP6STAT_ADD/SUB/INC/DEC as per rwatson's IPv4 cleanup.
 * Update carp(4) for new IPv6 SSM KPIs.
 * Virtualize ip6_mrouter socket.
   Changes mostly localized to IPv6 MROUTING.
 * Don't do a local group lookup in MROUTING.
 * Kill unused KAME prototypes in6_purgemkludge(), in6_restoremkludge().
 * Preserve KAME DAD timer jitter behaviour in MLDv1 compatibility mode.
 * Bump __FreeBSD_version to 800084.
 * Update UPDATING.

NOTE WELL:
 * This code hasn't been tested against real MLDv2 queriers
   (yet), although the on-wire protocol has been verified in Wireshark.
 * There are a few unresolved issues in the socket layer APIs to
   do with scope ID propagation.
 * There is a LOR present in ip6_output()'s use of
   in6_setscope() which needs to be resolved. See comments in mld6.c.
   This is believed to be benign and can't be avoided for the moment
   without re-introducing an indirect netisr.

This work was mostly derived from the IGMPv3 implementation, and
has been sponsored by a third party.

15 years agoSome non-functional changes: whitespace, KASSERT strings, declaration order.
jamie [Wed, 29 Apr 2009 18:41:08 +0000 (18:41 +0000)]
Some non-functional changes: whitespace, KASSERT strings, declaration order.

Approved by: bz (mentor)

15 years agoImplement ^T support for rm: now it will report the next file it
imp [Wed, 29 Apr 2009 18:08:18 +0000 (18:08 +0000)]
Implement ^T support for rm: now it will report the next file it
removes when you hit ^T.  This is similar to what's done for cp.  The
signal handler and type definitions for "info" were borrowed directly
from cp.

15 years agoWith the permission of phk@ change the license on remaining jail code
jamie [Wed, 29 Apr 2009 16:02:52 +0000 (16:02 +0000)]
With the permission of phk@ change the license on remaining jail code
to a 2 clause BSD license.

Approved by: phk
Approved by: bz (mentor)

15 years agoAdd MLDv2 protocol header, but do not connect it to the build.
bms [Wed, 29 Apr 2009 11:31:23 +0000 (11:31 +0000)]
Add MLDv2 protocol header, but do not connect it to the build.

15 years agoImport IPv6 SSM module but do not connect it to the build.
bms [Wed, 29 Apr 2009 11:26:45 +0000 (11:26 +0000)]
Import IPv6 SSM module but do not connect it to the build.

15 years agoStub out IN6_LOOKUP_MULTI() for GETSPI requests, for now.
bms [Wed, 29 Apr 2009 11:15:58 +0000 (11:15 +0000)]
Stub out IN6_LOOKUP_MULTI() for GETSPI requests, for now.

This has the effect that IPv6 multicast traffic won't trigger
an SPI allocation when IPSEC is in use, however, this obviously
needs to stomp on locks, and IN6_LOOKUP_MULTI() is about to go away.

This definitely needs to be revisited before 8.x is branched as
a release branch.

15 years agoAdd IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT, in6addr_linklocal_allv2routers
bms [Wed, 29 Apr 2009 10:22:44 +0000 (10:22 +0000)]
Add IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT, in6addr_linklocal_allv2routers
for use by MLDv2.
Add IPv6 SSM socket layer membership vector size constants and
tree bounds.
Remove unreferenced struct ipv6_mreq_source; SSM for IPv6 goes
straight to the RFC 3678 socket options.

15 years agoAdd MLDv2 prototypes and defines.
bms [Wed, 29 Apr 2009 10:20:17 +0000 (10:20 +0000)]
Add MLDv2 prototypes and defines.

15 years agoUse KTR_INET for MROUTING CTRs.
bms [Wed, 29 Apr 2009 10:17:08 +0000 (10:17 +0000)]
Use KTR_INET for MROUTING CTRs.

15 years agoCut over to KTR_INET for CTR.
bms [Wed, 29 Apr 2009 10:14:16 +0000 (10:14 +0000)]
Cut over to KTR_INET for CTR.
For clarity, put pointer incremement/size decrement on own line
when copying out in-mode source filters to userland.

15 years agoDo not assume that ip6_moptions is always set, it is
bms [Wed, 29 Apr 2009 10:13:22 +0000 (10:13 +0000)]
Do not assume that ip6_moptions is always set, it is
a lazy-allocated structure.

15 years agoFix a problem whereby enqueued IGMPv3 filter list changes would be
bms [Wed, 29 Apr 2009 10:12:01 +0000 (10:12 +0000)]
Fix a problem whereby enqueued IGMPv3 filter list changes would be
incorrectly output, if the RB-tree enumeration happened to reuse the
same chain for a mode switch: that is, both ALLOW and BLOCK records
were appended for the same group, in the same mbuf packet chain.

This was introduced during an mbuf chain layout bug fix involving
m_getptr(), which obviously cannot count from offset 0 on the
second pass through the RB-tree when serializing the IGMPv3
group records into the pending mbuf chain.

Cut over to KTR_INET for IGMPv3 CTR usage.

15 years agoSlightly improve gjournal documentation.
trasz [Wed, 29 Apr 2009 10:02:50 +0000 (10:02 +0000)]
Slightly improve gjournal documentation.

Reviewed by: pjd

15 years agoGrab a VIMAGE module ID for MLDv2.
bms [Wed, 29 Apr 2009 09:59:34 +0000 (09:59 +0000)]
Grab a VIMAGE module ID for MLDv2.

15 years agoFix an obvious bug in getsourcefilter()'s use of struct __msfilterreq;
bms [Wed, 29 Apr 2009 09:58:31 +0000 (09:58 +0000)]
Fix an obvious bug in getsourcefilter()'s use of struct __msfilterreq;
the kernel will return in msfr_nsrcs the number of source filters
in-mode for a given multicast group.
However, the filters themselves were never copied out, as the libc
function clobbers this field with zero, causing the kernel to assume
the provided vector of struct sockaddr_storage has zero length.
This bug would only affect users of SSM multicast, which is shimmed
in 7.x.
Picked up during mtest(8) refactoring.

MFC after: 1 day

15 years agoGrab KTR_SPARE1 and KTR_SPARE5 for KTR_INET and KTR_INET6
bms [Wed, 29 Apr 2009 09:54:33 +0000 (09:54 +0000)]
Grab KTR_SPARE1 and KTR_SPARE5 for KTR_INET and KTR_INET6
respectively, as placeholder for future use of CTR() by
the networking code (MLDv2 will be going in shortly).
Mark KTR_SPARE* as being used in fact by cxgb (picked up
on a 'make universe' run).

15 years agoAdd MLDv2 statistic IDs to netstat for IPv6 stack.
bms [Wed, 29 Apr 2009 09:52:04 +0000 (09:52 +0000)]
Add MLDv2 statistic IDs to netstat for IPv6 stack.

15 years agoMerge IPv6-capable mtest(8) from MLDv2 branch.
bms [Wed, 29 Apr 2009 09:50:04 +0000 (09:50 +0000)]
Merge IPv6-capable mtest(8) from MLDv2 branch.

15 years ago - Add support for cpuid leaf 0xb. This allows us to determine the
jeff [Wed, 29 Apr 2009 06:54:40 +0000 (06:54 +0000)]
 - Add support for cpuid leaf 0xb.  This allows us to determine the
   topology of nehalem/corei7 based systems.
 - Remove the cpu_cores/cpu_logical detection from identcpu.
 - Describe the layout of the system in cpu_mp_announce().

Sponsored by:   Nokia

15 years ago - Fix the FBSDID line.
jeff [Wed, 29 Apr 2009 03:26:30 +0000 (03:26 +0000)]
 - Fix the FBSDID line.

15 years ago - Remove the bogus idle thread state code. This may have a race in it
jeff [Wed, 29 Apr 2009 03:15:43 +0000 (03:15 +0000)]
 - Remove the bogus idle thread state code.  This may have a race in it
   and it only optimized out an ipi or mwait in very few cases.
 - Skip the adaptive idle code when running on SMT or HTT cores.  This
   just wastes cpu time that could be used on a busy thread on the same
   core.
 - Rename CG_FLAG_THREAD to CG_FLAG_SMT to be more descriptive.  Re-use
   CG_FLAG_THREAD to mean SMT or HTT.

Sponsored by:   Nokia

15 years agoPrevent a superuser inside a jail from modifying the dedicated
bz [Tue, 28 Apr 2009 21:00:50 +0000 (21:00 +0000)]
Prevent a superuser inside a jail from modifying the dedicated
root cpuset of that jail.
Processes inside the jail will still be able to change child sets.
A superuser outside of a jail will still be able to change the jail cpuset
and thus limit the number of cpus available to the jail.

Problem reported by: 000.fbsd@quip.cz (Miroslav Lachman)
PR: kern/134050
Reviewed by: jeff
MFC after: 3 weeks
X-MFC: backout r191596

15 years ago- Change some softc members to be unsigned where more appropriate.
marius [Tue, 28 Apr 2009 20:49:47 +0000 (20:49 +0000)]
- Change some softc members to be unsigned where more appropriate.
- Add some missing const.
- Move the size of the window spun by the registers to the softc
  as neither using va_mem_size for this nor va_mem_base for the
  start of the bus addresses is appropriate.

MFC after: 1 week

15 years ago- xref ndp(8)
danger [Tue, 28 Apr 2009 20:23:58 +0000 (20:23 +0000)]
- xref ndp(8)

PR: docs/134053
Submitted by: Bob Van Zant <bob@veznat.com>
MFC after: 1 week

15 years ago- fix path for locale.alias
danger [Tue, 28 Apr 2009 20:20:13 +0000 (20:20 +0000)]
- fix path for locale.alias

PR: docs/134070
Submitted by: Frank Shute <frank@shute.org.uk>
MFC after: 1 week

15 years agoChange the test at the beginning of strncmp(), from being if (len - 1) < 0
cognet [Tue, 28 Apr 2009 19:20:13 +0000 (19:20 +0000)]
Change the test at the beginning of strncmp(), from being if (len - 1) < 0
to if (len == 0).
The length is supposed to be unsigned, so len - 1 < 0 won't happen except
if len == 0 anyway, and it would return 0 when it shouldn't, if len was
> INT_MAX.

Spotted out by: Channa <channa kad gmail com>

15 years agoacpi: do not run resume/backout code when entering S0/S5 states
avg [Tue, 28 Apr 2009 11:56:54 +0000 (11:56 +0000)]
acpi: do not run resume/backout code when entering S0/S5 states

This change adds (possibly redundant) early check for invalid
state input parameter (including S0). Handling of S5 request
is reduced to simply calling shutdown_nice(). As a result
control flow of acpi_EnterSleepState is somewhat simplified
and resume/backout half of the function is not executed
for S5 (soft poweroff) request and invalid state requests.

Note: it seems that shutdown_nice may act as nop when initproc
is already initialized (to grab pid of 1), but init process is in
"pre-natal" state.

Tested by: Fabian Keil <fk@fabiankeil.de>
Reviewed by: njl, jkim
Approved by: rpaulo

15 years agoUse the acquired reference to the vmspace instead of direct dereferencing
kib [Tue, 28 Apr 2009 11:45:36 +0000 (11:45 +0000)]
Use the acquired reference to the vmspace instead of direct dereferencing
of p->p_vmspace in a place where it was missed in r191277.

Noted by:  pluknet gmail com

15 years agoFix typo.
kib [Tue, 28 Apr 2009 11:43:35 +0000 (11:43 +0000)]
Fix typo.

15 years agoDon't require packet to match a route (any route; this information wasn't
trasz [Tue, 28 Apr 2009 11:10:33 +0000 (11:10 +0000)]
Don't require packet to match a route (any route; this information wasn't
used anyway, so a typical workaround was to add a dummy route) if it's going
to be sent through IPSec tunnel.

Reviewed by: bz

15 years agoAdded (pre|post)(start|stop) jail hooks. These can be used to run
ru [Tue, 28 Apr 2009 09:45:32 +0000 (09:45 +0000)]
Added (pre|post)(start|stop) jail hooks.  These can be used to run
arbitrary commands (outside the jail) associated with said events,
e.g. to bring up/down CARP interfaces representing services run in
jails.

Reviewed by: simon

15 years agoMFC of tzdata2009g:
edwin [Tue, 28 Apr 2009 08:20:32 +0000 (08:20 +0000)]
MFC of tzdata2009g:

Egypt will have DST till the end of September the coming years.

15 years agofix typo in conditional
kmacy [Mon, 27 Apr 2009 23:43:28 +0000 (23:43 +0000)]
fix typo in conditional

15 years agocollapse the two em_start_locked routines in to one
kmacy [Mon, 27 Apr 2009 22:55:48 +0000 (22:55 +0000)]
collapse the two em_start_locked routines in to one

15 years agosimplify by removing dead code
kmacy [Mon, 27 Apr 2009 22:54:30 +0000 (22:54 +0000)]
simplify by removing dead code

15 years agoremove dead code with reference to IFQ_HANDOFF
kmacy [Mon, 27 Apr 2009 22:53:35 +0000 (22:53 +0000)]
remove dead code with reference to IFQ_HANDOFF

15 years agoreplace IFQ_ENQUEUE + if_start with if_transmit
kmacy [Mon, 27 Apr 2009 22:46:26 +0000 (22:46 +0000)]
replace IFQ_ENQUEUE + if_start with if_transmit

15 years agoreplace IFQ_HANDOFF with if_transmit
kmacy [Mon, 27 Apr 2009 22:45:56 +0000 (22:45 +0000)]
replace IFQ_HANDOFF with if_transmit