Commit graph

78498 commits

Author SHA1 Message Date
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