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.
Sascha Wildner [Wed, 2 Jul 2014 08:10:37 +0000 (10:10 +0200)]
kernel: Fix some -Wundef warnings.
Matthew Dillon [Tue, 1 Jul 2014 23:28:47 +0000 (16:28 -0700)]
kernel - Fix PF tables (SMP work)
* SMP work broke pf_table.c to some degree due to the use of globals
to store temporary data. The concurrency could cause table lookups
to return an incorrect match or mismatch.
* Change pfr_sin, pfr_sin6, and pfr_mask to local variables.
Franco Fichtner [Sun, 29 Jun 2014 19:36:01 +0000 (21:36 +0200)]
kernel: remove layer of indirection for ether_input()
Mop up after the recent changes by pulling the old switcheroo
on ether_input_pkt(), effectively renaming the function to
ether_input(). Also updates comments accordingly.
Matthew Dillon [Tue, 1 Jul 2014 17:23:36 +0000 (10:23 -0700)]
kernel - add vm_contig_avail_pages() API
* Add a function which DRM can query to determine how much more-easily-DMAd
memory is available from our contiguous memmory pool, instead of assuming
that it can gobble all 4GB of 'low' memory before it tries to swap.
* This memory is typically set in /boot/loader.conf, like this:
vm.dma_reserved=256m
The default is ~16MB at the moment so users will generally want to increase
it.
Matthew Dillon [Tue, 1 Jul 2014 15:52:16 +0000 (08:52 -0700)]
dmesg - Add -ff feature
* Add a feature whereby if -f is specified twice (-ff), dmesg will
not sleep() in its monitoring loop and will instead live loop.
This feature is intended only to help debug crashing kernel situations
and should not be used for normal dmesg monitoring.
Matthew Dillon [Tue, 1 Jul 2014 15:39:29 +0000 (08:39 -0700)]
kernel - Fix several taskqueue livelocks
* Taskqueue was trying to issue callout_*() operations with a spin-lock
held on callouts associated with other cpus. This can livelock the
system.
* Unlock the taskqueue spinlock when messing with callout_*() operations.
* Fixes an indefinite spin lock panic from drm/ttm.
Franco Fichtner [Sun, 29 Jun 2014 18:34:13 +0000 (20:34 +0200)]
kernel: switch newer drivers back to if_input()
Restore the if_input() invoke. This is needed to reenable
tapping into if_input through drivers like netmap(4).
Reviewed by: sephe
Franco Fichtner [Sun, 29 Jun 2014 17:05:32 +0000 (19:05 +0200)]
kernel: make pktinfo and cpuid native to ip_input()
In order to remove ether_input_pkt(), switch the prototype
of if_input() and adjust all callers. While there, consolidate
the style of the invoke.
Suggested and reviewed by: sephe
Sascha Wildner [Tue, 1 Jul 2014 14:23:56 +0000 (16:23 +0200)]
kernel/acpi: Use device_printf() in a few places.
Sepherosa Ziehau [Tue, 1 Jul 2014 12:49:26 +0000 (20:49 +0800)]
inet: Make ip fragments reassemble queue per-cpu and lockless MPSAFE
Matthew Dillon [Tue, 1 Jul 2014 08:06:20 +0000 (01:06 -0700)]
kernel - Fix bug in cdev_pager_allocate() that was messing up gem/ttm
* cdev_pager_allocate() was assuming that the passed vm_object handle
was a cdev_t and populating a field in it, but that is not always the case.
Fix the case.
* This solves RBTREE corruption in drm/ttm.
Reported-by: Joris Giovannangeli
Nicolas Thery [Mon, 30 Jun 2014 18:57:35 +0000 (20:57 +0200)]
add posix semaphore test suite
Port FreeBSD test suite, remove tests specific to FreeBSD
implementation, and modify tests that do not comply with the standard.
A next step could be to integrate this test in dfregress(8).
Obtained-from: FreeBSD
Reviewed-by: joris@giovannangeli.fr
Nicolas Thery [Mon, 30 Jun 2014 18:57:27 +0000 (20:57 +0200)]
libc - bail out on invalid sem_open(3) flags
Preventing now callers from passing invalid flags prevents compatibility
issue should new flags be added to sem_open(3) in future standard
revisions.
Reviewed-by: joris@giovannangeli.fr
Nicolas Thery [Mon, 30 Jun 2014 18:57:03 +0000 (20:57 +0200)]
libc - change SEM_VALUE_MAX
sem_getvalue(3) requires a signed int count so change SEM_VALUE_MAX to INT_MAX.
Reviewed-by: joris@giovannangeli.fr
Sascha Wildner [Tue, 1 Jul 2014 04:01:10 +0000 (06:01 +0200)]
kernel/acpi: Stop installing default address space handlers explicitly.
Since ACPICA
20040427 this is no longer necessary since it is part of
AcpiEnableSubsystem(). It is not supported and has led to problems.
See http://svnweb.freebsd.org/base?view=revision&revision=212993
Sascha Wildner [Tue, 1 Jul 2014 03:09:17 +0000 (05:09 +0200)]
kernel/acpica: Add tunables for editing the _OSI string list.
ACPICA has a built-in list of supported _OSI strings. A query on any of
those strings returns TRUE. It is meant to help the ASL code determine
which OS it is dealing with. See AcpiDefaultSupportedInterfaces[] in
utosi.c for the full list.
This commit adds two tunables, hw.acpi.{install,remove}_interface,
for adding to and removing from that list. Their contents are comma
separated and leading white space is ignored.
Examples:
# Add "FreeBSD" to the list of supported _OSI strings,
# i.e. _OSI("FreeBSD") from ASL will return TRUE.
#
hw.acpi.install_interface="FreeBSD"
# Remove "Windows 2000" and "Windows 2001" from the list
# of supported _OSI strings, i.e. _OSI("Windows 2000") and
# _OSI("Windows 2001") from ASL will return FALSE.
#
hw.acpi.remove_interface="Windows 2000, Windows 2001"
Taken-from: FreeBSD
Matthew Dillon [Mon, 30 Jun 2014 19:27:59 +0000 (12:27 -0700)]
kernel - Move CPUMASK_LOCK out of the cpumask_t
* Add cpulock_t (a 32-bit integer on all platforms) and implement
CPULOCK_EXCL as well as space for a counter.
* Break-out CPUMASK_LOCK, add a new field to the pmap (pm_active_lock)
and do the process vmm (p_vmm_cpulock) and implement the mmu interlock
there.
The VMM subsystem uses additional bits in cpulock_t as a mask counter
for implementing its interlock.
The PMAP subsystem just uses the CPULOCK_EXCL bit in pm_active_lock for
its own interlock.
* Max cpus on 64-bit systems is now 64 instead of 63.
* cpumask_t is now just a pure cpu mask and no longer requires all-or-none
atomic ops, just normal bit-for-bit atomic ops. This will allow us to
hopefully extend it past the 64-cpu limit soon.
Matthew Dillon [Mon, 30 Jun 2014 19:20:41 +0000 (12:20 -0700)]
build - Add additional CFLAGS
* Add additional CFLAGS that are expected to be needed in later revs
of the compiler. These are not needed at the moment.
Markus Pfeiffer [Mon, 30 Jun 2014 16:29:15 +0000 (17:29 +0100)]
Set CR4.OSFXSR before probing the mxcsr mask
This fixes Bug #2691
Reported-By: Antonio Huete Jiménez <tuxillo@quantumachine.net>
Matthew Dillon [Sun, 29 Jun 2014 18:08:05 +0000 (11:08 -0700)]
kernel - Fix nfs server-side shutdown race
* Fix issues where slp->ns_so is being accessed during or after the socket
has been zapped. The zap code actually closes the fp and destroys the
socket so this race results in a use-after-free and can cause a panic
on the NFS server.
* Zapping now shuts the socket down but does not close/destroy it. The
socket will be destroyed when the last ref on slp (aka nfssvc_sock)
is dropped.
* Re-check SLP_VALID in a few more places after potentially blocking.
Other situations that might block are handled by the change in the
zap code.
Sascha Wildner [Sun, 29 Jun 2014 14:57:33 +0000 (16:57 +0200)]
Fix buildworld.
Due to adding a struct lock to struct pf_state in one of the recent
pf(4) commits, we have to define _KERNEL_STRUCTURES in everything
which includes pfvar.h.
Sepherosa Ziehau [Sun, 29 Jun 2014 12:33:38 +0000 (20:33 +0800)]
inpcb: Rework insertion of local group
Mainly to take possible malloc(9) blocking into consideration. This
prepares tokenizing inpcb lists and tables for udp.
Matthew Dillon [Sun, 29 Jun 2014 06:46:43 +0000 (23:46 -0700)]
kernel - Fix pf-based NAT
* NAT may not always be able to select a translated addr/port that is
compatible with the source addr/port. In this situation return packets
from the translated target won't be able to find the state structure.
This occurs if static-port is used or if the port range is insufficent
for PF to be able to find a hash-compatible addr/port.
This also occurs for UDP because the toeplitz hash does not appear to
include a port (so there's nothing PF NAT can do to make it
hash-compatible).
* In situations where PF believes a translation is not hash-compatible,
the pf_state_key will be placed on a global RBTREE instead of the
cpu-localized RBTREE. This tree is checked and modified with a separate
lock (shared when doing lookups, exclusive when doing adjustments).
The nominal pf_find_state*() code will now check the global RBTREE if the
state cannot be found in the localized tree.
* Modifications to the pf_state structure are now exclusively locked to
handle the case where a state structure might be used by multiple cpu's
at the same time. This can only occur for translations such as NAT.
* The TCP code is not allowed to destroy state on connection reuse unless
the state is cpu-local. If it is not cpu-local the TCP code will mark
the state for an immediate purge (within the next second).
* Add a TSO flag check to pf_route(), which is called via NAT. Locally
originated packets may have been built with TSO. For PF NAT, we can
only assume that the target interface will be compatible and allow the
packet through (not try to fragment it, which won't work well anyway for
TCP packets).
Sascha Wildner [Sat, 28 Jun 2014 20:10:48 +0000 (22:10 +0200)]
kernel/pf: Check size of long at compile time (fixes i386 build).
Matthew Dillon [Sat, 28 Jun 2014 16:38:38 +0000 (09:38 -0700)]
kernel - add toeplitz_piecemeal_addr/port()
* Add two more inlines to help PF calculate matching cpus for NAT port
scans.
Sascha Wildner [Sat, 28 Jun 2014 15:51:11 +0000 (17:51 +0200)]
Chmod 644 a few scripts in the tree.
As usual, 'make install' will take care about setting the wanted mode.
Sascha Wildner [Sat, 28 Jun 2014 13:31:31 +0000 (15:31 +0200)]
kernel/acpi: Solve ACPI_DEBUG_{CACHE,LOCKS,MEMMAP} building better.
ACPICA
20140627 added a mechanism for having a platform dependent
header that is included _after_ ACPICA headers are included.
So we can now solve compilation with ACPI_DEBUG_{CACHE,LOCKS,MEMMAP}
by adding a new acdragonflyex.h header for the prototypes of the
debug flavors of AcpiOsReleaseObject(), AcpiOsAcquireLock(),
AcpiOsMapMemory() and AcpiOsUnmapMemory() instead of having to put
them into the vendor code (like I did in
3b92a84dc0def, which this
commit reverts).
Sascha Wildner [Sat, 28 Jun 2014 13:24:00 +0000 (15:24 +0200)]
kernel/acpi: Fix a kprintf for ACPI_DEBUG_MEMMAP.
Imre Vadasz [Fri, 27 Jun 2014 19:29:04 +0000 (21:29 +0200)]
vga_pci: Improve vga boot display detection.
* Check the "VGA Enable" bit on the parent bridge only if it is a
PCI-to-PCI bridge.
* Always check the "I/O" and "Memory address space decoding" bits on the
video card itself.
* Furthermore, vga_pci_attach() logs "Boot video device" if the card
being attached is the Chosen One:
vgapci0: <VGA-compatible display> [...]
vgapci0: Boot video device
This is FreeBSD's r259579.
Tested-by: François Tigeot <ftigeot@wolfpond.org>
Sascha Wildner [Sat, 28 Jun 2014 12:00:58 +0000 (14:00 +0200)]
unlock_return.cocci: Add a check for ACPI_SERIAL_{BEGIN,END}.
Sascha Wildner [Sat, 28 Jun 2014 11:58:48 +0000 (13:58 +0200)]
kernel/acpi_thinkpad: Unlock properly before returning.
Sascha Wildner [Sat, 28 Jun 2014 11:43:04 +0000 (13:43 +0200)]
acpi: Sync aapits Makefile with
20140627 ACPICA test suite.
Sascha Wildner [Sat, 28 Jun 2014 11:14:15 +0000 (13:14 +0200)]
kernel: Sync ACPICA with Intel's version
20140627.
* Various bug fixes and enhancements (see changes.txt).
* Use new local printf() like functions for the utilities.
* Use new AcpiLogError for portability.
This that are also changed/new but it don't affect DragonFly so far:
* Support for ACPICA generation within the EFI environment.
* New OSL file I/O interface.
* New global AcpiGbl_VerifyTableChecksum.
For a more detailed list, please see sys/contrib/dev/acpica/changes.txt.
Matthew Dillon [Sat, 28 Jun 2014 03:06:02 +0000 (20:06 -0700)]
kernel - merge fixes from FreeBSD
* Merge
8159278dbd8e019, fixes to pf_get_sport(). Primarily fixes the state
key used to check whether a port is in-use or not. NAT could previously
choose a port that was already in-use.
* bzero() the state key to ensure that uninitialized fields are zero,
otherwise the RB_FIND is likely to fail.
* Cleanup the case where there is no port range or the protocol is not
supported. In this situation, sport must be replicated on the host.
Matthew Dillon [Sat, 28 Jun 2014 02:05:33 +0000 (19:05 -0700)]
pfctl - Change default keep-policy to bring more in-line with other BSDs
* Change the default keep-policy to the equivalent of:
set keep-policy keep state (pickups, sloppy)
* This is being done because without keep state PF is simply going to be
too inefficient for any reasonable set of rules, and we no longer want
to make users set the keep-policy line when keep state is already the
default in other BSD systems.
* Note that we also set pickups and sloppy by default. This allows the
router and/or PF to be restarted and allows packet routing to change
mid-stream without causing all active TCP connections to drop. This
may not be the default in other BSD systems but it should be. Being
ultra strict here to improve security against ICMP-based attacks removes
too much flexibility to be appropriate. Proper TCP implementations
already do sequence space checks for RST packets.
Matthew Dillon [Sat, 28 Jun 2014 01:02:26 +0000 (18:02 -0700)]
kernel - Fix pf-based NAT
* Concurrency work on PF broke NAT. Fix NAT for IPV4 TCP.
* This is not a complete fix, the NAT must be able to select from a range
of local ports to replace sport to properly map the NAT onto the same
cpu that the originating packet was forwarded to.
* Not fixed for UDP yet.
Matthew Dillon [Fri, 27 Jun 2014 17:24:24 +0000 (10:24 -0700)]
kernel - Force manual hash calculation for IP fragments
* Hardware toeplitz hashes do not always distinguish IP fragments from
full IP packets. An IP fragment will typically have the
(src,dst,srcport,dstport) in the first fragment, but will only have
(src,dst) in the remaining fragments. The HW might not understand this
and generate hashes which prevent the fragments from being directed to
the same cpu.
* Force a manual recalculation of the hash (ignore the HW hash) for any
IP fragment. That is, any IP packet with the IP_MF bit set or with a
non-zero offset (masked by IP_OFFMASK).
* Direct all IP fragments to a target cpu based on the hash. We previously
directed all IP fragments to cpu 0.
* NOTE: The IP fragment handling code in the kernel is still serialized with
a lock. This will be addressed in a later commit. However, fragments
which are piped into PF will now be properly distributed across
available cpus.
Submitted-by: sephe
François Tigeot [Fri, 27 Jun 2014 06:57:55 +0000 (08:57 +0200)]
drm/i915: Reorder function definitions in i915_gem.c
* Reducing differences with Linux 3.8.13
* No functional changes
Matthew Dillon [Fri, 27 Jun 2014 04:04:09 +0000 (21:04 -0700)]
buildworld - Add sync/sleep safety before mkinitrd
* Try to mitigate a bug in earlier versions of DragonFly that can be
triggered by mkinitrd's use of the VN device by ensuring that the world
is synced to disk before running mkinitrd.
Matthew Dillon [Fri, 27 Jun 2014 03:40:32 +0000 (20:40 -0700)]
pf - make the bulk of PF concurrent under normal operation
* state and ip fragment tables are now per-cpu.
* packet paths acquire pf_token shared instead of exclusive. Packet
processing runs concurrently.
* Any dynamic rules updates will run synchronously for now.
* State expiration from the pfpurge thread runs synchronously for now.
More work can be done here.
* ioctl (and also pfsync) paths acquire pf_token exclusively. That is,
primarily pfctl commands. This includes rules updates and state scans.
More work can be done here.
Matthew Dillon [Fri, 27 Jun 2014 02:19:30 +0000 (19:19 -0700)]
pfctl - Fix pf_print_state
* Fix a bug where the 'minutes' field in the expiration was not being
calculated properly.
* Reformat the verbose output so it does not overflow 80 columns, and
move the rule # printing up a little so it is not confusedly associated
with the next entry.
Sascha Wildner [Thu, 26 Jun 2014 20:21:56 +0000 (22:21 +0200)]
newsyslog(8): Remove a NULL-check-after-use and instead assert != NULL.
Taken-from: FreeBSD
Sascha Wildner [Thu, 26 Jun 2014 17:55:29 +0000 (19:55 +0200)]
route(8): Fix a sizeof bug.
Sascha Wildner [Thu, 26 Jun 2014 17:24:43 +0000 (19:24 +0200)]
Always check the limits of array index variables before using them.
Franco Fichtner [Thu, 26 Jun 2014 17:10:27 +0000 (19:10 +0200)]
netmap: port if_transmit() to ifq_dispatch()
Suggested by: sephe
Sepherosa Ziehau [Thu, 26 Jun 2014 12:13:41 +0000 (20:13 +0800)]
inet: Handle IP fragments in netisr0
For packet whose hash is provided by hardware, the processing netisr
may not be netisr0. Add a IP fragments check at the beginning of
ip_input(): if the current processing netisr is not netisr0 and the
packet is an IP fragment, then redispatch it to netisr0.
Discussed-with: dillon@
Justin C. Sherrill [Thu, 26 Jun 2014 03:47:00 +0000 (23:47 -0400)]
Note need for most recent 3.6 possible before updating.
Sascha Wildner [Wed, 25 Jun 2014 19:29:09 +0000 (21:29 +0200)]
perror.1: Document which locale related env variables affect perror(1).
Sascha Wildner [Wed, 25 Jun 2014 13:07:49 +0000 (15:07 +0200)]
kernel/pci: Fix wrong checks for U4B presence.
I messed this up when switching us to the new USB stack.
Thanks to Markus Pfeiffer for tracking down my mistake.
Reported-by: peeter
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2686>
Sascha Wildner [Wed, 25 Jun 2014 11:59:34 +0000 (13:59 +0200)]
kernel/mrsas: Fix memset() size.
Sepherosa Ziehau [Sun, 22 Jun 2014 12:00:41 +0000 (20:00 +0800)]
inpcb: Reorganize localgroup manages functions.
This is in preparation for conditionally tokenize inpcb lists/tables.
Matthew Dillon [Tue, 24 Jun 2014 22:33:56 +0000 (15:33 -0700)]
boot - Return proper sense from probe_keyboard()
* The sense was reversed. Return the proper sense.
Taken-From: FreeBSD
Matthew Dillon [Tue, 24 Jun 2014 22:32:09 +0000 (15:32 -0700)]
boot - consistently reload v86.ctl/v86.addr (non-bug)
* This is not a bug. Be more consistent when loading the v86 structure,
do not try to optimize out fields that are already loaded in distinct
code sections.
Matthew Dillon [Tue, 24 Jun 2014 22:29:47 +0000 (15:29 -0700)]
boot - Timeout seta20 for normal boots as well as for cd boots.
* Bring code from cdboot into boot1.S
* Also use a more correct segment:offset when trying to reboot.
Reported-by: karu.pruun (karu.pruun@gmail.com),
Roman Neuhauser (neuhauser@sigpipe.cz)
Matthew Dillon [Tue, 24 Jun 2014 22:10:31 +0000 (15:10 -0700)]
boot - Fix BIOS lockup due to H2 probe on small medias
* Some BIOSes (found w/Intel atom D525 w/Foxconn mobo, AMIBIOS) will
implode when asked to read a disk address beyond the EOM. The HAMMER2
probe tries to read a volume header at the 0, 2G, 4G, and 6G marks.
This appears to blow up the BIOS when booting from USB media.
* To work around the problem, for now we do not proceed to test all four
volume header offsets if the first one (at offset 0) does not have a
HAMMER2 signature.
* Thanks to tm512 (Kyle Davis) for spending ~4+ hours helping us find
the problem.
Reported-by: tm512 (Kyle Davis)
Johannes Hofmann [Mon, 23 Jun 2014 20:53:02 +0000 (22:53 +0200)]
drm/i915: fix notify_ring()
Franco Fichtner [Sat, 21 Jun 2014 14:16:50 +0000 (16:16 +0200)]
author style fixes in manual pages
François Tigeot [Sat, 21 Jun 2014 09:00:30 +0000 (11:00 +0200)]
drm/i915: Sync intel_pm.c with Linux 3.8.13
* Add a workaround for a hardware issue making the GPU get stuck at
some particular frequency
* Add initialization code to enable Haswell power wells
* Little fixes and adjustements for various GPUs up to Haswell
Sascha Wildner [Fri, 20 Jun 2014 09:30:57 +0000 (11:30 +0200)]
kernel/vinum: Use %jx in a number of places instead of %llx.
Sascha Wildner [Fri, 20 Jun 2014 06:12:19 +0000 (08:12 +0200)]
kernel: Correct function names in comments.
Franco Fichtner [Thu, 19 Jun 2014 12:28:14 +0000 (14:28 +0200)]
file: libmagic knows about libz now so drop the dependency
Franco Fichtner [Thu, 19 Jun 2014 12:10:26 +0000 (14:10 +0200)]
libmagic: fix file identification
Removes local modifications from contrib code and
fixes at least the following identification issue.
Before:
# file /usr/src/bin/test/test.c
/usr/src/bin/test/test.c: ASCII text
After:
# file /usr/src/bin/test/test.c
/usr/src/bin/test/test.c: C source, ASCII text
Sascha Wildner [Thu, 19 Jun 2014 09:28:23 +0000 (11:28 +0200)]
jscan(8): Remove dupdata() (no longer used since
36d6bdee113b682f2).
Matthew Dillon [Wed, 18 Jun 2014 18:47:45 +0000 (11:47 -0700)]
kernel - Fix rare ucred race
* In a threaded program if one thread is modifying the ucred, e.g.
changing the uid or gid or something like that, and another thread
enters a system call at the same time, the second thread can wind
up trying to hold a stale ucred kfree()'d by the first thread.
* Very rare race on top of a ~2-instruction window.
* Fix the problem by obtaining proc->p_spin when updating the per-thread
ucred cache (td->td_ucred) from p->p_ucred, as well as when replacing
p_ucred.
These fixes do NOT impose any critical-path overhead. For the case where
a thread already has the current p_ucred cached on entry to a system call,
absolutely nothing needs to be done.
Reported-by: joris (Joris Giovannangeli)
Sepherosa Ziehau [Wed, 18 Jun 2014 14:19:53 +0000 (22:19 +0800)]
socket: so_pru_abort_oncpu -> so_pru_abort_direct
No functional change. It is consistent w/ other so_pru functions name.
Sepherosa Ziehau [Wed, 18 Jun 2014 14:12:50 +0000 (22:12 +0800)]
socket: {soabort,so_pru_abort}a -> {soabort,so_pru_abort}_async
No functional change. They are consistent w/ other so and so_pru
function names.
Sepherosa Ziehau [Wed, 18 Jun 2014 13:46:51 +0000 (21:46 +0800)]
uipc: Fix comment
Sepherosa Ziehau [Wed, 18 Jun 2014 13:32:00 +0000 (21:32 +0800)]
uipc: Nuke unnecessary void cast
Sepherosa Ziehau [Wed, 18 Jun 2014 13:20:25 +0000 (21:20 +0800)]
tcp: White space cleanup; no functional changes.
Sepherosa Ziehau [Wed, 18 Jun 2014 13:19:41 +0000 (21:19 +0800)]
ip/demux: Remove no longer applied comment
Sepherosa Ziehau [Wed, 18 Jun 2014 13:18:45 +0000 (21:18 +0800)]
udp: Fix "unconnect" and cleanup connect
Put udp inpcb into wildcard hash in pru_disconnect method. This restores
the old behaviour of traditional BSD "unconnect".
Clean up pru_connect after fixing the "unconnect" support; in preparation
for distributing udp inpcb across netisrs.
Sepherosa Ziehau [Wed, 18 Jun 2014 13:18:02 +0000 (21:18 +0800)]
systat/ip,tcp: Initialize curstate to avoid overflow/underflow
Sepherosa Ziehau [Wed, 18 Jun 2014 13:16:58 +0000 (21:16 +0800)]
net: Add initport protosw method to init socket's default protocol port
Currently only tcp implements this method to distribute pru_attach and
pru_connect workload.
Nuke no longer necessary protosw flag PR_RAND_INITPORT and sysctl
kern.ipc.rand_initport.
Sepherosa Ziehau [Wed, 18 Jun 2014 13:15:52 +0000 (21:15 +0800)]
tcp: Avoid unnecessary calling of in_pcbladdr() in tcp_connect()
If in_pcbladdr() was called and inp_laddr was saved, there would be
no need to call in_pcbladdr() again, after the inp was forwarded to
its owner netisr.
Franco Fichtner [Mon, 16 Jun 2014 13:16:08 +0000 (15:16 +0200)]
libmagic: link against libz
Linking a program against the library without explicitly
stating `-lz' produced this output:
/usr/lib/libmagic.so: undefined reference to `inflate'
/usr/lib/libmagic.so: undefined reference to `inflateInit2_'
/usr/lib/libmagic.so: undefined reference to `inflateEnd'
Sepherosa Ziehau [Mon, 16 Jun 2014 13:08:46 +0000 (21:08 +0800)]
inpcb: Remove inp_cpcbinfo, which serves no purpose now
It is always same as inp_pcbinfo.
Sepherosa Ziehau [Mon, 16 Jun 2014 13:08:02 +0000 (21:08 +0800)]
inpcb: Cache align inpcbinfo
Sepherosa Ziehau [Mon, 16 Jun 2014 13:07:01 +0000 (21:07 +0800)]
inet: in_pcbsetlport_remote -> in_pcbbind_remote
This function may change inp_laddr, so 'bind' is is better than
'setlport'.
Sepherosa Ziehau [Mon, 16 Jun 2014 13:06:16 +0000 (21:06 +0800)]
net: Remove unnecessary sosetport() in various pru_attachs
The so_port is set before the pru_attach is called; there is no need
to do it again.
Sepherosa Ziehau [Mon, 16 Jun 2014 13:05:38 +0000 (21:05 +0800)]
udp: No data will be carried along w/ connect
Pull the assertion into earlier place.
Sascha Wildner [Sun, 15 Jun 2014 18:13:17 +0000 (20:13 +0200)]
ctags(1): Fix use after free().
Sascha Wildner [Sun, 15 Jun 2014 18:02:00 +0000 (20:02 +0200)]
netstat(8): Remove upHex(), which is unused since we dropped NS.
Sascha Wildner [Sun, 15 Jun 2014 11:46:20 +0000 (13:46 +0200)]
Update the pciconf(8) database.
June 14, 2014 snapshot from http://pciids.sourceforge.net/
Sascha Wildner [Sun, 15 Jun 2014 01:10:42 +0000 (03:10 +0200)]
Remove some unneeded continue statements.
Sascha Wildner [Sat, 14 Jun 2014 21:35:53 +0000 (23:35 +0200)]
Sync zoneinfo database with tzdata2014e from ftp://ftp.iana.org/tz/releases
* africa: Egypt's 2014 Ramadan-based transitions are June 26 and July 31
at 24:00. (Thanks to Imed Chihi.) Similarly, Morocco's are June 28
at 03:00 and August 2 at 02:00. (Thanks to Milamber Space Network.)
* europe: The abbreviation "MSM" (Moscow Midsummer Time) is now used
instead of "MSD" for Moscow's double daylight time in summer 1921.
Also, a typo "VLASST" has been repaired to be "VLAST" for
Vladivostok summer time in 1991. (Thanks to Hank W. for reporting
the problems.)
* Some minor adjustments/rearrangement.