John Marino [Mon, 30 Sep 2013 21:59:27 +0000 (23:59 +0200)]
Set ICONV_CONST to "const" for various GNU software
The prototype of iconv changed to match FreeBSD and NetBSD with the
recent locales update.
John Marino [Mon, 30 Sep 2013 21:14:14 +0000 (23:14 +0200)]
libarchive: Disable iconv the statically-built version
The iconv in base uses dlopen(3) which only works on dynamically-built
binaries. Use the new SHARED_CFLAGS variable to set ICONV conditionally
for dynamic libraries only. This fixes the "Service Unavailable"
message that pkg started emitting after the locales/iconv update.
John Marino [Mon, 30 Sep 2013 20:48:45 +0000 (22:48 +0200)]
bsd.lib.mk: Recognize {SHARED,STATIC}_{C,CXX}FLAGS variables
Four new variables are recognized by bsd.lib.mk:
STATIC_CFLAGS
STATIC_CXXFLAGS
SHARED_CFLAGS
SHARED_CXXFLAGS
This allows for the possibility to compile the objects with unique flags
depending if the library is shared or not, and/or c versus c++.
John Marino [Mon, 30 Sep 2013 19:58:56 +0000 (21:58 +0200)]
date(1): Choose a better format constant
After the locales patch, date(1) would return something like "09/30/13"
depending on your locale. This is a different format that omits the
time component that was there before. Changing the D_FMT constant for
D_T_FMT will return something like "Mon Sep 30 21:55:26 2013" which is
much closer to how it was before the locales patch was committed.
Sascha Wildner [Mon, 30 Sep 2013 04:22:18 +0000 (06:22 +0200)]
libc: Ansify again, de-register again.
* Remove all the K&R crap that was carelessly copied over our ansified
source in the so called locale "sync" (
0d5acd7467c4e95).
* Also remove a lot of old unused gunk in stdtime/ again that had already
been removed. We really don't want it back.
* De-register again (while here, do that in resolv/ too).
John Marino [Sun, 29 Sep 2013 23:29:20 +0000 (01:29 +0200)]
libm: Update erf, add imprecise versions of missing c++11 functions
Provide updates to erf and erff functions.
Also add weak versions of the missing c++11 long double functions by
using taking arguments of type double. Use of these versions will
result in a linker warning to discourage program that really need
extra precision from using them.
Note that since the c/c++ specs only guarantee that long double has
precision equal to double, code that relies on these functions having
greater precision is unportable at best and broken at worst.
Taken-from: FreeBSD
John Marino [Sun, 29 Sep 2013 19:18:52 +0000 (21:18 +0200)]
Activate Native Language Support (NLS) for error messages
Error messages have been in English regardless of the locale selected by
the user. NLS support has always been possible, but it's never been
activated. A simple CFLAG (-DNLS) does that now. At the same time, NLS
support was added for network messages.
John Marino [Sun, 29 Sep 2013 17:33:57 +0000 (19:33 +0200)]
nvi: Upgrade from version 1.79 to 2.1.1 (multibyte support)
The DragonFly NVI ("new" vi and ex) has been at version 1.79 which,
according to the FreeBSD repository, was imported nearly 18 years
ago in October 1996.
A 2011 Summer of Code project of FreeBSD added multibyte encoding
support with iconv. With the recent update to the base iconv
support, DragonFly users can enjoy multibyte support. Language
catalogs are still based on English, French, German, Dutch,
Spanish, Chinese, Russian, Polish, and Swedish. FreeBSD brought
this NVI update into their HEAD in August 2013. Local
modifications to nvi 1.79 were incorporated directly on top of
this sync.
Repository: <https://github.com/lichray/nvi2>
Antonio Huete Jimenez [Sun, 29 Sep 2013 15:25:26 +0000 (08:25 -0700)]
dirfs - Lower debug level to 0
Antonio Huete Jimenez [Sun, 29 Sep 2013 15:14:25 +0000 (08:14 -0700)]
dirfs - Fix a panic on shutdown.
* Do not attempt to release root inode if there was no call
to VFS_ROOT()
John Marino [Sat, 21 Sep 2013 10:45:03 +0000 (12:45 +0200)]
locales, libconv: Sync with FreeBSD (extensive reach)
What started out as a relatively simply upgrade to libiconv finally
resulted in a simultaneous overhaul to locales, strings, and stdio.
All of these are interdependent and there is no way to upgrade them
individually or in steps.
These cases are similar to what happened with libm where significant
syncing came from NetBSD previously, rendering contributions from
FreeBSD difficult. Libiconv and locales (both ancient) are now in
sync with FreeBSD HEAD.
As several headers were signficantly updated and the mtree was updated
to accommodate the new include/xlocale directory, this commit will
require a full world build. It also may cause some dports to no longer
build due to prototype differences, but the dports will be adjusted.
The regexp library was not being used. It was removed from FreeBSD four
years ago. Since it required collate updates, I took the opportunity to
remove it completely by adding re_comp functionality to 4.3 compat
library like FreeBSD did.
__DragonFly_version has been bumped to 500300.
Sascha Wildner [Sun, 29 Sep 2013 11:14:03 +0000 (13:14 +0200)]
keylogin(1): Fix a warning and raise WARNS to 6.
François Tigeot [Sun, 29 Sep 2013 09:36:28 +0000 (11:36 +0200)]
agp/intel: Add ValleyView and Haswell devices
François Tigeot [Sun, 29 Sep 2013 08:43:49 +0000 (10:43 +0200)]
agp/intel: Fix pci_get_subdevice() / pci_get_device() confusion
The IDs are the sames with Intel chipsets but it's best to check
for the right thing anyway.
Spotted-by: swildner
François Tigeot [Sun, 29 Sep 2013 07:23:39 +0000 (09:23 +0200)]
agp/intel: Minor cleanups
* Do not limit the device probe check to "display" devices
* Stop storing the vendor ID in the match list, all the devices we care
about are Intel ones.
Matthew Dillon [Sun, 29 Sep 2013 06:30:11 +0000 (23:30 -0700)]
hammer2 - Redo refactor code, fix races, add assertions
* Redo the refactor code which is used to detect when a chain
has been delete-duplicated so the caller can translate a stale
chain pointer into an up-to-date chain pointer.
The new code uses a simple chain flag, HAMMER2_CHAIN_DUPLICATED,
to flag that the original chain is now stale. The old code was
unnecessarily complex.
* Close several holes in the hardlink code where stale chains
were improperly being used as starting points for modifications,
resulting in filesystem corruption.
* Assert the a delete-duplicate is not performed on a stale chain.
Antonio Huete Jimenez [Sat, 28 Sep 2013 16:25:42 +0000 (09:25 -0700)]
vkernel - Update usage options.
* This was overlooked in the previous commit.
John Marino [Sat, 28 Sep 2013 09:02:49 +0000 (11:02 +0200)]
Makefile.inc1: Fix build when MAKEOBJDIRPREFIX is provided
While testing a patch that removed symbols from libc, Joris found his
build would break on leaf with MAKEOBJDIRPREFIX set in the command-line.
While this is a misuse of the feature per bsd.obj.mk comments, the issue
was reproduced on my machine. The object files from btools, ctools, and
world were getting placed in common directories, so world binaries were
being built with bootstrap and crosstools objects.
I do not know if this has always been the case, or if this started
happening when bmake replaced legacy make. In any case, changing the
way DESTDIRBASE is defined solved the build issues on the local machine.
Antonio Huete Jimenez [Sat, 28 Sep 2013 09:06:44 +0000 (02:06 -0700)]
vkernel - Add -d option to disable vmm.
In some cases we might need to be able to disable vmm per-vkernel.
Add a command-line option to allow that.
Antonio Huete Jimenez [Fri, 27 Sep 2013 12:16:37 +0000 (05:16 -0700)]
vkernel - Remove unused getopt option.
Antonio Huete Jimenez [Fri, 27 Sep 2013 11:58:28 +0000 (04:58 -0700)]
vkernel64 - Report VMM status at startup.
Matthew Dillon [Sat, 28 Sep 2013 05:57:54 +0000 (22:57 -0700)]
hammer2 - Rewrite internal chain algorithms - stabilization
* Add temporary guards on a few structures for debugging purposes.
* Verify that blocktables are ordered.
* live_zero is multi-homed, move it out of the chain_core structure and
into the chain structure. Also move the COUNTEDBREFS flag
* Unlock the spinlock prior to issuing the atomic fetchadd to decrement
hammer2_core->sharecnt. Clean up any hanging chain_layer's when freeing
a core structure.
* Initialize live_zero to 0 when base is NULL (i.e. if the chain structure
is in the INITIAL stage).
* Refactor hammer2_chain_find(), hammer2_base_find(), and add
hammer2_combined_find(). Fix numerous bugs in the key_next
calculation and ensure that the combined find returns exhaustion
if the element it finds is outside the requested range.
* Close a delete-duplicate race in hammer2_chain_getparent() and
in hammer2_chain_lookup(). A delete-duplicate could weasle its
way in during the parent lock transition.
Matthew Dillon [Fri, 27 Sep 2013 14:50:53 +0000 (07:50 -0700)]
hammer2 - Rewrite internal chain algorithms
* These are big changes designed to make it easier for the flusher to
order media writes and as a requirement for upcoming 'copies' and other
work. H2 will be somewhat unstable for a short while.
* Replace the single-layer RBTREE per topological level with a stack of
RBTREEs per topological level. This allows conflicts to be stacked
vertically roughly by flush synchronization group instead of trying
to arrange everything in a single 2D RBTREE. Conflicts arise because
the in-memory tree can represent multiple synchronization points with
live and deleted-flagged chains.
The RBTREE compare function is actually simplified by this change, but
the code must contend with a list of RBTREEs (built as conflicts arise)
instead of just one.
* The block table for any given topological layer is now ordered, and this
will now be reflected and required on-media as well. That is, it is
sorted. It is still effectively set-associative in that the dynamic
radix tree model is still being used, but elements must now be sorted.
This improves I/O but more importantly it will allow H2 to use cursors
to track multiple mounts used in 'copies' and later on in clustering.
Running multiple media topologies concurrently was impossible when the
block sets were unordered.
This makes implementing a merged search (blocktable and in-memory chains)
easier.
* Remove chain->index tracking. We used to track the block table index
that each in-memory chain intended to use which worked 'ok' when the
block table (such as in an inode or an indirect block) was unordered,
but requires excessive (and unnecessary) coding when the block table
is ordered.
Instead of tracking indices we track the total number of 'live' (not
deleted) elements that will end up in the block table in hammer2_chain_core
and use that to determine when indirect blocks need to be created or not.
Block table entries are now only assigned by the flusher itself when it
determines that an entry must be added or deleted.
* The flusher now operates more deterministically by scanning the stacked
RBTREEs backwards (earliest to most recent). The stacks are not specifically
broken down by flush group (instead stacking only occurs if there is a
key range conflict), so the flusher still checks the modify_tid and
delete_tid for each chain it scans, but there should no longer be any
chance of media updates being misordered.
Because block table indices are now assigned by the flusher, each RBTREE
stack is scanned three times instead of twice. One for the recursion down
and two for the finalization on the way back up which updates the block
table. The block table scan was broken into two passes to handle deletions
in the first pass and insertions/updates in the second pass which allows
the block table to be updated on the fly without having to assign specific
array indices to chains.
* Replace the first_parent/next_parent linkages used to deal with multi-homed
chains (chains with multiple parents which can arise due to renames,
moves into or out of indirect blocks ,etc). Use a queue instead.
Remove the additional ref count used in the old linkage model. We must
still ensure that the final 'live' chain does not get removed when its
refs drops to 0.
Sepherosa Ziehau [Fri, 27 Sep 2013 03:57:14 +0000 (11:57 +0800)]
test: Test commit from new box xanadu2
Sepherosa Ziehau [Fri, 27 Sep 2013 03:19:10 +0000 (11:19 +0800)]
test: Test commit from new box xanadu1
Matthew Dillon [Thu, 26 Sep 2013 17:16:04 +0000 (10:16 -0700)]
kernel - Fix ifnet scan race in ipv6
* Fix situations where an ifnet scan can catch an interface as it is still
being initialized, before ifp->if_afdata[AF_INET6] is assigned.
* Add a global ifnet_token to protect if_index and the ifnet list.
WARNING, there are still SMP races in the ifnet scans, they have
not yet been instrumented with the new token.
* Also reorder the TAILQ_INSERT of a new if into the ifnet list to occur
after all the domain initialization has been done rather than before.
Sascha Wildner [Thu, 26 Sep 2013 09:21:48 +0000 (11:21 +0200)]
Fix i386 buildworld.
REALLY_X86_64 needs to be defined in order to be checked later in the
Makefile.
Sepherosa Ziehau [Thu, 26 Sep 2013 08:51:42 +0000 (16:51 +0800)]
mxge: Remove more useless code under IFNET_BUF_RING
Sepherosa Ziehau [Thu, 26 Sep 2013 01:27:07 +0000 (09:27 +0800)]
mxge: When MSI interrupt handler is triggered, 'valid' probably is set
François Tigeot [Tue, 24 Sep 2013 07:25:06 +0000 (09:25 +0200)]
drm: Use an include directory hierarchy similar to the Linux one
Sepherosa Ziehau [Wed, 25 Sep 2013 09:06:32 +0000 (17:06 +0800)]
mxge: Add macro for RX small buf length
Sepherosa Ziehau [Wed, 25 Sep 2013 08:36:53 +0000 (16:36 +0800)]
mxge: Mark TX queue no longer over-active earlier
François Tigeot [Wed, 25 Sep 2013 07:06:27 +0000 (09:06 +0200)]
drm: Reduce differences with Linux a bit
* drm_internal.h is no longer present in Linux
François Tigeot [Wed, 25 Sep 2013 06:34:28 +0000 (08:34 +0200)]
drm: Remove unused files
Sepherosa Ziehau [Wed, 25 Sep 2013 07:58:18 +0000 (15:58 +0800)]
mxge: Cache align TX and RX struct
Sepherosa Ziehau [Wed, 25 Sep 2013 06:00:40 +0000 (14:00 +0800)]
mxge: mxge_tx_buffer_state and mxge_rx_buffer_state are same now; merge them
Sepherosa Ziehau [Wed, 25 Sep 2013 05:57:44 +0000 (13:57 +0800)]
mxge: Nuke the flag field in mxge_tx_buffer_state
Instead of using flag to mark the end of the TX packet chain, we now
save mbuf in the last tx_buffer_state and use the mbuf pointer to mark
the end of the TX packet.
Sepherosa Ziehau [Wed, 25 Sep 2013 03:24:48 +0000 (11:24 +0800)]
mxge: Remove cnt from RX done ring struct; which serves no purpose
Sepherosa Ziehau [Wed, 25 Sep 2013 03:01:45 +0000 (11:01 +0800)]
mxge: Move busdma information for RX done ring out of the hot path
These information is rarely accessed
Matthew Dillon [Wed, 25 Sep 2013 06:57:10 +0000 (23:57 -0700)]
hammer2 - Add missing header file linkage
* Add vfs/hammer2 to the BSD.include.dist mtree.
Reported-by: swildner
Matthew Dillon [Wed, 25 Sep 2013 06:55:25 +0000 (23:55 -0700)]
hammer2 - Add missing header file linkage
* Add vfs/hammer2 to the list of directories for /usr/obj softlinked
headers.
Reported-by: swildner
Sepherosa Ziehau [Wed, 25 Sep 2013 02:30:29 +0000 (10:30 +0800)]
mgxe: Remove some fields from RX and TX ring struct
This packs RX and TX ring struct a little bit.
Matthew Dillon [Tue, 24 Sep 2013 22:14:26 +0000 (15:14 -0700)]
hammer2 - Add hammer2 boot support
* Add hammer2 boot loader support. The hammer2 boot loader accesses the
hammer2 mount starting at the super-root. To use hammer2 boot support
you need to have a PFS called 'boot', which will be seen as "/boot" by
the boot loader.
The 'boot' PFS can be created either by creating a boot-specific H2
partition with 'newfs_hammer2 -L boot ...', or by using
'hammer2 pfs-create boot' to create a PFS called 'boot'.
You can access any super-root if desired.
* Since boot is a super-root you can mix boot PFS's and other PFS's on the
same hammer2 filesystem, including creating a boot PFS far later on.
* WARNING!!!!! The 'boot' PFS must be configured without compression.
i.e. 'hammer2 setcomp autozero /boot' (assuming you've mounted it on /boot),
before you install anything. The newfs_hammer2 utility will automatically
handle this if you specify a label name of 'boot' (i.e. -L boot).
* WARNING!!!!! The BIOS may not be able to reliably access very high
sector numbers on large hard drives, so to be safe we recommend creating
a small 'a' partition anyway, unless the drive / main hammer2 filesystem
is small enough to not cause problems.
* Add %qx support to boot2's mini printf().
* Fix ipdata->comp_algo propagation bug in hammer2_inode_create()
* newfs_hammer2 and the pfs_create ioctl will set comp_algo to AUTOZERO
for PFS's called "boot" automatically.
Sascha Wildner [Tue, 24 Sep 2013 17:22:42 +0000 (19:22 +0200)]
Sepherosa Ziehau [Tue, 24 Sep 2013 16:10:04 +0000 (00:10 +0800)]
mxge: Remove mlen field from rx ring
This field actually serves no purpose
Sepherosa Ziehau [Tue, 24 Sep 2013 15:54:55 +0000 (23:54 +0800)]
mxge: Remove unused stats
Sepherosa Ziehau [Tue, 24 Sep 2013 14:00:05 +0000 (22:00 +0800)]
mxge: Make callout on the same CPU which handles interrupt
This avoids main serialize contention
Sepherosa Ziehau [Tue, 24 Sep 2013 13:18:49 +0000 (21:18 +0800)]
mxge: There is no need to hold TX serialize to check pkt_done
Since pkt_done is only updated by mxge_tx_done(), which is only called
from the interrupt handler, checking pkt_done from the interrupt handler
does not need TX serialize at all. This reduce TX serialize contention.
Sepherosa Ziehau [Tue, 24 Sep 2013 09:08:00 +0000 (17:08 +0800)]
mxge: Split one shared serializer into TX, RX and main serializers
This one gives ~150Mbps transmission performance improvement.
Sepherosa Ziehau [Tue, 24 Sep 2013 05:52:41 +0000 (13:52 +0800)]
acpi: Be lenient about unknown revision of FADT, MADT, XSDT and RSDT
Revision 5 FADT is found on on ASRock H77 Pro4-M, which is beyond the
revision even in ACPI-4.0a. Since length is checked for these tables,
this commit should be safe.
Matthew Dillon [Mon, 23 Sep 2013 22:18:35 +0000 (15:18 -0700)]
hammer2 - Cleanup and bugfix pass to hammer2 setcomp paths
* HAMMER2 will attempt to use LZ4 compression by default now.
* hammer2 setcomp now accepts text labels for the compression type and
accepts a compression level of 0 to set the default, which is simply
passed through to the VFS.
* Specify force and recursion flags in hammer2's main options rather than
after the setcomp command.
* Allow a list of paths to be specified rather than just one.
* The HAMMER2IOC_INODE_SET ioctl now only sets field elements which can
actually be modified by userland i.e. only the comp_algo field. It
used to set everything, including the indirect block table.
* Do not modify the hammer2_inode if the compression method is not being
changed.
* Change the zero-block testing logic a little, with related code cleanups.
Sascha Wildner [Mon, 23 Sep 2013 19:47:06 +0000 (21:47 +0200)]
libc/x86_64: Fix yet another (x86_64 specific) warning.
Sascha Wildner [Mon, 23 Sep 2013 18:33:02 +0000 (20:33 +0200)]
libc: Raise WARNS to 1 and fix warnings.
* Raise the priorities of our constructor functions from 0 to 101 because
0-100 are reserved priorities. This results in no change in object code
(as per comparison using hexdump(1)).
* Provide a prototype for _pthread_init_early().
* Be less strict in the exclusion of gdtoa's files to also match the files
outside contrib/ (in lib/libc/gdtoa/). Do the same for libc_rtld.
* Also fix an ignored attribute warning due to __thread being defined
empty in libc_rtld.
Note that the most important aspect of this commit is that it causes libc
to no longer be built with -w (suppress all warnings). This was the result
of a hack we have to ignore warnings for gdtoa (which resides in contrib/).
But in conjunction with WARNS being 0 it led to -w being set for _all_
files of libc.
Removing -w causes all the warnings which are enabled by default (even
without any -W options) to trigger again, in addition the few -W options
that WARNS=1 actually sets.
Thanks to aggelos for useful clues.
Sepherosa Ziehau [Mon, 23 Sep 2013 16:22:25 +0000 (00:22 +0800)]
mxge: Group RX related fields together
Prepare for upcoming serializer spliting
Mihai Carabas [Mon, 23 Sep 2013 14:14:53 +0000 (17:14 +0300)]
kernel - fix vkernel64 startup when no hw virtualization present
Mihai Carabas [Mon, 23 Sep 2013 07:54:38 +0000 (10:54 +0300)]
kernel: disable VMM for AMD SVM to not break the vkernel64
Sepherosa Ziehau [Mon, 23 Sep 2013 01:47:52 +0000 (09:47 +0800)]
kmalloc.9: Mention M_NULLOK in RETURN VALUE section
Sepherosa Ziehau [Mon, 23 Sep 2013 01:46:36 +0000 (09:46 +0800)]
kmalloc.9: Add kmalloc_raise_limit to NAME section
Sepherosa Ziehau [Mon, 23 Sep 2013 01:41:34 +0000 (09:41 +0800)]
em/emx: On attach path, perform another reset if the first one fails
The second reset fixes the 82573L attaching failure.
Reported-and-Tested-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
Sepherosa Ziehau [Mon, 23 Sep 2013 01:34:17 +0000 (09:34 +0800)]
em/emx: Fix attach error handling and media leakage in detach
- Add missing ether_ifdetach() if reset fails.
Reported-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
- Call ifmedia_removeall() on detach path, since these drivers add
ifmedia themselves; move ifmedia_init() to the beginning of attach
for this to work.
Mihai Carabas [Sun, 22 Sep 2013 15:25:46 +0000 (18:25 +0300)]
kernel: remove garbage symlink MYKERNEL64
Mihai Carabas [Sun, 22 Sep 2013 14:52:03 +0000 (17:52 +0300)]
test: test: README: testing commit bit
François Tigeot [Fri, 20 Sep 2013 07:05:12 +0000 (09:05 +0200)]
kernel: Add vm_phys_fictitious_unreg_range()
Rework vm_phys_fictitious_reg_range() a bit
Obtained-from: FreeBSD
Sepherosa Ziehau [Sun, 22 Sep 2013 12:14:22 +0000 (20:14 +0800)]
ifq: Add ifq_set_hw_serialize
This eases the drivers which use splitted serializers but only have one
transmit queue.
Sepherosa Ziehau [Sun, 22 Sep 2013 09:57:15 +0000 (17:57 +0800)]
mxge: Simplify MSI handling; cleanup legacy interrupt handling
Sepherosa Ziehau [Sun, 22 Sep 2013 08:56:05 +0000 (16:56 +0800)]
mxge: Limit unrelated softc fields' visibility to RX and TX path
Sascha Wildner [Sun, 22 Sep 2013 08:54:58 +0000 (10:54 +0200)]
libc/rpc: Fix some prototypes.
Sascha Wildner [Sun, 22 Sep 2013 06:17:41 +0000 (08:17 +0200)]
kernel/drm: Remove bogus typedef.
Sepherosa Ziehau [Sun, 22 Sep 2013 04:48:40 +0000 (12:48 +0800)]
mxge: Count oerrors in generic way
- Remove unused local oerrors field
- Remove stats updating code which applies only to FreeBSD IFNET_BUF_RING
Sepherosa Ziehau [Sun, 22 Sep 2013 03:27:59 +0000 (11:27 +0800)]
kmalloc.9: Update 'date'
Sepherosa Ziehau [Sun, 22 Sep 2013 03:27:21 +0000 (11:27 +0800)]
kmalloc.9: Mention kmalloc_raise_limit()
Sepherosa Ziehau [Sun, 22 Sep 2013 03:20:20 +0000 (11:20 +0800)]
kmalloc.9: M_INTWAIT is a proper "wait" flag too
Sepherosa Ziehau [Sun, 22 Sep 2013 03:19:27 +0000 (11:19 +0800)]
kmalloc.9: Mention M_NULLOK
Sepherosa Ziehau [Sun, 22 Sep 2013 02:57:03 +0000 (10:57 +0800)]
kmalloc.9: Mention allocated memory alignment garantee
Sepherosa Ziehau [Sun, 22 Sep 2013 02:56:13 +0000 (10:56 +0800)]
kmalloc.9: Mention kmalloc_cachealign()
Sepherosa Ziehau [Sun, 22 Sep 2013 02:44:55 +0000 (10:44 +0800)]
mxge: DragonFly's kmalloc(9) always returns 8 bytes aligned memory
Sepherosa Ziehau [Sun, 22 Sep 2013 01:48:57 +0000 (09:48 +0800)]
mxge: Fix various comment
Sepherosa Ziehau [Sat, 21 Sep 2013 14:55:07 +0000 (22:55 +0800)]
mxge: Utilize if_watchdog instead of knocking its own wheel out
Sascha Wildner [Sat, 21 Sep 2013 18:58:00 +0000 (20:58 +0200)]
kernel/drm: ttm_mem_global_free() is void, so don't return any result.
Sascha Wildner [Sat, 21 Sep 2013 18:05:40 +0000 (20:05 +0200)]
Fix typos (sytem -> system) in a manpage and a message.
Matthew Dillon [Sat, 21 Sep 2013 17:02:10 +0000 (10:02 -0700)]
buildworld - Fix buildworld conflict
* Remove EX_REBOOT from include/sysexits.h, it conflicts with the
buildworld.
* Replace EX_REBOOT with a local #define'd symbol in
vkernel64/platform/init.c.
Sepherosa Ziehau [Wed, 18 Sep 2013 05:27:42 +0000 (13:27 +0800)]
mxge: Cleanup code that frees pending mbufs
Sascha Wildner [Sat, 7 Sep 2013 22:45:19 +0000 (00:45 +0200)]
kernel/acpi: Sync acpi_thermal with FreeBSD.
Sascha Wildner [Sat, 21 Sep 2013 07:58:30 +0000 (09:58 +0200)]
kernel: Fix some recently introduced breakage.
vm_page_free() and vm_page_undirty() are now inline functions
in <vm/vm_page2.h>.
Matthew Dillon [Sat, 21 Sep 2013 04:11:42 +0000 (21:11 -0700)]
kernel - Drop overlapping ipv6 fragments
* Unconditionally drop overlapping ipv6 fragments as per
RFC 5722.
Reported-by: logan1, bug 2584, including patch
Matthew Dillon [Fri, 20 Sep 2013 23:15:43 +0000 (16:15 -0700)]
hammer2 - Merge Mihai Carabas's VKERNEL/VMM GSOC project into the main tree
* This merge contains work primarily by Mihai Carabas, with some misc
fixes also by Matthew Dillon.
* Special note on GSOC core
This is, needless to say, a huge amount of work compressed down into a
few paragraphs of comments. Adds the pc64/vmm subdirectory and tons
of stuff to support hardware virtualization in guest-user mode, plus
the ability for programs (vkernels) running in this mode to make normal
system calls to the host.
* Add system call infrastructure for VMM mode operations in kern/sys_vmm.c
which vectors through a structure to machine-specific implementations.
vmm_guest_ctl_args()
vmm_guest_sync_addr_args()
vmm_guest_ctl_args() - bootstrap VMM and EPT modes. Copydown the original
user stack for EPT (since EPT 'physical' addresses cannot reach that far
into the backing store represented by the process's original VM space).
Also installs the GUEST_CR3 for the guest using parameters supplied by
the guest.
vmm_guest_sync_addr_args() - A host helper function that the vkernel can
use to invalidate page tables on multiple real cpus. This is a lot more
efficient than having the vkernel try to do it itself with IPI signals
via cpusync*().
* Add Intel VMX support to the host infrastructure. Again, tons of work
compressed down into a one paragraph commit message. Intel VMX support
added. AMD SVM support is not part of this GSOC and not yet supported
by DragonFly.
* Remove PG_* defines for PTE's and related mmu operations. Replace with
a table lookup so the same pmap code can be used for normal page tables
and also EPT tables.
* Also include X86_PG_V defines specific to normal page tables for a few
situations outside the pmap code.
* Adjust DDB to disassemble SVM related (intel) instructions.
* Add infrastructure to exit1() to deal related structures.
* Optimize pfind() and pfindn() to remove the global token when looking
up the current process's PID (Matt)
* Add support for EPT (double layer page tables). This primarily required
adjusting the pmap code to use a table lookup to get the PG_* bits.
Add an indirect vector for copyin, copyout, and other user address space
copy operations to support manual walks when EPT is in use.
A multitude of system calls which manually looked up user addresses via
the vm_map now need a VMM layer call to translate EPT.
* Remove the MP lock from trapsignal() use cases in trap().
* (Matt) Add pthread_yield()s in most spin loops to help situations where
the vkernel is running on more cpu's than the host has, and to help with
scheduler edge cases on the host.
* (Matt) Add a pmap_fault_page_quick() infrastructure that vm_fault_page()
uses to try to shortcut operations and avoid locks. Implement it for
pc64. This function checks whether the page is already faulted in as
requested by looking up the PTE. If not it returns NULL and the full
blown vm_fault_page() code continues running.
* (Matt) Remove the MP lock from most the vkernel's trap() code
* (Matt) Use a shared spinlock when possible for certain critical paths
related to the copyin/copyout path.
Joris Giovannangeli [Fri, 20 Sep 2013 21:31:56 +0000 (23:31 +0200)]
dc(1): Sync with OpenBSD
Changes include :
* show an error message if the argument is a dir
* check value against UINT_MAX before casting to u_int; while
there fix a buglet in bexp(): x * UINT_MAX only overflows if x > 0
* fix fractional number exponentiation
* use BN_set_negative() and BN_is_negative() instead of subtracting or
comparing to zero
* For exponenttion, only warn if the fractional part of the exponent
is non-zero and avoid div by zero.
* let length(0.000) conform to what gnu bc does
* check for unitialized elements when accessing an array
* although there's no EOF condition defined for the handling of '?',
but anyway reset the eof condition on stdin, so you don't get an
infinite loop in the typical program after a ^D.
* convert malloc to calloc
* fix three leaks
* use size_t as stack size and ssize_t as stack pointer
* add missing bn_check
Revision for updated OpenBSD files are :
- bcode.c : 1.45
- bcode.h : 1.7
- dc.c : 1.11
- inout.c : 1.17
- stack.c : 1.11
Obtained-from: OpenBSD
Joris Giovannangeli [Fri, 20 Sep 2013 21:17:36 +0000 (23:17 +0200)]
bc(1): Sync with openBSD
This include the following changes :
* repair function when used with different scales
* Better error message on unexpected newline
* save/restore tty state on SIGTSTP/SIGCONT
* protect errno from damage in the signal handler
* make ^D behave well
dont't echo it and make it work if the cursor is at start of line after a ^C
* avoid usage of YY_FLUSH_BUFFER
- avoid YY_FLUSH_BUFFER: it is not signal safe and it does not work as intended
after the introduction of editline
- honour editline edit off mode
OpenBSD updated files revisions :
- scan.l : 1.28
- bc.y : 1.42
- bc.library : 1.4
- extern.h : 1.10
- tty.c : 1.1
Obtained-from: OpenBSD
Joris Giovannangeli [Fri, 20 Sep 2013 16:47:32 +0000 (18:47 +0200)]
test/test: test commit
François Tigeot [Sun, 15 Sep 2013 16:32:59 +0000 (18:32 +0200)]
drm: sync drmP.h with FreeBSD
François Tigeot [Thu, 19 Sep 2013 19:50:55 +0000 (21:50 +0200)]
drm: Update drm_pciids.h with Linux 3.8 data
Obtained-from: FreeBSD
Sascha Wildner [Thu, 19 Sep 2013 20:38:52 +0000 (22:38 +0200)]
kernel/usb4bsd: Silence an 'unused variable' warning in run(4).
François Tigeot [Tue, 17 Sep 2013 17:35:08 +0000 (19:35 +0200)]
drm/ttm: Fix a crash in vm_page_unwire()
François Tigeot [Sun, 15 Sep 2013 18:31:31 +0000 (20:31 +0200)]
kernel/x86_64: Add a 64-bit atomic function
* atomic_swap_long()
* also define atomic_store_rel_64() and atomic_swap_64() aliases
Sascha Wildner [Thu, 19 Sep 2013 16:15:24 +0000 (18:15 +0200)]
sleep.9: Adjust prototypes.
Matthew Dillon [Thu, 19 Sep 2013 04:01:45 +0000 (21:01 -0700)]
hammer2 - GSOC cleanup pass
* Cleanup some syntax and convert // comments in core source files.
Remove _t suffix on static compression type procedures, make a
few variable names shorter, etc.
* Used in-memory hammer2_inode->comp_heuristic instead of the on-media
ipdata->reserved85 field for the compression heuristic. It doesn't
need to be recorded on-media.
* If the write thread encounters an I/O error, flag the original logical
bp with the error and continue rather than breaking out and killing
the write thread.
Matthew Dillon [Thu, 19 Sep 2013 02:56:07 +0000 (19:56 -0700)]
hammer2 - Merge Daniel Flores's HAMMER2 GSOC project into the main tree
* This merge contains work primarily by Daniel Flores, and also by
Matthew Dillon. Daniel's work is focused around adding the compression
infrastructure while my work was focused around changing HAMMER2's
I/O infrastructure to work with the compression code.
Daniel's work involved adding the compression functions and heuristics,
modifying mainly vnops and vfsops to use them, adding the new buffer
cache write thread, and adding the new hammer2 utility directives and
related ioctls.
My work involved changing the H2 I/O infrastructure to always double-buffer
(i.e. logical buffers vs device buffers) because device buffers can now
wind up being a different size than the related logical buffers. I also
had to make changes to the hammer2_mount and hammer2_pfsmount mechanics
and other things to prevent deadlocks.
Daniel's Work
* Add the hammer2 setcomp directive which sets the compression mode on a
directory or file. If applie to a directory, the compression mode is
inherited by any new files or directories created under the directory.
Pre-existing subdirectories and files are not affected.
The directive has a recursive option to recurse down and set the mode on
everything underneath.
* Add wthread_bioq and related fields to hammer2_mount to support a
buffer cache buffer writing thread. This thread is responsible for
calculating compression sizes, allocating device buffer blocks, and
compressing logical buffers into the device buffers.
* Implement HAMMER2_COMP_AUTOZERO, HAMMER2_COMP_LZ4, and HAMMER2_COMP_ZLIB
compression modes. AUTOZERO is the zero-block detection code. LZ4 will
do zero-block-detection and LZ4 otherwise, and ZLIB will do
zero-block-detection and gzip otherwise.
This work entails a ton of new files imported from the LZ4 and ZLIB
projects plus lots of wiring.
The new files had to be cleaned up considerably, as well, since they
were originally intended for userland.
* Move synchronous device buffer handling out of hammer2_vop_write() and
into the support thread. Numerous procedures were moved out of
hammer2_vnops.c and into hammer2_vfsops.c as well.
This greatly simplifies hammer2_vop_write() as well as the truncate and
extend code, and improves the critical-path performance for write()
(at least until the buffer cache fills up or gets too far behind).
* Implement semi-synchronous decompression callbacks for read I/O and
read-ahead I/O.
* Add HAMMER2IOC_INODE_COMP_REC_SET and HAMMER2IOC_INODE_COMP_REC_SET2
ioctls to support the setcomp directive.
Matthew's Work
* The hammer2_inode copies additional fields from the inode data, allowing
the inode data to be deallocated after use.
* Due to the way the buffer cache now operates, multiple deletions of the
same chain key can occur within the same transaction. Adjust the RBTREE
compare code to handle the case.
* Track chain structure use on a pfsmount-by-pfsmount basis for current
and future management of the kmalloc pools used by hammer2.
* Rework the way inodes are locked to track chain modifications.
* Rewrite hammer2_chain_delete_duplicate().
* Rewrite hammer2_trans_init() and the flush code primarily to fix
deadlocks in the flush synchronization mechanics.
* Interlock very low level chain operations with a spin lock instead
of the full-blown chain lock to deal with potential deadlocks and
fix a few SMP races.
* For the moment make all logical buffers 64KB. Not efficient for small
files and will be changed back at some point but necessary for efficient
compression at the moment.
* Implement an asynchronous buffer cache callback feature.
* Use a localized in-hammer2_inode-structure size field for frontend
operations, including extend and truncate, to remove confusion against
backend flushes. This way the inode data can be modified only during
the flush and not before where it might cause confusion with previously
staged flushes.
François Tigeot [Wed, 18 Sep 2013 19:48:58 +0000 (21:48 +0200)]
inet6: Add missing ifioctl credential checks
This fixes issue #2581 (again), but with SIOCSIFBRDADDR and
SIOCSIFNETMASK ioctls this time.
Security: CVE-2013-5691
Patch-from: Loganaden Velvindron, inspired by FreeBSD changes
Sascha Wildner [Wed, 18 Sep 2013 20:46:59 +0000 (22:46 +0200)]
dsched.9: Fix dsched_new_policy_thread_io()'s prototype (see
5374d04f).
Sascha Wildner [Wed, 18 Sep 2013 20:45:54 +0000 (22:45 +0200)]
token.9: lwkt_token_init()'s desc argument is const.