MFC: Initialize list of kld's correctly when there are no kld's and catch
errors in kgdb_parse() so it returns 0 for invalid expressions. This
fixes the kld loading for 6.x and 7.x.
MFC rev. 1.6-1.7
- Switch from timeval to bintime, to use 1/(2^20) of seconds instead of
microseconds. It allows to use bit shifts instead of some heavy 64bit
mul/div math operations.
- Account all node stats at the shape mode.
- Do not check destination hook presence, it will be done by netgraph.
- Use u_int instead of int in some places to simplify type conversions.
- Use NG_SEND_DATA_ONLY() macro instead of selfmade equivalent.
Add a /S mode to DDB "ex" command, which interprets and prints the
value at the requested address as a symbol. For example, "ex /S
aio_swake" prints the name of the function currently registered in
via aio_swake hook.
The change as committed differs slightly from the patch in the PR,
as I force the size of the retrieved value (and the automatic
address increment) to be sizeof(void *). This seems to provide
the most useful auto-increment behavior, and defaults using the
default size (4), which is not sizeof(void *) on 64-bit platforms.
PR: 57976
Submitted by: Dan Strick <strick at covad.net>
Use dump_write() instead of direct calls to di->dumper() in textdumps.
Textdumps already do pretty much the same sanity checking, but
abstractions and seatbelts are both useful.
Merge options:1.616, db_capture.c:1.4 from HEAD to RELNEG_7:
Allow DDB_CAPTURE_DEFAULTBUFSIZE and DDB_CAPTURE_MAXBUFSIZE to be
overridden at compile-time using kernel options of the same names.
Rather than doing a compile-time CTASSERT of buffer sizes being
even multiples of block sizes, just adjust them at boottime, as
the failure mode is more user-friendly.
rwatson [Mon, 31 Mar 2008 22:03:54 +0000 (22:03 +0000)]
Merge savecore.8:1.26, savecore.c:1.79 from HEAD to RELENG_7:
Teach savecore(8) how to extract textdump(4) dumps.
Update savecore(8) man page to reflect textdump additions.
Merge savecore.c:1.80 from HEAD to RELENG_7:
Compare kernel dump header magic with textdump magic using strncmp()
rather than the memcmp() which is used for regular dumps: the
textdump string is one character shorter, so we need to stop
comparing at the end of the string.
Use independent version checking logic for architecture-specific
version number vs. textdump version number, as the version sequences
may (someday) differ.
rwatson [Mon, 31 Mar 2008 22:00:27 +0000 (22:00 +0000)]
Merge Makefile:1.401, ddb.4:1.46, textdump.4:1.1 from HEAD to RELENG_7:
Add textdump(4) man page to describe the textdump facility and provide
some stock formulas for use.
Update ddb(4) to reference the textdump(4) page, list the textdump
commands, and suggest using them with scripts and output capture.
Update HISTORY section.
rwatson [Mon, 31 Mar 2008 21:57:24 +0000 (21:57 +0000)]
Merge files:1.1260, db_capture.c:1.2, db_command.c:1.76,
db_textdump.c:1.1, ddb.h:1.46, kern_shutdown.c:1.187 from HEAD to
RELENG_7:
Add textdump(4) facility, which provides an alternative form of kernel
dump using mechanically generated/extracted debugging output rather than
a simple memory dump. Current sources of debugging output are:
- DDB output capture buffer, if there is captured output to save
- Kernel message buffer
- Kernel configuration, if included in kernel
- Kernel version string
- Panic message
Textdumps are stored in swap/dump partitions as with regular dumps, but
are laid out as ustar files in order to allow multiple parts to be stored
as a stream of sequentially written blocks. Blocks are written out in
reverse order, as the size of a textdump isn't known a priori. As with
regular dumps, they will be extracted using savecore(8).
One new DDB(4) command is added, "textdump", which accepts "set",
"unset", and "status" arguments. By default, normal kernel dumps are
generated unless "textdump set" is run in order to schedule a textdump.
It can be canceled using "textdump unset" to restore generation of a
normal kernel dump.
Several sysctls exist to configure aspects of textdumps;
debug.ddb.textdump.pending can be set to check whether a textdump is
pending, or set/unset in order to control whether the next kernel dump
will be a textdump from userspace.
While textdumps don't have to be generated as a result of a DDB script
run automatically as part of a kernel panic, this is a particular useful
way to use them, as instead of generating a complete memory dump, a
simple transcript of an automated DDB session can be captured using the
DDB output capture and textdump facilities. This can be used to
generate quite brief kernel bug reports rich in debugging information
but not dependent on kernel symbol tables or precisely synchronized
source code. Most textdumps I generate are less than 100k including
the full message buffer. Using textdumps with an interactive debugging
session is also useful, with capture being enabled/disabled in order to
record some but not all of the DDB session.
aac.c 1.136, aac_ioctl.h 1.13:
Implement FSACTL_LNX_GET_FEATURES and FSACTL_GET_FEATURES ioctls. RAID
tools (e.g. arcconf) need this to be able to create arrays larger than 2TB.
Submitted by: Adaptec, via driver build 15317
The RELENG_7 and HEAD drivers are in sync as of this commit.
emaste [Mon, 31 Mar 2008 14:32:06 +0000 (14:32 +0000)]
MFC - diff reduction w/ HEAD
aac.c 1.131:
Diff reduction to Adaptec driver build 15317 (refactoring and code shuffling):
- Resource allocation in aac_alloc (moved from from aac_init)
- Interrupt setup in aac_setup_intr (from aac_attach)
- Container probing in aac_get_container_info (from aac_startup and
aac_handle_aif)
- Firmware status check moved to aac_check_firmware from aac_init
aac.c 1.132, aac_cam.c 1.31, aad_debug.c 1.24, aac_disk.c 1.44,
aac_pci.c 1.67, aacvar.h 1.50:
Diff reduction to Adaptec's driver (around build 15317): catch up with a
change in debugging routines.
The fwprintf macro in the AAC_DEBUG case (mapping to printf) isn't from the
Adaptec driver.
aac.c 1.135:
Add \n to the end of a printf string and remove it from panic strings.
rwatson [Sun, 30 Mar 2008 17:20:40 +0000 (17:20 +0000)]
Merge kerneldump.h:1.10 from HEAD to RELENG_7:
Define a new kernel dump "architecture", TEXTDUMPMAGIC, which is used
to identify textdumps in the swap/dump partition. While textdumps
aren't really an architecture, they are architecture-neutral and so
don't really correspond to any existing architecture.
Define a version number for textdumps, KERNELDUMP_TEXT_VERSION, of 1.
rwatson [Sun, 30 Mar 2008 17:07:10 +0000 (17:07 +0000)]
Merge Makefile:1.169, ddb/Makefile:1.1, ddb.8:1.1, ddb.c:1.1,
ddb.h:1.1, ddb_script.c:1.1 from HEAD to RELENG_7:
Add command-line tool ddb(8), which allows DDB(4) scripts to be
managed from userspace. It is largely a wrapper for sysctl()
calls, but because the sysctls for adding and removing scripts
are awkward to use directly, this provides an easier-to-use
interface.
rwatson [Sun, 30 Mar 2008 17:03:58 +0000 (17:03 +0000)]
Merge files:1.1259, db_command.c:1.75, db_command.h:1.14, db_lex.c:1.23,
db_lex.h:1.15, db_main.c:1.7, db_script.c:1.1-1.2, ddb.h:1.45 from HEAD
to RELENG_7:
Add a simple scripting facility to DDB(4), allowing the user to
define a set of named scripts. Each script consists of a list of DDB
commands separated by ";"s that will be executed verbatim. No higher
level language constructs, such as branching, are provided for:
scripts are executed by sequentially injecting commands into the DDB
input buffer.
Four new commands are present in DDB: "run" to run a specific script,
"script" to define or print a script, "scripts" to list currently
defined scripts, and "unscript" to delete a script, modeled on shell
alias commands. Scripts may also be manipulated using sysctls in the
debug.ddb.scripting MIB space, although users will prefer to use the
soon-to-be-added ddb(8) tool for usability reasons.
Scripts with certain names are automatically executed on various DDB
events, such as entering the debugger via a panic, a witness error,
watchdog, breakpoint, sysctl, serial break, etc, allowing customized
handling.
Add a new 'why' argument to kdb_enter(), and a set of constants to use
for that argument. This will allow DDB to detect the broad category of
reason why the debugger has been entered, which it can use for the
purposes of deciding which DDB script to run.
Assign approximate why values to all current consumers of the
kdb_enter() interface.
For ABI/KPI reasons, the MFC creates a new function, kdb_enter_why(),
with the new argument, updating existing consumers to use that,
preserving kdb_enter() with the current argument, and wrapping it around
kdb_enter_why().
mav [Sun, 30 Mar 2008 08:01:48 +0000 (08:01 +0000)]
MFC ng_pptpgre.c rev. 1.41-1.42
Rewrite node to support multiple hooks, alike to ng_l2tp, to use one pair
of pptpgre and ksocket nodes for all calls between two peers. This patch
modifies node's API by adding new "session_%04x" hook names support, while
keeping backward compatibility.
remko [Sat, 29 Mar 2008 13:53:07 +0000 (13:53 +0000)]
MFC rev 1.134 ObsoleteFiles.inc
Document the removal data for usbdevs.h and usbdevs_data.h,
sort the entry into it's correct place (behind 200407XX before
200406XX because we have an explicit date here).
remko [Sat, 29 Mar 2008 13:44:36 +0000 (13:44 +0000)]
MFC rev 1.84 route.c
In route.c in newroute() there's a call to exit(0) if the command was
'get'. Since rtmsg() always gets called and returns 0 on success and -1
on failure, it's possible to exit with a suitable exit code by calling
exit(ret != 0) instead, as is done at the end of newroute().
rdivacky [Fri, 28 Mar 2008 10:13:20 +0000 (10:13 +0000)]
MFC rev. 1.12 of sys/compat/linux/linux_futex.c
MFC rev. 1.3 of sys/compat/linux/linux_futex.h:
o Add stub support for some new futex operations,
so the annoying message is not printed.
o Don't warn about FUTEX_FD not being implemented
and return ENOSYS instead of 0 (eg. success).
o Clear FUTEX_PRIVATE_FLAG as we actually implement
only private futexes so there is no reason to
return ENOSYS when app asks for a private futex.
We don't reject shared futexes because they worked
just fine with our implementation so far.
emaste [Thu, 27 Mar 2008 17:11:38 +0000 (17:11 +0000)]
MFC
aac.c r1.129 aac_ioctl.h r1.12:
Add ioctls FSACTL_SEND_LARGE_FIB, FSACTL_SEND_RAW_SRB,
FSACTL_LNX_SEND_LARGE_FIB, and FSACTL_LNX_SEND_RAW_SRB, and correct size
checks on FIBs passed in from userspace. Both changes were obtained from
Adaptec's driver build 15317. Adaptec's commandline RAID tool arcconf uses
these ioctls when creating a RAID-10 array (and probably other operations
too).
aac.c r1.130:
Restore creation of passthrough devices with newer controller firmware by
putting the correct size in the fib header. Presumably the older firmware
silently ignored a bad size field.
(This change tested with a 3805 controller. Passthrough devices were
created when running firmware build 12814, but not 15323 or later. With
this change they're created for both old and new firmware versions.)
kib [Thu, 27 Mar 2008 13:46:27 +0000 (13:46 +0000)]
MFC
rev. 1.682 of sys/amd64/amd64/machdep.c
rev. 1.16 of sys/amd64/ia32/ia32_signal.c
rev. 1.33 of sys/amd64/linux32/linux32_sysvec.c
rev. 1.666 of sys/i386/i386/machdep.c
rev. 1.152 of sys/i386/linux/linux_sysvec.c
rev. 1.39 of sys/i386/svr4/svr4_machdep.c
rev. 1.402 of sys/pc98/pc98/machdep.c
Modify the signal handler frame setup code to clear the DF {e,r}flags
bit on the amd64/i386 for the signal handlers.
rwatson [Mon, 24 Mar 2008 21:24:10 +0000 (21:24 +0000)]
Merge files:1.1258, db_capture.c:1.1, db_command.c:1.74, db_input.c:1.37,
db_main.c:1.6, db_output.c:1.38, ddb.h:1.44 from HEAD to RELENG_7:
Add a new DDB(4) facility, output capture. Input and output from DDB
may be captured to a memory buffer for later inspection using sysctl(8),
or in the future, to a textdump.
A new DDB command, "capture", is added, which accepts arguments "on",
"off", "reset", and "status".
A new DDB sysctl tree, debug.ddb.capture, is added, which can be used to
resize the capture buffer and extract buffer contents.
jkim [Mon, 24 Mar 2008 17:49:34 +0000 (17:49 +0000)]
MFC: 1.24-1.26
- Check device masks and bypass printing headers if capable device does
not exist. /etc/rc.d/mixer tried to restore non-existent recording
source because /var/var/db/mixer*-state contains '=rec' for example.
- Remove hardcoded mixer2 and mixer3 and do the right thing.
- Replace getopt(3) with hand-rolled option parser. It was not able
to handle 'mixer -rec mic' although it is a valid command.
- Make '-s' and '-S' mutualy exclusive as mixer(8) says.
- Do not re-read recording source unless it has been modified.
- Clean up code and fix style(9) nits.
jkim [Mon, 24 Mar 2008 17:16:25 +0000 (17:16 +0000)]
MFC: 1.80-1.83
Prefer clock_gettime(2) over gettimeofday(2) and use CLOCK_MONOTONIC_FAST.
It is only used to track elapsed time and it does not have to be precise.
Fix compiler warnings and style(9) bugs.
antoine [Mon, 24 Mar 2008 14:28:33 +0000 (14:28 +0000)]
MFC to RELENG_7:
Make sysctl_kern_arnd return a random buffer instead of a random long,
as it is expected by userland (stack protector guard setup for example).
remko [Mon, 24 Mar 2008 10:46:00 +0000 (10:46 +0000)]
MFC rev 1.73 newfs.8
Replace reference from vinum.8 to gvinum.8, it was advised in the PR to
replace this with vinum.4, but that's the kernel interface manual, which
is not appropriate in my understanding. I think that gvinum is a suitable
replacement for this.
PR: docs/121938
Submitted by: "Federico" <federicogalvezdurand at yahoo dot com>
MFC after: 3 days
remko [Mon, 24 Mar 2008 10:39:34 +0000 (10:39 +0000)]
MFC rev 1.9 tinybsd
Alert properly when we have stale mounts left after interupting
a tinybsd build. If we do not do this, we can accidentally remove
critical files from directories like /lib (if mounted).
PR: misc/121763
Submitted by: Richard Arends < richard at unixguru dot nl >
MFC after: 3 days
bz [Fri, 21 Mar 2008 23:15:01 +0000 (23:15 +0000)]
MFC: rev. 1.30 key.c
Remove the "Fast " from the
"Fast IPsec: Initialized Security Association Processing." printf.
People kept asking questions about this after the IPsec shuffle.
This still is the Fast IPsec implementation so no worries that it would
be any slower now. There are no functional changes.
bz [Fri, 21 Mar 2008 23:03:32 +0000 (23:03 +0000)]
MFC: rev. 1.8 ip6_ipsec.c, 1.4 ip6_ipsec.h
#if 0 out a currently unsued (and incomplete) function: ip6_ipsec_mtu().
No need to compile 'dead' code.
I am leaving it in because we will have to review the concept and
should use the common function in various places.
mtm [Thu, 20 Mar 2008 10:53:18 +0000 (10:53 +0000)]
MFC:
The check for errors from the mount command did not work as
intended because another command (echo) is executed between
the mount command and the check.