Commit Graph

78679 Commits

Author SHA1 Message Date
Nathan Whitehorn
3b4b38304e Improve hash coverage for kernel page table entries by modifying the kernel
ESID -> VSID map function. This makes ZFS run stably on PowerPC under
heavy loads (repeated simultaneous SVN checkouts and updates).
2010-07-31 21:35:15 +00:00
Bjoern A. Zeeb
19291ab3de Document the mandatory argument to the arptimer() and
nd6_llinfo_timer() functions with a KASSERT().
Note: there is no need to return after panic.

In the legacy IP case, only assign the arg after the check,
in the IPv6 case, remove the extra checks for the table and
interface as they have to be there unless we freed and forgot
to cancel the timer.  It doesn't matter anyway as we would
panic on the NULL pointer deref immediately and the bug is
elsewhere.
This unifies the code of both address families to some extend.

Reviewed by:	rwatson
MFC after:	6 days
2010-07-31 21:33:18 +00:00
Jayachandran C.
9ca746fb79 Use PTR_ADDU to change sp, so that it works for n64 too. 2010-07-31 19:13:08 +00:00
Jayachandran C.
dcd2709851 Use fuword32() to fetch instructions, this will work on both 32 and 64 bit
compilation.
2010-07-31 19:11:38 +00:00
Bjoern A. Zeeb
4579930d2e MFp4 @181628:
Free the rtentry after we diconnected it from the FIB and are counting
it as rttrash.  There might still be a chance we leak it from a different
code path but there is nothing we can do about this here.

Sponsored by:	ISPsystem (in February)
Reviewed by:	julian (in February)
MFC after:	2 weeks
2010-07-31 15:31:23 +00:00
Nathan Whitehorn
2c16c8d7e5 Add support for the IBM Full-System Simulator (Mambo). This code has been
developed against the 970 and Cell simulators.
2010-07-31 13:22:34 +00:00
Rui Paulo
8b297c1fbd pci_if.h is required to build atacore. 2010-07-31 00:08:18 +00:00
Andre Oppermann
28a53f037a Fix a bug in syncache where the initial CWND for new incoming connections
was limited to one segment under the faulty assumption of a retransmit.
Due to this the opportunity to initialize the increased congestion window
according to RFC3390 was missed.

Support for RFC3465 introduced in r187289 uncovered the bug as the ACK
to SYN/ACK no longer caused snd_cwnd increase by MSS (actually, this
increase shouldn't happen as it's explicitly forbidden by RFC3390, but
it's another issue).  Snd_cwnd remains really small (1*MSS + 1) and this
causes really bad interaction with delayed acks on other side.

The variable name sc_rxmits is a bit misleading as it counts all transmits,
not just retransmits.

Submitted by:	Maxim Dounin <mdounin-at-mdounin-dot-ru>
MFC after:	10 days
2010-07-30 21:45:53 +00:00
Xin LI
16430b12a3 In rdmsr_safe, use zero extend (by doing a 32-bit movl over
eax to itself) instead of a sign extend.

Discussed with:	stas
MFC after:	1 month
2010-07-30 21:39:28 +00:00
Matthew D Fleming
f6daba8329 Add MALLOC_DEBUG_MAXZONES=8 to powerpc64 GENERIC configuration file.
Requested by:    nwhitehorn
Approved by:     zml (mentor)
2010-07-30 20:25:04 +00:00
Xin LI
e5fdd9de2c Change copyright holder to author. We prefer using a real legal
entity for copyright holders.

Approved by:	sephe
MFC after:	3 days
2010-07-30 17:51:22 +00:00
Doug Rabson
1df9a68303 A simple test harness to help debug problems with the ZFS boot code. 2010-07-30 13:54:15 +00:00
Jayachandran C.
55bf3928c0 n64 support - enable UX bit in STATUS for kernel and userspace.
- enable UX in kernel start, and kernel entry
- keep UX flag in cpu_fork and cpu_set_upcall
- enable UX for userspace
2010-07-30 12:45:00 +00:00
Jayachandran C.
654969d149 MIPS n64 support - support kstack in XKSEG.
- enable KX on entry from user-space, we need KX set to save to XKSEG
  addresses.
- add MIPS_XKSEG_START to genassym.c
- Add n64 case for swth.S
2010-07-30 09:38:47 +00:00
Pyun YongHyeon
f39cf57f91 Consistently check header type after reading PCIR_HDRTYPE register.
While I'm here use defined macro instead of using magic numbers for
header type.

Reviewed by:	jhb
2010-07-29 20:42:38 +00:00
Konstantin Belousov
4782e51e14 Add compat32 shims for opencrypto(4).
Reviewed by:	bz
MFC after:	3 weeks
2010-07-29 20:42:20 +00:00
Jayachandran C.
42963f5a48 Update rge driver for 64 bit kernel.
- stored virtual addresses should be 64bit
- physical memory can be directly accessed using XKPHYS pointers in 64 bit.
- no need to enable KX
2010-07-29 20:41:40 +00:00
Jayachandran C.
fbbf115e35 Prepare for 3 level page tables for MIPS.
- Move page table second level shift and mask to param.h
- rename SEGOFSET to SEGMASK
- fix values for 64 bit maximum kernel and user addresses.
2010-07-29 20:02:56 +00:00
Jayachandran C.
a9ec9e9b03 Add fuiword() in n64 for completeness. 2010-07-29 19:47:15 +00:00
Jayachandran C.
9f91a43769 MIPS 64 bit support. Define fuword64() for n64 compilation, fuword() should
be fuword64() in 64 bit.
2010-07-29 19:14:06 +00:00
Xin LI
a3bc0a4e5c Improve cputemp(4) driver wrt newer Intel processors, especially
Xeon 5500/5600 series:

 - Utilize IA32_TEMPERATURE_TARGET, a.k.a. Tj(target) in place
   of Tj(max) when a sane value is available, as documented
   in Intel whitepaper "CPU Monitoring With DTS/PECI"; (By sane
   value we mean 70C - 100C for now);
 - Print the probe results when booting verbose;
 - Replace cpu_mask with cpu_stepping;
 - Use CPUID_* macros instead of rolling our own.

Approved by:	rpaulo
MFC after:	1 month
2010-07-29 19:08:22 +00:00
John Baldwin
536af0d751 Mark the __curthread() functions as __pure2 and remove the volatile keyword
from the inline assembly.  This allows the compiler to cache invocations of
curthread since it's value does not change within a thread context.

Submitted by:	zec (i386)
MFC after:	1 week
2010-07-29 18:44:10 +00:00
George V. Neville-Neil
ee6a02813b Make sure that we clear the correct bits when we turn off
a PMC.  It was possible that we could have turned a bit on but
never cleared it.

Extend the calls to rdmsr() to all necessary functions, not
just those which previously caused a panic.

Pointed out by: jhb@
MFC after:	1 week
2010-07-29 17:52:23 +00:00
John Baldwin
6676877bd9 When performing a sanity check on the SRAT table to ensure that each
memory domain has an assigned CPU, ignore disabled CPUs.  Previously
disabled CPUs were counted as being in domain 0.

Reported by:	mdf
2010-07-29 17:37:35 +00:00
Jung-uk Kim
994ce54d01 MFamd64: r210615
Fix another fallout from r208833.  savectx() is used to save CPU context
for crash dump (dumppcb) and kdb (stoppcbs).  For both cases, we cannot
have a valid pointer in pcb_save.  This should restore the previous
behaviour.
2010-07-29 17:00:41 +00:00
Jung-uk Kim
9727ca6a77 Fix another fallout from r208833. savectx() is used to save CPU context
for crash dump (dumppcb) and kdb (stoppcbs).  For both cases, there cannot
have a valid pointer in pcb_save.  This should restore the previous
behaviour.
2010-07-29 16:49:20 +00:00
Jung-uk Kim
39381048f0 Rename PCB_USER_FPU to PCB_USERFPU not to clash with a macro from fpu.h. 2010-07-29 16:41:21 +00:00
Rui Paulo
55820e298a Bump the witness pendlist to 768 to accomodate the increased number of
spinlocks.
2010-07-29 16:13:26 +00:00
Jayachandran C.
56e6260883 Update MIPS _stdint.h for 64 bit. Initial 64 bit changes for profile.h. 2010-07-29 14:04:29 +00:00
Jayachandran C.
63ba49fd5f Fix RQB_FFS for 64 bit, we need to use ffsl() for 64bit.
Use 'ifdef __mips_n64' instead of 'if defined' to be consistant with other
usage.
2010-07-29 13:52:46 +00:00
John Baldwin
c280c7d482 Fix test for double-nul characters that terminate the string table at
the end of each SMBIOS/DMI structure.

Submitted by:	Dmitrij Tejblum @ yandex.ru
MFC after:	3 days
2010-07-29 13:46:37 +00:00
Alexander Motin
6c8dd81fa9 Adapt sparc64 and sun4v timer code for the new event timers infrastructure.
Reviewed by:	marius@
2010-07-29 12:08:46 +00:00
Randall Stewart
753358d725 Fix the comment block that has the nice
table to really have the nice table :-)

MFC after:	1 month
2010-07-29 12:01:59 +00:00
Randall Stewart
44fbe46280 PR SCTP Bugs. Basically a full sized frame of
PR SCTP FWD-TSN's would not be sent and thus
cause a stalled connection. Also the rwnd
Calculation was also off on the receiver side for
PR-SCTP.
MFC after:	1 month
2010-07-29 11:37:04 +00:00
Neel Natu
762aad8142 Fix 'pciconf -a' by providing an implementation of PCIOCATTACHED.
Reviewed by:	imp
MFC after:	1 week
Pointed out by:	Heymian Wong (heymian at mit.alum.edu)
Sponsored by:	NetApp
2010-07-29 06:27:41 +00:00
Neel Natu
2a3232d9d6 Fix build for o32 kernels.
The emulation of 'ld' and 'sd' instructions only works for ABIs that support
64-bit registers and the instructions 'ldl' and 'ldr' that operate on those
registers.

Reviewed by:	jmallett
2010-07-29 05:14:59 +00:00
Juli Mallett
864ec37f39 o) Subtract 64K from the default userland stack pointer. GCC generate code
that with a 32-bit ABI on a system with 64-bit registers can attempt to
   access an invalid (well, kernel) memory address rather than the intended
   user address for stack-relative loads and stores.  Lowering the stack
   pointer works around this. [1]
o) Make TRAP_DEBUG code conditional on the trap_debug variable.  Make
   trap_debug default to 0 instead of 1 now but make it possible to change it
   at runtime using sysctl.
o) Kill programs that attempt an unaligned access of a kernel address.  Note
   that with some ABIs, calling useracc() is not sufficient since the register
   may be 64-bit but vm_offset_t is 32-bit so a kernel address could be
   truncated to what looks like a valid user address, allowing the user to
   crash the kernel.
o) Clean up unaligned access emulation to support unaligned 16-bit and 64-bit
   accesses.  (For 16-bit accesses it was checking for user access to too much
   memory (4 bytes) and there was no 64-bit support.)  This still lacks support
   for unaligned load-linked and store-conditional.

Reviewed by:	[1] gonzo
2010-07-29 02:32:21 +00:00
John Baldwin
a955c461ad The corrected error count field is dependent on CMCI, not TES.
MFC after:	1 week
2010-07-28 21:52:09 +00:00
Tijl Coosemans
317a3ce2c5 Add quirk for Apacer HT202 USB 2.0 Flash Drive.
PR:		usb/107243
Approved by:	kib (mentor)
MFC after:	1 week
2010-07-28 18:56:01 +00:00
Gavin Atkinson
61bb77d415 Provide descriptions for three vendors and four devices in usbdevs. Use
the official vendor listed for 0x076b, rather than Omnikey, as in the PR.

PR:		usb/123351
Submitted by:	Marcin Cieslak <saper SYSTEM.PL>
MFC after:	1 week
2010-07-28 17:38:43 +00:00
Gavin Atkinson
082dbb0d11 Add support for the Corega CG-USBRS232R to uplcom(4)
PR:		usb/129173
Submitted by:	SHIMAOKA Shunsuke <shimaoka.shunsuke gmail.com>
MFC after:	1 week
2010-07-28 16:29:10 +00:00
Matthew D Fleming
370808da5f Fix clang warning on empty statement.
Reviewed by:    rdivacky, zml
Approved by:    zml (mentor)
2010-07-28 16:24:11 +00:00
Matthew D Fleming
a767c78e4a Fix clang warning on empty statement.
Reviewed by:    rdivacky, zml
Approved by:    zml (mentor)
2010-07-28 16:24:06 +00:00
Matthew D Fleming
7472b122a9 Bump __FreeBSD_version for multizone malloc(9).
Approved by:    zml (mentor)
2010-07-28 15:47:32 +00:00
Matthew D Fleming
d7854da193 Add MALLOC_DEBUG_MAXZONES debug malloc(9) option to use multiple uma
zones for each malloc bucket size.  The purpose is to isolate
different malloc types into hash classes, so that any buffer overruns
or use-after-free will usually only affect memory from malloc types in
that hash class.  This is purely a debugging tool; by varying the hash
function and tracking which hash class was corrupted, the intersection
of the hash classes from each instance will point to a single malloc
type that is being misused.  At this point inspection or memguard(9)
can be used to catch the offending code.

Add MALLOC_DEBUG_MAXZONES=8 to -current GENERIC configuration files.
The suggestion to have this on by default came from Kostik Belousov on
-arch.

This code is based on work by Ron Steinke at Isilon Systems.

Reviewed by:    -arch (mostly silence)
Reviewed by:    zml
Approved by:    zml (mentor)
2010-07-28 15:36:12 +00:00
Gavin Atkinson
4c01dc3e12 Support the Pyramid KBS USB LCD under uftdi(4)
PR:		usb/129758
Submitted by:	joao lima <jlima visionware.pt>
MFC after:	1 week
2010-07-28 08:48:35 +00:00
Alan Cox
a14a949872 The interpreter name should no longer be treated as a buffer that can be
overwritten.  (This change should have been included in r210545.)

Submitted by:	kib
2010-07-28 04:47:40 +00:00
Andrew Thompson
a6977f4ae4 Fix the entry for the Option ICON452 where an underscore was used instead of
whitespace.

Submitted by:	Lucius Windschuh
2010-07-27 22:55:24 +00:00
John Baldwin
dd540b4623 Add a parser for the ACPI SRAT table for amd64 and i386. It sets
PCPU(domain) for each CPU and populates a mem_affinity array suitable
for the NUMA support in the physical memory allocator.

Reviewed by:	alc
2010-07-27 20:40:46 +00:00
John Baldwin
a3870a1826 Very rough first cut at NUMA support for the physical page allocator. For
now it uses a very dumb first-touch allocation policy.  This will change in
the future.
- Each architecture indicates the maximum number of supported memory domains
  via a new VM_NDOMAIN parameter in <machine/vmparam.h>.
- Each cpu now has a PCPU_GET(domain) member to indicate the memory domain
  a CPU belongs to.  Domain values are dense and numbered from 0.
- When a platform supports multiple domains, the default freelist
  (VM_FREELIST_DEFAULT) is split up into N freelists, one for each domain.
  The MD code is required to populate an array of mem_affinity structures.
  Each entry in the array defines a range of memory (start and end) and a
  domain for the range.  Multiple entries may be present for a single
  domain.  The list is terminated by an entry where all fields are zero.
  This array of structures is used to split up phys_avail[] regions that
  fall in VM_FREELIST_DEFAULT into per-domain freelists.
- Each memory domain has a separate lookup-array of freelists that is
  used when fulfulling a physical memory allocation.  Right now the
  per-domain freelists are listed in a round-robin order for each domain.
  In the future a table such as the ACPI SLIT table may be used to order
  the per-domain lookup lists based on the penalty for each memory domain
  relative to a specific domain.  The lookup lists may be examined via a
  new vm.phys.lookup_lists sysctl.
- The first-touch policy is implemented by using PCPU_GET(domain) to
  pick a lookup list when allocating memory.

Reviewed by:	alc
2010-07-27 20:33:50 +00:00
Jayachandran C.
257ee8a425 mips/rmi/bus_space_rmi_pci.c is needed even when PCI is disabled. This
file really provides a bus that does byteswapping, and can be used by
non-PCI components too.
2010-07-27 19:31:10 +00:00
Edward Tomasz Napierala
fd6f4ffb27 Fix commented out resource limit check in mlockall(2). It's still racy,
but at least less misleading.
2010-07-27 19:26:18 +00:00
Jayachandran C.
ee37b5e791 The changes in r210542 moved setting counter_upper and counter_lower_last
outside the critical section - fix that.

Reported by:	mav
2010-07-27 17:33:51 +00:00
Alan Cox
2af6e14d39 Introduce exec_alloc_args(). The objective being to encapsulate the
details of the string buffer allocation in one place.

Eliminate the portion of the string buffer that was dedicated to storing
the interpreter name.  The pointer to the interpreter name can simply be
made to point to the appropriate argument string.

Reviewed by:	kib
2010-07-27 17:31:03 +00:00
Gavin Atkinson
7dddb455e5 Prevent uhid(4) from attaching to the Liebert PowerSure Personal XT UPS.
PR:		usb/129251
Submitted by:	Andrew D Wiles <adw+gnats avatastic.co.uk>
MFC after:	1 week
2010-07-27 17:07:16 +00:00
Jayachandran C.
707fd442af The count/compare values have to be tracked per CPU.
Reviewed by:	mav
2010-07-27 15:10:05 +00:00
Gleb Smirnoff
b9bff254af Fix operation of "netgraph" action in conjunction with the
net.inet.ip.fw.one_pass sysctl.

The "ngtee" action is still broken.

PR:		kern/148885
Submitted by:	Nickolay Dudorov <nnd mail.nsk.ru>
2010-07-27 14:26:34 +00:00
Gavin Atkinson
627ab90b2a Add support for the Longcheer WM66 USB HSDPA Modem to u3g(4)
This patch is different to that provided in the PR, due to the changes in
this driver since 7.x.

PR:		usb/129945
Submitted by:	Antonio Hilario <avahilario gmail.com>
MFC after:	1 week
2010-07-27 12:29:45 +00:00
Gleb Smirnoff
b17f26b00c Don't check malloc(M_WAITOK) result. 2010-07-27 11:56:49 +00:00
Bjoern A. Zeeb
cd292f1264 Return NULL rather than 0 for a pointer.
MFC after:	3 days
2010-07-27 11:54:01 +00:00
Gleb Smirnoff
85011246ac When installing a new ARP entry via 'arp -S', lla_lookup() will
either find an existing entry, or allocate a new one. In the latter
case an entry would have flags, that were supplied as argument to
lla_lookup(). In case of an existing entry, flags aren't modified.

This lead to losing LLE_PUB and/or LLE_PROXY flags.

We should apply these flags either in lla_rt_output() or in the
in.c:in_lltable_lookup(). It seems to me that lla_rt_output() is
a more correct choice.

PR:		kern/148784, kern/146539
Silence from:	qingli, 5 days
2010-07-27 10:05:27 +00:00
Jayachandran C.
135fcc6da0 Fixup mips/rmi for the new mips timer code(r210403). This will get XLR
booting again.

The code is a copy of the mips/mips/tick.c with minor modifications for
XLR interrupt handling. Disable mips/rmi/clock.c for now, the PIC based
timer code will be added later.
2010-07-27 09:22:41 +00:00
Gavin Atkinson
46cbe200b5 - Support two devices made by West Mountain Radio in uslcom(4) [1]
- Bring in several other devices from OpenBSD while here.  Use the
  official manufacturer name over the OpenBSD name in the case of
  GEMALTO.  Reorder list slightly to aid future syncing.

- Remove duplicate SILABS CP2102 define from usbdevs

PR:		usb/131912 [1]
Submitted by:	Jack Twilley <mathuin gmail.com> [1]
MFC after:	1 week
2010-07-27 07:57:35 +00:00
Jung-uk Kim
954022384f Fix an apparent typo.
Found by:	clang
Reviewed by:	davidch, yongari
2010-07-26 23:24:42 +00:00
Jung-uk Kim
172754036a Simplify fldcw() macro. There is no reason to use pointer here. No object
file change after this commit (verified with md5).
2010-07-26 23:20:55 +00:00
Jung-uk Kim
07c86dcf54 Add missing ldmxcsr() prototype for lint case. 2010-07-26 23:02:18 +00:00
Jung-uk Kim
8b019a8887 Remove an unused macro since r189418. 2010-07-26 22:55:14 +00:00
Jung-uk Kim
30402401a7 Reduce diff against fenv.h:
Mark all inline asms as volatile for safety.  No object file change after
this commit (verified with md5).
2010-07-26 22:16:36 +00:00
Jung-uk Kim
2e50fa36a5 FNSTSW instruction can use AX register as an operand.
Obtained from:	fenv.h
2010-07-26 21:24:52 +00:00
Gavin Atkinson
c3b40fb7bf Prevent uhid(4) from attaching to the Gembird Silver Shield remote power
plug.  Note that the Vendor ID 0x04b4 is officially assigned to Cypress,
so use that instead of adding a second vendor with an identical ID, in the
same way other similar cases are treated in usb/usbdevs.

PR:		usb/132785
Submitted by:	Dirk-Willem van Gulik <dirkx webweaving.org>
MFC after:	1 week
2010-07-26 21:22:57 +00:00
Gavin Atkinson
7ab53cc48b Prevent ukbd(4) and uhid(4) from attaching when a WiSPY DBx Spectrum
Analyzer is attached.

PR:		usb/134631
Submitted by:	Jesse Kempf <jkempf davisvision.com>
MFC after:	1 week
2010-07-26 20:44:29 +00:00
Jung-uk Kim
9bfb10b154 Re-implement FPU suspend/resume for amd64. This removes superfluous uses
of critical_enter(9) and critical_exit(9) by fpugetregs() and fpusetregs().
Also, we do not touch PCB flags any more.

MFC after:	1 month
2010-07-26 19:53:09 +00:00
John Baldwin
b739a509f2 - Change the warning about PCI-e links narrower than x8 to only apply to
10G cards.  1G cards are x4 only.
- Use constants from pcireg.h for reading the current link width.
- Use pci_set_max_read_req() rather than implementing it by hand.

Reviewed by:	np
MFC after:	1 week
2010-07-26 17:31:15 +00:00
Konstantin Belousov
970eba46d5 Remove unneeded includes.
Submitted by:	alc
MFC after:	1 week
2010-07-26 14:38:51 +00:00
Gleb Smirnoff
9da8211828 Zero padding fields of netflow records. This helps to reduce
size of compressed export logs.

Requested by:	Alexey Illarionov <littlesavage orionet.ru>
2010-07-26 13:48:35 +00:00
Konstantin Belousov
a9c9e80bec Revert r210451, and the similar part of the r210431. The forward-declaration
for the enum tag when enum definition is not complete is not allowed by
C99, and is gcc extension.

Requested by:	stefanf
MFC after:	28 days
2010-07-26 12:52:44 +00:00
Jaakko Heinonen
b42f40b8eb - Remove some extra white space.
- Wrap g_md_dumpconf() prototype to 80 columns.
2010-07-26 10:37:14 +00:00
Michael Tuexen
74e906fa94 Fix a bug where the length of a FORWARD-TSN chunk was set incorrectly in
the chunk. This resulted in malformed frames.
Remove a duplicate assignment.

MFC after: 2 weeks
2010-07-26 09:26:55 +00:00
Randall Stewart
8db924defb Make sure that we report chunks if a socket
still exists that were not sent. In either
case carefully remove the data if it does not
get taken by the reporting routines.

MFC after:	2 weeks
2010-07-26 09:22:52 +00:00
Randall Stewart
6c065bbe06 When counting the number of chunks in the
retransmission queue to validate the retran count, we
need to include the chunks in the control send queue
too. Otherwise the count will not match and you will get
the invarient warning if invarients are on.

MFC after:	2 weeks
2010-07-26 09:20:55 +00:00
Rui Paulo
daef39e7ae Remove the acpi_aiboost driver. It has been replaced by aibs(4). 2010-07-25 17:55:57 +00:00
Alan Cox
9e4e511499 Change the order in which the file name, arguments, environment, and
shell command are stored in exec*()'s demand-paged string buffer.  For
a "buildworld" on an 8GB amd64 multiprocessor, the new order reduces
the number of global TLB shootdowns by 31%.  It also eliminates about
330k page faults on the kernel address space.

Change exec_shell_imgact() to use "args->begin_argv" consistently as
the start of the argument and environment strings.  Previously, it
would sometimes use "args->buf", which is the start of the overall
buffer, but no longer the start of the argument and environment
strings.  While I'm here, eliminate unnecessary passing of "&length"
to copystr(), where we don't actually care about the length of the
copied string.

Clean up the initialization of the exec map.  In particular, use the
correct size for an entry, and express that size in the same way that
is used when an entry is allocated.  The old size was one page too
large.  (This discrepancy originated in 2004 when I rewrote
exec_map_first_page() to use sf_buf_alloc() instead of the exec map
for mapping the first page of the executable.)

Reviewed by:	kib
2010-07-25 17:43:38 +00:00
Alexander Motin
8edcf69406 Export PCI IDs of ATA/SATA controllers through CAM and ata(4) layers to
GEOM. This information needed for proper soft-RAID's on-disk metadata
reading and writing.
2010-07-25 15:43:52 +00:00
Martin Matuska
f4e7a6c3f1 Import two changesets from OpenSolaris to make future updates easier.
The changes do not affect FreeBSD code because
zfs_znode_move(), cleanlocks() and cleanshares() are not used.

OpenSolaris onnv changeset:	9788:f660bc44f2e8, 9909:aa280f585a3e

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6843700, 6790232)
MFC after:	7 weeks
2010-07-25 15:17:24 +00:00
Gavin Atkinson
6d07817641 Give a name to the HTC Wizard Smartphone
PR:		usb/135575
Submitted by:	lioux
2010-07-25 15:14:42 +00:00
Warner Losh
5343524a9e Get N64 building by defining VM_FREELIST_DIRECT to be
VM_FREELIST_DEFAULT.  I believe this is correct, since KX is set in
n64, and thus all RAM can be direct mapped.
2010-07-25 04:19:05 +00:00
Yoshihiro Takahashi
502074f0cf MFi386: revision 210387
Correctly setup LDADD with regards to libstand.
2010-07-25 02:22:32 +00:00
Andrew Turner
fa94061701 Allow external interrupts.
- Set the external pin to interrupt in bus_setup_intr
- Implement bus_config_intr for external interrupts
- Extend arm_{,un}mask_irq to work with external interrupts

Approved by:	imp (mentor)
2010-07-24 23:41:09 +00:00
Martin Matuska
34f56898a1 Consider snapshots as descendants via zfs allow -d
OpenSolaris onnv changeset:	9847:2f3ba86e857a

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6809340)
MFC after:	1 week
2010-07-24 22:28:29 +00:00
Rick Macklem
f92bbff248 Move sys/nfsclient/nfs_lock.c into sys/nfs and build it as a separate
module that can be used by both the regular and experimental nfs
clients. This fixes the problem reported by jh@ where /dev/nfslock
would be registered twice when both nfs clients were used.
I also defined the size of the lm_fh field to be the correct value,
as it should be the maximum size of an NFSv3 file handle.

Reviewed by:	jh
MFC after:	2 weeks
2010-07-24 22:11:11 +00:00
Andriy Gapon
7f5b7f2323 ichwd: correct range check for timeout value
This is similar to a fix in r189305 but for earlier ICH versions (<= 5).

Reported by:	someone via attilio
Discussed with:	des, attilio
MFC after:	1 week
2010-07-24 19:40:16 +00:00
George V. Neville-Neil
6de27dc09f style(9) fix
MFC after:	1 week
2010-07-24 18:53:46 +00:00
Konstantin Belousov
9a9f23bd2f Use forward declartion for enum uio_seg in imgact.h. This allows to remove
inclusion of sys/uio.h from the header.

Proposed by:	alc
MFC after:	1 week
2010-07-24 18:14:34 +00:00
Konstantin Belousov
0a058f9ef3 Reword the comment, fixing typo.
MFC after:	3 days
2010-07-24 14:23:06 +00:00
Alexander Motin
017cb944b1 Increment td->td_intr_nesting_level for LAPIC timer interrupts. Among other
things it hints SCHED_ULE to run clock swi handlers on their native CPUs,
avoiding many unneeded IPI_PREEMPT calls.
2010-07-24 10:49:59 +00:00
Alexander Motin
b577f44398 Remove extra commas from KTR_EVENT4() macro to match number of CTR6() args.
Comparing to other macros there should be strings concatenation, not a
separate arguments.
2010-07-24 10:07:17 +00:00
Konstantin Belousov
d48dda1244 Regen 2010-07-23 21:31:03 +00:00
Konstantin Belousov
0b53d1569e Remove the linux_exec_copyin_args(), freebsd32_exec_copyin_args() may
server as well. COMPAT_FREEBSD32 is a prerequisite for COMPAT_LINUX32.

Reviewed by:	alc
MFC after:	3 weeks
2010-07-23 21:30:33 +00:00
Alan Cox
69a8f9e3d1 Eliminate a little bit of duplicated code. 2010-07-23 18:58:27 +00:00
George V. Neville-Neil
dc1ccafedd Fix a bug in the statistics code for tracking the head and
tail pointers of the tx and rx queues.   We needed a SYSCTL_PROC
to correctly get the values at run time.

Submitted by:	Andrew Boyer aboyer at averesystems.com
MFC after:	1 week
2010-07-23 17:53:39 +00:00
Andriy Gapon
a85d8d8acc zfs arc_memory_throttle: available memory is free + cache
OpenSolaris freemem has the same meaning as our v_free_count +
v_cache_count.

Obtained from:	Artem Belevich <fbsdlist@src.cx>,
		Peter Jeremy <peterjeremy@acm.org>
Discussed with:	pjd
MFC after:	2 weeks
2010-07-23 17:44:01 +00:00
Andriy Gapon
676799a00d completely ignore zero-sized elf sections in modules of elf object type (amd64)
Current code doesn't check size of elf sections and may perform needless
actions of zero-sized memory allocation and similar.
The bigger issue is that alignment requirement of a zero-sized section
gets effectively applied to the next section if it has smaller alignment
requirement.  But other tools, like gdb and consequently kgdb,
completely ignore zero-sized sections and thus may map symbols to
addresses differently.

Zero-sized sections are not typical in general.
Their typical (only, even) cause in FreeBSD modules is inline assembly that
creates custom sections which is found in pcpu.h and vnet.h.  Mere inclusion
of one of those header files produces a custom section in elf output.
If there is no actual use for the section in a given module, then the
section remains empty.

Better solution is to avoid creating zero-sized sections altogether,
which is in plans.

Preloaded modules are handled in boot code (load_elf_obj.c), while
dynamically loaded modules are handled by kernel (link_elf_obj.c).

Based on code by:	np
MFC after:		3 weeks
2010-07-23 17:07:51 +00:00
Andriy Gapon
dac509311f cpufreq: allocate long-lived buffer for handling of sysctl requests
At present the cpufreq sysctl handler for current level setting would
allocate and deallocate a temporary buffer of 24KB even to handle a
read-only query.  This puts unnecessary load on memory subsystem when
current level is checked frequently, e.g. when the likes of powerd
and system monitoring software are running.
Change the strategy to allocating a long-lived buffer for handling the
requests.

Reviewed by:	njl
MFC after:	2 weeks
2010-07-23 16:46:42 +00:00
Ivan Voras
984c64736c Make lorunningspace catch up with hirunningspace.
While there, add comment about the magic numbers.

Prodded by:	alc
2010-07-23 12:30:29 +00:00
Konstantin Belousov
5f270659fd Crypto(4) driver for AESNI.
The aeskeys_{amd64,i386}.S content was mostly obtained from OpenBSD,
no objections to the license from core.

Hardware provided by:	Sentex Communications
Tested by:	fabient, pho (previous versions)
MFC after:	1 month
2010-07-23 11:00:46 +00:00
Alexander Motin
a6cca5d8a1 Add some comments. 2010-07-23 08:20:14 +00:00
Alexander Motin
44d1534122 Update MIPS timer code (except RMI) to utilize new MI event timer
infrastructure.

Reviewed by:	neel
2010-07-23 07:46:55 +00:00
Andrey V. Elsukov
733a9e2783 Prevent access after free to table entry in case when
user deletes partition that not yet created (changes doesn't
committed to disk).

PR:		148687
Approved by:	mav (mentor)
MFC after:	7 days
2010-07-23 06:30:01 +00:00
Martin Matuska
2bacd082bd Enable fake resolving of SMB RIDs by using nulldomain and UID_NOBODY
- fixes panics when Solaris/OpenSolaris pools that contain files
uploaded with the SMB protocol are accessed

Enable seting/unsetting the sharesmb property (dummy action)
- allows users who import pools from Solaris/Opensolaris to unset
the sharesmb property and get rid of annoying messages

PR:		kern/145778, kern/148709
Approved by:	pjd, delphij (mentor)
MFC after:	7 weeks
2010-07-22 23:30:24 +00:00
Andrew Turner
6fc08f19a6 Add the s3c24x0 real time clock driver
Approved by:	imp (mentor)
2010-07-22 23:23:39 +00:00
Andrew Turner
6eae6892da Rework how device memory is allocated on the s3c24x0 CPU's.
The device virtual addresses are now able to be allocated at runtime rather
than from the static pmap_devmap at boot. The only exception is memory
required before we have had a chance to dynamically allocate it.

While here reduce the space between the statically allocated devices by
reducing the distance between the virtual addresses.

Approved by:	imp (mentor)
2010-07-22 23:12:19 +00:00
Rui Paulo
6f450d8e09 Fix previous commit: don't remove the WERROR definition when using
clang.

Submitted by:	Dimitry Andric <dimitry at andric.com>
Reviewed by:	jkim
2010-07-22 21:31:35 +00:00
Weongyo Jeong
0f3801fa37 Fixes a mistake to calculate CALC_COEFF2() value that tmp[3] is
used even if it's unreachable.

PR:		kern/144505
Submitted by:	Henning Petersen <henning.petersen at t-online dot de>
MFC after:	1 week
2010-07-22 20:08:02 +00:00
Gabor Kovesdan
ade4363774 - Bump __FreeBSD_version for BSD grep import
Approved by:	delphij (mentor)
2010-07-22 19:15:26 +00:00
Rui Paulo
7d54a05ac8 Correctly setup LDADD with regards to libstand. The submitter points
out that "on amd64, libstand.a is compiled for i386, but is still installed
under ${WORLDTMP}/usr/lib instead of ${WORLDTMP}/usr/lib32.  Even if it
would be installed there, ld on amd64 is set up incorrectly with a
${TOOLS_PREFIX}/usr/lib/i386 default path, so it wouldn't link.  The reason
it does link under gcc is that gcc passes -L${WORLDTMP}/usr/lib twice,
even for -m32 builds, which is also incorrect, but accidentally works in
this case."

Submitted by:	Dimitry Andric <dimitry at andric.com>
2010-07-22 18:57:47 +00:00
Rui Paulo
3cc97e66ad Handle a few corner cases for clang like we did with icc. These should
reduce the number of warnings seen while building the kernel.

Submitted by:	Dimitry Andric <dimitry at andric.com>
2010-07-22 18:47:41 +00:00
Jung-uk Kim
82040afcf3 Fix an obvious typo from r1.1. We were acquiring an exclusive writer lock
regardless of the given flags.

MFC after:	3 days
2010-07-22 18:44:40 +00:00
Matthew D Fleming
033459c8f1 Remove unused variable that snuck in during development.
Approved by:    zml (mentor)
2010-07-22 17:23:43 +00:00
Matthew D Fleming
242ed5d96c Fix taskqueue_drain(9) to not have false negatives. For threaded
taskqueues, more than one task can be running simultaneously.

Also make taskqueue_run(9) static to the file, since there are no
consumers in the base kernel and the function signature needs to change
with this fix.

Remove mention of taskqueue_run(9) and taskqueue_run_fast(9) from the
taskqueue(9) man page.

Reviewed by:    jhb
Approved by:    zml (mentor)
2010-07-22 16:41:09 +00:00
Jaakko Heinonen
f4e7c5a894 Convert md(4) to use alloc_unr(9) and alloc_unr_specific(9) for unit
number allocation. The old approach had some problems such as it allowed
an overflow to occur in the unit number calculation.

PR:		kern/122288
2010-07-22 10:24:28 +00:00
Konstantin Belousov
87d45a0392 When compat32 binary asks for the value of hw.machine_arch, report the
name of 32bit sibling architecture instead of the host one. Do the
same for hw.machine on amd64.

Add a safety belt debug.adaptive_machine_arch sysctl, to turn the
substitution off.

Reviewed by:	jhb, nwhitehorn
MFC after:	2 weeks
2010-07-22 09:13:49 +00:00
Edward Tomasz Napierala
175389cff2 Remove spurious '/*-' marks and fix some other style problems.
Submitted by:	bde@
2010-07-22 05:42:29 +00:00
Xin LI
d74001ad8d Apply vendor version 1.20.00.17.
This version adds support for ARC1880; additionally this version fixed
an issue where all devices on a SAS port gets offlined when any device
failed on the port [1].

Many thanks to Areca for continuing to support FreeBSD.

PR:		kern/148502 [1]
Submitted by:	Ching-Lung Huang <ching2048 areca com tw>
Obtained from:	Areca
Tested by:	Rich Ercolani <rercola acm jhu edu> [1]
MFC after:	2 weeks
2010-07-21 18:50:24 +00:00
Rui Paulo
2b95672852 MFamd64:
Add USD_GETBASE(), USD_SETBASE(), USD_GETLIMIT() and USD_SETLIMIT().
2010-07-21 18:47:52 +00:00
Bjoern A. Zeeb
101235dcb3 Since r186119 IP6 input counters for octets and packets were not
working anymore.  In addition more checks and operations were missing.

In case lla_lookup results in a match, get the ifaddr to update the
statistics counters, and check that the address is neither tentative,
duplicate or otherwise invalid before accepting the packet.  If ok,
record the address information in the mbuf.  [ as is done in case
lla_lookup does not return a result and we go through the FIB ].

Reported by:	remko
Tested by:	remko
MFC after:	2 weeks
2010-07-21 13:01:21 +00:00
Alexander Motin
e88f9fb47f Use proper sysctl type (quad) for et_frequency. It fixes output on sparc64. 2010-07-21 12:23:49 +00:00
Attilio Rao
4e55157fa4 Probabilly defaulting to KTR_GEN is not the right decision when KTR_MASK
is not defined at all because KTR_GEN is still a valid class and some
traces may fit in. Default to 0, instead, and block any tracing.

As long as this is a POLA violation (some thirdy-part code, even if
that may be a questionable choice, could be rely on that feature) a
MFC possibility might be carefully evaluated.

Sponsored by:	Sandvine Incorporated
2010-07-21 10:14:04 +00:00
Attilio Rao
651aa2d896 KTR_CTx are long time aliased by existing classes so they can't serve
their purpose anymore. Axe them out.

Sponsored by:	Sandvine Incorporated
Discussed with:	jhb, emaste
Possible MFC:	TBD
2010-07-21 10:05:07 +00:00
Jayachandran C.
49ca10d40c Redo the page table page allocation on MIPS, as suggested by
alc@.

The UMA zone based allocation is replaced by a scheme that creates
a new free page list for the KSEG0 region, and a new function
in sys/vm that allocates pages from a specific free page list.

This also fixes a race condition introduced by the UMA based page table
page allocation code. Dropping the page queue and pmap locks before
the call to uma_zfree, and re-acquiring them afterwards  will introduce
a race condtion(noted by alc@).

The changes are :
- Revert the earlier changes in MIPS pmap.c that added UMA zone for
page table pages.
- Add a new freelist VM_FREELIST_HIGHMEM to MIPS vmparam.h for memory that
is not directly mapped (in 32bit kernel). Normal page allocations will first
try the HIGHMEM freelist and then the default(direct mapped) freelist.
- Add a new function 'vm_page_t vm_page_alloc_freelist(int flind, int
order, int req)' to vm/vm_page.c to allocate a page from a specified
freelist. The MIPS page table pages will be allocated using this function
from the freelist containing direct mapped pages.
- Move the page initialization code from vm_phys_alloc_contig() to a
new function vm_page_alloc_init(), and use this function to initialize
pages in vm_page_alloc_freelist() too.
- Split the  function vm_phys_alloc_pages(int pool, int order) to create
vm_phys_alloc_freelist_pages(int flind, int pool, int order), and use
this function from both vm_page_alloc_freelist() and vm_phys_alloc_pages().

Reviewed by:	alc
2010-07-21 09:27:00 +00:00
Juli Mallett
32272e3b0a Remove unused file. Replaced by tlb.c. 2010-07-20 21:17:33 +00:00
Juli Mallett
bfa39fa09f o) Add the "octusb" controller which supports the first port of the Octeon
on-board USB controller.  It is not currently enabled because there are
   known problems with device communication and until those are fixed I am not
   certain that it won't destabilize the system. [1]
o) Add the "cryptocteon" opencrypto device based on the OCF device written by
   David McCullough.  It is not currently enabled because until support for
   saving/restoring coprocessor 2 state on context switch is available, it runs
   with interrupts disabled, which tends to pessimize performance over using a
   software crypto facility.  Tests using this driver which are not negatively
   affected by it running with interrupts disabled show it to be substantially
   faster than software for large blocks.

Submitted by:	hps [1]
2010-07-20 19:32:25 +00:00
Juli Mallett
cea2b8b915 Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive
library:
o) Increase inline unit / large function growth limits for MIPS to accommodate
   the needs of the Simple Executive, which uses a shocking amount of inlining.
o) Remove TARGET_OCTEON and use CPU_CNMIPS to do things required by cnMIPS and
   the Octeon SoC.
o) Add OCTEON_VENDOR_LANNER to use Lanner's allocation of vendor-specific
   board numbers, specifically to support the MR320.
o) Add OCTEON_BOARD_CAPK_0100ND to hard-wire configuration for the CAPK-0100nd,
   which improperly uses an evaluation board's board number and breaks board
   detection at runtime.  This board is sold by Portwell as the CAM-0100.
o) Add support for the RTC available on some Octeon boards.
o) Add support for the Octeon PCI bus.  Note that rman_[sg]et_virtual for IO
   ports can not work unless building for n64.
o) Clean up the CompactFlash driver to use Simple Executive macros and
   structures where possible (it would be advisable to use the Simple Executive
   API to set the PIO mode, too, but that is not done presently.)  Also use
   structures from FreeBSD's ATA layer rather than structures copied from
   Linux.
o) Print available Octeon SoC features on boot.
o) Add support for the Octeon timecounter.
o) Use the Simple Executive's routines rather than local copies for doing reads
   and writes to 64-bit addresses and use its macros for various device
   addresses rather than using local copies.
o) Rename octeon_board_real to octeon_is_simulation to reduce differences with
   Cavium-provided code originally written for Linux.  Also make it use the
   same simplified test that the Simple Executive and Linux both use rather
   than our complex one.
o) Add support for the Octeon CIU, which is the main interrupt unit, as a bus
   to use normal interrupt allocation and setup routines.
o) Use the Simple Executive's bootmem facility to allocate physical memory for
   the kernel, rather than assuming we know which addresses we can steal.
   NB: This may reduce the amount of RAM the kernel reports you as having if
       you are leaving large temporary allocations made by U-Boot allocated
       when starting FreeBSD.
o) Add a port of the Cavium-provided Ethernet driver for Linux.  This changes
   Ethernet interface naming from rgmxN to octeN.  The new driver has vast
   improvements over the old one, both in performance and functionality, but
   does still have some features which have not been ported entirely and there
   may be unimplemented code that can be hit in everyday use.  I will make
   every effort to correct those as they are reported.
o) Support loading the kernel on non-contiguous cores.
o) Add very conservative support for harvesting randomness from the Octeon
   random number device.
o) Turn SMP on by default.
o) Clean up the style of the Octeon kernel configurations a little and make
   them compile with -march=octeon.
o) Add support for the Lanner MR320 and the CAPK-0100nd to the Simple
   Executive.
o) Modify the Simple Executive to build on FreeBSD and to build without
   executive-config.h or cvmx-config.h.  In the future we may want to
   revert part of these changes and supply executive-config.h and
   cvmx-config.h and access to the options contained in those files via
   kernel configuration files.
o) Modify the Simple Executive USB routines to support getting and setting
   of the USB PID.
2010-07-20 19:25:11 +00:00
Alexander Motin
599cf0f197 Fix several un-/signedness bugs of r210290 and r210293. Add one more check. 2010-07-20 15:48:29 +00:00
Ivan Voras
b089a17737 Fix expression style.
Prodded by: jhb
2010-07-20 13:59:51 +00:00
Tijl Coosemans
3245ecbe92 Store fsbase and gsbase in the right fields of the mcontext. They were
switched.

PR:		i386/148344
Approved by:	kib (mentor)
MFC after:	1 week
2010-07-20 12:36:36 +00:00
Alexander Motin
e9f0d5658c Refactor Marvell ARM SoC timer driver to the new timer infrastructure. 2010-07-20 11:46:45 +00:00
Rui Paulo
4e3eab5258 Fix typo in comment. 2010-07-20 11:20:45 +00:00
Alexander Motin
51636352b6 Extend timer driver API to report also minimal and maximal supported period
lengths. Make MI wrapper code to validate periods in request. Make kernel
clock management code to honor these hardware limitations while choosing hz,
stathz and profhz values.
2010-07-20 10:58:56 +00:00
Juli Mallett
219d14fe5f Import the Cavium Simple Executive from the Cavium Octeon SDK. The Simple
Executive is a library that can be used by standalone applications and kernels
to abstract access to Octeon SoC and board-specific hardware and facilities.
The FreeBSD port to Octeon will be updated to use this where possible.
2010-07-20 07:19:43 +00:00
Martin Matuska
f926b455e7 To improve latency, lower default vfs.zfs.vdev.max_pending from 35 to 10
OpenSolaris onnv changeset (partial):	10801:e0bf032e8673

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6891731)
MFC after:	1 week
2010-07-20 05:22:14 +00:00
Andrew Thompson
21a9d6e706 - Support for Globetrotter iCON 452.
- Fixed the interface probe routine to only attach to USB interfaces the driver
  actually supports.  This allows other drivers to attach to things like
  MicroSD slots etc.
- Fixed network interface enumeration to be globally sequential instead of
  relying on the USB interface numbers.  This make sure the first network
  interface always is at uhso0 and the second at usho1 and so on.
- Added a radio kill switch; exposed through sysctl.
- Updated the manual page to be verbose about the number of serial ports and
  include iCON 452 in the set of tested hardware.

Submitted by:	Fredrik Lindberg
2010-07-20 03:10:22 +00:00
David Xu
212bc4b337 Fix function name in error messages. 2010-07-20 02:23:12 +00:00
Pyun YongHyeon
ad09ad06bc Specify BCE_RX_BUF_ALIGN alignment for RX buffers. All bce(4)
controllers require RX buffers aligned on BCE_RX_BUF_ALIGN bytes.

Reviewed by:	davidch
2010-07-19 23:48:03 +00:00
Pyun YongHyeon
3016d3fe4e Specify BUS_DMA_ZERO flag to bus_dmamem_alloc(9) and remove bzero()
calls. Also add BUS_DMA_COHERENT flag to bus_dmamem_alloc(9) to
take advantage of efficient synchronization for architectures that
support that feature.

Reviewed by:	davidch
2010-07-19 23:41:45 +00:00
Pyun YongHyeon
6351e52fcf Use bus_get_dma_tag() to get parent tag. Also use
BUS_SPACE_MAXSIZE_32BIT to specify sum of all segment lengths.
Previously it used MAXBSIZE which was wrong.

Reviewed by:	davidch
2010-07-19 23:35:43 +00:00
Rick Macklem
66c0f45a3d For the experimental NFSv4 server's dumplocks operation, add the
MPSAFE flag to cn_flags so that it doesn't panic. The panics weren't
seen since nfsdumpstate(8) is broken for the "-l" case, so this
was never done. I'll do a separate commit to fix nfsdumpstate(8).

Submitted by:	zack.kirsch at isilon.com
MFC after:	2 weeks
2010-07-19 23:33:42 +00:00
Pyun YongHyeon
b18d9d4b15 Add KASSERT to check number of returned DMA segments.
Reviewed by:	davidch
2010-07-19 23:25:19 +00:00
Adrian Chadd
62c3a412df Fix naming to be consistent. 2010-07-19 21:50:43 +00:00
Adrian Chadd
53436ace02 Extend the mx25l erase function to support different erase commands. 2010-07-19 21:46:40 +00:00
Pyun YongHyeon
c87831d8f4 Do not report current link state if interface is not UP.
Reviewed by:	davidch
2010-07-19 21:41:54 +00:00