dragonfly.git
11 years agoudevd(8): Reduce the scope of a yet unused variable.
Sascha Wildner [Sat, 20 Oct 2012 08:49:14 +0000 (10:49 +0200)]
udevd(8): Reduce the scope of a yet unused variable.

11 years agonewfs(8): Remove an unused variable.
Sascha Wildner [Sat, 20 Oct 2012 08:39:26 +0000 (10:39 +0200)]
newfs(8): Remove an unused variable.

Found-by: gcc47
11 years agomount{,_ufs}(8): Check for mountctl() error before printing buf.
Sascha Wildner [Sat, 20 Oct 2012 08:18:27 +0000 (10:18 +0200)]
mount{,_ufs}(8): Check for mountctl() error before printing buf.

11 years agokernel - Fix UP build for usched_dfly
Matthew Dillon [Fri, 19 Oct 2012 20:26:45 +0000 (13:26 -0700)]
kernel - Fix UP build for usched_dfly

* Fix UP build for usched_dfly (primarily for the 3.2 release, UP is being
  removed post-release).

11 years agorshd(8): Add an error check for getnameinfo().
Sascha Wildner [Fri, 19 Oct 2012 19:22:23 +0000 (21:22 +0200)]
rshd(8): Add an error check for getnameinfo().

11 years agokernel - Detect edge cases in ELF note handling
Matthew Dillon [Fri, 19 Oct 2012 17:41:01 +0000 (10:41 -0700)]
kernel - Detect edge cases in ELF note handling

* Do more stringent tests on ELF note structures and headers to
  avoid possible panics on page-crossings.

* Patch constructed from examination of a similar fix made to FreeBSD
  cvs/1.227.  However, our patch is written a different way.

Reported-by: Lukasz Wojcik <lukasz.wojcik@zoho.com>
11 years agoRevert a few additions of __unused that need some more thought.
Sascha Wildner [Fri, 19 Oct 2012 15:47:17 +0000 (17:47 +0200)]
Revert a few additions of __unused that need some more thought.

We can postpone it until WARNS gets raised to 4 (at the moment, all
this stuff is WARNS = 2).

11 years agoRevert some no longer needed local CFLAGS modifications.
Sascha Wildner [Fri, 19 Oct 2012 08:49:34 +0000 (10:49 +0200)]
Revert some no longer needed local CFLAGS modifications.

11 years agocrypto: Revert some changes in contributed code.
Sascha Wildner [Fri, 19 Oct 2012 08:47:11 +0000 (10:47 +0200)]
crypto: Revert some changes in contributed code.

11 years agoMove gcc47's -Wunused-but-set-{parameter,variable} to WARNS >= 4.
Sascha Wildner [Fri, 19 Oct 2012 08:43:55 +0000 (10:43 +0200)]
Move gcc47's -Wunused-but-set-{parameter,variable} to WARNS >= 4.

It's not really important stuff that they uncover.

Also, -Wunused-parameter is added at >= 4 too.

11 years agondis_events(8): Check a read().
Sascha Wildner [Fri, 19 Oct 2012 07:36:36 +0000 (09:36 +0200)]
ndis_events(8): Check a read().

Found-by: gcc47
11 years agolibstdc++47: Rework to prevent regeneration during install
John Marino [Fri, 19 Oct 2012 07:15:22 +0000 (09:15 +0200)]
libstdc++47: Rework to prevent regeneration during install

The installincludes target regenerated files such as c++config.h during
the install phase.  It may be a minor bug as "bits/c++config.h:" would
trigger it but "c++config.h:" without the subdirectory wouldn't.  In any
case, generating it and two other headers to the local working bits
directory wasn't necessary as installincludes target installs them in an
accessible location.  Reworking the makefiles prevents a write operation
during installworld.

Reported-by: dillon
11 years agoIPXrouted(8): Oops removed too much in the last commit.
Sascha Wildner [Thu, 18 Oct 2012 22:54:03 +0000 (00:54 +0200)]
IPXrouted(8): Oops removed too much in the last commit.

11 years ago<bsd.sys.mk>: Rename -W to -Wextra.
Sascha Wildner [Thu, 18 Oct 2012 22:30:13 +0000 (00:30 +0200)]
<bsd.sys.mk>: Rename -W to -Wextra.

-Wextra is a newer name and it is a bit more descriptive.

While here, break a long line.

11 years agowatchdogd(8): Silence a warning differently.
Sascha Wildner [Thu, 18 Oct 2012 22:13:41 +0000 (00:13 +0200)]
watchdogd(8): Silence a warning differently.

Also satisfies -Wunused-but-set-parameter.

Found-by: gcc47
11 years agokernel/x86_64: In pmap_enter(), entry is, in fact, used.
Sascha Wildner [Thu, 18 Oct 2012 15:53:36 +0000 (17:53 +0200)]
kernel/x86_64: In pmap_enter(), entry is, in fact, used.

11 years agomptable(8): Remove an unused variable.
Sascha Wildner [Thu, 18 Oct 2012 13:36:07 +0000 (15:36 +0200)]
mptable(8): Remove an unused variable.

Found-by: gcc47
11 years agoinetd(8): Fix initialization of se_rpc_{low,high}vers.
Sascha Wildner [Thu, 18 Oct 2012 13:35:08 +0000 (15:35 +0200)]
inetd(8): Fix initialization of se_rpc_{low,high}vers.

Found-by: gcc47
11 years agofwcontrol(8): f_cycle is only used in #if 0'd code, so #if 0 it too.
Sascha Wildner [Thu, 18 Oct 2012 13:34:20 +0000 (15:34 +0200)]
fwcontrol(8): f_cycle is only used in #if 0'd code, so #if 0 it too.

Found-by: gcc47
11 years agoIPXrouted(8): Remove dead code, DragonFly has RTM_ADD.
Sascha Wildner [Thu, 18 Oct 2012 13:32:19 +0000 (15:32 +0200)]
IPXrouted(8): Remove dead code, DragonFly has RTM_ADD.

11 years agoypxfr(8): Use the correct enum member for checking yp_errno.
Sascha Wildner [Thu, 18 Oct 2012 12:56:38 +0000 (14:56 +0200)]
ypxfr(8): Use the correct enum member for checking yp_errno.

Revert local CFLAGS, too.

Found-by: gcc47
11 years agoyppoll(8): Comment out -h option.
Sascha Wildner [Thu, 18 Oct 2012 12:30:27 +0000 (14:30 +0200)]
yppoll(8): Comment out -h option.

The implementation of it is missing (see e.g. NetBSD or OpenBSD). Until
someone works on it, comment out the existing code to silence a warning
about 'hostname' being set but unused.

Found-by: gcc47
11 years agoldconfig(8): Remove -s from usage(), too.
Sascha Wildner [Thu, 18 Oct 2012 12:22:38 +0000 (14:22 +0200)]
ldconfig(8): Remove -s from usage(), too.

11 years agomake(1): Use an inline function instead of a macro for Lst_Valid().
Sascha Wildner [Thu, 18 Oct 2012 12:03:04 +0000 (14:03 +0200)]
make(1): Use an inline function instead of a macro for Lst_Valid().

This gives -Waddress something to test even if the address of a local
variable is passed.

Remove local CFLAGS and put back under -Werror.

11 years agoSync zoneinfo database with tzdata2012g from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Thu, 18 Oct 2012 06:45:59 +0000 (08:45 +0200)]
Sync zoneinfo database with tzdata2012g from ftp://ftp.iana.org/tz/releases

* asia (Asia/Gaza, Asia/Hebron): Fall transition was Sep 21, not Sep 28.
    Thanks to Steffen Thorsen for this.

* australasia (Pacific/Apia): New DST rules for Western Samoa.
    Thanks to Nicholas Pereira for the heads-up and to Robert Elz
    for coding up the rules.

11 years agondiscvt(8): Unbreak build.
Sascha Wildner [Wed, 17 Oct 2012 20:51:15 +0000 (22:51 +0200)]
ndiscvt(8): Unbreak build.

11 years agocompilers.conf: Add -Wno-unknown-warning-option for clang.
Sascha Wildner [Wed, 17 Oct 2012 16:15:54 +0000 (18:15 +0200)]
compilers.conf: Add -Wno-unknown-warning-option for clang.

When compiling with clang, add -Wno-unknown-warning-option to silence
warnings about unknown warning options. We'll not maintain compatibility
for warning options in our wrapper.

Reported-by: Joris Giovannangeli <joris@giovannangeli.fr>
11 years agoRemove more unused variables in userland.
Sascha Wildner [Wed, 17 Oct 2012 16:08:46 +0000 (18:08 +0200)]
Remove more unused variables in userland.

Found-by: gcc47
11 years agosnd/hda: Restore the magic register setting to enable cache snooping
Sepherosa Ziehau [Wed, 17 Oct 2012 13:22:59 +0000 (21:22 +0800)]
snd/hda: Restore the magic register setting to enable cache snooping

It looks like certain chips ignore NOSNOOP settings in PCIe device
control configuration register.  Restore the magic register setting
to enable cache snooping.

Reported-by: many
Tested-by: Goetz Isenmann <info@goetz-isenmann.de>
11 years agovinum(8): Remove some unused variables.
Sascha Wildner [Tue, 16 Oct 2012 10:41:43 +0000 (12:41 +0200)]
vinum(8): Remove some unused variables.

Found-by: gcc47
11 years agogrowfs(8): Remove an unused variable.
Sascha Wildner [Tue, 16 Oct 2012 09:44:53 +0000 (11:44 +0200)]
growfs(8): Remove an unused variable.

Found-by: gcc47
11 years agorcs(1): Remove an unused variable.
Sascha Wildner [Tue, 16 Oct 2012 09:19:46 +0000 (11:19 +0200)]
rcs(1): Remove an unused variable.

Found-by: gcc47
11 years agoloader(8): Remove an unused variable.
Sascha Wildner [Tue, 16 Oct 2012 08:50:40 +0000 (10:50 +0200)]
loader(8): Remove an unused variable.

Found-by: gcc47
11 years agofsirand(8): Remove an unused variable.
Sascha Wildner [Tue, 16 Oct 2012 08:16:22 +0000 (10:16 +0200)]
fsirand(8): Remove an unused variable.

Found-by: gcc47
11 years agoldconfig(8): Make -s a no-op.
Sascha Wildner [Tue, 16 Oct 2012 08:08:33 +0000 (10:08 +0200)]
ldconfig(8): Make -s a no-op.

The functionality of -s was removed in a369de1639fc. Also comment it out
in the manpage, but leave the option for compatibility.

Found-by: gcc47
11 years agoffsinfo(8): Remove an unused variable.
Sascha Wildner [Tue, 16 Oct 2012 08:01:27 +0000 (10:01 +0200)]
ffsinfo(8): Remove an unused variable.

Found-by: gcc47
11 years agocryptdisks(8): The 'ok' variable is only needed in #ifdef DEBUG.
Sascha Wildner [Tue, 16 Oct 2012 07:58:08 +0000 (09:58 +0200)]
cryptdisks(8): The 'ok' variable is only needed in #ifdef DEBUG.

Found-by: gcc47
11 years agoccdconfig(8): Remove some unused variables.
Sascha Wildner [Tue, 16 Oct 2012 07:53:02 +0000 (09:53 +0200)]
ccdconfig(8): Remove some unused variables.

Found-by: gcc47
11 years agocamcontrol(8): Remove some unused variables.
Sascha Wildner [Tue, 16 Oct 2012 07:48:42 +0000 (09:48 +0200)]
camcontrol(8): Remove some unused variables.

Found-by: gcc47
11 years agousched_set.2: Mention usched(8).
Sascha Wildner [Tue, 16 Oct 2012 06:49:09 +0000 (08:49 +0200)]
usched_set.2: Mention usched(8).

11 years agousched(8): Add a minimal manual page.
Sascha Wildner [Tue, 16 Oct 2012 06:48:06 +0000 (08:48 +0200)]
usched(8): Add a minimal manual page.

11 years agousched(8): #if 0 out some (yet) unused code.
Sascha Wildner [Tue, 16 Oct 2012 06:47:26 +0000 (08:47 +0200)]
usched(8): #if 0 out some (yet) unused code.

Found-by: gcc47
11 years agotcplay(3): The 'ok' variable is only needed in #ifdef DEBUG.
Sascha Wildner [Tue, 16 Oct 2012 05:00:32 +0000 (07:00 +0200)]
tcplay(3): The 'ok' variable is only needed in #ifdef DEBUG.

Found-by: gcc47
11 years agoreboot(8): Remove an unused variable.
Sascha Wildner [Tue, 16 Oct 2012 04:38:14 +0000 (06:38 +0200)]
reboot(8): Remove an unused variable.

Found-by: gcc47
11 years agorcorder(8): Whitespace fix.
Sascha Wildner [Tue, 16 Oct 2012 04:36:35 +0000 (06:36 +0200)]
rcorder(8): Whitespace fix.

11 years agomonitor(1): Check kevent().
Sascha Wildner [Tue, 16 Oct 2012 04:36:09 +0000 (06:36 +0200)]
monitor(1): Check kevent().

Found-by: gcc47
11 years agodfregress(8): Check prop_dictionary_get_uint32()'s return value.
Sascha Wildner [Tue, 16 Oct 2012 02:59:08 +0000 (04:59 +0200)]
dfregress(8): Check prop_dictionary_get_uint32()'s return value.

Consistent with the rest of the file.

Found-by: gcc47
11 years agobrandelf(1): Make -v a no-op.
Sascha Wildner [Tue, 16 Oct 2012 02:51:22 +0000 (04:51 +0200)]
brandelf(1): Make -v a no-op.

-v never did anything, so remove the verbose variable and comment it out
in the manpage, but leave the option for compatibility.

Found-by: gcc47
11 years agoAdd dragonfly.vim, for changing vim indentation rules to match style(9).
Sascha Wildner [Mon, 15 Oct 2012 07:16:38 +0000 (09:16 +0200)]
Add dragonfly.vim, for changing vim indentation rules to match style(9).

Assuming it works, haven't personally used it.

Taken-from: FreeBSD

11 years agoUpdate the pciconf(8) database.
Sascha Wildner [Mon, 15 Oct 2012 06:58:31 +0000 (08:58 +0200)]
Update the pciconf(8) database.

October 14, 2012 snapshot from http://pciids.sourceforge.net/

11 years agocompilers.conf.5: Some more cleanup.
Sascha Wildner [Sun, 14 Oct 2012 08:34:36 +0000 (10:34 +0200)]
compilers.conf.5: Some more cleanup.

* Remove a reference to an old patch I did for building world with clang.
  The changes which are currently needed remain to be determined.

* Make the examples more generic and indicate that buildworld/kernel
  do not necessarily survive with the compilers listed. Also, stuff them
  into an EXAMPLES section.

* Add a comma.

Reported-by: Carsten Mattner <carstenmattner@gmail.com>
11 years agovkernel - Adjust parameters for vkernel test build
Matthew Dillon [Sat, 13 Oct 2012 17:22:02 +0000 (10:22 -0700)]
vkernel - Adjust parameters for vkernel test build

* Increase root partition from 512M to 2G to accomodate DEBUG_FLAGS=-g
  kernels.

* Increase default memory from 128M to 256M

* Create the /var/vkernel directory if necessary.

11 years agokernel - Fix sysclock_t comparison in usched code
Matthew Dillon [Sat, 13 Oct 2012 17:11:43 +0000 (10:11 -0700)]
kernel - Fix sysclock_t comparison in usched code

* Fix a sysclock_t comparison that was attempting to detect an overflow
  by checking if an unsigned field was negative.  The field has
  to be cast to signed for the test to work as expected.

Reported-by: enjolras
11 years agoHAMMER VFS - Use full-block undos for B-Tree nodes
Matthew Dillon [Sat, 13 Oct 2012 17:03:03 +0000 (10:03 -0700)]
HAMMER VFS - Use full-block undos for B-Tree nodes

* Use a full-block undos instead of small byte-range undos for
  B-Tree nodes.

  There is no bug here per-say, but we are trying to improve
  HAMMER's ability to recover after a power failure where a disk
  drive is writing to the platter at the time of the failure.
  While we have no control over any unrelated sectors that might
  get smashed by such an event, the concern is that sectors being
  specifically written might get corrupted beyond the ability for
  the byte-range undo to fix.

  The reason is that if, say, only 50 bytes in a B-Tree node need
  updating, HAMMER must still do a 16K physical write to disk, so
  really any portion of that 16K can wind up corrupt on a power
  failure, not just the 50 bytes being changed.

  So instead of writing a byte-ranged 50-byte UNDO we now write
  a 16K undo for B-Tree elements.

* The hope is that this will improve cases where HAMMER has become
  unmountable due to CRC errors in the B-Tree closer to the root of
  the B-Tree (which are usually updated to update only the mirror_tid)

Reported-by: sgeorge, marino
11 years agomake device_probe_child() public
Tim [Tue, 25 Jan 2011 05:29:55 +0000 (21:29 -0800)]
make device_probe_child() public

11 years agocompilers.conf.5: Remove docs about *_VERSION, it no longer exists.
Sascha Wildner [Sat, 13 Oct 2012 05:53:04 +0000 (07:53 +0200)]
compilers.conf.5: Remove docs about *_VERSION, it no longer exists.

11 years agosleep.9: Really write PINTERLOCKED in the example.
Sascha Wildner [Fri, 12 Oct 2012 19:38:50 +0000 (21:38 +0200)]
sleep.9: Really write PINTERLOCKED in the example.

Reported-by: vsrinivas
11 years agosleep.9: s/PINTERLOCK/PINTERLOCKED/
Sascha Wildner [Fri, 12 Oct 2012 19:27:22 +0000 (21:27 +0200)]
sleep.9: s/PINTERLOCK/PINTERLOCKED/

11 years agocustomcc/compilers.conf: Some adjustments and simplifications.
Sascha Wildner [Fri, 12 Oct 2012 08:57:12 +0000 (10:57 +0200)]
customcc/compilers.conf: Some adjustments and simplifications.

* pkgsrc's clang no longer needs special handling for C++ compilation.

* Use gcc44's cpp, gcc41 is gone.

* -dumpversion is now understool by both pkgsrc's and SVN trunk's
  clang, so no special handling needed for that either.

Based on an older patch I did with Juan Francisco a year ago.

Reported-by: Juan Francisco Cantero Hurtado <iam@juanfra.info>
               Joris Giovannangeli <joris@giovannangeli.fr>
Tested-by: Joris Giovannangeli <joris@giovannangeli.fr>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2205>

11 years agokernel: Some adjustments for the GCC 4.1 removal in Makefiles.
Sascha Wildner [Fri, 12 Oct 2012 08:16:20 +0000 (10:16 +0200)]
kernel: Some adjustments for the GCC 4.1 removal in Makefiles.

11 years agoUPDATING: Some words about GCC 4.7.
Sascha Wildner [Fri, 12 Oct 2012 08:12:57 +0000 (10:12 +0200)]
UPDATING: Some words about GCC 4.7.

11 years agocompilers.conf.5: We only describe non-base compilers here.
Sascha Wildner [Fri, 12 Oct 2012 07:53:20 +0000 (09:53 +0200)]
compilers.conf.5: We only describe non-base compilers here.

"gcc47" is no longer handled via compilers.conf.

11 years agoMakefile_upgrade.inc: Adjust modules path.
Sascha Wildner [Fri, 12 Oct 2012 05:00:48 +0000 (07:00 +0200)]
Makefile_upgrade.inc: Adjust modules path.

This can be helpful in cases where old modules for some reason
had not been cleaned when the location was still /boot/modules
and have ended up getting objcopy'd to /boot/kernel after the
location was changed.

11 years agokernel - Fix i386 pmap bug
Matthew Dillon [Thu, 11 Oct 2012 21:34:09 +0000 (14:34 -0700)]
kernel - Fix i386 pmap bug

* mpte will be NULL for KVM page table pages, there is no need to track
  the wire count.  Conditionalize-out the unwiring call.

* This is believed to be (this time for sure to the third power!) the
  PG_BUSY crash that vsrinivas was getting on i386 related to paging
  in a swapped kernel pipe buffer.

11 years agokernel - Make pcb_onfault more robust.
Matthew Dillon [Thu, 11 Oct 2012 19:12:25 +0000 (12:12 -0700)]
kernel - Make pcb_onfault more robust.

* Record the expected kernel stack pointer along with the pcb_onfault
  action.  Adjust the trap code to only take the action if the frame's
  stack pointer matches the recorded expected stack pointer.

  Otherwise this might be a recursive trap and we definitely do NOT want
  to execute the on-fault stuff in that situation.

* Prior to these changes recursive traps during uiomove()s could result
  in a kernel stack so corrupt that finding the actual cause of the panic
  becomes impossible.  This is believed to be making life difficult for us
  trying to track down a particular i386 panic.

* On x86-64 we had to increase the size of the pcb structure.  kgdb on
  kernel cores and live kernels will be effected (needs recompile).

11 years agotop - Use RES by default instead of PRES
Matthew Dillon [Thu, 11 Oct 2012 15:36:45 +0000 (08:36 -0700)]
top - Use RES by default instead of PRES

* The kernel support for PRES was removed during the SMP fine-grained
  locking work on the VM system last year so top was reporting 0K for
  everything.  Change top to go back to RES.

11 years agoacpi/pstate: Be lenient about wrong # of processors in the power domain
Sepherosa Ziehau [Thu, 11 Oct 2012 06:54:52 +0000 (14:54 +0800)]
acpi/pstate: Be lenient about wrong # of processors in the power domain

Some stupid BIOSes seem to consider two logic CPUs (hyperthreading) as
one CPU.  Don't bail out; just print some error messages.

Reported-by: dillon@
11 years agokernel - Use atomic op for usched_global_cpumask
Matthew Dillon [Thu, 11 Oct 2012 06:43:03 +0000 (23:43 -0700)]
kernel - Use atomic op for usched_global_cpumask

* Use atomic op for usched_global_cpumask in the cpu init code.  This
  code is serialized anyway, I think, but it is best to be safe.

* Add cpu_ccfence() to ensure that the compiler does not reorder the
  clearing of the mask in the cpusync code.

11 years agokernel - Remove debugging from i386 pmap
Matthew Dillon [Wed, 10 Oct 2012 23:43:57 +0000 (16:43 -0700)]
kernel - Remove debugging from i386 pmap

* Remove i386 pmap debugging kprintf.

11 years agokernel - Add MODULE_VERSION for if_ale
Matthew Dillon [Wed, 10 Oct 2012 23:36:19 +0000 (16:36 -0700)]
kernel - Add MODULE_VERSION for if_ale

* Seems to solve boot-time lockup when if_ale is built into the kernel
  AND also specified in /boot/loader.conf

* Related issues now being reviewed by swildner

11 years agokernel - Probable fix to vm_fault: PG_BUSY panic on i386
Matthew Dillon [Wed, 10 Oct 2012 21:47:57 +0000 (14:47 -0700)]
kernel - Probable fix to vm_fault: PG_BUSY panic on i386

* The info structure for the pmap_inval*() API is only initialized
  conditionally as an optimization.

* There was a case where the info structure was being used without
  first being initialized which matches reported panics (essentially
  a pipe buffer page in kernel memory is swapped out and the faulted back
  in during a uiomove).

Reported-by: vsrinivas, marino, several others
11 years agokernel - Fix missing LWKT token init in linprocfs
Matthew Dillon [Wed, 10 Oct 2012 20:24:59 +0000 (13:24 -0700)]
kernel - Fix missing LWKT token init in linprocfs

* Fix missing LWKT token init in linprocfs.  linprocfs_init() was not
  being called.

Reported-by: marino
11 years agoMerge branch 'DragonFly_RELEASE_3_2' of ssh://crater.dragonflybsd.org/repository...
Justin C. Sherrill [Wed, 10 Oct 2012 02:44:26 +0000 (22:44 -0400)]
Merge branch 'DragonFly_RELEASE_3_2' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into DragonFly_RELEASE_3_2

11 years agoPoint the pkgsrc make targets at newest quarterly release.
Justin C. Sherrill [Wed, 10 Oct 2012 02:43:14 +0000 (22:43 -0400)]
Point the pkgsrc make targets at newest quarterly release.
I'm building packages to match now too.

11 years ago<sys/param.h>: Fix wrongly merged comments on the release branch.
Sascha Wildner [Tue, 9 Oct 2012 20:47:57 +0000 (22:47 +0200)]
<sys/param.h>: Fix wrongly merged comments on the release branch.

11 years agoBranching 3.2/3.3. v3.2.0
Justin C. Sherrill [Tue, 9 Oct 2012 03:27:30 +0000 (23:27 -0400)]
Branching 3.2/3.3.

11 years agokernel - Fix UP build for usched_dfly.c
Matthew Dillon [Tue, 9 Oct 2012 00:56:09 +0000 (17:56 -0700)]
kernel - Fix UP build for usched_dfly.c

* Fix UP build errors

Reported-by: multiple
11 years agovkernel - Properly initialize pool tokens.
Antonio Huete Jimenez [Mon, 8 Oct 2012 14:28:20 +0000 (16:28 +0200)]
vkernel - Properly initialize pool tokens.

 * There was no call to init_locks() in vkernel's initialization
   code, so provide one.

 * As pool tokens weren't initialized, the attempt to copy its
   t_desc in lwkt_getalltokens() resulted in a panic. This should
   be fixed now.

 * Add a KASSERT() so that uninitialized tokens will panic the system.

Suggested by: swildner

11 years agokmalloc.9: Document M_POWEROF2.
Sascha Wildner [Mon, 8 Oct 2012 12:53:28 +0000 (14:53 +0200)]
kmalloc.9: Document M_POWEROF2.

11 years agokmalloc: Use 'fls' to round up the size to the nearest power of 2
Sepherosa Ziehau [Mon, 8 Oct 2012 12:14:56 +0000 (20:14 +0800)]
kmalloc: Use 'fls' to round up the size to the nearest power of 2

On average tests conducted on Intel i3, i7 and xeon-e3 in x86_64 mode,
fls version is 3 times faster than the simple loop version.

Submitted-by: vsrinivas@
Also M_POWEROF2 flag is used to do the nearest power of 2 size rounding
up, instead of a seperate function (was kmalloc_powerof2)

Suggested-by: sjg@, vsrinivas@
11 years agolibgcc.a47: build with -fpic
John Marino [Sun, 7 Oct 2012 17:34:31 +0000 (19:34 +0200)]
libgcc.a47: build with -fpic

The vendor makefile builds libgcc.a with the PIC flag.  The x86_64
platform needs it for packages that need need to link to libgcc.a

11 years agobuild - Unbreak world
Matthew Dillon [Sun, 7 Oct 2012 23:39:37 +0000 (16:39 -0700)]
build - Unbreak world

* Fix issue w/ last commit

Submitted-by: marino
11 years agoUse GCC's builtin offset_of as the first option
John Marino [Sun, 7 Oct 2012 21:27:36 +0000 (23:27 +0200)]
Use GCC's builtin offset_of as the first option

Other than C++ code, the GCC offsetof builtin was never getting used.
The version that did get expanded could not be used for array
declarations on GCC 4.5 and later because it wasn't considered a
constant expression by those later GCC compilers.

The first symptom was seen when building world with GCC 4.6, but the
the offsetof expansion was finally identified as the cause of the
problem while discussion PostgreSQL 9.1 build failures on DragonFly.
Since DragonFly was the only platform exibiting the behavior, the
problem was narrowed down to the offsetof macro or the compiler itself.
Fixing the macro allowed the unpatched pgsql to compile.

Thanks-to: Tom Lane

11 years agoifpoll: Utilize kmalloc_cachealign()
Sepherosa Ziehau [Sun, 7 Oct 2012 06:14:22 +0000 (14:14 +0800)]
ifpoll: Utilize kmalloc_cachealign()

11 years agobusdma: Panic if the kmalloc_powerof2() fails to meet the dma requirement
Sepherosa Ziehau [Sun, 7 Oct 2012 04:53:42 +0000 (12:53 +0800)]
busdma: Panic if the kmalloc_powerof2() fails to meet the dma requirement

11 years agobusdma: Utilize kmalloc_powerof2()
Sepherosa Ziehau [Sun, 7 Oct 2012 04:40:57 +0000 (12:40 +0800)]
busdma: Utilize kmalloc_powerof2()

11 years agoigb: Use kmalloc_cachealign to allocate rx ring, tx ring and msix data
Sepherosa Ziehau [Sun, 7 Oct 2012 04:22:35 +0000 (12:22 +0800)]
igb: Use kmalloc_cachealign to allocate rx ring, tx ring and msix data

11 years agokmalloc: Add kmalloc_powerof2() and kmalloc_cachealign()
Sepherosa Ziehau [Sun, 7 Oct 2012 04:14:52 +0000 (12:14 +0800)]
kmalloc: Add kmalloc_powerof2() and kmalloc_cachealign()

kmalloc_powerof2()
    Ensures that the returned address will be power of 2 aligned.

kmalloc_cachealign()
    Ensures that the returned address will be cacheline size aligned.
    It is useful to allocate structs declared with __cachealign
    attribute.

These two function probably should _not_ be used on the hot code path
due to the computational cost to find the nearest power of 2 size.

11 years agoigb: Cache align msix, rx and tx data
Sepherosa Ziehau [Sat, 6 Oct 2012 15:03:22 +0000 (23:03 +0800)]
igb: Cache align msix, rx and tx data

11 years agoigb: Remove unused code
Sepherosa Ziehau [Sat, 6 Oct 2012 15:02:52 +0000 (23:02 +0800)]
igb: Remove unused code

11 years agoigb: Change polling(4) support to ifpoll support
Sepherosa Ziehau [Sat, 6 Oct 2012 10:59:50 +0000 (18:59 +0800)]
igb: Change polling(4) support to ifpoll support

For 82576, this means that all of the 16 RX rings could be enabled
and fully utilized; even in MSI-X mode, only 8 RX rings could be
used.

11 years agokernel/ixgbe: Remove double definition.
Sascha Wildner [Sat, 6 Oct 2012 13:03:29 +0000 (15:03 +0200)]
kernel/ixgbe: Remove double definition.

11 years agoixgbe: Define missing DEBUGOUT# macros.
François Tigeot [Sat, 6 Oct 2012 09:27:28 +0000 (11:27 +0200)]
ixgbe: Define missing DEBUGOUT# macros.

DEBUGOUT[45] are not yet used but are being defined pre-emptively
to avoid future build breakage

Obtained-from: FreeBSD

11 years agokernel/hammer: Staticize hammer_skip_redo.
Sascha Wildner [Sat, 6 Oct 2012 10:14:45 +0000 (12:14 +0200)]
kernel/hammer: Staticize hammer_skip_redo.

It's just used in hammer_recover.c.

11 years agore: Don't enable MSI by default
Sepherosa Ziehau [Sat, 6 Oct 2012 10:00:45 +0000 (18:00 +0800)]
re: Don't enable MSI by default

11 years agoigb: Initialize if_name so functions used on if_init could use if_printf
Sepherosa Ziehau [Sat, 6 Oct 2012 09:45:08 +0000 (17:45 +0800)]
igb: Initialize if_name so functions used on if_init could use if_printf

11 years agoRemove some more GCC 4.1 specific files via 'make upgrade'.
Sascha Wildner [Fri, 5 Oct 2012 13:56:03 +0000 (15:56 +0200)]
Remove some more GCC 4.1 specific files via 'make upgrade'.

11 years agore(4): Use MSI if device supports it.
Tim Bisson [Mon, 19 Mar 2012 02:39:37 +0000 (19:39 -0700)]
re(4): Use MSI if device supports it.

RT8168E supports MSI.

11 years agokernel - Acquire vm_token in pmap_remove_all() (3)
Matthew Dillon [Fri, 5 Oct 2012 05:15:04 +0000 (22:15 -0700)]
kernel - Acquire vm_token in pmap_remove_all() (3)

* Correct bug in last commit, resident_count adjustment has to be
  moved past the revalidation.

11 years agokernel - Acquire vm_token in pmap_remove_all() (2)
Matthew Dillon [Fri, 5 Oct 2012 05:09:30 +0000 (22:09 -0700)]
kernel - Acquire vm_token in pmap_remove_all() (2)

* Remove this, the token is already acquired in all pmap_remove_all()
  paths.

* Instead, try catching the problem in pmap_remove_all(m) by re-validating
  the pv_entry (essentially detecting a removal race).