Commit Graph

56235 Commits

Author SHA1 Message Date
Gleb Smirnoff
1928437497 Fix several races between socket closure and node/hook
destruction:
  - Backout 1.62, since it doesn't fix all possible
    problems.
  - Upon node creation, put an additional reference on node.
  - Add a mutex and refcounter to struct ngsock. Netgraph node,
    control socket and data socket all count as references.
  - Introduce ng_socket_free_priv() which removes one reference
    from ngsock, and frees it when all references has gone.
  - No direct pointers between pcbs and node, all pointing
    is done via struct ngsock and protected with mutex.
2005-11-02 15:34:42 +00:00
Gleb Smirnoff
ac5dd14182 Fix two races which happen when netgraph is restructuring:
- Introduce ng_topo_mtx, a mutex to protect topology changes.
  - In ng_destroy_node() protect with ng_topo_mtx the process
    of checking and pointing at ng_deadnode. [1]
  - In ng_con_part2() check that our peer is not a ng_deadnode,
    and protect the check with ng_topo_mtx.
  - Add KASSERTs to ng_acquire_read/write, to make more
    understandible synopsis in case if called on ng_deadnode.

Reported by:	Roselyn Lee [1]
2005-11-02 15:23:47 +00:00
Gleb Smirnoff
4be5933577 Rework the ng_item queueing on nodes:
- Introduce a new flags NGQF_QREADER and NGQF_QWRITER,
    which tell how the item should be actually applied,
    overriding NGQF_READER/NGQF_WRITER flags.
  - Do not differ between pending reader or writer. Use only
    one flag that is raised, when there are pending items.
  - Schedule netgraph ISR in ng_queue_rw(), so that callers
    do not need to do this job.
  - Fix several comments.

Submitted by:	julian
2005-11-02 14:27:24 +00:00
Andre Oppermann
34333b16cd Retire MT_HEADER mbuf type and change its users to use MT_DATA.
Having an additional MT_HEADER mbuf type is superfluous and redundant
as nothing depends on it.  It only adds a layer of confusion.  The
distinction between header mbuf's and data mbuf's is solely done
through the m->m_flags M_PKTHDR flag.

Non-native code is not changed in this commit.  For compatibility
MT_HEADER is mapped to MT_DATA.

Sponsored by:	TCP/IP Optimization Fundraise 2005
2005-11-02 13:46:32 +00:00
Alan Cox
83ed5ec059 Instead of a panic()ing in pmap_insert_entry() if get_pv_entry() fails,
reclaim a pv entry by destroying a mapping to an inactive page.
2005-11-02 08:23:28 +00:00
Paul Saab
dd498befc4 Rate limit vnode_pager_putpages printfs to once a second. 2005-11-01 23:00:24 +00:00
John Baldwin
d394d454b0 Throw the switch and turn on STOP_NMI on in GENERIC for amd64 and i386.
Requested by:	kris
Ok'd by:	scottl
2005-11-01 22:59:03 +00:00
Jung-uk Kim
e8d472a7af Catch up with ACPI-CA 20051021 import 2005-11-01 22:44:08 +00:00
Jung-uk Kim
6eb081af76 Update to reflect import of ACPI-CA 20051021 with includes fixups 2005-11-01 22:38:50 +00:00
Jung-uk Kim
5475ddb73a Local change: remove unnecessary __cdecl 2005-11-01 22:33:32 +00:00
Jung-uk Kim
0dd793f645 Local change: remove compilation warnings 2005-11-01 22:30:52 +00:00
Jung-uk Kim
b56f6e1fd7 Fix conflicts from import of Intel ACPI-CA 20051021 2005-11-01 22:28:49 +00:00
Jung-uk Kim
775a51a92f Unchanged files that are off the vendor branch 2005-11-01 22:23:25 +00:00
Jung-uk Kim
43ea53ef1f This commit was generated by cvs2svn to compensate for changes in r151940,
which included commits to RCS files with non-trunk default branches.
2005-11-01 22:18:47 +00:00
Jung-uk Kim
5e41bc61d8 Fix few compilation problems on vendor branch.
These fixes will be submitted vendor.
2005-11-01 22:18:47 +00:00
Jung-uk Kim
ff4eaaff6b This commit was generated by cvs2svn to compensate for changes in r151937,
which included commits to RCS files with non-trunk default branches.
2005-11-01 22:11:18 +00:00
Jung-uk Kim
fba7fc7e34 Vendor import of Intel ACPI-CA 20051021 2005-11-01 22:11:18 +00:00
Scott Long
6a4810bd6d Move HPET debugging under ACPI_TIMER in order to save a bitfield. 2005-11-01 20:41:43 +00:00
John Baldwin
68a17869c1 Push down Giant into fdfree() and remove it from two of the callers.
Other callers such as some rfork() cases weren't locking Giant anyway.

Reviewed by:	csjp
MFC after:	1 week
2005-11-01 17:13:05 +00:00
Scott Long
5be4c55fea Add proper debugging infrastructure for acpi_hpet.c. 2005-11-01 15:57:15 +00:00
Robert Watson
2bdeb3f9f2 Reuse ktr_unused field in ktr_header structure as ktr_tid; populate
ktr_tid as part of gathering of ktr header data for new ktrace
records.  The continued use of intptr_t is required for file layout
reasons, and cannot be changed to lwpid_t at this point.

MFC after:	1 month
Reviewed by:	davidxu
2005-11-01 14:46:37 +00:00
Robert Watson
d977a58307 Replace ktr_buffer pointer in struct ktr_header with a ktr_unused
intptr_t.  The buffer length needs to be written to disk as part
of the trace log, but the kernel pointer for the buffer does not.
Add a new ktr_buffer pointer to the kernel-only ktrace request
structure to hold that pointer.  This frees up an integer in the
ktrace record format that can be used to hold the threadid,
although older ktrace files will have a garbage ktr_buffer field
(or more accurately, a kernel pointer value).

MFC after:		2 weeks
Space requested by:	davidxu
2005-11-01 12:36:19 +00:00
Bill Paul
fde84c1850 Clean up one remaining 'multiple DPC thread' bogon: only bzero() one
sizeof(kq_queue), not sizeof(kq_queue) * mp_ncpus.
2005-11-01 09:24:35 +00:00
Alan Cox
674b706ea0 Consider the zero-copy transmission of a page that was wired by mlock(2).
If a copy-on-write fault occurs on the page, the new copy should inherit
a part of the original page's wire count.

Submitted by: tegge
MFC after: 1 week
2005-11-01 04:30:21 +00:00
David Xu
7bde374872 Update SIGTHR's comment. 2005-11-01 03:14:39 +00:00
SUZUKI Shinsuke
797df30d75 statically configured IPv6 address is properly added/deleted now
Obtained from: KAME
Reported in: freebsd-net@freebsd
MFC after: 1 day
2005-10-31 23:06:04 +00:00
Poul-Henning Kamp
f6868f848c Tie acpi_hpet.c into the module and kernel. 2005-10-31 21:40:40 +00:00
Poul-Henning Kamp
4fa7241fd4 Add a basic HPET timecounter.
It has -200 quality for now so it will not get automatically selected.
2005-10-31 21:39:50 +00:00
John Baldwin
13df733045 - Use callout_*() to manage the callout and make it MPSAFE.
- Fix locking in detach(), we only need to lock across vr_stop().

Tested by:	Mike Tancsa mike at sentex dot net
MFC after:	1 week
2005-10-31 21:37:27 +00:00
Alan Cox
f7118bdf3b Instead of a panic()ing in pmap_insert_entry() if get_pv_entry()
fails, reclaim a pv entry by destroying a mapping to an inactive
page.

Change the format strings in many of the assertions that were recently
converted from PMAP_DIAGNOSTIC printf()s so that they are compatible
with PAE.  Avoid unnecessary differences between the amd64 and i386
format strings.
2005-10-31 21:25:33 +00:00
Paul Saab
ecc44de7a2 Reformat socket control messages on input/output for 32bit compatibility
on 64bit systems.

Submitted by:	ps, ups
Reviewed by:	jhb
2005-10-31 21:09:56 +00:00
John Baldwin
296c4b1ad5 Hook nve(4) up in i386 and amd64 NOTES.
MFC after:	1 week
2005-10-31 20:45:37 +00:00
Paul Saab
e1cef62715 Rate limit filesystem full and out of inodes messages to once a
second.
2005-10-31 20:33:28 +00:00
Robert Watson
66767c79cf Put probe-time printf of adapter speed and duplex behind bootverbose:
since the link takes a bit to negotiate, the information is pretty
much never available during the probe.  As such, the boot output
pretty much always prints N/A for speed and duplex.  Since we print
out the output of ifconfig during the user space boot, this early
boot information is also generally redundant, and added to the noise.

MFC after:	2 weeks
2005-10-31 19:59:40 +00:00
John Baldwin
f6494f2e13 Check to see if the hash table is present in link_elf_lookup_symbol()
before dereferencing it.  Certain corrupt kernel modules might not have
a valid hash table, and would cause a kernel panic when they were loaded.
Instead of panic'ing, the kernel now prints out a warning that it is
missing the symbol hash table.

Tested by:	Benjamin Close Benjamin dot Close at clearchain dot com
MFC after:	1 week
2005-10-31 19:17:32 +00:00
John Baldwin
aa14e8f4b4 Add the device ID for the VIA VT8235 south bridge.
PR:		kern/62438
Submitted by:	FUJIMOTO Kou fujimoto at j dot dendai dot ac dot jp
Tested by:	Oliver Fromme olli at secnetix dot de
MFC after:	1 week
2005-10-31 18:43:28 +00:00
John Baldwin
6647585e2d Some of the VIA pm and propm devices are actually the same device as the
PCI-ISA bridge.  Thus, when viapm0 or viapropm0 attaches, isab0 dosen't
attach so there is no isa0 bus hung off of that bridge.  In the non-ACPI
case, legacy0 will add an isa0 anyway as a fail-safe, but ACPI assumes that
any ISA bus will be enumerated via a bridge.  To fix this, call
isab_attach() to attach an isa0 ISA child bus device if the pm or propm
device we are probing is a PCI-ISA bridge.  Both drivers now have to
implement the bus_if interface via the generic methods for resource
allocation, etc. to work.  Also, we now add 2 new ISA bus drivers that
attach to viapm and viapropm devices.

PR:		kern/87363
Reported by:	Oliver Fromme olli at secnetix dot de
Tested by:	glebius
MFC after:	1 week
2005-10-31 18:31:16 +00:00
Alan Cox
563d9e6341 MFamd64/i386
Eliminate unneeded diagnostic code.
2005-10-31 16:14:07 +00:00
Robert Watson
5bb84bc84b Normalize a significant number of kernel malloc type names:
- Prefer '_' to ' ', as it results in more easily parsed results in
  memory monitoring tools such as vmstat.

- Remove punctuation that is incompatible with using memory type names
  as file names, such as '/' characters.

- Disambiguate some collisions by adding subsystem prefixes to some
  memory types.

- Generally prefer lower case to upper case.

- If the same type is defined in multiple architecture directories,
  attempt to use the same name in additional cases.

Not all instances were caught in this change, so more work is required to
finish this conversion.  Similar changes are required for UMA zone names.
2005-10-31 15:41:29 +00:00
Peter Grehan
a3624af7d8 The mediasize shouldn't be multipled by the sector size when it was
in bytes to start off with. This caused the GPT geom sniffer to attempt
a seek just back from the end of the 'disk', which resulted in a > 4G
seek, causing gdb psim to exit since it only supports 32-bit seeks.

The size of the disk should really be specified in the psim device tree,
but for now do the minimal amount of work to get psim to run again.
2005-10-31 03:09:38 +00:00
Christian S.J. Peron
1ffe41c1ec Pickup I/O lock in aac_get_bus_info, as this code will call
aac_alloc_sync_fib(). aac_alloc_sync_fib() will assert that the I/O locks
are held. This fixes a panic on system boot up  when the aac(4) device's
bus_generic_attach() routine is called.

Reviewed by:	scottl
2005-10-31 00:12:19 +00:00
Peter Grehan
04975fbba5 Copy SPRG0-3 registers at boot-time and restore when calling into
OpenFirmware. FreeBSD/ppc uses SPRG0 as the per-cpu data area pointer,
and SPRG1-3 as temporary registers during exception handling. There
have been a few instances where OpenFirmware does require these to
be part of it's context, such as cd-booting an eMac.

reported by:	many
MFC after:	3 days
2005-10-30 21:29:59 +00:00
Alan Cox
6fb8d0e3a7 Replace diagnostic printf()s by assertions. Use consistent style for
similar assertions.
2005-10-30 20:47:42 +00:00
Robert Watson
d374e81efd Push the assignment of a new or updated so_qlimit from solisten()
following the protocol pru_listen() call to solisten_proto(), so
that it occurs under the socket lock acquisition that also sets
SO_ACCEPTCONN.  This requires passing the new backlog parameter
to the protocol, which also allows the protocol to be aware of
changes in queue limit should it wish to do something about the
new queue limit.  This continues a move towards the socket layer
acting as a library for the protocol.

Bump __FreeBSD_version due to a change in the in-kernel protocol
interface.  This change has been tested with IPv4 and UNIX domain
sockets, but not other protocols.
2005-10-30 19:44:40 +00:00
Marcel Moolenaar
6739824a02 Remove a stray return statement in the interrupt dispatch function
that caused a premature exit after calling a fast interrupt handler
and bypassing a much needed critical_exit() and the scheduling of
the interrupt thread for non-fast handlers. In short: unbreak :-)
2005-10-30 17:23:01 +00:00
Yoshihiro Takahashi
94ac50dbcb MFi386: Enable beastie.4th. 2005-10-30 15:59:08 +00:00
Dag-Erling Smørgrav
85cc3851ff Add some safeguards to AIOSFMT:
- Return EINVAL if play_format or rec_format is set but the corresponding
   sample rate is 0.

 - Don't try to set the playback or recording format to 0.  Previously,
   issuing an AIOSFMT ioctl with an all-zeroes snd_chan_param would
   trigger a KASSERT in chn_fmtchain(); I'm unsure about the effects on
   a kernel without INVARIANTS.  After this commit, issuing AIOSFMT with
   an all-zeroes snd_chan_param is equivalent to issuing AIOGFMT.

MFC after:	2 weeks
2005-10-30 10:03:11 +00:00
Peter Grehan
c0498352c1 In stack_save, stop when a trap-frame is encountered. This prevents
trying to access user-space stack addresses when a user fault
is encountered, as occurs when GEOM KTR code is handling a page fault
and is using stack_save() to capture a trace for debug purposes.

It may be possible to walk beyond the trap-frame if it is a kernel fault,
as db_backtrace() does, but I don't think that complexity is needed in
this routine.

MFC after:	3 days
2005-10-30 07:56:10 +00:00
Scott Long
fe8388fec2 Add back some bits. 2005-10-30 05:41:42 +00:00
Scott Long
aa845d2dc1 Replace loader_color with loader_logo 2005-10-30 05:36:23 +00:00