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
Sepherosa Ziehau [Mon, 20 Jan 2014 13:40:39 +0000 (21:40 +0800)]
acpi/cstate: Remove unused macros
Sepherosa Ziehau [Mon, 20 Jan 2014 13:36:13 +0000 (21:36 +0800)]
acpi/cstate: acpi_cpu_softc -> acpi_cst_softc
Sepherosa Ziehau [Mon, 20 Jan 2014 04:56:00 +0000 (12:56 +0800)]
acpi/cstate: Remove useless device methods
Sascha Wildner [Mon, 13 Jan 2014 08:00:26 +0000 (09:00 +0100)]
kernel/acpi: Silence exception warning when a \\_Sx_ object can't be found.
Submitted-by: sephe
Sascha Wildner [Thu, 2 Jan 2014 13:58:24 +0000 (14:58 +0100)]
Remove previous ACPICA.
Sascha Wildner [Thu, 2 Jan 2014 00:45:26 +0000 (01:45 +0100)]
acpi: Fix building the kernel.
Sascha Wildner [Fri, 3 Jan 2014 00:41:09 +0000 (01:41 +0100)]
acpi: Fix building userland.
As of this commit we're losing acpidb(8) which gets replaced by
acpiexec(8).
Additionally, we're getting:
acpibin(8)
acpiexec(8)
acpihelp(8)
acpinames(8)
acpisrc(8)
acpixtract(8)
Manual pages for the new utilities have yet to be written. Also
acpidump.8 and iasl.8 need to be updated, I guess.
Sascha Wildner [Wed, 1 Jan 2014 13:50:08 +0000 (14:50 +0100)]
sys/acpi: Bring in Intel's acpica-unix2-
20131218 verbatim.
On acpica.org, -unix is the version with an Intel license and
-unix2 is the BSD/GPL dual licensed version. I didn't want to
call the directory acpica-unix2 instead of our acpica-unix so
I settled on simply acpica.
Further updates would be done in-place in that directory.
François Tigeot [Sun, 19 Jan 2014 20:08:23 +0000 (21:08 +0100)]
drm: Reduce differences with Linux 3.8
François Tigeot [Sun, 19 Jan 2014 19:38:42 +0000 (20:38 +0100)]
asm/uaccess.h: Add get_user() and put_user()
Obtained-from: linux/uaccess.h from FreeBSD's OFED stack
François Tigeot [Sun, 19 Jan 2014 19:36:00 +0000 (20:36 +0100)]
drm: Import asm/uaccess.h from FreeBSD's OFED stack
Markus Pfeiffer [Sat, 18 Jan 2014 22:14:46 +0000 (22:14 +0000)]
manpages: Update documentation of lock(9) to include lockowned
François Tigeot [Sun, 19 Jan 2014 13:49:47 +0000 (14:49 +0100)]
drm: Remove DRM_MSLEEP()
François Tigeot [Sun, 19 Jan 2014 14:41:37 +0000 (15:41 +0100)]
drm/radeon: Replace DRM_MSLEEP() by msleep()
François Tigeot [Sun, 19 Jan 2014 13:20:44 +0000 (14:20 +0100)]
drm: Add linux/delay.h, implement msleep()
Sepherosa Ziehau [Sun, 19 Jan 2014 14:24:11 +0000 (22:24 +0800)]
acpi/cstate: Break long lines; minor style changes
Sepherosa Ziehau [Sun, 19 Jan 2014 14:06:51 +0000 (22:06 +0800)]
acpi/cstate: Dispatch Cx re-probing to the target CPU
And add flag to indicate that the Cx probing is in progress, so
if idle is scheduled before the probing is done, we could safely
fallback to C1.
Sepherosa Ziehau [Sun, 19 Jan 2014 08:54:34 +0000 (16:54 +0800)]
acpi/cstate: Set cx_lowest on the target CPU
Sepherosa Ziehau [Sun, 19 Jan 2014 07:45:00 +0000 (15:45 +0800)]
acpi/cstate: Fix global Cx count setup
Sepherosa Ziehau [Sun, 19 Jan 2014 06:57:13 +0000 (14:57 +0800)]
acpi/cstate: Use u_long as stats type
Sepherosa Ziehau [Sun, 19 Jan 2014 06:41:18 +0000 (14:41 +0800)]
acpi/cstate: Fix non-C3 setting
It should take lowest Cx setting into consideration.
Sepherosa Ziehau [Sat, 18 Jan 2014 13:25:37 +0000 (21:25 +0800)]
acpi/cstate: Set non-C3 state during generic Cx probing
Remove useless non-C3 state index setup in cx_list, which should
only reformat sysctl string.
Sascha Wildner [Sat, 18 Jan 2014 20:43:52 +0000 (21:43 +0100)]
Only run the 670.pkgsrcaudit periodic script if pkgsrc is found.
The script will eventually go away once we move away from pkgsrc
in PATHs, manpages and everywhere but I don't want to do that right
now, hence this check for now. This silences the error this script
was giving on dports systems.
Reported-by: pavalos
François Tigeot [Sat, 18 Jan 2014 19:46:31 +0000 (20:46 +0100)]
linux/kernel.h: Implement swap()
François Tigeot [Sat, 18 Jan 2014 19:39:13 +0000 (20:39 +0100)]
linux/kernel.h: printf => kprintf
François Tigeot [Sat, 18 Jan 2014 13:04:23 +0000 (14:04 +0100)]
drm: Import linux/err.h from FreeBSD's OFED stack