Commit Graph

66102 Commits

Author SHA1 Message Date
Warner Losh
d75dc1b522 sun4v has a MACHINE_ARCH of sparc64, so it was covered under that clause and
shouldn't have been added.  Remove it.
2008-02-02 16:40:40 +00:00
Bjoern A. Zeeb
c26fe973a3 Rather than passing around a cached 'priv', pass in an ucred to
ipsec*_set_policy and do the privilege check only if needed.

Try to assimilate both ip*_ctloutput code blocks calling ipsec*_set_policy.

Reviewed by:	rwatson
2008-02-02 14:11:31 +00:00
Dmitry Morozovsky
f9773372c3 Fix one more grammo.
Noticed by:	ru
2008-02-02 08:41:53 +00:00
Warner Losh
783dc828f0 Some platforms that are currently under development have to cope with
a variety of bootloaders.  This sometimes means that different loader
scripts are required within one ${MACHINE_ARCH}, which makes the
current practice of using ldscript.${MACHINE_ARCH} unsuitable.
Instead, make the default the current convention and allow the ld
scripts to be overridden as necessary.
2008-02-02 07:52:24 +00:00
Warner Losh
3a00c266dc Wall of shame rather than wall of fame for the -Werror suppression.
If we aren't arm, pc98 or sun4v, then enable treating warnings like
errors.  That doesn't mean these platforms aren't -Werror clean, just
that we haven't enforced it before.  Someone with some spare time
should investigate these three platforms to see if any can be removed.
2008-02-02 07:43:38 +00:00
Sam Leffler
2d165aedd9 add opaque pointer to tx ampdu state for drivers
MFC after:	3 days
2008-02-02 00:38:02 +00:00
Sam Leffler
ddc5368476 o correct typo that broke check when handling addba response
o add a comment about the ht rates being for 20MHz channels w/ long GI;
  needs a separate fix after more thought

MFC after:	3 days
2008-02-01 21:31:10 +00:00
John Baldwin
138e8d08b0 Relax the check for a PCI-express chipset by assuming the system is a
PCI-express chipset (and thus has functional MSI) if there are any
PCI-express devices in the system, not requiring a root port device.

With PCI-X the chipset detection has to be very conservative because there
are known systems with PCI-X devices that do not appear to have PCI-X
chipsets.  However, with PCI-express I'm not sure it is possible to have
a PCI-express device in a system with a non-PCI-express chipset.  If we
assume that is the case then this change is valid.  It is also required
for at least some PCI-express systems that don't have any devices with
a root port capability (some ICH9 systems).

MFC after:	1 week
Reported by:	jfv
2008-02-01 20:31:09 +00:00
Poul-Henning Kamp
cf827063a9 Give MEXTADD() another argument to make both void pointers to the
free function controlable, instead of passing the KVA of the buffer
storage as the first argument.

Fix all conventional users of the API to pass the KVA of the buffer
as the first argument, to make this a no-op commit.

Likely break the only non-convetional user of the API, after informing
the relevant committer.

Update the mbuf(9) manual page, which was already out of sync on
this point.

Bump __FreeBSD_version to 800016 as there is no way to tell how
many arguments a CPP macro needs any other way.

This paves the way for giving sendfile(9) a way to wait for the
passed storage to have been accessed before returning.

This does not affect the memory layout or size of mbufs.

Parental oversight by:	sam and rwatson.

No MFC is anticipated.
2008-02-01 19:36:27 +00:00
Dmitry Morozovsky
942fe01f61 Reword recent comment a bit. 2008-02-01 17:35:46 +00:00
Robert Watson
e603be7ada Use FEATURE() macro to advertise aio availability. 2008-02-01 11:59:14 +00:00
Alexander Motin
d4529f987a Add comments about stack protection mechanism. 2008-02-01 11:01:15 +00:00
Alexander Motin
b1a3358ba3 Tune the message for better informativity.
Print the hook pointer as other functions do.
2008-02-01 07:25:06 +00:00
Benno Rice
db2dabf87c Band-aid recent commit by mav by replacing a variable in a CTR statement with
the variable that appears as if it should've been there.

Pointy hat to:		mav
Not tested either by:	benno
2008-02-01 07:17:26 +00:00
Alexander Motin
b2b5279b25 Implement Session-ID hashing to improve receive performance scalability
for big number of concurrent sessions.
2008-01-31 22:42:37 +00:00
John Baldwin
7157eae462 For no good reason I had assumed that ACPI table headers would be page
aligned (or at least not cross a page boundary).  However, it turns out
that on at least one machine one table header does cross a page boundary.
This caused problems with the MADT early probe as it uses the crash dump
map to load ACPI tables by loading the RSDT/XSDT into pages 1 ... N and
loading the header of each ACPI table header into page 0 looking for the
MADT.  However, if a table header crossed a page boundary, then page 1
would get trashed resulting in a panic.  Fix this by reserving the first
2 pages for ACPI table headers (headers are less than a page in size,
so 2 pages will be sufficient) and use pages 2 .. N for the RSDT and XSDT.

Note: amd64 should probably be simplified to just use pmap_mapbios()
for all these tables which will use the direct map and not need the
crash dump hack.

MFC after:	5 days
Tested on:	i386
Reported by:	Pete French  petefrench of ticketswitch.com
2008-01-31 16:51:43 +00:00
Robert Watson
990132f07d 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.

MFC after:	2 months
2008-01-31 16:22:14 +00:00
Alexander Motin
e72a98f4bf Some code reformat. 2008-01-31 10:13:04 +00:00
Alexander Motin
81a253a4ed Implement stack protection based on GET_STACK_USAGE() macro.
This fixes system panics possible with complicated netgraph setups
and allows to avoid unneded extra queueing for stack unwrapping.
2008-01-31 08:51:48 +00:00
Alexander Motin
2a57ca33c7 Move GET_STACK_USAGE from MI header to i386/amd64 MD ones.
Somebody who can, please feel free to implement it for other archs
or copy this one if it suits.
2008-01-31 08:24:27 +00:00
Robert Watson
265de5bb62 Correct two problems relating to sorflush(), which is called to flush
read socket buffers in shutdown() and close():

- Call socantrcvmore() before sblock() to dislodge any threads that
  might be sleeping (potentially indefinitely) while holding sblock(),
  such as a thread blocked in recv().

- Flag the sblock() call as non-interruptible so that a signal
  delivered to the thread calling sorflush() doesn't cause sblock() to
  fail.  The sblock() is required to ensure that all other socket
  consumer threads have, in fact, left, and do not enter, the socket
  buffer until we're done flushin it.

To implement the latter, change the 'flags' argument to sblock() to
accept two flags, SBL_WAIT and SBL_NOINTR, rather than one M_WAITOK
flag.  When SBL_NOINTR is set, it forces a non-interruptible sx
acquisition, regardless of the setting of the disposition of SB_NOINTR
on the socket buffer; without this change it would be possible for
another thread to clear SB_NOINTR between when the socket buffer mutex
is released and sblock() is invoked.

Reviewed by:	bz, kmacy
Reported by:	Jos Backus <jos at catnook dot com>
2008-01-31 08:22:24 +00:00
Peter Grehan
104954fe06 Enable ofwdump on powerpc (finally). Tested on G3 & G4 machines.
Submitted by:	Dan Stekloff  <dsteklof at c i s c o dot com>
Discussed with:	marcel
2008-01-31 01:57:33 +00:00
Olivier Houchard
8f2948f1c1 Bring in the nice work from Mark Tinguely on arm pmap.
The only downside is that it renames pmap_vac_me_harder() to pmap_fix_cache().
From Mark's email on -arm :
pmap_get_vac_flags(), pmap_vac_me_harder(), pmap_vac_me_kpmap(), and
pmap_vac_me_user() has been rewritten as pmap_fix_cache() to be more
efficient in the kernel map case. I also removed the reference to
the md.kro_mappings, md.krw_mappings, md.uro_mappings, and md.urw_mappings
counts.

In pmap_clearbit(), we can also skip over tests and writeback/invalidations
in the PVF_MOD and PVF_REF cases if those bits are not set in the pv_flag.
PVF_WRITE will turn caching back on and remove the PV_MOD bit.

In pmap_nuke_pv(), the vm_page_flag_clear(pg, PG_WRITEABLE) has been moved
to the pmap_fix_cache().

We can be more agressive in attempting to turn caching back on by calling
pmap_fix_cache() at times that may be appropriate to turn cache on
(a kernel mapping has been removed, a write has been removed or a read
has been removed and we know the mapping does not have multiple write
mappings to a page).

In pmap_remove_pages() the cpu_idcache_wbinv_all() is moved to happen
before the page tables are NULLed because the caches are virtually
indexed and virtually tagged.

In pmap_remove_all(), the pmap_remove_write(m) is added before the
page tables are NULLed because the caches are virtually indexed and
virtually tagged. This also removes the need for the caches fixing routine
(whichever is being used pmap_vac_me_harder() or pmap_fix_cache()) to be
called on any of these mappings.

In pmap_remove(), I simplified the cache cleaning process and removed
extra TLB removals. Basically if more than PMAP_REMOVE_CLEAN_LIST_SIZE
are removed, then just flush the entire cache.
2008-01-31 00:05:40 +00:00
Alexander Motin
cb1f76532c Implement GET_STACK_USAGE() macro to get the current kernel thread stack usage.
This implemntation made for growing down stack organization like i386/amd64
platforms have, but prefers different machine dependent version if it is present.
2008-01-30 21:24:10 +00:00
Pyun YongHyeon
6ceb40baa9 Fix link state handling in bfe(4).
o conversion to callout(9) API.
 o add a missing driver lock in bfe_ifmedia_sts().
 o use our callout to drive watchdog timer.
 o restart Tx routine if pending queued packets are present in
   watchdog handler.
 o unarm watchdog timer only if there are no queued packets.
 o don't blindly reset phy and let phy driver handle link change
   request in bfe_init_locked().
 o return the status of mii_mediachg() to caller in
   bfe_ifmedia_upd(). Previously it always returned 0 to caller.
 o add check for IFF_DRV_RUNNING flag as well as IFF_DRV_OACTIVE
   in bfe_start_locked().
 o implement miibus_statchg method that keeps track of current
   link state changes as well as negotiated speed/duplex/
   flow-control configuration.
   Reprogram MAC to appropriate duplex state. Flow-control
   configuration was also implemented but commented out at the
   moment. The flow-control configuration will be enabled again
   after we have general flow-control framework in mii layer.

Reported by:	Yousif Hassan < yousif () alumni ! jmu ! edu >
Tesdted by:	Yousif Hassan < yousif () alumni ! jmu ! edu >
2008-01-29 02:15:11 +00:00
Alexander Motin
f38b370376 Avoid data copying when it is possible.
bpf_filter() is able to work directly on mbuf chain.
2008-01-28 22:37:17 +00:00
Ruslan Ermilov
007b1b7bae Add a wrapper function that bound checks writes to the dump device. 2008-01-28 19:04:07 +00:00
Christian Brueffer
935c968abe Correct the kernel config hint in a printf statement.
Submitted by:	R.Mahmatkhanov <cvs-src@yandex.ru>
Reviewed by:	scottl
Approved by:	rwatson (mentor)
MFC after:	3 days
2008-01-28 18:13:03 +00:00
Christian S.J. Peron
c52a508838 Make sure that the termid type is initialized to AU_IPv4 by default.
This makes sure that process tokens credentials with un-initialized
audit contexts are handled correctly.  Currently, when invariants are
enabled, this change fixes a panic by ensuring that we have a valid
termid family.  Also, this fixes token generation for process tokens
making sure that userspace is always getting a valid token.

This is consistent with what Solaris does when an audit context is
un-initialized.

Obtained from:	TrustedBSD Project
MFC after:	1 week
2008-01-28 17:33:46 +00:00
Mitsuru IWASAKI
0aeee4bd8a Don't repeat error logging about NOP message sending if
ciss_report_request() return an error (which is most likely data
underrun).

Noticed by:	Mark Atkinson
MFC after:	1 week
2008-01-28 16:21:34 +00:00
Andrew Gallatin
10882804c9 Only reset driver state when a hardware error is detected.
Preserve warning but do not reset if we enter the routine
without seeing a hardware error.
2008-01-28 13:20:51 +00:00
Randall Stewart
3ca1bceea5 - Fix a comment about prison.
- Fix it so the VRF is captured while locks are held.
MFC after:	1 week
2008-01-28 10:34:38 +00:00
Randall Stewart
bf949ea2d4 - Change back to using prioity 0. Which means don't change the
prioity when running the thread. (this is for the sctp_interator thread).

MFC after:	1 week
2008-01-28 10:33:41 +00:00
Randall Stewart
257438fb6c - Fix a bug where the socket may have been closed which
could cause a crash in the auth code.
Obtained from:	Michael Tuexen
MFC after:	1 week
2008-01-28 10:31:12 +00:00
Randall Stewart
f36d98069e - Fixes a comparison wrap issue with sack gap ack blocks that
span the 32 bit roll over mark.
2008-01-28 10:25:43 +00:00
Robert Watson
5ac3b03500 Properly return the error from mls_subject_privileged() in the ifnet
relabel check for MLS rather than returning 0 directly.

This problem didn't result in a vulnerability currently as the central
implementation of ifnet relabeling also checks for UNIX privilege, and
we currently don't guarantee containment for the root user in mac_mls,
but we should be using the MLS definition of privilege as well as the
UNIX definition in anticipation of supporting root containment at some
point.

MFC after:	3 days
Submitted by:	Zhouyi Zhou <zhouzhouyi at gmail dot com>
Sponsored by:	Google SoC 2007
2008-01-28 10:20:18 +00:00
Mitsuru IWASAKI
7572a9c749 Return errno value rather than boolean in this context.
MFC after:	1 week
2008-01-28 01:57:48 +00:00
Mitsuru IWASAKI
0c26519e5a Enter the sleep state immediately without waiting for timeout if
devd(8) is not running such as the system in single user mode.

MFC after:	1 week
2008-01-27 16:11:04 +00:00
Mitsuru IWASAKI
4f7f6238af Add devctl_process_running() so that power management system driver
can check whether devd(8) is running.

MFC after:	1 week
2008-01-27 16:06:37 +00:00
Alexander Motin
57f2b25dfa Run expire even without export hook connected.
PR:	kern/119839
2008-01-27 15:01:16 +00:00
Alexander Motin
cfcb2a4c82 Fix memory leak when export hook is not connected. 2008-01-27 09:22:10 +00:00
Alexander Motin
f704a24b20 Remove one very strange unneded if. 2008-01-27 08:52:41 +00:00
Kip Macy
6edc218ea1 Fix loading for case where we don't overload tcp_usrreqs by calling tcp_drop directly 2008-01-27 04:39:38 +00:00
Kip Macy
a57927a1e6 fix DISABLE_MBUF_IOVEC case by initializing mbuf header completely 2008-01-27 04:37:02 +00:00
Alexander Motin
f8e5127d49 Slightly simplify code. 2008-01-27 02:04:12 +00:00
Marius Strobl
82f358ff2a - Fix a typo in a comment.
- Fix whitespace according to style(9).
- Sync the comment describing why we have to wait in nsphy_reset()
  with nsphyter_reset(). It's true that the manual tells to not do a
  reset within 500us of applying power but that's unlikely the cause
  of problems seen here. Generally having to wait 500us after a reset
  however is.
2008-01-27 01:30:02 +00:00
Marius Strobl
4f3b854461 Fix a typo in a comment. 2008-01-27 01:11:57 +00:00
Marius Strobl
d47d37af9b Add a driver for the National Semiconductor DP83815, DP83843 and
DP83847 PHYs. The main reason for using a specific driver for these
PHYs are reset quirks similar to the nsphy(4) driven DP83840A.

PR:		112654
Obtained from:	NetBSD
MFC after:	2 weeks
Thanks to:	mlaier for testing w/ DP83815
2008-01-27 01:10:41 +00:00
Marius Strobl
a9e28d7d0b Sort values according to style.Makefile(5). 2008-01-27 01:02:29 +00:00
Robert Watson
a384163c5e Increase maximum DDB capture buffer size to 5MB.
PR:		119993
MFC after:	2 months
Suggested by:	Scot Hetzel <swhetzel at gmail dot com>
2008-01-26 23:02:14 +00:00