8 years agoRemove the old (and broken) kzip(8) utility.
Sascha Wildner [Sat, 10 Mar 2012 08:57:49 +0000 (09:57 +0100)]
Remove the old (and broken) kzip(8) utility.

8 years agokgzip(8) is i386 only, so stop building/installing on x86_64.
Sascha Wildner [Sat, 10 Mar 2012 08:53:08 +0000 (09:53 +0100)]
kgzip(8) is i386 only, so stop building/installing on x86_64.

8 years agosvc_vc_create(3): Initialize xprt with NULL.
Sascha Wildner [Sat, 10 Mar 2012 08:27:36 +0000 (09:27 +0100)]
svc_vc_create(3): Initialize xprt with NULL.

In the (corner-)case of being out of memory, this prevents free() to be
called on an uninitialized xprt below the cleanup_svc_vc_create: label.

8 years agokernel: fixup accidental whitespace shift in vm_fault_copy_entry commit
Chris Turner [Fri, 9 Mar 2012 21:31:19 +0000 (21:31 +0000)]
kernel: fixup accidental whitespace shift in vm_fault_copy_entry commit

was resulting in cherry-pick conflicts in MFC branch

8 years agokernel: reorganize new holds in vm_fault_copy_entry
Chris Turner [Fri, 9 Mar 2012 20:57:42 +0000 (20:57 +0000)]
kernel: reorganize new holds in vm_fault_copy_entry

Move holds outside of the pagecopy loop to reduce locking overhead.

Suggested-by: dillon
8 years agokernel: add missing holds/drops to vm_fault_copy_entry
Chris Turner [Fri, 9 Mar 2012 20:34:46 +0000 (20:34 +0000)]
kernel: add missing holds/drops to vm_fault_copy_entry

Add missing holds/drops to vm_fault_copy_entry that were triggering
assertions in vm_page_alloc/vm_page_lookup when when a process
holding locked memory is forked.

Fixes: https://bugs.dragonflybsd.org/issues/2320
Reviewed-by: vsrinavas
X-Nahmean-Status: word

8 years agosetnetpath(3): Fix a double free().
Sascha Wildner [Fri, 9 Mar 2012 17:29:51 +0000 (18:29 +0100)]
setnetpath(3): Fix a double free().

np_sessionp is free()'d after the failed: label.

8 years agoUpdate the pciconf(8) database.
Sascha Wildner [Fri, 9 Mar 2012 17:05:53 +0000 (18:05 +0100)]
Update the pciconf(8) database.

Feb 27, 2012 snapshot from http://pciids.sourceforge.net/

8 years agolibalias(3): Bring in some fixes from FreeBSD.
Sascha Wildner [Fri, 9 Mar 2012 10:57:17 +0000 (11:57 +0100)]
libalias(3): Bring in some fixes from FreeBSD.

It fixes the "dereferencing pointer 'sptr' does break strict-aliasing
rules" warnings which -O2 was generating.

Submitted-by: Aycan iRiCAN <iricanaycan@gmail.com>
8 years agoHAMMER VFS: Conditionalize debug message
Matthew Dillon [Fri, 9 Mar 2012 06:04:10 +0000 (22:04 -0800)]
HAMMER VFS: Conditionalize debug message

* Conditionalize an annoying debug kprintf on hammer_debug_inode.

8 years agortld: fix debug statement
John Marino [Thu, 8 Mar 2012 18:21:34 +0000 (19:21 +0100)]
rtld: fix debug statement

This bug showed only when rtld is built with -DENABLE_DEBUG.

8 years agokernel: Add a few forgotten crit_exit()s and fix a wrong crit_enter().
Sascha Wildner [Wed, 7 Mar 2012 18:19:33 +0000 (19:19 +0100)]
kernel: Add a few forgotten crit_exit()s and fix a wrong crit_enter().

8 years agoInstaller: one more place where inform() called without a format string
YONETANI Tomokazu [Wed, 7 Mar 2012 15:01:15 +0000 (00:01 +0900)]
Installer: one more place where inform() called without a format string

Noticed-by: swildner@
8 years agoInstaller: fix a (possible) crash in show_ifconfig()
YONETANI Tomokazu [Wed, 7 Mar 2012 15:01:15 +0000 (00:01 +0900)]
Installer: fix a (possible) crash in show_ifconfig()

inform() expects a printf-like format string as the second argument,
so you should always supply one instead of a random string by itself.

DragonFly-bug: <http://bugs.dragonflybsd.org/issues/1596>

8 years agoAdd a coccinelle patch to find 0 (instead of NULL) used with pointers.
Sascha Wildner [Tue, 6 Mar 2012 19:13:55 +0000 (20:13 +0100)]
Add a coccinelle patch to find 0 (instead of NULL) used with pointers.

8 years agoSweep-fix comparing pointers with 0 (and assigning 0 to pointers).
Sascha Wildner [Mon, 5 Mar 2012 21:05:24 +0000 (22:05 +0100)]
Sweep-fix comparing pointers with 0 (and assigning 0 to pointers).

For better readability, don't compare pointers with 0 or assign 0
to them. Use NULL instead.

The change was done with coccinelle.

8 years agovfs_conf - remove old debug message tryroot()
Alex Hornung [Tue, 6 Mar 2012 00:32:08 +0000 (00:32 +0000)]
vfs_conf - remove old debug message tryroot()

8 years agodump_conf - delay extra 2s before looking for dumpdev
Alex Hornung [Tue, 6 Mar 2012 00:30:11 +0000 (00:30 +0000)]
dump_conf - delay extra 2s before looking for dumpdev

 * This is the same hack used for the root mount. Some disk devices will
   not be probed by CAM's initial probes.

 * We give these devices some extra time to settle and hopefully be
   ready for when we look them up.

 * This fixes the use of some CAM disk devices set via the loader dumpdev

8 years agovfsops - add two new ops, ncpgen_set, ncpgen_test
Alex Hornung [Mon, 5 Mar 2012 21:52:44 +0000 (21:52 +0000)]
vfsops - add two new ops, ncpgen_set, ncpgen_test

 * ncpgen_set takes care of setting the namecache generation in an ncp,
   while ncpgen_test can force zapping a resolved negative cache hit.

 * Make use of the functions in devfs to keep the functionality we had

 * Also pass the calls through in nullfs - this should fix a problem
   with posix_openpt when /dev is a nullfs mount of devfs.

Reported-by: Markus Pfeiffer (profmakx)
8 years agosin.3: Sort SEE ALSO alphabetically.
Sascha Wildner [Mon, 5 Mar 2012 12:47:22 +0000 (13:47 +0100)]
sin.3: Sort SEE ALSO alphabetically.

8 years agoncurses: Fix an almost 7 year old typo in the profiling libtinfo's name.
Sascha Wildner [Mon, 5 Mar 2012 10:49:27 +0000 (11:49 +0100)]
ncurses: Fix an almost 7 year old typo in the profiling libtinfo's name.

It was introduced in c4c23d9061b6eb2a3456620a48b84583b00fe0ce.

8 years agogcc44: Remove a wrong define for the profiled math library's name.
Sascha Wildner [Mon, 5 Mar 2012 10:05:48 +0000 (11:05 +0100)]
gcc44: Remove a wrong define for the profiled math library's name.

This caused compiling with -pg to fail for C++:

zoot# c++ -pg -o t t.c
/usr/libexec/binutils222/elf/ld.bfd: cannot find -lm_p

Our libraries for profiling don't have different names than the normal
ones. They just are in a different directory (/usr/lib/profile), which
is already cared for.

Reported-by: Pierre Abbat <phma@phma.optus.nu>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2325>

8 years agoUpdate 'rcrun' with a 'onestart' action to use the rc.subr 'one' functionality
Chris Turner [Sun, 4 Mar 2012 13:03:12 +0000 (13:03 +0000)]
Update 'rcrun' with a 'onestart' action to use the rc.subr 'one' functionality

For reference - the 'one' functionality differs from 'force'
as it still allows various rc.subr sanity checks to be run.

Suggested-by: swildner
8 years agoAdd 'one' behavior to rc.subr, update rc.subr.8 .
Chris Turner [Sun, 4 Mar 2012 10:43:49 +0000 (10:43 +0000)]
Add 'one' behavior to rc.subr, update rc.subr.8 .

This permits configuring / running services without
requiring *_enable in rc.conf which is handy for non-automatic

Obtained-from: NetBSD

8 years agoOops, it's kiconv and not kiconf.
Sascha Wildner [Sat, 3 Mar 2012 12:01:56 +0000 (13:01 +0100)]
Oops, it's kiconv and not kiconf.

8 years agoFix a number of incomplete/missing DPADDs.
Sascha Wildner [Sat, 3 Mar 2012 11:59:24 +0000 (12:59 +0100)]
Fix a number of incomplete/missing DPADDs.

8 years agovi(1): Remove some old tk stuff from the Makefile.
Sascha Wildner [Sat, 3 Mar 2012 11:15:25 +0000 (12:15 +0100)]
vi(1): Remove some old tk stuff from the Makefile.

8 years agosmp.4: Use .Dv for a tunable.
Sascha Wildner [Fri, 2 Mar 2012 12:42:33 +0000 (13:42 +0100)]
smp.4: Use .Dv for a tunable.

8 years agoSync zoneinfo database with tzdata2012b from munnari.oz.au
Sascha Wildner [Fri, 2 Mar 2012 09:25:53 +0000 (10:25 +0100)]
Sync zoneinfo database with tzdata2012b from munnari.oz.au

northamerica:   8.52 -> 8.53

* northamerica: Summer time in Cuba has been delayed 3 weeks (now
    starts April 1 rather than March 11). Since Mar 11 (the old
    start date, as listed in 2012a) is just a little over a week
    away, this change is urgent.

Also bump zone.tab's version for a fix that was not in 2012a but
which I already added.

8 years agortld: Add a special case in do_dlsym() for TLS stored symbols.
Sascha Wildner [Fri, 2 Mar 2012 09:15:56 +0000 (10:15 +0100)]
rtld: Add a special case in do_dlsym() for TLS stored symbols.

Submitted-by: Markus Pfeiffer <markus.pfeiffer@morphism.de>
8 years agoSync zoneinfo database with tzdata2012a from munnari.oz.au
Sascha Wildner [Thu, 1 Mar 2012 14:41:05 +0000 (15:41 +0100)]
Sync zoneinfo database with tzdata2012a from munnari.oz.au

antarctica:     8.9  -> 8.10
asia:           8.69 -> 8.70
australasia:    8.29 -> 8.30
europe:         8.40 -> 8.41
leapseconds:    8.11 -> 8.13
northamerica:   8.51 -> 8.52
README:         8.3  -> 8.4
southamerica:   8.52 -> 8.53
zone.tab:       8.52 -> 8.54

* antarctica: Current best known timezone info for various Antarctic
    bases for the winter of 2012.

* asia: Armenia has abolished summer time.

* australasia: Tokelau copied Samoa and swapped sides of the
    International Date Line last December (affects current timestams).

* europe: Updated URL for UK timezone history.

* leapseconds: Bulletin C43 incorporated (a leap Second will occur
    2012-06-30 at 23:59:60 UTC). Bulletin C42 was also incorporated
    (but never released) - it said nothing very interesting (no leap
    second 2011-12-31).

* northamerica: New zone America/Creston created for an area in
    British Columbia that was previously (and apparently incorrectly)
    considered identical to Dawson Creek. Also, some corrections to
    1918 summer time end dates in several Canadian zones.

* README: Updated to reflect the current home of the mailing list and

* southamerica: Chile has extended Summer time in the 2011/2 summer.
    Future years (2013->) are assumed revert to "normal" for now. The
    Falkland Islands now have it permanently (continuing the 2011
    experiment). This "permanently" is a guess, it apparently is
    certain for 2012 (as certain as these things ever are) and
    considered likely into the future.

* zone.tab: New America/Creston zone added, and a typo in the entry
    for Europe/Samara corrected.

8 years agoscsi_cd - don't lock tray on cdcheckmedia()
Alex Hornung [Wed, 29 Feb 2012 19:53:07 +0000 (19:53 +0000)]
scsi_cd - don't lock tray on cdcheckmedia()

 * Move the tray locking explicitly to cdopen(), so that it matches the
   unlocking in cdclose().

 * Before disk probing existed this wasn't a problem as every device was
   first opened, then operated on, then closed.

 * The disk probing code operates directly on the device, which caused
   it to be locked via cdcheckmedia() but never unlocked since no
   close() was ever called.

Reported-by: Sascha Wildner <swildner@>
8 years agoboot/loader - test if CPU supports long mode
Alex Hornung [Wed, 29 Feb 2012 15:46:48 +0000 (15:46 +0000)]
boot/loader - test if CPU supports long mode

 * Test if the CPU supports long mode (64 bits) before trying to load an
   x86_64 kernel.

Obtained-from: FreeBSD
Dragonfly-bug: http://bugs.dragonflybsd.org/issue1624

8 years agobsd-family-tree: Sync with FreeBSD.
Sascha Wildner [Wed, 29 Feb 2012 14:13:23 +0000 (15:13 +0100)]
bsd-family-tree: Sync with FreeBSD.

8 years agolibthread_xu/libc_r: Improve the check for EINVAL in sem_* functions.
Sascha Wildner [Tue, 28 Feb 2012 22:44:29 +0000 (23:44 +0100)]
libthread_xu/libc_r: Improve the check for EINVAL in sem_* functions.

Before referencing *sem->... in the check, do not just test if sem is
NULL but also if *sem is NULL.

Reported-by: Max Herrgard <herrgard@gmail.com>
8 years agoarp: Don't send gratuitous ARP in arp_ifinit
Sepherosa Ziehau [Tue, 28 Feb 2012 12:57:57 +0000 (20:57 +0800)]
arp: Don't send gratuitous ARP in arp_ifinit

- Move the CARP's ifaddr_event handler to the first of the
  registered ifaddr_event handlers.
- Register ifaddr_event handler for gratuituous ARP; it won't
  send gratuitous ARP for CARP interface or CARP interface's
  parent.  The event handler is registered as the last
  ifaddr_event handler, so it is called after CARP's ifaddr_event
  handler.  It is mainly used to fix following problem before
  this commit:

      ifconfig emx0 up
      ifconfig carp0 create
      ifconfig carp0 vhid 1
      ifconfig carp0 inet
      ifconfig emx0 inet

  Originally, you always saw gratuitous ARP from emx0 first,
  then gratuitous ARP from carp0, which is quite confusing.
  After this change, only gratuitous ARP from carp0.
- arp_ifinit() now only set ifa_rtrequest and CLONING flags
- Rename arp_iainit() to arp_gratuitous(); call it when CARP
  wants to send gratuitous ARP and when link layer address
  is changed.

8 years agokernel: Remove opt_ipfw.h from a few files which don't need it.
Sascha Wildner [Tue, 28 Feb 2012 10:49:35 +0000 (11:49 +0100)]
kernel: Remove opt_ipfw.h from a few files which don't need it.

8 years agokernel: Remove the IPFIREWALL_FORWARD option which does nothing.
Sascha Wildner [Tue, 28 Feb 2012 10:41:21 +0000 (11:41 +0100)]
kernel: Remove the IPFIREWALL_FORWARD option which does nothing.

In FreeBSD it is needed for ipfw's 'forward' action. In DragonFly,
this needs no special option.

In-discussion-with: sephe

8 years agovn - use DSO_RAWPSIZE flag
Alex Hornung [Mon, 27 Feb 2012 21:56:41 +0000 (21:56 +0000)]
vn - use DSO_RAWPSIZE flag

 * Use the DSO_RAWPSIZE flag so that the disk subsystem uses vn's own
   psize when the top level fails.

 * This allows the use of vn disks as swap.

Reported-by: Antonio Huete (tuxillo@)
8 years agodisk - add flag to use underlying psize
Alex Hornung [Mon, 27 Feb 2012 21:54:09 +0000 (21:54 +0000)]
disk - add flag to use underlying psize

 * If the top (disk subsystem) psize fails, try again with the
   underlying raw device psize if the DSO_RAWPSIZE flag is set for the

 * This allows for disk devices and slices without a proper disklabel to
   return a correct psize, which in turn allows the device to be used
   for swap.

 * Previously that behaviour was integrated with the DSO_DEVICEMAPPER

8 years agouguru(4): Fix a panic when detaching (e.g., on kldunload).
Sascha Wildner [Mon, 27 Feb 2012 19:52:26 +0000 (20:52 +0100)]
uguru(4): Fix a panic when detaching (e.g., on kldunload).

Reported-by: Max Herrgard <herrgard@gmail.com>
8 years agovnconfig - use correct device if using autoclone
Alex Hornung [Mon, 27 Feb 2012 16:47:56 +0000 (16:47 +0000)]
vnconfig - use correct device if using autoclone

 * if autoclone device (/dev/vn) is used in vnconfig, the wrong device
   is later passed to, e.g., swapon().

 * Fix it by changing the device name the rest of vnconfig
   operates on to the actual device name as per fdevname.

Reported-by: tuxillo
8 years agosubr_disk - clear out old labels
Alex Hornung [Mon, 27 Feb 2012 12:53:38 +0000 (12:53 +0000)]
subr_disk - clear out old labels

 * Whenever a label is blown out and we reprobe, make sure we also clean
   the in-memory disklabel inside the diskslice - otherwise dscheck()
   will think that there's still an old disklabel around.

 * This fixes changing the disklabel from disklabel64 to disklabel32 and
   vice versa without rebooting.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1667
Reported-by: Thomas Nikolajsen
8 years agodisklabel - add new freedisklabel op
Alex Hornung [Mon, 27 Feb 2012 12:52:08 +0000 (12:52 +0000)]
disklabel - add new freedisklabel op

 * The freedisklabel op is simply used to free the disklabel stored in a
   disklabel_t (in a diskslice).

 * It deallocates the memory and sets the pointer to NULL.

8 years agokernel: Regenerate pcidevs.h and pcidevs_data.h.
Sascha Wildner [Sun, 26 Feb 2012 16:49:48 +0000 (17:49 +0100)]
kernel: Regenerate pcidevs.h and pcidevs_data.h.

8 years agokernel/pcidevs: Shrink it down to what we actually need from it.
Sascha Wildner [Sun, 26 Feb 2012 16:49:12 +0000 (17:49 +0100)]
kernel/pcidevs: Shrink it down to what we actually need from it.

8 years agokernel: Move a de(4) specific header file where it belongs.
Sascha Wildner [Sun, 26 Feb 2012 15:14:08 +0000 (16:14 +0100)]
kernel: Move a de(4) specific header file where it belongs.

8 years agonetif: Use ether_ioctl() to handle SIOCSIFADDR
Sepherosa Ziehau [Sun, 26 Feb 2012 14:02:27 +0000 (22:02 +0800)]
netif: Use ether_ioctl() to handle SIOCSIFADDR

DragonFly's SIOCSIFADDR handling in ether_ioctl() already has unnecessary
if_init avoidance processing; no need to reinvent the wheel

8 years agoe1000: Remove em specific files, which are not and will not be used
Sepherosa Ziehau [Sun, 26 Feb 2012 13:53:53 +0000 (21:53 +0800)]
e1000: Remove em specific files, which are not and will not be used

8 years agokernel/pci: Fix indent.
Sascha Wildner [Sun, 26 Feb 2012 13:39:01 +0000 (14:39 +0100)]
kernel/pci: Fix indent.

8 years agokernel/pci: Fix the securelevel check in pci_open() for write access.
Sascha Wildner [Sun, 26 Feb 2012 13:27:45 +0000 (14:27 +0100)]
kernel/pci: Fix the securelevel check in pci_open() for write access.

While here, clean up some unused code and definitions.

8 years agodm_target_crypt.4: Remove trailing whitespace.
Sascha Wildner [Sat, 25 Feb 2012 23:11:51 +0000 (00:11 +0100)]
dm_target_crypt.4: Remove trailing whitespace.

8 years agopuffs - fix possible null pointer dereference
Alex Hornung [Sat, 25 Feb 2012 19:27:41 +0000 (19:27 +0000)]
puffs - fix possible null pointer dereference

Found-by: clang static analyzer
8 years agopuffs: Install some headers and remove now unnecessary -I's in Makefiles.
Sascha Wildner [Sat, 25 Feb 2012 19:08:02 +0000 (20:08 +0100)]
puffs: Install some headers and remove now unnecessary -I's in Makefiles.

8 years agokernel/i386: Remove the empty CPU_HAS_FXSR kernel option.
Sascha Wildner [Sat, 25 Feb 2012 14:14:46 +0000 (15:14 +0100)]
kernel/i386: Remove the empty CPU_HAS_FXSR kernel option.

8 years agovlan: Add comment about how MPSAFE works out for vlan
Sepherosa Ziehau [Sat, 25 Feb 2012 12:31:26 +0000 (20:31 +0800)]
vlan: Add comment about how MPSAFE works out for vlan

8 years agovlan: Fix the incorrect logic
Sepherosa Ziehau [Sat, 25 Feb 2012 11:08:33 +0000 (19:08 +0800)]
vlan: Fix the incorrect logic

It should speak that parent interface is gone or parent interface
was changed.

8 years agordrand.4 - add warning about being untested
Alex Hornung [Sat, 25 Feb 2012 08:48:58 +0000 (08:48 +0000)]
rdrand.4 - add warning about being untested

8 years agordrand.4 - add man page
Alex Hornung [Sat, 25 Feb 2012 08:32:59 +0000 (08:32 +0000)]
rdrand.4 - add man page

8 years agoLINT{,64} - add rdrand
Alex Hornung [Sat, 25 Feb 2012 08:23:43 +0000 (08:23 +0000)]
LINT{,64} - add rdrand

8 years agordrand - An RNG driver for the RdRand insn
Alex Hornung [Sat, 25 Feb 2012 08:21:48 +0000 (08:21 +0000)]
rdrand - An RNG driver for the RdRand insn

 * The driver is as of yet untested as the hardware is not yet

8 years agobuild: Add WORLD_LDVER (similar to WORLD_CCVER)
John Marino [Fri, 24 Feb 2012 17:50:25 +0000 (18:50 +0100)]
build: Add WORLD_LDVER (similar to WORLD_CCVER)

This enables building world and kernel with the gold linker, and the
result is finally fully bootable and functional.

8 years agoobjformat: Recognize LDVER instead of LINKERVER
John Marino [Fri, 24 Feb 2012 17:43:56 +0000 (18:43 +0100)]
objformat: Recognize LDVER instead of LINKERVER

An informal discussion on IRC revealed that the environment variable
LDVER is preferred over LINKERVER to select the gold linker.

8 years agoboot2: Add linker scripts for gold v2.22
John Marino [Fri, 24 Feb 2012 23:38:03 +0000 (00:38 +0100)]
boot2: Add linker scripts for gold v2.22

The precursors for boot2 and boot2_64 also require linker scripts
when built with gold.  The boot2 program was tested using disklabel
for both linkers after introducing the attached linker script.

8 years agoloader: Add linker scripts for gold v2.22
John Marino [Fri, 24 Feb 2012 17:33:50 +0000 (18:33 +0100)]
loader: Add linker scripts for gold v2.22

The program header handling defaults for the gold linker that comes with
binutils 2.22 changed from the 2.21 version.  As a result, DragonFly's
loader broke when linked with gold, rendering it unbootable.

The solution is to provide dedicated linker scripts for btx, btxldr, and
the loader itself.  These scripts specify how to handle the program
headers.  In these cases, we don't want to embed the headers in the first
LOAD segment which is what gold was doing, so the PDHRS section of the
scripts prevents that from happening.

The gnu ld-built loader still builds just fine with these linker scripts.

8 years agoloader: use _end symbol instead of end
John Marino [Fri, 24 Feb 2012 17:23:39 +0000 (18:23 +0100)]
loader: use _end symbol instead of end

A long time ago, the "_end" symbol replaced the "end" symbol.  The "end"
symbol was never present on the x86_64 DragonFly platform, but it was
erroneously carried inside the i386 libc for a few years (removed with
commit 8f73bea34efe21334e560a312017af168f3d1991).

The main.c file of the loader has been carrying the old version of the
symbol, but this was masked with the standard linker script which defined
"end: as an alias of "_end" and put both symbols in the binary.

This is the only instance of "end" found in the DragonFly code base, and
now it is gone.

8 years agoidentcpu - add bits about RdRand (RDRND)
Alex Hornung [Fri, 24 Feb 2012 12:24:56 +0000 (12:24 +0000)]
identcpu - add bits about RdRand (RDRND)

8 years agokthread_create - fix varargs bug
Alex Hornung [Fri, 24 Feb 2012 21:13:19 +0000 (21:13 +0000)]
kthread_create - fix varargs bug

 * varargs in _kthread_create were handed the formatter but not the
   va_list, leading to all sorts of unexpected behaviour.

 * Set up the va_list in the callers of _kthread_create and pass it in
   when calling.

Points-finger-at: tuxillo
Reported-by: Markus Pfeiffer, Sascha Wildner, Myself
8 years agocrypttab.5 - Mention loading dm_target_crypt
Alex Hornung [Fri, 24 Feb 2012 20:37:42 +0000 (20:37 +0000)]
crypttab.5 - Mention loading dm_target_crypt

Dragonfly-bug: http://bugs.dragonflybsd.org/issue2281

8 years agodm - Add manpages for target crypt and striped
Alex Hornung [Fri, 24 Feb 2012 20:37:15 +0000 (20:37 +0000)]
dm - Add manpages for target crypt and striped

8 years agoagp - fix potential panic
Alex Hornung [Fri, 24 Feb 2012 19:49:10 +0000 (19:49 +0000)]
agp - fix potential panic

 * Fix a potential panic when close() is called on an agp device that
   hasn't been opened.

 * Check whether it's open (and has been busied) before trying to unbusy

Reported-by: Pierre Abbat
DragonFly-bug: http://bugs.dragonflybsd.org/issue2310

8 years agopsshfs - implement hard links
Alex Hornung [Fri, 24 Feb 2012 18:42:31 +0000 (18:42 +0000)]
psshfs - implement hard links

 * implement hard links using the OpenSSH SFTP extension for it, since
   OpenSSH doesn't understand FXP_LINK as per sftp version 6.

8 years agolibc -- stdlib: Implement aligned_alloc from C11.
Venkatesh Srinivas [Fri, 24 Feb 2012 18:22:37 +0000 (10:22 -0800)]
libc -- stdlib: Implement aligned_alloc from C11.

8 years agolibc -- stdlib: Implement quick_exit and at_quick_exit from C11.
Venkatesh Srinivas [Fri, 24 Feb 2012 18:07:07 +0000 (10:07 -0800)]
libc -- stdlib: Implement quick_exit and at_quick_exit from C11.

8 years agopuffs - check whether the FS has the given op
Alex Hornung [Fri, 24 Feb 2012 16:09:21 +0000 (16:09 +0000)]
puffs - check whether the FS has the given op

 * Previously calls to some of the vnops that are unimplemented in the
   actual puffs filesystem were succeeding.

 * We now check whether the op exists before trying to pass it to
   the userland FS. If it doesn't exist, fail (or return ok if no real
   action needs to be taken).

8 years agopuffs - fix panic on hardlink
Alex Hornung [Fri, 24 Feb 2012 14:57:08 +0000 (14:57 +0000)]
puffs - fix panic on hardlink

 * puffs was trying to lock the vp in nlink again, but kern_link does
   that already via vget.

Reported-by: Sascha Wildner (swildner@)
8 years agokern - Do not expose _kthread_create()
Antonio Huete Jimenez [Fri, 24 Feb 2012 10:01:30 +0000 (11:01 +0100)]
kern - Do not expose _kthread_create()

Pointed-out-by: aggelos
8 years agokern build: Tweak ldscripts for gold linker
John Marino [Thu, 23 Feb 2012 18:03:04 +0000 (19:03 +0100)]
kern build: Tweak ldscripts for gold linker

The gold linker v2.21 was able to link a working kernel although its
modules were unloadable.  The gold linker v2.22 could build loadable
modules, but the kernel wouldn't boot!  It's not clear why the modules
started to work -- my guess is that the ancient ldscripts used during
the 2.21 trial were the culprit.

The gold linker changed its ELF program header handling defaults for
version 2.22, and this resulted in an extra LOAD segment reserved only
for the program headers.  The DragonFly loader wasn't expecting that
and instantly rebooted when trying to load a gold kernel.

The solution was to add a PHDRS section to the ldscripts to specify
exactly the section to segment mapping, and prevent gold from putting
the elf headers in their own load segment.  Now gold matches gnu ld
linker in having only two LOAD segments, text and data.

As a curiousity, gold sets the LOAD segment alignment value at 0x1000
for both i386 and x86_64, where gnu ld sets the segment alignment at
0x1000 for i386 and 0x200000 for x86_64.  This seems to have no impact
on the loading of the kernel.

8 years agoloaded: Remove obsolete -elf cflags
John Marino [Thu, 23 Feb 2012 21:59:45 +0000 (22:59 +0100)]
loaded: Remove obsolete -elf cflags

The gnu ld ignores -elf, but gold linker interprets this flag as
entry=lf.  It's a dinosaur from the FreeBSD aout days.

8 years agoLINT: Add CPU_HAS_SSE2.
Sascha Wildner [Thu, 23 Feb 2012 18:23:40 +0000 (19:23 +0100)]

8 years agobuild - Add git gc --aggressive to src and pkgsrc git repo creation
Matthew Dillon [Thu, 23 Feb 2012 17:04:38 +0000 (09:04 -0800)]
build - Add git gc --aggressive to src and pkgsrc git repo creation

* Issue a git gc --aggressive after pulling the git repo for src
  and/or pkgsrc.  This will garbage collect and recompress the
  repo, significantly reducing the disk space required.

* Primarily intended to reduce the size of the usb and dvd gui nrelease

* The gc pass takes a few minutes to run but seems worth it.

8 years agoRemove the KTR_MSGPORT kernel option which was never used.
Sascha Wildner [Wed, 22 Feb 2012 09:35:03 +0000 (10:35 +0100)]
Remove the KTR_MSGPORT kernel option which was never used.

8 years agokern - Merge two functions to avoid duplicated code.
Antonio Huete Jimenez [Tue, 21 Feb 2012 19:19:34 +0000 (20:19 +0100)]
kern - Merge two functions to avoid duplicated code.

- Merged kthread_create() and kthread_create_cpu() into
  _kthread_create() thus avoiding some duplicated code.
- Set TDF_VERBOSE on threads only under bootverbose.

8 years agoMakefile.inc1: Remove a no longer used variable.
Sascha Wildner [Tue, 21 Feb 2012 16:00:32 +0000 (17:00 +0100)]
Makefile.inc1: Remove a no longer used variable.

8 years agoRemove the old <sys/ata.h> header and make it a link of <sys/nata.h>.
Sascha Wildner [Mon, 20 Feb 2012 18:29:44 +0000 (19:29 +0100)]
Remove the old <sys/ata.h> header and make it a link of <sys/nata.h>.

8 years agochkey, chpass, enigma, lock, newgrp, pw - Handle NULL return from crypt(3)
Samuel J. Greear [Mon, 20 Feb 2012 17:34:19 +0000 (10:34 -0700)]
chkey, chpass, enigma, lock, newgrp, pw - Handle NULL return from crypt(3)

8 years agoFix some typos.
Sascha Wildner [Mon, 20 Feb 2012 13:31:04 +0000 (14:31 +0100)]
Fix some typos.

8 years agodsched(4): Some miscellaneous cleanup.
Sascha Wildner [Mon, 20 Feb 2012 11:58:50 +0000 (12:58 +0100)]
dsched(4): Some miscellaneous cleanup.

* Rename the bfq manpage to dsched_bfq(4), so that we don't run into
  name conflicts in the future. If someone wrote a manpage for
  dsched_as, it would have resulted in an as(4) manpage.

* Add options DSCHED_AS and DSCHED_BFQ to LINT*.

* Also, remove an unneeded check in dsched_as.

8 years agokern build: Update ldscripts
John Marino [Sun, 19 Feb 2012 16:24:56 +0000 (17:24 +0100)]
kern build: Update ldscripts

All for ldscripts (includes two virtual kernel scripts) have been
synchronized with binutils 2.22.  The previous sync was with FreeBSD
which is still using binutils 2.17.50.

A notable update is the usage of "-z max-page-size".  This is required
because the gold linker has a standard maximum page size of 0x1000 bytes
compared to 0x200000 bytes for the gnu ld linker.  It's an option to
change the default, but the gold default of 4KB has advantages.  Or in
other words, using a default maximum page size of 2MB has impacts to
library size and available memory that can be avoided.

Another thing to note is the vkernel64 has now been changed to load at
0x200000 like it's pc64 counterpart.

8 years agox86_64 getmemsize: Recover 0x100000 bytes
John Marino [Sun, 19 Feb 2012 15:26:19 +0000 (16:26 +0100)]
x86_64 getmemsize: Recover 0x100000 bytes

When binutils 2.20 was brought in, the x86_64 kernel built with it loaded
at 0x200000 instead of 0x100000 as it was previously.  The getmemsize()
function was never updated with the new address so the physical memory
between 0x100000 and 0x200000 has been lost since then.

The hardcoded value has been updated.  In the future, it may be a good
idea to replace with a variable as FreeBSD has done.

8 years agoMerge remote-tracking branch 'crater/master'
Thomas Nikolajsen [Sat, 18 Feb 2012 10:42:01 +0000 (11:42 +0100)]
Merge remote-tracking branch 'crater/master'

8 years agotmpfs.5: Add note that DragonFly NFS client needs to disable ReaddirPlus
Thomas Nikolajsen [Sat, 18 Feb 2012 10:37:22 +0000 (11:37 +0100)]
tmpfs.5: Add note that DragonFly NFS client needs to disable ReaddirPlus

8 years agoVFS accounting: optimize vop_write() performance
Fran├žois Tigeot [Sat, 18 Feb 2012 09:36:06 +0000 (10:36 +0100)]
VFS accounting: optimize vop_write() performance

* Avoid a mount list scan if accounting is globally disabled

8 years agoVFS accounting: check if nullfs mp* really exist
Francois Tigeot [Fri, 17 Feb 2012 22:58:58 +0000 (23:58 +0100)]
VFS accounting: check if nullfs mp* really exist

* Nullfs are a clever hack, they forget their mp after mount and let the
  non-nullfs underlying mount point do all the work

* Nevertheless, we need to get the real struct mount associated to a mount
  point to count the space used by PFSes. We cache it in the vnode.

* But since the vnode we use really belongs to the lowest underlying
  mount point, the upper-level mp may already have been freed.

* We need to first check if it still valid; a new function,
  mountlist_exists() now exists for that purpose.

* Should fix issue #2266

8 years agortld: add carriage return to die()
John Marino [Sat, 18 Feb 2012 07:47:35 +0000 (08:47 +0100)]
rtld: add carriage return to die()

Add missing EOL character to the die() message.  This was lost when rtld_fdputstr() was
brought into rtld.

FreeBSD PR bin/165075
FreeBSD SVN 231582 (13 Feb 2012)

8 years agohier.7: Add back a .Bl that was removed with the binutils 2.20 removal.
Sascha Wildner [Fri, 17 Feb 2012 22:05:03 +0000 (23:05 +0100)]
hier.7: Add back a .Bl that was removed with the binutils 2.20 removal.

8 years agokernel/pf: In the ioctl code, make sure NPFLOG is actually defined.
Sascha Wildner [Fri, 17 Feb 2012 11:22:26 +0000 (12:22 +0100)]
kernel/pf: In the ioctl code, make sure NPFLOG is actually defined.

The inclusion of if_pflog.h was conditionalized on NPFLOG but it is
if_pflog.h itself that actually defines NPFLOG (because it includes

So if_pflog.h was never included and some initialization code in
the ioctls for adding and changing rules was not executed.

8 years agokernel: Remove unused attributes from stuff that is, in fact, used.
Sascha Wildner [Thu, 16 Feb 2012 22:56:53 +0000 (23:56 +0100)]
kernel: Remove unused attributes from stuff that is, in fact, used.

8 years agopuc(4): Enable it for x86_64, too.
Sascha Wildner [Thu, 16 Feb 2012 21:30:49 +0000 (22:30 +0100)]
puc(4): Enable it for x86_64, too.

I have no idea if it works, but it is not in our GENERIC kernels so it
looks safe to just lurk for someone adding it to their config and
reporting breakage.

8 years agopuc.4: Fix path.
Sascha Wildner [Thu, 16 Feb 2012 21:28:44 +0000 (22:28 +0100)]
puc.4: Fix path.