Commit graph

78142 commits

Author SHA1 Message Date
Jack F Vogel 17d2646b7c Left out header change in last delta - new member
in adapter so that advertise changes can be done
to one port without the other changing.
2010-06-30 16:28:28 +00:00
Gleb Smirnoff 3da2cea421 Fix build. 2010-06-30 11:17:55 +00:00
Alan Cox f4b9ace4f8 Improve bufdone_finish()'s handling of the bogus page. Specifically, if
one or more mappings to the bogus page must be replaced, call pmap_qenter()
just once.  Previously, pmap_qenter() was called for each mapping to the
bogus page.

MFC after:	3 weeks
2010-06-30 04:52:42 +00:00
Jack F Vogel 1fa9ef23cc BAH, I apologize, the wrong version of the code got
fat fingered in place, this is the correct version
that actually works... <sheepish grin>

MFC: in a week
2010-06-30 01:10:08 +00:00
Jack F Vogel 5f46ec799a Add a new sysctl option, this will allow one to
limit the advertised speed of an SFP+ to 1G, effectively
"forcing" link at that lower speed. It is off by default
and is enabled by sysctl dev.ix.0.force_gig=1, 0 will
set it back to the norm.
2010-06-30 01:01:06 +00:00
Kenneth D. Merry 4201341ff7 Change the mpt driver to allow larger I/O sizes.
The mpt driver previously didn't report a 'maxio' size to CAM, and so the
da(4) driver limited I/O sizes to DFLTPHYS (64K) by default.  The number
of scatter gather segments allowed, as reported to busdma, was
(128K / PAGE_SIZE) + 1, or 33 on architectures with 4K pages.

Change things around so that we wait until we've determined how many
segments the adapter can support before creating the busdma tag used for
buffers, so we can potentially support more S/G segments and therefore
larger I/O sizes.

Also, fix some things that were broken about the module unload path.  It
still gets hung up inside CAM, though.

mpt.c:		Move some busdma initialization calls in here, and call
		them just after we've gotten the IOCFacts, and know how
		many S/G segments this adapter can support.

mpt.h:		Get rid of MPT_MAXPHYS, it is no longer used.

		Add max_cam_seg_cnt, which is used to report our maximum
		I/O size up to CAM.

mpt_cam.c:	Use max_cam_seg_cnt to report our maximum I/O size to CAM.

		Fix the locking in mpt_cam_detach().

mpt_pci.c:	Pull some busdma initialization and teardown out and put
		it in mpt.c.  We now delay it until we know many scatter
		gather segments the adapter can support, and therefore
		how to setup our busdma tags.

mpt_raid.c:	Make sure we wake up the right wait channel to get the
		raid thread to wake up when we're trying to shut it down.

Reviewed by:	gibbs, mjacob
MFC after:	2 weeks
2010-06-29 22:07:53 +00:00
Weongyo Jeong 03286b3576 Initializes the ratectl for a node when the state is changed to RUN.
This prevents a kernel fault by dividing with zero because the initial
rate was 0 and didn't be initialized.

Tested by:	Warren Block <wblock at wonkity.com>
MFC after:	3 days
2010-06-29 21:56:42 +00:00
Weongyo Jeong 68cd814a8a Fixes NULL pointer reference that it's occurred when the state is
changed to RUN because ic->ic_newassoc isn't set anywhere now.  In the
previous bwi_newassoc() is used to initialize AMRR rate routines.

Tested by:	Warren Block <wblock at wonkity.com>
MFC after:	3 days
2010-06-29 21:52:40 +00:00
John Baldwin fab216aaa0 Sort function prototypes (since I didn't manage to insert tdksignal()
correctly).
2010-06-29 20:55:12 +00:00
John Baldwin 7a6f3d7890 Send SIGPIPE to the thread that issued the offending system call
rather than to the entire process.

Reported by:	Anit Chakraborty
Reviewed by:	kib, deischen (concept)
MFC after:	1 week
2010-06-29 20:44:19 +00:00
John Baldwin ad6eec7b9e Tweak the in-kernel API for sending signals to threads:
- Rename tdsignal() to tdsendsignal() and make it private to kern_sig.c.
- Add tdsignal() and tdksignal() routines that mirror psignal() and
  pksignal() except that they accept a thread as an argument instead of
  a process.  They send a signal to a specific thread rather than to an
  individual process.

Reviewed by:	kib
2010-06-29 20:41:52 +00:00
Marcel Moolenaar cfbcffa248 Fix profiling (part 1):
o   Functions are 4-byte aligned for Book-E.
o   We get compiled with -DPROF and not -DGPROF if profiling
    is enabled.
2010-06-29 19:07:44 +00:00
Matt Jacob 6e4b813833 Don't lock buses around a call to xptperiphlistmatch- the buses will be
locked at appropriate places.

MFC after:	1 week
X-MFC:		208752
2010-06-29 17:10:55 +00:00
Gleb Smirnoff 24536f92c5 After processing the O_SKIPTO opcode our cmd points to the next rule, and
"match" processing at the end of inner loop would look ahead into the next
rule, which is incorrect. Particularly, in the case when the next rule
started with F_NOT opcode it was skipped blindly.

To fix this, exit the inner loop with the continue operator forcibly and
explicitly.

PR:		kern/147798
2010-06-29 16:57:30 +00:00
Konstantin Belousov 5ed35ba97a Revert r209578:
Use C99 initializers for the struct sysent generated by MAKE_SYSENT().
C++ does not have designator-initializer facility of C99, not using this
in the header makes us friendly to C++ kernel modules, whoever wants
such schism.

Requested by:	mdf
MFC after:	6 days (not really)
2010-06-29 14:31:49 +00:00
Doug Barton d748aee076 If i is going to be used in the loop unconditionally the declaration
has to be unconditional as well.

Conical head covering to:	kib
2010-06-29 01:04:24 +00:00
Konstantin Belousov 13cedde2cb Regenerate 2010-06-28 18:17:21 +00:00
Konstantin Belousov 0d9d996d39 Despite system call deregistration drains the threads executing System V
shm syscalls, and initial check for the number of allocated segments
in the module deinitialization code, the following might happen:
   after the check for active segment, while waiting for threads to
   leave some other syscall, shmget(2) is called. Then, we can end
   up with the shared segment that cannot be detached since sysvshm
   module is unloaded.

Prevent the leak by rechecking and disclaiming a reference to the vm
object owned by sysvshm module, that might have grown during the drain.

Tested by:	pho
Reviewed by:	jhb
MFC after:	1 month
2010-06-28 18:12:42 +00:00
Konstantin Belousov 153ac44cf6 Count number of threads that enter and leave dynamically registered
syscalls. On the dynamic syscall deregistration, wait until all
threads leave the syscall code. This somewhat increases the safety
of the loadable modules unloading.

Reviewed by:	jhb
Tested by:	pho
MFC after:	1 month
2010-06-28 18:06:46 +00:00
Konstantin Belousov dc2db34f42 Use C99 initializers for the struct sysent generated by MAKE_SYSENT().
MFC after:	1 week
2010-06-28 17:59:45 +00:00
Attilio Rao b2488fc159 Fix a lock leak in the deadlock resolver in case the ticks counter
wrapped up.

Sponsored by:	Sandvine Incorporated
Submitted by:	pluknet <pluknet at gmail dot com>
Reported by:	Anton Yuzhaninov <citrin at citrin dot ru>
Reviewed by:	jhb
MFC after:	3 days
2010-06-28 17:45:00 +00:00
Jaakko Heinonen bc96d3d17a Correct a comment typo. 2010-06-27 12:19:09 +00:00
Rui Paulo cb3fbd1b92 Fix typo introduced in previous revision. 2010-06-27 10:17:11 +00:00
Pawel Jakub Dawidek 3297cdd096 Correct arguments order. 2010-06-26 21:44:45 +00:00
Rui Paulo fcfe3ad480 Fix the AR_SREV_MERLIN_20_OR_LATER() check.
Submitted by:	Alex Kozlov <spam at rm-rf.kiev.ua>
MFC after:	2 weeks
2010-06-26 20:59:10 +00:00
Michael Tuexen e1c97831ec * Do not dereference a NULL pointer when calling an SCTP send syscall
not providing a destination address and using ktrace.
* Do not copy out kernel memory when providing sinfo for sctp_recvmsg().
Both bug where reported by Valentin Nechayev.
The first bug results in a kernel panic.
MFC after: 3 days.
2010-06-26 19:26:20 +00:00
Rui Paulo c6b2b6fce6 Add NTFS partition type to GEOM_MBR. 2010-06-26 13:20:40 +00:00
Rui Paulo bbe4a97d41 Import the acpi_aibs(4) driver written by Constantine A. Murenin.
It has more features than acpi_aiboost(4) and it will eventually replace
acpi_aiboost(4).

Submitted by:	Constantine A. Murenin <cnst at FreeBSD.org>
Reviewed by:	freebsd-acpi, imp
MFC after:	1 month
2010-06-25 15:32:46 +00:00
George V. Neville-Neil 5ea4d522bb Make sure that all the exposed counters and variables are actually
being updated.

Pointed out by:	jfv
2010-06-24 21:17:58 +00:00
Jayachandran C. 4fddb8ed6f Add linker script and configuration file for n32 kernel.
Approved by:	rrs (mentor)
2010-06-24 10:14:31 +00:00
Jayachandran C. 9fa0972cf9 Merge jmallett@'s n64 work into HEAD - changeset 7
Initial support for n32 and n64 ABIs from
http://svn.freebsd.org/base/user/jmallett/octeon

Changes are:
 - syscall, exception and trap support for n32/n64 ABIs
 - 64-bit address space defines
 - _jmp_buf for n32/n64
 - casts between registers and ptr/int updated to work on n32/n64

Approved by:	rrs(mentor), jmallett
2010-06-24 08:08:43 +00:00
Michael Tuexen 370d524f00 Fix a bug I introduced in r209470.
MFC after: 3 days
2010-06-24 07:43:25 +00:00
Marcel Moolenaar bcec9ed0f1 Assign PCI intline values for ISA interrupts using the new INTR_VEC()
macro.
2010-06-24 05:49:58 +00:00
Marcel Moolenaar ed571bca9f Remove debugging printf() -- that is, I assume it was for debugging :-) 2010-06-24 05:47:00 +00:00
Adrian Chadd 7107f92fd6 Comment about the shared pins I know about. 2010-06-24 05:17:21 +00:00
Marcel Moolenaar ec120b9476 Pass the device_t of the AT PIC driver to atpic_intr() so that
we don't have to use a global variable. Pass a NULL frame pointer
to the dispatch function just like openpic(4).
2010-06-24 05:05:18 +00:00
Nathan Whitehorn bcebf6a165 Reverse the logic of the if statement that sets the default value of
HZ; the list of 1000 Hz platforms was getting unwieldy.

Suggested by:	marcel
2010-06-24 00:27:20 +00:00
Jung-uk Kim 28ef508f86 Use M_WAITOK for VESA BIOS initialization consistently. 2010-06-23 23:34:56 +00:00
Nathan Whitehorn e864acd42f Move default HZ from 100 to 1000 on powerpc.
Reviewed by:	marcel
MFC after:	2 weeks
2010-06-23 23:26:14 +00:00
Marcel Moolenaar 79312a0b25 With openpic(4) using active-low as the default polarity, reconfigure
the internal interrupt sources as active-high. The internal interrupt
sources are disabled when programmed as active-low.

Note that the internal interrupts have no sense bit like the external
interrupts. We program them as edge-triggered to make sure we write a
0 value to a reserved register. It does not in any way say anything
about the sense of internal interrupt.
2010-06-23 23:16:27 +00:00
Nathan Whitehorn 08393b3efa Configure interrupts on SMP systems to be distributed among all online
CPUs by default, and provide a functional version of BUS_BIND_INTR().
While here, fix some potential concurrency problems in the interrupt
handling code.
2010-06-23 22:33:03 +00:00
Marcel Moolenaar bd077006c0 In the attach method, refactor to take into account that
BUS_GET_RESOURCE_LIST() can return a NULL pointer -- and
will for MPC85xx kernels.
2010-06-23 22:25:52 +00:00
Konstantin Belousov 595473a587 Clear DF bit in eflags/rflags on the kernel entry. The i386 and amd64
ABI specifies the DF should be zero, and newer compilers do not clear
DF before using DF-sensitive instructions.

The DF clearing for signal handlers was done some time ago.

MFC after:	1 week
2010-06-23 20:44:07 +00:00
Jayachandran C. 78fe0672b6 Merge jmallett@'s n64 work into HEAD - changeset 6
PTE flag cleanup from http://svn.freebsd.org/base/user/jmallett/octeon
- Rename PTE_xx flags to match their MIPS names
- Use the new pte_set/test/clear macros uniformly, instead of a mixture
  of mips_pg_xxx(), pmap_pte_x() macros and direct access.
- Remove unused macros and defines from pte.h and pmap.c

Discussed on freebsd-mips@

Approved by:	rrs(mentor), jmallett
2010-06-23 19:42:01 +00:00
Jung-uk Kim 362487c0ba Let x86bios_alloc() pass contigmalloc(9) flags. Use it to set M_WAITOK
from VESA BIOS initialization.  All other malloc(9) uses in the function is
blocking any way.
2010-06-23 17:20:51 +00:00
Michael Tuexen 749c49ac62 * Implement sctp_does_stcb_own_this_addr() correclty. It was taking the
wrong side into account.
* sctp_findassociation_ep_addr() must check the local address if available.
This fixes a bug where ABORT chunks were accepted even in the case where
the local was not owned by the endpoint.
Thanks to brucec for pointing out a bug in my first version of the fix.
MFC after: 3 days
2010-06-23 15:19:07 +00:00
Rebecca Cran 10eee561f4 Add some more modules to loader.conf. Remove if_awi since support for it
was removed 2 years ago.

PR: conf/147126
PR: conf/116071
Approved by: rrs (mentor)
2010-06-23 14:06:05 +00:00
Konstantin Belousov 692add74d8 Fix bugs on pc98, use npxgetuserregs() instead of npxgetregs() for
get_fpcontext(), and npxsetuserregs() for set_fpcontext). Also,
note that usercontext is not initialized anymore in fpstate_drop().

Systematically replace references to npxgetregs() and npxsetregs()
by npxgetuserregs() and npxsetuserregs() in comments.

Noted by:	bde
2010-06-23 12:17:13 +00:00
Konstantin Belousov 1060a94fb5 After the FPU use requires #MF working due to INT13 FPU exception handling
removal, MFi386 r209198:
    Use critical sections instead of disabling local interrupts to ensure
    the consistency between PCPU fpcurthread and the state of FPU.

Reviewed by:	bde
Tested by:	pho
2010-06-23 11:21:19 +00:00
Konstantin Belousov 699d648aab Remove the support for int13 FPU exception reporting on i386. It is
believed that all 486-class CPUs FreeBSD is capable to run on, either
have no FPU and cannot use external coprocessor, or have FPU on the
package and can use #MF.

Reviewed by:	bde
Tested by:	pho (previous version)
2010-06-23 11:12:58 +00:00