Sepherosa Ziehau [Thu, 6 Feb 2014 12:34:28 +0000 (20:34 +0800)]
acpica: Disable debug message by default
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.
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.
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.
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
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.
Sepherosa Ziehau [Wed, 5 Feb 2014 12:48:41 +0000 (20:48 +0800)]
x86_64/mwait: Start auto tuning from C1
Sepherosa Ziehau [Wed, 5 Feb 2014 12:43:04 +0000 (20:43 +0800)]
x86_64: Fix up the setting of BM_STS
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
François Tigeot [Tue, 4 Feb 2014 21:21:40 +0000 (22:21 +0100)]
drm: Sync a few headers 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
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
Sepherosa Ziehau [Mon, 3 Feb 2014 14:42:08 +0000 (22:42 +0800)]
x86_64: Rework cpu specific C-state auto tuning
Sepherosa Ziehau [Mon, 3 Feb 2014 14:05:55 +0000 (22:05 +0800)]
x86_64: Use per-cpu stats for idle
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
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), [...]"
Also:
"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.
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."
Sascha Wildner [Sun, 2 Feb 2014 22:41:30 +0000 (23:41 +0100)]
pthread_attr.3: Adjust pthread_attr_setinheritsched() return value.
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.
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:
PTHREAD_INHERIT_SCHED
[...]
PTHREAD_EXPLICIT_SCHED
[...]"
And, "the pthread_attr_setinheritsched() function may fail if:
[EINVAL]
The value of inheritsched is not valid."
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.
Sascha Wildner [Sun, 2 Feb 2014 17:57:01 +0000 (18:57 +0100)]
libc: __sys_fork() and _fork() are no more.
Sascha Wildner [Sun, 2 Feb 2014 17:56:12 +0000 (18:56 +0100)]
libc_r: Fix up for the recent sysvipc work.
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.
NOTE:
AUTODEEP and C3+ cpu specific C-state is not bullet prove yet. We need
to get the bus master operations information from ACPI.
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.
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.
Sascha Wildner [Sun, 2 Feb 2014 10:27:24 +0000 (11:27 +0100)]
libc: Silence another -Wtype-limits (socklen_t is unsigned).
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.
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.
Sascha Wildner [Sat, 1 Feb 2014 19:25:55 +0000 (20:25 +0100)]
libc: Fix some -Wunused-parameter.
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.
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.
Sascha Wildner [Sat, 1 Feb 2014 07:13:58 +0000 (08:13 +0100)]
rcrun(8): Rename $i, $j and $k to (more) meaningful names.
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.
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).
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).
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.
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
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
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
passed.
* socklen_t is unsigned, so checking extlen for less than zero is
not needed.
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".
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.
Sepherosa Ziehau [Thu, 30 Jan 2014 04:24:58 +0000 (12:24 +0800)]
acpi/cstate: Fix resource leakage
Sepherosa Ziehau [Thu, 30 Jan 2014 04:01:55 +0000 (12:01 +0800)]
acpi/cstate: Use boolean_t for acpi_cst_disable_idle
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
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
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.
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
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
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.
Sepherosa Ziehau [Mon, 27 Jan 2014 12:40:47 +0000 (20:40 +0800)]
acpi/cstate: Rearrange _CST reprobe code path
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.
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.
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
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 .
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.
Sepherosa Ziehau [Sun, 26 Jan 2014 09:40:00 +0000 (17:40 +0800)]
acpi/cstate: Fix up comment
Franco Fichtner [Sun, 26 Jan 2014 10:05:43 +0000 (11:05 +0100)]
doc: remove cdevpriv bits from porting guide
Franco Fichtner [Sun, 26 Jan 2014 09:58:32 +0000 (10:58 +0100)]
netmap: remove bogus NULL check
Reported-by: swildner
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
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.
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
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.
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.
Sepherosa Ziehau [Sat, 25 Jan 2014 13:48:50 +0000 (21:48 +0800)]
acpi/cstate: White space cleanup
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
Sepherosa Ziehau [Sat, 25 Jan 2014 13:17:11 +0000 (21:17 +0800)]
acpi/cstate: Utilize microtime_pcpu instead of ACPI timer
Sepherosa Ziehau [Sat, 25 Jan 2014 13:08:41 +0000 (21:08 +0800)]
polling: Utilize microtime_pcpu
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.
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.
François Tigeot [Sat, 25 Jan 2014 08:55:48 +0000 (09:55 +0100)]
Use less(1) as default pager for new user accounts
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.
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
Sepherosa Ziehau [Sat, 25 Jan 2014 06:59:45 +0000 (14:59 +0800)]
mwait: Allow treating interrupts as break-event for MWAIT
Even when interrupts disabled by setting ECX[0] to 1. Needed for
"native" C-state support.
Sepherosa Ziehau [Fri, 24 Jan 2014 16:02:15 +0000 (00:02 +0800)]
acpi/cstate: BM_STS only needs check before entering C3+ state
Sepherosa Ziehau [Fri, 24 Jan 2014 14:48:58 +0000 (22:48 +0800)]
acpi/cstate: Free previously allocated resource during re-probing
Sepherosa Ziehau [Thu, 23 Jan 2014 13:04:33 +0000 (21:04 +0800)]
acpi/pstate: Utilize CPUID_TO_{FAMILY,MODEL} macros
Joris Giovannangeli [Sat, 25 Jan 2014 00:04:04 +0000 (01:04 +0100)]
/sbin/swapon : adds a -i flag which prompts for user confirmation.
Markus Pfeiffer [Fri, 24 Jan 2014 18:05:10 +0000 (18:05 +0000)]
nrelease: Correct help message when cdrtools is not installed
Sascha Wildner [Fri, 24 Jan 2014 17:02:59 +0000 (18:02 +0100)]
kernel/drm: Add some missing opt_ktr.h in Makefiles.
François Tigeot [Thu, 23 Jan 2014 10:59:11 +0000 (11:59 +0100)]
drm: Fix DRM_CURRENTPID macro
Spotted-by: joris
Sascha Wildner [Thu, 23 Jan 2014 21:56:29 +0000 (22:56 +0100)]
Stop using libcompat in our tree.
The only thing that actually needed it was fortune(6). Move it to using
libc's regex(3) functions (taken from FreeBSD).
Markus Pfeiffer [Sun, 19 Jan 2014 16:17:04 +0000 (16:17 +0000)]
kern/usb4bsd: update usb_dev.c kqfilter code
Markus Pfeiffer [Sat, 18 Jan 2014 23:11:22 +0000 (23:11 +0000)]
usb4bsd: fix if_axe lock issue
For some reason if_axe was acquiring the sc_lock twice leading to
a panic.
Markus Pfeiffer [Fri, 17 Jan 2014 19:09:46 +0000 (19:09 +0000)]
usb4bsd: sync if_axe
Markus Pfeiffer [Thu, 16 Jan 2014 19:36:48 +0000 (19:36 +0000)]
usb4bsd sync ukbd
Markus Pfeiffer [Tue, 14 Jan 2014 23:40:57 +0000 (23:40 +0000)]
usb4bsd: remove debug kprintfs
Markus Pfeiffer [Tue, 14 Jan 2014 22:02:40 +0000 (22:02 +0000)]
devfs: add passing of file pointer through to dev_dclose
Markus Pfeiffer [Tue, 14 Jan 2014 22:02:12 +0000 (22:02 +0000)]
usb4bsd: remove merge artifact
Markus Pfeiffer [Tue, 14 Jan 2014 19:39:34 +0000 (19:39 +0000)]
Apply patches to enable get/set_cdevpriv
Johannes Hofmann [Wed, 18 Dec 2013 22:06:22 +0000 (23:06 +0100)]
add file pointer to dev_d*() functions
Johannes Hofmann [Wed, 18 Dec 2013 22:05:42 +0000 (23:05 +0100)]
add devfs_*_cdevpriv() functions
Sascha Wildner [Tue, 21 Jan 2014 21:09:03 +0000 (22:09 +0100)]
bsd-family-tree: Sync with FreeBSD (for FreeBSD 10.0).
Sascha Wildner [Tue, 21 Jan 2014 20:15:07 +0000 (21:15 +0100)]
acpidump.8: acpidb is acpiexec now but no manpage yet. Comment out .Xr.
Sepherosa Ziehau [Tue, 21 Jan 2014 13:06:58 +0000 (21:06 +0800)]
acpi/cstate: acpi_cpu_cst -> acpi_cst for driver glue variables
Sepherosa Ziehau [Tue, 21 Jan 2014 13:05:30 +0000 (21:05 +0800)]
acpi/cstate: acpi_cpu_cst -> acpi_cst for device methods
Sepherosa Ziehau [Tue, 21 Jan 2014 13:02:51 +0000 (21:02 +0800)]
acpi/cstate: Restore cx_lowest_req, if no suitable intr cputimer
Sepherosa Ziehau [Tue, 21 Jan 2014 12:54:54 +0000 (20:54 +0800)]
acpi/acad: Put unknown notify print under bootverbose
Sepherosa Ziehau [Tue, 21 Jan 2014 12:44:30 +0000 (20:44 +0800)]
acpi/acad: CST changed may service as notification for acline changes
François Tigeot [Mon, 20 Jan 2014 19:42:34 +0000 (20:42 +0100)]
Bump __DragonFly_version after drm/i915 update
xf86-video-intel-2.21.15 now runs properly on DragonFly