]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoMFV of r196350
Edwin Groothuis [Thu, 27 Aug 2009 12:24:21 +0000 (12:24 +0000)]
MFV of r196350

Import of tzdata2009l

- Egypt will go to Wintertime on 21 August 2009
- Heads up for a possible DST in Samoa

14 years agoMFV of r195792:
Edwin Groothuis [Thu, 27 Aug 2009 12:22:50 +0000 (12:22 +0000)]
MFV of r195792:

Import of tzdata2009k to head.

- Changes in Mauritius and Bangladesh
- No leapsecond at the end of December 2009

14 years agoThere's no need for checking result of M_WAITOK allocation.
Pawel Jakub Dawidek [Thu, 27 Aug 2009 08:40:51 +0000 (08:40 +0000)]
There's no need for checking result of M_WAITOK allocation.

14 years agoFix an obvious topology lock leak.
Pawel Jakub Dawidek [Thu, 27 Aug 2009 08:28:34 +0000 (08:28 +0000)]
Fix an obvious topology lock leak.

MFC after: 3 days

14 years agoWhen multiple interfaces exist in the system, with each interface having
Qing Li [Wed, 26 Aug 2009 21:32:50 +0000 (21:32 +0000)]
When multiple interfaces exist in the system, with each interface having
an IPv6 address assigned to it, and if an incoming packet received on
one interface has a packet destination address that belongs to another
interface, the routing table is consulted to determine how to reach this
packet destination. Since the packet destination is an interface address,
the route table will return a host route with the loopback interface as
rt_ifp. The input code must recognize this fact, instead of using the
loopback interface, the input code performs a search to find the right
interface that owns the given IPv6 address.

Reviewed by: bz, gnn, kmacy
MFC after: immediately

14 years ago- Add quirk for Sony DSC digital cameras. This umass devices fail
Stanislav Sedov [Wed, 26 Aug 2009 21:14:28 +0000 (21:14 +0000)]
- Add quirk for Sony DSC digital cameras.  This umass devices fail
  to attach without these quirks applied.

PR: usb/137035
URL: http://lists.freebsd.org/pipermail/freebsd-current/2009-August/010852.html
Reported by: Henri Hennebert <hlh@restart.be>, Andrey V. Elsukov <bu7cher@yandex.ru>
MFC after: 1 week

14 years agoAdd a temporary workaround which just lets init die instead of
Marius Strobl [Wed, 26 Aug 2009 21:10:47 +0000 (21:10 +0000)]
Add a temporary workaround which just lets init die instead of
causing a panic if it is killed due to a unsolved stack overflow
seen very late during shutdown on sparc64 when the gmirror worker
process exists, which is a regression introduced in 8.0.

Reviewed by: kib
MFC after: 3 days

14 years agoHonor the vfs.timestamp_precision sysctl settings for utimes(path, NULL)
Konstantin Belousov [Wed, 26 Aug 2009 14:32:37 +0000 (14:32 +0000)]
Honor the vfs.timestamp_precision sysctl settings for utimes(path, NULL)
and similar calls.

Obtained from: Petr Salinger, Debian GNU/kFreeBSD, Debian bug #489894
MFC after: 3 days

14 years agoAdd IFNET_HOLD reserved pointer value for the ifindex ifnet array,
Robert Watson [Wed, 26 Aug 2009 11:13:10 +0000 (11:13 +0000)]
Add IFNET_HOLD reserved pointer value for the ifindex ifnet array,
which allows an index to be reserved for an ifnet without making
the ifnet available for management operations.  Use this in if_alloc()
while the ifnet lock is released between initial index allocation and
completion of ifnet initialization.

Add ifindex_free() to centralize the implementation of releasing an
ifindex value.  Use in if_free() and if_vmove(), as well as when
releasing a held index in if_alloc().

Reviewed by: bz
MFC after: 3 days

14 years agoDon't try to mmap the contents of empty files. This behaviour was harmless
Colin Percival [Wed, 26 Aug 2009 03:30:06 +0000 (03:30 +0000)]
Don't try to mmap the contents of empty files.  This behaviour was harmless
prior to r195693, since historical behaviour of mmap(2) was to silently
ignore length-zero mmap requests; but mmap now returns EINVAL, which caused
look(1) to emit an error message and fail.

Among other things, this makes `freebsd-update fetch` on a newly installed
8.0-BETA3 system print bogus warning messages.

MFC after: 3 days

14 years agoFix poll() on half-closed sockets, while retaining POLLHUP for fifos.
Jilles Tjoelker [Tue, 25 Aug 2009 21:44:14 +0000 (21:44 +0000)]
Fix poll() on half-closed sockets, while retaining POLLHUP for fifos.

This reverts part of r196460, so that sockets only return POLLHUP if both
directions are closed/error. Fifos get POLLHUP by closing the unused
direction immediately after creating the sockets.

The tools/regression/poll/*poll.c tests now pass except for two other things:
- if POLLHUP is returned, POLLIN is always returned as well instead of only
  when there is data left in the buffer to be read
- fifo old/new reader distinction does not work the way POSIX specs it

Reviewed by: kib, bde

14 years ago- Use the headers from ACPI-CA to define various constants and structures
John Baldwin [Tue, 25 Aug 2009 20:35:57 +0000 (20:35 +0000)]
- Use the headers from ACPI-CA to define various constants and structures
  for table layouts, etc. rather than homerolling our own structures and
  constants in acpidump.h.
- Verify the extended checksum on the RSDP.
- Handle new ACPI 3.0 fields in MADT including X2APIC entries and
  UIDs for local SAPICs.
- Add handling for new ACPI 3.0 flags in the FADT.

Reviewed by: jkim
MFC after: 1 month

14 years agoAdd some tests for poll(2)/shutdown(2) interaction.
Jilles Tjoelker [Tue, 25 Aug 2009 20:33:37 +0000 (20:33 +0000)]
Add some tests for poll(2)/shutdown(2) interaction.

14 years agoBreak out allocation of new ifindex values from if_alloc() and if_vmove(),
Robert Watson [Tue, 25 Aug 2009 20:21:16 +0000 (20:21 +0000)]
Break out allocation of new ifindex values from if_alloc() and if_vmove(),
and centralize in a single function ifindex_alloc().  Assert the
IFNET_WLOCK, and add missing IFNET_WLOCK in if_alloc().  This does not
close all known races in this code.

Reviewed by: bz
MFC after: 3 days

14 years agoLocalize 'e'.
Xin LI [Tue, 25 Aug 2009 20:05:51 +0000 (20:05 +0000)]
Localize 'e'.

Submitted by: dougb

14 years agoFix argument ordering to memcpy as well as the size of the copy in the
Max Laier [Tue, 25 Aug 2009 19:30:32 +0000 (19:30 +0000)]
Fix argument ordering to memcpy as well as the size of the copy in the
(theoretical) case that pfi_buffer_cnt should be greater than ~_max.

Submitted by: pjd
Reviewed by: {krw,sthen,markus}@openbsd.org
MFC after: 3 days

14 years agoAdd a new rc.d script, static_arp, which enables the administrator to
Xin LI [Tue, 25 Aug 2009 19:07:26 +0000 (19:07 +0000)]
Add a new rc.d script, static_arp, which enables the administrator to
statically bind IPv4 <-> MAC address at boot time.

In order to use this, the administrator needs to configure the following
rc.conf(5) variable:

 - static_arp_pairs: A list of names for static bind pairs, and,
 - a series of static_arp_(name): the arguments that is being passed to
   ``arp -S'' operation.

Example:
  static_arp_pairs="gw"
  static_arp_gw="192.168.1.1 00:01:02:03:04:05"

See the rc.conf(5) manual page for more details.

Reviewed by: -rc@
MFC after: 2 weeks

14 years agoIt is possible for all the kthreads to exit (hci modules unloaded) which in
Andrew Thompson [Tue, 25 Aug 2009 16:59:55 +0000 (16:59 +0000)]
It is possible for all the kthreads to exit (hci modules unloaded) which in
turn ends our usb process. This means the proc pointer becomes invalid and will
panic if a new kthread is added. Count the number of threads and clear the proc
pointer on the last one.

Suggested by: julian
MFC after: 3 days

14 years agoFix build broken in r196524.
Gleb Smirnoff [Tue, 25 Aug 2009 14:08:33 +0000 (14:08 +0000)]
Fix build broken in r196524.

14 years agoIntroduce SheevaPlug support.
Rafal Jaworowski [Tue, 25 Aug 2009 10:09:25 +0000 (10:09 +0000)]
Introduce SheevaPlug support.

  - The device is based on Marvell 88F6281 system on chip.
  - More info about the platform at http://www.plugcomputer.org

  - To build the FreeBSD kernel:
    make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG

  - Installation notes at: http://wiki.freebsd.org/FreeBSDMarvell

Submitted by: Michal Hajduk
Obtained from: Semihalf

14 years agoUse locks specific to the lltable code, rather than borrow the ifnet
Robert Watson [Tue, 25 Aug 2009 09:52:38 +0000 (09:52 +0000)]
Use locks specific to the lltable code, rather than borrow the ifnet
list/index locks, to protect link layer address tables.  This avoids
lock order issues during interface teardown, but maintains the bug that
sysctl copy routines may be called while a non-sleepable lock is held.

Reviewed by: bz, kmacy
MFC after: 3 days

14 years agoIntroduce MII_ADDR_BASE option on ARM, which allows to override the default
Rafal Jaworowski [Tue, 25 Aug 2009 09:47:12 +0000 (09:47 +0000)]
Introduce MII_ADDR_BASE option on ARM, which allows to override the default
per platform requirements.

Notes:
- Only used by mge(4) at the moment.

- This is very simplified approach and should be replaced by some long-term
  solution for managing the board/platform configuration (among others the
  MAC-PHY binding info).

Submitted by: Michal Hajduk
Obtained from: Semihalf

14 years agoExclude common Kirkwood settings so they can be shared among various platforms
Rafal Jaworowski [Tue, 25 Aug 2009 09:39:11 +0000 (09:39 +0000)]
Exclude common Kirkwood settings so they can be shared among various platforms
based on this SOC. This is a preliminary step for SheevaPlug support.

Submitted by: Michal Hajduk
Obtained from: Semihalf

14 years agoProperly handle initial state of power mgmt.
Rafal Jaworowski [Tue, 25 Aug 2009 09:35:50 +0000 (09:35 +0000)]
Properly handle initial state of power mgmt.

Modules on Marvell SOC can be selectively PM-disabled, and we must not access
disabled devices' registers (attempt to initialize them) unconditionally, as
this leads to the system hang. This patch introduces graceful handling of the
PM state during devices init.

Submitted by: Michal Hajduk
Obtained from: Semihalf

14 years agoEliminate platform_pmap_init() to simplify Marvell bootstrap code.
Rafal Jaworowski [Tue, 25 Aug 2009 09:30:03 +0000 (09:30 +0000)]
Eliminate platform_pmap_init() to simplify Marvell bootstrap code.

14 years agoDocument that ppp handles pipe(2) descriptors specially in -direct mode.
Brian Somers [Tue, 25 Aug 2009 07:52:09 +0000 (07:52 +0000)]
Document that ppp handles pipe(2) descriptors specially in -direct mode.

MFC after: 3 days

14 years agoRather than havnig enabled/disabled, implement a max queue depth.
Warner Losh [Tue, 25 Aug 2009 06:25:59 +0000 (06:25 +0000)]
Rather than havnig enabled/disabled, implement a max queue depth.
While usually not an issue, this firewalls bugs in the code that may
run us out of memory.

Fix a memory exhaustion in the case where devctl was disabled, but the
link was bouncing.  The check to queue was in the wrong place.

Implement a new sysctl hw.bus.devctl_queue to control the depth.  Make
compatibility hacks for hw.bus.devctl_disable to ease transition.

Reviewed by: emaste@
Approved by: re@ (kib)
MFC after: asap

14 years ago- Add a SIGINFO handler for savecore.
Ulf Lilleengen [Tue, 25 Aug 2009 06:21:45 +0000 (06:21 +0000)]
- Add a SIGINFO handler for savecore.

14 years agoANSIfy functions declarations, adjust prototypes. Rename local variable
Philippe Charnier [Tue, 25 Aug 2009 04:09:09 +0000 (04:09 +0000)]
ANSIfy functions declarations, adjust prototypes. Rename local variable
to not conflict with err().

14 years agoAdd a missing .El.
Xin LI [Tue, 25 Aug 2009 01:04:15 +0000 (01:04 +0000)]
Add a missing .El.

Founded by: make manlint

14 years agoConsider flag == 0 as the same of flag == R_NEXT. This change will restore
Xin LI [Mon, 24 Aug 2009 23:44:07 +0000 (23:44 +0000)]
Consider flag == 0 as the same of flag == R_NEXT.  This change will restore
a historical behavior that has been changed by revision 190491, and has seen
to break exim.

14 years agoFix VESA modes and allow 8bit depth modes.
Xin LI [Mon, 24 Aug 2009 22:35:53 +0000 (22:35 +0000)]
Fix VESA modes and allow 8bit depth modes.

PR: i386/124902
Submitted by: paradox <ddkprog yahoo com>
MFC after: 2 months

14 years agoImprove the case test to detect the presence of lo0 in the list of
Doug Barton [Mon, 24 Aug 2009 22:05:08 +0000 (22:05 +0000)]
Improve the case test to detect the presence of lo0 in the list of
network_interfaces.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>

14 years agoInvoke the recently added mm-mtree.sh release script to store a pre-built
John Baldwin [Mon, 24 Aug 2009 21:56:41 +0000 (21:56 +0000)]
Invoke the recently added mm-mtree.sh release script to store a pre-built
mergemaster mtree database in the 'base' dist.

MFC after: 3 days

14 years agoFix a few issues with the lib32 dist so that it includes ldd32.
John Baldwin [Mon, 24 Aug 2009 21:55:43 +0000 (21:55 +0000)]
Fix a few issues with the lib32 dist so that it includes ldd32.
- Use a better find invocation to purge empty directories from all the dist
  trees during a release build.  The previous version did not purge
  directories whose contents were all empty directories.
- Explicitly blacklist a few files from the lib32 dist instead of using a
  whitelist.  A better longterm solution is to fix the few offenders to not
  install data files during a lib32 install.

MFC after: 3 days

14 years agoTweak the way that the ACPI and ISA bus drivers match hint devices to
John Baldwin [Mon, 24 Aug 2009 21:51:46 +0000 (21:51 +0000)]
Tweak the way that the ACPI and ISA bus drivers match hint devices to
BIOS-enumerated devices:
- Assume a device is a match if the memory and I/O ports match even if the
  IRQ or DRQ is wrong or missing.  Some BIOSes don't include an IRQ for
  the atrtc device for example.
- Add a hack to better match floppy controller devices.  Many BIOSes do not
  include the starting port of the floppy controller listed in the hints
  (0x3f0) in the resources for the device.  So far, however, all the BIOS
  variations encountered do include the 'port + 2' resource (0x3f2), so
  adjust the matching for "fdc" devices to look for 'port + 2'.

Reviewed by: imp
MFC after: 3 days

14 years agoWhen bridging LRO is causing a problem, the believe
Jack F Vogel [Mon, 24 Aug 2009 21:04:51 +0000 (21:04 +0000)]
When bridging LRO is causing a problem, the believe
that it would work as long as all interfaces have TSO
seems to be false, until the matter gets sorted out
just disable LRO completely.

14 years agoA couple of changes: first, make header split on by default
Jack F Vogel [Mon, 24 Aug 2009 20:41:51 +0000 (20:41 +0000)]
A couple of changes:  first, make header split on by default
and remove from its dependency on LRO, my tests have shown
that its always beneficial, even when doing bridging.
Second, fix up a few problems in the statistics code, the
adapter dependencies had gotten lost so some code that should
only run on 82599 was always running, this resulted in bogus
flow control numbers on 82598.

14 years agoDon't try to power down PHY when alc(4) failed to map the device.
Pyun YongHyeon [Mon, 24 Aug 2009 20:37:15 +0000 (20:37 +0000)]
Don't try to power down PHY when alc(4) failed to map the device.
This fixes system crash when mapping alc(4) device failed in device
attach.

Reported by: Jim < stapleton.41 <> gmail DOT com >
MFC after: 3 days

14 years agoAdd RTL8168DP/RTL8111DP device id. While I'm here append "8111D" to
Pyun YongHyeon [Mon, 24 Aug 2009 18:58:13 +0000 (18:58 +0000)]
Add RTL8168DP/RTL8111DP device id. While I'm here append "8111D" to
the description of RTL8168D as RL_HWREV_8168D can be either
RTL8168D or RTL8111D.

PR: kern/137672
MFC after: 3 days

14 years agoUpdate example for RELENG_8.
Ken Smith [Mon, 24 Aug 2009 18:43:22 +0000 (18:43 +0000)]
Update example for RELENG_8.

14 years agoWhen ``ppp -direct'' is invoked by a program that uses pipe(2) to
Brian Somers [Mon, 24 Aug 2009 17:19:45 +0000 (17:19 +0000)]
When ``ppp -direct'' is invoked by a program that uses pipe(2) to
create stdin and stdout, don't blindly try to use stdin as a bi-directional
channel.  Instead, detect the pipe and set up a special exec handler
that indirects write() calls through stdout.

This fixes the problem where ``set device "!ssh -e none host ppp
-direct label"'' no longer works with an openssh-5.2 server side as
that version of openssh ignores the USE_PIPES config setting and
*always* uses pipes (rather than socketpair) for stdin/stdout channels.

MFC after: 3 days

14 years agoWhen realloc()ing device memory for transfer to another ppp process,
Brian Somers [Mon, 24 Aug 2009 17:18:17 +0000 (17:18 +0000)]
When realloc()ing device memory for transfer to another ppp process,
don't continue to use the realloc()d pointer - it might have changed!

Remove some stray diagnostics while I'm here.

MFC after: 3 days

14 years agoFix handling of .note.ABI-tag section for GNU systems [1].
Bjoern A. Zeeb [Mon, 24 Aug 2009 16:19:47 +0000 (16:19 +0000)]
Fix handling of .note.ABI-tag section for GNU systems [1].
Handle GNU/Linux according to LSB Core Specification 4.0,
Chapter 11. Object Format, 11.8. ABI note tag.

Also check the first word of desc, not only name, according to
glibc abi-tags specification to distinguish between Linux and
kFreeBSD.

Add explicit handling for Debian GNU/kFreeBSD, which runs
on our kernels as well [2].

In {amd64,i386}/trap.c, when checking osrel of the current process,
also check the ABI to not change the signal behaviour for Linux
binary processes, now that we save an osrel version for all three
from the lists above in struct proc [2].

These changes make it possible to run FreeBSD, Debian GNU/kFreeBSD
and Linux binaries on the same machine again for at least i386 and
amd64, and no longer break kFreeBSD which was detected as GNU(/Linux).

PR: kern/135468
Submitted by: dchagin [1] (initial patch)
Suggested by: kib [2]
Tested by: Petr Salinger (Petr.Salinger seznam.cz) for kFreeBSD
Reviewed by: kib
MFC after: 3 days

14 years ago- Update config to doxygen 1.5.2 (I use this with 1.5.9).
Alexander Leidinger [Mon, 24 Aug 2009 13:10:55 +0000 (13:10 +0000)]
- Update config to doxygen 1.5.2 (I use this with 1.5.9).
- Add linprocfs and linsysfs to the linuxulator dox.
- Take the generated includes from the .m files from a subdirectory
  instead of putting everything into $(.OBJDIR). This imporves the
  human readbility of the source directory contents a lot, if you do not
  create a separate OBJDIR.
- Assume UTF-8 encoding for every input file.
- Strip the source and dest path from the output, we are not interested
  in the absolute location on the machine where the docs are created,
  relative the the root of the FreeBSD source is what interests us.
- Exclude .svn directories.
- Switch to alphabetic index.
- Use one line per INCLUDE_PATH member in the common dox-config.
- Bump the __FreeBSD__ version to 9. [MFC: to 8]
- Switch from hardcoded .m files to an run-time generated one. Takes
  a little bit more time to get started with actual work, but at least
  is more future-proof. If you generate dox for all subsystems, the
  time to find all .m files in the source is magnitutes lower than
  producing the docs.
- Make the *DEST_PATH overidable from the environment. This allows to
  produce the output directly in the docroot of a webserver.
- Fix the path when telling the user where he can find the API docs.

MFC after: 1 month (after 8.0)

14 years agoMake if_grow static -- it's not used outside of if.c, and with the
Robert Watson [Mon, 24 Aug 2009 12:52:05 +0000 (12:52 +0000)]
Make if_grow static -- it's not used outside of if.c, and with the
internals destined to change, it's better if it remains that way.

MFC after: 3 days

14 years agoThis fixes a bug where the value set by SCTP_PARTIAL_DELIVERY_POINT
Michael Tuexen [Mon, 24 Aug 2009 11:46:40 +0000 (11:46 +0000)]
This fixes a bug where the value set by SCTP_PARTIAL_DELIVERY_POINT
was not honored, if the socket buffer size was not 4 times that large.

Approved by: rrs (mentor)
MFC after: 3 days.

14 years agoOur implementation of granpt(3) could be valid in the future.
Ed Schouten [Mon, 24 Aug 2009 11:16:44 +0000 (11:16 +0000)]
Our implementation of granpt(3) could be valid in the future.

When I wrote the pseudo-terminal driver for the MPSAFE TTY code, Robert
Watson and I agreed the best way to implement this, would be to let
posix_openpt() create a pseudo-terminal with proper permissions in place
and let grantpt() and unlockpt() be no-ops.

This isn't valid behaviour when looking at the spec. Because I thought
it was an elegant solution, I filed a bug report at the Austin Group
about this. In their last teleconference, they agreed on this subject.
This means that future revisions of POSIX may allow grantpt() and
unlockpt() to be no-ops if an open() on /dev/ptmx (if the implementation
has such a device) and posix_openpt() already do the right thing.

I'd rather put this in the manpage, because simply mentioning we don't
comply to any standard makes it look worse than it is. Right now we
don't, but at least we took care of it.

Approved by: re (kib)
MFC after: 3 days

14 years agoThis fixes two bugs in the NR-Sack code:
Randall Stewart [Mon, 24 Aug 2009 11:13:32 +0000 (11:13 +0000)]
This fixes two bugs in the NR-Sack code:
 1) When calculating the table offset for sliding the sack
    array, the two byte values must be "ored" together in order
    for us to do the correct sliding of the arrays.
 2) We were NOT properly doing CC and other changes to things only
    NR-Sacked. The solution here is to make a separate function that
    will actually do both CC/updates and free things if its NR sack'd.
    This actually shrinks out common code from three places (much better).

MFC after: 3 days

14 years agoAllow multiple console devices per driver without insane code duplication.
Ed Schouten [Mon, 24 Aug 2009 10:53:30 +0000 (10:53 +0000)]
Allow multiple console devices per driver without insane code duplication.

Say, a driver wants to have multiple console devices to pick from, you
would normally write down something like this:

CONSOLE_DRIVER(dev1);
CONSOLE_DRIVER(dev2);

Unfortunately, this means that you have to declare 10 cn routines,
instead of 5. It also isn't possible to initialize cn_arg on beforehand.

I noticed this restriction when I was implementing some of the console
bits for my vt(4) driver in my newcons branch. I have a single set of cn
routines (termcn_*) which are shared by all vt(4) console devices.

In order to solve this, I'm adding a separate consdev_ops structure,
which contains all the function pointers. This structure is referenced
through consdev's cn_ops field.

While there, I'm removing CONS_DRIVER() and cn_checkc, which have been
deprecated for years. They weren't used throughout the source, until the
Xen console driver showed up. CONSOLE_DRIVER() has been changed to do
the right thing. It now declares both the consdev and consdev_ops
structure and ties them together. In other words: this change doesn't
change the KPI for drivers that used the regular way of declaring
console devices.

If drivers want to use multiple console devices, they can do this as
follows:

static const struct consdev_ops mydriver_cnops = {
.cn_probe = mydriver_cnprobe,
...
};
static struct mydriver_softc cons0_softc = {
...
};
CONSOLE_DEVICE(cons0, mydriver_cnops, &cons0_softc);
static struct mydriver_softc cons1_softc = {
...
};
CONSOLE_DEVICE(cons1, mydriver_cnops, &cons1_softc);

Obtained from: //depot/user/ed/newcons/...

14 years agoWhen "jail -c vnet" request fails, the current code actually creates and
Marko Zec [Mon, 24 Aug 2009 10:16:19 +0000 (10:16 +0000)]
When "jail -c vnet" request fails, the current code actually creates and
leaves behind an orphaned vnet.  This change ensures that such vnets get
released.

This change affects only options VIMAGE builds.

Submitted by: jamie
Discussed with: bz
Approved by: re (rwatson), julian (mentor)
MFC after: 3 days

14 years agoWhen moving ifnets from one vnet to another, and the ifnet
Marko Zec [Mon, 24 Aug 2009 10:14:09 +0000 (10:14 +0000)]
When moving ifnets from one vnet to another, and the ifnet
has ifaddresses of AF_LINK type which thus have an embedded
if_index "backpointer", we must update that if_index backpointer
to reflect the new if_index that our ifnet just got assigned.

This change affects only options VIMAGE builds.

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

14 years agoFix NFS panics with options VIMAGE kernels by apropriately setting curvnet
Marko Zec [Mon, 24 Aug 2009 10:09:30 +0000 (10:09 +0000)]
Fix NFS panics with options VIMAGE kernels by apropriately setting curvnet
context inside the RPC code.

Temporarily set td's cred to mount's cred before calling socreate() via
__rpc_nconf2socket().

Submitted by: rmacklem (in part)
Reviewed by: rmacklem, rwatson
Discussed with: dfr, bz
Approved by: re (rwatson), julian (mentor)
MFC after: 3 days

14 years agoIntroduce a div_destroy() function which takes over per-vnet cleanup tasks
Marko Zec [Mon, 24 Aug 2009 10:06:02 +0000 (10:06 +0000)]
Introduce a div_destroy() function which takes over per-vnet cleanup tasks
from the existing modevent / MOD_UNLOAD handler, and register div_destroy()
in protosw as per-vnet .pr_destroy() handler for options VIMAGE builds.  In
nooptions VIMAGE builds, div_destroy() will be invoked from the modevent
handler, resulting in effectively identical operation as it was prior this
change.  div_destroy() also tears down hashtables used by ipdivert, which
were previously left behind on ipdivert kldunloads.

For options VIMAGE builds only, temporarily disable kldunloading of ipdivert,
because without introducing additional locking logic it is impossible to
atomically check whether all ipdivert instances in all vnets are idle, and
proceed with cleanup without opening a race window for a vnet to open an
ipdivert socket while ipdivert tear-down is in progress.

While here, staticize div_init(), because it is not used outside of
ip_divert.c.

In cooperation with: julian
Approved by: re (rwatson), julian (mentor)
MFC after: 3 days

14 years agoWhen registering a protocol to an existing protocol domain via
Marko Zec [Mon, 24 Aug 2009 10:03:41 +0000 (10:03 +0000)]
When registering a protocol to an existing protocol domain via
pf_proto_register(), iterate over all existing vnets to call protosw_init()
and thus the appropriate .pr_init() handler in the context of each vnet.
NB in the future we probably want to separate pr_init() handlers into
two, i.e. per-vnet and global, functions.

This change has no impact on nooptions VIMAGE builds.

Approved by: re (rwatson), julian (mentor)
MFC after: 3 days

14 years agoUnhardcode 0x100 inside kbdcontrol.
Ed Schouten [Mon, 24 Aug 2009 09:17:01 +0000 (09:17 +0000)]
Unhardcode 0x100 inside kbdcontrol.

In preparation for Unicode support for the keyboard layer, we'd better
get rid of all the hardcoded 0x100/0xff constants in kbdcontrol.
Instead, add a flag called SPECIAL stored in the top bit of the integer.

Adding Unicode support is very simple now; just change u_char map[] to
u_int map[] in keyent_t, change the bounds checking in kbdcontrol to
0x1FFFFF and modify the ioctls to allow loading these new keymaps.

14 years agoCleanups to the Xen console driver:
Ed Schouten [Mon, 24 Aug 2009 08:27:42 +0000 (08:27 +0000)]
Cleanups to the Xen console driver:

- Use CONSOLE_DRIVER() instead of the deprecated CONS_DRIVER() declaration.

- This means we cannot use cn_checkc anymore, which is supposed to do
  the same as cn_getc nowadays. Remove the cn_getc implementation (that
  was never being called) and rename cn_checkc to cn_getc.

- Don't run-time patch cn_putc, but add the logic to xc_cnputc().

This means I could do some cleanups to our console code...

Tested by: nobody on hackers@

14 years ago - Patch to allow USB controller to resume operation after
Alfred Perlstein [Mon, 24 Aug 2009 05:05:38 +0000 (05:05 +0000)]
     - Patch to allow USB controller to resume operation after
         being polled.

         - Remove the need for Giant from the USB HUB driver.

         - Leave device unconfigured instead of disabling the USB port
           when Huawei Autoinstall disk detection triggers. This should
           fix problems that the Huawei device is not detected after
           Autoinstall eject is issued.
         - Reported by: Nikolay Antsiferov

         - Fix memory use after free race for USB character devices.
         - Reported by: Lucius Windschuh

         - Factor out the enumeration lock into three functions to make the
         coming newbus lock conversion more easy.
          - usbd_enum_lock
          - usbd_enum_unlock
          - usbd_enum_is_locked

Submitted by: hps

14 years agoRemove redundant locking.
Alfred Perlstein [Mon, 24 Aug 2009 05:03:59 +0000 (05:03 +0000)]
Remove redundant locking.

Submitted by: hps

14 years agoAdd a reminder comment to optimize bus_dmamap_sync calls.
Alfred Perlstein [Mon, 24 Aug 2009 05:03:30 +0000 (05:03 +0000)]
Add a reminder comment to optimize bus_dmamap_sync calls.

Submitted by: hps

14 years agoAdd mass storage quirks.
Alfred Perlstein [Mon, 24 Aug 2009 05:02:36 +0000 (05:02 +0000)]
Add mass storage quirks.

PR:             usb/137138,usb/137226,usb/137789,usb/135372

Submitted by: hps

14 years ago - fix uvisor support, mostly correct buffer sizes used.
Alfred Perlstein [Mon, 24 Aug 2009 05:01:40 +0000 (05:01 +0000)]
     - fix uvisor support, mostly correct buffer sizes used.
         - correct device info flag for SONY Cli NR70V

Reported by: Marc Fonvieille
Submitted by: hps

14 years ago - Fix false positive uipaq probe
Alfred Perlstein [Mon, 24 Aug 2009 05:01:06 +0000 (05:01 +0000)]
     - Fix false positive uipaq probe

Reported by: Alexander Motin <mav@freebsd.org>

Submitted by: hps

14 years ago - fix CDC ethernet matching order so that the match flags get correct.
Alfred Perlstein [Mon, 24 Aug 2009 05:00:33 +0000 (05:00 +0000)]
     - fix CDC ethernet matching order so that the match flags get correct.

Reported by: Juergen Lock

Submitted by: hps

14 years agoWe used force all of the GPIO pins low first and then
Alfred Perlstein [Mon, 24 Aug 2009 05:00:07 +0000 (05:00 +0000)]
We used force all of the GPIO pins low first and then
enable the ones we want. This has been changed to better
match the ADMtek's reference design to avoid setting the
power-down configuration line of the PHY at the same time
it is reset.

Submitted by: John Hood via hps

14 years ago - FIFO's are always opened separately in read and write
Alfred Perlstein [Mon, 24 Aug 2009 04:59:09 +0000 (04:59 +0000)]
    - FIFO's are always opened separately in read and write
        direction even if the actual device is opened for read and
        write. Fix fflags check so that the UFM and URIO drivers work.
Reported by: Krassimir Slavchev

Submitted by: hps

14 years ago - patch for cordump slowdown. Avoid using DELAY(1000) when no
Alfred Perlstein [Mon, 24 Aug 2009 04:58:42 +0000 (04:58 +0000)]
    - patch for cordump slowdown. Avoid using DELAY(1000) when no
        keys are pressed.
        - Reported by: Various people

        - add sysctl to disable keyboard led control request
        - Reported by: Yoshihiro Ota

        - Save system CPU usage: Patch to stop keyboard timer when no
        keys are pressed.

Submitted by: hps
MFC after: 3 days

14 years ago - allow disabling "root_mount_hold()" by
Alfred Perlstein [Mon, 24 Aug 2009 04:58:11 +0000 (04:58 +0000)]
    - allow disabling "root_mount_hold()" by
        setting a sysctl/tunable at boot
        - remove some redundant initial explore code

Submitted by: hps

14 years agoRemove redundant Giant reference. Giant will be dropped
Alfred Perlstein [Mon, 24 Aug 2009 04:57:48 +0000 (04:57 +0000)]
Remove redundant Giant reference. Giant will be dropped
automatically when the mutex argument is NULL.

Reported by: Various people
Submitted by: hps

14 years agoOops. Needed to adjust a little bit more of the line for packages-8-stable
Ken Smith [Mon, 24 Aug 2009 03:04:13 +0000 (03:04 +0000)]
Oops.  Needed to adjust a little bit more of the line for packages-8-stable
now that we're prepping for 8.0's release.

Submitted by: pluknet at gmail dot com
Pointy hat: kensmith

14 years agoKDB needs <machine/db_machdep.h>, so move it under #ifdef KDB.
Olivier Houchard [Sun, 23 Aug 2009 23:37:53 +0000 (23:37 +0000)]
KDB needs <machine/db_machdep.h>, so move it under #ifdef KDB.
While I'm there, remove dead code, we will never support acorn26.

14 years agosh: Fix crash when undefining or redefining a currently executing function.
Jilles Tjoelker [Sun, 23 Aug 2009 21:09:46 +0000 (21:09 +0000)]
sh: Fix crash when undefining or redefining a currently executing function.

Add a reference count to function definitions.
Memory may leak if multiple SIGINTs arrive in interactive mode,
this will be fixed later by changing SIGINT handling.

PR: bin/137640

14 years agoRather than using IFNET_RLOCK() when iterating over (and modifying) the
Robert Watson [Sun, 23 Aug 2009 21:00:21 +0000 (21:00 +0000)]
Rather than using IFNET_RLOCK() when iterating over (and modifying) the
ifnet list during if_ef load, directly acquire the ifnet_sxlock
exclusively.  That way when if_alloc() recurses the lock, it's a write
recursion rather than a read->write recursion.

This code structure is arguably a bug, so add a comment indicating that
this is the case.  Post-8.0, we should fix this, but this commit
resolves panic-on-load for if_ef.

Discussed with: bz, julian
Reported by: phk
MFC after: 3 days

14 years agoRework global locks for interface list and index management, correcting
Robert Watson [Sun, 23 Aug 2009 20:40:19 +0000 (20:40 +0000)]
Rework global locks for interface list and index management, correcting
several critical bugs, including race conditions and lock order issues:

Replace the single rwlock, ifnet_lock, with two locks, an rwlock and an
sxlock.  Either can be held to stablize the lists and indexes, but both
are required to write.  This allows the list to be held stable in both
network interrupt contexts and sleepable user threads across sleeping
memory allocations or device driver interactions.  As before, writes to
the interface list must occur from sleepable contexts.

Reviewed by: bz, julian
MFC after: 3 days

14 years agoAllow pty(4) to be loaded as a kld.
Ed Schouten [Sun, 23 Aug 2009 20:26:09 +0000 (20:26 +0000)]
Allow pty(4) to be loaded as a kld.

Unfortunately, the wrappers that are present in pts(4) don't have the
mechanics to allow pty(4) to be unloaded safely, so I'm forcing this kld
to return EBUSY. This also means we have to enable some extra code in
pts(4) unconditionally.

Proposed by: rwatson

14 years agoNo need to remove the same flag multiple times.
Olivier Houchard [Sun, 23 Aug 2009 19:54:36 +0000 (19:54 +0000)]
No need to remove the same flag multiple times.

14 years agoPrior to the dire warning about values of network_interfaces other than
Doug Barton [Sun, 23 Aug 2009 19:52:47 +0000 (19:52 +0000)]
Prior to the dire warning about values of network_interfaces other than
AUTO the biggest mistake users made was leaving lo0 off the list. Since
lo0 is effectively mandatory, check for it and add it to the list if
it's not there.

14 years agoObsoleteFiles.inc:
Antoine Brodin [Sun, 23 Aug 2009 18:28:58 +0000 (18:28 +0000)]
ObsoleteFiles.inc:
  kthread_create(9) was resurrected as a mlink to kproc(9)

14 years agoRemove (c) line.
Ivan Voras [Sun, 23 Aug 2009 18:15:13 +0000 (18:15 +0000)]
Remove (c) line.

Requested by: pjd
Approved by: gnn (mentor)
MFC after: 1 month

14 years ago- Add AS lookup functionality to traceroute6(8) as well.
Hajimu UMEMOTO [Sun, 23 Aug 2009 17:00:16 +0000 (17:00 +0000)]
- Add AS lookup functionality to traceroute6(8) as well.
- Support for IPv6 transport for AS lookup.
- Introduce $RA_SERVER to set whois server.
- Support for 4 byte ASN.
- ANSIfy function declaration in as.c.

Tested by: IHANet folks.

14 years agoMerge DTLS fixes from vendor-crypto/openssl/dist:
Simon L. B. Nielsen [Sun, 23 Aug 2009 16:29:47 +0000 (16:29 +0000)]
Merge DTLS fixes from vendor-crypto/openssl/dist:

- Fix memory consumption bug with "future epoch" DTLS records.
- Fix fragment handling memory leak.
- Do not access freed data structure.
- Fix DTLS fragment bug - out-of-sequence message handling which could
  result in NULL pointer dereference in
  dtls1_process_out_of_seq_message().

Note that this will not get FreeBSD Security Advisory as DTLS is
experimental in OpenSSL.

MFC after: 1 week
Security: CVE-2009-1377 CVE-2009-1378 CVE-2009-1379 CVE-2009-1387

14 years agoEnable _DIRENT_HAVE_D_TYPE so wpa_cli scans directories properly
Sam Leffler [Sun, 23 Aug 2009 16:04:10 +0000 (16:04 +0000)]
Enable _DIRENT_HAVE_D_TYPE so wpa_cli scans directories properly
for it's unix domain socket.  Before this change wpa_cli would take
the first file in the directory that was not "." or "..".

Submitted by: Brandon Gooch <jamesbrandongooch@gmail.com>
MFC after: 3 days

14 years agoAdd GET_PARAM support for Z pipes.
Robert Noland [Sun, 23 Aug 2009 15:02:58 +0000 (15:02 +0000)]
Add GET_PARAM support for Z pipes.

This is needed for occulsion queries on rv530 chips.

MFC after: 2 weeks

14 years agoAdd kernel support for Radeon R6/7xx 3D.
Robert Noland [Sun, 23 Aug 2009 14:55:57 +0000 (14:55 +0000)]
Add kernel support for Radeon R6/7xx 3D.

You will still need Mesa from git and possibly an updated DDX driver,
but this is working fairly well now.

MFC after: 2 weeks

14 years agoUse a more appropriate choice of words.
Joseph Koshy [Sun, 23 Aug 2009 14:48:25 +0000 (14:48 +0000)]
Use a more appropriate choice of words.

Submitted by: danfe

14 years agoImport DTLS fix from upstream OpenSSL 0.9.8 branch:
Simon L. B. Nielsen [Sun, 23 Aug 2009 14:39:15 +0000 (14:39 +0000)]
Import DTLS fix from upstream OpenSSL 0.9.8 branch:

Fix DTLS fragment bug - out-of-sequence message handling which could
result in NULL pointer dereference in
dtls1_process_out_of_seq_message().

Note that this will not get FreeBSD Security Advisory as DTLS is
experimental in OpenSSL.

Security: CVE-2009-1387
Obtained from: OpenSSL CVS
http://cvs.openssl.org/chngview?cn=17958

14 years agoAdd a read only sysctl tracking the hw.drm.msi tunable.
Robert Noland [Sun, 23 Aug 2009 14:33:12 +0000 (14:33 +0000)]
Add a read only sysctl tracking the hw.drm.msi tunable.

MFC after: 2 weeks

14 years agoClean up the handling of device minors
Robert Noland [Sun, 23 Aug 2009 14:31:20 +0000 (14:31 +0000)]
Clean up the handling of device minors

Submitted by: Ed
MFC after: 2 weeks

14 years agoClean up the locking in drm_alloc_resource()
Robert Noland [Sun, 23 Aug 2009 14:27:46 +0000 (14:27 +0000)]
Clean up the locking in drm_alloc_resource()

MFC after: 2 weeks

14 years agoImport DTLS fix from upstream OpenSSL 0.9.8 branch:
Simon L. B. Nielsen [Sun, 23 Aug 2009 14:15:28 +0000 (14:15 +0000)]
Import DTLS fix from upstream OpenSSL 0.9.8 branch:

Do not access freed data structure.

Note that this will not get FreeBSD Security Advisory as DTLS is
experimental in OpenSSL.

Security: CVE-2009-1379
Obtained from: OpenSSL CVS
http://cvs.openssl.org/chngview?cn=18156

14 years agoImport DTLS fix from upstream OpenSSL 0.9.8 branch:
Simon L. B. Nielsen [Sun, 23 Aug 2009 14:12:01 +0000 (14:12 +0000)]
Import DTLS fix from upstream OpenSSL 0.9.8 branch:

Fix fragment handling memory leak.

Note that this will not get FreeBSD Security Advisory as DTLS is
experimental in OpenSSL.

Security: CVE-2009-1378
Obtained from: OpenSSL CVS
http://cvs.openssl.org/filediff?f=openssl/ssl/d1_both.c&v1=1.4.2.13&v2=1.4.2.15

14 years agoImport DTLS fix from upstream OpenSSL 0.9.8 branch:
Simon L. B. Nielsen [Sun, 23 Aug 2009 13:58:25 +0000 (13:58 +0000)]
Import DTLS fix from upstream OpenSSL 0.9.8 branch:

Fix memory consumption bug with "future epoch" DTLS records.

Note that this will not get FreeBSD Security Advisory as DTLS is
experimental in OpenSSL.

Security: CVE-2009-1377
Obtained from: OpenSSL CVS
http://cvs.openssl.org/chngview?cn=18187

14 years agoFix the conformance of poll(2) for sockets after r195423 by
Konstantin Belousov [Sun, 23 Aug 2009 12:44:15 +0000 (12:44 +0000)]
Fix the conformance of poll(2) for sockets after r195423 by
returning POLLHUP instead of POLLIN for several cases. Now, the
tools/regression/poll results for FreeBSD are closer to that of the
Solaris and Linux.

Also, improve the POSIX conformance by explicitely clearing POLLOUT
when POLLHUP is reported in pollscan(), making the fix global.

Submitted by: bde
Reviewed by: rwatson
MFC after: 1 week

14 years agoAdd support for diffs generated by Perforce.
Ed Schouten [Sun, 23 Aug 2009 12:23:24 +0000 (12:23 +0000)]
Add support for diffs generated by Perforce.

It basically picks the filenames from the "====" line and strips off the
# revision number.

14 years ago- Hide ZFS kernel threads under zfskern process.
Pawel Jakub Dawidek [Sun, 23 Aug 2009 11:33:46 +0000 (11:33 +0000)]
- Hide ZFS kernel threads under zfskern process.
- Use better (shorter) threads names:
'zvol:worker zvol/tank/vol00' -> 'zvol tank/vol00'
'vdev:worker da0' -> 'vdev da0'

14 years agoSet priority of vdev_geom threads and zvol threads to PRIBIO.
Pawel Jakub Dawidek [Sun, 23 Aug 2009 11:27:08 +0000 (11:27 +0000)]
Set priority of vdev_geom threads and zvol threads to PRIBIO.

14 years ago- Give minclsyspri and maxclsyspri real values (consulted with kmacy).
Pawel Jakub Dawidek [Sun, 23 Aug 2009 11:22:46 +0000 (11:22 +0000)]
- Give minclsyspri and maxclsyspri real values (consulted with kmacy).
- Honour 'pri' argument for thread_create().

14 years agoMake dev.asmc.N.light.control writable by everyone.
Rui Paulo [Sun, 23 Aug 2009 09:58:06 +0000 (09:58 +0000)]
Make dev.asmc.N.light.control writable by everyone.

Submitted by: Patrick Lamaiziere <patfbsd at davenulle.org>
MFC after: 1 week

14 years agoConstify prime numbers.
Rui Paulo [Sun, 23 Aug 2009 09:55:06 +0000 (09:55 +0000)]
Constify prime numbers.

14 years agoFix another typo right next to the previous one, that amazingly, I did
Julian Elischer [Sun, 23 Aug 2009 08:49:32 +0000 (08:49 +0000)]
Fix another typo right next to the previous one, that amazingly, I did
not see before.

MFC after:  1 week