5 years agoMerge branch 'vendor/EE'
Sascha Wildner [Sun, 9 Feb 2014 05:09:01 +0000 (06:09 +0100)]
Merge branch 'vendor/EE'

5 years agoImport ee 1.5.2 avalon/vendor/EE
Sascha Wildner [Sun, 9 Feb 2014 05:08:42 +0000 (06:08 +0100)]
Import ee 1.5.2

5 years agoAdd missing newlines at EOF in a couple of files.
Sascha Wildner [Sat, 8 Feb 2014 16:38:54 +0000 (17:38 +0100)]
Add missing newlines at EOF in a couple of files.

5 years agofetch.1: Use .Mt for email address.
Sascha Wildner [Sat, 8 Feb 2014 15:56:24 +0000 (16:56 +0100)]
fetch.1: Use .Mt for email address.

5 years agodrm: Implement and use drm_send_vblank_event()
François Tigeot [Sat, 8 Feb 2014 10:37:10 +0000 (11:37 +0100)]
drm: Implement and use drm_send_vblank_event()

5 years agodrm: Implement mutex_is_locked()
François Tigeot [Sat, 8 Feb 2014 09:06:54 +0000 (10:06 +0100)]
drm: Implement mutex_is_locked()

5 years agodrm: Move drm_open() and drm_firstopen() to drm_fops.c
François Tigeot [Fri, 7 Feb 2014 18:15:33 +0000 (19:15 +0100)]
drm: Move drm_open() and drm_firstopen() to drm_fops.c

* That's where they are located on Linux

* Also rename drm_firstopen() to drm_setup() to further reduce

5 years agodrm/drm_bufs.c: Reduce differences with Linux
François Tigeot [Fri, 7 Feb 2014 09:56:02 +0000 (10:56 +0100)]
drm/drm_bufs.c: Reduce differences with Linux

Make sure functions have the same prototypes and top of body comments as their
corresponding versions in Linux 3.9

5 years agoacpi/cstate: Remove unnecessary bus_generic_{attach,probe}()
Sepherosa Ziehau [Sat, 8 Feb 2014 11:47:00 +0000 (19:47 +0800)]
acpi/cstate: Remove unnecessary bus_generic_{attach,probe}()

They were inheritted when acpi_cpu_cstate.c was splitted from acpi_cpu.c.
C-state is a leaf device, nothing will be its children.

5 years agoacpica/cpu: Add missing bus_generic_probe
Sepherosa Ziehau [Sat, 8 Feb 2014 11:42:14 +0000 (19:42 +0800)]
acpica/cpu: Add missing bus_generic_probe

Used by coretemp(4) and perfbias(4).  Maybe many others

5 years agoperfbias: Implement Intel performance-energy hint support
Sepherosa Ziehau [Fri, 7 Feb 2014 13:16:59 +0000 (21:16 +0800)]
perfbias: Implement Intel performance-energy hint support

This hint is set on per-logical CPU.  0 delivers highest performance;
15 maximizes energy saving.  It could be set through sysctl nodes
machdep.perfbiasX (X is the CPU id).

It is linked into i386 and x86_64 GENERIC kernel.

* We may want to make powerd(8) to aware of these sysctls.

5 years agokernel: Revert the callout_stop_sync() changes in the wlan stack.
Sascha Wildner [Sat, 8 Feb 2014 08:32:24 +0000 (09:32 +0100)]
kernel: Revert the callout_stop_sync() changes in the wlan stack.

Our locking is quite different here and it could cause a deadlock with

Pointed-out-by: sephe
5 years agokernel: Use callout_stop_sync() in a number of drivers.
Sascha Wildner [Sat, 8 Feb 2014 07:49:17 +0000 (08:49 +0100)]
kernel: Use callout_stop_sync() in a number of drivers.

5 years agocallout.9: Mention callout_stop_sync().
Sascha Wildner [Sat, 8 Feb 2014 07:37:04 +0000 (08:37 +0100)]
callout.9: Mention callout_stop_sync().

5 years agolibc: Create MLINKS for hesiod(3) too when it is requested.
Sascha Wildner [Wed, 5 Feb 2014 17:17:37 +0000 (18:17 +0100)]
libc: Create MLINKS for hesiod(3) too when it is requested.

5 years agoAdd gcore(1) to the x86_64 build too. It builds and appears to work.
Sascha Wildner [Sat, 8 Feb 2014 05:13:40 +0000 (06:13 +0100)]
Add gcore(1) to the x86_64 build too. It builds and appears to work.

5 years agoig4 - improve interrupt handling
Matthew Dillon [Sat, 8 Feb 2014 04:28:28 +0000 (20:28 -0800)]
ig4 - improve interrupt handling

* Have the interrupt read the data from the rxfifo in order to clear
  the interrupt condition, rather than relying on the polling code to
  do it.

* Should fix partial ig4 interrupt live-locks.  Still under test.

5 years agocyapa - Reduced polling rate on idle detection
Matthew Dillon [Sat, 8 Feb 2014 03:17:30 +0000 (19:17 -0800)]
cyapa - Reduced polling rate on idle detection

* Reduce the polling rate from 100hz to 20hz when the trackpad is not in
  use.  This greatly reduces power consumption by the trackpad and cpus.
  Power consumption on my Acer C720 drops from ~8.2W to ~7.8W using default
  values with this (and the prior I2C interrupt) commit.

* Reduce the polling rate to 1hz when the trackpad is not open.
  TODO - we should power-down the trackpad in this situation.

* The idle rate is used whenever the trackpad has been idle more than 1

5 years agoig4 - Use interrupt to wait for receive data
Matthew Dillon [Sat, 8 Feb 2014 03:13:53 +0000 (19:13 -0800)]
ig4 - Use interrupt to wait for receive data

* The transmit FIFO is typically big enough to hold the full command
  so we do not usually hit the DELAY(25) in the poll loop.  However,
  this is not the case when receiving data.

* Generate an interrupt on stop-bit detection and when a character is
  received.  Set the receive FIFO threshold to 1.  Our polling loop works
  the same way but this allows us to use lksleep() instead of DELAY(25)
  when waiting for receive data.

* Reduces cpu overhead very significantly.  The cyapa (trackpad) driver
  polling at 100hz previously ate 10% of the cpu and now only uses 2%
  or less when fully active.

5 years agogcore(1): Remove no longer needed prototype.
Sascha Wildner [Sat, 8 Feb 2014 02:02:23 +0000 (03:02 +0100)]
gcore(1): Remove no longer needed prototype.

5 years agogcore(1): Remove sparc specific core image handling.
Sascha Wildner [Sat, 8 Feb 2014 01:54:21 +0000 (02:54 +0100)]
gcore(1): Remove sparc specific core image handling.

5 years agocpu: Add necessary bits to detect existance of PERF_BIAS MSR
Sepherosa Ziehau [Fri, 7 Feb 2014 12:55:02 +0000 (20:55 +0800)]
cpu: Add necessary bits to detect existance of PERF_BIAS MSR

5 years agox86_64: Factor out cpu_mwait_attach
Sepherosa Ziehau [Fri, 7 Feb 2014 12:36:16 +0000 (20:36 +0800)]
x86_64: Factor out cpu_mwait_attach

5 years agox86_64: Turbo is now reported along w/ "Thermal and PM features"
Sepherosa Ziehau [Thu, 6 Feb 2014 13:43:25 +0000 (21:43 +0800)]
x86_64: Turbo is now reported along w/ "Thermal and PM features"

No need to do it again.

5 years agoinstall(1): Fix 2.5 y/o verbose bug, use static functions
John Marino [Thu, 6 Feb 2014 13:33:01 +0000 (14:33 +0100)]
install(1): Fix 2.5 y/o verbose bug, use static functions

A bug was introduced by this commit to add the -D option:

a2bc4e56d4ab068fea12d65d13740b7a600769a8 (7 SEP 11)

It changed the -v verbose option from standalone to expecting input and
as a result, any use of -v caused the usage screen to come up.  Fixed.
Additionally, the pathnames.h header is unused, removed now.
Finally, several functions were turned into static functions and explicit
void casts were used when functions normally return integers.  The last
two change sets converge with FreeBSD.

xinstall has not been seriously updated in a long time and has fallen
behind BSD counterparts.  Syncing with FreeBSD may take several steps as
there is significant divergence and options (e.g. -l) do different things
on FreeBSD

5 years agox86_64: Print TURBO and SENSOR for "Thermal and PM features"
Sepherosa Ziehau [Thu, 6 Feb 2014 13:28:29 +0000 (21:28 +0800)]
x86_64: Print TURBO and SENSOR for "Thermal and PM features"

5 years agoaltq: Byte counter is not compat w/ RED or RIO AQM
Sepherosa Ziehau [Thu, 6 Feb 2014 13:21:58 +0000 (21:21 +0800)]
altq: Byte counter is not compat w/ RED or RIO AQM

For altq packet schedulers, use packet counter should be enough.

Reported-by: Pierre Abbat
5 years agoacpica: Disable debug message by default
Sepherosa Ziehau [Thu, 6 Feb 2014 12:34:28 +0000 (20:34 +0800)]
acpica: Disable debug message by default

5 years agomwait/spin: Push sysctl into machdep code
Sepherosa Ziehau [Thu, 6 Feb 2014 11:56:59 +0000 (19:56 +0800)]
mwait/spin: Push sysctl into machdep code

On x86_64, make the sysctl read only.  Sysctl machdep.mwait.CX.spin
should be used to configure the mwait hint.

Manipulate mwait hint value directly through hw.cpu_mwait_halt is not
safe, e.g. intr cputimer may need change for deep cpu specific C-state.

5 years agox86_64: Make sysctl hw.cpu_mwait_halt read only
Sepherosa Ziehau [Thu, 6 Feb 2014 11:46:22 +0000 (19:46 +0800)]
x86_64: Make sysctl hw.cpu_mwait_halt read only

Sysctl machdep.mwait.CX.idle should be used to configure mwait hint.

Manipulate mwait hint value directly through hw.cpu_mwait_halt is not
safe, e.g. intr cputimer may need change for deep cpu specific C-state.

5 years agomwait: Staticize cpu_mwait_halt
Sepherosa Ziehau [Thu, 6 Feb 2014 11:45:08 +0000 (19:45 +0800)]
mwait: Staticize cpu_mwait_halt

It is only used in machdep code.

5 years agopatch(1): Sync with FreeBSD
John Marino [Thu, 6 Feb 2014 11:22:53 +0000 (12:22 +0100)]
patch(1): Sync with FreeBSD

FreeBSD has taken our patch(1) completely (29 JAN 2013), forked it, and
has improved on it.  It's a relatively simple sync.  Selected change log:

More user friendly:
 - Ask only once for "apply anyway"
 - Tell user which patch failed rather than only # of hunk failures

Handle lines with null character:
 - read buffer for pgets properly populated
 - callers of pgets still misprocess buffer contents, but at least
   pgets is more accurate

Make "patch < fubar" and "patch -i fubar" equivalent:
 - previous behavior was source of "unexpected end of file in patch"
   errors when null characters came from stdin

Fixed error handling where final fclose got skipped
Fixed target selection logic to match was was documented on man page
Synced with OpenBSD base

5 years agox86_64/mwait: Cap idle repeat stats
Sepherosa Ziehau [Wed, 5 Feb 2014 13:09:30 +0000 (21:09 +0800)]
x86_64/mwait: Cap idle repeat stats

So we could react to sudden busy much faster.  Deep cpu specific C-state
usually takes longer to complete the transition.

5 years agox86_64/mwait: Start auto tuning from C1
Sepherosa Ziehau [Wed, 5 Feb 2014 12:48:41 +0000 (20:48 +0800)]
x86_64/mwait: Start auto tuning from C1

5 years agox86_64: Fix up the setting of BM_STS
Sepherosa Ziehau [Wed, 5 Feb 2014 12:43:04 +0000 (20:43 +0800)]
x86_64: Fix up the setting of BM_STS

5 years agolibc/net: fix a portability issue
Eitan Adler [Wed, 5 Feb 2014 02:01:58 +0000 (21:01 -0500)]
libc/net: fix a portability issue

* POSIX does not require socklen_t to be unsigned

Submitted by: bde@freebsd.org
Obtained-from: FreeBSD

5 years agodrm: Sync a few headers with Linux 3.8
François Tigeot [Tue, 4 Feb 2014 21:21:40 +0000 (22:21 +0100)]
drm: Sync a few headers with Linux 3.8

5 years agodrm: Sync drm_fb_helper files with Linux 3.8
François Tigeot [Tue, 4 Feb 2014 21:06:15 +0000 (22:06 +0100)]
drm: Sync drm_fb_helper files with Linux 3.8

5 years agofetch(1), libfetch: Sync with FreeBSD
John Marino [Mon, 3 Feb 2014 23:12:32 +0000 (00:12 +0100)]
fetch(1), libfetch: Sync with FreeBSD

Changes include:
 * Increase buffer size from 4K to 16K
 * Include Accept header in requests
 * Implement certificate verification
 * libfetch support

5 years agox86_64: Rework cpu specific C-state auto tuning
Sepherosa Ziehau [Mon, 3 Feb 2014 14:42:08 +0000 (22:42 +0800)]
x86_64: Rework cpu specific C-state auto tuning

5 years agox86_64: Use per-cpu stats for idle
Sepherosa Ziehau [Mon, 3 Feb 2014 14:05:55 +0000 (22:05 +0800)]
x86_64: Use per-cpu stats for idle

5 years agox86_64: Check preamble operation before allowing deep cpu specific C-state
Sepherosa Ziehau [Mon, 3 Feb 2014 11:35:44 +0000 (19:35 +0800)]
x86_64: Check preamble operation before allowing deep cpu specific C-state

5 years agolibthread_xu: Properly inherit the creating thread's sched_priority.
Sascha Wildner [Mon, 3 Feb 2014 00:40:21 +0000 (01:40 +0100)]
libthread_xu: Properly inherit the creating thread's sched_priority.

When a new thread is created with the inheritsched attribute set to
PTHREAD_INHERIT_SCHED, then it must inherit the sched_priority
scheduling parameter from the creating thread, because POSIX sez:

"The following thread scheduling attributes defined by POSIX.1-2008
are affected by the inheritsched attribute: [...], scheduling parameters
(schedparam), [...]"


"For SCHED_FIFO and SCHED_RR, the only required member of the sched_param
structure is the priority sched_priority. For SCHED_OTHER, the affected
scheduling parameters are implementation-defined."

For SCHED_OTHER, it will currently inherit the creating thread's
sched_priority too. We'll see if that poses a problem.

5 years agokernel/sched_setscheduler: Fix return value.
Sascha Wildner [Sun, 2 Feb 2014 23:04:32 +0000 (00:04 +0100)]
kernel/sched_setscheduler: Fix return value.

sched_setscheduler() shall return EINVAL "if one or more of the
parameters contained in param is outside the valid range for the
specified scheduling policy."

5 years agopthread_attr.3: Adjust pthread_attr_setinheritsched() return value.
Sascha Wildner [Sun, 2 Feb 2014 22:41:30 +0000 (23:41 +0100)]
pthread_attr.3: Adjust pthread_attr_setinheritsched() return value.

5 years agolibthread_xu: Fix wrong return value in pthread_attr_setinheritsched().
Sascha Wildner [Sun, 2 Feb 2014 22:40:12 +0000 (23:40 +0100)]
libthread_xu: Fix wrong return value in pthread_attr_setinheritsched().

If it fails because of an invalid inheritsched, EINVAL must be returned.

5 years agolibc_r: Add inheritsched check in pthread_attr_setinheritsched().
Sascha Wildner [Sun, 2 Feb 2014 22:37:29 +0000 (23:37 +0100)]
libc_r: Add inheritsched check in pthread_attr_setinheritsched().

Per POSIX, "the supported values of inheritsched shall be:



And, "the pthread_attr_setinheritsched() function may fail if:

The value of inheritsched is not valid."

5 years agolibc_r: Check attr.sched_inherit for PTHREAD_INHERIT_SCHED, not attr.flags.
Sascha Wildner [Sun, 2 Feb 2014 22:33:55 +0000 (23:33 +0100)]
libc_r: Check attr.sched_inherit for PTHREAD_INHERIT_SCHED, not attr.flags.

5 years agolibc: __sys_fork() and _fork() are no more.
Sascha Wildner [Sun, 2 Feb 2014 17:57:01 +0000 (18:57 +0100)]
libc: __sys_fork() and _fork() are no more.

5 years agolibc_r: Fix up for the recent sysvipc work.
Sascha Wildner [Sun, 2 Feb 2014 17:56:12 +0000 (18:56 +0100)]
libc_r: Fix up for the recent sysvipc work.

5 years agox86_64: Implement idle mwait hint auto tuning
Sepherosa Ziehau [Sun, 2 Feb 2014 13:48:19 +0000 (21:48 +0800)]
x86_64: Implement idle mwait hint auto tuning

The tuning is based on gd_idle_repeat.  The higher the gd_idle_repeat,
the deeper cpu specific C-state the current CPU will enter.

The idle mwait hint auto tuning could be enabled by setting sysctl
machdep.mwait.CX.idle to "AUTO" or "AUTODEEP":
"AUTO"     -- C0 ~ C2
"AUTODEEP" -- C0 ~ deepest cpu specific C-state

This will allow us to enter deepest cpu specific C-state, even if ACPI
does not map its deepest C-State to the deepest cpu specific C-state.

AUTODEEP and C3+ cpu specific C-state is not bullet prove yet.  We need
to get the bus master operations information from ACPI.

5 years agox86_64: Save mwait hints
Sepherosa Ziehau [Sun, 2 Feb 2014 12:53:41 +0000 (20:53 +0800)]
x86_64: Save mwait hints

These two arrays will be used to implement mwait hint auto tuning.

5 years agolibc_r: Compile with our default CSTD (gnu99) and raise WARNS to 2.
Sascha Wildner [Sun, 2 Feb 2014 12:12:44 +0000 (13:12 +0100)]
libc_r: Compile with our default CSTD (gnu99) and raise WARNS to 2.

5 years agolibc: Silence another -Wtype-limits (socklen_t is unsigned).
Sascha Wildner [Sun, 2 Feb 2014 10:27:24 +0000 (11:27 +0100)]
libc: Silence another -Wtype-limits (socklen_t is unsigned).

5 years agolibc: __atfork() is only used by the WR() in this file, so make it static.
Sascha Wildner [Sun, 2 Feb 2014 00:05:58 +0000 (01:05 +0100)]
libc: __atfork() is only used by the WR() in this file, so make it static.

Also mark it __used.

This silences a -Wmissing-prototypes warning.

5 years agolibc: Fix -Wmissing-field-initializer for FAKE_FILE usages.
Sascha Wildner [Sat, 1 Feb 2014 21:45:45 +0000 (22:45 +0100)]
libc: Fix -Wmissing-field-initializer for FAKE_FILE usages.

While here, use PTHREAD_MUTEX_INITIALIZER for _fl_mutex initialization.

5 years agolibc: Fix some -Wunused-parameter.
Sascha Wildner [Sat, 1 Feb 2014 19:25:55 +0000 (20:25 +0100)]
libc: Fix some -Wunused-parameter.

5 years agox86_64/mwait: Request proper intr cputimer, if C3+ is used as hint
Sepherosa Ziehau [Sat, 1 Feb 2014 14:11:53 +0000 (22:11 +0800)]
x86_64/mwait: Request proper intr cputimer, if C3+ is used as hint

Though mwait's hint uses CPU specific C-state, we still believe that
C3+ hints are deep C-states, which may cause certain type of intr
cputimer hang (e.g. LAPIC intr cputimer on CPUs w/o ARAT).

While I'm here, make sure that mwait hint could not be changed on CPUs
that do not support monitor/mwait or mwait hint.

5 years agocputimer/intr: Move powersaving intr cputimer switching to kern_cputimer.c
Sepherosa Ziehau [Sat, 1 Feb 2014 13:15:53 +0000 (21:15 +0800)]
cputimer/intr: Move powersaving intr cputimer switching to kern_cputimer.c

While I'm here fix several bugs:
- Don't take ERESTART as error
- Use serializer to protect the number of power saving request.  Using
  atomic_fetchadd_int is not enough here:
  The first power saving request could fail.  However, before its failure,
  other power saving request could be successful, since the intr cputimer
  switch is skipped.

5 years agorcrun(8): Rename $i, $j and $k to (more) meaningful names.
Sascha Wildner [Sat, 1 Feb 2014 07:13:58 +0000 (08:13 +0100)]
rcrun(8): Rename $i, $j and $k to (more) meaningful names.

5 years agorcrun(8): Read /etc/rc.conf too for overrides of $local_startup.
Sascha Wildner [Sat, 1 Feb 2014 07:02:23 +0000 (08:02 +0100)]
rcrun(8): Read /etc/rc.conf too for overrides of $local_startup.

5 years agobsd-family-tree: Sync with FreeBSD (for FreeBSD 2.2.9 and NetBSD 6.1.3).
Sascha Wildner [Fri, 31 Jan 2014 18:52:41 +0000 (19:52 +0100)]
bsd-family-tree: Sync with FreeBSD (for FreeBSD 2.2.9 and NetBSD 6.1.3).

5 years agokernel/x86_64: Make a function argument const (fixes a new warning).
Sascha Wildner [Fri, 31 Jan 2014 18:50:08 +0000 (19:50 +0100)]
kernel/x86_64: Make a function argument const (fixes a new warning).

5 years agox86_64: Add new sysctls to set idle/spin mwait hint
Sepherosa Ziehau [Fri, 31 Jan 2014 12:02:08 +0000 (20:02 +0800)]
x86_64: Add new sysctls to set idle/spin mwait hint

These sysctls verify that the mwait hint is supported.  It's format is:
C-state/sub-state.  The valid one could be picked up from the output of
sysctl machdep.mwait.CX.supported.

Sysctls hw.cpu_mwait_{halt,spin} should be deprecated.

While I'm here, rearrange cpu_mwait_hint_valid() a little bit.

5 years agox86_64: Export Cx support list through sysctl machdep.mwait.CX.supported
Sepherosa Ziehau [Fri, 31 Jan 2014 09:20:08 +0000 (17:20 +0800)]
x86_64: Export Cx support list through sysctl machdep.mwait.CX.supported

The format is: C-state/sub-state

5 years agoacpi/cpu: Remove the cpux naming hack
Sepherosa Ziehau [Thu, 30 Jan 2014 16:16:35 +0000 (00:16 +0800)]
acpi/cpu: Remove the cpux naming hack

Used to avoid name conflict between C-state module and cpu module

5 years agolibc/net: Fix some issues in our inet6_opt_init() (from RFC 3542).
Sascha Wildner [Thu, 30 Jan 2014 14:23:52 +0000 (15:23 +0100)]
libc/net: Fix some issues in our inet6_opt_init() (from RFC 3542).

* The RFC says (in section 10.1) that only when extbuf is not NULL,
  extlen shall be checked, so don't perform this check when NULL is

* socklen_t is unsigned, so checking extlen for less than zero is
  not needed.

5 years agoacpi/cstate/x86_64: Implement native C-state support for Intel CPUs
Sepherosa Ziehau [Thu, 30 Jan 2014 09:56:16 +0000 (17:56 +0800)]
acpi/cstate/x86_64: Implement native C-state support for Intel CPUs

The native C-state on Intel CPUs is entered using monitor/mwait w/ the
help from mwait hint (eax) and extension (ecx, break upon interrupt).

We still need to keep an eye on native C1 state.  Currently C1 state
only uses "sti;halt".

5 years agoacpi/cstate: Allow fixed hardware GAS for C1, which means "sti;halt"
Sepherosa Ziehau [Thu, 30 Jan 2014 06:50:16 +0000 (14:50 +0800)]
acpi/cstate: Allow fixed hardware GAS for C1, which means "sti;halt"

Add comment we still need to filter Intel's "C1 I/O then halt".  It
probably won't be problem, since the related bit is not set in _OSC
or _PDC.

5 years agoacpi/cstate: Fix resource leakage
Sepherosa Ziehau [Thu, 30 Jan 2014 04:24:58 +0000 (12:24 +0800)]
acpi/cstate: Fix resource leakage

5 years agoacpi/cstate: Use boolean_t for acpi_cst_disable_idle
Sepherosa Ziehau [Thu, 30 Jan 2014 04:01:55 +0000 (12:01 +0800)]
acpi/cstate: Use boolean_t for acpi_cst_disable_idle

5 years agoacpi/cstate: Rework preamble operation for entering C-state
Sepherosa Ziehau [Thu, 30 Jan 2014 03:51:05 +0000 (11:51 +0800)]
acpi/cstate: Rework preamble operation for entering C-state

- Save preamble operation in C-state struct, instead of choosing
  preamble operation at run time
- Add machine depend C-state setup code to optimize out certain
  preamble operation for various CPU vendors
- Fix up generic preamble operation setup according to ACPI spec

5 years agojails/netinet6: unbreak source selection after cfd7912
Markus Pfeiffer [Wed, 29 Jan 2014 21:37:00 +0000 (21:37 +0000)]
jails/netinet6: unbreak source selection after cfd7912

Commit cfd7912 broke source address selection for the host. It
selected link-local addresses for local global routeable addresses.

Reported-By: ftigeot
5 years agotaskqueue: locking fix
Johannes Hofmann [Wed, 29 Jan 2014 20:30:02 +0000 (21:30 +0100)]
taskqueue: locking fix

Remove leftover TQ_UNLOCK() call from taskqueue_enqueue_locked()
error case.

5 years agoacpi/cstate: Add a method to per C-state softc to enter the C-state
Sepherosa Ziehau [Mon, 27 Jan 2014 13:13:14 +0000 (21:13 +0800)]
acpi/cstate: Add a method to per C-state softc to enter the C-state

This will be used to add "native" C-state support

5 years agoacpi/cstate: Make sure that idle hook is installed as the last step
Sepherosa Ziehau [Mon, 27 Jan 2014 12:49:02 +0000 (20:49 +0800)]
acpi/cstate: Make sure that idle hook is installed as the last step

5 years agoacpi/cstate: If there is bus master activity pick up non-C3 is enough
Sepherosa Ziehau [Mon, 27 Jan 2014 12:47:10 +0000 (20:47 +0800)]
acpi/cstate: If there is bus master activity pick up non-C3 is enough

Since bus master activity is only checked before entering C3+ states.

5 years agoacpi/cstate: Rearrange _CST reprobe code path
Sepherosa Ziehau [Mon, 27 Jan 2014 12:40:47 +0000 (20:40 +0800)]
acpi/cstate: Rearrange _CST reprobe code path

5 years agoacpi/cstate: Save ACPI_GENERIC_ADDRESS for later use
Sepherosa Ziehau [Mon, 27 Jan 2014 12:30:23 +0000 (20:30 +0800)]
acpi/cstate: Save ACPI_GENERIC_ADDRESS for later use

Also fix a bug that 'res_type' should be used instead of 'type' during
FADT C state resource allocation.

5 years agoacpi/cstate: Function/variable/macro renaming
Sepherosa Ziehau [Sun, 26 Jan 2014 12:06:55 +0000 (20:06 +0800)]
acpi/cstate: Function/variable/macro renaming

Adjust some comment.  No functional changes.

5 years agoswapon(8): Fix wrong constant parameter for function call
Joris Giovannangeli [Sun, 26 Jan 2014 18:14:12 +0000 (19:14 +0100)]
swapon(8): Fix wrong constant parameter for function call

Reported-by: swildner
5 years agoAdd missing libraries to some program Makefiles
François Tigeot [Sun, 26 Jan 2014 14:23:56 +0000 (15:23 +0100)]
Add missing libraries to some program Makefiles

The userland programs they manage are currently building fine but
fail to link in a completely dynamic world with shared libraries
split between /lib and /usr/lib .

5 years agoacpi/cstate: Go though set_lowest routing after _CST reprobing
Sepherosa Ziehau [Sun, 26 Jan 2014 10:30:52 +0000 (18:30 +0800)]
acpi/cstate: Go though set_lowest routing after _CST reprobing

So C3+ state transition could be properly recorded and perper cputimer
could be selected.

5 years agoacpi/cstate: Fix up comment
Sepherosa Ziehau [Sun, 26 Jan 2014 09:40:00 +0000 (17:40 +0800)]
acpi/cstate: Fix up comment

5 years agodoc: remove cdevpriv bits from porting guide
Franco Fichtner [Sun, 26 Jan 2014 10:05:43 +0000 (11:05 +0100)]
doc: remove cdevpriv bits from porting guide

5 years agonetmap: remove bogus NULL check
Franco Fichtner [Sun, 26 Jan 2014 09:58:32 +0000 (10:58 +0100)]
netmap: remove bogus NULL check

Reported-by: swildner
5 years agonetmap: bring back cdevpriv usage
Franco Fichtner [Sun, 26 Jan 2014 09:53:57 +0000 (10:53 +0100)]
netmap: bring back cdevpriv usage

This partially reverts commit 3efed4582e1 now that we have these
functions.  There are three remaining porting issues:

* vm fake pages support
* poll to kqfilter
* if_transmit

5 years agoacpi/cstate: If C3+ is detected, BM_RLD is always set
Sepherosa Ziehau [Sun, 26 Jan 2014 09:00:24 +0000 (17:00 +0800)]
acpi/cstate: If C3+ is detected, BM_RLD is always set

BM_RLD is only needed on old chipsets; on new chipsets, writing to
it is a nop.  Always leave it on if C3+ is probed; this reduce I/O
accesses on idle path.

5 years agosys: platform: pc64: vmm: vmx.c: bug-fix in PROCBASED2 detection
Mihai Carabas [Sat, 25 Jan 2014 23:42:38 +0000 (01:42 +0200)]
sys: platform: pc64: vmm: vmx.c: bug-fix in PROCBASED2 detection

Bug-fix in accessing PROCBASED2 MSR:
 * First check PROCBASED MSR to see if it is available

Reported-by: Johannes Hofmann
5 years agobsd.lib.mk: Fix symlink creation if ${SHLIBDIR} and ${LIBDIR} differ.
François Tigeot [Sat, 25 Jan 2014 19:53:27 +0000 (20:53 +0100)]
bsd.lib.mk: Fix symlink creation if ${SHLIBDIR} and ${LIBDIR} differ.

5 years agojails/netinet6: Only select jailed ips for outgoing
Markus Pfeiffer [Sat, 25 Jan 2014 19:01:11 +0000 (19:01 +0000)]
jails/netinet6: Only select jailed ips for outgoing

Outgoing IP address selection for jailed processes using ipv6
was broken and selected the first ip6 address available.
Now the code checks whether an ip6 is available to the jail
in in6_ifawithascope.

5 years agoacpi/cstate: White space cleanup
Sepherosa Ziehau [Sat, 25 Jan 2014 13:48:50 +0000 (21:48 +0800)]
acpi/cstate: White space cleanup

5 years agoacpi/cstate: Save bus tag and handle to I/O operation beforehand
Sepherosa Ziehau [Sat, 25 Jan 2014 13:45:34 +0000 (21:45 +0800)]
acpi/cstate: Save bus tag and handle to I/O operation beforehand

5 years agoacpi/cstate: Utilize microtime_pcpu instead of ACPI timer
Sepherosa Ziehau [Sat, 25 Jan 2014 13:17:11 +0000 (21:17 +0800)]
acpi/cstate: Utilize microtime_pcpu instead of ACPI timer

5 years agopolling: Utilize microtime_pcpu
Sepherosa Ziehau [Sat, 25 Jan 2014 13:08:41 +0000 (21:08 +0800)]
polling: Utilize microtime_pcpu

5 years agotime: Add functions to calculate time difference
Sepherosa Ziehau [Sat, 25 Jan 2014 13:05:04 +0000 (21:05 +0800)]
time: Add functions to calculate time difference

Caller MUST make sure that the two time measured is on the same CPU.

5 years agoswapon(8): Remove forgotten initialization of iflag (which broke booting).
Sascha Wildner [Sat, 25 Jan 2014 11:06:00 +0000 (12:06 +0100)]
swapon(8): Remove forgotten initialization of iflag (which broke booting).

While here, add -i to the manpage's synopsis.

5 years agoUse less(1) as default pager for new user accounts
François Tigeot [Sat, 25 Jan 2014 08:55:48 +0000 (09:55 +0100)]
Use less(1) as default pager for new user accounts

5 years agox86_64: Log MONITOR/MWAIT features
Sepherosa Ziehau [Sat, 25 Jan 2014 07:25:53 +0000 (15:25 +0800)]
x86_64: Log MONITOR/MWAIT features

While Im here, cpu_mwait_features -> cpu_mwait_feature; consistent w/
other features variable name.

5 years agoacpi/cstate: If FADT is used, take C2_MP_SUPPORTED into consideration
Sepherosa Ziehau [Sat, 25 Jan 2014 07:13:09 +0000 (15:13 +0800)]
acpi/cstate: If FADT is used, take C2_MP_SUPPORTED into consideration