MFC r209664:
Add ata(4) ability to limit initial ATA mode for devices via device hints.
After boot this mode can be changed with atacontrol/camcontrol as usual.
It works for both legacy and ATA_CAM wrapper mode.
Enhance config to handle MACHINEs with multiple architectures:
- Passing -m to config will now print the MACHINE and MACHINE_ARCH
given in the passed kernel configuration file and then exit.
- If an option is defined in options.MACHINE with the same name as the
architecture of the kernel being configured, that option will be
considered set. This allows conditional compilation based on CPU
architecture.
o make cmd scoped to the whole do_rules function, since it really is
scoped to the whole fucnion. Making it static was the wrong way to
fix referencing it outside of the block in which it was declared
(and conforms to the style of the rest of the file).
o remove a couple of meaningless blank lines
o properly wrap one line.
Partially MFC 209592:
Add a tdksignal() routine that mirrors pksignal() except that it accepts a
thread instead of a process. As an extension, if a NULL ksiginfo_t is
passed in, setup a ksiginfo_t on the stack similar to psignal(). This
provides semantics matching the new tdsignal() function in 9 while
preserving the existing ABI.
MFC 208507,208556,208621:
Add support for corrected machine check interrupts. CMCI is a new local
APIC interrupt that fires when a threshold of corrected machine check
events is reached. CMCI also includes a count of events when reporting
corrected errors in the bank's status register. Note that individual
banks may or may not support CMCI. If they do, each bank includes its own
threshold register that determines when the interrupt fires. Currently
the code uses a very simple strategy where it doubles the threshold on
each interrupt until it succeeds in throttling the interrupt to occur
only once a minute (this interval can be tuned via sysctl). The threshold
is also adjusted on each hourly poll which will lower the threshold once
events stop occurring.
MFC 208787:
Assert that the thread lock is held in sched_pctcpu() instead of
recursively acquiring it. All of the current callers already hold the
lock.
MFC 209588:
- The ETIMEDOUT error applies to pthread_timedjoin_np(), not pthread_join().
- Tweak wording in history section for pthread_timedjoin_np().
ed [Tue, 13 Jul 2010 11:04:46 +0000 (11:04 +0000)]
MFC r209718:
Fix a race condition, where a TTY could be destroyed twice.
There are special cases where tty_rel_free() can be called twice in a
row, namely when closing and revoking the TTY at the same moment. Only
call destroy_dev_sched_cb() once.
MFC r209577, r209761:
- Fix a lock leak in case the ticks wrapped up
- Simplify the logic for handling ticks wrap-ups
- Fix a bug where a thread may be in sleepign state but not on a
sleepqueue chain still.
MFC r209214:
When Emulate3Button is active, do not set select() timeout in states when
it is not needed. No need to kick CPU every 20ms without a purpose.
MFC r209328,r209330:
While we indeed can't precisely measure time spent in C1, we can consider
measured interval as upper bound. It should be more precise then just
assuming 1/(2*hz). For idle CPU it should be quite precise, for busy - not
worse then before.
MFC r208946:
New netgraph node ng_patch(4). It performs data modification of packets
passing through. Modifications are restricted to a subset of C language
operations on unsigned integers of 8, 16, 32 or 64 bit size.
These are: set to new value (=), addition (+=), subtraction (-=),
multiplication (*=), division (/=), negation (= -), bitwise AND (&=),
bitwise OR (|=), bitwise eXclusive OR (^=), shift left (<<=),
shift right (>>=). Several operations are all applied to a packet
sequentially in order they were specified by user.
Submitted by: Maxim Ignatenko <gelraen.ua at gmail.com>
Vadim Goncharov <vadimnuclight at tpu.ru>
Discussed with: net@
MFC r208947:
Fix typo.
MFC r208989:
Style(9) fixes:
* Sort includes
* Replace #define<SPACE> to #define<TAB>
* Split declarations and initializations
* Split long lines
Requested by: kib
MFC r209194:
* Include sys/systm.h for KASSERT()
* Remove unneeded includes and comment
* Replace home made OFFSETOF() macro with standard offsetof()
MFC 208742:
MFamd64: Add a new macro PCPU_XEN_FIELDS to hold XEN-specific per-CPU
fields that is always included in PCPU_MD_FIELDS. The macro is empty for
non-XEN kernels. This avoids duplicating non-XEN per-CPU fields in two
places. While here, remove several unused fields from the XEN-specific
structure.
MFC r209598:
Initializes the ratectl for a node when the state is changed to RUN.
This prevents a kernel fault by dividing with zero because the initial
rate was 0 and didn't be initialized.
MFC r209597:
Fixes NULL pointer reference that it's occurred when the state is
changed to RUN because ic->ic_newassoc isn't set anywhere now. In the
previous bwi_newassoc() is used to initialize AMRR rate routines.
Merge 209589 from head:
After processing the O_SKIPTO opcode our cmd points to the next rule, and
"match" processing at the end of inner loop would look ahead into the next
rule, which is incorrect. Particularly, in the case when the next rule
started with F_NOT opcode it was skipped blindly.
To fix this, exit the inner loop with the continue operator forcibly and
explicitly.
- Add a utility macro to simplify calculating an aggregate sum from a DPCPU
counter variable.
- Rename the internal for loop iterator to "_i" to avoid potential shadowing of
external variables named "i". The "_" prefix is reserved for infrastructure
type code and is therefore not expected to be used by normal code likely to
call DPCPU_SUM(). [1]
- Change DPCPU_SUM to return the sum rather than calculate and assign it
internally. Usage is now: "sum = DPCPU_SUM(dpcpu_var, member_to_sum);" [2]
- Fix some style nits. [3]
Sponsored by: FreeBSD Foundation
Suggested by: bde [3], mdf [1], kib [1,2], pjd [1,3]
Reviewed by: jhb, rpaulo, rwatson (old version of r209119), kib (r209325)
- Rework the underlying ALQ storage to be a circular buffer, which amongst other
things allows variable length messages to be easily supported.
- Extend KPI with alq_writen() and alq_getn() to support variable length
messages, which is enabled at ALQ creation time depending on the arguments
passed to alq_open(). Also add variants of alq_open() and alq_post() that
accept a flags argument. The KPI is still fully backwards compatible and
shouldn't require any change in ALQ consumers unless they wish to utilise
the new features.
- Introduce the ALQ_NOACTIVATE and ALQ_ORDERED flags to allow ALQ consumers
to have more control over IO scheduling and resource acquisition
respectively.
- Strengthen invariants checking.
- Document ALQ changes in ALQ(9) man page.
Sponsored by: FreeBSD Foundation
Reviewed by: gnn, jeff, rpaulo, rwatson
marius [Wed, 7 Jul 2010 19:52:50 +0000 (19:52 +0000)]
MFC: r209695
- Pin the IPI cache and TLB demap functions in order to prevent migration
between determining the other CPUs and calling cpu_ipi_selected(), which
apart from generally doing the wrong thing can lead to a panic when a
CPU is told to IPI itself (which sun4u doesn't support).
Reported and tested by: Nathaniel W Filardo
- Add __unused where appropriate.
Package set for 8.1-RELEASE. We still have a 2Gb maximum file size
limit caused by cvsup still being used for some of our mirror system.
That is being worked on.
Modify the console mouse pointer drawing routine to use single-byte writes
instead of 4-byte ones. Because the mouse pointer can start part way
through a character cell, 4-byte memory operations are not necessarily
aligned, triggering a fatal alignment exception when the console pointer
was moved on PowerPC G5 systems.
Move default HZ from 100 to 1000 on powerpc, and rearrange the logic
slightly, so that it is set to 100 on ARM and MIPS and defaults to 1000,
instead of defaulting to 100, and setting it to 1000 on everything but
ARM and MIPS.
- Missing full stops
- Upper case the first character of an description
- Section headings do not need to be quoted. From OpenBSD's make.1, revision 1.81
- Plural of suffix is suffixes. From OpenBSD's make.1, revision 1.61
- s/seperating/separating/
MFC r209169:
Fix TX retry rate handling. tx->linkq is an index to a rate table
beginning with the highest available rate. Currently we always use
54m for the first retry no matter what AMRR has choosen. Fix this
by setting the index to the next lower rate.
Implement an optional delay to the ddb reset/reboot command.
This allows textdumps to be run automatically with unattended reboots
after a resonable timeout, while still permitting an administrator to
break into debugger if attached to the console at the time of the
event for further debugging. Cap the maximum delay at 1 week to avoid
highly accidental results, and default to 15s in case of problems
parsing the timeout value.
Move hex2dec helper function from db_thread.c to db_command.c to make
it generally available and prefix it with a "db_" to avoid namespace
collisions.
Improve IPsec flow distribution for better netisr parallelism.
Instead of using the pointer that would have the last bits masked in a %
statement in netisr_select_cpuid() to select the queue, use the SPI.
MFC r209337: sh: Fix compilation with -DNO_HISTORY.
The LINENO code uses snprintf() and relied on "myhistedit.h" to pull in the
necessary <stdio.h>.
Compiling with -DNO_HISTORY disables all editing and history support and
allows linking without -ledit -ltermcap. This may be useful for embedded
systems.
MFC r209104:
Add modifications of devctl_notify(9) functions that take flags. Use
flags to specify M_WAITOK/M_NOWAIT. M_WAITOK allows devctl to sleep for
the memory allocation.
MFC r209294:
Add -fno-asynchronous-unwind-tables to disable unwind table generation
for crtbegin/crtend. While there, disable omitting the frame pointer.
MFC r209540
* Do not dereference a NULL pointer when calling an SCTP send syscall
not providing a destination address and using ktrace.
* Do not copy out kernel memory when providing sinfo for sctp_recvmsg().
Both bug where reported by Valentin Nechayev.
The first bug results in a kernel panic.
tuexen [Mon, 28 Jun 2010 10:50:14 +0000 (10:50 +0000)]
MFC r209470,r209499
* Implement sctp_does_stcb_own_this_addr() correclty. It was taking the
wrong side into account.
* sctp_findassociation_ep_addr() must check the local address if available.
This fixes a bug where ABORT chunks were accepted even in the case where
the local was not owned by the endpoint.
Thanks to brucec for pointing out a bug in my first version of the fix.
kib [Mon, 28 Jun 2010 01:16:34 +0000 (01:16 +0000)]
MFC r209120:
In NFS clients, instead of inconsistently using #ifdef
DIAGNOSTIC and #ifndef DIAGNOSTIC for debug assertions, prefer
KASSERT(). Also change one #ifdef DIAGNOSTIC in the new nfs server.
delphij [Sun, 27 Jun 2010 03:06:20 +0000 (03:06 +0000)]
MFC 196750,196751,196818,196819 (ache@):
196750:
1) Use isprint() instead of hardcoded values to detect non-printable.
2) Use (unsigned char) cast in waddch() calls.
It fix highlighting bug: sign extension of 8bit to the attributes area.
3) Use setlocale() in any case.
196751:
Move <locale.h> out of NO_CATGETS define too (as setlocale() in prev.
commit)
196818:
1) Remove single occurance of HAS_CTYPE ifdef, ctype functions
used here for a long time and needs their header in anycase.
2) Add (unsigned char) casts to more ctype macros.
3) Simplify menu input handling using ctype instead of range unguarded
hardcoded tricks.
196819:
Remove single occurance of HAS_CTYPE ifdef, ctype functions
used here for a long time and needs their header in anycase.
Requested by: Patrick Lamaiziere <patfbsd davenulle org>
Ok'ed by: ache
jhb [Thu, 24 Jun 2010 13:17:45 +0000 (13:17 +0000)]
MFC 208915,208991:
- Use a bit more care when moving I/O APIC interrupts between CPUs. Mask
the interrupt followed by a brief delay if it is not currently masked
before moving the interrupt.
- Move the icu_lock out of ioapic_program_intpin() and into callers. This
closes a race where ioapic_program_intpin() could use a stale value of
the masked state to compute the masked bit in the register.
jhb [Thu, 24 Jun 2010 13:11:12 +0000 (13:11 +0000)]
MFC 208392:
- Adjust the whitespace for the lines that output fields in 'show pcpu' in
DDB so that all the fields line up.
- Print out the tid of the per-CPU idlethread instead of the pid since
the idle process is now shared across all idle threads.
jhb [Thu, 24 Jun 2010 12:08:50 +0000 (12:08 +0000)]
MFC 208391:
Assert that the thread passed to sched_bind() and sched_unbind() is
curthread as those routines are only supported for curthread currently.
ae [Thu, 24 Jun 2010 05:52:44 +0000 (05:52 +0000)]
MFC r207094 (by marcel):
Implement the resize verb and add support for resizing partitions
for all schemes but EBR.
MFC r207095 (by marcel):
Implement the resize command for resizing partitions. Without new
size, the partition in question is resized to fill all available
space.
mount(8): add xref to devfs(5)
devfs(5): change example to something more likely to be useful (it is not
necessary to mount a devfs on /dev manually, but for chroots/jails it is
often needed), mention since when devfs is preferred to device nodes on ufs
and when device nodes on ufs stopped working