jh [Wed, 30 Jun 2010 18:34:45 +0000 (18:34 +0000)]
- Don't assign the return value from read(2) to a variable of type
int.
- Use errx(3) instead of err(3) to print the error message on short
reads in readlabel(). errno won't be set on short reads which can
easily occur here due to the fixed size read request.
jfv [Wed, 30 Jun 2010 17:26:47 +0000 (17:26 +0000)]
SR-IOV support added to igb
What this provides is support for the 'virtual function'
interface that a FreeBSD VM may be assigned from a host
like KVM on Linux, or newer versions of Xen with such
support.
When the guest is set up with the capability, a special
limited function 82576 PCI device is present in its virtual
PCI space, so with this driver installed in the guest that
device will be detected and function nearly like the bare
metal, as it were.
The interface is only allowed a single queue in this configuration
however initial performance tests have looked very good.
alc [Wed, 30 Jun 2010 17:20:33 +0000 (17:20 +0000)]
Simplify entry to vm_pageout_clean(). Expect the page to be locked.
Previously, the caller unlocked the page, and vm_pageout_clean()
immediately reacquired the page lock. Also, assert rather than test
that the page is neither busy nor held. Since vm_pageout_clean() is
called with the object and page locked, the page can't have changed
state since the caller verified that the page is neither busy nor
held.
alc [Wed, 30 Jun 2010 04:52:42 +0000 (04:52 +0000)]
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.
marcel [Wed, 30 Jun 2010 01:40:25 +0000 (01:40 +0000)]
On powerpc, calculate s_scale using the non-FP version previously
specific to hp300. Since FreeBSD does not support hp300, hp300 has
been removed from the condition altogether.
The FP version broke profiling on powerpc due to invalid results.
Casting to double instead of float resolved the issue, but with
Book-E not having a FP unit, the non-FP version looked preferrable.
Note that even on AIM hardware the FP version yielded an invalid
value for s_scale, so the problem is most likely with the compiler
or with the expression itself.
jfv [Wed, 30 Jun 2010 01:01:06 +0000 (01:01 +0000)]
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.
jilles [Tue, 29 Jun 2010 22:37:45 +0000 (22:37 +0000)]
sh: Forget about terminated background processes sooner.
Unless $! has been referenced for a particular job or $! still contains that
job's pid, forget about it after it has terminated. If $! has been
referenced, remember the job until the wait builtin has reported its
completion (either with the pid as parameter or without parameters).
In interactive mode, jobs are forgotten after termination has been reported,
which happens before primary prompts and through the jobs builtin. Even
then, though, remember a job if $! has been referenced.
This is similar to what is suggested by POSIX and should fix most memory
leaks (which also tend to cause sh to use more CPU time) with long running
scripts that start background jobs.
Caveats:
* Repeatedly referencing $! without ever doing 'wait', like
while :; do foo & echo started foo: $!; sleep 60; done
will still use a lot of memory and CPU time in the long run.
* The jobs and jobid builtins do not cause a job to be remembered for longer
like expanding $! does.
ken [Tue, 29 Jun 2010 22:07:53 +0000 (22:07 +0000)]
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.
weongyo [Tue, 29 Jun 2010 21:56:42 +0000 (21:56 +0000)]
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
weongyo [Tue, 29 Jun 2010 21:52:40 +0000 (21:52 +0000)]
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
jhb [Tue, 29 Jun 2010 20:41:52 +0000 (20:41 +0000)]
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.
glebius [Tue, 29 Jun 2010 16:57:30 +0000 (16:57 +0000)]
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.
kib [Tue, 29 Jun 2010 14:31:49 +0000 (14:31 +0000)]
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.
imp [Tue, 29 Jun 2010 03:52:12 +0000 (03:52 +0000)]
Expand system into my_system, and add the necessary tidyness that we
need. Close the pidfile. Then close all descriptors >= 3 to avoid
information leakage to children.
This solves the problem of not being able to restart devd when you
have, for example, a dhclient forked to configure your network...
kib [Mon, 28 Jun 2010 18:12:42 +0000 (18:12 +0000)]
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.
kib [Mon, 28 Jun 2010 18:06:46 +0000 (18:06 +0000)]
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.
gavin [Mon, 28 Jun 2010 12:04:55 +0000 (12:04 +0000)]
Various changes to make locate compilable with WARNS=6. Note that there
is still one issue on FreeBSD/arm (signed vs unsigned char) which prevents
actually bumping this to WARNS=6 - I'm still considering the correct
solution to this issue.
gavin [Mon, 28 Jun 2010 12:00:20 +0000 (12:00 +0000)]
Make WARNS=6 safe, mainly by casting to intmax_t and printing with %ju
where needed. Also, fix bad indentation on lines already affected by the
above changes.
nwhitehorn [Mon, 28 Jun 2010 01:40:56 +0000 (01:40 +0000)]
Revert r209544. It papers over a binutils bug, and is not even a reliable
fix for it.
The bug occurs when using the --as-needed flag to ld in the presence of
synthetic linker-generated symbols that reference symbols defined in
linked-to shared libraries with versioned symbols. When the only symbols
used from a library fall into this category, ld will drop the DT_NEEDED
entry for it, but retain the versioning information. This bug is best
fixed/hacked around in binutils, not in rtld.
gavin [Sun, 27 Jun 2010 23:11:35 +0000 (23:11 +0000)]
Make the second example command more closely match the demo output, and as
a side effect more clearly show the change in command lines between the
first and second example invocations.
imp [Sun, 27 Jun 2010 17:14:04 +0000 (17:14 +0000)]
Properly inherit variables from src/usr.sbin/Makefile.inc for
subdirectories of pc-sysinstall. Back out explicit setting in
pc-sysinstall/pc-sysinstall/Makefile.
gavin [Sun, 27 Jun 2010 14:21:08 +0000 (14:21 +0000)]
Fix transfer statistics in the "send file" case - The conditional used
to print the stats were using an uninitialised variable. [1]
Fix trasnfer statistics in the "receive file" case - the statistics struct
was being cleared both before and after the initial connect to the remote
server. As a result, the printed time and calculated bandwidth covers
the time to connect ad well as the time to transfer the file. This may
not be ideal, but now at least matches the "send file" case.
Found by: clang static analyser [1]
Reviewed by: imp
cperciva [Sun, 27 Jun 2010 02:30:19 +0000 (02:30 +0000)]
Note that internal_underscores should be used in identifier names rather
than camelCase or TitleCase.
According to grep and my checked-out source tree, we're currently at 3733379 internal_underscores, 93024 camelCases, and 80831 TitleCases;
so this commit is merely documenting existing practice.
nwhitehorn [Sat, 26 Jun 2010 22:04:52 +0000 (22:04 +0000)]
Ignore versioned dependencies on shared objects to which we do not link.
This fixes an error with files like this created by GNU ld under certain
circumstances.
pjd [Sat, 26 Jun 2010 21:44:05 +0000 (21:44 +0000)]
Just like in case of setgroups(2), for getgroups(2) also advice including
sys/param.h instead of sys/types.h so we get NGROUPS_MAX and NGROUPS
definitions.
tuexen [Sat, 26 Jun 2010 19:26:20 +0000 (19:26 +0000)]
* 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.
rpaulo [Fri, 25 Jun 2010 15:32:46 +0000 (15:32 +0000)]
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
imp [Thu, 24 Jun 2010 22:21:47 +0000 (22:21 +0000)]
Bring in Kris Moore's pc-sysinstall shell script from PC-BSD. This
shell script is the back end logic necessary for an installer. It
contains both query routines to allow a front-end installer to present
reasonable choices to the user and also action routines which allow
the front end installer to put a FreeBSD distribution onto a disk. It
supports installing onto the usual suspects, as well as advanced
features like Mirroring, ZFS, Encryprion and GPT labels.
While this is only the back-end of the installer, it can do unattended
scripted installations. In PC-BSD's world view, all installations are
scripted and all the front-end does is write the script. As such, it
is useful in its own right.
This has been extensively tested over the past several releases of
PC-BSD. However, differences between that environment and FreeBSD
suggest there will be a period of shake-out while those differences
are discovered and corrected.
A text-based front-end is in the works. For the GUI-based front-end,
you can use the PC-BSD distribution.
Kris' BSDcan paper on pc-sysinstall is linked off his talk on the
BSDcan site:
http://www.bsdcan.org/2010/schedule/events/173.en.html
The man page is written by Josh Paetzel, and I wrote the Makefiles for
the FreeBSD integration. Kris wrote the rest.
This represents version r7010 in the PC-BSD repo.
http://svn.pcbsd.org/pcbsd/current/pc-sysinstall
imp [Thu, 24 Jun 2010 16:28:52 +0000 (16:28 +0000)]
Merge from TBEMD:
Rather than having arch specific code in Makefile.inc1, generalize so
that we can control the settings of different options on a per
architecutre basis.
jchandra [Thu, 24 Jun 2010 08:08:43 +0000 (08:08 +0000)]
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
marcel [Thu, 24 Jun 2010 05:05:18 +0000 (05:05 +0000)]
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).
marcel [Wed, 23 Jun 2010 23:16:27 +0000 (23:16 +0000)]
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.
nwhitehorn [Wed, 23 Jun 2010 22:33:03 +0000 (22:33 +0000)]
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.
kib [Wed, 23 Jun 2010 20:44:07 +0000 (20:44 +0000)]
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.
jchandra [Wed, 23 Jun 2010 19:42:01 +0000 (19:42 +0000)]
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
jkim [Wed, 23 Jun 2010 17:20:51 +0000 (17:20 +0000)]
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.
tuexen [Wed, 23 Jun 2010 15:19:07 +0000 (15:19 +0000)]
* 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
brucec [Wed, 23 Jun 2010 14:19:19 +0000 (14:19 +0000)]
Make it easier to cancel a failing installation by only attempting to
extract distributions once. If a distribution fails to fetch/extract
and the user doesn't want to retry, abort the installation.
brucec [Wed, 23 Jun 2010 14:11:34 +0000 (14:11 +0000)]
When installing on a machine which doesn't have a VGA card installed, enable
a getty on the serial port so that it's possible to login when the system is
rebooted.
kib [Wed, 23 Jun 2010 12:17:13 +0000 (12:17 +0000)]
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.
kib [Wed, 23 Jun 2010 11:21:19 +0000 (11:21 +0000)]
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.
kib [Wed, 23 Jun 2010 11:12:58 +0000 (11:12 +0000)]
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.
kib [Wed, 23 Jun 2010 10:40:28 +0000 (10:40 +0000)]
Remove unused i586 optimized bcopy/bzero/etc implementations that utilize
FPU registers for copying. Remove the switch table and jumps from
bcopy/bzero/... to the actual implementation.
As a side-effect, i486-optimized bzero is removed.
thompsa [Tue, 22 Jun 2010 21:16:18 +0000 (21:16 +0000)]
- fix for USB audio devices which use the 7-byte endpoint descriptor instead of
the 9-byte one.
- remove sync-endpoint code, which is currently unused.
Reported by: Antun Matanovi
Submitted by: Hans Petter Selasky
thompsa [Tue, 22 Jun 2010 21:13:36 +0000 (21:13 +0000)]
Reduce MIDI input buffer size to one USB packet, hence some USB devices don't
properly short terminate their transfers. This fixes a problem where input
appears several seconds late.
Reported by: Alexander Yerenkow
Submitted by: Hans Petter Selasky