Commit Graph

88635 Commits

Author SHA1 Message Date
mdodd
261178d14f - Express hard dependencies on bus (pci, isa, pccard) and
network layer (ether).
- Don't abuse module names to facilitate ifconfig module loading;
  such abuse isn't really needed.  (And if we do need type information
  associated with a module then we should make it explicit and not
  use hacks.)
2003-04-15 06:37:30 +00:00
ru
e7e7ff6c1c Makefile.inc1 rev. 1.341 broke release.5 -- the fuss with MAKEFLAGS
here interferenced with one in Makefile.inc1.  Since we can't avoid
the jugglery in Makefile.inc1 (we want -m /usr/src/tools/build/mk
to come first, before any other -m specified on the command line),
avoid it here.

Reported by:	imp
2003-04-15 06:36:38 +00:00
mdodd
f6ae17d57c Don't abuse module names to facilitate ifconfig module loading;
such abuse isn't really needed.  (And if we do need type information
associated with a module then we should make it explicit and not
use hacks.)
2003-04-15 06:25:58 +00:00
mdodd
ba18538620 Decode a few more syscalls. 2003-04-15 06:12:12 +00:00
njl
9dfe2aa5f6 Fix a warning about deprecated string literals.
Reviewed by:	diff
2003-04-15 05:15:50 +00:00
mdodd
24af6661b4 Add a module version number. 2003-04-15 04:19:49 +00:00
mdodd
420e645e8a Express bus dependency a little more clearly. 2003-04-15 04:08:01 +00:00
silby
83c096f9a1 Rework the rl_encap failure case. Previously, we would stuff the
unencapsulated packet back into the IFQ.  Unfortunately, the only reason
rl_encap would fail was due to m_defrag failing, which should only happen
when we're low on mbufs.  Hence, it was possible for us to end up with
an IFQ full of packets which could never clear the queue because they could
never be defragmented because they were themselves taking up all the mbufs.

To solve this, take if_xl's approach to the problem of encapsulation failure:
drop the packet.

MFC after:	3 days
2003-04-15 04:06:01 +00:00
mux
c2d5e1feb9 style(9) 2003-04-15 03:11:03 +00:00
silby
169aedfd7f Add a description of m_defragrandomfailures. 2003-04-15 02:26:13 +00:00
silby
0c01d3cc3f Add another MBUF_STRESS_TEST feature, m_defragrandomfailures.
When enabled, this causes m_defrag to randomly return NULL (following
its normal failure case so that extra memory leaks are not introduced.)

Code similar to this was used to find / fix a few bugs last week.
2003-04-15 02:14:43 +00:00
alc
1a58aa9678 Update locking on the kmem_object to use the new macros. 2003-04-15 01:16:05 +00:00
rwatson
301ae63096 Add MAC_ALWAYS_LABEL_MBUF to options; this permits the administrator
to force the allocation of MAC labels for all mbufs regardless of
whether a configured policy requires labeling when the mbuf is
allocated.  This can be useful it you anticipate loading a fully
labeled policy after boot and don't want mbufs to exist without
label storage, for performance measurement purposes, etc.  It also
slightly lowers the overhead of m_tag labeling due to removing the
decision logic.

While here, improve commenting of other MAC options.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-14 21:45:12 +00:00
rwatson
53a050aac3 Move MAC label storage for mbufs into m_tags from the m_pkthdr structure,
returning some additional room in the first mbuf in a chain, and
avoiding feature-specific contents in the mbuf header.  To do this:

- Modify mbuf_to_label() to extract the tag, returning NULL if not
  found.

- Introduce mac_init_mbuf_tag() which does most of the work
  mac_init_mbuf() used to do, except on an m_tag rather than an
  mbuf.

- Scale back mac_init_mbuf() to perform m_tag allocation and invoke
  mac_init_mbuf_tag().

- Replace mac_destroy_mbuf() with mac_destroy_mbuf_tag(), since
  m_tag's are now GC'd deep in the m_tag/mbuf code rather than
  at a higher level when mbufs are directly free()'d.

- Add mac_copy_mbuf_tag() to support m_copy_pkthdr() and related
  notions.

- Generally change all references to mbuf labels so that they use
  mbuf_to_label() rather than &mbuf->m_pkthdr.label.  This
  required no changes in the MAC policies (yay!).

- Tweak mbuf release routines to not call mac_destroy_mbuf(),
  tag destruction takes care of it for us now.

- Remove MAC magic from m_copy_pkthdr() and m_move_pkthdr() --
  the existing m_tag support does all this for us.  Note that
  we can no longer just zero the m_tag list on the target mbuf,
  rather, we have to delete the chain because m_tag's will
  already be hung off freshly allocated mbuf's.

- Tweak m_tag copying routines so that if we're copying a MAC
  m_tag, we don't do a binary copy, rather, we initialize the
  new storage and do a deep copy of the label.

- Remove use of MAC_FLAG_INITIALIZED in a few bizarre places
  having to do with mbuf header copies previously.

- When an mbuf is copied in ip_input(), we no longer need to
  explicitly copy the label because it will get handled by the
  m_tag code now.

- No longer any weird handling of MAC labels in if_loop.c during
  header copies.

- Add MPC_LOADTIME_FLAG_LABELMBUFS flag to Biba, MLS, mac_test.
  In mac_test, handle the label==NULL case, since it can be
  dynamically loaded.

In order to improve performance with this change, introduce the notion
of "lazy MAC label allocation" -- only allocate m_tag storage for MAC
labels if we're running with a policy that uses MAC labels on mbufs.
Policies declare this intent by setting the MPC_LOADTIME_FLAG_LABELMBUFS
flag in their load-time flags field during declaration.  Note: this
opens up the possibility of post-boot policy modules getting back NULL
slot entries even though they have policy invariants of non-NULL slot
entries, as the policy might have been loaded after the mbuf was
allocated, leaving the mbuf without label storage.  Policies that cannot
handle this case must be declared as NOTLATE, or must be modified.

- mac_labelmbufs holds the current cumulative status as to whether
  any policies require mbuf labeling or not.  This is updated whenever
  the active policy set changes by the function mac_policy_updateflags().
  The function iterates the list and checks whether any have the
  flag set.  Write access to this variable is protected by the policy
  list; read access is currently not protected for performance reasons.
  This might change if it causes problems.

- Add MAC_POLICY_LIST_ASSERT_EXCLUSIVE() to permit the flags update
  function to assert appropriate locks.

- This makes allocation in mac_init_mbuf() conditional on the flag.

Reviewed by:	sam
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-14 20:39:06 +00:00
charnier
26efa7aed0 Correct style bugs. Don't skip zombies in cputime(), according to Bruce,
zombie CPU times are valid. Adjust array size in strftime(3).

Submitted by:	Bruce
2003-04-14 19:51:36 +00:00
rwatson
0cf8c3b34b Abstract access to the mbuf header label behind a new function,
mbuf_to_label().  This permits the vast majority of entry point code
to be unaware that labels are stored in m->m_pkthdr.label, such that
we can experiment storage of labels elsewhere (such as in m_tags).

Reviewed by:	sam
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-14 18:11:18 +00:00
obrien
038d1a303c Add CPUTYPE support for "athlon-tbird", as GCC makes the distinction.
PR:		50801
Submitted by:	Glenn Johnson <glennpj@charter.net>
2003-04-14 17:36:29 +00:00
rwatson
c48acd8ffd Use MBTOM() to convert mbuf allocator flags to malloc() flags, rather
than using the same compare/substitute in many places.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-14 16:04:10 +00:00
sobomax
ac94030547 Use pci_enable_{busmaster|io}() instead of directly writing into
PCI configuration register.

Submitted by:	mdodd
2003-04-14 15:50:04 +00:00
ru
3ff8bde4fa kbdcontrol.c rev. 1.35 and onwards support the KEYMAP_PATH
environment variable, and don't need to be bootstrapped.
2003-04-14 14:46:13 +00:00
cognet
64f4176c9e Use while (*controlp != NULL) instead of do ... while (*control != NULL)
There are valid cases where *controlp will be NULL at this point.

Discussed with:	dwmalone
2003-04-14 14:44:36 +00:00
ticso
57c77ee3ed Use a sim for each device on it's own instead of one for all umass
devices.
This reduces complexity and fixes a number of small problems.

Approved by:	gallatin (mentor)
Reviewed by:	njl
2003-04-14 14:28:17 +00:00
simokawa
1cfbbefd6c Panic if bus_dmamap_load() doesn't respect maxsegsz. 2003-04-14 14:17:49 +00:00
ticso
74d6d25d1a add EHCI (USB 2.0) controller support.
Approved by:	joe
		gallatin (mentor)
Obtained from:  NetBSD
2003-04-14 14:04:08 +00:00
simokawa
bdfca1b9c1 Restore delayed load support for the resource shortage case.
It was missed in the previous change.
Now, _bus_dmamap_load_buffer() accepts BUS_DMA_WAITOK/BUS_DMA_NOWAIT flags.

Original idea from: jake
2003-04-14 13:21:40 +00:00
tjr
bb06bbb4a0 Merge in vfprintf.c rev. 1.58. 2003-04-14 12:15:59 +00:00
das
2fd827a8bc Add a test case for printf("%5.0f", 0.001). 2003-04-14 11:26:32 +00:00
das
c01851b648 Fix a bug where printf was erroneously printing a decimal point for
%f and sufficiently short %g specifiers where the precision was
explicitly zero, no '#' flag was specified, and the floating point
argument was > 0 and <= 0.5.  While at it, add some comments to better
explain the relevant bits of code.

Noticed by:	Christoph Kukulies <kuku@physik.rwth-aachen.de>
2003-04-14 11:24:53 +00:00
sobomax
6efce81948 Before attaching device set PCIM_CMD_PORTEN in addition to
PCIM_CMD_MEMEN and PCIM_CMD_BUSMASTEREN, becaise some braindead
BIOSes (such as one found in my vprmatrix notebook) forget
to initialize it properly resulting in attachment failure.
2003-04-14 09:45:25 +00:00
phk
3f6cd8397d Avoid off_t -> integer overflow when sorting the locksector addresses. 2003-04-14 09:36:39 +00:00
phk
c10cd4d964 More correct patch: Only call biofinish if we have not already sent
any children down the mesh.
2003-04-14 08:49:54 +00:00
maxim
da1c42b4c0 o Skip timestamp part when checking payload.
PR:		bin/50909
Submitted by:	Barney Wolff <barney@lab.databus.com>
2003-04-14 08:34:14 +00:00
phk
e27444e997 Call biofinish() also when we get a malloc() failure. 2003-04-14 08:08:17 +00:00
tjr
1287890a35 Uncomment the description of the -f option. Add rfork() to the list of
system calls it displays stats about.

PR:		50924
2003-04-14 07:22:25 +00:00
tjr
ddd5b3a66d Reimplement the vmstat -f option (display fork statistics).
PR:		50924
Submitted by:	Ken Stailey (with a few changes)
2003-04-14 07:21:03 +00:00
simokawa
a350d6ddb9 * Use _bus_dmamap_load_buffer() and respect maxsegsz in bus_dmamap_load().
Ignoring maxsegsz may lead to fatal data corruption for some devices.
ex. SBP-2/FireWire
We should apply this change to other platforms except for sparc64.

MFC after: 1 week
2003-04-14 04:19:42 +00:00
alc
a05b4b3347 Update locking on the kernel_object to use the new macros. 2003-04-14 00:36:53 +00:00
alc
e241ee6007 Lock some manipulations of the vm object's flags. 2003-04-13 23:43:34 +00:00
silby
48600489e7 Update the list of devices supported to match the driver.
MFC after:	2 days
2003-04-13 23:31:47 +00:00
silby
41c5b55e03 Add info on how to use the MBUF_STRESS_TEST options. (Only 1 option
at present.)
2003-04-13 23:31:06 +00:00
phk
a9021891fc Use symbolic constants from <sys/diskmbr.h> instead of local constants.
Always set the magic sequence when we write, rather than trusting the
previously read boot code to do so.

Use explicit encoding/decoding of little endian disk image.

Remove a comment which was OBE.

Change the test vector for "fdisk -I" to reflect that there is a magic
sequence in the result now.

Add test case for "fdisk" which reads the image back.

At least for the two test-cases this program now gives the same result
on sparc64 as on i386.  The lack of an installed /boot/mbr on sparc64
raises an (un)interesting question.
2003-04-13 21:57:08 +00:00
jake
08ad0d0b12 - Move the routine for flushing all user mappings from the tlb from pmap to
the cpu dependent files.  It will need to be done differently for USIII.
- Simplify the logic for detecting context rollovers.  Instead of dealing
  with it when the next context switch would cause the context numbers to
  rollover, deal with it when they actually do rollover.
- Move some things around in cpu_switch so that we only do 1 membar #Sync
  when switching address space, instead of 2.
- Detect kernel threads by comparing the new vm space to vmspace0, instead
  if checking if the tlb context is 0.
- Removed some debug code.
2003-04-13 21:54:58 +00:00
phk
718ebc1291 Add definitions for location of the magic sequence and the length
of a partition entry.
2003-04-13 21:52:22 +00:00
phk
2ceb0a613a Pull in the encoding/decoding functions for struct dos_partition.
Add a very simple regression test for "fdisk -I".
2003-04-13 21:34:16 +00:00
jake
0827d0138a Made vmspace0 non-static. Its useful to be able to identify a vmspace as
the kernel vmspace.
2003-04-13 21:29:11 +00:00
alc
a921c15d0e Lock some manipulations of the vm object's flags. 2003-04-13 20:22:02 +00:00
alc
eac23cf75a Lock some manipulations of the vm object's flags. 2003-04-13 19:36:18 +00:00
bmah
56a4ceacb3 Add sbsh(4) entry. 2003-04-13 19:15:30 +00:00
bmah
0fabc2f778 New release notes: sbsh(4), mixer(8) relative adjustments,
mount_nfs(8) noinet4/noinet6, usbhidaction(1), xargs(1) -o.
2003-04-13 19:15:08 +00:00
alc
0dbe173de2 Add new macros for locking and unlocking a vm object. 2003-04-13 18:39:47 +00:00