Commit Graph

68285 Commits

Author SHA1 Message Date
Max Laier
9f21c07f14 Merge state reuse for tcp.
PR:		kern/125261
Obtained from:	OpenBSD
MFC after:	1 week
2008-08-04 14:42:09 +00:00
Olivier Houchard
ae33434c7f We need -I$S to compile the elf trampoline.
MFC after:	3 days
2008-08-04 14:38:38 +00:00
Olivier Houchard
cf1f6a4da0 Remove unneeded #include <stdlib.h> (?)
MFC after:	3 days
2008-08-04 14:37:32 +00:00
Max Laier
898dc49201 Flatten out dist and all "live" tag directories. 2008-08-04 13:30:44 +00:00
Konstantin Belousov
66548e0a2f Lower the priority of the sleep in the syscons for "waitvt" wchan to
PZERO + 1. The sleeping process at the priority <= PZERO is counted as
blocked, or, as comment states, 'disk wait'. PZERO + 1 works as well,
and does not cause user confusion.

Reported by:	sam <samflanker at gmail com>
MFC after:	1 week
2008-08-04 12:22:33 +00:00
Alan Cox
494c177e81 Make pmap_kenter_attr() static. 2008-08-04 08:04:09 +00:00
Colin Percival
ff1782127a Dereferencing uninitialized pointers considered harmful. Prior to this
commit, calling i386_parsedev(..., X, ...) where X is "ad", "bge", or
any other disk or network device name without a unit number, would
result in dereferencing whatever happened to be on the stack where the
variable "cp" is stored.

Found by:	LLVM/Clang Static Checker
2008-08-04 07:01:42 +00:00
Colin Percival
5fe69bb518 Setting a variable to the same value twice doesn't actually make it
more likely to have the right value.  Remove superfluous assignments.

Found by:	LLVM/Clang Static Checker
2008-08-04 06:39:52 +00:00
Pyun YongHyeon
3d85c23dc6 Rearrange conditional compilation directives. This makes syntax
highlighting work in vim.
2008-08-04 04:00:10 +00:00
Pyun YongHyeon
3199b0c42c Remove return keyword at the end of functions that return void. 2008-08-04 03:51:20 +00:00
Pyun YongHyeon
0ce0868acd Remove register keyword. 2008-08-04 03:47:29 +00:00
Pyun YongHyeon
7b5ffebfe2 Use ANSI C declarations for all functions. 2008-08-04 03:45:07 +00:00
Pyun YongHyeon
a2a8420cfd Don't enable TSO by default. Users of RTL8169/8110 reported
watchdog timeout issues and the root cause seems to stem from
silicon bug of controller. Personally I couldn't reproduce it on
RTL8169 controller but it seems it's dependent on usage pattern.
For newer PCIe based controllers I have no TSO complaints but
turning off TSO would be more safe. Users who are sure that
their controller works with TSO can still reenable the TSO with
ifconfig(8).

Reported by:	Oliver Lehmann (lehmann at ans-netz dot de), Eugene Butusov (ebutusov at gmail dot com)
2008-08-04 02:34:40 +00:00
Pyun YongHyeon
ae64408754 The number of bits reserved for MSS in RealTek controllers is
11bits. This limits the maximum interface MTU size in TSO case
as upper stack should not generate TCP segments with MSS greater
than the limit. Armed with this information, disable TSO if
interface MTU is greater than the limit.
2008-08-04 02:05:09 +00:00
Antoine Brodin
f8062a0b0f Kill a dead variable
PR:		126223
Submitted by:	Mateusz Guzik
2008-08-03 21:07:19 +00:00
Robert Watson
1d986c5ff1 Remove broken code to replace st_mode value with ACCESSPERMS when
lstat(2) is called on symlinks -- this code appears never to have
worked.  The PR this addresses suggests that the intended
original behavior is the right one, but as bde points out in the
PR comments, we do actually support storing a mode on symlinks,
so returning it seems reasonable.

This is consistent with Mac OS X, which despite documentation to
the contrary does return the mode set on a symlink, but not some
other platforms.  The Single Unix Spec requires only that the
returned bits be "meaningful", which seems at best unhelpful as
advice goes.

PR:		25018
MFC after:	3 days
2008-08-03 15:44:56 +00:00
Olivier Houchard
f0fe5e9127 Add "add pc, whatever" as a branch instruction, we use it in memcpy().
MFC after:	3 days
2008-08-03 15:35:32 +00:00
Tom Rhodes
6bd9cb1c81 Fill in a few sysctl descriptions.
Reviewed by:	alc, Matt Dillon <dillon@apollo.backplane.com>
Approved by:	alc
2008-08-03 14:26:15 +00:00
Tom Rhodes
942df7e765 Document a few sysctls.
Approved by:	imp
2008-08-03 14:11:06 +00:00
Konstantin Belousov
4f7afc20e0 Calling linker_load_dependencies() while holding the module'
vnode lock may cause a LOR between kld_sx lock and vnode lock.
linker_load_dependencies() drops kld_sx, and another thread may attempt
to load the same kld.

Reported and tested by:	pjd
MFC after:	1 week
2008-08-03 13:33:45 +00:00
Ed Schouten
200d80cd74 Disconnect drivers that haven't been ported to MPSAFE TTY yet.
As clearly mentioned on the mailing lists, there is a list of drivers
that have not been ported to the MPSAFE TTY layer yet. Remove them from
the kernel configuration files. This means people can now still use
these drivers if they explicitly put them in their kernel configuration
file, which is good.

People should keep in mind that after August 10, these drivers will not
work anymore. Even though owners of the hardware are capable of getting
these drivers working again, I will see if I can at least get them to a
compilable state (if time permits).
2008-08-03 10:32:17 +00:00
Warner Losh
93757e6b48 Kernel config for the Linksys NSLU2. This is just a basic configuration,
with no support for the LED, buttons, realtime clock or flash support.
2008-08-03 07:10:25 +00:00
Olivier Houchard
fcfc49979c Handle ldr pc, [reg] in branch_taken().
Obtained from:	NetBSD
MFC after:	3 days
2008-08-03 01:53:14 +00:00
Olivier Houchard
697292d902 Add blx as a branch instruction.
MFC after:	3 days
2008-08-03 01:51:30 +00:00
Warner Losh
c65b00d158 Minor style nit. 2008-08-02 22:53:43 +00:00
Robert Watson
95b85ca3a9 Minor style tweaks. 2008-08-02 22:30:51 +00:00
Robert Watson
f7c4bd95ba Rename mac_partition_enabled to partition_enabled to synchronize with
other policies that similarly now avoid the additional mac_ prefix on
variables.

MFC after:	soon
2008-08-02 20:53:59 +00:00
Warner Losh
24b934392e Add an altnerative Siemens SpeedStream ID. This one is for a Prism 3
card.  I got a pair of these at a garage sale for US$1.00 today...
2008-08-02 20:50:13 +00:00
Warner Losh
15820ef70c Report what kind of chip only under bootverbose since that's now
exported via a sysctl.
2008-08-02 20:49:01 +00:00
Warner Losh
f043f9621e Minor tweaks to names and comments now that I understand what's going
on better.
2008-08-02 20:45:28 +00:00
Warner Losh
96edbc847e Add an alternative ID for the Siemens SpeedStream SS1021: 0x3021. 2008-08-02 20:36:25 +00:00
Sam Leffler
d3d6c95298 add missing lock for htinfo update
Submitted by:	Chris Zimmermann
2008-08-02 18:04:09 +00:00
Sam Leffler
6bbdc70146 correct decap of of AppleTalk and IPX frames; don't strip the SNAP
header as they have one natively

Submitted by:	Chris Zimmermann
2008-08-02 18:02:57 +00:00
Sam Leffler
ac5ae6986f add a sysctl to deliver a radar event for testing 2008-08-02 18:00:33 +00:00
Sam Leffler
5c9b0f1d07 schedule the correct timer when receiving a radar event during CAC 2008-08-02 17:58:39 +00:00
Sam Leffler
6e0186d5ee add callout_schedule; besides being useful it also improves
compatibility with other systems

Reviewed by:	ed, battlez
2008-08-02 17:42:38 +00:00
Scott Long
8792c6abd8 Correctly set the interrupt enable and disable bits. The previous
code interfered with Performant mode and legacy interrupts.  Also
remove a register read operation on the Simplq code that was
effectively a time-wasting no-op.
2008-08-02 13:04:26 +00:00
Olivier Houchard
08cfba5d14 Fix software single-stepping: we need to check if the instruction is a
return instruction as well, or we'll stop single-stepping as soon as we'll
return from a function.

MFC after:	3 days
2008-08-02 12:49:43 +00:00
Olivier Houchard
4ed897041f Add yet another branch instruction.
Obtained from:	NetBSD
MFC after:	3 days
2008-08-02 12:48:30 +00:00
Remko Lodder
a2a9fbb490 Add support for the ASUS P535 PDA
PR:		kern/126097
Submitted by:	Anton Kartashev <amokk@seb.org.ua>
Approved by:	imp (mentor, implicit)
MFC after:	3 days
2008-08-02 12:15:18 +00:00
Ed Schouten
6d09e4f1a8 Make the at91 uart(4) driver compile again.
As of r178766 this driver didn't compile anymore, because it missed a
switch()-statement. I'm getting tired of seeing this driver being broken
for two months already. When I run `make universe', everything passes,
except the BWCT kernel configuration file.
2008-08-02 08:01:56 +00:00
Warner Losh
504ff11df7 ixp425 parts aren't multicore, so remove the SMP option. They also
don't support the ioapic either, so remove that option too.  These
were commented out, but could never be enabled, unlike the other
options in the file that are commented out.
2008-08-02 07:20:30 +00:00
Warner Losh
319150067f Conform to the options<space><tab> convention everywhere in this file.
This is just a white space change, no functional change.
2008-08-02 07:18:12 +00:00
Alan Cox
75accfd97d Enhance pmap_mapdev_attr(). Take advantage of recent enhancements to
pmap_change_attr() in order to use the direct map for any cache mode, not
just write-back mode.

It is worth noting that this change also eliminates a situation in which we
have two mappings to the same physical memory with different cache modes.

Submitted by:	Magesh Dhasayyan (with some changes by me)
Discussed with:	jhb
2008-08-02 03:43:54 +00:00
Warner Losh
2f6a79342a Add ELF relocation types for mips.
Obtained from:	mips/include/elf.h
2008-08-02 01:20:10 +00:00
Olivier Houchard
939e434def Store the PC while context switching, for the benefits of DDB. 2008-08-02 00:10:38 +00:00
Julian Elischer
711ca7efbb The IPFW code accepts the use of the tablearg keyword along with the skipto
keyword. But it doesn't work. Two options.. make it no longer accept it,
or actually make it work.. I chose the 2nd..

Allow the tablearg to be used to specify a skipto destination.

This is actually a very powerful construct if used correctly, or a sink
of cpu cycles if used badly.

changes t teh man page will follow.
2008-08-01 22:21:03 +00:00
Antoine Brodin
69237b102d Make "1000baseT" the description and "1000baseTX" the alias for
IFM_1000_T instead of the reverse.  It is possible FreeBSD doesn't
even support 1000baseTX.
This changes ifconfig(8) output.

Requested by:	gavin@ and bms@
See also:	http://docs.freebsd.org/cgi/mid.cgi?20050307191901.H32508
2008-08-01 22:13:39 +00:00
Antoine Brodin
7b4f6e7b9f Remove trailing ';' in BPFD_LOCK_ASSERT macro.
MFC after:	1 month
X-MFC-to:	stable/7, stable/6 has it right
2008-08-01 22:08:14 +00:00
Christian S.J. Peron
a05cf8c6db Annotate why we do not call BPF_CHECK_DIRECTION() in this tapping routine.
There is no way for the caller to tell us which direction this packet is
going.  With the bpf_mtap{2} routines, we can check the interface pointer.

MFC after:	2 weeks
2008-08-01 21:38:46 +00:00
John Baldwin
9b1db80125 Use the new bus device_shutdown hook for performing the shutdown action
on the ee16 parts rather than explicitly registering an event handler
that wasn't being torn down on detach.
2008-08-01 21:33:07 +00:00
John Baldwin
08649f593c - Use an sx lock to serialize writes since they update the checksum.
- Remove D_NEEDGIANT as the rtc drivers already have their own locks, so
  this doesn't need Giant.

MFC after:	1 week
2008-08-01 20:39:18 +00:00
John Baldwin
d428508ca6 Adjust comment. This stack is only used for booting now and not as an
idle stack.
2008-08-01 20:10:47 +00:00
Ed Maste
879afbd55a Fix whitespace. 2008-08-01 15:13:56 +00:00
John Baldwin
7b030859af Enable the support for G33/Q35/Q33 now that both the G33 and Q35 have been
tested:

PR:		amd64/126090
MFC after:	1 week
2008-08-01 13:11:23 +00:00
Robert Watson
7ec3a88b94 Remove further trailing white space. 2008-08-01 09:41:45 +00:00
Alan Cox
67cbc11594 Enhance pmap_change_attr() with the ability to demote 1GB page mappings. 2008-08-01 04:55:38 +00:00
Maksim Yevmenkin
4fa708ef20 Implement ratelimiting for debug messages. For now, allow at most
one message per second. In the future might add a sysctl knob for
each socket family to fine tune this.

MFC after:	1 week
2008-08-01 00:36:43 +00:00
Maksim Yevmenkin
93f9b5b4aa Increase maximum input queue size limit for raw Bluetooth HCI sockets.
MFC after:	3 days
2008-08-01 00:16:40 +00:00
Maksim Yevmenkin
9b5b51671c Fix locking bug, i.e. lock "wildcard" matched pcb before return. 2008-08-01 00:13:32 +00:00
Alan Cox
ba65f767c0 Enhance pmap_change_attr(). Specifically, avoid 2MB page demotions, cache
mode changes, and cache and TLB invalidation when some or all of the
specified range is already mapped with the specified cache mode.

Submitted by:	Magesh Dhasayyan
2008-07-31 22:45:28 +00:00
Robert Watson
80794edc05 In mac_bsdextended's auditctl and acct policy access control checks,
return success if the passed vnode pointer is NULL (rather than
panicking).  This can occur if either audit or accounting are
disabled while the policy is running.

Since the swapoff control has no real relevance to this policy,
which is concerned about intent to write rather than water under the
bridge, remove it.

PR:             kern/126100
Reported by:    Alan Amesbury <amesbury at umn dot edu>
MFC after:      3 days
2008-07-31 20:49:12 +00:00
Kip Macy
006c3d2eb6 remove socketvar.h, add more selective includes 2008-07-31 20:28:58 +00:00
Kip Macy
849cca9b8e move sockbuf locking macros in to sockbuf.h 2008-07-31 20:27:50 +00:00
Christian S.J. Peron
dfc714fba1 Currently, BSM audit pathname token generation for chrooted or jailed
processes are not producing absolute pathname tokens.  It is required
that audited pathnames are generated relative to the global root mount
point.  This modification changes our implementation of audit_canon_path(9)
and introduces a new function: vn_fullpath_global(9) which performs a
vnode -> pathname translation relative to the global mount point based
on the contents of the name cache.  Much like vn_fullpath,
vn_fullpath_global is a wrapper function which called vn_fullpath1.

Further, the string parsing routines have been converted to use the
sbuf(9) framework.  This change also removes the conditional acquisition
of Giant, since the vn_fullpath1 method will not dip into file system
dependent code.

The vnode locking was modified to use vhold()/vdrop() instead the vref()
and vrele().  This will modify the hold count instead of modifying the
user count.  This makes more sense since it's the kernel that requires
the reference to the vnode.  This also makes sure that the vnode does not
get recycled we hold the reference to it. [1]

Discussed with:	rwatson
Reviewed by:	kib [1]
MFC after:	2 weeks
2008-07-31 16:57:41 +00:00
Rui Paulo
f2512ba12a MFp4 (//depot/projects/tcpecn/):
TCP ECN support. Merge of my GSoC 2006 work for NetBSD.
  TCP ECN is defined in RFC 3168.

Partly reviewed by:	dwmalone, silby
Obtained from:		NetBSD
2008-07-31 15:10:09 +00:00
Randall Stewart
6d9e8f2b3a Adds support for the SCTP_PORT_REUSE option
Fixes a refcount bug found in the process

Obtained from:	With the help of Michael Tuexen
2008-07-31 11:08:30 +00:00
Robert Watson
f6d4a8a77b Further synchronization of copyrights, licenses, white space, etc from
Apple and from the OpenBSM vendor tree.

Obtained from:	Apple Inc., TrustedBSD Project
MFC after:	3 days
2008-07-31 09:54:35 +00:00
Alan Cox
c1695335d1 Eliminate recomputation of the PDE by pmap_pde_attr(). 2008-07-31 04:42:42 +00:00
Maksim Yevmenkin
a0bac9cc1b Fix LINT
MFC after:	3 months
2008-07-31 03:51:53 +00:00
Jack F Vogel
339cd27eec Data type fix 2008-07-31 02:22:53 +00:00
Paul Saab
a5469167c1 Unbreak the build by creating opt_nfs.h 2008-07-31 02:13:36 +00:00
Paul Saab
721c409daf Unbreak the build by including sys/socketvar.h 2008-07-31 01:52:04 +00:00
Paul Saab
f4779b9d6e Include netinet/tcp_lro.h, unbreak the build 2008-07-30 23:54:23 +00:00
Maksim Yevmenkin
ecfcbb9f03 Hook up Bluetooth SCO sockets code to the build
MFC after:	3 months
2008-07-30 22:42:17 +00:00
Maksim Yevmenkin
48698a834c Introduce support for Bluetooth SCO sockets. This is based on older
code that was revisted.

MFC after:	3 months
2008-07-30 22:41:23 +00:00
Jack F Vogel
20976c5bc7 Add igb driver to the default kernel 2008-07-30 22:30:49 +00:00
Jack F Vogel
859ff640f3 Add igb to the default kernel
MFC after:ASAP
2008-07-30 22:27:38 +00:00
Jack F Vogel
1a8a2aa55b Change Makefile to reflect new directory structure
MFC after:ASAP
2008-07-30 22:06:38 +00:00
Jack F Vogel
d7b1367463 Change to build module with new directory tree
MFC after:ASAP
2008-07-30 22:05:06 +00:00
Jack F Vogel
06248ffcc6 Alter kernel build to work with new dev/e1000 structure.
This makes both em and igb, or either alone build and
work in the static kernel.

MFC after:ASAP
2008-07-30 22:01:32 +00:00
Jack F Vogel
8cfa0ad266 Merge of the source for igb and em into dev/e1000, this
proved to be necessary to make the static drivers work
in EITHER/OR or BOTH configurations. Modules will still
build in sys/modules/igb or em as before.

This also updates the igb driver for support for the 82576
adapter, adds shared code fixes, and etc....

MFC after:	ASAP
2008-07-30 21:56:53 +00:00
John Baldwin
2c3b410b3a One more whitespace nit. 2008-07-30 21:23:32 +00:00
John Baldwin
3cca4b6fe8 A few more whitespace fixes. 2008-07-30 21:18:08 +00:00
John Baldwin
3677ad363b If the kernel has run out of metadata for swap, then explicitly panic()
instead of emitting a warning before deadlocking.

MFC after:	1 month
2008-07-30 21:12:15 +00:00
John Baldwin
4a67a0d994 Whitespace tweak. 2008-07-30 21:07:56 +00:00
John Baldwin
feaed6c57e Trim some noise from some #ifdef's. This had leaked into the compat32
support for bpf(4) due to hacks in the Y! tree for a truss32 binary
(since superseded by native support for 32-bit binaries in truss itself).

MFC after:	1 week
2008-07-30 21:01:51 +00:00
Kip Macy
c316a7ab32 fix includes for post sockbuf re-factor 2008-07-30 20:08:34 +00:00
John Baldwin
c9fe67dd7e Use single byte read and write operations to toggle the BIOS and OS
semaphores rather than 4 byte operations.

MFC after:	1 month
2008-07-30 19:16:53 +00:00
Konstantin Belousov
24bbc85bf6 The behaviour of the lockmgr going back at least to the 4.4BSD-Lite2 was
to downgrade the exclusive lock to shared one when exclusive lock owner
requested shared lock. New lockmgr panics instead.

The vnode_pager_lock function requests shared lock on the vnode backing
the OBJT_VNODE, and can be called when the current thread already holds
an exlcusive lock on the vnode. For instance, it happens when handling
page fault from the VOP_WRITE() uiomove that writes to the file, with
the faulted in page fetched from the vm object backed by the same file.
We then get the situation described above.

Verify whether the vnode is already exclusively locked by the curthread
and request recursed exclusive vnode lock instead of shared, if true.

Reported by:	gallatin
Discussed with:	attilio
2008-07-30 18:16:06 +00:00
Jack F Vogel
5b7f4ced65 This updates the ixgbe driver to Intel internal version 1.4.7
Shared code changes, core driver fixes, vlan event/filter support

Also Kip Macy's fix to allow any number of queues, thanks Kip!
2008-07-30 18:15:18 +00:00
John Baldwin
a6c4b9deb4 Set all of the "optimum performance" PHY registers for the 15D parts as
well as the 15C since it seems to be required in practice.  The Linux
natsemi.c driver mostly does this as well.

PR:		kern/112179
Submitted by:	Mark Willson  mark - hydrus org uk
MFC after:	1 week
2008-07-30 17:28:49 +00:00
John Baldwin
f5698581ca SIS_SETBIT() already does a read/modify/write operation, so there isn't
a reason to read the register twice.

MFC after:	1 week
2008-07-30 17:21:32 +00:00
Ed Schouten
e7ea30e404 Remove the use of lbolt from the VFS syncer.
It seems we only use `lbolt' inside the VFS syncer and the TTY layer
now.  Because I'm planning to replace the TTY layer next month, there's
no reason to keep `lbolt' if it's only used in a single thread inside
the kernel.

Because the syncer code wanted to wake up the syncer thread before the
timeout, it called sleepq_remove(). Because we now just use a condvar(9)
with a timeout value of `hz', we can wake it up using cv_broadcast()
without waking up any unrelated threads.

Reviewed by:	phk
2008-07-30 12:39:18 +00:00
Ed Schouten
911d490140 Don't make subr_clist.c depend on the TTY layer.
After the import of the new TTY layer, the TTY_QUOTE definition will not
be present anymore. To make sure clists will still work as expected,
introduce an internal definition called QUOTEMASK.

Maybe we can decide to remove the quote bits entirely, but we still have
to look into this. There may be drivers that still use the quote bits.

Obtained from:	//depot/projects/mpsafetty
2008-07-30 12:32:42 +00:00
Konstantin Belousov
8f4a1f3a83 Bring back the save/restore of the %ds, %es, %fs and %gs registers for
the 32bit images on amd64.

Change the semantic of the PCB_32BIT pcb flag to request the context
switch code to operate on the segment registers. Its previous meaning
of saving or restoring the %gs base offset is assigned to the new
PCB_GS32BIT flag.

FreeBSD 32bit image activator sets the PCB_32BIT flag, while Linux 32bit
emulation sets PCB_32BIT | PCB_GS32BIT.

Reviewed by:	peter
MFC after:	2 weeks
2008-07-30 11:30:55 +00:00
Robert Watson
2209e8f159 Adopt the slightly weaker consistency locking approach used in IPv4 raw
sockets for IPv6 raw sockets: separately lock the inpcb for determining
the destination address for a connect()'d raw socket at the rip6_send()
layer, and then re-acquire the inpcb lock in the rip6_output() layer to
query other options on the socket.  Previously, the global raw IP socket
lock was used, which while correct and marginally more consistent, could
add significantly to global raw IP socket lock contention.

MFC after:	1 week
2008-07-30 09:26:27 +00:00
Marcel Moolenaar
16b0c20c82 Change the type of psaddr_t from void* to uintptr_t. A pointer
type cannot be made wider to allow ILP32 platforms to target
LP64 platforms.
2008-07-30 00:59:19 +00:00
Pyun YongHyeon
1f8287f868 Unbreak build.
Remove nfe(4). The driver applies to i386/amd64 only.
2008-07-30 00:39:25 +00:00
Andrew Thompson
c42c172256 Free the correct buffer list on failure. 2008-07-30 00:38:10 +00:00
Kip Macy
d7ec7db225 remove redundant ifdef ... lol 2008-07-29 23:00:54 +00:00
Kip Macy
57ca0572b1 fix build by forward declaring thread and hiding socket buffer definitions from user code 2008-07-29 23:00:00 +00:00
Olivier Houchard
8cad15c8fe Unbreak the build by protecting kernel-only functions with #ifdef _KERNEL. 2008-07-29 21:48:01 +00:00
Robert Watson
ae89d5a389 When copying in and out current ICMPv6 filters on a raw IPv6 socket,
lock the inpcb and use a local stack variable to copy to/from userspace
so that sooptcopyin()/sooptcopyout() aren't called while holding an
rwlock.

While here, fix a bug in which a failed sooptcopyin() might lead to
partially consistent ICMPv6 filters on the socket by not ignoring the
error returned by sooptcopyin().

MFC after:	2 weeks
2008-07-29 19:37:16 +00:00
Robert Watson
2f1ff0cd80 Since we fail IPv6 raw socket allocation if inp->in6p_icmp6filt can't
be allocated, there's no need to conditionize use and freeing of it
later.

MFC after:	1 week
2008-07-29 18:09:46 +00:00
Robert Watson
cc29ac7d22 Marginally decomplicate set/getsockopt code in ip6_output.c by simply
using the passed arguments explicitly and unconditionally rather than
testing them and calling panic().  The result is the same but easier
to read.

MFC after:	3 days
2008-07-29 09:31:03 +00:00
Randall Stewart
52baa64a19 Fix build breakage - kthread_exit() in 8 now has no arguments
MFC after:	1 week
2008-07-29 09:30:50 +00:00
Randall Stewart
d6af161a34 - Out with some printfs.
- Fix a initialization of last_tsn_used
- Fix handling of mapped IPv4 addresses
Obtained from:	Michael Tuexen and I :-)
MFC after:	1 week
2008-07-29 09:06:35 +00:00
Pyun YongHyeon
cde2511802 style(9) - space after keywords, don't indent case. 2008-07-29 09:02:00 +00:00
Pyun YongHyeon
2229ae4a5e Cache PCI vendor/device ids to avoid unnecessary PCI configuration
space access in device probe.
Also nuke referencing softc in device probe.
2008-07-29 08:49:36 +00:00
Pyun YongHyeon
be280562a1 s/printf/device_printf/g
Don't hard code function name in device_printf() and use __func__.
While I'm here nuke bfe_unit in softc as it's not needed anymore.
2008-07-29 08:32:29 +00:00
Kip Macy
66a4ba6246 Factor sockbuf, sockopt, and sockstate out of socketvar.h in to separate headers.
Reviewed by:	rwatson
MFC after:	3 days
2008-07-29 07:45:05 +00:00
Pyun YongHyeon
0587cad886 Add missing jme(4), msk(4), nfe(4), re(4) and stge(4) in NOTES and
ensure that LINT builds include these devices.

Reported by:	Peter Jeremy
2008-07-29 01:15:11 +00:00
Maksim Yevmenkin
a4d05859e7 Simplify ubt_isoc_in_complete2(). Also should fix off by 1 bug.
MFC after:	3 months
2008-07-29 00:17:53 +00:00
Alexander Motin
280d6bd758 Don't use memcpy() to copy several bytes.
Store IDs is host order. It is not so important to bloat code for it.
Combine m_adj() and M_PREPEND() into single M_PREPEND().
2008-07-28 22:22:38 +00:00
John Baldwin
02f3c16fa5 Re-enable em(4) and igb(4) in NOTES.
PR:		conf/112081
2008-07-28 22:16:58 +00:00
John Baldwin
12d3da872c Remove a stale reference to sys/dev/ixgbe/tcp_lro.c. 2008-07-28 21:47:04 +00:00
John Baldwin
c3ea337801 When choosing a CPU for a thread in a cpuset, prefer the last CPU that the
thread ran on if there are no other CPUs in the set with a shorter per-CPU
runqueue.
2008-07-28 20:39:21 +00:00
Alexander Motin
6c5bbf5ce1 Move inpcb lock higher to protect some nonbinding fields reading.
It fixes nothing at this time, but decided to be more correct.
2008-07-28 19:32:18 +00:00
John Baldwin
f7f1cc1518 Really fix this. 2008-07-28 18:33:43 +00:00
Pawel Jakub Dawidek
7224dd4dad Properly check if td_name is empty and if it is, print process name,
instead of empty thread name.

Reviewed by:	jhb
2008-07-28 18:10:26 +00:00
Antoine Brodin
e8c6b2d8ca Remove a file that is not used and does not exist. 2008-07-28 17:56:37 +00:00
John Baldwin
f200843b72 Implement support for cpusets in the 4BSD scheduler.
- When a cpuset is applied to a thread, walk the cpuset to see if it is a
  "full" cpuset (includes all available CPUs).  If not, set a new
  TDS_AFFINITY flag to indicate that this thread can't run on all CPUs.
  When inheriting a cpuset from another thread during thread creation, the
  new thread also inherits this flag.  It is in a new ts_flags field in
  td_sched rather than using one of the TDF_SCHEDx flags because fork()
  clears td_flags after invoking sched_fork().
- When placing a thread on a runqueue via sched_add(), if the thread is not
  pinned or bound but has the TDS_AFFINITY flag set, then invoke a new
  routine (sched_pickcpu()) to pick a CPU for the thread to run on next.
  sched_pickcpu() walks the cpuset and picks the CPU with the shortest
  per-CPU runqueue length.  Note that the reason for the TDS_AFFINITY flag
  is to avoid having to walk the cpuset and examine runq lengths in the
  common case.
- To avoid walking the per-CPU runqueues in sched_pickcpu(), add an array
  of counters to hold the length of the per-CPU runqueues and update them
  when adding and removing threads to per-CPU runqueues.

MFC after:	2 weeks
2008-07-28 17:25:24 +00:00
Warner Losh
0c5544bb64 Export the hardware type (as number and name), the secondary firmware
revision and (on Prism cards) the primary firmware revision via
sysctl.  Move the printing of this information under bootverbose,
since it is relatively easy to get to it now.
2008-07-28 17:00:37 +00:00
John Baldwin
8aa3d7ffc0 Various and sundry style and whitespace fixes. 2008-07-28 15:52:02 +00:00
Alexander Motin
18f401c664 Some style and assertion fixes to the previous commits hinted by rwatson.
There is no functional changes.
2008-07-28 06:57:28 +00:00
Alan Cox
e79980e1f7 Correct an off-by-one error in the previous change to pmap_change_attr().
Change the nearby comment to mention the recursive map.
2008-07-28 05:41:35 +00:00
Alan Cox
b0c139d336 Don't allow pmap_change_attr() to be applied to the recursive mapping. 2008-07-28 04:59:48 +00:00
Alan Cox
cc1ec88f72 Don't allow pmap_change_attr() to be applied to the recursive mapping. 2008-07-28 04:13:49 +00:00
Alan Cox
a8bb29e5d2 Add a check for 1GB page mappings to pmap_change_attr() so that it fails
gracefully.  (On K10 family processors the direct map is implemented using
1GB page mappings.)
2008-07-28 03:58:49 +00:00
Pyun YongHyeon
43742818e3 Fix buffer discard index.
While I'm here dicard all buffers if errored frame is part of
multi-segmented frames.

Pointed out by:	sephe
Reviewd by:	sephe
MFC after:	3 days
2008-07-28 02:37:15 +00:00
Kip Macy
947265b6bd - track maximum wait time
- resize columns based on actual observed numerical values

MFC after:	3 days
2008-07-27 21:45:20 +00:00
Alexander Motin
d185578a78 According to in_pcb.h protocol binding information has double locking.
It allows access it while list travercing holding only global pcbinfo lock.
2008-07-27 20:48:22 +00:00
Alexander Motin
b11e21ae80 According to in_pcb.h protocol binding information has double locking.
It allows access it while list travercing holding only global pcbinfo lock.
2008-07-27 20:30:34 +00:00
Alan Cox
35db2ce0dc Style fixes to several function definitions. 2008-07-27 18:18:50 +00:00
Alan Cox
91842e53a9 Enhance pmap_change_attr(). Use pmap_demote_pde() to demote a 2MB page
mapping to 4KB page mappings when the specified attribute change only
applies to a portion of the 2MB page.  Previously, in such cases,
pmap_change_attr() gave up and returned an error.

Submitted by:	Magesh Dhasayyan
2008-07-27 17:32:36 +00:00
Pawel Jakub Dawidek
5573021d78 Assert for exclusive vnode lock in vinactive(), vrecycle() and vgonel()
functions.

Reviewed by:	kib
2008-07-27 11:48:15 +00:00
Pawel Jakub Dawidek
610507ae00 - Move vp test for beeing NULL under IGNORE_LOCK().
- Check if panicstr isn't set, if it is ignore the lock. This helps to avoid
  confusion, because lockmgr is a no-op when panicstr isn't NULL, so
  asserting anything at this point doesn't make sense and can just race with
  other panic.

Discussed with:	kib
2008-07-27 11:46:42 +00:00
Julian Elischer
66e8505f4c Add the ability to add new addresses for interfacesto just one FIB
(Other more specific related options will follow)
This allows one to set multiple p2p links to the same place
and select which to use by having each in different FIBS.
2008-07-27 01:29:28 +00:00
Sam Leffler
693e312235 don't deauth a station because it sends a ps-poll w/ a bogus aid in it;
turns out some devices do this and since we otherwise validate the station
is associated and don't use the aid for anything being lenient here allows
them to function

Submitted by:	Chris Zimmermann
MFC after:	2 weeks
2008-07-26 23:50:27 +00:00
Alexander Motin
e2ed8f3514 Increase UDBHASHSIZE from 16 to 128 items.
Previous value was chosen 10 years ago and not very effective now.
This change gives several percents speedup on 1000 L2TP mpd links.
2008-07-26 23:07:34 +00:00
Alexander Motin
0ca3b0967b According to in_pcb.h protocol binding information has double locking.
It allows access it while list travercing holding only global pcbinfo lock.
This relaxed locking noticably increses receive socket lookup performance.
2008-07-26 21:12:00 +00:00
Darren Reed
14fbef0c79 2020447 IPFilter's NAT can undo name server random port selection
(fix output port range, was a random number in [0,max-min]
	 (byteswapped on litle endian), instead of [min,max])

Submitted by:	darrenr
2008-07-26 19:46:00 +00:00
Alexander Motin
9ed324c9a5 Add hash table lookup for a fully connected raw sockets.
This gives significant performance improvements when many raw sockets used.
Benchmarks of mpd handeling 1000 simultaneous PPTP connections show up to 50%
performance boost. With higher number of connections benefit becomes even
bigger. PopTop snd others should also get some benefits.
2008-07-26 17:32:15 +00:00
Warner Losh
febcff0a3b Register the interrupt handler at the end of wi_attach rather than at
the beginning.  There's a race in the shared interrutp case.  If
another interrupt happens after the interrupt is setup, then we'd try
to lock an uninitialized mutex.  In addition, if we bailed out due to
a too old version of firmware, we'd leave the interrupt enabled with
all the fun that ensues....
2008-07-26 17:04:30 +00:00
Andrey A. Chernov
b834665cd5 Return arc4_i = arc4_j = 0; line from previous backing out since
just found it in OpenBSD, see their sys/crypto/arc4.c, function
rc4_keysetup, line ctx->x = ctx->y = 0;

Obtained from:  OpenBSD
2008-07-26 16:42:45 +00:00
Tom Rhodes
be6b130476 Fill in a few sysctl descriptions.
Approved by:	rwatson
2008-07-26 00:55:35 +00:00
Tom Rhodes
ad291f81da Fill in sysctl descriptions.
Approved by:	philip
2008-07-26 00:01:19 +00:00
Tom Rhodes
c9fac982af Fill in BPF sysctl descriptions.
Reviewed by:	csjp
2008-07-25 23:58:09 +00:00
Tom Rhodes
7521cd74f6 Begin the sysctl descriptions with a capital letter.
Make some slight wording tweaks.
2008-07-25 23:54:07 +00:00
Stanislav Sedov
32c5ce374b - Connect ds1339 to the build infrastructure.
Reviewed by:	raj
Approved by:	imp
2008-07-25 19:35:40 +00:00
Stanislav Sedov
8e3b2aab49 - Add driver for Dallas Semiconductor DS1339 RTC sitting
on I2C bus.

Reviewed by:	raj
Approved by:	imp
MFC after:	2 week
2008-07-25 19:34:44 +00:00
Andrey A. Chernov
fff6495ea6 Per rwatson's request:
"If you don't get a review within a day or two, I would firmly recommend
backing out the changes"

back out all my changes as unreviewed by secteam@ yet.
2008-07-25 15:53:32 +00:00
Ed Schouten
bea45cdda3 Move ttyinfo() into its own C file.
The ttyinfo() routine generates the fancy output when pressing ^T. Right
now it is stored in tty.c. In the MPSAFE TTY code it is already stored
in tty_info.c. To make integration of the MPSAFE TTY code a little
easier, take the same approach.

This makes the TTY code a little bit more readable, because having the
proc_*/thread_* routines in tty.c is very distractful.

Approved by:	philip (mentor)
2008-07-25 14:31:00 +00:00
Konstantin Belousov
58e8af1bf5 Call pargs_drop() unconditionally in do_execve(), the function correctly
handles the NULL argument.
Make pargs_free() static.

MFC after:	1 week
2008-07-25 11:55:32 +00:00
Konstantin Belousov
96f1567fa7 s/alredy/already/ in the comments and the log message. 2008-07-25 11:22:25 +00:00
Jeff Roberson
d67023a155 - Provide kernelname as the name for process with P_KTHREAD set as
otherwise their textvp is NULL.

Reviewed by:	jkoshy
Sponsored by:	Nokia
2008-07-25 05:49:48 +00:00
Ivan Voras
c7317f5bb0 Add tweak for AMD Geode "companion" chip, AMD CS5536, which is apparently
USB 2.0 capable but is shy and doesn't adwertise it much.

PR:		120017
Reviewed by:	imp
Approved by:	gnn (mentor)
MFC after:	2 weeks
2008-07-24 23:22:19 +00:00
Julian Elischer
7e4e65ffb3 Fix spelling error in comment 2008-07-24 19:05:58 +00:00
Marius Strobl
85f57c4d48 Prefer the opt_global.h from KERNBUILDDIR if existent so we obtain all
macros that might be relevant.
2008-07-24 14:07:52 +00:00
Doug Rabson
d3508f91ee Try again not to use a userspace pointer in the kernel when trying to record
the hostname which we need for NLM requests. The previous patch was incomplete.

PR:		125849
Pointy hat:	dfr
2008-07-24 14:02:03 +00:00
Doug Rabson
db428b786c Don't use a userspace pointer in the kernel when trying to record the hostname
which we need for NLM requests.

PR:		125849
2008-07-24 13:42:28 +00:00
Darren Reed
52c7653383 2020447 IPFilter's NAT can undo name server random port selection
Approved by:	darrenr
MFC after:	1 week
Security:	CERT VU#521769
2008-07-24 12:35:05 +00:00
Ed Schouten
75ec42320d Don't include <sys/tty.h> in non-TTY drivers.
The kbd, kbdmux, ugen and uhid drivers included <sys/tty.h>, because
they needed clists, which have been moved to <sys/clist.h> some time
ago. In the MPSAFE TTY branch, <sys/tty.h> does not include
<sys/clist.h>, which means we have to teach these drivers to include
this header file directly.

Approved by:	philip (mentor, implicit)
2008-07-24 09:54:10 +00:00
Ed Schouten
b377be43a5 Add TIOCPKT and TIOCSPTLCK to the Linuxolator.
We're very lucky, because the flags used by our TIOCPKT implementation
are the same as flags used by Linux. We can safely enable TIOCPKT,
assuming EXTPROC is not used.

TIOCSPTLCK is used by unlockpt(). Because we don't need unlockpt() in
our implementation, make this ioctl a no-op.

Approved by:	philip (mentor, implicit), rdivacky
Obtained from:	P4 (//depot/projects/mpsafetty/...)
2008-07-23 17:47:44 +00:00
Roman Divacky
0864e2a4f1 Fix linux_alarm, the linux behaviour is to limit the
secs to INT_MAX when the passed in parameter is bigger
than INT_MAX.

Submitted by:	Dmitry Chagin <chagin.dmitry gmail com>
Approved by:	kib (mentor)
2008-07-23 17:19:02 +00:00
Dag-Erling Smørgrav
b39cb07cbc Remove debugging cruft. 2008-07-23 16:44:20 +00:00
Dag-Erling Smørgrav
75f31a5fe4 pjd@'s r180759 was intended to revert r180755 due to ipfilter breakage,
but removed too much, breaking the build in other places instead.  Now
that the ipfilter issue has been fixed (or hacked around), address the
second issue by restoring r180755, with one small change.  I don't feel
comfortable using assert(3) in a header that will be included in userland
code that may or may not already have an assertion mechanism in place,
so KASSERT() evaluates to a no-op in the !_KERNEL case.
2008-07-23 16:40:07 +00:00
John Baldwin
b661868711 Further refine the probe order of devices to more closely match the previous
behavior.  Specifically, probe Host-PCI bridges in the order they are
encountered in the tree.  For CPUs, just use an order of 100000 and assume
that no Host-PCI bridges will be more than 10000 levels deep in the
namespace.  This fixes an issue on some boxes where the HPET timer stopped
attaching.
2008-07-23 15:13:06 +00:00
Pawel Jakub Dawidek
72b60ff82c Back out this change, as it breaks the build and I don't have time for
a better fix today.
2008-07-23 15:12:45 +00:00
Konstantin Belousov
89672c6337 The ffs_balloc_ufs{1,2} functions call bdwrite() while having several
vnode buffers locked at once. In particular, there are indirect buffers
among locked ones. The bdwrite() may start the flushing to keep dirty
buffer list at the bounds. If any buffer on the dirty list requires
translation from logical to physical block number, code may ends up
trying to lock an indirect buffer already locked in ffs_balloc_ufsX.

Prevent the bdflush() activity when several buffers are locked at once
by setting the TDP_INBDFUSH for the problematic code blocks.

Reported and tested by:	pho, Josef Buchsteiner at Juniper
In collaboration with:	kan
MFC after:	1 month
2008-07-23 14:32:44 +00:00
Luoqi Chen
e8f00dec4b Unbreak cc -pg support on i386. In gcc 4.2, %ecx is used as the arg pointer
when stack realignment is turned on (it is ALWAYS on for main), however
in a profiling build %ecx would be clobbered by mcount(), this would lead
to a segmentation fault when the code tries to reference any argument.
This fix changes mcount() to preserve %ecx.

PR:		bin/119709
Reviewed by:	bde
MFC after:	1 week
2008-07-23 11:37:20 +00:00
Pawel Jakub Dawidek
a16ab3b093 Check for negative reference count.
Reviewed by:	des
2008-07-23 11:17:46 +00:00
Weongyo Jeong
138ddff935 when NDIS framework try to query/set informations NDIS drivers can
return NDIS_STATUS_PENDING.  In this case, it's waiting for 5 secs to
get the response from drivers now.  However, some NDIS drivers can send
the response before NDIS framework gets ready to receive it so we might
always be blocked for 5 secs in current implementation.  NDIS framework
should reset the event before calling NDIS driver's callback not after.

MFC after:	1 month
2008-07-23 10:49:27 +00:00
Luoqi Chen
4522ac77de SATA device on some nForce based boards could get confused if MSI is not
used but MSI to HyperTransport IRQ mapping is enabled, and would act as
if MSI is turned on, resulting in interrupt loss.

This commit will,
1. enable MSI mapping on a device only when MSI is enabled for that
   device and the MSI address matches the HT mapping window.
2. enable MSI mapping on a bridge only when a downstream device is
   allocated an MSI address in the mapping window

PR:		kern/118842
Reviewed by:	jhb
MFC after:	1 week
2008-07-23 09:44:36 +00:00
Doug Rabson
6dc0afa896 Re-work the code slightly to avoid a possible livelock.
MFC after:	2 weeks
2008-07-23 09:18:08 +00:00
Konstantin Belousov
8b4a2800de Do the pargs_hold() on the copy of the pointer to the p_args of the
child process immediately after bulk bcopy() without dropping the
process lock.

Since process is not single-threaded when forking, dropping and
reacquiring the lock allows an other thread to change the process title
of the parent in between, and results in hold being done on the invalid
pointer. The problem manifested itself as the double free of the old
p_args.

Reported by:	kris
Reviewed by:	jhb
MFC after:	1 week
2008-07-23 08:45:25 +00:00
Robert Watson
33f0efe6b0 Minor white space tweak.
Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-23 07:42:31 +00:00
Warner Losh
b3f1e9378b Only descend into the boot directory for the architecture if it
actually exists and is a directory or symlink to a directory.
2008-07-23 07:23:33 +00:00
Warner Losh
a30c29f9f5 Disable SSP for mips until support is added to the base architecture. 2008-07-23 06:16:34 +00:00
Ed Schouten
8c2ceafebf Move the NFS/RPC code away from lbolt.
The kernel has a special wchan called `lbolt', which is triggered each
second. It doesn't seem to be used a lot and it seems pretty redundant,
because we can specify a timeout value to the *sleep() routines. In an
attempt to eventually remove lbolt, make the NFS/RPC code use a timeout
of `hz' when trying to reconnect.

Only the TTY code (not MPSAFE TTY) and the VFS syncer seem to use lbolt
now.

Reviewed by:	attilio, jhb
Approved by:	philip (mentor), alfred, dfr
2008-07-22 21:27:22 +00:00
Peter Wemm
fbbc785240 Trivial commit to attempt to diagnose a svn problem. Add
comment that Tivo disks are APM, but do not have a DDR record.
2008-07-22 18:05:50 +00:00
Robert Watson
93536b495d If an AUE_SYSCTL_NONADMIN audit event is selected, generate a record
with equivilent content to AUE_SYSCTL.

Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-22 17:54:32 +00:00
Robert Watson
30d0721b59 Further minor style fixes to audit.
Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-22 17:49:30 +00:00
Robert Watson
1814e5b748 Remove unneeded \ at the end of a macro.
Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-22 17:08:27 +00:00
Robert Watson
3c4636a7d4 Further minor white space tweaks.
Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-22 17:06:49 +00:00
Robert Watson
fc1286c81d Generally avoid <space><tab> as a white space anomoly.
Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-22 16:44:48 +00:00
Robert Watson
0c0a142a52 Use #define<tab> rather than #define<space>.
Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-22 16:21:59 +00:00
Andrey A. Chernov
d16863efa6 1) Initialize arc4_i and arc4_j to 0 after key mixing as recommended in
draft-kaukonen-cipher-arcfour-03.txt (3.1.5)

2) Drop first 768 bytes as standard RC4-drop(768)
2008-07-22 16:16:51 +00:00
Robert Watson
f1cb603072 Comment fix.
Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-22 16:02:21 +00:00
Robert Watson
98ee1b30aa Comment typo fix.
Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-22 15:54:10 +00:00
Robert Watson
c2f027ffb8 Minor white space synchronization to Apple version of security audit.
Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-22 15:49:19 +00:00
Robert Watson
bc9a43d698 In preparation to sync Apple and FreeBSD versions of security audit,
pick up the Apple Computer -> Apple change in their copyright and
license templates.

Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-22 15:29:48 +00:00
Robert Watson
59b622e6b3 Use unsigned int when iterating over groupsets in audit_arg_groupset().
Obtained from:	Apple Inc.
MFC after:	3 days
2008-07-22 15:17:21 +00:00
Stanislav Sedov
cde9cd82fe - Whitespace fixes.
Approved by:	gonzo
MFC after:	1 week
2008-07-22 14:04:06 +00:00
Marius Strobl
93060c6c1b o Fix style(9) bugs and similar nits.
o Merge ncr53c9x.c from NetBSD:
  1.115: fix variable shadowing
  1.118: __inline -> inline
  1.121: fix empty if
2008-07-22 13:51:21 +00:00
Andrey A. Chernov
9b78febf8e Bump __FreeBSD_version for arc4random_buf() and arc4random_uniform()
added.
2008-07-22 13:38:17 +00:00
Marius Strobl
109c391928 For sun4v ensure there is an opt_global.h with SUN4V defined included,
even for the stand-alone build.
2008-07-22 09:56:45 +00:00
Olivier Houchard
7cff8ceafb Disable SSP for the kernel on arm as well (see rev 180605).
I overlooked this because a SSP kernel booted for me.

Apologises to:	ticso
2008-07-22 09:38:12 +00:00
Tai-hwa Liang
df9cf830d1 Trying to fix compilation bustage:
- removing 'const' qualifier from an input parameter to conform to the type
  required by rw_assert();
- using in_addr->s_addr to retrive 32 bits address value.

Observed by:	tinderbox
2008-07-22 04:23:57 +00:00
Attilio Rao
09400d5abe - Disallow XFS mounting in write mode. The write support never worked really
and there is no need to maintain it.
- Fix vn_get() in order to let it call vget(9) with a valid locking
  request.  vget(9) returns the vnode locked in order to prevent recycling,
  but in this case internal XFS locks alredy prevent it from happening, so
  it is safe to drop the vnode lock before to return by vn_get().
- Add a VNASSERT() in vget(9) in order to catch malformed locking requests.

Discussed with:	kan, kib
Tested by:	Lothar Braun <lothar at lobraun dot de>
2008-07-21 23:01:09 +00:00
Kip Macy
9d29c635da make new accessor functions consistent with existing style 2008-07-21 22:11:39 +00:00
Kip Macy
99d803b98f remove call to unsafe tcp_twstart function 2008-07-21 21:23:43 +00:00
Kip Macy
84330faa64 - Switch to INP_WLOCK macro from inp_wlock
- calling sodisconnect after tcp_twstart is both gratuitous and unsafe - remove

Submitted by:	rwatson
2008-07-21 21:22:56 +00:00
Robert Watson
828e07694c If run_interrupt_driven_config_hooks() waits 360 seconds and INVARIANTS
is compiled into the kernel, then panic.

MFC after:	3 days
Discussed with:	scottl
2008-07-21 20:50:49 +00:00
John Baldwin
847bd80810 Allocate a single CCB at the start of the main loop of the RAID monitoring
kthread of the mpt(4) driver that hangs around for the entire lifetime of
the thread.  Previously the driver would allocate a new CCB using M_WAITOK
with a lock held each time it updated its state.  While here, use the
CAM API for allocating a CCB rather than raw malloc(9).

Reviewed by:	scottl
MFC after:	1 week
2008-07-21 18:43:02 +00:00
Marius Strobl
6ab60a4bdd - Remove redundant inclusion of opt_global.h.
- Use __FBSDID in autoconf.c.

MFC after:	3 days
2008-07-21 17:15:51 +00:00
Pawel Jakub Dawidek
7f41115ef6 Implement the following macros for completeness:
SYSCTL_QUAD()
	SYSCTL_ADD_QUAD()
	TUNABLE_QUAD()
	TUNABLE_QUAD_FETCH()

Now we can use 64bit tunables on 32bit systems.
2008-07-21 15:05:25 +00:00
Pawel Jakub Dawidek
37876323b1 We want to use LBOLT instead of lbolt on FreeBSD.
I've this already fixed in p4, but the fix was never integrated into HEAD.

Reported by:	ed
2008-07-21 14:35:48 +00:00
Pawel Jakub Dawidek
28814ddbe8 We want to check new options given, not the current ones.
This fixes 'zpool import -o <mntopt> <name>' not working properly.
2008-07-21 09:45:44 +00:00
Kip Macy
7038c6d2c1 remove unneeded declarations 2008-07-21 02:34:52 +00:00
Kip Macy
9a027ea9a4 remove local version of tcp_offload_* functions 2008-07-21 02:29:40 +00:00
Kip Macy
d21cb942bc update syncache function names 2008-07-21 02:26:49 +00:00
Kip Macy
b1f8bd6464 Add versions of tcp_twstart, tcp_close, and tcp_drop that hide the acquisition the tcbinfo lock.
MFC after:	1 week
2008-07-21 02:23:02 +00:00
Kip Macy
83324f5cb5 remove cxgb local definition of locked syncache_expand 2008-07-21 02:17:27 +00:00
Kip Macy
409d8ba5c7 add interface for external consumers to syncache_expand - rename syncache_add in a manner consistent with other bits intended for offload 2008-07-21 02:11:06 +00:00
Kip Macy
e331636d14 remove cxgb local definitions of socket accessor functions 2008-07-21 01:23:19 +00:00
Kip Macy
dd0e6c383a Add accessor functions for socket fields.
MFC after:	1 week
2008-07-21 00:49:34 +00:00
Kip Macy
9378e4377f add inpcb accessor functions for fields needed by TOE devices 2008-07-21 00:08:34 +00:00
Julian Elischer
44554a6de7 Add support for actually sending WCCP return packets via GRE.
This MAY be combined by a clever person with the 'key' code recently
added, however a cursary glance suggest that it would be safer to just keep
the patches as it is unlikely that the two modes would be used together
and the separate patch has been extensively tested.

Obtained from:	 here and there
MFC after:	1 week
2008-07-20 21:45:15 +00:00
Pawel Jakub Dawidek
5527ecd9a5 Clear passphrase buffer after use.
Submitted by:	Fabian Keil <fk@fabiankeil.de> (a bit different version)
2008-07-20 19:56:13 +00:00
Tom Rhodes
3377c9613e Document a few sysctls. While here, remove dead code
related to ip4_esp_randpad.

Reviewed by:	gnn, bz (older version)
Approved by:	gnn
Tested with:	make universe
2008-07-20 17:51:58 +00:00
Scott Long
92130a8f2e While spin-waiting for the mailbox semaphore to update, do flushing reads of
PCI bus so that we don't have to wait more than needed.
2008-07-20 16:50:14 +00:00
Tom Rhodes
41698ebf5b Document a few sysctls.
Reviewed by:	rwatson
2008-07-20 15:29:58 +00:00
Tom Rhodes
941b15a3e0 Document a few sysctls.
Reviewed by:	rwatson
2008-07-20 15:25:20 +00:00
Bjoern A. Zeeb
8699ea087e ia is a pointer thus use NULL rather then 0 for initialization and
in comparisons to make this more obvious.

MFC after:	5 days
2008-07-20 12:31:36 +00:00
Maxim Konovalov
6de078f1c0 o Add cddl, nlm and xdr to CSCOPEDIRS.
o Add pc98 and sun4v to CSCOPE_ARCHDIR.

PR:		misc/125792
Submitted by:	KOIE Hidetaka
MFC after:	1 week
2008-07-20 09:16:00 +00:00
Pawel Jakub Dawidek
48aadb632b Convert lock that protects sessions list from a mutex to a rwlock.
Now we can use read lock in fast path (padlock_process()).
2008-07-20 07:34:00 +00:00
Alan Cox
14e69e48b8 Eliminate dead code. (The commit message for revision 1.287 explains why
this code is dead.)
2008-07-20 04:13:51 +00:00
Kip Macy
b1bc0b2a86 remove unused toedev functions and add comments for rest 2008-07-20 02:02:50 +00:00
Alan Cox
9a8f043722 Increase the ceiling on the size of the buffer map. 2008-07-19 23:42:38 +00:00
Alan Cox
f6c12ae7f0 Correct the description of v_cache_count. Eliminate an unused function. 2008-07-19 22:35:13 +00:00
Pawel Jakub Dawidek
a80d8caa74 Say hi to svn, by simplifing ffs_vget() function a bit - there is no need for
a variable that is used only once.
2008-07-19 22:29:44 +00:00
Robert Watson
1cc2bd820b Rather than simply waiting silently and indefinitely for all
interrupt-driven configuration handlers to complete, print out a
diagnostic message every 60 second indicating which handlers are
still running.  Do this at most 5 times per run so as to avoid
scrolling out any useful information from the kernel message
buffer.

The interval of 60 seconds was selected based on a best guess as
to the nature of "long enough" and may want to be tuned higher
or lower depending on real-world tolerances.

MFC after:	3 days
Discussed with:	scottl
2008-07-19 19:08:35 +00:00
Robert Watson
1a4b919f8e witness_addgraph() is required even if DDB isn't compiled into the kernel,
so exclude it from #ifdef DDB.

Submitted by:	attilio
2008-07-19 17:47:23 +00:00
Ulf Lilleengen
14e96b45e8 - When renaming a drive, also set the drive name in the gvinum header.
PR:		kern/125632
Approved by:	pjd (mentor)
MFC after:	3 days
2008-07-19 13:53:11 +00:00
Robert Watson
51c0f94ed7 Add DDB "show conifhk" command, which lists hooks currently waiting
for completion in run_interrupt_driven_config_hooks().  This is
helpful when trying to figure out which device drivers have gone
into la-la land during boot-time autoconfiguration.

MFC after:	3 days
2008-07-19 12:12:54 +00:00
Jeff Roberson
9fc51b0bf4 Fix a race which could result in some timeout buckets being skipped.
- When a tick occurs on a cpu, iterate from cs_softticks until ticks.
   The per-cpu tick processing happens asynchronously with the actual
   adjustment of the 'ticks' variable.  Sometimes the results may
   be visible before the local call and sometimes after.  Previously this
   could cause a one tick window where we didn't evaluate the bucket.
 - In softclock fetch curticks before incrementing cc_softticks so we
   don't skip insertions which were made for the current time.

Sponsored by:	Nokia
2008-07-19 05:18:29 +00:00
Jeff Roberson
e980fff622 - Check whether we've recorded this tick in ts_ticks on another cpu in
sched_tick() to prevent multiple increments for one tick.  This pushes
   the value out of range and breaks priority calculation.

Reviewed by:	kib
Found by:	pho/nokia
Sponsored by:	Nokia
MFC after:	3 days
2008-07-19 05:13:47 +00:00
Alan Cox
59a23cacd4 Correct an error in pmap_change_attr()'s initial loop that verifies that the
given range of addresses are mapped.  Previously, the loop was testing the
same address every time.

Submitted by:	Magesh Dhasayyan
2008-07-18 22:05:51 +00:00
Alan Cox
53d13c6030 Simplify pmap_extract()'s control flow, making it more like the related
functions pmap_extract_and_hold() and pmap_kextract().
2008-07-18 20:07:50 +00:00
Alan Cox
fb272dc841 Eliminate stale comments from kmem_malloc(). 2008-07-18 17:41:31 +00:00
David Malone
744eaff7e6 Add an accept filter for TCP based DNS requests. It waits until the
whole first request is present before returning from accept.
2008-07-18 14:44:51 +00:00
Robert Watson
3b19fa3597 Eliminate use of the global ripsrc which was being used to pass address
information from rip_input() to rip_append().  Instead, pass the source
address for an IP datagram to rip_append() using a stack-allocated
sockaddr_in, similar to udp_input() and udp_append().

Prior to the move to rwlocks for inpcbinfo, this was not a problem, as
use of the global was synchronized using the ripcbinfo mutex, but with
read-locking there is the potential for a race during concurrent
receive.

This problem is not present in the IPv6 raw IP socket code, which
already used a stack variable for the address.

Spotted by:	mav
MFC after:	1 week (before inpcbinfo rwlock changes)
2008-07-18 10:47:07 +00:00
Kip Macy
694382c8eb revert local change 2008-07-18 07:10:33 +00:00
Kip Macy
2976b312a1 revert change from local tree 2008-07-18 07:07:57 +00:00
Kip Macy
38ddd4d3ed new vendor PHY support 2008-07-18 07:01:51 +00:00
Kip Macy
0ffc57f58d revert changes accidentally included in last commit 2008-07-18 06:22:57 +00:00
Alan Cox
7b4270021d Eliminate unused global variables. (These global variables became fields of
struct kva_md_info many years ago.)
2008-07-18 06:14:36 +00:00
Kip Macy
4af83c8cff import vendor fixes to cxgb 2008-07-18 06:12:31 +00:00
Pyun YongHyeon
7a4e8171ba Correct 1000Mbps link handling logic for JMC250. This should make
jme(4) run on 1000Mbps link.
2008-07-18 04:20:48 +00:00
Pyun YongHyeon
91216e1ef1 Use DELAY() instead of pause if waiting time is less than 1ms.
This will fix driver hang if hz < 1000.

Pointed out by:	thompsa
2008-07-18 01:00:54 +00:00
Luoqi Chen
47cb006cdd Fix a benign typo that would give out an incorrect warning message.
Change a get-or-set sequence on OHCI_COMMAND_STATUS register which
is "write to set" to a simple set.
2008-07-17 22:40:23 +00:00
Konstantin Belousov
9a75ea2333 Pair the VOP_OPEN call from do_execve() with the reciprocal VOP_CLOSE.
This was unnoticed because local filesystems usually do nothing
non-trivial in the close vop.

Reported and tested by:	Rick Macklem
MFC after:	2 weeks
2008-07-17 16:44:07 +00:00
Andrew Gallatin
e749ef6bab Clean up mxge's use of callouts as pointed out by jhb,
and handle NIC hardware watchdog resets.

- remove buggy code at the top of mxge_tick() which tried
  to detect a race which is already detected in the kernel's
  callout code.

- move callout_stop() and callout_reset() into mxge_close()
  mxge_open() rather than doing the callout manipulation
  all over the place.

- use callout_drain(), rather than callout_stop() to prevent
  a potential race between mxge_tick() and mxge_detach()
  which could lead to softclock using a destroyed mutex

- restructure the mxge_tick() and mxge_watchdog_reset()
  routines to avoid resetting a callout, and then
  immediately stopping it if the watchdog reset routine
  is called, and fails.

- enable the driver to handle NIC hardware watchdog
  resets by restoring the NIC's PCI config space, which is
  lost when the NIC hardware watchdog triggers.

Reviewed by: jhb (previus version)
2008-07-17 15:46:35 +00:00
Ed Schouten
16be775eff Move the TCSA* definitions out of _KERNEL. They are processed in libc.
The tcsetattr() routine already converts the TCSA* arguments to their
respective TIOCSETA* ioctl's in the C library. There is no need to have
these definitions inside the kernel.

Approved by:	philip (mentor, implicit)
2008-07-16 12:36:39 +00:00
Ed Schouten
7717bbe1ed Sort the ioctl's in <sys/ttycom.h> by number.
I think one of the reasons why we have so many conflicts in the TTY
ioctl category, is because the ioctl's aren't ordered logically. This
commit only sorts them by number. The comments may still be inaccurate.

Approved by:	philip (mentor)
2008-07-16 11:23:15 +00:00
Ed Schouten
94a340ae73 Remove OTTYDISC, NETLDISC and NTTYDISC definitions.
When I ported most applications away from <sgtty.h>, I noticed none of
them were actually using these definitions. I kept them in place,
because I didn't want to touch tools like pstat(8) and stty(1).

In preparation for the MPSAFE TTY layer, remove these definitions. This
doesn't have any impact with respect to binary compatibility (see
tty_conf.c).

We couldn now add an #error to <sys/ioctl_compat.h> when included
outside the kernel. Unfortunately, kdump's mkioctls includes this file
unconditionally.

Approved by:	philip (mentor)
2008-07-16 11:20:04 +00:00
Robert Watson
ca528788b8 Fix error in comment.
MFC after:	3 weeks
2008-07-16 10:55:50 +00:00
Pyun YongHyeon
6b284b784a Fix a multicast handling regression on VT6105M introduced in
vr(4) overhauling(r177050).

It seems that filtering multicast addresses with multicast CAM
entries require accessing 'CAM enable bit' for each CAM entry.
Subsequent accessing multicast CAM control register without
toggling the 'CAM enable bit' seem to no effects.
In order to fix that separate CAM setup from CAM mask configuration
and CAM entry modification. While I'm here add VLAN CAM filtering
feature which will be enabled in future(FreeBSD now can receive
VLAN id insertion/removal event from vlan(4) on the fly).

For VT6105M hardware, explicitly disable VLAN hardware tag
insertion/stripping and enable VLAN CAM filtering for VLAN id 0.
This shall make non-VLAN frames set VR_RXSTAT_VIDHIT bit in Rx
status word.

Added multicast/VLAN CAM address definition to header file.

PR:	kern/125010, kern/125024
MFC after:	1 week
2008-07-16 08:35:29 +00:00
Pyun YongHyeon
0a76b25957 Fix VR_RXSTAT_RX_OK bit definition which lasted for more than 9
years. All datasheet I have indicates the bit 15 is the
VR_RXSTAT_RX_OK. The bit 14 is reserved for all Rhine family
except VT6105M. VT6105M uses that bit to indicate a VLAN frame
with matching CAM VLAN id.
Use the VR_RXSTAT_RX_OK instead of VR_RXSTAT_RXERR when vr(4)
checks the validity of received frame.
This should fix occasional dropping frames on VT6105M.

Tested by:	Goran Lowkrantz ( goran.lowkrantz at ismobile dot com )
MFC after:	1 week
2008-07-16 08:02:23 +00:00
Robert Watson
43cc0bc1df Merge last of a series of rwlock conversion changes to UDP, which
completes the move to a fully parallel UDP transmit path by using
global read, rather than write, locking of inpcbinfo in further
semi-connected cases:

- Add macros to allow try-locking of inpcb and inpcbinfo.
- Always acquire an incpcb read lock in udp_output(), which stablizes the
  local inpcb address and port bindings in order to determine what further
  locking is required:
  - If the inpcb is currently not bound (at all) and are implicitly
    connecting, we require inpcbinfo and inpcb write locks, so drop the
    read lock and re-acquire.
  - If the inpcb is bound for at least one of the port or address, but an
    explicit source or destination is requested, trylock the inpcbinfo
    lock, and if that fails, drop the inpcb lock, lock the global lock,
    and relock the inpcb lock.
  - Otherwise, no further locking is required (common case).
- Update comments.

In practice, this means that the vast majority of consumers of UDP sockets
will not acquire any exclusive locks at the socket or UDP levels of the
network stack.  This leads to a marked performance improvement in several
important workloads, including BIND, nsd, and memcached over UDP, as well
as significant improvements in pps microbenchmarks.

The plan is to MFC all of the rwlock changes to RELENG_7 once they have
settled for a weeks in the tree.

Tested by:	ps, kris (older revision), bde
MFC after:	3 weeks
2008-07-15 15:38:47 +00:00
Rui Paulo
b27227029b Fix commment in typo.
M    tcp_output.c
2008-07-15 10:32:35 +00:00
Alan Cox
36e6513df5 Update bus_dmamem_alloc()'s first call to malloc() such that M_WAITOK is
specified when appropriate.

Reviewed by:	scottl
2008-07-15 03:34:49 +00:00
Xin LI
ff7b31cb8f Add quirk for Dell D630 laptops.
Tested by:	Quake Lee <quakelee geekcn org>,
		Robert Noland <rnoland 2hip net>
MFC after:	1 week
Approved by:	ariff
2008-07-15 02:34:44 +00:00
Jung-uk Kim
968c88bc75 Allow injecting big packets via bpf(4) up to min(MTU, 16K-byte).
MFC after:	1 week
2008-07-14 22:41:48 +00:00
David E. O'Brien
1989184838 Match the implementation of the inline function from libkern.h. 2008-07-14 21:36:02 +00:00
Ermal Luçi
7972c979c5 Fix carp(4) panics that can occur during carp interface configuration.
Approved by:	mlaier (mentor)
Reported by:	Scott Ullrich
MFC after:	1 week
2008-07-14 20:11:51 +00:00
Jack F Vogel
c725524cd5 Add event notification at attach/detach so the NIC
is able to detect it and do hardware filtering.
2008-07-14 18:40:21 +00:00
Jack F Vogel
fa79ddefbe Add an event handler to the vlan driver so the NIC driver
becomes aware of it, and gets the VLAN ID. This will allow
the easy use of VLAN hardware filtering by adapters that
support it.
2008-07-14 18:38:52 +00:00
Tom Rhodes
54d1e01094 Fill in the string portion of the bluetooth stack version sysctl.
Approved by:	emax
2008-07-14 13:45:05 +00:00
Doug Barton
9335f224bb Change the character prefixed to the svn version to "r" since that seems
to be how they are commonly referred to.
2008-07-13 20:08:38 +00:00
Alan Cox
cfcbf8c6fd Handle a race between pmap_kextract() and pmap_promote_pde(). This race
caused ZFS to crash when restoring a snapshot with superpage promotion
enabled.

Reported by:	kris
2008-07-13 18:19:53 +00:00
Antoine Brodin
23d5e112eb Staticize M_STACK.
Approved by:	rwatson (mentor)
MFC after:	1 month
2008-07-13 17:15:05 +00:00
Ed Schouten
f4d811f0b2 Make uart(4) the default serial port driver on i386 and amd64.
The uart(4) driver has the advantage of supporting a wider variety of
hardware on a greater amount of platforms. This driver has already been
the standard on platforms such as ia64, powerpc and sparc64.

I've decided not to change anything on pc98. I'd rather let people from
the pc98 team look at this.

Approved by:	philip (mentor), marcel
2008-07-13 07:20:14 +00:00
Bernd Walter
fe228e4a7a fix multicast hash register definition 2008-07-12 23:40:07 +00:00
Alan Cox
8bfadfd616 Refine the changes made in SVN rev 180430. Specifically, instantiate a new
page table page only if the 2MB page mapping has been used.  Also, refactor
some assertions.
2008-07-12 21:24:42 +00:00
Craig Rodrigues
1aad294b4e In nmount(), if we see "update" in the mount options,
set MNT_UPDATE in fsflags, and delete the
"update" option from the global mount options.

MNT_UPDATE is a command, and not a property of a mount
that should persist after the command is executed.

We need to do similar things for MNT_FORCE and MNT_RELOAD.

All mount flags are prefixed by MNT_..... it would
be nice if flags which were commands were named differently
from flags which are persistent properties of a mount.
This was not such a big deal in the pre-nmount() days,
but with nmount() it is more important.

Requested by:	yar
MFC after:	2 weeks
2008-07-12 20:12:40 +00:00
Alan Cox
85a0a1be91 In order to apply pmap_demote_pde() to a page directory entry (PDE) from the
direct map, the PDE must have PG_M and PG_A preset.

Noticed by: Magesh Dhasayyan
2008-07-12 18:43:57 +00:00
Scott Long
22657ce129 A number of significant enhancements to the ciss driver:
1.  The FreeBSD driver was setting an interrupt coalesce delay of 1000us
for reasons that I can only speculate on.  This was hurting everything
from lame sequential I/O "benchmarks" to legitimate filesystem metadata
operations that relied on serialized barrier writes.  One of my
filesystem tests went from 35s to complete down to 6s.

2.  Implemented the Performant transport method.  Without the fix in
(1), I saw almost no difference.  With it, my filesystem tests showed
another 5-10% improvement in speed.  It was hard to measure CPU
utilization in any meaningful way, so it's not clear if there was a
benefit there, though there should have been since the interrupt handler
was reduced from 2 or more PCI reads down to 1.

3.  Implemented MSI-X.  Without any docs on this, I was just taking a
guess, and it appears to only work with the Performant method.  This
could be a programming or understanding mistake on my part.  While this
by itself made almost no difference to performance since the Performant
method already eliminated most of the synchronous reads over the PCI
bus, it did allow the CISS hardware to stop sharing its interrupt with
the USB hardware, which in turn allowed the driver to become decoupled
from the Giant-locked USB driver stack.  This increased performance by
almost 20%.  The MSI-X setup was done with 4 vectors allocated, but only
1 vector used since the performant method was told to only use 1 of 4
queues.  Fiddling with this might make it work with the simpleq method,
not sure.  I did not implement MSI since I have no MSI-specific hardware
in my test lab.

4.  Improved the locking in the driver, trimmed some data structures.
This didn't improve test times in any measurable way, but it does look
like it gave a minor improvement to CPU usage when many
processes/threads were doing I/O in parallel.  Again, this was hard to
accurately test.
2008-07-11 21:20:51 +00:00
Xin LI
b4b9862495 Don't leak DMA map if not freed.
Submitted by:	kevlo
2008-07-11 18:26:12 +00:00
Maksim Yevmenkin
f0f78f3513 Dust off old code for support of USB isochronous transfers.
USB isochronous transfer support is required for Bluetooth SCO.
While i'm here change u_int to uint and update TODO.
This should produce no visible changes unless the device is
broken (or really old).

MFC after:	3 months
2008-07-11 17:13:43 +00:00
Ulf Lilleengen
56af4c6141 - Fix a logic error when updating plex configuration.
Approved by:	pjd (mentor)
2008-07-11 16:46:29 +00:00
David E. O'Brien
b474c780b5 Improve readability and cscope searches a little bit by not using the
same variable name in closely related (but not conflicting) contexts.
2008-07-11 14:48:28 +00:00
Konstantin Belousov
11041003c6 Use the VM_ALLOC_INTERRUPT for the page requests when allocating memory
for the bio for swapout write. It allows the page allocator to drain
free page list deeper. As result, a deadlock where pageout deamon sleeps
waiting for bio to be allocated for swapout is no more reproducable in
practice.

Alan said that M_USE_RESERVE shall be ressurrected and used there, but
until this is implemented, M_NOWAIT does exactly what is needed.

Tested by:	pho, kris
Reviewed by:	alc
No objections from:	phk
MFC after:	2 weeks (RELENG_7 only)
2008-07-11 11:27:42 +00:00
Konstantin Belousov
ae95dc623a Make it atomic for the devfs_populate_loop() to see the setting of
SI_ALIAS flag and initialization of the si_parent when alias is created.
Assert that supplied parent device is not NULL.

Both situations could cause NULL dereference in the
devfs_populate_loop() when creating a symlink for SI_ALIAS'ed device.
Namely, cdp->cdp_c.si_parent may be NULL.

Reported by:	mav
MFC after:	2 weeks
2008-07-11 11:22:19 +00:00
David E. O'Brien
4f2945f832 Revert r180431.
r180431 broke the AMD64 build (the only arch using kern/link_elf_obj.c)
2008-07-11 01:10:40 +00:00
Remko Lodder
1d69e13d1f Detect ATA controllers in the Macbook3.
PR:		118135
Submitted by:	ed
Approved by:	imp (mentor, implicit)
MFC after:	1 week
2008-07-10 21:36:53 +00:00
Brooks Davis
e44f0b2a63 style(9): put parentheses around return values. 2008-07-10 19:54:34 +00:00
Brooks Davis
774b72e12e Regen 2008-07-10 17:46:58 +00:00
Brooks Davis
a8c6d6d0ba id_t is a 64-bit integer and thus is passed as two arguments like off_t is.
As a result, those arguments must be recombined before calling the real
syscal implementation.  This change fixes 32-bit compatibility for
cpuset_getid(), cpuset_setid(), cpuset_getaffinity(), and
cpuset_setaffinity().
2008-07-10 17:45:57 +00:00
David E. O'Brien
f55ffb3990 Allow 'elf_file_t' to be used in a wider scope. 2008-07-10 16:35:57 +00:00
Alan Cox
e1cb4a353c Extend pmap_demote_pde() to include the ability to instantiate a new page
table page where none existed before.
2008-07-10 16:22:24 +00:00
Robert Watson
3144b7d3d3 Slightly rearrange validation of UDP arguments and jail processing in
udp_output() so that argument validation occurs before jail processing.

Add additional comments explaining what's going on when we process
addresses and binding during udp_output().

MFC after:	3 weeks
2008-07-10 16:20:18 +00:00
David E. O'Brien
2efc107abe Use 'CSCOPE_ARCHDIR' to change the default architecture directories to
cscope.  After the addition of sys/modules/dtrace/dtrace, setting
'ARCHDIR' in /etc/src.conf breaks the build.
2008-07-10 16:03:24 +00:00
Bjoern A. Zeeb
078b704233 Pass the ucred along into in{,6}_pcblookup_local for upcoming
prison checks.

Reviewed by:	rwatson
2008-07-10 13:31:11 +00:00
Bjoern A. Zeeb
cdcb11b92c For consistency take lport as u_short in in{,6}_pcblookup_local.
All callers either pass in an u_short or u_int16_t.

Reviewed by:	rwatson
2008-07-10 13:23:22 +00:00
Robert Watson
1175d9d56d Apply the MAC label to an outgoing UDP packet when other inpcb properties are
processed, meaning that we avoid the cost of MAC label assignment if we're
going to drop the packet due to mbuf exhaustion, etc.

MFC after:	3 weeks
2008-07-10 09:45:28 +00:00
Maksim Yevmenkin
fb8bcdc044 Get in some basic infrastructure for Bluetooth SCO support.
MFC after:	3 months
2008-07-10 00:15:29 +00:00
Peter Wemm
401989b00b Band-aid a problem with 32 bit selector setup.
Initialize %ds, %es, and %fs during CPU startup.  Otherwise a garbage
value could leak to a 32-bit process if a process migrated to a different
CPU after exec and the new CPU had never exec'd a 32-bit process.

A more complete fix is needed, but this mitigates the most frequent
manifestations.

Obtained from:	ups
2008-07-09 19:44:37 +00:00