Commit Graph

158067 Commits

Author SHA1 Message Date
Alexander Motin
dd9595e7fa Add some foot shooting protection by checking singlemul value correctness.
Rephrase sysctls descriptions.

Suggested by:	edmaste
2010-09-14 04:48:04 +00:00
Peter Grehan
44633af3c7 Resurrect PSIM support by moving the cacheline size-detection warning
printf outside of the MMU-disabled region. A call into OpenFirmware
with the MMU off resulted in an internal PSIM assert.
2010-09-14 03:18:11 +00:00
Ed Maste
3e50771086 Avoid repeatedly spamming the console while a timed out command is waiting
to complete.  Instead, print one message after the timeout period expires,
and one more when (if) the command eventually completes.

MFC after:	1 month
2010-09-14 01:51:04 +00:00
Neel Natu
c895b6e6ee Port r212559 to mips.
Do not explicitly enable interrupts in smp_init_secondary() because it
renders any spinlock protected code after that point to run with
interrupts enabled. This is because the processor is executing in the
context of idlethread whose 'md_spinlock_count' is already set to 1.

Instead just let sched_throw() re-enable interrupts when it releases
the spinlock.

The original powerpc commit log for r212559 is available here:
http://svn.freebsd.org/viewvc/base?view=revision&revision=212559
2010-09-14 01:48:01 +00:00
Ed Maste
8744fd1ce1 Remove libf2c. It hasn't been used for more than 11 years, since revision
1.90 (CVS; SVN r45770) of lib/Makefile.
2010-09-14 01:40:59 +00:00
Ed Maste
b3f4d7e17c Remove extra ; 2010-09-14 01:33:21 +00:00
Neel Natu
b503d5c50e Enforce that pmap_mapdev() always returns uncacheable mappings.
Reviewed by:	imp, jchandra, jmallett
2010-09-14 01:27:53 +00:00
Nathan Whitehorn
07ae21bae9 Fix a missing set of parantheses that could cause recent versions of libthr
to crash deferencing a NULL pointer to the user context on powerpc64
systems with COMPAT_FREEBSD32 defined.
2010-09-13 22:50:05 +00:00
Jung-uk Kim
f6ff063a6e Fix segment:offset calculation of interrupt vector for relocated video BIOS
when the original offset is bigger than size of one page.  X86BIOS macros
cannot be used here because it is assumed address is only linear in a page.

Tested by:	netchild
2010-09-13 19:58:46 +00:00
Hiroki Sato
d3a8a8b9fa Split $ipv6_prefer into $ip6addrctl_policy and $ipv6_activate_all_interfaces.
The $ip6addrctl_policy is a variable to choose a pre-defined address
selection policy set by ip6addrctl(8).
The keyword "ipv4_prefer" sets IPv4-preferred one described in Section 10.3,
the keyword "ipv6_prefer" sets IPv6-preferred one in Section 2.1 in RFC 3484,
respectively.  When "AUTO" is specified, it attempts to read
/etc/ip6addrctl.conf first.  If it is found, it reads and installs it as
a policy table.  If not, either of the two pre-defined policy tables is
chosen automatically according to $ipv6_activate_all_interfaces.

When $ipv6_activate_all_interfaces=NO, interfaces which have no corresponding
$ifconfig_IF_ipv6 is marked as IFDISABLED for security reason.

The default values are ip6addrctl_policy=AUTO and
ipv6_activate_all_interfaces=NO.

Discussed with:	ume and bz
2010-09-13 19:55:40 +00:00
Hiroki Sato
95f15c1589 Localize $_punct_c in get_if_var() and whitespace clean-ups.
Based on:	changes in r206408 by dougb
2010-09-13 19:53:54 +00:00
Hiroki Sato
fa3b84643a - Check some specific IFs first in ipv6_autoconfif().
- $ipv6_enable supports YES|TRUE|ON|1 as in checkyesno().

Based on:	changes in r206408 by dougb
2010-09-13 19:53:22 +00:00
Hiroki Sato
abe3ac576a Add $ipv6_privacy to support net.inet6.ip6.use_tempaddr. Note that this
will be replaced with a per-IF version later.

Based on:	changes in r206408 by dougb
2010-09-13 19:52:46 +00:00
Hiroki Sato
e5481092bb Fix $ipv6_network_interfaces and set it as AUTO by default.
Based on:	changes in r206408 by dougb
2010-09-13 19:52:04 +00:00
Hiroki Sato
c5ad71aff5 Revert changes in r206408.
Discussed with:	dougb, core.5, and core.6
2010-09-13 19:51:15 +00:00
Pawel Jakub Dawidek
3c907063e9 Remove the page queues lock around vm_page_undirty() - it is no longer needed.
Reviewed by:	alc
2010-09-13 19:47:09 +00:00
Matthew D Fleming
404a593e28 Revert r212370, as it causes a LOR on powerpc. powerpc does a few
unexpected things in copyout(9) and so wiring the user buffer is not
sufficient to perform a copyout(9) while holding a random mutex.

Requested by: nwhitehorn
2010-09-13 18:48:23 +00:00
Ed Maste
cbb9ebd738 Allow a kernel config to specify a set but empty value via
'makeoptions OPTION=' for consistency with the make commandline.

Previously 'makeoptions WERROR=' would result in a syntax error; now
it produces the same effect as 'makeoptions WERROR'.  Both forms now
result in 'WERROR=' in the generated Makefile.
2010-09-13 18:26:34 +00:00
Rui Paulo
ec88dcaec1 Bump __FreeBSD_version to reflect the userland DTrace changes.
Sponsored by:	The FreeBSD Foundation
2010-09-13 17:53:43 +00:00
Rui Paulo
d69eb5201d Add a note about userland DTracing.
Sponsored by:	The FreeBSD Foundation
2010-09-13 17:49:39 +00:00
Warner Losh
747e7efda0 TARGET_64BIT isn't needed anymore, GC it (partial merge from tbemd). 2010-09-13 16:39:33 +00:00
Nathan Whitehorn
7a7811e7bf Fix a subtle bug uncovered by the recent one-shot timer import in which
any spin locks acquired between the enabling of interrupts in
machdep_ap_bootstrap() and the invocation of the scheduler would fail to
have interrupts disabled due to the fake spinlock already held by the
idle thread. sched_throw(NULL) will enable interrupts by itself when
exiting this spinlock, so just let it do that and don't enable interrupts
here.
2010-09-13 15:36:42 +00:00
Warner Losh
8cfc82586e Move to using Makefile.arch to include the proper target-specific programs. 2010-09-13 15:30:09 +00:00
Alexander Motin
6bbbd18b83 Change call order to enable interrupts only after timer being programmed.
Submitted by:	nwhitehorn
2010-09-13 14:25:07 +00:00
Pawel Jakub Dawidek
315fcbf7db Add G_TYPE_MULTI flag, which when set for the given option, will
allow the option to be specified multiple times. This will help to
implement things like passing multiple keyfiles to geli(8) instead of
cat(1)ing them all into stdin and reading from there using one '-k -'
option.
2010-09-13 13:59:28 +00:00
Pawel Jakub Dawidek
946e2f3595 - Remove gc_argname field. It was introduced for gpart(8), but if I
understand everything correctly, we don't really need it.
- Provide default numeric value as strings. This allows to simplify
  a lot of code.
- Bump version number.
2010-09-13 13:48:18 +00:00
Jayachandran C.
480f6157fb sys/mips/rmi/msgring.h - fixes and clean up.
- Remove sync from msgrng_send, sync needs to be called just once before
  sending.
- Fix retry logic - don't reload registers when retrying in message_send,
  also fix check for send pending fail.
- remove unused message_send_block_fast()
- merge message_receive_fast() to message_receive
- style(9) fixes, and comments
- rge and nlge updated for the sys/mips/rmi/msgring.h changes
2010-09-13 13:11:50 +00:00
David Xu
7820a71113 Don't compare thread pointers again. 2010-09-13 11:58:42 +00:00
David Xu
cbadc1d7ad Fix copy&paste problem. 2010-09-13 11:57:46 +00:00
Jayachandran C.
04a68e0904 bus_add_child method is needed now. 2010-09-13 11:47:35 +00:00
Andriy Gapon
09c22c66e1 acpi_cpu: do not apply P_LVLx_LAT rules to latencies returned by _CST
ACPI specification sates that if P_LVL2_LAT > 100, then a system doesn't
support C2; if P_LVL3_LAT > 1000, then C3 is not supported.
But there are no such rules for Cx state data returned by _CST.  If a
state is not supported it should not be included into the return
package.  In other words, any latency value returned by _CST is valid,
it's up to the OS and/or user to decide whether to use it.

Submitted by:	nork
Suggested by:	mav
MFC after:	1 week
2010-09-13 09:51:24 +00:00
David Xu
fa1efe5efd Update symbol. 2010-09-13 09:23:38 +00:00
Pawel Jakub Dawidek
a478ea7490 - Allow to specify value as const pointers.
- Make optional string values always an empty string.
2010-09-13 08:56:07 +00:00
Andriy Gapon
b7d28b2e0b bus_add_child: add specialized default implementation that calls panic
If a kobj method doesn't have any explicitly provided default
implementation, then it is auto-assigned kobj_error_method.
kobj_error_method is proper only for methods that return error code,
because it just returns ENXIO.
So, in the case of unimplemented bus_add_child caller would get
(device_t)ENXIO as a return value, which would cause the mistake to go
unnoticed, because return value is typically checked for NULL.
Thus, a specialized null_add_child is added.  It would have sufficied
for correctness to return NULL, but this type of mistake was deemed to
be rare and serious enough to call panic instead.

Watch out for this kind of problem with other kobj methods.

Suggested by:	jhb, imp
MFC after:	2 weeks
2010-09-13 08:34:20 +00:00
Warner Losh
80dfae5fe2 Simplify atomic selection 2010-09-13 07:29:02 +00:00
Warner Losh
c614f4e2db Prefer MACHINE_CPUARCH over MACHINE_ARCH 2010-09-13 07:27:03 +00:00
Alexander Motin
a157e42516 Refactor timer management code with priority to one-shot operation mode.
The main goal of this is to generate timer interrupts only when there is
some work to do. When CPU is busy interrupts are generating at full rate
of hz + stathz to fullfill scheduler and timekeeping requirements. But
when CPU is idle, only minimum set of interrupts (down to 8 interrupts per
second per CPU now), needed to handle scheduled callouts is executed.
This allows significantly increase idle CPU sleep time, increasing effect
of static power-saving technologies. Also it should reduce host CPU load
on virtualized systems, when guest system is idle.

There is set of tunables, also available as writable sysctls, allowing to
control wanted event timer subsystem behavior:
  kern.eventtimer.timer - allows to choose event timer hardware to use.
On x86 there is up to 4 different kinds of timers. Depending on whether
chosen timer is per-CPU, behavior of other options slightly differs.
  kern.eventtimer.periodic - allows to choose periodic and one-shot
operation mode. In periodic mode, current timer hardware taken as the only
source of time for time events. This mode is quite alike to previous kernel
behavior. One-shot mode instead uses currently selected time counter
hardware to schedule all needed events one by one and program timer to
generate interrupt exactly in specified time. Default value depends of
chosen timer capabilities, but one-shot mode is preferred, until other is
forced by user or hardware.
  kern.eventtimer.singlemul - in periodic mode specifies how much times
higher timer frequency should be, to not strictly alias hardclock() and
statclock() events. Default values are 2 and 4, but could be reduced to 1
if extra interrupts are unwanted.
  kern.eventtimer.idletick - makes each CPU to receive every timer interrupt
independently of whether they busy or not. By default this options is
disabled. If chosen timer is per-CPU and runs in periodic mode, this option
has no effect - all interrupts are generating.

As soon as this patch modifies cpu_idle() on some platforms, I have also
refactored one on x86. Now it makes use of MONITOR/MWAIT instrunctions
(if supported) under high sleep/wakeup rate, as fast alternative to other
methods. It allows SMP scheduler to wake up sleeping CPUs much faster
without using IPI, significantly increasing performance on some highly
task-switching loads.

Tested by:	many (on i386, amd64, sparc64 and powerc)
H/W donated by:	Gheorghe Ardelean
Sponsored by:	iXsystems, Inc.
2010-09-13 07:25:35 +00:00
Warner Losh
3c7f49dcf2 Prefer MACHINE_CPUARCH to MACHINE_ARCH unless there's a good reason... 2010-09-13 07:22:14 +00:00
David Xu
b749a04db3 PS_DEAD state needs not be checked because _thr_find_thread() has already
checked it.
2010-09-13 07:18:00 +00:00
Warner Losh
3a0d123e5f Use MACHINE_CPUARCH as appropriate
Define __KLD_SHARED to be yes or no depending on if the target uses shared
binaries for klds or not (this also eliminates 4 uses of MACHINE_ARCH).
2010-09-13 07:16:48 +00:00
Warner Losh
9117ce0c88 It turns out that TARGET_CPUARCH doesn't buy us much here, if anything, but
costs us another copy of the transform.  Revert it.

# Maybe makefile.inc1 should set TARGET_CPUARCH for the cross-tools, but
# it doesn't now.  That would solve problems in other places too.

Submitted by:	jmallet@
2010-09-13 07:15:01 +00:00
David Xu
a9b764e218 Convert thread list lock from mutex to rwlock. 2010-09-13 07:03:01 +00:00
Warner Losh
336c4b45ea Doh! two last second refactoring typos crept in. Fix. 2010-09-13 06:50:07 +00:00
Warner Losh
d2fb1699ac Revert r212513 and reimplement the search order to be ARCH, CPUARCH 2010-09-13 06:35:35 +00:00
Alexander Motin
373d257ef0 Add tunable 'hint.hpet.X.per_cpu' to specify how much per-CPU timers driver
should provide if there is sufficient hardware. Default is 1.
2010-09-13 06:32:56 +00:00
Jayachandran C.
a3e0e990de The functions in sys/mips/mips/psraccess.S can be implemented with
mips_rd_status/mips_wr_status.  Implement them in mips/include/cpufunc.h,
and remove psraccess.S.

Reviewed by:	neel, imp
2010-09-13 05:03:37 +00:00
Warner Losh
fca5b4f4d9 This is exactly the same as the .else, so remove it. 2010-09-13 04:23:23 +00:00
Warner Losh
4a9a1e43a5 Ooops! Shouldn't have committed this 2010-09-13 02:26:36 +00:00
Warner Losh
130ecf684f MF tbemd: Move to using Makefile.arch to select what to build.
Reviewed by:	arch@ (no objection)
2010-09-13 02:25:21 +00:00
Warner Losh
22e2f727d0 Merge from tbemd: Move to using Makefile.arch to control what's build.
Reviewed by:	(arch@, no objection)
2010-09-13 02:23:03 +00:00