Commit Graph

141365 Commits

Author SHA1 Message Date
Roman Divacky
2963584278 Getdents requires padding with 2 bytes instead of 1 byte
as with getdents64. The last byte is used for storing
the d_type, add this to plain getdents case where it was
missing before. Also change the code to use strlcpy instead
of plain strcpy. This changes fix the getdents crash we
had reports about (hl2 server etc.)

PR:		kern/117010
MFC after:	1 week
Submitted by:	Dmitry Chagin (dchagin@)
Tested by:	MITA Yoshio <mita ee.t.u-tokyo.ac jp>
Approved by:	kib (mentor)
2008-09-09 16:00:17 +00:00
Doug Rabson
4efa8f3e07 Initialise the SVCAUTH field for new transport structures when they are
allocated instead of waiting for the first request. This fixes an issue with
rpcbind's support for PMAPPROC_CALLIT.

Reviewed by:	markm
2008-09-09 14:15:55 +00:00
Konstantin Belousov
745aaef5b5 Remove superfluous copyin() of args, structures are already in kernel space.
Submitted by:	dchagin
MFC after:	1 week
2008-09-09 13:01:14 +00:00
Edward Tomasz Napierala
70583fbb77 Remove redundant close(2).
Submitted by:	kensmith
Approved by:	rwatson (mentor)
2008-09-09 12:31:42 +00:00
Pyun YongHyeon
8de8f265b6 Add workaround for CRC errors seen at 100Mbps on JMC250 A2.
While here update chip revision number of JMC250/JMC260 from the
latest datasheet.
2008-09-09 10:19:48 +00:00
Pyun YongHyeon
9b45b70125 Fix typo. 2008-09-09 10:10:03 +00:00
Andrey A. Chernov
4220467ec2 Return two fixes from previous backout which does not require
review by secteam@ for the reasons mentioned below.

1) Rename /dev/urandom to /dev/random since urandom marked as
XXX Deprecated
alias in /sys/dev/random/randomdev.c
(this is our naming convention and no review by secteam@ required)

2) Set rs_stired flag after forced initialization to prevent
double stearing.
(this is already in OpenBSD, i.e. they don't have double stearing.
It means that this change matches their code path and no additional
secteam@ review required)

Submitted by:   Thorsten Glaser <tg@mirbsd.de> (2)
2008-09-09 09:46:36 +00:00
Bjoern A. Zeeb
c10eb6d10a Work around an integer division resulting in 0 and thus the
congestion window not being incremented, if cwnd > maxseg^2.
As suggested in RFC2581 increment the cwnd by 1 in this case.

See http://caia.swin.edu.au/reports/080829A/CAIA-TR-080829A.pdf
for more details.

Submitted by:	Alana Huebner, Lawrence Stewart,
		Grenville Armitage (caia.swin.edu.au)
Reviewed by:	dwmalone, gnn, rpaulo
MFC After:	3 days
2008-09-09 07:35:21 +00:00
Robert Noland
275d30b973 IGP based radeon cards such as the rs485 and rs690 require that the GART table
be un-cached.  Our previous memory barrier was not sufficient.  This patch
allocates the IGP GART tables using the BUS_DMA_NOCACHE flag to get these
cards working.

Approved by:	kib
2008-09-09 02:18:37 +00:00
Robert Noland
0020a2cded We should never call drm_pci_alloc() while holding locks, due the the
calls to bus_dma.  There were multiple paths that held different locks or
no locks at all. This patch ensures that all of the calling paths drop
their lock(s) before calling drm_pci_alloc().

Reviewed by:	kib
2008-09-09 02:05:03 +00:00
Kip Macy
d5e2c3dd04 Fix issue with recovering from transient jumbo mbuf shortage.
Submitted by:	Chelsio Inc.
MFC after:	3 days
2008-09-09 01:36:02 +00:00
Maksim Yevmenkin
618f3d8c0a Document TAPGIFNAME, TAPSIFINFO and TAPGIFINFO tap(4)
character device ioctl's.

MFC after:	1 week
2008-09-08 22:44:51 +00:00
Maksim Yevmenkin
03bbca8f63 Add new TAPGIFNAME tap(4) character device ioctl. This is a
convenient shortcut to obtain network interface name using
file descriptor for character device.

Obtained from:	NetBSD
MFC after:	1 week
2008-09-08 22:43:55 +00:00
John Baldwin
8c68f75a7c - Reduce scope of #ifdef's in uma_zcreate() call in init_turnstile0().
- Set UMA_ZONE_NOFREE so that the per-turnstile spin locks are type stable
  to avoid a race where one thread might dereference a lock in a free'd
  turnstile that was previously used by another thread.

Theorized by:	tegge (2)
MFC after:	1 week
2008-09-08 21:40:15 +00:00
Marius Strobl
a4eba4a555 For cheetah-class CPUs ensure that the dt512_0 is set to hold 8k pages
for all three contexts and configure the dt512_1 to hold 4MB pages for
them (e.g. for direct mappings).
This might allow for additional optimization by using the faulting
page sizes provided by AA_DMMU_TAG_ACCESS_EXT for bypassing the page
size walker for the dt512 in the superpage support code.

Submitted by:	nwhitehorn (initial patch)
2008-09-08 21:24:25 +00:00
Marius Strobl
2611aba180 USIII and beyond CPUs have stricter requirements when it comes
to synchronization needed after stores to internal ASIs in order
to make side-effects visible. This mainly requires the MEMBAR #Sync
after such stores to be replaced with a FLUSH. We use KERNBASE as
the address to FLUSH as it is guaranteed to not trap. Actually,
the USII synchronization rules also already require a FLUSH in
pretty much all of the cases changed.
We're also hitting an additional USIII synchronization rule which
requires stores to AA_IMMU_SFSR to be immediately followed by a DONE,
FLUSH or RETRY. Doing so triggers a RED state exception though so
leave the MEMBAR #Sync. Linux apparently also has gotten away with
doing the same for quite some time now, apart from the fact that
it's not clear to me why we need to clear the valid bit from the
SFSR in the first place.

Reviewed by:	nwhitehorn
2008-09-08 20:38:48 +00:00
Marius Strobl
85de9f54f8 o Move the MODULE_DEPEND() for cam(4) from the esp_sbus.c front-end to
the ncr53c9x.c core where it actually belongs so future front-ends
  don't need to add it.
o Use the correct OFW property when looking for the initiator ID of the
  SBus device.
o Don't specify an alignment when creating the parent DMA tag for
  SUNW,fas; their DMA engine doesn't require an alignment constraint
  and it's no inherited by the child DMA tags anyway (which probably
  is a bug though).
o Drop the superfluous sc_maxsync and use sc_minsync instead. The
  former apparently was added due to a confusion with the maximum
  frequency used in cam(4), which basically corresponds to the
  inverse of minimum sync period.
o Merge ncr53c9x.c from NetBSD:
  1.116: NCRDMA_SETUP() should be called before NCR_SET_COUNT() and
         NCRCMD_DMA command in ncr53c9x_select().
  1.125: free allocated resources on detach.
o Static'ize ncr53c9x_action(), ncr53c9x_init() and ncr53c9x_reset()
  as these are not required outside of ncr53c9x.c.
o In ncr53c9x_attach() don't leak the device mutex in case attaching
  fails.
o Register an asynchronous notification handler so in case cam(4)
  reports a lost device we can cancel outstanding commands and
  restore the default parameters for the target in question.
o For FAS366 correctly support 16-bit target IDs and let it know
  that we use 32-bit transfers.
o Overhaul the negotiation of transfer settings. This includes
  distinguishing between current and goal transfer settings of the
  target so we can renegotiate their goal settings when necessary
  and correcting the order in which tagged, wide and synchronous
  transfers are negotiated.
o If we are requesting sense, force a renegotiation if we are
  currently using anything different from asynchronous at 8 bit
  as the target might have lost our transfer negotiations.
o In case of an XPT_RESET_BUS just directly call ncr53c9x_init()
  instead of issuing a NCRCMD_RSTSCSI, which in turn will issue an
  interrupt that is treated as an unexpected SCSI bus reset by
  ncr53c9x_intr() and thus calls ncr53c9x_init(). Remove the now
  no longer used ncr53c9x_scsi_reset().
o Correct an off-by-one error when setting cpi->max_lun.
o In replace printf(9) with device_printf(9) calls where appropriate
  and in ncr53c9x_action() remove some unnecessarily verbose messages.
o In ncr53c9x_sched() use TAILQ_FOREACH() instead of reimplementing
  it and consolidate two tagging-related target info checks into one.
o In ncr53c9x_done() set the CAM status to CAM_SCSI_STATUS_ERROR when
  appropriate, respect CAM_DIS_AUTOSENSE and teach it to return SCSI
  status information.
o In ncr53c9x_dequeue() ensure the tags are cleared.
o Use ulmin() instead of min() where appropriate.
o In ncr53c9x_msgout() consistently use the reset label.
o When we're interrupted during a data phase and the DMA engine is
  still active, don't panic but reset the core and the DMA engine as
  this should be sufficient. Also, the typical problem for triggering
  this was the lack of renegotiation when requesting sense.
o Correctly handle DEVICE RESETs.
o Adapt the locking of esp(4) to MPSAFE cam(4). This includes moving
  the calls of lsi64854_attach() to the bus front-ends so it can pass
  the esp(4) mutex to bus_dma_tag_create(9).
o Change the LSI64854 driver to not create a DMA tag and map for the
  Ethernet channel as le(4) will handle these on its own as well as
  sync and unload the DMA maps for the SCSI and parallel port channel
  after a DMA transfer.
o Cam(4)'ify some NetBSD-centric comments.
o Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9)
  and take advantage of rman_get_rid(9) in order to save some softc
  members.

Reviewed by:	scottl
MFC after:	1 month
2008-09-08 20:20:44 +00:00
John Baldwin
aa4c44b58b Close a race in sleepq_broadcast() where the sleepq could be reused after
it had been assigned to the last sleeping thread.  That thread might have
started running on another CPU and have reused that sleep queue.  Fix it
by just walking the thread queue using TAILQ_FOREACH_SAFE() rather than
a while loop.

PR:		amd64/124200
Discovered by:	tegge
Tested by:	benjsc
MFC after:	1 week
2008-09-08 19:44:57 +00:00
Oleg Bulyzhin
82b67c0132 bge_tick(): do not touch PHY if link is up. This should solve problem with
extra input errors for some BCM57XX chips.

PR:		kern/122295
2008-09-08 18:10:15 +00:00
Gregory Neil Shapiro
4e1833120f Note sendmail 8.14.3 upgrade 2008-09-08 17:13:18 +00:00
Rafal Jaworowski
53917bdbd9 Streamline #include sections in ds133x and ds1672 drivers. This unbreaks the
LINT build.
2008-09-08 15:49:07 +00:00
Peter Wemm
434cb98901 Pass 1 of mpsafetty-ifying si(4). It compiles and has basic functionality,
but needs a lot more work.  In particular, it has no flow control and has
a tendency to race when giving commands.  It still uses Giant for the
tty and driver lock, but this is a keep-it-simple feature for now.
Some of the [temporary] proliferation of messages lines are way too long.
2008-09-08 11:41:20 +00:00
Rafal Jaworowski
286fa44565 ds133x: Introduce device_identify method; update NOTES.
Obtained from:	Semihalf
2008-09-08 10:40:48 +00:00
Konstantin Belousov
36fd475c64 Bump __FreeBSD_version for per-CPU GDT on amd64.
Requested by:	nox
2008-09-08 10:27:11 +00:00
Konstantin Belousov
3bd5e467b2 The pcb_gs32p should be per-cpu, not per-thread pointer. This is
location in GDT where the segment descriptor from pcb_gs32sd is
copied, and the location is in GDT local to CPU.

Noted and reviewed by:	peter
MFC after:	1 week
2008-09-08 09:59:05 +00:00
Konstantin Belousov
1772c3e9bb Provide private per-CPU GDTs on amd64. This is required at least for the
linux CB_GS32BIT to work.

Noted by:	nox
Reviewed by:	peter
MFC after:	1 week
2008-09-08 09:55:51 +00:00
Konstantin Belousov
7b1608fde1 In linux_set_thread_area(), mark pcb as PCB_GS32BIT. This was missed
when r180992 was committed.

Reviewed by:	peter
MFC after:	1 week
2008-09-08 09:09:23 +00:00
Konstantin Belousov
575a30d883 Fix inconsistencies in the comments.
MFC after:	1 week
2008-09-08 08:58:29 +00:00
Ed Schouten
d172be1fd0 Fix a typo in a comment in the ACPI Fujitsu driver.
The word "hotkys" should read "hotkeys".

Submitted by:	Jille Timmermans <jille quis cx>
2008-09-08 06:29:24 +00:00
Ulf Lilleengen
31dff47f01 - Update the libgeom manpage with a description of g_device_path and
g_providername utility functions.

Approved by:	kib (mentor)
2008-09-08 06:27:00 +00:00
Andrew Thompson
6945d73b44 Put the bridge mac inheritance behind a sysctl with the default off as this
still needs all the edge cases fixed.

Submitted by:	Eygene Ryabinkin
2008-09-08 03:28:26 +00:00
Tim Kientzle
a2a72fd640 Fix a type-aliasing problem in the libarchive test suite,
restore WARNS=6.
2008-09-08 00:58:12 +00:00
Warner Losh
7217c39672 Commit the no-brainer parts of my space saving kernel experiments. We
don't inline the locking primitives, and only grab those parts of mii
that we really need.  Other space optimizations are too agressive for
the generic file (removing all of usb, and loading it as kernel
modules).
2008-09-08 00:41:32 +00:00
Tim Kientzle
fb7ec956eb Correct a leaking archive_entry in the test suite. 2008-09-07 23:59:27 +00:00
Ollivier Robert
f8b329f0ed Merge from vendor/ntp/dist: r182856:
Apply updated patch from bin/92839 to avoid two possible buffer overflows.

PR:		bin/92839
Submitted by:	Helge Oldach <freebsdntpd@oldach.net>
2008-09-07 22:15:41 +00:00
Ollivier Robert
a3275ecc3f Re-apply patch from bin/92839 to avoid two possible buffer overflows. For an
unknown reason, this seems to have never been applied to vendor sources.

PR:		bin/92839
Submitted by:	Helge Oldach <freebsdntpd@oldach.net>
2008-09-07 22:08:10 +00:00
Bjoern A. Zeeb
00db174bc2 To my reading there are no real consumers of ip6_plen (IPv6
Payload Length) as set in tcpip_fillheaders().
ip6_output() will calculate it based of the length from the
mbuf packet header itself.
So initialize the value in tcpip_fillheaders() in correct
(network) byte order.

With the above change, to my reading, all places calling tcp_trace()
pass in the ip6 header via ipgen as serialized in the mbuf and with
ip6_plen in network byte order.
Thus convert the IPv6 payload length to host byte order before printing.

MFC after:	2 months
2008-09-07 20:44:45 +00:00
Joel Dahl
bbe9d8cba9 Fix deactivation of speakers while plugging in headphones on Fujitsu
U1010, Lenovo 3k N200 and Acer Aspire 4715Z.

Reviewed by:	attilio
PR:		126216, 126244, 127034
Submitted by:	Anton E. Kartashev <amokk@mirahost.ru>,
		Ganael Laplanche <ganael.laplanche@martymac.com>,
		Dennis Generaloff <giantlock@gmail.com>
2008-09-07 20:25:19 +00:00
Matteo Riondato
2c0e1c7ed4 Use %d to print numfibs
MFC after:	1 day
2008-09-07 19:10:06 +00:00
Warner Losh
33b4ae7d79 Minor cleanup of this config file:
o It has been tested only on KB9202, KB9202A and KB9202B boards
o Better comments about hints
o option<space><tab>
o Add newer SX_NOINLINE option.
o Fix a few comments
2008-09-07 18:55:55 +00:00
Bjoern A. Zeeb
3cee92e074 Split tcp_mss() in tcp_mss() and tcp_mss_update() where the former
calls the latter.

Merge tcp_mss_update() with code from tcp_mtudisc() basically
doing the same thing.

This gives us one central place where we calcuate and check mss values
to update t_maxopd (maximum mss + options length) instead of two slightly
different but almost equal implementations to maintain.

PR:		kern/118455
Reviewed by:	silby (back in March)
MFC after:	2 months
2008-09-07 18:50:25 +00:00
Rui Paulo
941f9f10b2 Add support for MacBook Air. (not tested)
Obtained from:	mactel-linux
2008-09-07 18:15:34 +00:00
Konstantin Belousov
9dee707cf0 Segment registers are stored in the uc_mcontext member of the struct
l_ucontext. To restore the registers content, trampoline needs to
dereference uc_mcontext instead of taking some undefined values from
l_ucontext.

Submitted by:	Dmitry Chagin <dchagin@>
MFC after:	1 week
2008-09-07 16:39:21 +00:00
Bjoern A. Zeeb
ebe5426934 V_irtualize SVN r182846 tcp_mssdflt/tcp_v6mssdflt procedure based
sysctl implementations for VIMAGE the same way we did elsewhere:
update the implementation but leave the globals and the SYSCTL
statement untouched.
2008-09-07 15:20:21 +00:00
Tom Rhodes
8156052b20 Bring a paragraph in this manual page a bit closer to the present date.
Discussed with:	des
2008-09-07 15:19:34 +00:00
Bjoern A. Zeeb
4cdf3bedf3 Convert SYSCTL_INTs for tcp_mssdflt and tcp_v6mssdflt to
SYSCTL_PROCs and check that the default mss for neither v4 nor
v6 goes below the minimum MSS constant (216).

This prevents people from shooting themselves in the foot.

PR:		kern/118455 (remotely related)
Reviewed by:	silby (as part of a larger patch in March)
MFC after:	2 months
2008-09-07 14:44:55 +00:00
Simon L. B. Nielsen
068ba60199 Change space -> tab in printed usage output to make it look consistent. 2008-09-07 14:32:03 +00:00
Ulf Lilleengen
b31e5ae243 - Make use of the new and g_device_path utility function in libgeom to avoid
duplication of code in fdisk and boot0cfg. Also make use of g_providername to
  fix an issue with fdisk and boot0cfg not using the correct provider when
  writing the MBR.

Reviewed by:	phk
Approved by:	pjd (mentor)
2008-09-07 13:58:35 +00:00
Ulf Lilleengen
f805f204b6 - Add a new ioctl for getting the provider name of a geom provider.
- Add a routine for looking up a device and checking if it is a valid geom
  provider given a partial or full path to its device node.

Reviewed by:	phk
Approved by:	pjd (mentor)
2008-09-07 13:54:57 +00:00
Bjoern A. Zeeb
6f4745d575 Catch a possible NULL pointer deref in case the offsets got mangled
somehow.
As a consequence we may now get an unexpected result(*).
Catch that error cases with a well defined panic giving appropriate
pointers to ease debugging.

(*) While the concensus was that the case should never happen unless
    there was a bug, noone was definitively sure.

Discussed with:		kmacy (about 8 months back)
Reviewed by:		silby (as part of a larger patch in March)
MFC after:		2 months
2008-09-07 13:09:04 +00:00