Commit Graph

68086 Commits

Author SHA1 Message Date
Rafal Jaworowski
1cba14c456 Fix ARM nocache allocator:
- let the loop iterate every page (as intended), and not some multiplies
  (which led to a fake exhaustion of the ARM_NOCACHE_KVA_SIZE)

- eliminate using MIN(): it compared number of pages vs. address
  (ARM_TP_ADDRESS), which was bogus

Reviewed by:	cognet, imp
Obtained from:	Piotr Ziecik kosmo ! semihalf dot com
MFC after:	3 days
2008-08-04 14:47:49 +00:00
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