dragonfly.git
8 years agocomm(1): Sync with FreeBSD.
Sascha Wildner [Sun, 3 Jan 2016 19:07:30 +0000 (20:07 +0100)]
comm(1): Sync with FreeBSD.

* multibyte char support

* fix truncation of lines at LINE_MAX

* use getline()

* make functions static

8 years agousr.bin/uniq: Sync with FreeBSD
zrj [Wed, 11 Nov 2015 07:26:27 +0000 (09:26 +0200)]
usr.bin/uniq: Sync with FreeBSD

Few improvements, mainly wchar_t support.

Obtained-from: FreeBSD

8 years agore: Disable ASPM
Sepherosa Ziehau [Sun, 3 Jan 2016 12:12:34 +0000 (20:12 +0800)]
re: Disable ASPM

Referenced: FreeBSD

8 years agore: Update Realtek PHY power management related bits
Sepherosa Ziehau [Sun, 3 Jan 2016 06:21:08 +0000 (14:21 +0800)]
re: Update Realtek PHY power management related bits

Obtained-from: FreeBSD

8 years agokqueue: Move notifymsglist out of kqinfo
Sepherosa Ziehau [Sun, 3 Jan 2016 02:21:43 +0000 (10:21 +0800)]
kqueue: Move notifymsglist out of kqinfo

It is only used by socket code.

8 years ago<strings.h>: Fix VKERNEL64 build.
Sascha Wildner [Sat, 2 Jan 2016 14:09:00 +0000 (15:09 +0100)]
<strings.h>: Fix VKERNEL64 build.

8 years agokernel/tmpfs: Implement _PC_FILESIZEBITS.
Sascha Wildner [Sat, 2 Jan 2016 12:53:10 +0000 (13:53 +0100)]
kernel/tmpfs: Implement _PC_FILESIZEBITS.

8 years agokernel: Add flsll(). Identical to flsl().
Sascha Wildner [Sat, 2 Jan 2016 12:50:03 +0000 (13:50 +0100)]
kernel: Add flsll(). Identical to flsl().

Add FreeBSD's libkern version too, but on x86_64 this is not compiled,
because we use inline assembly.

8 years agokernel/tmpfs: Sort pathconf cases.
Sascha Wildner [Sat, 2 Jan 2016 11:23:27 +0000 (12:23 +0100)]
kernel/tmpfs: Sort pathconf cases.

8 years agoif_iwm: Make the wifi LED work with iwm(4) (2/2)
François Tigeot [Sat, 2 Jan 2016 08:16:25 +0000 (09:16 +0100)]
if_iwm: Make the wifi LED work with iwm(4) (2/2)

Add forgotten if_iwm_led.c to sys/conf/files

8 years agoif_iwm: Make the wifi LED work with iwm(4).
Imre Vadász [Fri, 1 Jan 2016 21:41:23 +0000 (22:41 +0100)]
if_iwm: Make the wifi LED work with iwm(4).

- While the wifi device is scanning or trying to associate, the LED
  should blink now.
- When associated to a wifi network, the LED will stop blinking and stay
  enabled.

Taken-From: OpenBSD

8 years agoif_iwm: Remove comments referring to Linux iwlwifi source filenames.
Imre Vadász [Fri, 1 Jan 2016 21:26:02 +0000 (22:26 +0100)]
if_iwm: Remove comments referring to Linux iwlwifi source filenames.

Taken-From: OpenBSD

8 years agodump.8: Remove overlooked .Pp
Sascha Wildner [Fri, 1 Jan 2016 12:45:32 +0000 (13:45 +0100)]
dump.8: Remove overlooked .Pp

8 years agoSplit EXIT STATUS and DIAGNOSTICS sections in manual pages.
Sascha Wildner [Fri, 1 Jan 2016 00:07:02 +0000 (01:07 +0100)]
Split EXIT STATUS and DIAGNOSTICS sections in manual pages.

Also correct some DIAGNOSTICS -> EXIT STATUS where it described only
the exit codes.

8 years agoif_iwm: Just store the struct firmware pointer, like if_iwn does.
Imre Vadász [Thu, 31 Dec 2015 22:13:12 +0000 (23:13 +0100)]
if_iwm: Just store the struct firmware pointer, like if_iwn does.

if_iwm was passing the firmware data pointer to firmware_put(9), instead
of the struct firmware pointer that was returned by firmware_get(9).

8 years agoif_iwm: Apply some changes from OpenBSD, if_iwm.c rev 1.39 -> 1.42
Imre Vadász [Wed, 30 Dec 2015 16:01:11 +0000 (17:01 +0100)]
if_iwm: Apply some changes from OpenBSD, if_iwm.c rev 1.39 -> 1.42

- Use m_defrag(9) instead of rolling our own version of it.

- Limit the number of dma segments used for tx to IWM_MAX_SCATTER - 2.
  This avoids out-of-bound accesses on the segs array in iwm_tx().

- cleanup attach message

Taken-From: OpenBSD

8 years agoBump our copyrights to 2016. Happy new year! :)
Sascha Wildner [Thu, 31 Dec 2015 22:16:00 +0000 (23:16 +0100)]
Bump our copyrights to 2016. Happy new year! :)

8 years agonewfs_hammer.8: Remove two unneeded .Pp macros.
Sascha Wildner [Thu, 31 Dec 2015 20:18:53 +0000 (21:18 +0100)]
newfs_hammer.8: Remove two unneeded .Pp macros.

8 years agobus_dma.9: Fix bus_dmamap_load_mbuf_segment documentation of maxsegs arg.
Imre Vadász [Thu, 31 Dec 2015 17:21:54 +0000 (18:21 +0100)]
bus_dma.9: Fix bus_dmamap_load_mbuf_segment documentation of maxsegs arg.

The maxsegs argument of bus_dmamap_load_mbuf_segment is allowed to be
equal to the nsegments of the dma tag, i.e. doesn't have to be "less than",
but "not larger than" the nsegments.

8 years agosbin/mount_hammer: Fix mount_hammer(8) manpage
Tomohiro Kusumi [Sat, 5 Dec 2015 12:40:23 +0000 (21:40 +0900)]
sbin/mount_hammer: Fix mount_hammer(8) manpage

8 years agosbin/newfs_hammer: Fix newfs_hammer(8) manpage
Tomohiro Kusumi [Sat, 5 Dec 2015 12:40:23 +0000 (21:40 +0900)]
sbin/newfs_hammer: Fix newfs_hammer(8) manpage

8 years agokqueue: Use wakeup_one() to wake up kqueue scanner
Sepherosa Ziehau [Thu, 31 Dec 2015 10:18:04 +0000 (18:18 +0800)]
kqueue: Use wakeup_one() to wake up kqueue scanner

It hard to imagine an application to have multiple threads to
wait on one kqueue.  However, even if this kind of application
existed, wakeup_one() would not break them (admittedly they
might suffer uneven workload distribution).

In case the old behaviour is still wanted, sysctl
kern.kq_wakeup_one can be changed to 0.

This saves us 30Kipis/s ~ 50Kipis/s in kqueue+accept test.

8 years agokqueue: Reduce file/hash list token coverage
Sepherosa Ziehau [Thu, 31 Dec 2015 09:31:39 +0000 (17:31 +0800)]
kqueue: Reduce file/hash list token coverage

They should only cover file/hash list operations.  And reduce kqueue
token coverage on termination path; hash does not need protection
there.

8 years agodrm/i915: Convert hw level to user level when reading backlight value.
Imre Vadász [Tue, 29 Dec 2015 13:21:03 +0000 (14:21 +0100)]
drm/i915: Convert hw level to user level when reading backlight value.

Values written to, and then read back from the hw.backlight_level sysctl
should now match.

8 years agolibc/nls: Sync str{error,signal}() messages with <sys/{errno,signal}.h>.
Sascha Wildner [Tue, 29 Dec 2015 19:27:09 +0000 (20:27 +0100)]
libc/nls: Sync str{error,signal}() messages with <sys/{errno,signal}.h>.

Reported-by: zrj <rimvydas.jasinskas@gmail.com>
8 years agointro.2: Document errnos 89-93.
zrj [Tue, 29 Dec 2015 07:26:49 +0000 (09:26 +0200)]
intro.2: Document errnos 89-93.

8 years agosbin/newfs_hammer: Fix newfs_hammer(8) manpage
Tomohiro Kusumi [Tue, 29 Dec 2015 19:01:19 +0000 (04:01 +0900)]
sbin/newfs_hammer: Fix newfs_hammer(8) manpage

-L is always necessary, but two or more fs with the same -L is allowed.

8 years agosbin/newfs_hammer: Fix newfs_hammer(8) manpage
Tomohiro Kusumi [Tue, 29 Dec 2015 17:39:16 +0000 (02:39 +0900)]
sbin/newfs_hammer: Fix newfs_hammer(8) manpage

newfs_hammer has calculations and upper limit for boot area,
which don't result in default 4MB, but rather likely to be 64MB.
Also this isn't used for anything just like memory log area.

8 years agokqueue: Don't check list against NULL; list is never NULL.
Sepherosa Ziehau [Tue, 29 Dec 2015 11:04:36 +0000 (19:04 +0800)]
kqueue: Don't check list against NULL; list is never NULL.

Instead, do a quick and unlocked SLIST_EMPTY check on the list.

8 years agoSync man page stat.2 with the definitions in sys/stat.h
Michael Neumann [Tue, 29 Dec 2015 10:27:58 +0000 (11:27 +0100)]
Sync man page stat.2 with the definitions in sys/stat.h

8 years agokqueue: Mark user filter MPSAFE
Sepherosa Ziehau [Tue, 29 Dec 2015 10:16:37 +0000 (18:16 +0800)]
kqueue: Mark user filter MPSAFE

8 years agokqueue: Remove unapplied comment
Sepherosa Ziehau [Tue, 29 Dec 2015 10:12:58 +0000 (18:12 +0800)]
kqueue: Remove unapplied comment

8 years agosocket: Use {get,rel}pooltoken in netmsg_so_notify()
Sepherosa Ziehau [Tue, 29 Dec 2015 09:59:04 +0000 (17:59 +0800)]
socket: Use {get,rel}pooltoken in netmsg_so_notify()

8 years agobridge: Mark callouts MPSAFE
Sepherosa Ziehau [Tue, 29 Dec 2015 09:16:51 +0000 (17:16 +0800)]
bridge: Mark callouts MPSAFE

8 years agoig_hal: Allow enabling debug at runtime
Sepherosa Ziehau [Tue, 29 Dec 2015 08:01:03 +0000 (16:01 +0800)]
ig_hal: Allow enabling debug at runtime

8 years agoBUS_SETUP_INTR.9: Mention INTR_NOPOLL flag.
Imre Vadász [Mon, 28 Dec 2015 13:57:18 +0000 (14:57 +0100)]
BUS_SETUP_INTR.9: Mention INTR_NOPOLL flag.

8 years agopsm: Remove unused struct sigio *async
Imre Vadász [Mon, 28 Dec 2015 11:30:31 +0000 (12:30 +0100)]
psm: Remove unused struct sigio *async

8 years agopsm: Remove leftover PSM_HOOKAPM #if defined check
Imre Vadász [Mon, 28 Dec 2015 11:08:59 +0000 (12:08 +0100)]
psm: Remove leftover PSM_HOOKAPM #if defined check

8 years agoagp: Remove support for Sandy Bridge hardware
François Tigeot [Mon, 28 Dec 2015 21:41:53 +0000 (22:41 +0100)]
agp: Remove support for Sandy Bridge hardware

This GPU family is now fully handled by the drm/i915 driver.

8 years agodrm/i915: Use generic drm_plane helper functions
François Tigeot [Mon, 28 Dec 2015 20:46:50 +0000 (21:46 +0100)]
drm/i915: Use generic drm_plane helper functions

* Now than drm plane helpers have been fixed, we can use the generic
  drm_plane_update function

* This should fix some mouse cursor corruption and disappearance
  issues reported by various testers

8 years agodrm: Skip vblank wait for legacy cursor updates
François Tigeot [Mon, 28 Dec 2015 20:40:43 +0000 (21:40 +0100)]
drm: Skip vblank wait for legacy cursor updates

This commit fixes an issue with the generic drm_plane_helper_update
function where the mouse cursor position was updated long after the
mouse was actually moved.

Submitted-by: Matthew Dillon <dillon@apollo.backplane.com>
8 years agokernel/acpi_cpu: Fix argument name.
Sascha Wildner [Mon, 28 Dec 2015 16:37:23 +0000 (17:37 +0100)]
kernel/acpi_cpu: Fix argument name.

8 years agoacpi/pstate: Allow user to ignore type 0x80 notify
Sepherosa Ziehau [Mon, 28 Dec 2015 15:17:48 +0000 (23:17 +0800)]
acpi/pstate: Allow user to ignore type 0x80 notify

Some BIOSes just send stupid _PPC updates which do not make
sense, so allow users to ignore the stupidity through tunable
and sysctl.

8 years agoacpi/pstate: Support type 0x80 notify
Sepherosa Ziehau [Mon, 28 Dec 2015 13:55:36 +0000 (21:55 +0800)]
acpi/pstate: Support type 0x80 notify

- Protect power domain states by per-power-domain serializer.
- Protect global P-state setting by the first usable power domain's
  serializer.

8 years agokernel/vga: Remove wrong lwkt_reltoken(). It's not taken at this point.
Sascha Wildner [Mon, 28 Dec 2015 13:41:16 +0000 (14:41 +0100)]
kernel/vga: Remove wrong lwkt_reltoken(). It's not taken at this point.

8 years agoacpi/pstate: Factor out acpi_pst_eval_{ppc,pdl}()
Sepherosa Ziehau [Mon, 28 Dec 2015 13:00:38 +0000 (21:00 +0800)]
acpi/pstate: Factor out acpi_pst_eval_{ppc,pdl}()

They will be used to handle type 0x80 notify.

8 years agotest - refactor Makefile
Matthew Dillon [Mon, 28 Dec 2015 03:18:54 +0000 (19:18 -0800)]
test - refactor Makefile

* Refactor the Makefile, also generate binaries to /tmp insetead of to the
  current directory.

8 years agotest - Add testvblank program
Matthew Dillon [Mon, 28 Dec 2015 03:14:47 +0000 (19:14 -0800)]
test - Add testvblank program

* Test program opens /dev/dri/card0 and uses DRM ioctls to test drm's
  vblank wait code.

8 years agotest - cleanup build
Matthew Dillon [Mon, 28 Dec 2015 03:12:11 +0000 (19:12 -0800)]
test - cleanup build

* Get rid of -Wall warnings, cleanup Makefile

8 years agodevfs - Fix panic on extra devfs mounts when rules are present
Matthew Dillon [Mon, 28 Dec 2015 01:01:29 +0000 (17:01 -0800)]
devfs - Fix panic on extra devfs mounts when rules are present

* Fix issue where the rules-check was being made on the root mount
  node itself.

* devfs would panic on extra devfs mounts (such as in jails) when
  /etc/defaults/devfs.conf contains any rules.

Reported-by: marino
8 years agoagp: Remove support for Ivy Bridge hardware
François Tigeot [Sun, 27 Dec 2015 08:12:50 +0000 (09:12 +0100)]
agp: Remove support for Ivy Bridge hardware

This GPU family is now fully handled by the drm/i915 driver.

8 years agodrm - Fix panic on DRM_IOCTL_WAIT_VBLANK
Matthew Dillon [Sun, 27 Dec 2015 00:11:04 +0000 (16:11 -0800)]
drm - Fix panic on DRM_IOCTL_WAIT_VBLANK

* DRM_IOCTL_WAIT_VBLANK -> drm_wait_vblank() -> DRM_WAIT_ON() -> panic

  DRM_WAIT_ON() assumed that the device was locked and tried to unlock
  and relock it around the tsleep.  However, the ioctl paths that use
  this function do not lock the device.

* Remove the unlock/relock sequence.

* Tested on haswell using ioctl call w/vblank.request.type =
   _DRM_VBLANK_RELATIVE and vblank.request.sequence = 10.  Crash reproduced
   before fix, does not occur after fix.

Reported-by: arcade@b1t.name
8 years agodrm/i915: Upgrade to Linux 4.0
François Tigeot [Sat, 26 Dec 2015 13:09:06 +0000 (14:09 +0100)]
drm/i915: Upgrade to Linux 4.0

* Basic Skylake support

* Panel Self-Refresh (PSR) now supported on Valleyview and Cherryview

* Preparations for atomic display updates

* Performance improvements on various GPU families, including Cherryview,
  Broadwell and Haswell

* GPU frequencies are now kept at a minimum of 450MHz when possible
  on Haswell and Broadwell, ensuring a minimum experience level for
  various types of workloads

* Improved reset support for gen3/4 GPUs, which should fix some OpenGL
  crashes on Core 2 and pre-2012 Atom machines

* Better sound/graphics driver synchronization for audio over hdmi support

* As usual, small bugfixes and stability improvements here and there

8 years agodrm: Fix previous commit
François Tigeot [Sat, 26 Dec 2015 09:30:29 +0000 (10:30 +0100)]
drm: Fix previous commit

8 years agodrm: Create device entries with the "video" group
François Tigeot [Sat, 26 Dec 2015 08:16:27 +0000 (09:16 +0100)]
drm: Create device entries with the "video" group

* Add a new "video" group with id 44

* Make the drm subsystem create /dev/dri/card* devices with this
  new group

* FreeBSD and many Linux distributions already do the same thing

Suggested-by: Koop Mast
Partially-obtained-from: FreeBSD

8 years agoagp: Remove support for Haswell hardware
François Tigeot [Sat, 26 Dec 2015 07:36:43 +0000 (08:36 +0100)]
agp: Remove support for Haswell hardware

This GPU family is now fully handled by the drm/i915 driver.

8 years agolibc - fix getcontext bug from last commit
Matthew Dillon [Fri, 25 Dec 2015 21:56:01 +0000 (13:56 -0800)]
libc - fix getcontext bug from last commit

* getcontext() should not save the FP state (which is all scratch),
  and was already setting the flags to indicate such, but still calling
  the xsave instruction.

  Remove the xsave instruction, fixing issues on numerous computers.

* Note that setcontext() will properly restore the FP state if the context
  contains valid FP state (i.e. the ucontext was taken from a signal handler
  argument).

Reported-by: YRabbit
8 years agodrm: Make OpenGL usable by everyone
François Tigeot [Fri, 25 Dec 2015 11:59:39 +0000 (12:59 +0100)]
drm: Make OpenGL usable by everyone

By changing permissions on /dev/dri/card* .
These devices were previously only usable by root or wheel users.

8 years agoagp: Remove support for Broadwell hardware
François Tigeot [Fri, 25 Dec 2015 10:57:18 +0000 (11:57 +0100)]
agp: Remove support for Broadwell hardware

This GPU family is now fully handled by the drm/i915 driver.

8 years agoRaise WARNS to 3 for most ACPICA tools.
Sascha Wildner [Fri, 25 Dec 2015 03:30:31 +0000 (04:30 +0100)]
Raise WARNS to 3 for most ACPICA tools.

8 years agoboot0: Fix some typos (driver -> drive).
Sascha Wildner [Thu, 24 Dec 2015 18:25:33 +0000 (19:25 +0100)]
boot0: Fix some typos (driver -> drive).

8 years agosbin/fdisk: cleanups
Alexander Kuleshov [Thu, 24 Dec 2015 13:21:52 +0000 (19:21 +0600)]
sbin/fdisk: cleanups

This patch provides set of cleanups for the sbin/fdisk util.

1. MBRSIGOFF macro removed. Use the DOSMAGICOFFSET macro instead
which is already defined in the <sys/diskmbr.h>.

2. Global variable iotest removed. It was used in the write_sr0()
function before. We checked this variable and it it was set we
just printed information about zero sector and exited from the
write_sr0(). Actually, this variable wasn't set never and never
used anywhere. For this point we already have the `-t` flag
which prevents writing of sector 0.

3. Unused macros removed.

4. Unused functions removed.

5. MAX_SECTORS_PER_TRACK and MIN_SECTORS_PER_TRACK macros are added.

6. Fixed order of DIOCWLABEL ioctl in the write_sr0().

7. Indentation fixed.

8 years agoboot0cfg: use getdevpath() instead of custom function
Alexander Kuleshov [Wed, 23 Dec 2015 14:22:06 +0000 (20:22 +0600)]
boot0cfg: use getdevpath() instead of custom function

We are using mkrdev function in the boot0cfg.c to prduce a device
path from the given command line argument. The <fstab.h> provides
the getdevpath() function that does the same but in more general
way. Let's use function from the libc instead of custom.

8 years agoboot/libi386: use macros from <machine/psl.h> to represent eflags's bits
Alexander Kuleshov [Fri, 18 Dec 2015 18:01:13 +0000 (00:01 +0600)]
boot/libi386: use macros from <machine/psl.h> to represent eflags's bits

The libi386's source code contains some checks of the EFLAGS's bits. In
the same time the <machine/psl.h> header file provides macros which
represents these bits. Let's use human readable names instead of
numbers.

8 years agoboot0 refactoring
Alexander Kuleshov [Thu, 10 Dec 2015 19:23:35 +0000 (01:23 +0600)]
boot0 refactoring

The patch provides refactoring for the sys/boot/pc32/boot0.S
assembly file to imrove readability and comprehensibility of
assembly code.

The main changes are:

Two new symbols added: the _SECTOR_FIELD_OFF which provides
offset for the 'sector' field in CHS and the _DATA_OFF which
provides offset for the boot0 data from the partition table.
We can use these symbols instead of magic numbers in the code.

The second change is updating comments in some place.

The patch was tested as in virtual machine as in real hardware.

8 years agoboot0cfg: check result of malloc in read_mbr()
Alexander Kuleshov [Tue, 8 Dec 2015 18:38:12 +0000 (00:38 +0600)]
boot0cfg: check result of malloc in read_mbr()

We allocating buffer for MBR in the read_mbr() function. The malloc()
may return NULL, so this patch checks the result of the malloc and
exit with the error if we can't allocate memory.

Besides this we close file descriptor.

8 years agokernel/usb4bsd: Fix device generation in usb_serial
Markus Pfeiffer [Thu, 24 Dec 2015 15:30:03 +0000 (15:30 +0000)]
kernel/usb4bsd: Fix device generation in usb_serial

When creating multiple tty devices for a connected usb device, don't
overwrite pregenerated names, in particular don't create multiple
devices with the same name.

8 years agoagp: Remove support for Valleyview hardware
François Tigeot [Thu, 24 Dec 2015 14:31:27 +0000 (15:31 +0100)]
agp: Remove support for Valleyview hardware

It is now fully handled by the drm/i915 driver.

8 years agomoused: Read more than 1 byte at a time from the mouse device.
Imre Vadasz [Thu, 24 Dec 2015 11:54:39 +0000 (12:54 +0100)]
moused: Read more than 1 byte at a time from the mouse device.

8 years agomoused: Omit superfluous gettimeofday calls when mouse only moves
Imre Vadasz [Thu, 24 Dec 2015 11:50:37 +0000 (12:50 +0100)]
moused: Omit superfluous gettimeofday calls when mouse only moves

The gettimeofday() is only needed when a mouse button state changed.

8 years agodrm: Fix ww mutex crtc locking
François Tigeot [Thu, 24 Dec 2015 08:56:57 +0000 (09:56 +0100)]
drm: Fix ww mutex crtc locking

* The original code had many problems:
  - the ctx wasn't available to drm_modeset_unlock().
  - 'struct list_head' was used for both the list head AND the list entry
  It's like it was coded to create maximum confusion on top of maximum pain

* drm_modeset_acquire_ctx structure needs a second list which we add
  kmalloc()'d entries to to track the extra locks in the EALREADY case

* Replace the reference from the modeset_lock structure with a pointer
  to an intermediate (kmalloc'd) structure that references both and turn
  the list entry in the lock into a list head

Submitted-by: Matthew Dillon <dillon@apollo.backplane.com>
8 years agokernel/acpi: Save a newline.
Sascha Wildner [Thu, 24 Dec 2015 02:51:43 +0000 (03:51 +0100)]
kernel/acpi: Save a newline.

8 years agosbin/hammer: Remove vol_alloc from volume_info
Tomohiro Kusumi [Mon, 21 Dec 2015 13:14:08 +0000 (22:14 +0900)]
sbin/hammer: Remove vol_alloc from volume_info

vol_alloc is a fixed sized space before boot/mem/buf area
that the filesystem doesn't recognize once initialized.
(This area is currently used for nothing)

8 years agosbin/newfs_hammer: Remove total size arg from format_volume()
Tomohiro Kusumi [Mon, 21 Dec 2015 12:56:32 +0000 (21:56 +0900)]
sbin/newfs_hammer: Remove total size arg from format_volume()

Each HAMMER volume doesn't recognize total filesystem size,
so this unused arg isn't necessary when formatting a volume.

8 years agosbin/hammer: Remove global variable NumVolumes
Tomohiro Kusumi [Wed, 23 Dec 2015 07:06:53 +0000 (16:06 +0900)]
sbin/hammer: Remove global variable NumVolumes

Only newfs_hammer uses this, but doesn't need to be global.

(Keeping a number of volumes isn't that important either,
because it can be retrieved directly from volume headers or
by counting the number of elements in the volume_info list)

8 years agosys/vfs/hammer: Add sanity check to volume-del
Tomohiro Kusumi [Wed, 16 Dec 2015 14:07:43 +0000 (23:07 +0900)]
sys/vfs/hammer: Add sanity check to volume-del

8 years agokernel/hpt27xx: Move two files to better names (like hptrr).
Sascha Wildner [Tue, 22 Dec 2015 10:19:51 +0000 (11:19 +0100)]
kernel/hpt27xx: Move two files to better names (like hptrr).

8 years agokernel/igb: Fix build with either IGB_RSS_DEBUG or IGB_TSS_DEBUG.
Sascha Wildner [Tue, 22 Dec 2015 10:15:41 +0000 (11:15 +0100)]
kernel/igb: Fix build with either IGB_RSS_DEBUG or IGB_TSS_DEBUG.

8 years agolibc - fix makecontext build issues
Matthew Dillon [Tue, 22 Dec 2015 01:10:10 +0000 (17:10 -0800)]
libc - fix makecontext build issues

* Enhance makecontext_quick manual page code example.

* Remove mcontext.S (old get_mcontext and set_mcontext calls) from build.

8 years agolibc - Add quick version for the context management functions.
Matthew Dillon [Mon, 21 Dec 2015 20:17:36 +0000 (12:17 -0800)]
libc - Add quick version for the context management functions.

* Add makecontext_quick(), setcontext_quick(), and swapcontext_quick().
  These functions work similarly to the non-quick versions but are designed
  for fast synchronous switching.  These functions do not mess with the
  signal mask or stack at all and do not save or restore scratch registers.

* These functions make no system calls.  Switching time can be as low as
  ~5 nanoseconds.

* These functions also provide optimizations for coroutine fall-through
  linkages.

* Note that the coroutine / start-function callback arguments are somewhat
  different.  Start functions are called back as cofunc(ucp, arg).  Var-args
  are not supported and the stack is minimally aligned and initialized.

* Remove the old internal set_mcontext() and get_mcontext() routines.

8 years agolibc - Fix bugs in getcontext(), setcontext(), and swapcontext()
Matthew Dillon [Mon, 21 Dec 2015 08:33:54 +0000 (00:33 -0800)]
libc - Fix bugs in getcontext(), setcontext(), and swapcontext()

* Fix multiple bugs revealed by qemu's use of these functions.  Most of
  these fixes are accomplished by calling sigreturn(uctx) to restore the
  state instead of trying to roll our own in userland.  This won't be much
  slower (if at all) because we had to save and restore the signal state
  in the userland code anyway, so we could not avoid making at least one
  system call.

  Using sigreturn() handles the signal mask atomicy for us so we don't have
  to deal with it and fixes numerous other issues.  Along with this change,
  adjust getcontext() and makecontext() to fill out additional important
  fields in the ucontext that sigreturn() inspects.

* Fixes two stack corruption bugs. First, getcontext() was calling
  get_mcontext() and get_mcontext() was setting up the setcontext return
  state to return 1 ... from get_mcontext(), NOT from getcontext().  If
  normal operations or signals mess with the stack, the double return
  will not work.  Oops.

  Secondly, getcontext scribbled over the red-zone in a way that is not
  permitted.

* setcontext() was restoring the context as saved by makecontext() or
  getcontext(), but setcontext() can also be called with the ucontext
  from the signal handler which requires a full restore.  setcontext()
  was not restoring FPU or scratch registers or rflags.

* Fixes signal restoration bug and corruption that can mess up emulation
  in qemu.

* Fixes issues with qemu related to SMP startup and lack of preemption.

Reported-by: ivadasz
8 years agoMakefile.usr - Allow /usr/src to pre-exist
Matthew Dillon [Mon, 21 Dec 2015 08:31:53 +0000 (00:31 -0800)]
Makefile.usr - Allow /usr/src to pre-exist

* Check for /usr/src/.git instead of /usr/src when generating warnings.

8 years agotty_pty - The tty_token isn't needed in ptckqfilter().
Imre Vadasz [Mon, 21 Dec 2015 21:38:10 +0000 (22:38 +0100)]
tty_pty - The tty_token isn't needed in ptckqfilter().

8 years agokernel - Mark sig_filtops kqueue filter as mpsafe.
Imre Vadasz [Mon, 21 Dec 2015 21:30:13 +0000 (22:30 +0100)]
kernel - Mark sig_filtops kqueue filter as mpsafe.

8 years agodrm: Mark drmfiltops mpsafe, remove unneeded locking in kqueue handlers.
Imre Vadasz [Mon, 21 Dec 2015 21:24:19 +0000 (22:24 +0100)]
drm: Mark drmfiltops mpsafe, remove unneeded locking in kqueue handlers.

8 years ago<sys/param.h>: Bump __DragonFly_version for the unionfs removal.
Sascha Wildner [Mon, 21 Dec 2015 20:48:18 +0000 (21:48 +0100)]
<sys/param.h>: Bump __DragonFly_version for the unionfs removal.

Some public headers were touched.

8 years agokernel: Remove VT_UNION.
Sascha Wildner [Mon, 21 Dec 2015 20:43:58 +0000 (21:43 +0100)]
kernel: Remove VT_UNION.

8 years agokernel: Adjust some comments to the unionfs removal.
Sascha Wildner [Mon, 21 Dec 2015 20:43:05 +0000 (21:43 +0100)]
kernel: Adjust some comments to the unionfs removal.

8 years agokernel: Remove the old unionfs that was unhooked from the build since 2004.
Sascha Wildner [Mon, 21 Dec 2015 20:33:03 +0000 (21:33 +0100)]
kernel: Remove the old unionfs that was unhooked from the build since 2004.

Approved-by: dillon
8 years agoigb.4: Update according to the recent TX/RX MSI-X handling work
Sepherosa Ziehau [Mon, 21 Dec 2015 12:35:12 +0000 (20:35 +0800)]
igb.4: Update according to the recent TX/RX MSI-X handling work

8 years agoig_hal/igb: Merge Intel igb-2.4.3
Sepherosa Ziehau [Sat, 19 Dec 2015 01:50:30 +0000 (09:50 +0800)]
ig_hal/igb: Merge Intel igb-2.4.3

- Add one more device
- Fix settings for i354

Tested-by: dillon@ (I354, I217[emx]) me (I350, 82580, 82576, 82575)
8 years agoigb: Optimize the aggregated TX/RX MSI-X handler a bit
Sepherosa Ziehau [Mon, 21 Dec 2015 11:22:19 +0000 (19:22 +0800)]
igb: Optimize the aggregated TX/RX MSI-X handler a bit

By checking whether there are any TX descs to collect or not, before
holding the TX ring serializer.

This requires that igb_txeof() is only called in interrupt handler,
thus we remove the igb_txeof() from igb_start(), which does nothing
most of the time.  Removal of igb_txeof() from igb_start() also allows
us to simplify the TX ring OACTIVE detection, so several unused water
marks are also removed.

8 years agoigb: Partly rework MSI-X support to bypass one serializer
Sepherosa Ziehau [Mon, 14 Dec 2015 03:04:06 +0000 (11:04 +0800)]
igb: Partly rework MSI-X support to bypass one serializer

For aggregated TX/RX MSI-X handler, there is no need to use
an independent serializer; using RX ring's serializer just
works (well, this driver's MSI-X support was added when we
still lacked of experience about how to serialize aggregated
TX/RX MSI-X handler).

Enable aggregated TX/RX MSI-X handling by default to avoid
extra TX interrupt (though its pretty low for TCP streams).

8 years agokernel/pci: Remove old compatibility shims.
Sascha Wildner [Sun, 20 Dec 2015 22:45:39 +0000 (23:45 +0100)]
kernel/pci: Remove old compatibility shims.

The last drivers using this were removed in d69d461d812.

8 years agokqueue/ufs: Remove unnecessary klist cast
Sepherosa Ziehau [Sun, 20 Dec 2015 10:26:12 +0000 (18:26 +0800)]
kqueue/ufs: Remove unnecessary klist cast

8 years agosocket: Don't use NOTE_OOB as hint for KNOTE upon OOB
Sepherosa Ziehau [Sun, 20 Dec 2015 10:19:07 +0000 (18:19 +0800)]
socket: Don't use NOTE_OOB as hint for KNOTE upon OOB

It is not necessary, and would cause penalty if there was knote
processing contention.  Add comment about it.

8 years agokqueue: Hint is not used by socket filters
Sepherosa Ziehau [Sun, 20 Dec 2015 10:02:40 +0000 (18:02 +0800)]
kqueue: Hint is not used by socket filters

8 years agokqueue: Remove unapplied comment
Sepherosa Ziehau [Sun, 20 Dec 2015 09:47:01 +0000 (17:47 +0800)]
kqueue: Remove unapplied comment

8 years agokqueue: Minor style changes
Sepherosa Ziehau [Sun, 20 Dec 2015 09:35:59 +0000 (17:35 +0800)]
kqueue: Minor style changes

8 years agokqueue: Avoid duplicate KN_PROCESSING clearing
Sepherosa Ziehau [Sun, 20 Dec 2015 09:35:17 +0000 (17:35 +0800)]
kqueue: Avoid duplicate KN_PROCESSING clearing