Commit Graph

85881 Commits

Author SHA1 Message Date
Jung-uk Kim
0b01dbd70b Remove unnecessary static variable initializations and duplicate codes.
Consistently use bcopy(9) over memcpy(9).
2012-03-16 23:54:23 +00:00
Adrian Chadd
a66d508971 Fix a couple of debugging outputs.
* printf -> device_printf
* print the buffer pointer and sequence number for any buffer that wasn't
  correctly tidied up before it was freed.  This is to aid in some
  current SMP TX debugging stalls.

PR:		kern/166190
2012-03-16 23:24:27 +00:00
Adrian Chadd
58816f3f1b Add a dependency on ALQ if IEEE80211_ALQ and/or AH_DEBUG_ALQ is included. 2012-03-16 23:12:40 +00:00
Adrian Chadd
a284b01037 Pull in a dependency on ALQ if it's compiled with IEEE80211_ALQ. 2012-03-16 23:08:13 +00:00
Robert Millan
bb197d4e46 Remove gratuitous DEBUG_FLAGS="-g" setting (this is already the default
option with GENERIC kernels).

Reviewed by:	ken
2012-03-16 21:46:02 +00:00
Davide Italiano
c6111de55d Add rudimentary profiling of the hash table used in the in the umtx code to
hold active lock queues.

Reviewed by:	attilio
Approved by:	davidxu, gnn (mentor)
MFC after:	3 weeks
2012-03-16 20:32:11 +00:00
Tijl Coosemans
786645078b Move userland bits of i386 npx.h and amd64 fpu.h to x86 fpu.h.
Remove FPU types from compat/ia32/ia32_reg.h that are no longer needed.
Create machine/npx.h on amd64 to allow compiling i386 code that uses
this header.

The original npx.h and fpu.h define struct envxmm differently. Both
definitions have been included in the new x86 header as struct __envxmm32
and struct __envxmm64. During compilation either __envxmm32 or __envxmm64
is defined as envxmm depending on machine architecture. On amd64 the i386
struct is also available as struct envxmm32.

Reviewed by:	kib
2012-03-16 20:24:30 +00:00
Tijl Coosemans
545193ce59 Use exact width integer types instead of long in struct env87 in
preparation to merge with amd64.

Reviewed by:	kib
2012-03-16 19:42:39 +00:00
Jung-uk Kim
b1a499f3d8 Do not unnecessarily clear display memory when switching modes.
MFC after:	3 days
2012-03-16 19:22:29 +00:00
John Baldwin
57e58a39d6 Fix build with INET6 disabled. 2012-03-16 17:56:53 +00:00
John Baldwin
3b22825af7 Revert the PCIe 4GB boundary issue workaround now that the proper fix is
in HEAD.

Ok'd by:	scottl
2012-03-16 16:12:10 +00:00
Yoshihiro Takahashi
dff207f860 - Fix to build a native i386 kernel without the SMP and atpic.
- Merge r232744 changes to pc98.
  (Allow a kernel to be built with 'nodevice atpic'.)
- Move ICU related defines from x86/isa/atpic.c to x86/isa/icu.h and
  use them in x86/x86/intr_machdep.c.

Reviewed by:	jhb
2012-03-16 12:13:44 +00:00
Tijl Coosemans
b827337ee6 Remove prototypes of _amd64_get_fsbase et al. The functions were removed
in r145571.
2012-03-16 10:10:17 +00:00
Oleksandr Tymoshenko
66134c7e59 Clean-up fake preload data generator:
- Use macros to push scalar values
- Fix type mismatch for module size
2012-03-15 23:53:24 +00:00
Nathan Whitehorn
0d8d9edaaa Make ofw_bus_get_node() consistently return -1 when there is no associated
OF node, instead of a random mixture of 0 and -1. Update all checks for 0
to check for -1 instead.

MFC after:	4 weeks
2012-03-15 22:53:39 +00:00
Nathan Whitehorn
cd907a68aa Implement pmap_remove_pages(). This will be added later to the 32-bit MMU
module.

Suggested by:	alc
2012-03-15 22:50:48 +00:00
Rafal Jaworowski
fd62dcff8a Fix error check.
Submitted by:	Lukasz Plachno
Obtained from:	Semihalf
2012-03-15 21:48:27 +00:00
Nathan Whitehorn
246e44956e Improve algorithm for deciding whether to loop through all process pages
or look them up individually in pmap_remove() and apply the same logic
in the other ranged operation (pmap_protect). This speeds up make
installworld by a factor of 2 on powerpc64.

MFC after:	1 week
2012-03-15 19:36:52 +00:00
Michael Tuexen
dea47f3999 Clean up, no functional change.
MFC after: 3 days.
2012-03-15 14:22:05 +00:00
Michael Tuexen
99f293a20e Fix bugs which can result in a panic when an non-SCTP socket it
used with an sctp_ system-call which expects an SCTP socket.

MFC after: 3 days.
2012-03-15 14:13:38 +00:00
Andrey V. Elsukov
5284aff594 Add MODULE_DEPEND() to geom_part modules.
MFC after:	2 weeks
2012-03-15 08:39:10 +00:00
Andrey V. Elsukov
b26a09848a Add CTLFLAG_TUN to the sysctl definition and fix style.
Pointed by:	Garrett Cooper
MFC after:	2 weeks
2012-03-15 06:01:21 +00:00
Oleksandr Tymoshenko
fba09d4c08 Fill out fake preload structure to let userland tools like pmc(3) know
about kernel module base address and actual size
2012-03-15 05:29:51 +00:00
Andrey V. Elsukov
199aa9756b Add debug.kld_debug loader tunable.
MFC after:	2 weeks
2012-03-15 05:11:29 +00:00
Oleksandr Tymoshenko
d43022a1b3 - Remove unncessary type casts
- Make kernel backtrace routine more robust by refusing to backtrace
    further when encountered function that is possibly modifies SP
    value
2012-03-14 23:46:07 +00:00
Jung-uk Kim
96ec27d42b Add a PCI quirk to ignore PCI map registers from configuration space.
For example, some BIOS for AMD SB600 south bridge may map HPET MMIO base
address as a memory BAR for SMBus controller depending on a PM register
configuration.  Before r231161 (and r232086, subsequent MFC to stable/9),
it was not fatal but hpet(4) just failed to attach.  Since we probe and
attach HPET earlier than PCI devices now, it caused unfortunate hard lockup.
With this patch, it does not hang any more and HPET works at the same time.
Clean up some style nits while I am in the neighborhood.

PR:		kern/165647
Reviewed by:	jhb
MFC after:	3 days
2012-03-14 23:25:46 +00:00
Xin LI
eacace9317 Add the missing IPOIB option.
Sponsored by:	iXsystems, Inc.
MFC after:	3 days
2012-03-14 22:44:56 +00:00
John Baldwin
df96bc9713 Pedantic nit: use vm_pindex_t instead of long for a count of pages. 2012-03-14 20:57:48 +00:00
Nathan Whitehorn
cbfa304088 Use LIST_FOREACH_SAFE() instead of LIST_FOREACH() in pmap_remove(), since
the point of this loop is to remove elements. This worked by accident before.

MFC after:	2 days
2012-03-14 20:19:49 +00:00
Adrian Chadd
c4b72ba19d Correctly calculate the callout interval for beacon generation.
Submitted by:	monthadar@gmail.com
2012-03-14 16:43:22 +00:00
Jaakko Heinonen
db62ced238 Add an assert for proctree_lock to proc_to_reap().
Discussed with:	kib
MFC after:	1 week
2012-03-14 15:52:23 +00:00
Konstantin Belousov
77b5f5c8e2 Add PCI Id for the AMT SOL UART on G4x series Intel chipsets.
Submitted by:	admin zahost ru
MFC after:	3 days
2012-03-14 14:01:51 +00:00
Gleb Kurtsou
db94ad126a Prevent tmpfs_rename() deadlock in a way similar to UFS
Unlock vnodes and try to lock them one by one. Relookup fvp and tvp.

Approved by:	mdf (mentor)
2012-03-14 09:15:50 +00:00
Gleb Kurtsou
ca846258e2 Don't enforce LK_RETRY to get existing vnode in tmpfs_alloc_vp()
Doomed vnode is hardly of any use here, besides all callers handle error
case. vfs_hash_get() does the same.

Don't mess with vnode holdcount, vget() takes care of it already.

Approved by:	mdf (mentor)
2012-03-14 08:29:21 +00:00
Bernhard Schmidt
fd5c6edb78 Import the latest microcode.h which was used to generate the current
firmware files and adjust the Makefile.

Obtained from:	OpenBSD
2012-03-14 08:00:33 +00:00
Pyun YongHyeon
baaaeac947 Fix white space nits. 2012-03-14 00:54:37 +00:00
Pyun YongHyeon
f9d050a860 fxp(4) does not handle deferred dma map loading. Tell
bus_dmamap_load(9) that it should return immediately with error
when there are insufficient mapping resources.
2012-03-14 00:26:36 +00:00
Konstantin Belousov
064f517d2b Supply boolean as the second argument to ffs_update(), and not a
MNT_[NO]WAIT constants, which in fact always caused sync operation.

Based on the submission by:	bde
Reviewed by:	mckusick
MFC after:	2 weeks
2012-03-13 22:04:27 +00:00
Konstantin Belousov
7335ed90a0 Lock the process around manipulations with p_flag.
Reported and reviewed by:	jh
MFC after:	3 days
2012-03-13 22:00:46 +00:00
Bernhard Schmidt
b1866dfea3 Update the rt2860's firmware and add a Makefile for the module. While
here remove the ucode header file which was used to generate the fw files
but by now is outdated.

Reviewed by:	ray
Obtained from:	OpenBSD
2012-03-13 21:25:25 +00:00
Adrian Chadd
3468c30c95 (Re)-make these ACL routines optional.
They're only currently used by ZFS and UFS_ACL.  They're just wasting space
on embedded platforms with neither enabled.
2012-03-13 20:29:56 +00:00
Adrian Chadd
368a79ddd0 Add dependencies onto acl_posix1e and acl_nfs4. 2012-03-13 20:29:04 +00:00
Adrian Chadd
9124ddeb4a Add module building Makefile entries for NFSv4 and POSIX.1e ACL handling. 2012-03-13 20:28:42 +00:00
Adrian Chadd
a9a282f672 Add module load/unload stubs. 2012-03-13 20:27:48 +00:00
Dimitry Andric
4391754075 Update comments and CFLAGS in sys/conf/kern.mk, introduced in r221879,
to match reality: clang does _not_ disable SSE automatically when
-mno-mmx is used, you have to specify -mno-sse explicitly.

Note this was the case even before r232894, which only makes a change in
the 'positive' flag case; e.g. when you specify -msse, MMX gets enabled
too.

MFC after:	1 week
2012-03-13 19:18:34 +00:00
Alexander V. Chernikov
147972555f Use rt_numfibs variable instead of compile-time RT_NUMFIBS.
Reviewed by:    glebius (previous version)
Approved by:    kib(mentor), ae(mentor)
2012-03-13 11:08:40 +00:00
Alexander Motin
fd053fae73 Add kern.eventtimer.activetick tunable/sysctl, specifying whether each
hardclock() tick should be run on every active CPU, or on only one.

On my tests, avoiding extra interrupts because of this on 8-CPU Core i7
system with HZ=10000 saves about 2% of performance. At this moment option
implemented only for global timers, as reprogramming per-CPU timers is
too expensive now to be compensated by this benefit, especially since we
still have to regularly run hardclock() on at least one active CPU to
update system uptime. For global timer it is quite trivial: timer runs
always, but we just skip IPIs to other CPUs when possible.

Option is enabled by default now, keeping previous behavior, as periodic
hardclock() calls are still used at least to implement setitimer(2) with
ITIMER_VIRTUAL and ITIMER_PROF arguments. But since default schedulers don't
depend on it since r232917, we are much more free to experiment with it.

MFC after:	1 month
2012-03-13 10:21:08 +00:00
Kevin Lo
11753bd018 Use NULL instead of 0 2012-03-13 10:04:13 +00:00
Alexander Motin
7295465e33 Rewrite thread CPU usage percentage math to not depend on periodic calls
with HZ rate through the sched_tick() calls from hardclock().

Potentially it can be used to improve precision, but now it is just minus
one more reason to call hardclock() for every HZ tick on every active CPU.
SCHED_4BSD never used sched_tick(), but keep it in place for now, as at
least SCHED_FBFS existing in patches out of the tree depends on it.

MFC after:	1 month
2012-03-13 08:18:54 +00:00
Adrian Chadd
49def78fbb Remove a now unneeded ARGE_UNLOCK().
Whilst I'm here, remove a couple blank lines.
2012-03-13 06:50:56 +00:00
Juli Mallett
964fdce070 Remove some files not used by the FreeBSD kernel which have been adding quite
a bit of bloat to the kernel source tree's size.
2012-03-13 06:48:26 +00:00
Adrian Chadd
8a5350984f Fix link status handling on if_arge upon system boot to allow bootp/NFS to
function.

From the submitter:

This patch fixes an issue I encountered using an NFS root with an
ar71xx-based MikroTik RouterBoard 450G on -current where the kernel fails
to contact a DHCP/BOOTP server via if_arge when it otherwise should be able
to.  This may be the same issue that Monthadar Al Jaberi reported against
an RSPRO on 6 March, as the signature is the same:

%%%

DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
.
.
.
DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
arge0: initialization failed: no memory for rx buffers
DHCP/BOOTP timeout for server 255.255.255.255
arge0: initialization failed: no memory for rx buffers

%%%

The primary issue that I found is that the DHCP/BOOTP message that
bootpc_call() is sending never makes it onto the wire, which I believe is
due to the following:

- Last December, a change was made to the ifioctl that bootpc_call() uses
to adjust the netmask around the sosend().

- The new ioctl (SIOCAIFADDR) performs an if_init when invoked, whereas the
old one (SIOCSIFNETMASK) did not.

- if_arge maintains its own sense of link state in sc->arge_link_status.

- On a single-phy interface, sc->arge_link_status is initialized to 0 in
arge_init_locked().

- sc->arge_link_status remains 0 until a phy state change notification
causes arge_link_task to run, notice the link is up, and set it to 1.

- The inits caused by the ifioctls in bootpc_call are reinitializing the
interface, but not the phy, so sc->arge_link_status goes to 0 and remains
there.

- arge_start_locked() always sees sc->arge_link_status == 0 and returns
without queuing anything.

The attached patch changes arge_init_locked() such that in the single-phy
case, instead of initializing sc->arge_link_status to 0, it runs
arge_link_task() to set it according to the current phy state.  This change
has allowed my setup to mount an NFS root successfully.

Submitted by:	Patrick Kelsey <kelsey@ieee.org>
Reviewed by:	juli
2012-03-13 06:28:52 +00:00
Juli Mallett
f8e47016ec Don't build kernel.tramp on Octeon. Probably building it should be opt-in
not opt-out, but I don't know enough about which ports need it to get the
defaults right.
2012-03-13 06:22:49 +00:00
Adrian Chadd
eeaef4bae5 Correctly (I hope) deallocate the if_arge RX buffer ring on arge_stop().
I had some interesting hangs until I realised I should try flushing the
DDR FIFO register and lo and behold, hangs stopped occuring.

I've put in a few DDR flushes here and there in case people decide to
reuse some of these functions.  It's very very likely they're almost
all superflous.

To test:

* Connect to a network with a _lot_ of broadcast traffic
* Do this:
  # while true; do ifconfig arge0 down; ifconfig arge0 up; done

This fixes the mbuf exhaustion that has been reported when the interface
state flaps up/down.
2012-03-13 06:15:20 +00:00
Juli Mallett
4ea65e2064 Remove TARGET_BIG_ENDIAN which should have been removed previously. 2012-03-12 21:26:09 +00:00
Juli Mallett
379663d70b o) Use ABI, not ISA_* options, to determine whether to compile bits if libkern
required for the ABI the kernel is being built for.
   XXX This is implemented in a kind-of nasty way that involves including source
       files, but it's still an improvement.
o) Retire ISA_* options since they're unused and were always wrong.
2012-03-12 21:25:32 +00:00
Adrian Chadd
6ff44ffc53 Configuration changes/updates!
* enable ALQ and net80211/ath ALQ logging by default, to make it possible
  to get debug register traces.
* Update some comments
* Enable HWPMC for testing.
2012-03-12 20:32:23 +00:00
Scott Long
3a71b630ff Remove a stale comment.
Submitted by:	jimharris
2012-03-12 20:31:58 +00:00
Scott Long
6ac6f295b0 Final pass at having devices use their bus parent for dma tags. The
remaining drivers that haven't been converted have various problems or
complexities that will be dealt with later.  This list includes:

hptrr, hptmv, hpt27xx - device aggregation across multiple parents
drm - want to talk to the maintainer first
tsec, sec - Openfirmware devices, not sure if changes are warranted
fatm - Done except for unused testing code
usb - want to talk to the maintainer first
ce, cp, ctau, cx - Significant driver changes needed to convey parent info

There are also devices tucked into architecture subtrees that I'll leave
for the respective maintainers to deal with.
2012-03-12 19:29:35 +00:00
Juli Mallett
f1bd1e9dd7 Remove comments about creating DMA tags as children of the DMA tags of their
parent bus where the code has now been modified to do so.

Reviewed by:	scottl
2012-03-12 19:29:32 +00:00
Juli Mallett
fee74cf7e8 Use 64-bit bus space constants on 64-bit kernels. 2012-03-12 18:56:16 +00:00
Scott Long
62ce43ccc8 More conversions of drivers to use the PCI parent DMA tag. 2012-03-12 18:15:08 +00:00
Juli Mallett
11ca697ba5 Remove more unused stuff, primarily a set of (unused, thankfully) PIO
functions.

Adjust nearby style of one assembly function END().
2012-03-12 18:10:01 +00:00
Adrian Chadd
6a77ff29ff This header file no longer exists when doing cross builds, so remove it.
mips24k hwpmc now compiles again.
2012-03-12 17:25:35 +00:00
Alexander V. Chernikov
25a451a451 Fix VNET build broken by r232865.
Temporary remove the ability to assign different number of tables per VNET instance.
2012-03-12 15:41:36 +00:00
Randall Stewart
7081943d6f This fixes PR 165210. Basically we just
add in the netgraph interface to the list of
acceptable interfaces. A todo at the next
IETF code blitz, though is we need to review
why we screen interfaces, there was a reason ;-).

PR:		165210
MFC after:	1 week
2012-03-12 15:05:17 +00:00
Alexander V. Chernikov
f8bee51a69 - Add ipfw eXtended tables permitting radix to be used for any kind of keys.
- Add support for IPv6 and interface extended tables
- Make number of tables to be loader tunable in range 0..65534.
- Use IP_FW3 opcode for all new extended table cmds

No ABI changes are introduced. Old userland will see valid tables for
IPv4 tables and no entries otherwise. Flush works for any table.

IP_FW3 socket option is used to encapsulate all new opcodes:
 /* IP_FW3 header/opcodes */
 typedef struct _ip_fw3_opheader {
        uint16_t opcode;        /* Operation opcode */
        uint16_t reserved[3];   /* Align to 64-bit boundary */
 } ip_fw3_opheader;

New opcodes added:
 IP_FW_TABLE_XADD, IP_FW_TABLE_XDEL, IP_FW_TABLE_XGETSIZE, IP_FW_TABLE_XLIST

ipfw(8) table argument parsing behavior is changed:
 'ipfw table 999 add host' now assumes 'host' to be interface name instead of
 hostname.

New tunable:
 net.inet.ip.fw.tables_max controls number of table supported by ipfw in given
 VNET instance. 128 is still the default value.

New syntax:
ipfw add skipto tablearg ip from any to any via table(42) in
ipfw add skipto tablearg ip from any to any via table(4242) out

This is a bit hackish, special interface name '\1' is used to signal interface
table number is passed in p.glob field.

Sponsored by Yandex LLC

Reviewed by:    ae
Approved by:    ae (mentor)

MFC after:      4 weeks
2012-03-12 14:07:57 +00:00
Peter Holm
62a9fc76df Allways call fdrop(). 2012-03-12 11:56:57 +00:00
Juli Mallett
c8b31c8f20 Remove more unused code and declarations, and add dire warnings to the 64-bit
atomic ops used by 32-bit kernels.
2012-03-12 08:13:04 +00:00
Scott Long
b6f97155cc Convert a number of drivers to obtaining their parent DMA tag from their
PCI device attachment.
2012-03-12 08:03:51 +00:00
Juli Mallett
312af517e3 Remove platform APIs which are not used by any code and which had only stub
implementations or no implementation on all platforms.

Some of these functions might be good ideas, but their semantics were unclear
given the lack of implementation, and an unlucky porter could be fooled into
trying to implement them or, worse, being baffled when something like
platform_trap_enter() failed to be called.
2012-03-12 07:34:15 +00:00
Alexander Motin
3907c073e5 Tune cpuset macros to optimize cases when CPU_SETSIZE fits into single
machine word. For example, it turns CPU_SET() into expected shift and OR,
removing two extra shifts and additional index on memory access.

Generated code checked for kernel (optimized) and user-level (unoptimized)
cases with GCC and CLANG.

Reviewed by:	attilio
MFC after:	2 weeks
2012-03-12 07:02:16 +00:00
Alan Cox
9437b8d495 Simplify the error checking in one branch of trap_pfault() and update
the nearby comment.

Correct the style of two return statements in trap_pfault().

Merge a comment from amd64's trap_pfault().
2012-03-12 05:28:02 +00:00
Pyun YongHyeon
37ee7cc719 Make if_ierrors updated whenever any of the following counters are
updated.
 o Number of times NIC ran out of RX buffer descriptors
 o Number of inbound packet errors
 o Number of inbound packets that were chosen to be discarded
Previously only the discarded packet counter was used to update
if_ierrors.  This change fixes wrong if_ierrors counter on
BCM570[0-4] controllers.  For BCM5705 and later controllers bge(4)
already correctly counted it.

Reported by:	Eugene Grosbein <egrosbein <> rdtc dot ru>
2012-03-12 03:47:30 +00:00
Pyun YongHyeon
ea9c3a30f3 Show PCI bus speed and width as well as running mode of PCI-X
device in device attach.  This would help to narrow down issue to a
specific controller and operating mode of the controller.
While I'm here rename BGE_MISCCFG_BOARD_ID with
BGE_MISCCFG_BOARD_ID_MASK.
2012-03-12 02:42:47 +00:00
Pyun YongHyeon
062af0b00e Add workaround for PCI-X BCM5704 controller that live behind
AMD-8131 PCI-X bridge.  The bridge seems to reorder write access to
mailbox registers such that it caused watchdog timeouts by
out-of-order TX completions.

Tested by:	Michael L. Squires <mikes <> siralan dot org >
Reviewed by:	jhb
2012-03-12 02:09:47 +00:00
Oleksandr Tymoshenko
2a0fa68aca - Rename apb_intr to apb_filter since it's a filter handler
- Pass interrupt trapframe for handlers dow the chain
- Add PMC interrupt handler
    PMC interrupt is a special case, so we want handle it as soon as possible
    with minimum overhead. So we handle it apb filter routine.
2012-03-12 01:23:09 +00:00
Oleksandr Tymoshenko
5fca32c865 Implement pmc_save_user_callchain and pmc_save_kernel_callchain for MIPS 2012-03-12 01:19:41 +00:00
Adrian Chadd
f0dc1b857c Begin modifying the PB92 config file to actually generate a flashable,
bootable image.

The kernel has to fit inside an 896KiB area in a 4MB SPI flash.
So a bunch of stuff can't be included (and more is to come), including
(unfortunately) IPv6.

TODO:

* GPIO modules need to be created
* Shrink the image a bit more by removing some of the CAM layer debugging
  strings.
2012-03-12 01:15:58 +00:00
Alan Cox
cea42d1179 Simplify the error checking in one branch of trap_pfault() and update
the nearby comment.

Add missing whitespace to a return statement in trap_pfault().

Submitted by:	kib [2]
2012-03-12 00:47:13 +00:00
Juli Mallett
e889b2b09e We've supported 64-bit PTEs for some time. 2012-03-11 22:17:01 +00:00
Konstantin Belousov
92ccae0399 Remove superfluous brackets.
Submitted by:	alc
MFC after:	2 weeks
2012-03-11 21:25:42 +00:00
Konstantin Belousov
dd522d76dc Do schedule delayed writes for async mounts.
While there, make some style adjustments, like missed () around
return values.

Submitted by:	bde
Reviewed by:	mckusick
Tested by:	pho
MFC after:	2 weeks
2012-03-11 20:26:19 +00:00
Konstantin Belousov
2fd2c0b1e3 Do not fall back to slow synchronous i/o when low on memory or buffers.
The bawrite() schedules the write to happen immediately, and its use
frees the current thread to do more cleanups.

Submitted by:	bde
Reviewed by:	mckusick
Tested by:	pho
MFC after:	2 weeks
2012-03-11 20:23:46 +00:00
Konstantin Belousov
4cd74eecda In ffs_syncvnode(), pass boolean false as second argument of ffs_update().
Synchronous inode block update is not needed for MNT_LAZY callers (syncer),
and since waitfor values are not zero, code did unneccessary synchronous
update.

Submitted by:	bde
Reviewed by:	mckusick
Tested by:	pho
MFC after:	2 weeks
2012-03-11 20:18:14 +00:00
Konstantin Belousov
18ef3670e5 Remove not needed ARGSUSED lint command.
Submitted by:	bde
MFC after:	3 days
2012-03-11 20:15:12 +00:00
Konstantin Belousov
1a9c7dec1f ELF image can have several PT_NOTE program headers. Look for the ELF
brand note in each header, instead of using only first one.

Reviewed by:	kan
Tested by:	andrew (arm), flo (sparc64)
MFC after:	3 weeks
2012-03-11 19:38:49 +00:00
Adrian Chadd
bbf53c35ea Upgrade the netgraph vlan node to support 802.1q, encapsulation type,
PCP and CFI fields.

* Ethernet_type for VLAN encapsulation is tunable, default is 0x8100;
* PCP (Priority code point) and CFI (canonical format indicator) is
  tunable per VID;
* Tunable encapsulation to support 802.1q
* Encapsulation/Decapsulation code improvements

New messages have been added for this netgraph node to support the
new features.

However, the legacy "vlan" id is still supported and compiled in by
default.  It can be disabled in a future release.

TODO:

* Documentation
* Examples

PR:		kern/161908
Submitted by:	Ivan <rozhuk.im@gmail.com>
2012-03-11 19:08:56 +00:00
Luigi Rizzo
a72505824c - remove an extra parenthesis in a closing brace;
- add the macro NETMAP_RING_FIRST_RESERVED() which returns
  the index of the first non-released buffer in the ring
  (this is useful for code that retains buffers for some time
  instead of processing them immediately)
2012-03-11 17:35:12 +00:00
Konstantin Belousov
0e738b4c0f Update comment.
Submitted by:	gianni
2012-03-11 15:58:27 +00:00
Marius Strobl
fe245df2da Fix a bug introduced in r223938; on big-endian machines coping a 32-bit
quantum bytewise to the address of a 64-bit variable results in writing
to the "wrong" 32-bit half so adjust the address accordingly. This fix
is implemented in a hackish way for two reasons:
o in order to be able to get it into 8.3 with zero impact on the little-
  endian architectures where this bug has no effect and
o to avoid blowing the x86 boot2 out of the water again when compiling
  it with clang, which all sane versions of this fix tested do.
This change fixes booting from UFS1 file systems on big-endian machines.

MFC after:	3 days
2012-03-11 13:39:19 +00:00
Konstantin Belousov
b80dcb55aa Remove fifo.h. The only used function declaration from the header is
migrated to sys/vnode.h.

Submitted by:	gianni
2012-03-11 12:19:58 +00:00
Juli Mallett
295b83d18d Reenable -Winline on MIPS now that we're not compiling Cavium's error
decoding stuff, which is impossibly-huge.
2012-03-11 08:12:30 +00:00
Juli Mallett
b5acc0d618 Disable the Simple Executive's error decoding/reporting code. 2012-03-11 06:55:17 +00:00
Juli Mallett
9261550cf3 Do not try to use libfdt in FreeBSD. 2012-03-11 06:49:31 +00:00
Juli Mallett
57a8a8ff31 Remove files not needed by FreeBSD. 2012-03-11 06:18:38 +00:00
Juli Mallett
dc4ee6ca91 Merge the Cavium Octeon SDK 2.3.0 Simple Executive code and update FreeBSD to
make use of it where possible.

This primarily brings in support for newer hardware, and FreeBSD is not yet
able to support the abundance of IRQs on new hardware and many features in the
Ethernet driver.

Because of the changes to IRQs in the Simple Executive, we have to maintain our
own list of Octeon IRQs now, which probably can be pared-down and be specific
to the CIU interrupt unit soon, and when other interrupt mechanisms are added
they can maintain their own definitions.

Remove unmasking of interrupts from within the UART device now that the
function used is no longer present in the Simple Executive.  The unmasking
seems to have been gratuitous as this is more properly handled by the buses
above the UART device, and seems to work on that basis.
2012-03-11 06:17:49 +00:00
Juli Mallett
47c022f2ab Disable -Winline on MIPS in preparation for the import of the latest version
of the Cavium Simple Executive, which violates large function growth rules
in such a way that simply increasing the large function growth parameter is
insufficient.
2012-03-11 06:11:31 +00:00
Juli Mallett
ecdb6b0261 Fix promiscuous mode with if_octm:
o) The MAC set must occur before the multicast list is set up as the former
   will enable the CAM unconditionally, while promiscuous mode disables it,
   so if promiscuous mode is to be set this must occur after the MAC is
   programmed.
o) The multicast list must be set up unconditionally as even if flags have
   not changed, if the interface has gone through a reinitialization, the
   state of the CAM as changed by the MAC initialization could be incorrect.
o) Call octm_init when flags change, even if the interface is already running.
2012-03-11 00:34:14 +00:00
Juli Mallett
86ce6e9fda Remove some headers not used by kernel or world and which are not present in
other ports.
2012-03-10 23:27:03 +00:00
Alexander Leidinger
2676e6799d regen 2012-03-10 23:11:21 +00:00
Alexander Leidinger
048e874f54 - add comments to syscalls.master and linux(32)_dummy about which linux
kernel version introduced the sysctl (based upon a linux man-page)
- add comments to sscalls.master regarding some names of sysctls which are
  different than the linux-names (based upon the linux unistd.h)
- add some dummy sysctls
- name an unimplemented sysctl

MFC after:	1 month
2012-03-10 23:10:18 +00:00
Alexander Motin
fd94de5c9d ServerWorks HT1000 HPET reported to have problems with IRQs >= 16.
Lower (ISA) IRQs are working, but allowed mask is not set correctly.
Block both by default to allow HP BL465c G6 blade system to boot.

Reported by:	Attila Nagy <bra@fsn.hu>
MFC after:	1 week
2012-03-10 21:08:07 +00:00
Adrian Chadd
e4e7938ae5 Stick the if_drv_flags access (check and modify) behind the ifq lock.
Although access to the flags to check/set OACTIVE is racy due to how
the default if_start() function works, this should remove any races
with read/modify/write between threads.
2012-03-10 20:09:02 +00:00
Adrian Chadd
b09e37a185 Fix a panic introduced in a previous commit - non-beaconing modes (eg STA)
don't setup the avp mcast queue.

This is a bit annoying though - it turns out the mcast queue isn't
initialised for STA mode but it's then touched to see whether anything
is in it.  That should be fixed in a subsequent commit.

Noticed by:	gperez@entel.upc.edu
PR:		kern/165895
2012-03-10 19:58:23 +00:00
Alexander Motin
5f3818a56e Revert r175376 and tune cpufreq(4) frequency comparison logic instead.
Instead of using 25MHz equality threshold, look for the nearest value when
handling dev.cpu.0.freq sysctl and for exact match when it is expected.

ACPI may report extra level with frequency 1MHz above the nominal to
control Intel Turbo Boost operation. It is not a bug, but feature:
dev.cpu.0.freq_levels: 2934/106000 2933/95000 2800/82000 ...
In this case value 2933 means 2.93GHz, but 2934 means 3.2-3.6GHz.

I've found that my Core i7-870 based system has Intel Turbo Boost disabled
by default and without this change it was absolutely invisible and hard
to control.

MFC after:	2 weeks
2012-03-10 18:56:16 +00:00
Juli Mallett
21535672bb Fix reversed logic in previous commit that broke build and earned me quite the
pointy hat.

Submitted by:	bz
2012-03-10 18:35:38 +00:00
Mitsuru IWASAKI
7199b6f7ee Fix wrong asresp frame parsing in iwi_checkforqos().
After 8.0-RELEASE, iwi(4) doesn't send any data frames in infrastructure
mode.

Bacause of the condition `while (frm < efrm)', IEEE80211_VERIFY_LENGTH()
was checking item length beyond the ieee80211_frame region, and returned
from iwi_checkforqos() without setting flags, capinfo and associd.

In infrastructure mode associd is required, so this problem causes
discarding mbuf in ieee80211_start().

PR:	kern/165819
Tested/Reviewed/Supported by: bschmidt and adrian
MFC after:	1 week
2012-03-10 17:08:57 +00:00
Yoshihiro Takahashi
08cdfdf1de MFi386: revisions 232570 and 232754
Fix boot2 to handle boot config files that only contain a custom path to
  a loader or kernel.
2012-03-10 15:08:37 +00:00
Alexander Motin
bcfd016cff Idle ticks optimization:
- Pass number of events to the statclock() and profclock() functions
   same as to hardclock() before to not call them many times in a loop.
 - Rename them into statclock_cnt() and profclock_cnt().
 - Turn statclock() and profclock() into compatibility wrappers,
   still needed for arm.
 - Rename hardclock_anycpu() into hardclock_cnt() for unification.

MFC after:	1 week
2012-03-10 14:57:21 +00:00
Edward Tomasz Napierala
0a53cd5742 Remove useless thread_{lock,unlock}() in raccd. 2012-03-10 14:38:49 +00:00
Konstantin Belousov
3e1ca43bde Add brackets around bare '-1' used as the macro body.
Noted by:	bde
MFC after:	1 week
2012-03-10 08:48:52 +00:00
Juli Mallett
fff491331e Use ABI to determine bus_addr_t for cnMIPS. 2012-03-10 07:54:41 +00:00
Juli Mallett
4f32220bf6 o) Remove some CPU_CNMIPS-related magical thinking about the status register's
contents for user programs.
o) Conditionalize the installation of an XTLB handler on ABI, not CPU family.
2012-03-10 06:54:37 +00:00
Juli Mallett
fd71d13eb6 Get rid of mainbus.c. The version in nexus.c is being used and is
perfectly-sufficient and equally-crufty.
2012-03-10 06:45:21 +00:00
Juli Mallett
4b6b28c350 Don't truncate physical addresses to 32-bits. 2012-03-10 06:43:41 +00:00
Juli Mallett
13a7423bf5 Reduce diffs with freebsd32_sysarch. 2012-03-10 06:31:28 +00:00
Pyun YongHyeon
fdd4579648 After r232403, DMA transactions does not cross 4GB boundary for
all PCI devices.  Remove driver workaround for 4GB boundary issue.
2012-03-10 06:12:14 +00:00
Juli Mallett
fb2a44f292 o) Bump INTRCOUNT_COUNT to 256, since Octeon already has >128.
XXX It would be good to use a better way to size intrcnt.
o) Fix literal 4s that are supposed to be sizeof (u_long).
   XXX Why the * 2 here?  Is this an artifact of a different system that this
       code came from?  We seem to allocate twice as much space for intrcnt
       as we admit to in sintrcnt.
2012-03-10 05:38:04 +00:00
Adrian Chadd
9c85ff9164 Don't flood the cabq/mcastq with frames.
In a very noisy 2.4GHz environment (with HT/40 enabled, making it worse)
I saw the following occur:

* the air was considered "busy" a lot of the time;
* the cabq time is quite short due to staggered beacons being enabled;
* it just wasn't able to keep up TX'ing CABQ frames;
* .. and the cabq would swallow up all the TX ath_buf's.

This patch introduces a twiddle which allows the maximum cabq depth to be
set, forcing further frames to be dropped.

It defaults to the TX buffer count at the moment, so the default behaviour
isn't changed.

I've also started fleshing out a similar setup for the data path, so
it doesn't swallow up all the available TX buffers and preventing management
frames (such as ADDBA) out.

PR:		kern/165895
2012-03-10 04:14:04 +00:00
Adrian Chadd
3c77ac7c7a Enforce that wtap requires VIMAGE to be useful. 2012-03-10 04:02:52 +00:00
Jung-uk Kim
de9dec16dd Make boot2 build with Clang again.
Submitted by:	dim (bsd.sys.mk)
Reviewed by:	dim, jhb
2012-03-09 23:30:30 +00:00
Adrian Chadd
c5940c30a7 Document that we may end up with some suboptimal handling of data
frames with stations in power saving mode.

I'm not (yet) sure how to handle TX'ing aggregates frames to stations
that are in power saving mode, or whether that's even a feasible thing
to do. So in order to (mostly) not forget, leave a couple of comments
in the code.

The code presently assumes that the aggregation TID state for an ath_node
is locked not by the ath_node lock or a node+TID lock, but behind the
hardware queue said TID maps to.  This assumption is going to be
incorrect for stations in power saving mode as we'll be TX'ing frames
on the multicast queue.

In any case, I'm afraid its a "later problem". :/
2012-03-09 22:58:34 +00:00
Adrian Chadd
91d92caece Should the mcast queue be locked here? In case more multicast traffic
comes along?

This commit was brought to you via an Atheros AR5210, associated to an 3x3
HT40 11na access point.  Yes, this driver still works with it.
2012-03-09 22:41:09 +00:00
Juli Mallett
85729c2c44 Export intrcnt correctly when running under 32-bit compatibility.
Reviewed by:	gonzo, nwhitehorn
2012-03-09 22:30:54 +00:00
Peter Holm
39e77c4c50 Perform the parameter validation before assigning it to a signed int
variable. This fixes the problem seen with readdir(3) fuzzing.

Submitted by:	bde
MFC after:	1 week
2012-03-09 21:31:12 +00:00
John Baldwin
646af7c6af Move i386's intr_machdep.c to the x86 tree and share it with amd64. 2012-03-09 20:43:29 +00:00
Dimitry Andric
63d094a7e2 Add casts to __uint16_t to the __bswap16() macros on all arches which
didn't already have them.  This is because the ternary expression will
return int, due to the Usual Arithmetic Conversions.  Such casts are not
needed for the 32 and 64 bit variants.

While here, add additional parentheses around the x86 variant, to
protect against unintended consequences.

MFC after:	2 weeks
2012-03-09 20:34:31 +00:00
John Baldwin
ad47abd20c Allow a native i386 kernel to be built with 'nodevice atpic'. Just as on
amd64, if 'device isa' is present quiesce the 8259A's during boot and
resume from suspend.

While here, be more selective on amd64 about which kernel configurations
need elcr.c.

MFC after:	2 weeks
2012-03-09 19:42:48 +00:00
John Baldwin
5e9fcac6f4 MFamd64:
- Return failure for a suspend attempt if we have no wake address.
- Use intr_disable()/intr_restore() instead of ACPI_DISABLE_IRQS().
- Invoke intr_suspend() earlier and call intr_resume() if suspend
  fails.
- Use pause in the loop waiting for CPU to suspend.
- Restore PAT MSR, switchtime, switchticks, and MTRRs on resume.

Reviewed by:	jkim (earlier version)
MFC after:	2 weeks
2012-03-09 19:20:19 +00:00
Alexander Motin
b3f40a4107 Make kern.sched.idlespinthresh default value adaptive depending of HZ.
Otherwise with HZ above 8000 CPU may never skip timer ticks on idle.
2012-03-09 19:09:08 +00:00
Peter Holm
e521b5288a Revert r232692 as the correct place to fix this is at the syscall level. 2012-03-09 17:19:50 +00:00
Tijl Coosemans
ced8176236 Cast the expression in __bswap16(x) to __uint16_t because it is promoted
to int.

Reviewed by:	dim
2012-03-09 16:39:34 +00:00
John Baldwin
0518af3e08 Remove PAE special-case 2GB DMA boundary and always use a 4GB boundary
now that DMA tags in PAE kernels support 4GB boundaries.

Reviewed by:	yongari
2012-03-09 16:05:11 +00:00
Michael Tuexen
bd79f2ded1 Fix a warning reported by bz@
MFC after: 3 days.
2012-03-09 15:42:47 +00:00
Michael Tuexen
70a03e8834 Add support for stf interfaces.
MFC after: 3days.
2012-03-09 13:15:40 +00:00
Michael Tuexen
425d06a13d Fix a bug reported by Peter Holm which results in a crash:
Verify in sctp_peeloff() that the socket is a one-to-many
style SCTP socket.

MFC after: 3 days.
2012-03-09 13:12:33 +00:00
Tijl Coosemans
0502467707 Clean up x86 endian.h:
- Remove extern "C". There are no functions with external linkage here. [1]
- Rename bswapNN_const(x) to bswapNN_gen(x) to indicate that these macros
  are generic implementations that can take non-constant arguments. [1]
- Split up __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P and deal with
  each separately.
- Replace _LP64 with __amd64__ because asm instructions are machine
  dependent, not ABI dependent.

Submitted by:	bde [1]
Reviewed by:	bde
2012-03-09 11:48:56 +00:00
Juli Mallett
9ea99cd3b5 "Did you still want the not yet? I think we just arrived at yet."
Submitted by:	thompsa
2012-03-09 09:32:20 +00:00
Adrian Chadd
e86fd7a715 Insert extra paranoia into the ath(4) driver.
This function must be called with both the source and destination TXQs
locked or things will get hairy.

I added this as part of some debugging in a PR but it turned out to not
be the cause.  I still think it's -correct- so, here it is.
2012-03-09 08:36:30 +00:00
Juli Mallett
f6f8319094 Enable COMPAT_FREEBSD32 for the Octeon kernel config by default. 2012-03-09 07:53:44 +00:00
Alexander Motin
55c71d634f Be more polite when setting state->nextevent inside cpu_new_callout().
Hardclock is not the only who wakes idle CPU since kdtrace cyclic addition.

MFC after:	2 weeks
2012-03-09 07:30:48 +00:00
Konstantin Belousov
38ddb5725b Decomission mnt_noasync. Introduce MNTK_NOASYNC mnt_kern_flag which
allows a filesystem to request VFS to not allow MNTK_ASYNC.

MFC after:	1 week
2012-03-09 00:12:05 +00:00
Adrian Chadd
b1f3262c73 Correctly initialise the TXQ link pointer to the last descriptor in
the last buffer in the list.

The current behaviour (due to me, so pointy hat is firmly on my head here)
was incorrect - it was setting the link pointer to the last descriptor
of the _first_ buffer in the TXQ.  Instead, it should have set it to the
last descriptor in the _last_ buffer in the TXQ.

This showed up as occasional TX stalls with frames in the TXQ but no
TX progress being made.  Further inspection showed the TXQ looked like
it contained multiple "lists" of frames - there'd be a list of correct
frames, then a NULL link pointer, but there'd be a next buffer in the
list.

Since this code is only called upon an interface reset, it's likely
this only began showing up when I started doing stress testing
in environments which annoy the radios enough to cause lockups.

I've not yet any TX stalls with this patch applied.

PR:		kern/165866
2012-03-08 23:53:38 +00:00
Adrian Chadd
561bc9b3e4 Add missing \n's.
This showed up when testing the wtap module, as it attaches with
no radiotap tx/rx configuration.
2012-03-08 23:46:42 +00:00
Alexander Kabaev
6e9dcee4ca Save more of config space for PCI Express and PCI-X devices.
Expand pci_save_state and pci_restore_state to save more of
the config state for PCI Express and PCI-X devices. Various
writable control registers are present in PCI Express that
can potentially be lost over suspend/resume cycle.

This change is modeled after similar functionality in Linux.

Reviewed by: wlosh,jhb
MFC after:  1 month
2012-03-08 21:09:34 +00:00
Pedro F. Giffuni
035e4e0494 Add support for ns timestamps and birthtime to the ext2/3 driver.
When using big inodes there is sufficient space in ext3 to
keep extra resolution and birthtime (creation) timestamps.
The appropriate fields in the on-disk inode have been approved
for a long time but support for this in ext3 has not been
widely  distributed.

In preparation for ext4 most linux distributions have enabled
by default such bigger inodes and some people use nanosecond
timestamps in ext3. We now support those when the inode is big
enough and while we do recognize the EXT4F_ROCOMPAT_EXTRA_ISIZE,
we maintain the extra timestamps even when they are not used.

An additional note by Bruce Evans:
We blindly accept unrepresentable tv_nsec in VOP_SETATTR(), but
all file  systems have always done that.  When POSIX gets around
to  specifying the behaviour, it will probably require certain
rounding to the fs's resolution and not rejecting the request.
This unfortunately means that syscalls that set times can't
really tell if they succeeded without reading back the times
using stat() or similar and checking that they were set close
enough.

Reviewed by:	bde
Approved by:	jhb (mentor)
MFC after:	2 weeks
2012-03-08 21:06:05 +00:00
Peter Holm
ffae9d4d7c Free up allocated memory used by posix_fadvise(2). 2012-03-08 20:34:13 +00:00
John Baldwin
b47f624183 Add KTR_VFS traces to track modifications to a vnode's writecount. 2012-03-08 20:27:20 +00:00
John Baldwin
44ad547522 Add a new sched_clear_name() method to the scheduler interface to clear
the cached name used for KTR_SCHED traces when a thread's name changes.
This way KTR_SCHED traces (and thus schedgraph) will notice when a thread's
name changes, most commonly via execve().

MFC after:	2 weeks
2012-03-08 19:41:05 +00:00
Peter Holm
80042581a5 syscall() fuzzing can trigger this panic. Return EINVAL instead.
MFC after:	1 week
2012-03-08 12:49:08 +00:00
Gleb Smirnoff
0e2fe5f990 Merge from OpenBSD:
revision 1.146
  date: 2010/05/12 08:11:11;  author: claudio;  state: Exp;  lines: +2 -3
  bzero() the full compressed update struct before setting the values.
  This is needed because pf_state_peer_hton() skips some fields in certain
  situations which could result in garbage beeing sent to the other peer.
  This seems to fix the pfsync storms seen by stephan@ and so dlg owes me
  a whiskey.

I didn't see any storms, but this definitely fixes a useless memory
allocation on the receiving side, due to non zero scrub_flags field
in a pfsync_state_peer structure.
2012-03-08 09:20:00 +00:00
Hans Petter Selasky
b733be57cc Add new USB device IDs.
PR:		usb/165815
MFC after:	1 week
2012-03-08 07:22:41 +00:00
Ed Maste
972f6945b8 Remove unactionable message about label geometry
It's not clear to a user what they should do after seeing the "geometry
does not match label" kernel message, and it does not appear to present
a problem in practice.  Thus, just remove the messages.

Approved by:	marcel
2012-03-08 01:48:44 +00:00
Kenneth D. Merry
17a46b474f Make the mps(4) module depend on the cam module.
Submitted by:	Mykola Dzham <i@levsha.me>
MFC after:	3 days
2012-03-07 22:39:11 +00:00
John Baldwin
e80cc28c1d Remove the PAE-specific 2GB DMA boundary since HEAD now supports a proper 4G
boundary for PAE.
2012-03-07 18:57:09 +00:00
John Baldwin
30dee685ae Use bus_get_dma_tag() to inherit the 4G boundary restriction from the
parent PCI bus and remove the home-grown version in this driver.
2012-03-07 18:53:56 +00:00
John Baldwin
e495fd1f3d Use bus_get_dma_tag() to inherit the PCI bus' 4G boundary constraint.
Tested by:	emaste
2012-03-07 18:52:46 +00:00
John Baldwin
8766350924 Simplify the PCI bus dma tag code a bit. First, don't create a tag at
all for platforms that only have 32-bit bus addresses.  Second, remove
the 'tag_valid' flag from the softc.  Instead, if we don't create a
tag in pci_attach_common(), just cache the value of our parent's tag
so that we always have a valid tag to return.
2012-03-07 18:50:33 +00:00
Konstantin Belousov
f950879e16 The pipe_poll() performs lockless access to the vnode to test
fifo_iseof() condition, allowing the v_fifoinfo to be reset and freed
by fifo_cleanup().

Precalculate EOF at the places were fo_wgen is changed, and cache the
state in a new pipe state flag PIPE_SAMEWGEN.

Reported and tested by:	bf
Submitted by:	gianni
MFC after:	1 week (a backport)
2012-03-07 07:31:50 +00:00
Andrew Thompson
cd613b6351 Move the vlan buffer space into the union which also fixes an unused variable
warning with !INET & !INET6.

Spotted by:	pluknet
2012-03-07 07:22:53 +00:00
Remko Lodder
c8e72d0c6f Add support for the MosChip MCS9904 four serial ports
controller.

PR:		165804
Submitted by:	Eugene Grosbein
MFC after:	1 week
2012-03-07 06:42:21 +00:00
Juli Mallett
3812e6817b Get rid of duplicated versions of the KSU bits. 2012-03-06 23:08:02 +00:00
Andrew Thompson
86f67641a9 Add the ability to set which packet layers are used for the load balance hash
calculation.
2012-03-06 22:58:13 +00:00
Aleksandr Rybalko
7283f2ff0f Break long lines.
Approved by:	adri (mentor)
2012-03-06 22:45:54 +00:00
Aleksandr Rybalko
b906a7a912 Remove EoL whitespaces.
Approved by:	adri (mentor)
2012-03-06 22:16:10 +00:00
Adrian Chadd
1f88a92ba9 Modify HWMP to be able to allocate memory for PREQ/PREP/PERR for all scenarios.
* Added verify_mesh_*_len functions that verify the length
  according to the amendment spec and return number of destination addresses
  for allocation of appropriate struct size in memory;
* Modified hwmp_recv_action_meshpath to allocate HWMP ie instead of
  storing them on the stack and store all available field according the flags;
* Modify hwmp_add_mesh* to work with all cases of HWMP according to amendment.
* Modify hwmp_send_* to calculate correct len of bytes for the HWMP ie.
* Added new M_80211_MESH_* malloc defines.
* Added macros with magic numbers for HWMP ie sizes according to amendment.
* Added the external address to all HWMP ie structs.

Submitted by:	monthadar@gmail.com
2012-03-06 21:20:16 +00:00
John Baldwin
8bf6dd98a7 Add a note to clarify why we create a relocated copy of boot1 in lower
memory.
2012-03-06 20:45:13 +00:00
Juli Mallett
e13dfc355c Remove unused file. 2012-03-06 20:23:29 +00:00
Attilio Rao
9c170fd168 Disable the option VFS_ALLOW_NONMPSAFE by default on all the supported
platforms.
This will make every attempt to mount a non-mpsafe filesystem to the
kernel forbidden, unless it is expressely compiled with
VFS_ALLOW_NONMPSAFE option.

This patch is part of the effort of killing non-MPSAFE filesystems
from the tree.

No MFC is expected for this patch.
2012-03-06 20:01:25 +00:00
Juli Mallett
723616952d At the risk of reducing source compatibility with old NetBSD and Sprite:
o) Get rid of some unused macros related to features we don't intend to
   provide.
o) Get rid of macro definitions for MIPS-I CPUs.  We are not likely to
   support anything that predartes MIPS-III.
o) Respell MIPS3_* macros as MIPS_*, which is how most of them were being
   used already.
o) Eliminate a duplicate and mostly-unused set of exception vector macros.

There's still considerable duplication and lots more obsolete in our headers,
but this reduces one of the larger files to a size where one could reckon
about the correctness of its contents with a mere few hours of contemplation.

There is, of course, a question of whether we need definitions for fields,
registers and configurations that we are unlikely to ever use or implement,
even if they're not obsolete since 1991.  FreeBSD is not a processor
reference manual, and things that aren't used may be wrong, or may be
duplicated because nobody could possibly actually know whether they're
already defined.
2012-03-06 19:01:32 +00:00
Bjoern A. Zeeb
0566170f70 Provide wbwd(4), a driver for the watchdog timer found on various
Winbond Super I/O chips.

With minor efforts it should be possible the extend the driver to support
further chips/revisions available from Winbond.  In the simplest case
only new IDs need to be added, while different chipsets might require
their own function to enter extended function mode, etc.

Sponsored by:	Sandvine Incorporated ULC (in 2011)
Reviewed by:	emaste, brueffer
MFC after:	2 weeks
2012-03-06 18:44:52 +00:00
George V. Neville-Neil
a7ef8bbb2f Properly mask off bits that are not supported in the IAP counters.
This fixes a bug where users would see massively large counts, near
to 2**64 -1, due to the bits not being cleared.

MFC after:	3 weeks
2012-03-06 17:17:03 +00:00
Edward Tomasz Napierala
811772950f Add LUN resizing to CTL. Also make it possible to explicitly set
size when creating file-backed or device-backed LUN.

Reviewed by:	ken (earlier version)
Sponsored by:	The FreeBSD Foundation
2012-03-06 13:43:57 +00:00
Edward Tomasz Napierala
c34bbd2ada Make racct and rctl correctly handle jail renaming. Previously
they would continue using old name, the one jail was created with.

PR:		bin/165207
2012-03-06 11:05:50 +00:00
Juli Mallett
0b94059f12 Garbage collect some unused symbols. 2012-03-06 08:40:21 +00:00
Juli Mallett
8e09ecbf10 Make the native sigreturn just wrap set_mcontext, much as freebsd32_sigreturn
does.
2012-03-06 08:10:48 +00:00
Juli Mallett
6fa3bc4f91 Store TLS base in the sigframe just as is done in freebsd32_sendsig. Because
the native sigreturn doesn't use set_mcontext like the COMPAT_FREEBSD32 version
does, this wouldn't actually result in overwriting the TLS base.  Probably it
makes sense to restructure the native sigreturn to use set_mcontext for
consistency, and to allow sigreturn to change the TLS base.
2012-03-06 08:02:10 +00:00
Juli Mallett
bdf4700515 Fix two and a half oversights in COMPAT_FREEBSD32 related to contexts and
TLS:
o) The mc_tls field used to store the TLS base when doing context gets and
   restores was left a pointer and not converted to a 32-bit integer.  This
   had the bug of not correctly capturing the TLS value desired by the user,
   and the extra nastiness of making the structure the wrong size.
o) The mc_tls field was not being saved by sendsig.  As a result, the TLS base
   would always be set to NULL when restoring from a signal handler.

Thanks to gonzo for helping track down a bunch of other TLS bugs that came out
of tracking these down.
2012-03-06 07:50:45 +00:00
Juli Mallett
22c6822677 When emulating rdhwr for TLS, use the 32-bit offset under COMPAT_FREEBSD32. 2012-03-06 07:47:28 +00:00
Oleksandr Tymoshenko
081fc905e2 Prepare for large TLS redo. Save pointer to the beginning of TLS area,
and offset it only if requested by RDHWR handler. Otherwise things
    get overly complicated - we need to track whether address passsed in
    request for setting td_md.md_tls is already offseted or not.
2012-03-06 03:25:50 +00:00
Juli Mallett
fb3c16bc48 In the trap messages that aid the primitive debugging environment of MIPS,
include the tid as well, so it's easier to tell which thread of a process
with multiple is responsible for a crash.
2012-03-06 02:23:15 +00:00
John Baldwin
ea6ed0ba9f Fix boot2 to handle boot config files that only contain a custom path to
a loader or kernel.  Specifically, kname cannot be pointed at cmd[] since
it's value is change to be an empty string after the initial call to
parse, and cmd[]'s value can be changed (thus losing a prior setting for
kname) due to user input at the boot prompt.  While here, ensure that that
initial boot config file text is nul-terminated, that ops is initialized
to zero, and that kname is always initialized to a valid string.

Tested by:	Domagoj Smolcic  rank1seeker of gmail
MFC after:	1 week
2012-03-05 19:53:17 +00:00
Jung-uk Kim
e883bb1ae6 Fix few style nits. 2012-03-05 18:47:42 +00:00
Ivan Voras
2573ea5f76 Print out process name and thread id in the debugging message.
This is useful because the message can end up in system logs in
non-debugging operation.

Reviewed by:	attilio (earlier version)
2012-03-05 14:19:43 +00:00
Konstantin Belousov
31452ff75e Apply inlined vn_vget_ino() algorithm for ".." lookup in pseudofs.
Reported and tested by:	pho
MFC after:	2 weeks
2012-03-05 11:38:02 +00:00
Hans Petter Selasky
e8052eb4ea Add DWC OTG module to ARM builds.
MFC after:	1 week
2012-03-05 06:46:35 +00:00
Hans Petter Selasky
0b8de86913 Fix for DWC OTG interrupt register programming.
Fix a compiler warning.
Add missing header file.

MFC after:	1 week
2012-03-05 06:41:44 +00:00
Adrian Chadd
05f91fa06a Oops - used the wrong field.
Noticed by:	nwhitehorn
2012-03-05 02:36:15 +00:00
Adrian Chadd
cf42b1cce7 Add the thread id to the net80211 alq records.
This will (hopefully) aid in debugging concurrency related issues.
2012-03-04 23:13:52 +00:00
Adrian Chadd
22eeb8c617 Fix style(9) issues. 2012-03-04 23:04:16 +00:00
Robert Millan
a65f78bf2e Exclude USB drivers (except umass and ukbd) from main kernel image on i386
and amd64.

Reviewed by:	hselasky, arch, usb
Approved by:	kib (mentor)
2012-03-04 21:31:13 +00:00
Tijl Coosemans
d8a023328d Copy amd64 ptrace.h to x86 and merge with i386 ptrace.h. Replace
amd64/i386/pc98 ptrace.h with stubs.

For amd64 PT_GETXSTATE and PT_SETXSTATE have been redefined to match the
i386 values. The old values are still supported but should no longer be
used.

Reviewed by:	kib
2012-03-04 20:24:28 +00:00
Tijl Coosemans
21d0ce7868 Do not use INT64_C and UINT64_C to define 64 bit integer limits. They
aren't defined for C++ code unless __STDC_CONSTANT_MACROS is defined.

Reported by:	jhb
2012-03-04 20:02:20 +00:00
Rafal Jaworowski
aa15e881bb Respect phy-handle property in Ethernet nodes of the device tree.
This lets specify whereabouts of the parent PHY for a given MAC node
(and get rid of ugly kludges in mge(4) and tsec(4)).

Obtained from:	Semihalf
MFC after:	1 week
2012-03-04 19:22:52 +00:00
Marko Zec
1c7792950c Change SYSINIT priorities so that ip_mroute_modevent() is executed
before vnet_mroute_init(), since vnet_mroute_init() depends on mfchashsize
tunable to be set, and that is done in in ip_mroute_modevent().
Apparently I broke that ordering with r208744 almost 2 years ago...

PR:		kern/162201
Submitted by:	Stevan Markovic (mcafee.com)
MFC after:	3 days
2012-03-04 18:59:38 +00:00
Bjoern A. Zeeb
abbe8356ea In nd6_options() ignore the RFC 6106 options completely rather than printing
them if nd6_debug is enabled as unknown.  Leave a comment about the RFC4191
option as I am undecided so far.

Discussed with:	hrs
MFC after:	3 days
2012-03-04 18:51:45 +00:00
Bjoern A. Zeeb
4ab8fc10d1 Correct typo in the RFC number for the constants based on IANA assignments
for IPv6 Neighbor Discovery Option types for "IPv6 Router Advertisement
Options for DNS Configuration".  It is RFC 6106.

MFC after:	3 days
2012-03-04 18:47:20 +00:00
Rafal Jaworowski
f05c7d9044 Remove unused #defines. All this is now retrieved from the device tree.
MFC after:	1 week
2012-03-04 18:13:45 +00:00
Rebecca Cran
03225fac13 Fix race condition in KfRaiseIrql().
After getting the current irql, if the kthread gets preempted and
subsequently runs on a different CPU, the saved irql could be wrong.

Also, correct the panic string.

PR:		kern/165630
Submitted by:	Vladislav Movchan <vladislav.movchan at gmail.com>
2012-03-04 17:08:43 +00:00
Eitan Adler
a4e40567df Explicitly list dependency
PR:		misc/160463
Submitted by:	Garrett Cooper <yanegomi@gmail.com>
Helped by:	kan
Approved by:	cperciva
MFC after:	3 days
2012-03-04 16:46:27 +00:00
David Chisnall
a8ed63bb3d Reapply 227753 (xlocale cleanup), plus some fixes so that it passes build
universe with gcc.

Approved by:	dim (mentor)
2012-03-04 15:31:13 +00:00
Konstantin Belousov
e7f19c3d81 pipe_read(): change the type of size to int, and remove signed clamp.
pipe_write(): change the type of desiredsize back to int, its value fits.

Requested by: bde
MFC after:    3 weeks
2012-03-04 15:09:01 +00:00
Konstantin Belousov
8bb9a904d5 Instead of incomplete handling of read(2)/write(2) return values that
does not fit into registers, declare that we do not support this case
using CTASSERT(), and remove endianess-unsafe code to split return value
into td_retval.

While there, change the style of the sysctl debug.iosize_max_clamp
definition.

Requested by:	bde
MFC after:	3 weeks
2012-03-04 14:55:37 +00:00
Konstantin Belousov
ea4072446b Remove unneeded cast to u_int. The values as small enough to fit into
int, beside the use of MIN macro which performs type promotions.

Submitted by:	bde
MFC after:	3 weeks
2012-03-04 14:51:42 +00:00
Tijl Coosemans
8b4a1ed0de Copy amd64 trap.h to x86 and replace amd64/i386/pc98 trap.h with stubs. 2012-03-04 14:12:57 +00:00
Tijl Coosemans
ee0d5ab989 Copy amd64 float.h to x86 and merge with i386 float.h. Replace
amd64/i386/pc98 float.h with stubs.
2012-03-04 14:00:32 +00:00
Andreas Tobler
d59a23dc09 Restore proper dot symbol creation for assembly files in the kernel build case.
Without this patch we were not able to see the assembly function.
Only the function descriptor was visible.

- Distinguish between user-land and kernel when creating the ENTRY() point of
  assembly source.
- Make the ENTRY() macro more readable, replace the .align directive with the
  gas platform independant .p2align directive.
- Create an END()macro for later use to provide traceback tables on powerpc64.
2012-03-04 11:55:28 +00:00
Marko Zec
2db13e7575 Properly restore curvnet context when returning early from
ether_input_internal().

This change only affects options VIMAGE kernel builds.

PR:		kern/165643
Submitted by:	Vijay Singh
MFC after:	3 days
2012-03-04 11:11:03 +00:00
Kevin Lo
c225ad032d Remove unnecessary casts 2012-03-04 09:48:58 +00:00
Gleb Smirnoff
dbab732d75 Fix build w/o 'options IEEE80211_SUPPORT_MESH'. 2012-03-04 09:45:43 +00:00
Kevin Lo
dd104b3305 Clean up style(9) nits 2012-03-04 09:38:20 +00:00
Andreas Tobler
0cb9915474 Add support for PWM controlled fans. I found these fans on my PowerMac9,1.
These fans are not located under the same node as the the RPM controlled ones,
So I had to adapt the current source to parse and fill the properties correctly.
To control the fans we can set the PWM ratio via sysctl between 20 and 100%.

Tested by:	nwhitehorn
MFC after:	3 weeks
2012-03-04 08:43:33 +00:00
Adrian Chadd
91216c714c * Introduce new flag for QoS control field;
* Change in mesh_input to validate that QoS is set and Mesh Control field
  is present, also both bytes of the QoS are read;
* Moved defragmentation in mesh_input before we try to forward packet as
  inferred from amendment spec, because Mesh Control field only present in first
  fragment;
* Changed in ieee80211_encap to set QoS subtype and Mesh Control field present,
  only first fragment have Mesh Control field present bit equal to 1;

Submitted by:	monthadar@gmail.com
2012-03-04 05:52:26 +00:00
Adrian Chadd
bdd2a07668 * Added IEEE80211_ACTION_CAT_MESH in ieee80211.h as specified amendment spec;
* Moved old categories as specified by D4.0 to be action fields of MESH category
  as specified in amendment spec;
* Modified functions to use MESH category and its action fields:
  + ieee80211_send_action_register
  + ieee80211_send_action
  + ieee80211_recv_action_register
  +ieee80211_recv_action;
* Modified ieee80211_hwmp_init and hwmp_send_action so they uses correct
  action fields as specified in amendment spec;
* Modified ieee80211_parse_action so that it verifies MESH frames.
* Change Mesh Link Metric to use one information element as amendment spec.
  Draft 4.0 defined two different information elements for request and response.

Submitted by:	monthadar@gmail.com
2012-03-04 05:49:39 +00:00
Juli Mallett
2bd5a2588e Fix tls base computation with COMPAT_FREEBSD32 on n64 kernels. The previous
version was missing an else and would always use the n64 TP_OFFSET.  Eliminate
some duplication of logic here.

It may be worth getting rid of some of the ifdefs and introducing gratuitous
SV_ILP32 runtime checks on n64 kernels without COMPAT_FREEBSD32 and on o32
kernels, similarly to how PowerPC works.
2012-03-04 05:19:55 +00:00
Dimitry Andric
ef78eb0b8b In r232322, I forgot one case where a check for MK_CLANG_IS_CC was
needed, in sys/conf/kern.pre.mk.  Add it now.

MFC after:	2 weeks
2012-03-04 00:42:18 +00:00
Dimitry Andric
2651e350d3 Revert r232473. I have been convinced by Doug Barton and Bjoern Zeeb
that it is better to error out when people attempt to build using the
wrong bsd.*.mk files, than to silently ignore the problem.

This means, that after this commit, if you want to build kernel modules
by hand (or via a port) from a head source tree, you *must* make sure
the files in /usr/share/mk are in sync with that tree.  If that isn't
possible, for example when you are running on an older FreeBSD branch,
you can:

- Run "make buildenv" from your head source tree, to have the correct
  environment setup.  (It's advisable to have run "make buildworld", or
  at a minimum "make toolchain" first.)
- Alternatively, set MAKESYSPATH to the share/mk directory under your
  head source tree.  If your build tools are too old, other problems may
  still occur.
- Alternatively, use "make -m" and specify the share/mk directory under
  your head source tree.  Again, build tools that are too old may still
  result in trouble.

MFC after:	2 weeks
2012-03-03 23:49:53 +00:00
Juli Mallett
a6d20bbaa2 On MIPS, _ALIGN always aligns to 8 bytes, even for 32-bit binaries. This might
not be ideal, but is the ABI we've shipped so far.  Fix macros which reflect
the results of _ALIGN on 32-bit MIPS to use the right alignment.

This fixes sendmsg under COMPAT_FREEBSD32 on n64 MIPS kernels.
2012-03-03 21:39:12 +00:00
Dimitry Andric
2677e7fea5 After r232322, it turned out many people (and some ports) are building
kernel modules using their old installed /usr/share/mk/bsd.*.mk files,
instead of the updated ones in their source tree.  This leads to errors
like:

  "sys/conf/kmod.mk", line 111: Malformed conditional (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang")

Obviously, these errors will go away after a "make installworld", or
alternatively, by using "make buildenv" before attempting to manually
build modules.

However, since it is apparently an expected use case to build using old
.mk files, change the way we test for clang, so it also works when the
MK_CLANG_IS_CC macro doesn't exist.

Note the conditional expressions are becoming rather unreadable now, but
I will attempt to fix that on a followup commit.

MFC after:	2 weeks
2012-03-03 18:58:15 +00:00
John Baldwin
c668000b69 Expand the set of APIs available for locating PCI capabilities:
- pci_find_extcap() is repurposed to be used for fetching PCI-express
  extended capabilities (PCIZ_* constants in <dev/pci/pcireg.h>).
- pci_find_htcap() can be used to locate a specific HyperTransport
  capability (PCIM_HTCAP_* constants in <dev/pci/pcireg.h>).
- Cache the starting location of the PCI-express capability for PCI-express
  devices in PCI device ivars.
2012-03-03 18:08:57 +00:00
John Baldwin
cda6c6abf9 Use pci_find_cap() instead of pci_find_extcap() to locate PCI
find capabilities as the latter API is deprecated for this purpose.

MFC after:	2 weeks
2012-03-03 18:03:50 +00:00
Rick Macklem
b76ec2db93 The name caching changes of r230394 exposed an intermittent bug
in the new NFS server for NFSv4, where it would report ENOENT
when the file actually existed on the server. This turned out
to be caused by not initializing ni_topdir before calling lookup()
and there was a rare case where the value on the stack location
assigned to ni_topdir happened to be a pointer to a ".." entry,
such that "dp == ndp->ni_topdir" succeeded in lookup().
This patch initializes ni_topdir to fix the problem.

MFC after:	5 days
2012-03-03 16:13:20 +00:00
John Baldwin
37bf8b5f5b Update the pci_get_vpd_readonly() wrapper to use 'vptr' instead of
'identptr' for its last parameter to match the default implementation
as well as the method definition in pci_if.m.
2012-03-03 14:25:36 +00:00
John Baldwin
180aa2f0fc Fix a typo. 2012-03-03 14:24:39 +00:00
Mikolaj Golub
e0fcf639d2 Make kern.proc.umask sysctl readonly.
Requested by:	src
MFC after:	1 week
2012-03-03 11:53:35 +00:00
Alexander Motin
6022f0bcb3 Fix bug of r232207, when cpu_search() could prefer CPU group with best
load, but with no CPU matching given limitations. It caused kernel panics
in some cases when thread was bound to specific CPUs with cpuset(1).
2012-03-03 11:50:48 +00:00
Juli Mallett
87775fcd35 Unbreak n64 build without COMPAT_FREEBSD32 by fixing mismatched preprocessor
conditionals.
2012-03-03 10:22:49 +00:00
Juli Mallett
9624d94701 o) Add COMPAT_FREEBSD32 support for MIPS kernels using the n64 ABI with userlands
using the o32 ABI.  This mostly follows nwhitehorn's lead in implementing
   COMPAT_FREEBSD32 on powerpc64.
o) Add a new type to the freebsd32 compat layer, time32_t, which is time_t in the
   32-bit ABI being used.  Since the MIPS port is relatively-new, even the 32-bit
   ABIs use a 64-bit time_t.
o) Because time{spec,val}32 has the same size and layout as time{spec,val} on MIPS
   with 32-bit compatibility, then, disable some code which assumes otherwise
   wrongly when built for MIPS.  A more general macro to check in this case would
   seem like a good idea eventually.  If someone adds support for using n32
   userland with n64 kernels on MIPS, then they will have to add a variety of
   flags related to each piece of the ABI that can vary.  That's probably the
   right time to generalize further.
o) Add MIPS to the list of architectures which use PAD64_REQUIRED in the
   freebsd32 compat code.  Probably this should be generalized at some point.

Reviewed by:	gonzo
2012-03-03 08:19:18 +00:00
Hans Petter Selasky
02f728afc9 Make sure that the USB system suspend event is executed synchronously
and not asynchronously. This fixes problems related to USB system
suspend and resume.  It is assumed that we are always allowed to sleep
from the device_suspend() method.

MFC after:	1 week
Submitted by:	jkim
2012-03-03 08:11:04 +00:00
Rick Macklem
5e99212d36 Post r230394, the Lookup RPC counts for both NFS clients increased
significantly. Upon investigation this was caused by name cache
misses for lookups of "..". For name cache entries for non-".."
directories, the cache entry serves double duty. It maps both the
named directory plus ".." for the parent of the directory. As such,
two ctime values (one for each of the directory and its parent) need
to be saved in the name cache entry.
This patch adds an entry for ctime of the parent directory to the
name cache. It also adds an additional uma zone for large entries
with this time value, in order to minimize memory wastage.
As well, it fixes a couple of cases where the mtime of the parent
directory was being saved instead of ctime for positive name cache
entries. With this patch, Lookup RPC counts return to values similar
to pre-r230394 kernels.

Reported by:	bde
Discussed with:	kib
Reviewed by:	jhb
MFC after:	2 weeks
2012-03-03 01:06:54 +00:00
Jung-uk Kim
62953748f5 Add VESA option to GENERIC for amd64 and i386.
MFC after:	1 month
2012-03-03 00:11:46 +00:00
Kenneth D. Merry
aa6e8dfdd5 Fix a problem that was causing the mpt(4) driver to attach to MegaRAID
cards that should be handled by the mfi(4) driver.

The root of the problem is that the mpt(4) driver was masking off the
bottom bit of the PCI device ID when deciding which cards to attach to.

It appears that a number of the mpt(4) Fibre Channel cards had a LAN
variant whose PCI device ID was just one bit off from the FC card's device
ID.  The FC cards were even and the LAN cards were odd.

The problem was that this pattern wasn't carried over on the SAS and
parallel SCSI mpt(4) cards.  Luckily the SAS and parallel SCSI PCI device
IDs were either even numbers, or they would get masked to a supported
adjacent PCI device ID, and everything worked well.

Now LSI is using some of the odd-numbered PCI device IDs between the 3Gb
SAS device IDs for their new MegaRAID cards.  This is causing the mpt(4)
driver to attach to the RAID cards instead of the mfi(4) driver.

The solution is to stop masking off the bottom bit of the device ID, and
explicitly list the PCI device IDs of all supported cards.

This change should be a no-op for mpt(4) hardware.  The only intended
functional change is that for the 929X, the is_fc variable gets set.  It
wasn't being set previously, but needs to be because the 929X is a Fibre
Channel card.

Reported by:	Kashyap Desai <Kashyap.Desai@lsi.com>
MFC After:	3 days
2012-03-02 22:00:40 +00:00
Juli Mallett
4228a524fd When creating a handle for a subregion, be sure to actually math out the new
handle address, where we're using handles as raw addresses.

This fixes devices with subregions on Octeon PCI specifically, and likely also on
MIPS more generally, where there isn't another bus_space in use that was doing the
math already.
2012-03-02 21:46:31 +00:00
Juli Mallett
7b7463a5d2 If an Atheros device is attached to an Octeon, it's going to be by PCI. 2012-03-02 21:44:39 +00:00
John Baldwin
1b1596a3b3 - Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge.
The tag enforces a single restriction that all DMA transactions must not
  cross a 4GB boundary.  Note that while this restriction technically only
  applies to PCI-express, this change applies it to all PCI devices as it
  is simpler to implement that way and errs on the side of caution.
- Add a softc structure for PCI bus devices to hold the bus_dma tag and
  a new pci_attach_common() routine that performs actions common to the
  attach phase of all PCI bus drivers.  Right now this only consists of
  a bootverbose printf and the allocate of a bus_dma tag if necessary.
- Adjust all PCI bus drivers to allocate a PCI bus softc and to call
  pci_attach_common() from their attach routines.

MFC after:	2 weeks
2012-03-02 20:38:04 +00:00
Juli Mallett
3b7eabb569 Unbreak SMP on stock Octeon systems -- copy the core_mask from bootinfo into
sysinfo.  This should have been done as part of replacing bootinfo with sysinfo.
2012-03-02 20:34:15 +00:00
John Baldwin
58d65e8031 Similar to the fixes in 226967 and 226987, purge any name cache entries
associated with the previous vnode (if any) associated with the target of
a rename().  Otherwise, a lookup of the target pathname concurrent with a
rename() could re-add a name cache entry after the namei(RENAME) lookup
in kern_renameat() had purged the target pathname.

MFC after:	2 weeks
2012-03-02 18:55:19 +00:00
Andreas Tobler
10520ef88f Fix typo. 2012-03-02 18:18:14 +00:00
Alan Cox
83cbe16ff4 Eliminate stale incorrect ARGSUSED comments.
Submitted by:	bde
2012-03-02 17:33:51 +00:00
Konstantin Belousov
66f02f4b25 Do not expose unlocked unconstructed nullfs vnode on mount list.
Lock the native nullfs vnode lock before switching the locks.

Tested by:	pho
MFC after:	1 week
2012-03-02 09:48:46 +00:00
Alexander Motin
9364490242 Fix names of some Marvell SATA chips. It looks like chips with proprietary
interface supported by mvs(4) are 88SX, while AHCI-like chips are 88SE.

PR:		kern/165271
Submitted by:	Jia-Shiun Li <jiashiun@gmail.com>
MFC after:	1 week
2012-03-02 08:49:07 +00:00
Hiroki Sato
dead19563c Allow to configure net.inet6.ip6.{accept_rtadv,no_radr} by the loader tunables
as well because they have to be configured before interface initialization for
AF_INET6.
2012-03-02 07:23:28 +00:00
Hiroki Sato
a1875676ca Remove a redundant check. 2012-03-02 07:22:04 +00:00
Adrian Chadd
a887b1e359 Wrap another ATH_LOCK around the scanning flag.
PR:		kern/163318
2012-03-02 03:11:53 +00:00
Adrian Chadd
c98cefc5db Wrap the scan code state change stuff behind ATH_LOCK and the PCU fiddling
behind the PCU lock.

sc_scanning is being checked without ATH_LOCK behind held and could
in theory run from multiple threads.
2012-03-02 02:57:10 +00:00
Adrian Chadd
66b74386c7 Attempt to catch scan cancellations at exactly the wrong time from occuring.
The scan code unlocks the comlock and calls into the driver.  It then
assumes the state hasn't changed from underneath it.

Although I haven't seen this particular condition trigger, I'd like to
be informed if I or anyone else sees it.

What I'm thinking may occur:

* A cancellation comes in during the scan_end call;
* the cancel flag is set;
* but it's never checked, so scandone isn't updated;
* .. and the interface stays in the STA power save mode.

It's a subtle race, if it even exists.

PR:		kern/163318
2012-03-02 02:53:43 +00:00
John Baldwin
c3173381be Properly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X
allocation fails.

Reviewed by:	jfv
MFC after:	2 weeks
2012-03-01 22:13:10 +00:00
Davide Italiano
78d763a29b - Add support for the Intel Sandy Bridge microarchitecture (both core and uncore counting events)
- New manpages with event lists.
- Add MSRs for the Intel Sandy Bridge microarchitecture

Reviewed by:	attilio, brueffer, fabient
Approved by:	gnn (mentor)
MFC after:	3 weeks
2012-03-01 21:23:26 +00:00
Alexander Kabaev
d4280a0fab Provide pre/post transfer method callbacks for icbbb
clients.

These are helful when making certain drivers work on both Linux
and FreeBSD without changing the code flow too much.

Reviewed by: kib, wlosh
MFC after: 1 month
2012-03-01 20:58:20 +00:00