John Marino [Wed, 22 Jul 2015 17:08:43 +0000 (19:08 +0200)]
locales LC_NUMERIC: Overhaul completely wrong definitions
I have no idea how the UTF-8 definitions were created. They appear
to be grouped by (allegedly) similar countries with the same
definitions as other codesets. The assumption is wrong. I went through
every POSIX (UTF-8) definition on http://unicode.org and redefined all
UTF-8 locales. Besides being correct, there are 2 additional benefits:
1) The makefile is loads simpler, at least for UTF-8 part
2) This fixes a lot of locale failures on gcc testsuite
John Marino [Wed, 22 Jul 2015 13:39:12 +0000 (15:39 +0200)]
locales: Add 66 "@euro" symlinks, and UTF8 alias
While not documented, it appears that modifiers work. The only widely
used modifier is "@euro" which is an alias for ISO 8859-15 coded which
contains the Euro currently along with 7 other new symbols as compared
to ISO 8859-1. For all 33 localization sets that use la_LN.ISO8859-15
for LC_CTYPE, I'm creating an @euro and .ISO-8859-15@euro symlink to
them. These are still found on Linux and the .ISO-8859* extension is
the chosen linux format (this is unfortanately not standardized thus
BSD and Linux differ). Thus any use of @euro will probably also refer
to the Linux format and that's why I chose it.
For the same reason, .UTF8 versions (Linux) are being symlinked to
DragonFly's .UTF-8 versions. Symlinks are cheap.
John Marino [Wed, 22 Jul 2015 11:59:56 +0000 (13:59 +0200)]
make upgrade: Remove 122 dangling locale symlinks
The symlinks mechanism that created these extra symlinks has been fixed,
so now let's clean up the mess.
John Marino [Wed, 22 Jul 2015 11:54:22 +0000 (13:54 +0200)]
bsd.links.mk: Support symlinks to directories
Recently locales support utilized symlinks to directories. On the
second installworld, the links were followed and installed there,
creating dangling links. The commit forces symlinks to directories to
be removed before recreating them (as is done for files). The effect
on file symlinks is unchanged.
Sascha Wildner [Tue, 21 Jul 2015 17:25:16 +0000 (19:25 +0200)]
kernel/acpi_toshiba: Use NULL for pointers.
Tomohiro Kusumi [Tue, 21 Jul 2015 10:34:28 +0000 (19:34 +0900)]
sys/vfs/hammer: Fix comments
- Fix comments left unchanged in
1afb73cf. It seems the same comments
are still effective with rbtree.
Tomohiro Kusumi [Tue, 21 Jul 2015 10:34:00 +0000 (19:34 +0900)]
sys/vfs/hammer: Remove unused typedef
- hammer_seq_t was only used in the early days of hammer.
Tomohiro Kusumi [Mon, 20 Jul 2015 18:45:36 +0000 (03:45 +0900)]
sbin/hammer: Fix hammer checkmap big-block offset
- hammer checkmap wasn't showing the offset of big-block for each
layer2 within a layer1 correctly.
- (The checkmap for supported zones works the same, and there was
nothing nothing wrong with that, but offsets in output were not
correct)
Tomohiro Kusumi [Sun, 19 Jul 2015 20:30:07 +0000 (05:30 +0900)]
sbin/hammer: Make hammer blockmap print all blockmap offsets
- Add phys_offset and first_offset, where phys_offset points to
zone2 address of the layer1 big-block.
Tomohiro Kusumi [Sun, 19 Jul 2015 15:33:36 +0000 (00:33 +0900)]
sbin/hammer: Make hammer_parsedevs() initialize NumVolumes
- hammer_parsedevs() should initialize NumVolumes as well as
initializing volumes. This is as simple as incrementing the
counter each time setup_volume() is called.
- newfs_hammer can tell and initialize NumVolumes from argc,
however low-level hammer commands that use hammer_parsedevs()
can't do this because a blkdevs arg contains volumes joined
by ':'. These commands need a way to initialize NumVolumes.
Tomohiro Kusumi [Sun, 19 Jul 2015 10:40:16 +0000 (19:40 +0900)]
sbin/hammer: Cleanup AssertOnFailure assertions on blockmap lookup
- Since now that blockmap_lookup() has an unique 'error' value
for each error, the function can assert-0 at the end of the
function with the 'error' value when AssertOnFailure is set.
- This makes code clearer as the function doesn't have to have
two types of error check (assert-cond or goto-done-if-not-cond)
for 9 different error cases.
Tomohiro Kusumi [Sat, 18 Jul 2015 21:44:02 +0000 (06:44 +0900)]
sbin/hammer: Fix fill info of hammer show
- Printing big-block index within lower 60 bits (layer1/2 combined)
is not that useful. It should print an index within each layer.
- It dissects zoneX (where X is either of 8,9,10,11) offset into
layer1 index, layer2 index, big-block offset and prints those.
Tomohiro Kusumi [Sat, 18 Jul 2015 20:12:54 +0000 (05:12 +0900)]
sbin/hammer: Minor cleanups
- Some minor cleanups.
Sascha Wildner [Tue, 21 Jul 2015 07:03:43 +0000 (09:03 +0200)]
kernel/syscons: Enable kern.kms_console by default (if *kms.ko are loaded).
Matthew Dillon [Tue, 21 Jul 2015 04:01:52 +0000 (21:01 -0700)]
kernel - Hack pcm audio for firefox issue
* Observed that the firefox thread handling sound output winds up being
in a cpu-bound loop calling poll() on two descriptors, one being the
/dev/dsp descriptor. With some debugging, determined that this call
occurs with the sound buffer ~slightly less than half full.
The sound is generated via the dports/audio/alsa-plugins (oss) library,
but the poll() appears to come from the snd_pcm_ioplug subsystem. It
appears that this subsystem has a bug in it when pacing sound output,
it still polls and live-loops on the sound output descriptor even when
it has no new data to send to the decriptor.
* There could be something else going on here with assumptions made by
linux sound client code vs our implementation, but I don't know what
they might be.
* This is probably not the correct fix, but we hack in a change to not
generate POLLWR events until the sound buffer is at least half empty.
This matches up with observed behavior from the above subsystem and
prevents the cpu loop.
It should be harmless to other code using kqueue/select/poll.
Appears to fix firefox's live looping in poll() during sound and
video (w/sound) playback.
Matthew Dillon [Mon, 20 Jul 2015 18:27:49 +0000 (11:27 -0700)]
kernel - Fix pmap_change_attr() use cases.
* In DragonFly this function takes a page count, not a byte count.
some calls were made with a byte count, others with a page count.
Note that in FreeBSD this function takes a byte count, but after
reviewing the use cases I decided to normalize it all to a page count.
* Fixes reported DRM issues. Might also fix test branch ehci/ethernet
panics due to memory corruption when DRM is loaded.
Matthew Dillon [Mon, 20 Jul 2015 18:21:47 +0000 (11:21 -0700)]
kernel - Fix general MSI/interrupt issue with HDAA
* Testing on J1900, MSI didn't work and the normal interrupt mode
was stuck on, resulting in an interrupt storm.
* Problem was tracked down to a missing initialization of the WAKEEN
(wake enable) bits. Intel errata documentation clarifies that these bits
might not be cleared by a chip reset (since the idea is to support a
wake event).
On the J1900 some of these bits were found to be set, which caused
STATESTS to force an interrupt event and prevent additional
MSI events.
* Clearing the WAKEEN bits fixes the interrupt storm and MSI appears to
work again. STATESTS is only used to detect CODECs and there's no reason
to try to clear it (which would mess up driver reloads).
* Remove the QUIRK added in the previous commit.
* Reverse the resource hint test, run it after loading the quirk table
so it can override the quirk table.
Markus Pfeiffer [Mon, 20 Jul 2015 13:37:30 +0000 (14:37 +0100)]
usb4bsd/pci: Correct typo in bootverbose message
Matthew Dillon [Mon, 20 Jul 2015 06:41:42 +0000 (23:41 -0700)]
kernel - Quick Baytrail to disable MSI
* Intel hdac on valleyview (Baytrail id?) interrupt does not work with MSI,
quirk it off. This is a medium-end Atom cpu.
* Tested on Intel(R) Celeron(R) CPU J1900 @ 1.99GHz system.
Matthew Dillon [Mon, 20 Jul 2015 06:00:24 +0000 (23:00 -0700)]
drm - Add valleyview support
* Fix infininte loop during PCI iteration. The previous code was not
actually iterating, so any loop would wind up being infinite. Valleyview
triggers this issue.
* Fix improper register offset in intel_gpio_setup() (note, linux master
also made this fix in April).
* Allow hw.drm.debug to be modified with a sysctl.
Matthew Dillon [Mon, 20 Jul 2015 05:55:58 +0000 (22:55 -0700)]
kernel - Add valleyview PCI ids and support to agp.
* Add valleyview PCI ids and support.
* Fix a number of cases where gpu PCI space registers were being accessed
via the bridge. Parts of the GPU PCI space was replicated on the bridge
in the past, but not necessarily in the future and not in valleyview.
Matthew Dillon [Mon, 20 Jul 2015 05:52:09 +0000 (22:52 -0700)]
kernel - Add PCI functionality
* Add pci_iterate_class() for the drm code.
Sepherosa Ziehau [Fri, 17 Jul 2015 14:50:06 +0000 (22:50 +0800)]
powerd: Add options to limit CPU power domains' frequency
Sascha Wildner [Sun, 19 Jul 2015 18:36:00 +0000 (20:36 +0200)]
kernel/acpi: Prefer _BIX to _BIF for battery info if it is present.
As it is stated in the ACPI specification 6.0:
"The _BIF object is deprecated in lieu of _BIX in ACPI 4.0."
The seven additional fields of the package which _BIX returns
are skipped for now.
Sascha Wildner [Sun, 19 Jul 2015 18:03:33 +0000 (20:03 +0200)]
Stop removing /usr/include/machine/ieee.h via 'make upgrade' again.
It is now installed again.
Sascha Wildner [Sun, 19 Jul 2015 17:30:25 +0000 (19:30 +0200)]
kernel/usb4bsd: Fix buildkernel.
Sascha Wildner [Sun, 19 Jul 2015 11:46:05 +0000 (13:46 +0200)]
ddb: Add a command to call the ACPICA debugger if ACPI_DEBUG is specified.
Code stolen from AcpiDbUserCommands() but it won't AcpiTerminate() upon
"Exit" or "Quit" commands so that we may 'continue' from ddb.
Sascha Wildner [Sat, 2 May 2015 09:31:15 +0000 (11:31 +0200)]
kernel/kprintf: Implement the space flag, as in '% 7ld'.
The ACPICA debugger needs it for the 'Info Misc' command.
Sascha Wildner [Sun, 19 Jul 2015 10:34:45 +0000 (12:34 +0200)]
kernel/usb4bsd: Add device enumeration and port power disabling support.
Adds some sysctls/tunables, none of which are set by default.
John Marino [Sat, 18 Jul 2015 22:22:03 +0000 (00:22 +0200)]
gcc50: Change c++ locale handling
The biggest change is removing the modification of the specified locale.
Before locales without extensions were appended with ".UTF-8" and
modifiers (e.g. @euro) were silently stripped off.
The latter is probably a bad idea, and even if we want to continue doing
this (modifiers are not supported), it should be done at the library
level, not at c++ on gcc level. The no-extension problem has been solved
today by creating symlinks at /usr/share/locale.
The logic of the "gnu" support was mimicked by using newlocale, duplocale,
and freelocale. The generic version uses setlocale only. This patch will
be pushed upstream most likely.
Tomohiro Kusumi [Sat, 18 Jul 2015 15:41:22 +0000 (00:41 +0900)]
sbin/hammer: Make hammer blockmap show verbose info on -v
- Shows volume# and layer1/layer2 index or offset when -v(v) is used.
Tomohiro Kusumi [Sat, 18 Jul 2015 15:38:43 +0000 (00:38 +0900)]
sys/vfs/hammer: Add HAMMER_BLOCKMAP_LAYER[12]_INDEX()
- This commit adds HAMMER_BLOCKMAP_LAYER[12]_INDEX() which is
/=sizeof(layer[12]) version of HAMMER_BLOCKMAP_LAYER[12]_OFFSET().
- This is useful as it sometimes (the next commit, debugging, etc)
wants to retrieve an index of layer1/2 instead of an offset.
Tomohiro Kusumi [Sat, 18 Jul 2015 09:49:34 +0000 (18:49 +0900)]
sbin/hammer: Align zone# in hammer blockmap output
- Use printf("%-2d") for zone.
Tomohiro Kusumi [Sat, 18 Jul 2015 07:32:04 +0000 (16:32 +0900)]
sbin/newfs_hammer: Minor fixes
- It's better to call rel_volume() for the root volume here
without waiting for potential non-root ones to do it as
they all modifies the root volume.
- Also add assertions to ensure a caller calls this function
for the root volume first, and then non-root volumes.
(non-root volumes do += to these volume statistics)
Tomohiro Kusumi [Sat, 18 Jul 2015 06:57:31 +0000 (15:57 +0900)]
sbin/hammer: Remove modified1 flag
- modified1 isn't necessary and also the code is clearer without
this flag.
- Once layer1 big-block is initialized, the only thing allocator
has to do to layer1 is ++ or -- layer1->blocks_free and update
crc. So it's better to just update crc whenever layer1->blocks_free
got ++ or --.
John Marino [Sat, 18 Jul 2015 17:27:33 +0000 (19:27 +0200)]
default/compilers.conf: Fix include path
Reported by: zrj
John Marino [Sat, 18 Jul 2015 15:04:01 +0000 (17:04 +0200)]
OpenLIBM: Undefine two C99 macros
Martynas@openbsd believes that only fast FMA for float is implemented,
and that the double and long double versions are not "fast". This also
matches what FreeBSD has so I'm reverting these new definitions on his
recommendation.
John Marino [Sat, 18 Jul 2015 09:13:51 +0000 (11:13 +0200)]
Create short name locales
In other (non-BSD?) platforms, it's possible to use a locale such as
"en_GB". Up until now, this did not work on DragonFly. It required
a codeset as well, so if "en_GB.UTF-8" wasn't specified, setlocale
would fail.
Every locale except two has a version that uses the UTF-8 codeset,
so a symlink was created to these to create these territory locales.
The other two are
hi_IN => hi_IN.ISCII-DEV
la_LN => la_LN.ISO8859-1
This should improve cross-platform compatibility, and it will lead
to a change in gcc50 libstdc++ locale handling.
While here, set the "share" directory to build in parallel rather
than serially.
John Marino [Sat, 18 Jul 2015 07:27:06 +0000 (09:27 +0200)]
GCC50: Upgrade base compiler to GCC release 5.2
John Marino [Sat, 18 Jul 2015 07:51:54 +0000 (09:51 +0200)]
Merge branch 'vendor/GCC50'
John Marino [Sat, 18 Jul 2015 01:50:11 +0000 (03:50 +0200)]
Update gcc-50 to SVN version 225979 (gcc-5-branch)
This is equivalent to gcc 5.2 release plus a few additional commits
that came through when the gcc-5 branch reopened.
Last Changed Date: 2015-07-18 02:16:08 +0200 (Sat, 18 Jul 2015)
Nuno Antunes [Sat, 4 Aug 2012 08:03:23 +0000 (09:03 +0100)]
devfs: Use lwkt_domsg() instead of lwkt_sendmsg() + lwkt_waitport().
* lwkt_domsg() already implements the concept of synchronous message
execution, use it instead.
* The caller of devfs_msg_send_sync() has allocated the message and
keeps a reference to it, so we don't need to return the reference
back. Return the message error instead.
Nuno Antunes [Thu, 2 Aug 2012 11:41:14 +0000 (12:41 +0100)]
kernel: Use lwkt_domsg() instead of lwkt_sendmsg() + lwkt_waitmsg().
Sascha Wildner [Sat, 18 Jul 2015 03:12:00 +0000 (05:12 +0200)]
Sync ACPICA with Intel's version
20150717.
* Better partitioning between debugger and disassembler.
* Add 'Trace' command to the debugger.
* Add support for the TCPA table to compiler and template generator.
* Fix '!!' command issue in the debugger. This had already been committed.
* Various cleanups and fixes.
For a more detailed list, please see sys/contrib/dev/acpica/changes.txt.
John Marino [Fri, 17 Jul 2015 23:15:16 +0000 (01:15 +0200)]
Remove now-unused hostapd source files from contrib
John Marino [Fri, 17 Jul 2015 22:23:10 +0000 (00:23 +0200)]
Disconnect hostapd from building in base
There is insufficient reason to have hostapd in base at all. Moveover,
this version is three releases behind and probably has several security
vulnerabilities. Users that need a wifi access point should install
net/hostapd instead which the latest release and patched for known
security issues.
approved-by: dillon
Tomohiro Kusumi [Fri, 17 Jul 2015 11:36:07 +0000 (20:36 +0900)]
sbin/hammer: Assert simplified blockmap allocator
- alloc_blockmap() is a simplified blockmap allocator of
kernel function hammer_blockmap_alloc() as the comment says.
alloc_blockmap() is not aware of layer1 boundary since it
lacks layer1 boundary check and zone wrap check. This still
works for newfs_hammer because it's guaranteed that the newfs
never hits layer1 boundary even in the worst case[*] when
there are 2^8 volumes and each volume is 2^52 bytes storage.
- This commit adds assertions to ensure it's safe to use the
simplified allocator. If a caller hits the assertions then
the program does more than what this allocator supports.
--
[*] In the worst case each volume has 2^(18-8) big-blocks
for layer2 metadata which totals (8[MB] * 1024) = 8[GB].
Other than layer2 metadata, the root volume has 1 big-block
for layer1 metadata, less than 128 big-blocks for undo fifo,
and 1 big-block for btree and meta zone each. These add up
to somewhere between 8-10[GB] but it's still far less than
a single layer1 capacity of 4[TB]. Non-root volumes consume
a bit less than the root volume since it only has layer2
metadata initially which also fits in a single layer1.
The blockmaps for the root and non-root volumes would look
something like the following.
volume#0
zone big-blocks note
==============================================================
4 1 2^18 * layer1 = 2^(18+5) = 8[MB]
4 1024 2^19 * layer2 * 1024 = 2^(19+4+10) = 8[GB]
3 n undo zone for undo fifo (n <= 128)
8 1 btree zone for root btree node
9 1 meta zone for root inode and pfs0
volume#N (0<N<256)
zone big-blocks note
==============================================================
4 1024 2^19 * layer2 * 1024 = 2^(19+4+10) = 8[GB]
Tomohiro Kusumi [Thu, 16 Jul 2015 15:50:05 +0000 (00:50 +0900)]
sbin/hammer: Fix wrong free big-blocks counter
- newfs_hammer needs to decrement extra 2 big-blocks from
vol0_stat_freebigblocks for zone 8 and 9.
- newfs_hammer has following three lines that allocate the root
inode, root btree node, and pfs0 metadata for zone 8 and 9,
however because alloc_blockmap() doesn't decrement vol0_stat
_freebigblocks when a blockmap first meets a new layer2,
the volume header shows vol0_stat_freebigblocks 2 more than
it actually is.
bnode = alloc_btree_element(&btree_off, &data_buffer0);
idata = alloc_meta_element(&data_off, sizeof(*idata), &data_buffer1);
pfsd = alloc_meta_element(&pfsd_off, sizeof(*pfsd), &data_buffer2);
- This also means vol0_stat_bigblocks and vol0_stat_freebigblocks
are not equal initially. This commit makes vol0_stat_bigblocks
equal (vol0_stat_freebigblocks + 2), while these two were equal
until this commit. This should make sense than decrementing
vol0_stat_bigblocks by 2 to make these two look the same,
because inodes and btree nodes allocated by regular filesystem
operations do decrement vol0_stat_freebigblocks whenever a new
big-block is allocated and those are counted as used big-blocks.
The initial inode, btree node and pfs shouldn't be an exception.
The diff of hammer info command right after newfs_hammer would
look like this.
==========
# diff -aNur ./before ./after
--- ./before 2015-07-17 03:17:10.
999193000 +0900
+++ ./after 2015-07-17 03:17:14.
649193000 +0900
@@ -1,17 +1,17 @@
<snip>
Big-block information
Total 178376
- Used 0 (0.00%)
+ Used 2 (0.00%) /* inode/btree/pfs0 */
Reserved 45 (0.03%)
- Free 178331 (99.97%)
+ Free 178329 (99.97%) /* 2 less than before */
Space information
No. Inodes 1
Total size 1.4T (
1496326340608 bytes)
- Used 0B (0.00%)
+ Used 16M (0.00%) /* 2x8[MB] more than before */
Reserved 360M (0.03%)
Free 1.4T (99.97%)
PFS information
==========
Tomohiro Kusumi [Thu, 16 Jul 2015 14:54:18 +0000 (23:54 +0900)]
sbin/hammer: Optimize layer1 crc update
- layer1->layer1_crc needs update only when layer1 metadata gets
modified. In this case, it needs update only when a blockmap finds
a new layer2 that hasn't been touched yet, because that's when
layer1 metadata's free layer2 count is decremented.
Tomohiro Kusumi [Thu, 16 Jul 2015 14:50:33 +0000 (23:50 +0900)]
sbin/hammer: Properly set modified flag for blockmap
- When a blockmap finds the current layer2 (that corresponds to
blockmap->next_offset) belongs to a different zone and go to
the next layer2 by incrementing blockmap->next_offset, it should
set modified flag just like other ones do.
- If this function is ever changed to goto fail; without exit(1);
on failure, then a blockmap whose next_offset got incremented
here may be left without ondisk update.
Tomohiro Kusumi [Wed, 15 Jul 2015 17:45:41 +0000 (02:45 +0900)]
sbin/hammer: Fix boundary check
- It should be (next_offset + bytes - 1).
- alloc_blockmap() has only been used by newfs_hammer for root
inode, btree root node, and pfs0 metadata, and these don't
cross 16KB boundary so there hasn't been any issue.
Tomohiro Kusumi [Tue, 14 Jul 2015 23:18:38 +0000 (08:18 +0900)]
sys/vfs/hammer: Make HAMMER_ENCODE() take zone index instead of base
- HAMMER_ENCODE() macro added in cbf2551 should have taken zone index
for the first argument, instead of directly importing zone base
based code from format_blockmap().
- The zone base arg and other two args having overwrapped bits is
confusing, and not really good for anything. If zone base has non
zero for non-zone-bits then those bits should go to other two args.
- (format_blockmap() has been changed to take zone/offset instead of
the encoded one, but no external programs will need this function.
The same for the HAMMER_ENCODE() macro)
Tomohiro Kusumi [Tue, 14 Jul 2015 22:22:33 +0000 (07:22 +0900)]
sys/vfs/hammer: Add zoneX version of hammer_xlate_to_zone2()
- Add hammer_xlate_to_zoneX() macro as a generic version of
hammer_xlate_to_zone2().
Tomohiro Kusumi [Tue, 14 Jul 2015 11:48:25 +0000 (20:48 +0900)]
sbin/hammer: Remove unnecessary zone encoding
- This zone encoding isn't necessary since *result_offp is already
'zone' offset. HAMMER_ZONE_ENCODE() only cuts off zone bits from
*result_offp and then |= with 'zone' for zone bits, which results
the same as *result_offp.
- Also the name of the local variable 'zone2_offset' should have been
'zoneX_offset' since zone depends on what the 'zone' value is.
John Marino [Fri, 17 Jul 2015 06:26:03 +0000 (08:26 +0200)]
OpenLIBM: local mod -- add back C99 macros
The math.h header of OpenBSD's library is missing some C99 macro
defintions. Most of these we had before. FP_FAST_FMA and FP_FAST_FMAL
are new, but I believe should have been defined before.
Reported by: swildner
Sepherosa Ziehau [Thu, 16 Jul 2015 14:17:21 +0000 (22:17 +0800)]
powerd.8: Fix comment about P-state effect on Intel CPUs
It looks like P-state still has effect on Intel E5 v2 CPUs at least.
Sepherosa Ziehau [Thu, 16 Jul 2015 14:13:30 +0000 (22:13 +0800)]
ipiq: Add description for ipi latency measurement sysctls
Suggested-by: swildner@
Sepherosa Ziehau [Thu, 16 Jul 2015 14:08:33 +0000 (22:08 +0800)]
sysperf/ipitest: Run latency tests on all available CPUs
3 CPUs are too small even for 2-way configuration.
Matthew Dillon [Fri, 17 Jul 2015 03:46:02 +0000 (20:46 -0700)]
kernel - Reduce ACPI dmesg spam a little
* Reduce repetitive 'MPTABLE: warning PCI int dst apic id %d...' warnings.
Matthew Dillon [Fri, 17 Jul 2015 03:30:12 +0000 (20:30 -0700)]
kernel - MFC
160de052b2 from FreeBSD (persist timer)
Avoid a situation where we do not set persist timer after a zero window
condition. If you send a 0-length packet, but there is data is the socket
buffer, and neither the rexmt or persist timer is already set, then
activate the persist timer.
Author: hiren <hiren@FreeBSD.org>
Taken-from: FreeBSD
Matthew Dillon [Fri, 17 Jul 2015 03:26:49 +0000 (20:26 -0700)]
kernel - Reduce mountroot intr_config_hook wait to 30 seconds
* Reduce the amount of time mountroot waits for storage busses and
devices to finish configuration from 60 seconds to 30 seconds.
* Fix rare races in the intr_config_hook API by adding a lock to
hook operations.
Matthew Dillon [Fri, 17 Jul 2015 03:21:11 +0000 (20:21 -0700)]
kernel - Fix mountroot / usb diskkey race.
* Use the intr_config_hook mechanism to prevent mountroot from running
until all usb busses have completed two scans. umass's CAM
intr_config_hook will take over once umass is detected.
* Pull the hw.usb.xhci.use_polling tunable out of USB_DEBUG and make it work
generally. Setting this feature in /boot/loader.conf to 1 forces xhci to
always poll.
The polling rate is not the best in the world with this commit so do
not expect good performance. Only use if your USB doesn't work due to
e.g. interrupt routing issues.
John Marino [Thu, 16 Jul 2015 14:10:58 +0000 (16:10 +0200)]
Fix installation of libm man page(s)
diagnosed-by: swildner
John Marino [Thu, 16 Jul 2015 13:22:17 +0000 (15:22 +0200)]
OpenLIBM: Replace complex ACOSH functions
The regression tests revealed a bug in the OpenBSD complex COSH
function implementation. The FreeBSD implementation has been brought in,
at least temporarily, to address the regression.
It is likely that the ASINH functions are deficient with the edge cases
as well, but they've been left alone for now. The OpenBSD complex
functions implementation probably needs to be reviewed and reworked based
on my review of the OpenSolaris libm and FreeBSD msun implementations
John Marino [Thu, 16 Jul 2015 07:31:14 +0000 (09:31 +0200)]
OpenLIBM: Replace nextafterl function with FreeBSD's version
The nextafterl function is not coming up with the correct results. On
GCC's fortran round_4 test, a bit was being added to the lx component
where on FreeBSD it was being subtracted.
Replacing the source file with the equivalent of FreeBSD's version fixed
the rounding regression we saw after moving to OpenBSD's libm. Upstream
will be informed, so potentially this is only temporary.
John Marino [Wed, 15 Jul 2015 23:11:04 +0000 (01:11 +0200)]
OpenLIBM: Try to fix nextafterl
My first attempt at fixing this function to deal with the always-true
<unsigned variable> > 0 condition was a mistake. The problem was that
esy and esy were typed as u_int32_t when they should have been "int"
according to math_private.h.
This still doesn't fix the rounding error in Fortran so it's possible
this function is still broken (upstream too). The FreeBSD version is
a bit different.
François Tigeot [Wed, 15 Jul 2015 19:22:48 +0000 (21:22 +0200)]
kernel/linux: Implement idr_preload() and idr_preload_end()
Matthew Dillon [Wed, 15 Jul 2015 18:50:17 +0000 (11:50 -0700)]
wmake - Improve use case for incremental world build/installs
* If DESTDIR=<blah> is specified, automatically supply
_SHLIBDIRPREFIX=<same>.
Testing-by: marino
John Marino [Wed, 15 Jul 2015 17:57:56 +0000 (19:57 +0200)]
OpenLIBM: Fix initializing FP environment
This was discovered by zrj running OpenBSD's libm regression test.
DragonFly (and FreeBSD) using a different variable name for the
FPU control word initial value.
This fixes associated environment assertions for libm.
Sascha Wildner [Wed, 15 Jul 2015 11:03:21 +0000 (13:03 +0200)]
i386 removal, part 18/x: Remove an i386 specific option.
Sascha Wildner [Wed, 15 Jul 2015 11:01:11 +0000 (13:01 +0200)]
Add wpi(4) to our default config.
Reported-and-tested-by: libertas on #dragonflybsd
Sascha Wildner [Wed, 15 Jul 2015 11:05:04 +0000 (13:05 +0200)]
Update the pciconf(8) database.
July 10, 2015 snapshot from http://pciids.sourceforge.net/
John Marino [Wed, 15 Jul 2015 09:12:30 +0000 (11:12 +0200)]
OpenLIBM: Add missing symbol fegetexcept (DF404.0)
While here, move fe* symbols from main map to amd64 map.
Reported-by: zrj
Sepherosa Ziehau [Tue, 14 Jul 2015 14:49:31 +0000 (22:49 +0800)]
x86_64/mwait: Expose preamble mask for C3+ transition
Sepherosa Ziehau [Tue, 14 Jul 2015 14:29:32 +0000 (22:29 +0800)]
acpi/pstate: Force CPU package power domain for Intel CPUs
Sepherosa Ziehau [Tue, 14 Jul 2015 14:11:22 +0000 (22:11 +0800)]
powerd: Reverse the meaning of -e option
Intel Performance and Energy Bias Hint does not seem to have visible
effect on either power consumption, thermal control or cpu dynamic
frequency adjustment.
Matthew Dillon [Tue, 14 Jul 2015 22:52:31 +0000 (15:52 -0700)]
syscons - improve debugger entry
* Reduce stalls during debugger entry.
François Tigeot [Tue, 14 Jul 2015 21:20:26 +0000 (23:20 +0200)]
kernel/linux: Fix a bug in idr_alloc()
That function was only doing a single memory allocation and didn't
try to grow the underlying idr storage when needed.
John Marino [Tue, 14 Jul 2015 21:04:21 +0000 (23:04 +0200)]
OpenLIBM: Add 3 new symbols to map
We gained three additional functions with the move to OpenBSD libm:
catanhl
casinhl
cacoshl
They were built but filtered out because they weren't on the symbol
map before.
Matthew Dillon [Tue, 14 Jul 2015 20:33:49 +0000 (13:33 -0700)]
kernel - Fix live lock in vfs_conf.c mountroot>
* The mountroot> prompt calls cngetc() to process user input. However, this
function hard loops and can prevent other kernel threads from running on
the current cpu.
* Rearrange the code to use cncheckc() and a 1/25 second tsleep().
* Fix a bug in the syscons code where NOKEY was not being properly returned
as documented. Modify all use cases to handle NOKEY. This allows us to
differentiate between a keyboard present but not key pressed and a keyboard
not present.
* Pull the automatic polling mode code out of cncheckc() (or more precisely,
out of sccncheckc()) and add a new cnpoll() API function to set it manually.
This fixes issues in vfs_conf when normal keyboard processing interrupts
are operational and cncheckc() is used with a tsleep() delay. The normal
processing interrupt wound up eating the keystrokes so the cncheckc()
basically always failed.
cncheckc() in general also always had a small window of opportunity where
a keystroke could be lost due loops on it.
* Call cnpoll() in various places, such as when entering the debugger,
asking for input in vfs_conf, and a few other places.
John Marino [Tue, 14 Jul 2015 15:11:49 +0000 (17:11 +0200)]
WPA Supplicant: Add warning about its use
The wpa_supplicant software in base is three releases behind and likely
full of security holes. For example, the current release in DPorts has
already had 5 security vulnerabilities patched, but the base version is
not being actively maintained.
The base wpa_supplicant should only be used long enough to be able to
install the latest version from dports. In order to let sysadmins know
that running it is not the best idea, a 10-second warning will come up
when the base wpa_supplicant is used.
reviewed by: robgar
John Marino [Tue, 14 Jul 2015 08:58:42 +0000 (10:58 +0200)]
Bump __DragonFly_version after replacement of libm
John Marino [Mon, 13 Jul 2015 08:54:40 +0000 (10:54 +0200)]
Replace hybrid libm with OpenBSD libm on vendor branch
In order to gain full c++11 support on GCC, we had to import a number
of long double functions from NetBSD, once again converting libm into
a hybrid library from a mixture of sources. As of today, FreeBSD still
doesn't have the missing functions and the PR on broken c++11 has been
lingering for months.
The OpenBSD libm is complete and maintained[1][2]. It's unmodified
sources are in vendor/OPENBSD_LIBM branch with local modifications (to
squelch gcc warnings and adjust for OS differences mainly) are applied
to the master for easy diff generation.
A dports bulk build was executing using the new math library and the
result is the ports built normally.
[1] The final two "imprecise" functions were replaced by proper long
double versions. The imprecise versions remain as older symbols
(libm has symbol versioning) so this source is additional to what
is provided in the vendor branch. (powl, tgammal)
[2] There were several DF306.0 symbols that are not present in OpenLIBM,
partially because they've been moved to libc or were always there.
In order to maintain backwards capability, copies of these functions
with new names are built into libm, and given DF306.0 versions only.
Without the version suffix, these past functions will not link to
new programs.
Matthew Dillon [Tue, 14 Jul 2015 02:26:36 +0000 (19:26 -0700)]
ipiq: Add simple IPI latency measure sysctls (2)
* Add /usr/src/test/sysperf/ipitest test script.
* Make adjustments to the sysctl latency code, remove unnecessary
critical section and convert the result to nanoseconds.
Sepherosa Ziehau [Mon, 13 Jul 2015 15:29:51 +0000 (23:29 +0800)]
ipiq: Add simple IPI latency measure sysctls
It could be used to measure latency caused by power management stuffs.
John Marino [Mon, 13 Jul 2015 12:23:25 +0000 (14:23 +0200)]
OpenLIBM math.h: change __XPG_VISIBLE => __XSI_VISIBLE
OpenBSD uses a different macro definition X/Open portability spec, so
rename it (__XPG_VISIBLE) to the one used by Free/DF (__XSI_VISIBLE).
This is another local modification to math.h
John Marino [Mon, 13 Jul 2015 10:03:48 +0000 (12:03 +0200)]
OpenLIBM local mod: change another __fpclassify => __fpclassifyd
To avoid creating a new symbol, the original __fpclassifyd name was
retained, but I missed changing this one. The error was discovered
by a build failure of lang/spidermonkey185
John Marino [Mon, 13 Jul 2015 06:20:03 +0000 (08:20 +0200)]
xlocale: remove const qualifier from __xlocale_C_ctype
It contains a reference count that is modified by newlocale,
duplocale, freelocale.
diagnosed-by: dillon
taken-from: freebsd
Matthew Dillon [Mon, 13 Jul 2015 04:07:55 +0000 (21:07 -0700)]
kernel - Fix mlock() related panic and memory leak
* If a process exits with mlock()d pages, the pages are left wired,
causing an immediate memory leak and also leading to an assertion
and panic later on when the kernel tries to free the pages.
* The problem is due to an exit optimization which calls
pmap_remove_pages() before deleting the mappings. vm_fault_unwire()
expects the pmap to have the pages and fails to properly adjust the
wire count when it doesn't.
* Fixed by testing pmap->pm_stats.wired_count and shifting the
pmap_remove_pages() call to after the maps are removed if it is
non-zero.
Reported-by: marino via muscles panic
Sepherosa Ziehau [Mon, 13 Jul 2015 02:59:09 +0000 (10:59 +0800)]
bus: Clear device description when we set driver.
This fixes several places that driver is detached, but device desc set
by driver is not cleared, e.g. module unload.
Minor cleanup, while I'm here.
Reported-by: swildner@
John Marino [Sun, 12 Jul 2015 20:17:47 +0000 (22:17 +0200)]
OpenLIBM: Add DRAGONFLY.README to contrib
John Marino [Sun, 12 Jul 2015 20:16:29 +0000 (22:16 +0200)]
OpenLIBM: remaining local modifications
The following section is an excerpt of DRAGONFLY.README for this vendor
branch. Many of these patched issued exist in the current libm as well,
but they are masked with WARNS?=1. Other fixes adjust for differences
between DragonFly and OpenBSD. The WARNS level has been raised to 3, and
it could be raised to 4 by fixing "set-but-unused" errors.
The following files have been patched
=====================================
arch/amd64/*.S (elf note added to all assembly files)
arch/amd64/fenv.c (#include diff from OpenBSD)
arch/amd64/fenv.h (#include <sys/cdefs.h> for CDECL)
include/global/math.h (#include diff, double/float typedefs)
src/e_j0.c (full coverage)
src/e_j0f.c (full coverage, fix sign comparison mismatch)
src/e_j1.c (full coverage)
src/e_j1f.c (full coverage, fix sign comparison mismatch)
src/e_jnf.c (sign comparison mismatch)
src/e_pow.c (sign comparison mismatch)
src/e_powf.c (sign comparison mismatch)
src/e_rem_pio2f.c (sign comparison mismatch)
src/ld80/e_fmodl.c (sign comparison mismatch)
src/ld80/s_ceill.c (sign comparison mismatch)
src/ld80/s_floorl.c (sign comparison mismatch)
src/ld80/s_nextafterl.c (strong alias, explicit eval order, always true)
src/ld80/s_remquol.c (sign comparison mismatch)
src/s_lround.c (sign comparison mismatch)
src/s_lroundf.c (sign comparison mismatch)
src/s_nan.c (#include diff from OpenBSD)
src/w_drem.c (ansify prototype)
John Marino [Sun, 12 Jul 2015 20:06:59 +0000 (21:06 +0100)]
OpenLIBM: local modification - elf notes on assembly
All object files need a .note.GNU-stack elf section in order to preserve
the ability for the resulting program to run on a non-executable stack.
If a single object is missing this section, the linker will run the program
on an executable stack instead which is less secure.
The FreeBSD and NetBSD libm assembly files have these notes, but OpenBSD
does not use them, thus the need for a local modification.
John Marino [Sun, 12 Jul 2015 20:01:28 +0000 (22:01 +0200)]
Merge branch 'vendor/OPENBSD_LIBM'
John Marino [Sun, 12 Jul 2015 19:52:59 +0000 (21:52 +0200)]
Import OpenBSD's libm (trunk, 4 July 2015) to a new vendor branch
With the exception of x86_64 (as amd64), all arch-specific files have
been filtered out. A new directory called "include" has been added
to capture global and arch-specific headers for installation. Other
than that directory and those exclusions, this is an unaltered copy
of OpenBSD's libm as it existed on 4th of July, 2015.
Tomohiro Kusumi [Sun, 12 Jul 2015 03:15:34 +0000 (12:15 +0900)]
sys/vfs/hammer: Fix comments
- hammer_fsbuf_head only existed in the early days of hammer.
Tomohiro Kusumi [Sun, 12 Jul 2015 02:58:59 +0000 (11:58 +0900)]
sys/vfs/hammer: Cleanup whitespace(0x20) before tab
- Get rid of 0x20s that are being highlighted by editors
whereas other lines in hammer are aligned only by tabs.
Tomohiro Kusumi [Sun, 12 Jul 2015 02:31:53 +0000 (11:31 +0900)]
sys/vfs/hammer: Add comment on multi-master clustering
- It should note that multi-master clustering is not supported.
The original comment on multi-master clustering is from 2008.
Sepherosa Ziehau [Sun, 12 Jul 2015 15:03:46 +0000 (23:03 +0800)]
cam: Initialize counted_to_config properly in xpt_bus_register
DragonFly-bug: http://bugs.dragonflybsd.org/issues/2823
Sepherosa Ziehau [Sun, 12 Jul 2015 14:33:50 +0000 (22:33 +0800)]
acpi/pstate: Fix and cleanup 465a6ec
End of P-states MSR is not set properly in 465a6ec.
While I'm here, clean up macro names for AMD 11h related registers
and values.