François Tigeot [Tue, 15 Jul 2014 16:20:56 +0000 (18:20 +0200)]
drm: Reorder functions in drm_irq.c
* Reducing differences with Linux 3.8.13
* No functional change
Sascha Wildner [Tue, 15 Jul 2014 09:15:47 +0000 (11:15 +0200)]
Update the pciconf(8) database.
July 14, 2014 snapshot from http://pciids.sourceforge.net/
Sascha Wildner [Tue, 15 Jul 2014 09:03:03 +0000 (11:03 +0200)]
<sys/protosw.h>: Use netmsg_t.
Sascha Wildner [Tue, 15 Jul 2014 08:42:17 +0000 (10:42 +0200)]
kernel/netgraph7: Use kprintf etc. directly instead of defining printf.
While here, remove some commented out code from dragonfly.h
In-discussion-with: nant
Sascha Wildner [Tue, 15 Jul 2014 08:09:00 +0000 (10:09 +0200)]
kernel/netgraph: Don't grab the tty_token around ldisc_{,de}register().
The functions already grab it themselves.
Pointed-out-by: nant
Sascha Wildner [Tue, 15 Jul 2014 07:03:41 +0000 (09:03 +0200)]
kernel/netgraph7: Remove unneeded CFLAGS.
Sascha Wildner [Tue, 15 Jul 2014 06:53:21 +0000 (08:53 +0200)]
kernel/netgraph7: Adjust SVN ID.
Imre Vadasz [Mon, 14 Jul 2014 19:32:27 +0000 (21:32 +0200)]
km(4): Also supports sensors in AMD Family 12h CPUs. Update manpage.
* AMD Family 12h CPUs use the same PCI device ID as Family 14h CPUs.
Sascha Wildner [Mon, 14 Jul 2014 18:54:56 +0000 (20:54 +0200)]
kernel/netgraph7: Sync ng_bt3c with current FreeBSD and port it over.
I can't test this hardware unfortunately since I don't own it.
Matthew Dillon [Mon, 14 Jul 2014 18:16:53 +0000 (11:16 -0700)]
powerd - Set to max performance if killed
* If the powerd daemon is killed it now sets the system to maximum
performance before exiting for consistency, instead of leaving it
in a potentially low-power state.
Matthew Dillon [Mon, 14 Jul 2014 17:47:22 +0000 (10:47 -0700)]
kernel - Fix stability issue with net.inet.tcp.inflight*
* net.inet.tcp.inflight_enable is (already) turned on by default. This
is necessary for network stability and to reduce excessive packet buffering
to make PF and other routing protocols on the network work better.
* There is a bug at very high bandwidths where the 'bw' calculation is
unstable and can lead to positive feedback instead of the desired negative
feedback, preventing the tcp buffer size from ramping up properly.
GigE links could sometimes run a tcp stream as slow as 7 MBytes/sec due
to the bug due to bwnd limiting the tcp buffer to ~30-50KB.
* Fix the bug by increasing the minimum delta ticks for calculating (bw)
from 1 to 2 and changing the stab parameter to scale bw instead of adding a
fixed number of tcp maxsegs to bwnd. This handles the high-speed issue.
Low speed stability issues are handled by also adding 2*maxseg to bwnd.
With this fix, GigE links stabilize better at the ~400-450KB needed to run
the stream at full speed.
* net.inet.tcp.inflight_stab now scales bw in 1/10% increments instead
of adding N*tcp_maxseg/10. The default value of 50 increases the 'bw'
calculation used to derive bwnd by 5%. This appears to be sufficient.
Reported-by: alexh, rob__
Alex Hornung [Mon, 14 Jul 2014 11:43:40 +0000 (12:43 +0100)]
rc.d/random: bring back rc.conf defaults, minor fixes
* Saving the entropy across reboots is good practice to
avoid having a lack of entropy after restarting the
machine. For some reason, it has been disabled by default
for ages now.
* This commit brings back the defaults in rc.conf to enable
saving entropy across reboots.
* Minor fixes to rc.d/random, such as not assuming
/var/db/entropy is a good place to put the entropy file,
last but not least because:
- that location is not checked on the start part of the script,
so it won't ever be used.
- /var/db/entropy is most of the time a directory, for the
cron-based entropy collection.
Alex Hornung [Mon, 14 Jul 2014 10:55:33 +0000 (11:55 +0100)]
random.4 - update for new CSPRNG status
Alex Hornung [Mon, 14 Jul 2014 07:53:06 +0000 (08:53 +0100)]
kern_nrandom, rnd drivers: update for new CSPRNG
* Identify each source of entropy with an identifier, so that
for example the Fortuna CSPRNG can manage the pool index
for each source.
* Add a new sysctl, kern.rand_mode, which can be used to select
which generator is used for /dev/random; valid values are:
- csprng (to use only the Fortuna-based CSPRNG)
- ibaa (to use only IBAA)
- mixed (to XOR both csprng and ibaa in the output stream
It defaults to "mixed".
Alex Hornung [Thu, 12 Jun 2014 14:32:27 +0000 (15:32 +0100)]
Add ChaCha and CSPRNG to conf/files
Alex Hornung [Thu, 12 Jun 2014 14:24:21 +0000 (15:24 +0100)]
kernel - add a fortuna-based CSPRNG
* This implements a Fortuna-based CSPRNG.
* All entropy pools are shared across all CPUs in the system.
* SHA256 is used instead of SHA256_d as cryptographical hash
function.
* ChaCha is used as stream cipher instead of AES in CTR mode.
Alex Hornung [Thu, 12 Jun 2014 14:22:32 +0000 (15:22 +0100)]
kernel - add ChaCha algorithm (djb's merged implementation)
Alex Hornung [Thu, 12 Jun 2014 14:23:05 +0000 (15:23 +0100)]
glxsb(4) - use add_buffer_randomness()
Sepherosa Ziehau [Mon, 14 Jul 2014 09:59:34 +0000 (10:59 +0100)]
igb: enable MSI-X for i354 on C2550 SoC
Matthew Dillon [Mon, 14 Jul 2014 05:15:52 +0000 (22:15 -0700)]
drm - Fix bug with ttm_tt_swapin()
* Fix deadlock due to improper handling of the vm_page PG_BUSY in
ttm_tt_swapin().
François Tigeot [Sun, 13 Jul 2014 09:00:12 +0000 (11:00 +0200)]
drm/ttm: Replace FreeBSD custom code by Linux workqueues
Imre Vadasz [Sun, 13 Jul 2014 11:02:00 +0000 (13:02 +0200)]
identcpu: Add AMD Features2 strings for bits 25 to 28
Matthew Dillon [Sun, 13 Jul 2014 23:00:39 +0000 (16:00 -0700)]
kgdb - Fix for new CPU_prvspace[]
* CPU_prvspace[] is now an array of pointers to struct privatespace and
not an array of struct privatespace.
Sascha Wildner [Sun, 13 Jul 2014 12:10:11 +0000 (14:10 +0200)]
kernel/netgraph: Remove useless Makefile.inc's.
Sascha Wildner [Sun, 13 Jul 2014 18:47:23 +0000 (20:47 +0200)]
kernel/netgraph7: Sync ubt and ubtbcmfw with current FreeBSD.
Also make them compile.
We need those drivers as of FreeBSD >=8 here since that's when
FreeBSD switched to usb4bsd.
Alex Hornung [Sun, 13 Jul 2014 11:33:56 +0000 (12:33 +0100)]
Revert "add load_kld to rc.subr"
This reverts commit
9b9814ddce54234e4b231ecb33b1de509a0a9bd5.
We don't really need load_kld, since ifconfig loads if_vlan on its own.
Alex Hornung [Sun, 13 Jul 2014 09:56:35 +0000 (10:56 +0100)]
rc.conf - Add support for FreeBSD-style vlan conf
Obtained-from: FreeBSD
Alex Hornung [Sun, 13 Jul 2014 09:45:44 +0000 (10:45 +0100)]
ifconfig - use correct name after cloning
* When running something like 'ifconfig vlan create vlandev foo vlan
99', the vlan would be created correctly, but SIOCSETVLAN would be
called on 'vlan' instead of the newly created vlan device.
* Work around this by updating ifr_name from name (which is updated by
the clone function) after doing the actual clone callback.
Alex Hornung [Sun, 13 Jul 2014 07:19:55 +0000 (08:19 +0100)]
network.subr - use get_if_var extensively
Alex Hornung [Sun, 13 Jul 2014 07:06:13 +0000 (08:06 +0100)]
add load_kld to rc.subr
Obtained-from: FreeBSD
Alex Hornung [Sun, 13 Jul 2014 06:59:27 +0000 (07:59 +0100)]
network.subr - move get_if_var here
Sascha Wildner [Sun, 13 Jul 2014 09:52:31 +0000 (11:52 +0200)]
kernel: Use NULL for pointers.
François Tigeot [Sun, 13 Jul 2014 06:40:12 +0000 (08:40 +0200)]
drm: Improve the BUG() macro
Nuno Antunes [Sat, 12 Jul 2014 15:37:52 +0000 (16:37 +0100)]
netgraph7: Fix a bug in the Makefile.
* The ng_mppc node should not be built if the NO_CRYPT make
variable is set.
Matthew Dillon [Sun, 13 Jul 2014 01:06:53 +0000 (18:06 -0700)]
build - allow ABIVERS to be overridden in Makefile.usr
* Allow ABIVERS to be overridden in Makefile.usr. (Defaults to uname -P).
Matthew Dillon [Sun, 13 Jul 2014 00:48:59 +0000 (17:48 -0700)]
kernel - More verbose boot de-spamming
* Try to fit common package siblings print lines into 80 columns.
Matthew Dillon [Sun, 13 Jul 2014 00:31:48 +0000 (17:31 -0700)]
kernel - Add two features to improve qemu emulation (64-bit only)
* Implement a tunable for machdep.cpu_idle_hlt, allowing it to be
set in /boot/loader.conf. For qemu the admin might want to set
the value to 4 (always use HLT) instead of the default 2.
* Implement a tunable and new sysctl, machdep.pmap_fast_kernel_cpusync,
which defaults to disabled (0). Setting this to 1 in /boot/loader.conf
or at anytime via sysctl tells the kernel to use a one-stage pmap
invalidation for kernel_pmap updates. User pmaps are not affected and
will still use two-stage invalidations.
One-stage pmap invalidations only have to spin on the originating cpu,
but all other cpus will not be quiesced when updating a kernel_map pmap
entry. This is untested as there might be situations where the kernel
pmap is updated without an interlock (though most should be interlocked
already).
This second sysctl/tunable, if enabled, greatly improves qemu performance
particularly when the number of qemu cpus is greater than the number of
real cpus. It probably improves real hardware system performance as well,
but is not recommended for production at this time.
Matthew Dillon [Sun, 13 Jul 2014 00:30:04 +0000 (17:30 -0700)]
kernel - Add lwkt_cpusync_quick()
* Add a quick one-stage cpusync function to complement our two-stage
interlock/deinterlock cpusync functions.
The one-stage version doesn't have to spin the target cpus, only the
originating cpu, but it can't quiesce the cpus either whereas the
two-stage version can.
Matthew Dillon [Sun, 13 Jul 2014 00:20:29 +0000 (17:20 -0700)]
kernel - Reduce console spam in verbose mode when printing cpu sets
* Add helper function kprint_cpuset().
* Print cpu ranges when printing out cpu sets.
* Print cpu ranges when generating topology output for sysctl
François Tigeot [Sat, 12 Jul 2014 19:22:33 +0000 (21:22 +0200)]
drm/i915: Fix flickering screen issues on some laptops
Reported-and-tested-by: luxh
Matthew Dillon [Sat, 12 Jul 2014 18:49:13 +0000 (11:49 -0700)]
kernel - Fix crypto boots and rescue boots
* The kernel text+data+bss is too big, the loader's 64MB heap can't fit
it plus modules plus the initrd image any more. Fix by reducing the
kernel's BSS.
* Reduce the BSS allocation for CPU_prvspace[] from 11MB (45056 x 256 cpus)
to ~45056 for the BSP and dynamically allocate the globaldata space for
the APs. Also saves ~11MB of ram or so on normal systems.
* Reduce the BSS allocation for cpu_map_entry_init[]. Only the BSP needs
MAXCPU+1 pre-cached vm_map_entry structures. The APs can make due with
8 or so before the VM system comes up sufficiently to dynamically allocate
these structures. This saves around ~6.5MB of ram on normal systems.
Imre Vadasz [Sat, 12 Jul 2014 15:40:31 +0000 (17:40 +0200)]
km(4): Support for sensors in AMDs Kaveri and Kabini APUs
* Add support for Family 15h Models 30h-3Fh (Kaveri) and for
Family 16h Models 00h-0Fh (Kabini).
Sascha Wildner [Fri, 11 Jul 2014 21:27:42 +0000 (23:27 +0200)]
Fix a couple of typos in a manpage and readme file.
Sascha Wildner [Fri, 11 Jul 2014 19:52:32 +0000 (21:52 +0200)]
kernel: Remove unused functions vop_panic() and vfs_std{,un}mount().
vop_panic()'s last usage was removed in 2009 (in
bdc5802715465c8)
while vfs_stdmount() and vfs_stdunmount() were inherited from FreeBSD
but never used at all.
Matthew Dillon [Fri, 11 Jul 2014 18:07:50 +0000 (11:07 -0700)]
kernel - Fix table problem w/IPV6 matching with PF
* Zero the sin6 structure before initializing it for passing to rn_match().
rn_match() is not structurally aware so pad space in the structure must
be zero'd.
* Fixes IPV6 table matching problem with PF.
Reported-by: ftigeot
Testing-by: ftigeot
Sascha Wildner [Fri, 11 Jul 2014 11:46:50 +0000 (13:46 +0200)]
libradius.3: Add missing include file in the manual page.
It has the prototype for *vendor* functions and rad_demangle_mppe_key().
Nuno Antunes [Fri, 20 Jun 2014 14:11:34 +0000 (15:11 +0100)]
netgraph7: Allow name and ID hashes to grow.
* Also, nodes can be renamed now.
Obtained-from: FreeBSD (with changes)
Nuno Antunes [Fri, 20 Jun 2014 14:04:37 +0000 (15:04 +0100)]
netgraph7: Plug item allocation leak in ng_socket.
* ng_connect_data() allocates a dummy item (which will not be sent) to
address the destination node and obtain reference on it. This item
needs to be freed before returning from this function, so use
ng_free_item() instead of the NOP NG_FREE_ITEM.
Nuno Antunes [Thu, 19 Jun 2014 02:25:54 +0000 (03:25 +0100)]
netgraph7: Use a shared token to protect typelist changes.
* Reduce differences with FreeBSD current.
Nuno Antunes [Wed, 18 Jun 2014 07:22:06 +0000 (08:22 +0100)]
netgraph7: Use a shared token to protect topology changes.
* FreeBSD current uses a reader/writer lock to protect topology changes.
Take the same approach except we use a shared token instead.
Nuno Antunes [Wed, 18 Jun 2014 06:37:16 +0000 (07:37 +0100)]
netgraph7: Remove unneeded critical sections.
* While here, fix some style nits.
* Also add a missing objcache_destroy() call.
Nuno Antunes [Wed, 18 Jun 2014 05:26:09 +0000 (06:26 +0100)]
netgraph7: Directly use objcache_* functions instead of a translation macro.
Nuno Antunes [Thu, 9 May 2013 21:59:47 +0000 (21:59 +0000)]
netgraph7: Major rework of netgraph7 internal mechanisms.
* Promote the netgraph taskqueue to a fully fledged per-CPU lwkt.
Currently all work is queued to cpu0 but the idea is to later distribute
work among the threads. I also explored the idea of using netisr threads
instead of our own dedicated threads but I think it would be a bad idea to
globaly block a netisr thread due to a netgraph token or other lock.
* Embed a struct lwkt_msg in netgraph items.
* Make ng_apply_item() accept only one argument.
* Remove the global worklist and per-node input queues and related routines.
* Always and only queue items coming from interrupt context.
Items are now always queued, except if they are already being sent from a
netgraph thread (depth > 1). The NG_QUEUE and HK_QUEUE flags become no-ops
but are kept for compatibility reasons.
* Replace the node reader/writer gate with a per-node lwkt shared
token.
* Remove some #if 0'd code
* netgraph7/ng_socket: Avoid blocking on netisr.
Previously, the ng_socket code used a sleep/wakeup mechanism to
prevent returning immediatly from the syscall. This caused
netisr_cpu 0 to block globaly until the item was processed,
which is very inneficient.
Instead, delay the lwkt_replymsg call in the normal case until the item
has been processed. This achieves the same requirement of not returning
from syscall until the item is processed but is much more elegant.
Because ngc_send() returns sooner now, we can't allocate the apply
info from the stack. Instead, dynamically allocate it from an
objcache.
* Zeroize an item before returning it to the objcache.
Objects must be in their initialized state before being returned
to the object cache. Do that for netgraph items.
The above exposed a use after free bug. An item must remain valid
until is applied. If an item has been queued with a registered apply
callback, free it only after the callback is made.
* Add a function to check and apply the callback in case the item has
one registered.
* Pass the apply callback error via lwkt_replymsg() directly, instead of
using a field in the apply_info structure.
* Make sure that ng_socket items don't have their apply callback called
twice which was causing a panic.
* Items are now only allowed to be freed by ng_apply_item(). NG_FREE_ITEM
is kept for compatibility reasons but now it simply marks the item for
deletion and asserts it was not marked already in order to detect
double frees.
Hold a reference on the item every time it is sent or forwarded. When the
recursion is finished we are finally allowed to free the item on
ng_apply_item(). Prior to freeing the item, check it for a registered
callback.
* Let recursion unwinding free the item, even in case of error.
* Go back to using a single item allocation pool, instead of separate data
and message/function pools. If there is a performance hit, we'll have to
deal with it later. Now, ng_realloc_item() simply changes the item type,
without allocating a new one from the objcache.
Dragonfly-bug: http://bugs.dragonflybsd.org/issues/2549
Nuno Antunes [Fri, 11 Jul 2014 08:13:28 +0000 (09:13 +0100)]
netgraph7/eiface: Remove KMODDEPS from Makefile.
Nuno Antunes [Mon, 13 May 2013 16:33:29 +0000 (17:33 +0100)]
netgraph7: Bring in ng_eiface.
François Tigeot [Thu, 10 Jul 2014 07:57:25 +0000 (09:57 +0200)]
drm: Replace some custom code by wait_event routines
François Tigeot [Thu, 10 Jul 2014 06:42:16 +0000 (08:42 +0200)]
drm: Add a linux/jiffies.h implementation
* timespec_to_jiffies() inspired by the OpenBSD implementation
* Other code from existing drm files
François Tigeot [Thu, 10 Jul 2014 06:10:41 +0000 (08:10 +0200)]
drm: Add a linux/time.h implementation
Move some code already present elsewhere to the new file.
Matthew Dillon [Tue, 8 Jul 2014 18:17:48 +0000 (11:17 -0700)]
kernel - (32 bit) fix MP boot problems
* Same bug fix for bootstrapping the idle thread as in other architectures.
Sascha Wildner [Tue, 8 Jul 2014 13:34:54 +0000 (15:34 +0200)]
kernel/vga: Fix register name in a comment.
Sascha Wildner [Tue, 8 Jul 2014 12:39:52 +0000 (14:39 +0200)]
kernel/vga: Fix a CRTC register setting which I botched back in 2008.
Sascha Wildner [Tue, 8 Jul 2014 03:10:10 +0000 (05:10 +0200)]
kernel/vga: Remove VGA_NO_BIOS and VGA_ALT_SEQACCESS options.
VGA_NO_BIOS and VGA_NO_MODE_CHANGE were overlapping 90% or more in
functionality, so remove the former (which is internal anyway) and
use VGA_NO_MODE_CHANGE there too.
Also remove VGA_ALT_SEQACCESS which provided some alternate way to
access the VGA sequencer. I've not heard of anyone needing this
option ever, so assume that it is no longer needed. It can be brought
back if it turns out to be important to anyone.
In-discussion-with: ivadasz
François Tigeot [Tue, 8 Jul 2014 06:26:55 +0000 (08:26 +0200)]
drm/i915: Add some missing locks
Obtained-from: Linux 3.8.13
François Tigeot [Tue, 8 Jul 2014 06:25:22 +0000 (08:25 +0200)]
drm/i915: Add i915_gem_object_sync()
Matthew Dillon [Tue, 8 Jul 2014 02:52:44 +0000 (19:52 -0700)]
vkernel - Fix systat -vm 1
* Make the 'dirtybufspace' symbol global in the kernel so systat -vm 1
run from userland under a vkernel can find it. For some reason, vkernel
builds lose static symbols that real-kernel builds don't have a problem
with.
Reminded-by: tuxillo
Sascha Wildner [Mon, 7 Jul 2014 09:44:51 +0000 (11:44 +0200)]
kernel/usb4bsd: Add the urndis(4) driver for Remote NDIS device support.
Aka USB tethering.
Taken-from: FreeBSD
Tested-by: Yellow Rabbit <yrabbit@sdf.lonestar.org>
Sascha Wildner [Mon, 7 Jul 2014 09:08:48 +0000 (11:08 +0200)]
acpica: Clean up the config header a bit.
Nuno Antunes [Tue, 24 Jun 2014 02:43:40 +0000 (03:43 +0100)]
paths.h: Add path to ifconfig.
François Tigeot [Mon, 7 Jul 2014 06:01:58 +0000 (08:01 +0200)]
drm/i915: Reduce ring code differences with Linux
* Factorize somme common code sequences to __wait_seqno()
* Change locking in get/put irq functions
Matthew Dillon [Mon, 7 Jul 2014 05:53:19 +0000 (22:53 -0700)]
vkernel64 - Make operational again after bootstrap changes
* vkernel64's need the same cpu_idle_restore() fix that x86-64 got to
properly handle pending migrations on the BSP at bootstrap time.
(this occurs due to the way initclocks_other() works now).
* Add a warning/reminder in param.h regarding increasing MAXCPU beyond 256.
Sascha Wildner [Mon, 7 Jul 2014 05:31:29 +0000 (07:31 +0200)]
rpc: Remove empty FreeBSD ID.
Matthew Dillon [Mon, 7 Jul 2014 05:16:51 +0000 (22:16 -0700)]
build - Fix vkernel64 build
* Fix build due to missing declaration from recent commit.
Justin C. Sherrill [Sun, 6 Jul 2014 23:10:44 +0000 (19:10 -0400)]
RPC: remove some extraneous $id$ lines.
hrs [Mon, 25 Nov 2013 19:04:36 +0000 (19:04 +0000)]
RPC: replace Sun license with 3-clause BSD license.
Original commit message:
"Replace Sun RPC license in TI-RPC library with a 3-clause BSD license,
with the explicit permission of Sun Microsystems in 2009."
Taken-from: FreeBSD
Cherry-picked-from: http://svnweb.freebsd.org/base?view=revision&revision=258578
Matthew Dillon [Sun, 6 Jul 2014 19:49:22 +0000 (12:49 -0700)]
boot - Fix timecount issues with some BIOSes
* Some BIOSes do not correctly read RTC which means there is no timecount
at boot time. The system boots immediately without giving the user a
chance to choose a menu option. This patch gets rid of the annoying issue.
It has no effect on systems that work properly.
Reported-by: peeter bug #2696
Taken-from: FreeBSD
Matthew Dillon [Sun, 6 Jul 2014 19:27:04 +0000 (12:27 -0700)]
kernel - extend cpus past 64 - fixes and adjustments
* Reorder the SMP cpu boot code to remove a great deal of lock contention.
The APs must still loop waiting for the BSP to adjust the stage, but
they no longer need to hold a token or spinlock so startup under emulation
is considerably faster.
* Do not initialize our systimer periodics on each target cpu from the
idle thread bootstrap. Previously with the MP lock held the locks acquired
during this initialization were serialized and could not block. Now
that cpu startup runs mostly concurrently, that is no longer the
case.
Instead, systimer periodics are handled by process 0 as a post-smp-startup
call.
* statclock() now uses sys_cputimer() directly to calculate the delta time.
* The TSC is now implemented as sys_cputimer before any systimer periodics
(particularly statclock()) are set-up, allowing the system to take control
away from the i8254 earlier.
* Clean up struct lwkt_ipiq. Remove the 'lwkt_ipiq' typedef. Calculate
allocation sizes separately.
* Add a new loader.conf tunable, hw.tsc_cputimer_force. If set to 1 and
a TSC is present, the system will force invariant and mpsync operation
and always use the TSC as the cputimer (primarily useful for qemu).
* Remove unnecessary kmem_alloc() of the globaldata structure. We are
using a static array now. This access was wasting memory for a long
time.
* Make the boot stack bigger for the APs.
Matthew Dillon [Sun, 6 Jul 2014 19:21:17 +0000 (12:21 -0700)]
kernel - remove debugging
* Remove debugging for sip->subsystem.
Reminded-by: swildner
Matthew Dillon [Sun, 6 Jul 2014 19:19:18 +0000 (12:19 -0700)]
kernel - extend cpus past 64 - fixes
* qemu testing. Kernel can get stuck due to there not being enough
pre-allocated vm_map_entry structures. Increase MAX_MAPENT for booting
from 2048 to (SMP_MAXCPU * 32 + 1024), which should hopefully be enough.
* During early booting, the ZONE_SPECIAL flag is not yet set in
mapentzone_store.zflags. Add code to set the flag early.
Sascha Wildner [Sun, 6 Jul 2014 09:06:28 +0000 (11:06 +0200)]
Fix VKERNEL/i386 build.
Justin C. Sherrill [Sun, 6 Jul 2014 02:39:43 +0000 (22:39 -0400)]
Correct math and limerick.
Seen in FreeBSD just recently:
http://svnweb.freebsd.org/base?view=revision&revision=268295
And NetBSD 14 years ago:
http://cvsweb.netbsd.org/bsdweb.cgi/src/games/fortune/datfiles/fortunes2.diff?r1=1.6&r2=1.7&only_with_tag=MAIN
Sascha Wildner [Sat, 5 Jul 2014 20:41:12 +0000 (22:41 +0200)]
kernel: Fix KTR compilation.
François Tigeot [Sat, 5 Jul 2014 19:16:08 +0000 (21:16 +0200)]
drm/i915: Add i915_gem_check_wedge()
From Linux 3.8.13
Sascha Wildner [Sat, 5 Jul 2014 15:58:17 +0000 (17:58 +0200)]
kernel/i386: Fix buildkernel.
François Tigeot [Sat, 5 Jul 2014 15:24:25 +0000 (17:24 +0200)]
drm/i915: Sync intel_ringbuffer.h with Linux 3.8.13
François Tigeot [Sat, 5 Jul 2014 11:40:21 +0000 (13:40 +0200)]
drm/i915: intel_iic.c really is intel_i2c.c
* Rename it.
* With this commit, all drm/i915 files finally have the same names as their
counterparts in the official Linux driver.
François Tigeot [Sat, 5 Jul 2014 11:37:06 +0000 (13:37 +0200)]
drm/i915: i915_debug.c really is i915_debugfs.c
Rename it.
Matthew Dillon [Sat, 5 Jul 2014 05:04:40 +0000 (22:04 -0700)]
build - Add missing symbol for vkernel64 build
* Add symbols required to support access to the GD_OTHER_CPUS field,
which vkernel64's assembly now needs.
Matthew Dillon [Fri, 4 Jul 2014 19:59:15 +0000 (12:59 -0700)]
kernel - Refactor cpumask_t to extend cpus past 64, part 2/2
* Expand SMP_MAXCPU from 64 to 256 (64-bit only)
* Expand cpumask_t from 64 to 256 bits
* Refactor the C macros and the assembly code.
* Add misc cpu_pauses()s and do a bit of work on the boot sequencing.
François Tigeot [Fri, 4 Jul 2014 11:54:05 +0000 (13:54 +0200)]
drm: Use the Linux completion API
François Tigeot [Fri, 4 Jul 2014 09:54:40 +0000 (11:54 +0200)]
drm: Add a linux/completion.h implementation
* The drm/i915 code expect completion to be a struct containing a
counter named 'done' and a wait queue named 'wait'
* It also expects this wait queue to be a struct containing a spinlock
named 'lock'. Adjust the implementation in linux/wait.h accordingly.
Nuno Antunes [Fri, 4 Jul 2014 08:03:36 +0000 (09:03 +0100)]
kernel: Unbreak vkernel64 build.
Nuno Antunes [Fri, 4 Jul 2014 05:59:13 +0000 (06:59 +0100)]
libradius(3): Sync with FreeBSD head.
Here is a summary of the changes.
* Added rad_request_authenticator() which returns the Request-Authenticator
relevant to the most recently received RADIUS response.
* Added rad_server_secret() which returns the Shared Secret relevant to the
most recently received RADIUS response.
* Added rad_demangle() for demangling user-passwords (needed for MS-CHAPv1
MPPE-keys).
* Added rad_demangle_mppe_key() for demangling mppe-keys (needed for
MPPE-keys).
* Added some typecasts for avoiding compiler warnings.
* Fix: better handle wrong usage of the lib (if the programmer has not called
rad_create_request() but rad_put_*(), then a weird error message was
returned).
* Added a new function for putting the Message-Authenticator.
* Verify the Message-Authenticator, if it was found inside a response packet
and silently drop the packet, if the validation failed.
* Implicitly put the Message-Authenticator, if the EAP-Message attribute was
added.
* Added some missing defines.
* Add simple embedded RADIUS server support to libradius, by extending existing
API, keeping backward compatibility.
* Add binding support.
* Alphabetically sort MLINKS in the Makefile.
* Various other bugfixes.
Taken-from: FreeBSD (with small adjustments)
Sascha Wildner [Fri, 4 Jul 2014 05:13:00 +0000 (07:13 +0200)]
kernel/netgraph7: Build fix.
Matthew Dillon [Fri, 4 Jul 2014 03:07:27 +0000 (20:07 -0700)]
kernel - Refactor cpumask_t to extend cpus past 64, part 1/2
* 64-bit systems only. 32-bit builds use the macros but cannot be expanded
past 32 cpus.
* Change cpumask_t from __uint64_t to a structure. This commit implements
one 64-bit sub-element (the next one will implement four for 256 cpus).
* Create a CPUMASK_*() macro API for non-atomic and atomic cpumask
manipulation. These macros generally take lvalues as arguments, allowing
for a fairly optimal implementation.
* Change all C code operating on cpumask's to use the newly created CPUMASK_*()
macro API.
* Compile-test 32 and 64-bit. Run-test 64-bit.
* Adjust sbin/usched, usr.sbin/powerd. usched currently needs more work.
Sascha Wildner [Thu, 3 Jul 2014 18:32:47 +0000 (20:32 +0200)]
<sys/sysctl.h>: Put the access argument in parentheses.
Sascha Wildner [Thu, 3 Jul 2014 18:28:49 +0000 (20:28 +0200)]
<sys/sysctl.h>: Indentation fixes (nothing functional).
Sascha Wildner [Thu, 3 Jul 2014 18:24:53 +0000 (20:24 +0200)]
<sys/sysctl.h>: Remove CTLFLAGs which we don't handle.
To not give the wrong impression that we do (just because code compiles).
The removal of CTLFLAG_CAP{RD,WR} was discussed with joris.
While here, remove SYSCTL_ASSERT_TYPE which was doing nothing for us.
Joris Giovannangeli [Thu, 3 Jul 2014 18:18:35 +0000 (20:18 +0200)]
drm/ttm: remove linux_compat.c from conf/files too
Matthew Dillon [Thu, 3 Jul 2014 18:04:07 +0000 (11:04 -0700)]
drm/ttm - stabilizing pass, misc bug fixes
* hold the vblank_time_lock around mod_timer() calls in drm_vblank_put()
(in drm_irq.c). This should help protect against reentrancy races on
vblank_time_lock() which can result in a corrupted callout structure.
(possibly fixes crash).
* Add TTM_BO_PRIV_FLAG_ACTIVE to flag the implied reference on the
ttm_buffer_object (bo) structure instead of assuming that the implied
reference is always present in ttm_bo_release().
Only do final cleanup operations with the implied ref. This saves us
from ref/deref races which could result in multiple 1->0, 0->1 transitions
(might not be possible any more with the covering lock around
ttm_bo_release(), but do it anyway for safety).
(fixes crash).
* Unconditionally clear *bo in radeon_bo_unref().
* Unconditionally zero memory when allocating the bo in radeon_sa_bo_new()
to ensure that unused fields are zerod.
* For now, always use cpu 0 for the task queue. This fixes races/corruption
related to mycpuid changing and causing the wrong taskqueue_thread[] to
be specified vs prior calls. (fixes crash).
* Make sure *p_bo is NULL in ttm_bo_create() in the failure path.
* NULL out glob->dummy_read_page after freeing the page.
* Zero the temporary ttm_buffer_object in ttm_buffer_object_transfer()
to ensure that the last release does not double-free non-retained fields
(fixes double frees and related crashes).
* Make sure that *obj_res is NULL in ttm_bo_mmap_single() in the failure path.
* Fix spin-lock reversal in ttm_shrink() (fixes crash).
* Fix TTM memory initialization limits. Use the vm.dma_reserved count to
determine how much DMAable memory TTM can play with instead of assuming
4GB.
* Remove double-lock in ttm_release_base() (fixes deadlock).
* Protect the 1->0 transition on the ttm_base_object structure with its
lock to avoid races (fixes crash).
* Properly dispose of contig-allocated pages using vm_page_free_contig().
ttm_vm_page_free() was previously improperly using vm_page_free() which
has the effect of removing the page from the contig pool (fixes OOM).
* vm_page_grab() with VM_ALLOC_RETRY requires that VM_ALLOC_NORMAL also
be specified (fixes crash).
Joris Giovannangeli [Thu, 3 Jul 2014 17:58:20 +0000 (19:58 +0200)]
drm/ttm: convert rb_tree back to tree(3) and fix a few races
* remove the linux compat rbtree for now and use tree(3)
* change a few locks not converted from freebsd porting
* check that the refcount is still 0 before destroying the object after
acquiring the lock, because we might have raced another ref.