dragonfly.git
9 years agoFix lack of buildworld and quickworld messages
John Marino [Sun, 8 Mar 2015 13:39:12 +0000 (14:39 +0100)]
Fix lack of buildworld and quickworld messages

The "world" target has a nice start/stop message.  However, if somebody
chooses to use "make buildworld" followed by "make installworld" rather
than "make world", they get no messages at all.  I think this has been an
ongoing oversight.

This commit improves the "world" target messages (e.g. all targets are
ELF so don't need to specify that, and pre/post-world targets are shown.)
More importantly it adds start/complete messages to buildworld, and start
message to installworld.  The installworld already had a complete message,
but this was redone to match the format of the other ones.

Similar messages were added to quickworld and realquickworld targets too.

9 years agogcc50: Update to 08 Mar 2015 snapshot (SVN 221261)
John Marino [Sun, 8 Mar 2015 08:19:57 +0000 (09:19 +0100)]
gcc50: Update to 08 Mar 2015 snapshot (SVN 221261)

9 years agoMerge branch 'vendor/GCC50'
John Marino [Sun, 8 Mar 2015 14:08:42 +0000 (15:08 +0100)]
Merge branch 'vendor/GCC50'

9 years agoUpdate gcc-50 to SVN version 221261
John Marino [Sun, 8 Mar 2015 08:16:16 +0000 (09:16 +0100)]
Update gcc-50 to SVN version 221261

Last Changed Date: 2015-03-08 01:16:18 +0100 (Sun, 08 Mar 2015)

9 years agodrm/i915: Replace kmem_alloc_nofault() by kmap()
François Tigeot [Sun, 8 Mar 2015 09:03:37 +0000 (10:03 +0100)]
drm/i915: Replace kmem_alloc_nofault() by kmap()

As seen on pre-3.7 Linuxes.

9 years agodrm_gem.c: Start using some drm_mm functions
François Tigeot [Sun, 8 Mar 2015 08:35:53 +0000 (09:35 +0100)]
drm_gem.c: Start using some drm_mm functions

9 years agodrm: Reduce diffs with Linux 3.11 in drm_gem.c
François Tigeot [Sun, 8 Mar 2015 08:10:05 +0000 (09:10 +0100)]
drm: Reduce diffs with Linux 3.11 in drm_gem.c

* Restore Intel's copyright

* Reorder function definitions

* don't use idr_remove_all()

* No functional changes

9 years agoAdd entry about Sendmail removal in UPDATING from 4.0
John Marino [Sun, 8 Mar 2015 07:04:31 +0000 (08:04 +0100)]
Add entry about Sendmail removal in UPDATING from 4.0

9 years agoRemove three empty directories from BSD.usr.dist
John Marino [Sun, 8 Mar 2015 06:54:44 +0000 (07:54 +0100)]
Remove three empty directories from BSD.usr.dist

Two of these directories are removed by "make upgrade" (sendmail).  The
third (libg++) seems that it's just been overlooked forever.  It was
probably used for gcc prior to version 4.1.  In any case, it's not used
now.

9 years agodrm: Add asm/barrier.h
François Tigeot [Sun, 8 Mar 2015 07:23:22 +0000 (08:23 +0100)]
drm: Add asm/barrier.h

9 years agodrm: Add barrier()
François Tigeot [Sun, 8 Mar 2015 07:21:36 +0000 (08:21 +0100)]
drm: Add barrier()

9 years agoEffectively remove sendmail from base
John Marino [Sat, 7 Mar 2015 23:45:13 +0000 (00:45 +0100)]
Effectively remove sendmail from base

The NO_SENDMAIL build knob has been hardwired in sys.mk, so it is not
possible for it to be unset by /etc/make.conf.  This effectively prevents
sendmail from building.

A new check was added to "make upgrade" target to make sure the current
/etc/mail/mailer.conf is not configured to use the base sendmail as the
MTA.  If it fails the check, the upgrade will fail before it starts.
Directions are given hot to fix the problem in the error message.  A
successful check results in the sendmail-related binaries getting removed
from the system.

Finally, NO_SENDMAIL has been removed from the default make.conf and it's
man page.

The actual sendmail makefiles and source remain for now.  Once it is
confirmed that transition is working and dma is functioning well as a
replacement, sendmail and the NO_SENDMAIL conditions will be removed
permanently, along with modifying the mtree files.

Approved-by: dillon

9 years agosys/vfs/hammer: Fix and add comments on btree
Tomohiro Kusumi [Sat, 7 Mar 2015 22:46:49 +0000 (07:46 +0900)]
sys/vfs/hammer: Fix and add comments on btree

- hunk1-2: These two seem to be old ones. At this point *node is
  a pointer to cursor->node->ondisk which is not invalid or stale.

- hunk3: This isn't necessary since now this function just returns
  EINVAL if the cursor's node is internal. It didn't have this check
  when this comment was written.

- hunk4: It's hammer_btree_lookup() that could return ENOSPC when
  no space is available, but not this function. Moving this comment
  to the previous paragraph makes better sense.

- hunk5: Leaf nodes have no idea of boundaries to start with so
  replace it with the comment being used in hammer_btree_delete()
  which also deals with bcopy() of elements.

- hunk6: Fix a typo.

- hunk7: Refer to a leaf node's count in addition to internal node.

9 years ago/etc/mail: Install 4 sample mailer.conf files
John Marino [Sat, 7 Mar 2015 19:37:38 +0000 (20:37 +0100)]
/etc/mail: Install 4 sample mailer.conf files

These files have been recently referenced in the DragonFly handbook.
They are here to allow quick reconfiguration of the Mail Transfer Agent.
For example, if Postfix from DPorts is desired, all one needs to do is
copy /etc/mail/mailer.conf.postfix to /etc/mail/mailer.conf and reboot
(assuming postfix configuration files are already in place).

This provides default MTA configurations for dma (base), postfix,
sendmail, and and opensmtpd.

9 years agoperiodic.conf(5): Adjust for dma as MTA in default conf
John Marino [Sat, 7 Mar 2015 19:34:27 +0000 (20:34 +0100)]
periodic.conf(5): Adjust for dma as MTA in default conf

The DragonFly Mail Agent can't support daily_clean_hoststat and
daily_submit_queuerun, so disable these periodic scripts by default.

9 years agoSwitch default MTA from sendmail to dma
John Marino [Sat, 7 Mar 2015 19:08:26 +0000 (20:08 +0100)]
Switch default MTA from sendmail to dma

The mailwrapper controls which Mail Transfer Agent is used.  The
mailer.conf defines the behavior of the mailwrapper.  This commit will
have no effect on existing installations, but for the first installation
a new mailer.conf will be installed during the "distribution" target.

This means all new images have the DragonFly Mail Agent acting as base
MTA rather than Sendmail for the first time in the project's history.

While here, set the default path in the mail wrapper to dma as well,
although this isn't used unless the mailer.conf is incomplete.

9 years agomake.conf(5): Remove NO_MAILWRAPPER build option
John Marino [Sat, 7 Mar 2015 18:53:38 +0000 (19:53 +0100)]
make.conf(5): Remove NO_MAILWRAPPER build option

I doubt DragonFly mail system would even function properly if somebody
actually set NO_MAILWRAPPER in make.conf.  In preparation for the removal
of sendmail from base, removing the mailwrapper is not feasible.  This
wrapper is needed to support replacing the base MTA with one from ports.

There must have been a need for NO_MAILWRAPPER in the past, but I can't
see any purpose it could serve now.

9 years agosys/vfs/hammer: Fix hammer_debug_btree print format
Tomohiro Kusumi [Sat, 7 Mar 2015 09:02:54 +0000 (18:02 +0900)]
sys/vfs/hammer: Fix hammer_debug_btree print format

- hunk1 - Print current thread variable address like
  hammer_btree_iterate() does.

- hunk2,3 - Add 'R' since hammer_btree_iterate() and
  hammer_btree_iterate_reverse() had the exact same format.

- hunk4 - Minor cleanup to align with other btree debug prints.

- hunk5 - Need another space to align with other btree debug prints.

9 years agosys/vfs/hammer: Fix hammer_debug_btree print format
Tomohiro Kusumi [Sat, 7 Mar 2015 08:52:30 +0000 (17:52 +0900)]
sys/vfs/hammer: Fix hammer_debug_btree print format

- Use the same format as ones from btree_search() (add "key=")
  for better readability.

9 years agokernel/vfs: Move prtactive variable to vfs_subr.c
Sascha Wildner [Sat, 7 Mar 2015 01:03:05 +0000 (02:03 +0100)]
kernel/vfs: Move prtactive variable to vfs_subr.c

It is not UFS specific.

9 years agosbin/hammer: Print '>' or '<' if the element is a copy of root_btree_(beg|end)
Tomohiro Kusumi [Thu, 5 Mar 2015 19:42:08 +0000 (04:42 +0900)]
sbin/hammer: Print '>' or '<' if the element is a copy of root_btree_(beg|end)

- Make hammer show command print '>' or '<' if the element is a copy
  of hmp->root_btree_beg or hmp->root_btree_end. These two elements
  don't need 'd' so print it in place of 'd'.

- Makes it easier to find (grep) these two.

9 years agosbin/hammer: Fix workaround made in 2f8c6a59
Tomohiro Kusumi [Thu, 5 Mar 2015 19:23:32 +0000 (04:23 +0900)]
sbin/hammer: Fix workaround made in 2f8c6a59

- 'elm->internal.mirror_tid == 0' was not necessary.
  It failed to detect some cases that it was going to workaround.

9 years agorwho(1): Let the width of the username column depend on the file format.
Sascha Wildner [Thu, 5 Mar 2015 17:54:02 +0000 (18:54 +0100)]
rwho(1): Let the width of the username column depend on the file format.

We're parsing files generated by rwhod(8) here, not utmp(5) files.

This is FreeBSD's r200997.

9 years agosys/vfs/hammer: Fix and add comments on btree boundaries
Tomohiro Kusumi [Wed, 4 Mar 2015 19:10:33 +0000 (04:10 +0900)]
sys/vfs/hammer: Fix and add comments on btree boundaries

- Some comments on btree left/right boundaries are not up-to-date
  with the code or seem to need another line to make things clear.

9 years agonrelease: Revert a small part of 255a0279ad1443d3bf326878835b3ea5721b2f33
Sascha Wildner [Wed, 4 Mar 2015 09:08:00 +0000 (10:08 +0100)]
nrelease: Revert a small part of 255a0279ad1443d3bf326878835b3ea5721b2f33

This was causing git to be no longer installed.

Reported-by: Vitaly Shevtsov <loki.vt@gmail.com>
9 years agoinstaller: Remove some more initrd creation code.
Sascha Wildner [Tue, 3 Mar 2015 20:38:04 +0000 (21:38 +0100)]
installer: Remove some more initrd creation code.

After my revert, this original mkinitrd code (for encrypted setup
originally) came back. Since we can now rely on the ISO having an
initrd to be installed already, we can remove this too.

9 years agonrelease: Solve the initial initrd creation better.
Sascha Wildner [Tue, 3 Mar 2015 20:19:09 +0000 (21:19 +0100)]
nrelease: Solve the initial initrd creation better.

Hard links in cd9660, while not taking up more space in the ISO or on
the CD, all have distinct inode numbers, which causes them to be treated
like individual files when copying them somewhere. This caused the initrd
to overflow when we built it from the installer after booting from the
ISO.

This commit puts initrd creation into the nrelease process instead, making
use of mkinitrd(8)'s -c option which allows us to override the contents
directory to the ${ISOROOT}'s /usr/share/initrd.

Reported-by: opvalues
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2798>

9 years agomkinitrd(8): Add a -c option to override the contents directory.
Sascha Wildner [Tue, 3 Mar 2015 20:11:39 +0000 (21:11 +0100)]
mkinitrd(8): Add a -c option to override the contents directory.

9 years agoRevert "installer: Create an initial initrd unconditionally."
Sascha Wildner [Tue, 3 Mar 2015 18:15:20 +0000 (19:15 +0100)]
Revert "installer: Create an initial initrd unconditionally."

This reverts commit 0c69777ed12f9dff4a80f46f9ef730837791cf33.

Due to shortcomings of the CD9660 filesystems, hardlinks end up
having different inode numbers on it, which leads to them being
treated like separate files when copying etc.

As a result, the initrd put together by mkinitrd from a CD9660
would end up being around 230MB large where it actually has to
be below 15MB.

We will solve this in nrelease instead, putting together the
initrd from the building machine.

9 years agonrelease: Remove an unneeded comma.
Sascha Wildner [Tue, 3 Mar 2015 17:28:56 +0000 (18:28 +0100)]
nrelease: Remove an unneeded comma.

9 years agohammer2 - Fix a few assertion panics and other bugs
Matthew Dillon [Tue, 3 Mar 2015 06:32:12 +0000 (22:32 -0800)]
hammer2 - Fix a few assertion panics and other bugs

* hammer2_io_getblk() was referencing a dio potentially after disposing
  of it.

* Remove the DIO_GOOD patch I previously committed, replacing it with
  a different (better) fix for the DIO_GOOD/DIO_INPROG race.

  The new fix is to run the iocb chains on IO completion before marking
  any of the iocbs done, using a simple depth-first recursion.  INPROG
  is cleared on the last iocb chain so all IOCB_DONE's occur after it
  has been cleared.

* iocb->flags must be modified with atomic ops now.

9 years agodmsg - Stabilization work
Matthew Dillon [Tue, 3 Mar 2015 06:21:23 +0000 (22:21 -0800)]
dmsg - Stabilization work

* Add a refs field to dmsg_state and kdmsg_state for retention and
  disposal.

* Separate out the tracking of state->subq and the state RB trees.

* Greatly simplify the iocom shutdown code and functions related
  to handling communications failures.  When iterating states for
  shutdown, which requires simulating a received failure message,
  we can now simply iterate via state->subq.

* Greatly simplify how the simulated failures are generated and
  handled (See dmsg_msg_simulate_failure()).  This is probably the
  most complex part of the library.

* Fix a memory leak in kern_dmsg.c.

* Replace xdisk's per-softc token with a lockmgr lock.  Atomicy
  has to be guaranteed across blocking conditions in certain cases
  and it was easier to simply use a lock for everything.

  Cleanup the locking.

* Ripout the shutdown check in the I/O path, which can deadlock
  the disk management threads.  This will need to be revisited
  as it means that /dev/xa* and /dev/serno* devices remain in
  /dev after a link failure even when there are no opens on the
  device.

* Add the B_FAILONDIS flag to struct buf.  This flag allows the disk
  probe code to tell xdisk that it is ok for the I/O to fail, allowing
  xdisk to discard I/Os that would otherwise block or deadlock the
  disk probe code when the related network connection is lost.

9 years agodmesg - Fix <> console parsing for first line
Matthew Dillon [Tue, 3 Mar 2015 02:43:32 +0000 (18:43 -0800)]
dmesg - Fix <> console parsing for first line

* If the first string in the buffer is a console string, the normal dmesg
  was not filtering it out due to the initial state of (newl).

9 years agokernel - Refactor the kernel message buffer code (2)
Matthew Dillon [Tue, 3 Mar 2015 02:40:21 +0000 (18:40 -0800)]
kernel - Refactor the kernel message buffer code (2)

* Fix an edge case, the sysctl was not working properly when the msgbuf
  was completely empty.  Generate a single newline output.

* Also if dmesg gets a msgbuf size of 0, allocate at least 1 byte to
  avoid a malloc failure.

9 years agokernel - Refactor the kernel message buffer code
Matthew Dillon [Tue, 3 Mar 2015 01:55:51 +0000 (17:55 -0800)]
kernel - Refactor the kernel message buffer code

* Add a separate tracking index for /dev/klog (syslog) so it does not eat
  the base index for the in-memory buffer.

* Change the way the FIFO indexes work.  The indexes are no longer stored
  as modulo size values.  Instead they are simply adjusted without a modulo,
  making calculations easier.

* When the FIFO is full we now add around ~1KB of slop to reduce instances
  where SMP collisions implode the buffer.  This also required adjusting
  the kern.msgbuf sysctl to avoid dumping the 'slop' area (it used to just
  dump the entire buffer).

* Adjust dmesg to operate more consistently, and to modulo the indices when
  making calculations.

* The dmesg -a option now dumps the <num> prefix for syslog / console output
  messages.  Before it tried to strip them out, which created problems in
  distinguishing kprintf()d output from syslog output.

* Adjust the console tty support thread (which copies the dmesg buffer to the
  console) as well as /dev/klog to use the new index methodology.

* It is now possible for the indexes to wrap the buffer multiple times
  (between e.g. bufl and bufx), and it obviously makes no sense to try to
  dump the overwritten data over and over again, so if indexes get totally
  out of whack we reset bufr and bufl as needed to the size of the buffer.

9 years agoifnet: Make rest of ifnet accessing MPSAFE
Sepherosa Ziehau [Mon, 2 Mar 2015 14:36:36 +0000 (22:36 +0800)]
ifnet: Make rest of ifnet accessing MPSAFE

9 years agoacpi/pstate: Ignore inconsistent PSS table
Sepherosa Ziehau [Mon, 2 Mar 2015 13:43:17 +0000 (21:43 +0800)]
acpi/pstate: Ignore inconsistent PSS table

Some BIOSes create different PSS tables; just trust the one from the
BSP and move on.

Tested-by: Markus Pfeiffer
9 years agosbin/hammer: Don't show irrelevant "BM" and "d" after root split
Tomohiro Kusumi [Mon, 2 Mar 2015 16:32:05 +0000 (01:32 +0900)]
sbin/hammer: Don't show irrelevant "BM" and "d" after root split

- Make hammer show command suppress irrelevant outputs
  "BM NODE ..." and "d tids ..." after splitting the root node.

- When splitting the root node HAMMER uses a copy of predefined special
  node element that has static member values (regardless of other nodes
  within the btree). After the split, this predefined special element
  will be elms[0] of the (new)root node that has a pointer to the old
  root node as its current child.

- However this elms[0] always has 0 for internal.mirror_tid and 1 for
  base.delete_tid (till it's updated) which results hammer show command
  showing unnecessary "BM" and "d". This commit suppress "BM" that
  doesn't actually indicate invalid mirror tid, and suppress "d" that
  doesn't indicate actual delete as following diff of two results shows.

22c22
<         d tids 0000000000000001:0000000000000001 suboff=8000000020800000 mirror 0000000000000000
---
>           tids 0000000000000001:0000000000000001 suboff=8000000020800000 mirror 0000000000000000
46c46
< BM   NODE 8000000020800000 cnt=43 p=8000000020801000 type=L depth=1 mirror 0000000100098160 fill=z8:65=1% {
---
>      NODE 8000000020800000 cnt=43 p=8000000020801000 type=L depth=1 mirror 0000000100098160 fill=z8:65=1% {

9 years agosbin/hammer - Change verbose level for showing data records.
Antonio Huete Jimenez [Mon, 2 Mar 2015 16:03:31 +0000 (17:03 +0100)]
sbin/hammer - Change verbose level for showing data records.

- Also fix missing braces.

Suggested-by: tkusumi
9 years agosbin/hammer - Hex data dump for misc & data records
Antonio Huete Jimenez [Mon, 2 Mar 2015 15:46:30 +0000 (16:46 +0100)]
sbin/hammer - Hex data dump for misc & data records

- Under request of very verbose output, provide an hex
  dump for data, db and ext records.
- This is very useful for debugging.

9 years agosbin/hammer - Properly indent config text on 'show' output
Antonio Huete Jimenez [Mon, 2 Mar 2015 14:52:57 +0000 (15:52 +0100)]
sbin/hammer - Properly indent config text on 'show' output

9 years agodma(8): install default conf files with installworld
John Marino [Mon, 2 Mar 2015 13:45:55 +0000 (14:45 +0100)]
dma(8): install default conf files with installworld

Previously dma configure files were only installed with the
"make distribution" command.  Additionally, the user was expected to
modify them as opposed to copies of them.  This is probably why there
were part of distribution, in order to avoid overwriting the dma.conf
and auth.conf.

The negative side to this approach is that updated *.conf sample files
would never be installed.  Since the dma.conf is actually completely
commented out, and since it doesn't fail in the absence of dma.conf,
these files aren't actually needed.

This commit installs /etc/dma/dma.conf.sample and /etc/dma/auth.conf.sample
files during installworld instead.  Future updates to the *.conf.sample
files will overwrite them, but obviously /etc/dma/*.conf will not be
touched. Some of the sendfile conf files are provided as .sample, so the
concept is not new for DragonFly.

9 years agodma(8): remove unused virtusetable
John Marino [Mon, 2 Mar 2015 12:50:47 +0000 (13:50 +0100)]
dma(8): remove unused virtusetable

This was intended to be template file for the VIRTUAL option in dma,
but it appears this option was never implemented, nor was this file
ever installed.  Remove it.

9 years agodma(8): Sync with upstream (22 SEP 2014)
John Marino [Mon, 2 Mar 2015 10:44:02 +0000 (11:44 +0100)]
dma(8): Sync with upstream (22 SEP 2014)

There is only one substantial change: improving mail input format error
message.  The remain changes are email address, copyright years, etc.

While here, document which files have local modifications by adding a
README.DRAGONFLY file

9 years agoifnet: Make blocking operation in if_addrheads iteration MPSAFE
Sepherosa Ziehau [Wed, 18 Feb 2015 13:01:15 +0000 (21:01 +0800)]
ifnet: Make blocking operation in if_addrheads iteration MPSAFE

Two methods are used:
- Dispatch blocking operation in if_addrheads iteration to netisr0
  to run for functions which do not copy data into user space.
- Use ifaddr marker to make sure that the ifaddr list is not broken
  if the ifaddr list is changed during the blocking operation.  And
  reference the ifaddr being used so it will not be destroyed during
  the blocking operation.

9 years agodmesg - Add -n dumpnr option
Matthew Dillon [Mon, 2 Mar 2015 01:01:22 +0000 (17:01 -0800)]
dmesg - Add -n dumpnr option

* Add the -n option to specify a kernel core dump number, similar to
  how kgdb works, as a convenience so you don't have to write out the
  long -M and -N options.

9 years agohammer2 - Fix DIO_INPROG race.
Matthew Dillon [Sun, 1 Mar 2015 19:46:12 +0000 (11:46 -0800)]
hammer2 - Fix DIO_INPROG race.

* It is possible when a chained DIO_INPROG is present for the DIO to become
  GOOD and for the dio->refs ref to be release, but not yet have finished
  its INPROG processing due to the chaining.

  In this situation, a temporary user of the DIO will get/put it and hit
  an important sanity assertion in putblk.

* Fix by disallowing the DIO_GOOD shortcut in hammer2_io_getblk() if the
  DIO is still DIO_INPROG.

9 years agoxdisk - Flesh out support
Matthew Dillon [Sun, 1 Mar 2015 19:44:35 +0000 (11:44 -0800)]
xdisk - Flesh out support

* Add libdevstat support so 'xa' devices can report meaningful
  data in systat -vm.

* Add sysctls to track active requests.

9 years agokernel - work on dmsg disk exports
Matthew Dillon [Sun, 1 Mar 2015 19:41:41 +0000 (11:41 -0800)]
kernel - work on dmsg disk exports

* Refactor and clean up the kdmsg thread cleanup code.

* Add a workaround for a possible tx/rx race which can occur due to the
  transmit side not retiring the kdmsg until after writing it.  This can
  potentially block and allow a received response to be processed before the
  related transmitted kdmsg is cleaned up.

* Add sysctls to track operations in progress.

* Code documentation.

9 years agolibdevstat - add "xa"
Matthew Dillon [Sun, 1 Mar 2015 19:40:13 +0000 (11:40 -0800)]
libdevstat - add "xa"

* Add a match line for "xa" (xdisk) devices.

9 years agolibdmsg - Fix incomplete write bug
Matthew Dillon [Sun, 1 Mar 2015 19:37:53 +0000 (11:37 -0800)]
libdmsg - Fix incomplete write bug

* Fix a bug where a partial non-blocking write of encrypted data does not
  properly set the WREQ flag if the related dmsg has been disposed of.
  This could cause random stalls of the link.

* Fix an errno-handling bug.

* Cleanup and debugging.

9 years agoRevert "drm/i915: Sync i915_gem_pwrite_ioctl() with Linux 3.11"
François Tigeot [Sun, 1 Mar 2015 17:36:41 +0000 (18:36 +0100)]
Revert "drm/i915: Sync i915_gem_pwrite_ioctl() with Linux 3.11"

This reverts commit 005b6ef6b6adc0554079d13443c56f48766e8afc.

It breaks Ironlake.

9 years agolibedit: Add bapt patches to improve unicode
John Marino [Sun, 1 Mar 2015 15:14:24 +0000 (16:14 +0100)]
libedit: Add bapt patches to improve unicode

On Jan 9, bapt synced FreeBSD-current with the latest libedit from NetBSD.
After that, he added local patches to fix line reading in a unicode
environment.  Specifically it allowed sh(1) to work in UTF-8 environment.
I appreciate that bapt took the time to identify those patches for the
benefit of DragonFly.  Thanks!

9 years agokernel/radeon: Remove an unused GPLv2 only file.
Sascha Wildner [Sun, 1 Mar 2015 11:37:15 +0000 (12:37 +0100)]
kernel/radeon: Remove an unused GPLv2 only file.

Its contents are not used by our current radeon code (the functions
end up being defined as empty inlines in radeon_drv.c) and seems to
be the only file in Linux' radeon driver that is not MIT licensed.

So remove it.

In-discussion-with: ftigeot

9 years agodrm/i915: Sync i915_gem_pwrite_ioctl() with Linux 3.11
François Tigeot [Sun, 1 Mar 2015 10:46:09 +0000 (11:46 +0100)]
drm/i915: Sync i915_gem_pwrite_ioctl() with Linux 3.11

9 years agodrm/i915: i915_gem_pager_fault() is i915_gem_fault()
François Tigeot [Sun, 1 Mar 2015 10:19:57 +0000 (11:19 +0100)]
drm/i915: i915_gem_pager_fault() is i915_gem_fault()

9 years agodrm: Implement linux/io-mapping.h
François Tigeot [Sun, 1 Mar 2015 10:13:52 +0000 (11:13 +0100)]
drm: Implement linux/io-mapping.h

9 years agosbin/hammer: Don't show FLAG_BADMIRRORTID for root node in certain corner case situation
Tomohiro Kusumi [Sat, 28 Feb 2015 20:06:01 +0000 (05:06 +0900)]
sbin/hammer: Don't show FLAG_BADMIRRORTID for root node in certain corner case situation

- Make hammer show command stop showwing an error flag regarding
  mirror tid that isn't actually an error.

- newfs_hammer initializes the root node's mirror_tid with 0 along
  with its first two elements, but this mirror_tid is not updated
  till the third element is allocated (by creating a file, etc).
  Following result shows this situation.

- In this situation the root node's node->mirror_tid (==0) being
  smaller than elm->base.create_tid or elm->base.delete_tid is not
  an error. This only happens on the root node because all the other
  nodes get updated when they split from existing ones.

     NODE 8000000020800000 cnt=02 p=0000000000000000 type=L depth=0 mirror 0000000000000000 fill=z8:65=1% {
B-----M ELM  0 R lo=00000001 obj=0000000000000001 rt=01 key=0000000000000000 ot=01
         tids 0000000100000001:0000000000000000
 <snip>
B-----M ELM  1 R lo=00000002 obj=0000000000000001 rt=15 key=0000000000000000 ot=00
         tids 0000000100000001:0000000000000000
 <snip>
     }

9 years agosbin/hammer: Rename static function print_elm_flags() to get_elm_flags()
Tomohiro Kusumi [Fri, 27 Feb 2015 11:45:22 +0000 (20:45 +0900)]
sbin/hammer: Rename static function print_elm_flags() to get_elm_flags()

- print_elm_flags() doesn't print anything.

9 years agokernel: Mark sigexit() and cpu_halt() as not returning.
Sascha Wildner [Sat, 28 Feb 2015 20:31:02 +0000 (21:31 +0100)]
kernel: Mark sigexit() and cpu_halt() as not returning.

9 years agokernel/netinet6: Remove some bogus checks for KERNEL (use just _KERNEL).
Sascha Wildner [Sat, 28 Feb 2015 19:59:36 +0000 (20:59 +0100)]
kernel/netinet6: Remove some bogus checks for KERNEL (use just _KERNEL).

9 years agokernel/scsi: Fix sense information printing in bootverbose.
Sascha Wildner [Sat, 28 Feb 2015 19:55:30 +0000 (20:55 +0100)]
kernel/scsi: Fix sense information printing in bootverbose.

9 years agodrm/i915: Sync i915_gem.c with Linux 3.11
François Tigeot [Sat, 28 Feb 2015 10:48:43 +0000 (11:48 +0100)]
drm/i915: Sync i915_gem.c with Linux 3.11

* Make the GEM code more similar to Linux

* Replace i915_gem_shmem_pread() by the OpenBSD implementation
  (i915_gem.c revision 1.85)

* The rest of the changed code is based on Linux 3.11

9 years agohammer2 - Add extra debugging
Matthew Dillon [Sat, 28 Feb 2015 18:06:14 +0000 (10:06 -0800)]
hammer2 - Add extra debugging

* Enable DMsgDebugOpt if -d is specified twice.

9 years agolibdmsg - Fix memory leak
Matthew Dillon [Sat, 28 Feb 2015 18:04:54 +0000 (10:04 -0800)]
libdmsg - Fix memory leak

* Fix a memory leak in the message relay code.  When relaying a message
  we just transfer the aux_data pointer to the relay message.  The
  allocation of the relay message was also allocate aux_data space which
  was getting thrown away and not freed.

9 years agohammer2 / kern_dmsg - Fix bugs
Matthew Dillon [Sat, 28 Feb 2015 16:13:49 +0000 (08:13 -0800)]
hammer2 / kern_dmsg - Fix bugs

* Fix header size limt check.

* Do not free the message data out from under a running I/O.
  Introduce an API for detaching aux_data from a msg.

* Increase DMSG_AUX_MAX to 1MB to ensure that xdisk (remote disks)
  work with any filesystem.

  Theoretically we can break up READ and WRITE messages into pieces
  in order to allow DMSG_AUX_MAX to be made smaller (which is easier
  to manage in-kernel), but for now the implementation just uses a
  single message transaction.

* Adjust some comments.

9 years agolibdmsg - Fix buffer indexing bug in crypted path
Matthew Dillon [Sat, 28 Feb 2015 16:11:33 +0000 (08:11 -0800)]
libdmsg - Fix buffer indexing bug in crypted path

* Fix a buffering index bug in the crypted path which causes a buffer
  overrun and/or implodes the connection on a protocol error.

9 years agokernel: Remove unused xwait headers.
Sascha Wildner [Sat, 28 Feb 2015 11:53:03 +0000 (12:53 +0100)]
kernel: Remove unused xwait headers.

xsleep/xwakeup were added to DragonFly in 2003 to replace asleep/awakeup
from FreeBSD 4.x. tsleep & wakeup sleep on untyped identifiers; the sleep
routines do not store through the identifiers and treat them as opaque.
xsleep/xwakeup in contrast slept on explicit sleep structures,
'struct xwait'.

xsleep / xwakeup were never used; they were born #if-0ed out and were
removed by 2004. This commit removes a legacy declaration and associated
header.

Submitted-by: vsrinivas
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2786>

9 years agokernel: Remove unused hogticks global from kern_synch.c.
Sascha Wildner [Sat, 28 Feb 2015 11:33:07 +0000 (12:33 +0100)]
kernel: Remove unused hogticks global from kern_synch.c.

hogticks was a global definition used in kern_synch.c:should_yield().
A thread that had remained running for more than hogticks would
return true for should_yield(). DragonFly has not used this global
for a long time.

Submitted-by: vsrinivas
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2787>

9 years agodrm: Add asm/uaccess.h functions
François Tigeot [Sat, 28 Feb 2015 08:46:22 +0000 (09:46 +0100)]
drm: Add asm/uaccess.h functions

* __copy_to_user() and __copy_from_user(), obtained from OpenBSD

* __copy_to_user_inatomic() and __copy_from_user_inatomic_nocache(),
  obtained from FreeBSD

9 years agodrm: Import drm_memory.h from Linux 3.11
François Tigeot [Sat, 28 Feb 2015 08:05:56 +0000 (09:05 +0100)]
drm: Import drm_memory.h from Linux 3.11

9 years agodrm: Add drm_clflush_virt_range()
François Tigeot [Sat, 28 Feb 2015 07:57:43 +0000 (08:57 +0100)]
drm: Add drm_clflush_virt_range()

Obtained-from: Linux 3.11

9 years agodrm: linux/mm.h: Add offset_in_page()
François Tigeot [Sat, 28 Feb 2015 07:50:44 +0000 (08:50 +0100)]
drm: linux/mm.h: Add offset_in_page()

Obtained-from: OpenBSD

9 years agoxdisk - disk_setdiskinfo() must be assynchronous
Matthew Dillon [Sat, 28 Feb 2015 07:28:42 +0000 (23:28 -0800)]
xdisk - disk_setdiskinfo() must be assynchronous

* Allow CMD_BUF_READ operations without the device having to be open.
  This allows disk probes to occur.

* Use disk_setdiskinfo(), which is asynchronous, to avoid an I/O deadlock
  because the call is made from the rxmsg loop.  If it were to issue I/O
  synchronously we would deadlock and never process the reply.

9 years agolibdmsg - add safeties
Matthew Dillon [Sat, 28 Feb 2015 05:03:06 +0000 (21:03 -0800)]
libdmsg - add safeties

* Preinitialize return counters to 0 as a safety.  Not required for proper
  operation.

9 years agolibdmsg - Fix buffer overrun
Matthew Dillon [Sat, 28 Feb 2015 05:00:36 +0000 (21:00 -0800)]
libdmsg - Fix buffer overrun

* Large messages (generally large data payloads) could overrun the FIFO
  buffer.  e.g. dd if=/dev/xa<blah> of=/dev/null bs=32k

* Fix by chunking up large payloads.

9 years agoacpi_video(4): Fix detach panic.
Imre Vadasz [Fri, 27 Feb 2015 23:51:27 +0000 (00:51 +0100)]
acpi_video(4): Fix detach panic.

* The "if ((adr & DOD_DEVID_MASK_FULL) == DOD_DEVID_LCD)" test from
  acpi_video_vo_init was missing in acpi_video_vo_destroy. This meant
  that on some machines we ended up calling STAILQ_REMOVE with an element
  not contained in the list, which causes a panic since STAILQ_REMOVE
  doesn't check for the end of the list.

9 years agonet/if_lagg: Fix double-free issue
Markus Pfeiffer [Thu, 26 Feb 2015 15:24:45 +0000 (15:24 +0000)]
net/if_lagg: Fix double-free issue

9 years agogcc50: Update to 27 Feb 2015 snapshot (SVN 221044)
John Marino [Fri, 27 Feb 2015 08:05:01 +0000 (09:05 +0100)]
gcc50: Update to 27 Feb 2015 snapshot (SVN 221044)

9 years agoMerge branch 'vendor/GCC50'
John Marino [Fri, 27 Feb 2015 10:13:33 +0000 (11:13 +0100)]
Merge branch 'vendor/GCC50'

9 years agoUpdate gcc-50 to SVN version 221044
John Marino [Fri, 27 Feb 2015 08:01:52 +0000 (09:01 +0100)]
Update gcc-50 to SVN version 221044

Last Changed Date: 2015-02-27 09:37:51 +0100 (Fri, 27 Feb 2015)

9 years agoacpi/pstate: Allow user to force package level P-state domain
Sepherosa Ziehau [Thu, 26 Feb 2015 12:23:56 +0000 (20:23 +0800)]
acpi/pstate: Allow user to force package level P-state domain

Some CPUs only have package P-states, but some BIOSes put each
hyperthread to its own P-state domain; allow user to override.
It is not enabled by default.

9 years agosbin/newfs_hammer: Properly set ondisk localization value
Tomohiro Kusumi [Thu, 26 Feb 2015 11:36:42 +0000 (20:36 +0900)]
sbin/newfs_hammer: Properly set ondisk localization value

- Make hammer_newfs properly set ondisk localization for the first
  two elements (for root inode and PFS) of the root node.

- HAMMER does cursor lookup using sum of onmemory ip(inode) localization
  and localization type, so in this case hammer_newfs needs to write
  ondisk bits using (HAMMER_DEF_LOCALIZATION + type) instead of just
  a type (see hammer_get_inode() and hammer_load_pseudofs() for details).

- It makes no binary difference since HAMMER_DEF_LOCALIZATION is 0,
  however it should be fixed for the consistency (e.g. if the macro
  happens to be defined differently, although it is not likely as it
  forces ondisk layout change).

9 years agosys/vfs/hammer: Fix and add comments on root inode
Tomohiro Kusumi [Thu, 26 Feb 2015 11:25:59 +0000 (20:25 +0900)]
sys/vfs/hammer: Fix and add comments on root inode

- hunk1 - The root inode uses HAMMER_DEF_LOCALIZATION for its
  onmemory ip(inode) localization, however the purpose of this macro
  is not documented anywhere. Make it clear by adding this comment.

- hunk2 - Show HAMMER_OBJID_ROOT is the root inode # for both real
  root inode and PFS root inodes.

- hunk3-4 - Change "stored in the root inode" to "associated with
  the root inode". PFS records are not embedded within the ondisk
  inode structure, but associated with the root inode by id.
  Commit ea434b6f uses "associated with" in its commit message.

9 years agoNuke /usr/share/examples/cvsup.
Sascha Wildner [Thu, 26 Feb 2015 12:40:51 +0000 (13:40 +0100)]
Nuke /usr/share/examples/cvsup.

Now that i386 is no longer supported we can't even run an old FreeBSD
cvsup binary anymore, so all this has become completely pointless.

FreeBSD has since switched to SVN, NetBSD's repository can be
rsync'ed, about OpenBSD I am not sure though. There are git repos
of various BSDs too.

9 years agonetif/if_lagg: Fix panic on MOD_UNLOAD
Markus Pfeiffer [Thu, 26 Feb 2015 12:39:16 +0000 (12:39 +0000)]
netif/if_lagg: Fix panic on MOD_UNLOAD

Remove one instance of if_clone_detach being called.

Reported-By: bycn82 <bycn82@gmail.com>
9 years agodevd(8): Add -Wno-unused-local-typedefs to CFLAGS for now.
Sascha Wildner [Thu, 26 Feb 2015 10:47:05 +0000 (11:47 +0100)]
devd(8): Add -Wno-unused-local-typedefs to CFLAGS for now.

The issue is that with -Wunused-local-typedefs, our GCC 5.0 warns about
unused local typedefs in its own headers, in this case stl_algo.h which
comes in via <algorithm>, which devd(8) includes.

Example:

c++ [...] -Werror -Wall [...] -c devd.cc
In file included from /usr/include/c++/5.0/bits/stl_algo.h:61:0,
                 from /usr/include/c++/5.0/algorithm:62,
                 from devd.cc:93:
/usr/include/c++/5.0/bits/stl_heap.h: In function 'void std::pop_heap(_RAIter, _RAIter)':
/usr/include/c++/5.0/bits/stl_heap.h:266:2: error: typedef '_ValueType' locally defined but not used [-Werror=unused-local-typedefs]
  _ValueType;
  ^
[...]

More typedefs are warned about, _InputValueType, _OutputValueType, and
_DistanceType.

9 years agobmake.1: Add missing newline.
Sascha Wildner [Thu, 26 Feb 2015 10:16:54 +0000 (11:16 +0100)]
bmake.1: Add missing newline.

9 years agoFix 'make upgrade'.
Sascha Wildner [Wed, 25 Feb 2015 21:13:42 +0000 (22:13 +0100)]
Fix 'make upgrade'.

Seems sys.mk is pulled in for 'make upgrade' too and CCVER isn't defined
at this point.

Reported-by: Robin Hahling <robin.hahling@gw-computing.net>
9 years agocoretemp(4): Add MODULE_VERSION.
Sascha Wildner [Wed, 25 Feb 2015 21:03:34 +0000 (22:03 +0100)]
coretemp(4): Add MODULE_VERSION.

9 years agosys/vfs/hammer: conform to style(9)
Tomohiro Kusumi [Wed, 25 Feb 2015 10:18:06 +0000 (19:18 +0900)]
sys/vfs/hammer: conform to style(9)

- Remove #include <sys/types.h>

- Kernel include files (i.e. sys/*.h) come first;
  normally, include <sys/types.h> OR <sys/param.h>, but not both.

- Spotted-by: sephe
  http://lists.dragonflybsd.org/pipermail/commits/2015-February/417986.html

9 years agodevd(8): Raise WARNS back to 5.
Sascha Wildner [Wed, 25 Feb 2015 03:55:49 +0000 (04:55 +0100)]
devd(8): Raise WARNS back to 5.

9 years agogcc50: Exclude -Wunused-local-typedefs from C++ flags for now.
Sascha Wildner [Wed, 25 Feb 2015 03:55:09 +0000 (04:55 +0100)]
gcc50: Exclude -Wunused-local-typedefs from C++ flags for now.

At least GCC 5.0 is warning on its own C++ includes (stl_algo.h,
via <algorithm>) if -Wextra is set, breaking the build of programs
which do nothing wrong themselves (such as devd(8)).

When this gets fixed, we can revert this commit again.

Note that I didn't check with GCC 4.8 or 4.9.

9 years agoudp: Disable direct detach only if multicast options are to be set.
Sepherosa Ziehau [Wed, 25 Feb 2015 03:26:52 +0000 (11:26 +0800)]
udp: Disable direct detach only if multicast options are to be set.

9 years agoudp: Disable direct detach, if multicast options are set.
Sepherosa Ziehau [Wed, 25 Feb 2015 03:17:35 +0000 (11:17 +0800)]
udp: Disable direct detach, if multicast options are set.

Add additional comment about disabling direct detach when setting
multicast options.

Submitted-by: Romick
DragonFly-bug: http://bugs.dragonflybsd.org/issues/2792

9 years agodevd(8): Sync with FreeBSD.
Sascha Wildner [Wed, 25 Feb 2015 02:42:41 +0000 (03:42 +0100)]
devd(8): Sync with FreeBSD.

9 years agoacpi_hp(4): Fix detaching, by adding the missing sysctl_ctx_free call.
Imre Vadasz [Tue, 24 Feb 2015 22:57:11 +0000 (23:57 +0100)]
acpi_hp(4): Fix detaching, by adding the missing sysctl_ctx_free call.

9 years agosys/vfs/hammer: Remove duplicate calculation of localization
Tomohiro Kusumi [Tue, 24 Feb 2015 11:52:34 +0000 (20:52 +0900)]
sys/vfs/hammer: Remove duplicate calculation of localization

- No need to calculate localization twice.

9 years agosys/vfs/hammer: Fix comments on record initialization
Tomohiro Kusumi [Tue, 24 Feb 2015 10:57:14 +0000 (19:57 +0900)]
sys/vfs/hammer: Fix comments on record initialization

- hunk1 - Add description of manual data allocation.

- hunk2 - Make description of hammer_ip_add_record() up-to-date with code.

9 years agosys/vfs/hammer: Fix comments on btree record data
Tomohiro Kusumi [Tue, 24 Feb 2015 10:54:45 +0000 (19:54 +0900)]
sys/vfs/hammer: Fix comments on btree record data

- hunk1 - Make comments up-to-date with code.

- hunk2 - Show this member is to be dynamically allocated
  with >HAMMER_INODE_BASESYMLEN bytes length.