dragonfly.git
8 years agopowerd.8: Fix comment about P-state effect on Intel CPUs
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.

8 years agoipiq: Add description for ipi latency measurement sysctls
Sepherosa Ziehau [Thu, 16 Jul 2015 14:13:30 +0000 (22:13 +0800)]
ipiq: Add description for ipi latency measurement sysctls

Suggested-by: swildner@
8 years agosysperf/ipitest: Run latency tests on all available CPUs
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.

8 years agokernel - Reduce ACPI dmesg spam a little
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.

8 years agokernel - MFC 160de052b2 from FreeBSD (persist timer)
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

8 years agokernel - Reduce mountroot intr_config_hook wait to 30 seconds
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.

8 years agokernel - Fix mountroot / usb diskkey race.
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.

8 years agoFix installation of libm man page(s)
John Marino [Thu, 16 Jul 2015 14:10:58 +0000 (16:10 +0200)]
Fix installation of libm man page(s)

diagnosed-by: swildner

8 years agoOpenLIBM: Replace complex ACOSH functions
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

8 years agoOpenLIBM: Replace nextafterl function with FreeBSD's version
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.

8 years agoOpenLIBM: Try to fix nextafterl
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.

8 years agokernel/linux: Implement idr_preload() and idr_preload_end()
François Tigeot [Wed, 15 Jul 2015 19:22:48 +0000 (21:22 +0200)]
kernel/linux: Implement idr_preload() and idr_preload_end()

8 years agowmake - Improve use case for incremental world build/installs
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
8 years agoOpenLIBM: Fix initializing FP environment
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.

8 years agoi386 removal, part 18/x: Remove an i386 specific option.
Sascha Wildner [Wed, 15 Jul 2015 11:03:21 +0000 (13:03 +0200)]
i386 removal, part 18/x: Remove an i386 specific option.

8 years agoAdd wpi(4) to our default config.
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
8 years agoUpdate the pciconf(8) database.
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/

8 years agoOpenLIBM: Add missing symbol fegetexcept (DF404.0)
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
8 years agox86_64/mwait: Expose preamble mask for C3+ transition
Sepherosa Ziehau [Tue, 14 Jul 2015 14:49:31 +0000 (22:49 +0800)]
x86_64/mwait: Expose preamble mask for C3+ transition

8 years agoacpi/pstate: Force CPU package power domain for Intel CPUs
Sepherosa Ziehau [Tue, 14 Jul 2015 14:29:32 +0000 (22:29 +0800)]
acpi/pstate: Force CPU package power domain for Intel CPUs

8 years agopowerd: Reverse the meaning of -e option
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.

8 years agosyscons - improve debugger entry
Matthew Dillon [Tue, 14 Jul 2015 22:52:31 +0000 (15:52 -0700)]
syscons - improve debugger entry

* Reduce stalls during debugger entry.

8 years agokernel/linux: Fix a bug in idr_alloc()
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.

8 years agoOpenLIBM: Add 3 new symbols to map
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.

8 years agokernel - Fix live lock in vfs_conf.c mountroot>
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.

8 years agoWPA Supplicant: Add warning about its use
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

8 years agoBump __DragonFly_version after replacement of libm
John Marino [Tue, 14 Jul 2015 08:58:42 +0000 (10:58 +0200)]
Bump __DragonFly_version after replacement of libm

8 years agoReplace hybrid libm with OpenBSD libm on vendor branch
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.

8 years agoipiq: Add simple IPI latency measure sysctls (2)
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.

8 years agoipiq: Add simple IPI latency measure sysctls
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.

8 years agoOpenLIBM math.h: change __XPG_VISIBLE => __XSI_VISIBLE
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

8 years agoOpenLIBM local mod: change another __fpclassify => __fpclassifyd
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

8 years agoxlocale: remove const qualifier from __xlocale_C_ctype
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

8 years agokernel - Fix mlock() related panic and memory leak
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
8 years agobus: Clear device description when we set driver.
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@
8 years agoOpenLIBM: Add DRAGONFLY.README to contrib
John Marino [Sun, 12 Jul 2015 20:17:47 +0000 (22:17 +0200)]
OpenLIBM: Add DRAGONFLY.README to contrib

8 years agoOpenLIBM: remaining local modifications
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)

8 years agoOpenLIBM: local modification - elf notes on assembly
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.

8 years agoMerge branch 'vendor/OPENBSD_LIBM'
John Marino [Sun, 12 Jul 2015 20:01:28 +0000 (22:01 +0200)]
Merge branch 'vendor/OPENBSD_LIBM'

8 years agoImport OpenBSD's libm (trunk, 4 July 2015) to a new vendor branch gitea/vendor/OPENBSD_LIBM origin/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.

8 years agosys/vfs/hammer: Fix comments
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.

8 years agosys/vfs/hammer: Cleanup whitespace(0x20) before tab
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.

8 years agosys/vfs/hammer: Add comment on multi-master clustering
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.

8 years agocam: Initialize counted_to_config properly in xpt_bus_register
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

8 years agoacpi/pstate: Fix and cleanup 465a6ec
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.

8 years agoacpi/pstate: Since AMD 11h, 8 P-states are supported.
Sepherosa Ziehau [Sun, 12 Jul 2015 13:39:16 +0000 (21:39 +0800)]
acpi/pstate: Since AMD 11h, 8 P-states are supported.

DragonFly-bug: http://bugs.dragonflybsd.org/issues/2814

8 years agosbin/hammer: Fix comments
Tomohiro Kusumi [Sat, 11 Jul 2015 15:20:42 +0000 (00:20 +0900)]
sbin/hammer: Fix comments

- The first comment on layer1 seems to be obsolete.
  The big-block for layer1 metadata is always in volume0, but
  the big-blocks for layer2 metadata and filesystem data could
  be in any volume. This comment is from 2008 and only found
  here so remove it.

- Sync the second comment on layer2 with that of kernel code.

8 years agosbin/hammer: Cleanup blockmap pointer dereference
Tomohiro Kusumi [Sat, 11 Jul 2015 15:01:00 +0000 (00:01 +0900)]
sbin/hammer: Cleanup blockmap pointer dereference

- Just to make the code look better
  (than having blockmap[\nHAMMER_...]).

8 years agosbin/hammer: Remove unnecessary blockmap argument
Tomohiro Kusumi [Sat, 11 Jul 2015 10:50:59 +0000 (19:50 +0900)]
sbin/hammer: Remove unnecessary blockmap argument

- format_freemap() does not need the second argument for blockmap.
  This function sets that blockmap pointer to
  &root_vol->ondisk->vol0_blockmap[4];
  right before it starts to initialize blockmap anyway.

- Also passing the freemap blockmap as an argument is redundant
  in terms of api since format_freemap() can access the freemap
  blockmap via the first argument (root volume, as mentioned above)
  given that the function knows it's looking for blockmaps[4].

8 years agosbin/hammer: Make function prototype explicit
Tomohiro Kusumi [Sat, 11 Jul 2015 10:37:40 +0000 (19:37 +0900)]
sbin/hammer: Make function prototype explicit

- format_undomap() is only for root volume, so it's better to have
  the same first argument type as format_freemap(). It explicitly
  shows that the volume is the root volume.

- Also add assertions to check the given pointer is root volume.
  (it's invalid for non-root volumes to call these at least for now)

8 years agosbin/hammer: Cleanup blockmap initialization
Tomohiro Kusumi [Sat, 11 Jul 2015 10:18:24 +0000 (19:18 +0900)]
sbin/hammer: Cleanup blockmap initialization

- Initialize blockmap fields in the same order as
  struct definition as well as format_undomap().

8 years agodrm: Implement set_memory_wc() and set_memory_wb()
François Tigeot [Sat, 11 Jul 2015 16:20:31 +0000 (18:20 +0200)]
drm: Implement set_memory_wc() and set_memory_wb()

8 years agoaperf: Sensor for effective CPU frequency using APERF/MPERF MSRs.
Sepherosa Ziehau [Sat, 11 Jul 2015 13:11:57 +0000 (21:11 +0800)]
aperf: Sensor for effective CPU frequency using APERF/MPERF MSRs.

It was adapted by me to fit into cpu sensor device and utilize our
per-cpu sensor tasks.

Obtained-from: Imre Vadasz <imre@vdsz.com>

8 years agosensors: Add frequency sensor type
Sepherosa Ziehau [Sat, 11 Jul 2015 15:33:26 +0000 (23:33 +0800)]
sensors: Add frequency sensor type

While I'm here, fix sensor type string array.

8 years agosensors: Fix value type
Sepherosa Ziehau [Sat, 11 Jul 2015 14:30:44 +0000 (22:30 +0800)]
sensors: Fix value type

8 years agoxlocale: Fix potential segfault
John Marino [Sat, 11 Jul 2015 09:52:54 +0000 (11:52 +0200)]
xlocale: Fix potential segfault

It was possible for locale and rune locale to become out of sync causing
mb* and similar functions to be called with the wrong data, including
with a null pointer.  Unfortunately, this still does not solve the
gfortran testsuite failure related to newlocale usage.

Taken-from: FreeBSD SVN 264038 (2 APR 2014)

8 years agosys/vfs/hammer: Add hammer_node_max_elements()
Tomohiro Kusumi [Fri, 10 Jul 2015 14:07:28 +0000 (23:07 +0900)]
sys/vfs/hammer: Add hammer_node_max_elements()

- Add inline function hammer_node_max_elements() and make
  it available to userspace.

- The relation between btree node type and # of elements is
  a part of ondisk definition, so it's better to have it in
  the same header file.

8 years agosys/vfs/hammer: Use HAMMER_BUFFERS_PER_BIGBLOCK
Tomohiro Kusumi [Fri, 10 Jul 2015 13:18:48 +0000 (22:18 +0900)]
sys/vfs/hammer: Use HAMMER_BUFFERS_PER_BIGBLOCK

- It's been defined but not used and good to use it.

8 years agosbin/mount_hammer: Fix indentation
Tomohiro Kusumi [Thu, 9 Jul 2015 14:26:32 +0000 (23:26 +0900)]
sbin/mount_hammer: Fix indentation

8 years agosbin/hammer: Enable readhammerbuf()
Tomohiro Kusumi [Thu, 9 Jul 2015 14:10:40 +0000 (23:10 +0900)]
sbin/hammer: Enable readhammerbuf()

- Bring back #if0'd function readhammerbuf() which is a wrapper
  for pread(2) for 16KB buffer.

- (writehammerbuf() has been used since the early days)

8 years agosbin/hammer: Remove init_fifo_head()
Tomohiro Kusumi [Thu, 9 Jul 2015 13:28:39 +0000 (22:28 +0900)]
sbin/hammer: Remove init_fifo_head()

- format_undomap() initializes fifo head without using this
  function which has been #if0'd.

8 years agoacpi/pstate: Expose frequency power consumption table
Sepherosa Ziehau [Fri, 10 Jul 2015 15:32:54 +0000 (23:32 +0800)]
acpi/pstate: Expose frequency power consumption table

8 years agoacpi/pstate: Increase max supported P-states
Sepherosa Ziehau [Fri, 10 Jul 2015 14:06:31 +0000 (22:06 +0800)]
acpi/pstate: Increase max supported P-states

Intel Broadwell cpus could have 16 P-states.

8 years agopowerd: Implement mwait C-state hint adjustment
Sepherosa Ziehau [Fri, 10 Jul 2015 13:36:08 +0000 (21:36 +0800)]
powerd: Implement mwait C-state hint adjustment

8 years agopowerd: Allow disable CPU power domain frequency adjustment
Sepherosa Ziehau [Fri, 10 Jul 2015 12:08:52 +0000 (20:08 +0800)]
powerd: Allow disable CPU power domain frequency adjustment

And update powerd.8

8 years agokernel - Fix panic during coredump
Matthew Dillon [Fri, 10 Jul 2015 07:37:32 +0000 (00:37 -0700)]
kernel - Fix panic during coredump

* multi-threaded coredumps were not stopping all other threads before
  attempting to scan the vm_map, resulting in numerous possible panics.

* Add a new process state, SCORE, indicating that a core dump is in progress
  and adjust proc_stop() and friends as well as any code which tests the
  SSTOP state.  SCORE overrides SSTOP.

* The coredump code actively waits for all running threads to stop before
  proceeding.

* Prevent a deadlock between a SIGKILL and core dump in progress by
  temporarily counting the master exit thread as a stopped thread (which
  allows the coredump to proceed and finish).

Reported-by: marino
8 years agogcc5: Fix quickworld.
Sascha Wildner [Fri, 10 Jul 2015 06:47:28 +0000 (08:47 +0200)]
gcc5: Fix quickworld.

When copying the Makefile from gcc47, the writing of a comment line to
configargs.h about it being a generated file was removed, but the output
redirection was not adjusted to create the file from scratch.

This led to quickworld just appending to the existing header in /usr/obj
and resultant build errors.

8 years agoi386 removal, part 17/x: Remove i386 code from various parts of the tree.
Sascha Wildner [Fri, 10 Jul 2015 05:58:38 +0000 (07:58 +0200)]
i386 removal, part 17/x: Remove i386 code from various parts of the tree.

8 years agopowerd: Rework cpu and cpu power domain selection
Sepherosa Ziehau [Sat, 4 Jul 2015 16:33:14 +0000 (00:33 +0800)]
powerd: Rework cpu and cpu power domain selection

Since some kernel threads are bound to the specific cpus, e.g.
network threads, so we need to take this into consideration when
cpus are selected to increase their performance.  And cpu power
domain selection is adjusted accordingly.

8 years agoLocal adjustments for OpenSSL-1.0.1p.
Sascha Wildner [Thu, 9 Jul 2015 18:13:09 +0000 (20:13 +0200)]
Local adjustments for OpenSSL-1.0.1p.

8 years agoMerge branch 'vendor/OPENSSL'
Sascha Wildner [Thu, 9 Jul 2015 17:43:26 +0000 (19:43 +0200)]
Merge branch 'vendor/OPENSSL'

8 years agoImport OpenSSL 1.0.1p.
Sascha Wildner [Thu, 9 Jul 2015 17:41:59 +0000 (19:41 +0200)]
Import OpenSSL 1.0.1p.

Fixes CVE-2015-1793 (http://openssl.org/news/secadv_20150709.txt).

8 years agoi386 removal, part 16/x: Remove forgotten file via 'make upgrade'.
Sascha Wildner [Thu, 9 Jul 2015 12:57:57 +0000 (14:57 +0200)]
i386 removal, part 16/x: Remove forgotten file via 'make upgrade'.

8 years agoi386 removal, part 15/x: Remove i386 specific network drivers.
Sascha Wildner [Wed, 8 Jul 2015 19:46:54 +0000 (21:46 +0200)]
i386 removal, part 15/x: Remove i386 specific network drivers.

8 years agoi386 removal, part 14/x: Remove i386 specific code from ext2fs.
Sascha Wildner [Wed, 8 Jul 2015 19:22:25 +0000 (21:22 +0200)]
i386 removal, part 14/x: Remove i386 specific code from ext2fs.

8 years agosys/gnu/vfs/ext2fs: Update COPYRIGHT.INFO
Tomohiro Kusumi [Wed, 8 Jul 2015 18:53:49 +0000 (03:53 +0900)]
sys/gnu/vfs/ext2fs: Update COPYRIGHT.INFO

- 1284f18 should have updated this file.

8 years agoRemove non-existant .PATH components from a number of Makefiles.
Sascha Wildner [Wed, 8 Jul 2015 18:57:13 +0000 (20:57 +0200)]
Remove non-existant .PATH components from a number of Makefiles.

8 years agodirfs - Restore old behavior for 0-refs vnodes
Antonio Huete Jimenez [Sat, 30 May 2015 17:43:22 +0000 (10:43 -0700)]
dirfs - Restore old behavior for 0-refs vnodes

- Set VREF_FINALIZE on all dirfs vnodes. This way VOP_INACTIVE()
  will be called on last ref, which was the behaviour before ee173d09

8 years agotestcases: Attempt to integrate POSIX IPC tests to dfregress(8)
Antonio Huete Jimenez [Wed, 8 Jul 2015 10:38:27 +0000 (03:38 -0700)]
testcases: Attempt to integrate POSIX IPC tests to dfregress(8)

- Tests have been split up so they run separately

8 years agokernel/hda: Add missing != NULL check around kfree().
Sascha Wildner [Wed, 8 Jul 2015 08:55:42 +0000 (10:55 +0200)]
kernel/hda: Add missing != NULL check around kfree().

If hdac_get_capabilities() fails, sc->streams has not been allocated, so
check for != NULL before trying to free it in the cleanup.

Reported-by: Rimvydas Jasinskas <rimvydas.jasinskas@gmail.com>
8 years agodrm: Add linux/irqflags.h
François Tigeot [Tue, 7 Jul 2015 19:15:05 +0000 (21:15 +0200)]
drm: Add linux/irqflags.h

8 years agoiasl(8): Remove whitespace I overlooked in 44db1c69b6.
Sascha Wildner [Tue, 7 Jul 2015 16:29:22 +0000 (18:29 +0200)]
iasl(8): Remove whitespace I overlooked in 44db1c69b6.

8 years agohammer: Remove trailing whitespaces
Tomohiro Kusumi [Tue, 7 Jul 2015 15:03:09 +0000 (00:03 +0900)]
hammer: Remove trailing whitespaces

- (Non-functional commits could make it difficult to git-blame
  the history if there are too many of those)

8 years agohammer: Remove trailing tabs
Tomohiro Kusumi [Tue, 7 Jul 2015 10:56:34 +0000 (19:56 +0900)]
hammer: Remove trailing tabs

- (Non-functional commits could make it difficult to git-blame
  the history if there are too many of those)

8 years agosys/*: Fix typos
Tomohiro Kusumi [Tue, 7 Jul 2015 10:36:45 +0000 (19:36 +0900)]
sys/*: Fix typos

- "separate" is probably right.

- "transaction" is probably right.

8 years agosys/vfs/hammer: Remove obsolete macros
Tomohiro Kusumi [Tue, 7 Jul 2015 10:35:55 +0000 (19:35 +0900)]
sys/vfs/hammer: Remove obsolete macros

- These were added in 47197d71 and once used in early days of hammer
  but no longer used.

8 years agosys/vfs/hammer: Rename macros for consistency
Tomohiro Kusumi [Tue, 7 Jul 2015 10:33:27 +0000 (19:33 +0900)]
sys/vfs/hammer: Rename macros for consistency

- Rename HAMMER_SHORT_OFF_ENCODE() to HAMMER_OFF_SHORT_ENCODE()
  and HAMMER_LONG_OFF_ENCODE() to HAMMER_OFF_LONG_ENCODE() for
  consistency with the existing macros HAMMER_OFF_SHORT_MASK
  and HAMMER_OFF_LONG_MASK.

- These two are used by ENCODE() macros and haven't been used
  independently elsewhere, so there is no effect to others.
  (if external userspace programs are using these then those
  programs are probably doing something strange)

8 years agosys/vfs/hammer: Cleanups
Tomohiro Kusumi [Tue, 7 Jul 2015 10:28:32 +0000 (19:28 +0900)]
sys/vfs/hammer: Cleanups

- For better readability,
  define macros in zone -> volume -> offset order and
  define macros in encode -> decode order.

8 years agosbin/hammer: Use HAMMER_ENCODE_XXX() to encode zone address
Tomohiro Kusumi [Tue, 7 Jul 2015 10:25:53 +0000 (19:25 +0900)]
sbin/hammer: Use HAMMER_ENCODE_XXX() to encode zone address

- Use HAMMER_ENCODE_RAW_BUFFER() instead of manual bitwise operations.

8 years agoSync ACPICA code with the Intel licensed 20150619 distribution.
Sascha Wildner [Tue, 7 Jul 2015 09:35:28 +0000 (11:35 +0200)]
Sync ACPICA code with the Intel licensed 20150619 distribution.

Due to some issue in Intel's release procedure, the dual licensed
distribution - which we use - had not just license differences but
also code differences when comparing to the Intel licensed one.
Adjust to the code of the Intel licensed distribution.

Said issue will be reported to Intel.

This fixes a build issue in emulators/qemu-devel where iasl(8) was
wrongly crashing due to those code differences.

Reported-by: marino
8 years agodrm/linux: Implement GENMASK()
François Tigeot [Sun, 5 Jul 2015 17:44:57 +0000 (19:44 +0200)]
drm/linux: Implement GENMASK()

8 years agokernel - Fix syscons cursor movement
Matthew Dillon [Mon, 6 Jul 2015 19:02:38 +0000 (12:02 -0700)]
kernel - Fix syscons cursor movement

* Recent commits broke the cursor movement test, causing
  certain cursor movements to not update the screen.

* Re-enable the asynchronous update thread, whos primary
  purpose is to fix stuttering sound and other interrupt
  issues.

* Add a sysctl kern.syscons_async which defaults to 1
  to control whether the async thread is used or not.
  This can be changed at any time.

Reported-by: marino
8 years agobtx: Fixup comment indent
Markus Pfeiffer [Mon, 6 Jul 2015 16:11:11 +0000 (17:11 +0100)]
btx: Fixup comment indent

8 years agoFix hangup on VirtualBox.
sinetek [Mon, 6 Jul 2015 18:02:16 +0000 (01:02 +0700)]
Fix hangup on VirtualBox.

8 years agosys/vfs/hammer: Cleanup HAMMER_ENCODE_XXX() macros
Tomohiro Kusumi [Mon, 6 Jul 2015 10:07:48 +0000 (19:07 +0900)]
sys/vfs/hammer: Cleanup HAMMER_ENCODE_XXX() macros

- Define HAMMER_ENCODE_XXX() macros using HAMMER_ENCODE()
  which is a generic version of these.

8 years agosys/vfs/hammer: Define and use HAMMER_ENCODE() on blockmap formatting
Tomohiro Kusumi [Mon, 6 Jul 2015 09:57:29 +0000 (18:57 +0900)]
sys/vfs/hammer: Define and use HAMMER_ENCODE() on blockmap formatting

- Add HAMMER_ENCODE() which is a generic version of existing
  macros HAMMER_ENCODE_{RAW_VOLUME|RAW_BUFFER|FREEMAP}().

- Use HAMMER_ENCODE() in format_blockmap() in userspace when newfs
  initializes blockmap offsets. This is better in the sense that
  the macro hides internal of hammer's storage address space format,
  and gets rid of bitwise operations that make assumption on format.

8 years agosbin/hammer: Remove panic()
Tomohiro Kusumi [Mon, 6 Jul 2015 09:15:15 +0000 (18:15 +0900)]
sbin/hammer: Remove panic()

- hammer userspace mostly uses err()/errx() and panic()
  (which is only used once) can be replaced using these.

8 years agopowerd: Staticize global variables
Sepherosa Ziehau [Sat, 4 Jul 2015 15:27:15 +0000 (23:27 +0800)]
powerd: Staticize global variables

8 years agopowerd: Merge TotalCpus and NCpus
Sepherosa Ziehau [Sat, 4 Jul 2015 15:20:52 +0000 (23:20 +0800)]
powerd: Merge TotalCpus and NCpus

8 years agopowerd.8: List only related kernel modules
Sepherosa Ziehau [Sat, 4 Jul 2015 15:13:34 +0000 (23:13 +0800)]
powerd.8: List only related kernel modules