]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agohyperv/hn: Move chimney sending buffer to hn_softc
Sepherosa Ziehau [Mon, 22 Aug 2016 07:34:39 +0000 (07:34 +0000)]
hyperv/hn: Move chimney sending buffer to hn_softc

And don't recreate chimney sending buffer for each primary channel
open, it is now created in device_attach DEVMETHOD and destroyed
in device_detach DEVMETHOD.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7574

7 years agoAdd a missing change in r304575.
Pyun YongHyeon [Mon, 22 Aug 2016 03:28:06 +0000 (03:28 +0000)]
Add a missing change in r304575.

Noticed by: jhb

7 years agoImprove the locking when sending user messages.
Michael Tuexen [Mon, 22 Aug 2016 01:45:29 +0000 (01:45 +0000)]
Improve the locking when sending user messages.

First, keep a ref count on the stcb after looking it up, as
done in the other lookup cases.
Second, before looking again at sp, ensure that it is not
freed, because the assoc is about to be freed.

MFC after: 3 days

7 years agoAdd Killer E2400 to the supported hardware list.
Pyun YongHyeon [Mon, 22 Aug 2016 01:28:02 +0000 (01:28 +0000)]
Add Killer E2400 to the supported hardware list.

7 years agoAdd Killer E2400 Gigabit Ethernet support.
Pyun YongHyeon [Mon, 22 Aug 2016 01:19:05 +0000 (01:19 +0000)]
Add Killer E2400 Gigabit Ethernet support.
It seems Killer E2200/E2400 has a BIOS misconfiguration or silicon
bug which triggers DMA write errors when driver uses advertised
maximum payload size.  Force the maximum payload size to 128 bytes
in DMA configuration.
This change should fix occasional DMA write errors reported on
Killer E2200.

Tested by: <psy0nic@sys-tek.org>

7 years agoCorrect DMA channel number selection on AR816x family of
Pyun YongHyeon [Mon, 22 Aug 2016 01:06:54 +0000 (01:06 +0000)]
Correct DMA channel number selection on AR816x family of
controllers. For Gigabit Ethernet version of AR816x, AR813x/AR815x
except L1D controller, use vendor recommended ASPM parameters.
While here, increase alc_dma_burst array size.  Broken H/W can
return bogus value in theory.

7 years agoRemove duplicate code, which is not protected by the appropriate locks.
Michael Tuexen [Mon, 22 Aug 2016 00:40:45 +0000 (00:40 +0000)]
Remove duplicate code, which is not protected by the appropriate locks.

MFC after: 3 days

7 years agoRemove the kernel optoion for IPSEC_FILTERTUNNEL, which was deprecated
Bjoern A. Zeeb [Sun, 21 Aug 2016 18:55:30 +0000 (18:55 +0000)]
Remove the kernel optoion for IPSEC_FILTERTUNNEL, which was deprecated
more than 7 years ago in favour of a sysctl in r192648.

7 years agoMake the UKBD USB transfers double buffered and set them up one by one,
Hans Petter Selasky [Sun, 21 Aug 2016 18:37:21 +0000 (18:37 +0000)]
Make the UKBD USB transfers double buffered and set them up one by one,
so they are memory independent which allows for handling panics
triggered by the keyboard driver itself, typically via CTRL+ALT+ESC
sequences. Or if the USB keyboard driver was processing a key at the
moment of panic. Allow UKBD to be attached while keyboard polling is active.

Tested by: Bruce Evans <bde@freebsd.org>
MFC after: 1 week

7 years agoAdd the "-n" flag to cron(8), to prevent it from daemonizing.
Edward Tomasz Napierala [Sun, 21 Aug 2016 18:12:49 +0000 (18:12 +0000)]
Add the "-n" flag to cron(8), to prevent it from daemonizing.
This makes it possible to use it with external supervisors.
The "-n" flag name is compatible with Linux, NetBSD, and OpenBSD.

Reviewed by: jilles, pfg, wblock
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7581

7 years agoFix translation of the PrintScreen/SysRq and Pause/Break keys. Almost
Bruce Evans [Sun, 21 Aug 2016 16:06:00 +0000 (16:06 +0000)]
Fix translation of the PrintScreen/SysRq and Pause/Break keys.  Almost
everything was broken.  The cases that I noticed were Ctrl-PrintScreen
not being mapped to the virtual scancode 0x5c (debug) and Pause not being
mapped to the physical/virtual scancode 0x46 (slock).

These keys are the most complicated ones due to kludges to give some
compatibility back to before AT keyboards.

Alt-PrintScreen must pretend to be a separate key from PrintScreen
even at the "raw" level.  The (unique) usb code for it is 0x8a and we
just have to map this to our unique virtual scancode 0x54, but we
mapped it first to the internal code 0x7e and then to 0x79 which is a
key on the Japanese 106/109 keyboard.  This fix is under the
UKBD_EMULATE_ATASCANCODE option which shouldn't be used for non-AT
keyboards.  If it is, then the syscons Japanese keymaps have nothing
of importance for code 0x79 and can easily be changed.  0x54 is also
unimportant in Japanese and US keymaps.

NonAlt-PrintScreen and NonCtl-Pause/Break had many much larger bugs with
smaller compatibility problems from fixing them.  The details are too
ugly to give here.  Summary of the changed (hex) codes:

K_RAW  PrintScreen (Ctl, Shift, Ctl-Shift):             E0-2A-E0-37 -> E0-37
K_RAW  Alt-PrintScreen (all shift states):              79 -> 54
K_RAW  Pause/Break (unshifted, Shift, Alt, Alt-Shift)): E0-46 -> E1-1D-45
K_CODE ALT-PrintScreen (all shift states):              79 -> 54

That is 15 of 32 shift combinations for 2 keys fixed, with 8 easy cases
from the 79 -> 54 remapping.

The difference is only large and with no workaround using a keymap for
for K_RAW, but this affects other modes when ukbd is layered under kbmux
because kbmux keeps all subdevices in K_RAW mode and translates.  Oops.
I used kbdmux to generate the above table of changes.

7 years agoallwinner: Remove a20/a20_cpu_cfg.c from the build.
Emmanuel Vadot [Sun, 21 Aug 2016 16:03:44 +0000 (16:03 +0000)]
allwinner: Remove a20/a20_cpu_cfg.c from the build.
This was needed when we used the SoC specific timer and not the generic-timer.

7 years agoAdd source files generated from the 32-bit system call table.
Ed Schouten [Sun, 21 Aug 2016 16:02:25 +0000 (16:02 +0000)]
Add source files generated from the 32-bit system call table.

7 years agoAdd CPU independent code for running 32-bits CloudABI executables.
Ed Schouten [Sun, 21 Aug 2016 16:01:30 +0000 (16:01 +0000)]
Add CPU independent code for running 32-bits CloudABI executables.

Essentially, this is a literal copy of the code in sys/compat/cloudabi64,
except that it now makes use of 32-bits datatypes and limits. In
sys/conf/files, we now need to take care to build the code in
sys/compat/cloudabi if either COMPAT_CLOUDABI32 or COMPAT_CLOUDABI64 is
turned on.

This change does not yet include any of the CPU dependent bits. Right
now I have implementations for running i386 binaries both on i386 and
x86-64, which I will send out for review separately.

7 years agoFix s/64/32/ conversion errors in the system call table.
Ed Schouten [Sun, 21 Aug 2016 15:56:19 +0000 (15:56 +0000)]
Fix s/64/32/ conversion errors in the system call table.

We should pull in the 32 bit headers when using this system call table.

7 years agoImport the 32-bit system call table and data types into the tree.
Ed Schouten [Sun, 21 Aug 2016 15:41:19 +0000 (15:41 +0000)]
Import the 32-bit system call table and data types into the tree.

Obtained from: https://github.com/NuxiNL/cloudabi

7 years agoRemove the ie(4) hardware list from the release documentation
Benjamin Kaduk [Sun, 21 Aug 2016 15:39:46 +0000 (15:39 +0000)]
Remove the ie(4) hardware list from the release documentation

The driver was removed by jhb in r304513, and the &hwlist.ie; entity
is no longer generated, causing the website build to fail.

7 years agoDon't forget to define __ELF_WORD_SIZE.
Ed Schouten [Sun, 21 Aug 2016 15:37:49 +0000 (15:37 +0000)]
Don't forget to define __ELF_WORD_SIZE.

Without it, we only obtain the ELF types native to the system. In this
we explicitly want the 64-bit versions.

7 years agoAdd a utility macro for converting 64-bit pointers to native pointers.
Ed Schouten [Sun, 21 Aug 2016 15:36:18 +0000 (15:36 +0000)]
Add a utility macro for converting 64-bit pointers to native pointers.

Right now we're casting uint64_t's to native pointers. This isn't
causing any problems right now, but if we want to provide a 32-bit
compatibility layer that works on 64-bit systems as well, this will
cause problems. Casting a uint32_t to a 64-bit pointer throws a compiler
error.

Introduce a TO_PTR() macro that casts the value to uintptr_t before
casting it to a pointer.

7 years agoMove the linker script from cloudabi64/ to cloudabi/.
Ed Schouten [Sun, 21 Aug 2016 15:14:06 +0000 (15:14 +0000)]
Move the linker script from cloudabi64/ to cloudabi/.

It turns out that it works perfectly fine for generating 32-bits vDSOs
as well. While there, get rid of the extraneous .s file extension.

7 years agoUse the right _MAX constant.
Ed Schouten [Sun, 21 Aug 2016 09:32:20 +0000 (09:32 +0000)]
Use the right _MAX constant.

Though uio_resid is of type ssize_t, we need to take into account that
this source file contains an implementation specific to a certain
userspace pointer size. If this file provided 32-bit implementations,
this should have used INT32_MAX, even when running a 64-bit kernel.

This change has no effect, but is simply in preparation for adding
support for running 32-bit CloudABI executables.

7 years agoUse memcpy() to copy 64-bit timestamps into the syscall return values.
Ed Schouten [Sun, 21 Aug 2016 07:41:11 +0000 (07:41 +0000)]
Use memcpy() to copy 64-bit timestamps into the syscall return values.

On 32-bit platforms, our 64-bit timestamps need to be split up across
two registers. A simple assignment to td_retval[0] will cause the top 32
bits to get lost. By using memcpy(), we will automatically either use 1
or 2 registers depending on the size of register_t.

7 years agoRewrite the vDSOs for CloudABI in assembly.
Ed Schouten [Sun, 21 Aug 2016 07:28:38 +0000 (07:28 +0000)]
Rewrite the vDSOs for CloudABI in assembly.

The reason why the old vDSOs were written in C using inline assembly was
purely because they were embedded in the C library directly as static
inline functions. This was practical during development, because it
meant you could invoke system calls without any library dependencies.
The vDSO was simply a copy of these functions.

Now that we require the use of the vDSO, there is no longer any need for
embedding them in C code directly. Rewriting them in assembly has the
advantage that they are closer to ideal (less useless branching, less
assumptions about registers remaining unclobbered by the kernel, etc).
They are also easier to build, as they no longer depend on the C type
information for CloudABI.

Obtained from: https://github.com/NuxiNL/cloudabi

7 years ago[mips] add support for the "creative" GNU extensions and IRIX hilarity around MIPS...
Adrian Chadd [Sun, 21 Aug 2016 00:48:41 +0000 (00:48 +0000)]
[mips] add support for the "creative" GNU extensions and IRIX hilarity around MIPS LO16/HI16 relocations.

This was .. an interesting headache.

There are two halves:

* The earlier IRIX stuff (yes, early) occasionally would do dead
  code removal and generate multiple consecutive LO16 entries.
  If this is done for REL entries then it's fine - there's no
  state kept between them.  But gcc 5.x seems to do this for
  RELA entries.

eg:

HI1 LO1 HI2 LO2 LO3 HI4 LO4

.. in this instance, LO2 should affect HI2, but LO3 doesn't at all
affect anything.  The matching HI3 was in code that was deleted
as "dead code".

Then, the next one:

* A "GCC extension" allows for multiple HI entries before a LO entry;
  and all of those HI entries use the first LO entry as their basis
  for RELA offset calculations.

It does this so GCC can also do dead code deletion without necessarily
having to geneate fake relocation entries for balanced HI/LO RELA
entries.

eg:

HI1 LO1 HI2 HI3 HI4 LO4 LO5 HI6 LO6 LO7

in this instance, HI{2,3,4} are the same relocation as LO4 (eg .bss)
and need to be buffered until LO4 - then the RELA offset is applied
from LO4 to HI{2,3,4} calculations.

/And/, the AHL from HI4 is used during the LO4 relocation calculation,
just like in the normal (ie, before this commit) implementation.

Then, LO5 doesn't trigger anything - the HI "buffer" is empty,
so there are no HI relocations to flush out.

HI6/LO6 are normal, and LO7 doesn't trigger any HI updates.

Tested:

* AR9344 SoC, kernel modules, using gcc-5.3 (mips-gcc-5.3.0 package)

Notes:

* Yes, I do feel dirty having written this code.

Reviewed by: imp (after a handful of "this should be on fire" moments wrt gcc and this code)

7 years agoPermit disabling net.inet.udp.require_l2_bcast in VIMAGE kernels.
Marko Zec [Sat, 20 Aug 2016 22:12:26 +0000 (22:12 +0000)]
Permit disabling net.inet.udp.require_l2_bcast in VIMAGE kernels.

The default value of the tunable introduced in r304436 couldn't be
effectively overrided on VIMAGE kernels, because instead of being
accessed via the appropriate VNET() accessor macro, it was accessed
via the VNET_NAME() macro, which resolves to the (should-be) read-only
master template of initial values of per-VNET data.  Hence, while the
value of udp_require_l2_bcast could be altered on per-VNET basis, the
code in udp_input() would ignore it as it would always read the default
value (one) from the VNET master template.

Silence from: rstone

7 years agoDisable L2 caching for UDP over IPv6
Mike Karels [Sat, 20 Aug 2016 20:46:53 +0000 (20:46 +0000)]
Disable L2 caching for UDP over IPv6

The ip6_output routine is missing L2 cache invalication as done
in ip_output.  Even with that code, some problems with UDP over
IPv6 have been reported.  Diabling L2 cache for that problem works
around the problem for now.

PR: 211872 211926
Reviewed by: gnn
Approved by: gnn (mentor)
MFC after: immediate

7 years agoAudit the accepted (or rejected) username argument to setlogin(2).
Robert Watson [Sat, 20 Aug 2016 20:28:08 +0000 (20:28 +0000)]
Audit the accepted (or rejected) username argument to setlogin(2).

(NB: This was likely a mismerge from XNU in audit support, where the
text argument to setlogin(2) is captured -- but as a text token,
whereas this change uses the dedicated login-name field in struct
audit_record.)

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoUnbreak sctp_connectx().
Michael Tuexen [Sat, 20 Aug 2016 20:15:36 +0000 (20:15 +0000)]
Unbreak sctp_connectx().

MFC after: 3 days

7 years agoAudit additional vnode information in the implementation of the
Robert Watson [Sat, 20 Aug 2016 18:51:48 +0000 (18:51 +0000)]
Audit additional vnode information in the implementation of the
ftruncate(2) system call.  This was not required by the Common
Criteria, which needed only open-time audit.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoImport Dragonfly Mail Agent snapshort from 20160806 aka v0.11+
Baptiste Daroussin [Sat, 20 Aug 2016 16:36:05 +0000 (16:36 +0000)]
Import Dragonfly Mail Agent snapshort from 20160806 aka v0.11+

Most important change being:
dma - Fix security hole (#46)

Affecting DragonFly 4.6 and earlier, Matt Dillon fixed this in base after
finding out from BSDNow Episode 152. Comments following were from his commit
which explains better than I. Just taking his change and putting it here as well.

* dma makes an age-old mistake of not properly checking whether a file
owned by a user is a symlink or not, a bug which the original mail.local
also had.

* Add O_NOFOLLOW to disallow symlinks.

Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked
about the mail.local bug.

MFC After: 2 days

7 years agoImport Dragonfly Mail agent snapshot from 2016-08-16
Baptiste Daroussin [Sat, 20 Aug 2016 16:28:17 +0000 (16:28 +0000)]
Import Dragonfly Mail agent snapshot from 2016-08-16

7 years agoloader is filling fixed length command_errbuf with sprintf() and is trusting
Toomas Soome [Sat, 20 Aug 2016 16:23:19 +0000 (16:23 +0000)]
loader is filling fixed length command_errbuf with sprintf() and is trusting
strings provided by user/config files. This update is replacing sprintf with
snprintf for cases the command_errbuf is built from dynamic content.

PR: 211958
Reported by: ecturt@gmail.com
Reviewed by: imp, allanjude
Approved by: imp (mentor), allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D7563

7 years agoPull in r265122 from upstream llvm trunk (by James Molloy):
Dimitry Andric [Sat, 20 Aug 2016 14:04:51 +0000 (14:04 +0000)]
Pull in r265122 from upstream llvm trunk (by James Molloy):

  Fix for pr24346: arm asm label calculation error in sub

  Some ARM instructions encode 32-bit immediates as a 8-bit integer
  (0-255) and a 4-bit rotation (0-30, even) in its least significant 12
  bits. The original fixup, FK_Data_4, patches the instruction by the
  value bit-to-bit, regardless of the encoding. For example, assuming
  the label L1 and L2 are 0x0 and 0x104 respectively, the following
  instruction:

    add r0, r0, #(L2 - L1) ; expects 0x104, i.e., 260

  would be assembled to the following, which adds 1 to r0, instead of
  260:

    e2800104 add r0, r0, #4, 2 ; equivalently 1

  The new fixup kind fixup_arm_mod_imm takes care of the encoding:

    e2800f41 add r0, r0, #260

  Patch by Ting-Yuan Huang!

This fixes label calculation for ARM assembly, and is needed to enable
ARM assembly sources for OpenSSL.

Requested by: jkim
MFC after: 3 days

7 years agoJMicron JMB361 has only a single SATA port
Andriy Gapon [Sat, 20 Aug 2016 09:13:14 +0000 (09:13 +0000)]
JMicron JMB361 has only a single SATA port

Discussed with: mav
MFC after: 3 days

7 years agofix bug introduced in r297521, set canmount=on doesn't mount filesystem
Andriy Gapon [Sat, 20 Aug 2016 09:12:01 +0000 (09:12 +0000)]
fix bug introduced in r297521, set canmount=on doesn't mount filesystem

There are two cases where changing canmount should result in an action:
- canmount is set to off for a mounted filesystem
- canmount is set to on for an unmounted filesystem
Before r297521 we could unmount and re-mount a filesystem when that was
not necessary, but after r297521 we only handled the first of the above
cases.

MFC after: 5 days

7 years agoSkip HID1 initialization on e6500 cores, it doesn't exist.
Justin Hibbits [Sat, 20 Aug 2016 00:55:58 +0000 (00:55 +0000)]
Skip HID1 initialization on e6500 cores, it doesn't exist.

With this, and some drivers removed, a T2080 dev board boots to mountroot.

Submitted by: Ivan Krivonos <int0dster_AT_gmail.com>

7 years agoRemove the ie(4) driver for Intel 82586 ISA Ethernet adapters.
John Baldwin [Sat, 20 Aug 2016 00:49:29 +0000 (00:49 +0000)]
Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters.

This driver only supports 10Mb Ethernet using PIO (the hardware supports
DMA, but the driver only does PIO).  There are not any PCCard adapters
supported by this driver, only ISA cards.  In addition, it does not use
bus_space but instead uses bcopy with volatile pointers triggering a
host of warnings.  (if_ie.c is one of 3 files always built with
-Wno-error)

Relnotes: yes

7 years agoixlv(4): Fix ixlv(4) not loading when loaded as a kernel module and netmap is enabled.
Eric Joyner [Sat, 20 Aug 2016 00:08:10 +0000 (00:08 +0000)]
ixlv(4): Fix ixlv(4) not loading when loaded as a kernel module and netmap is enabled.

Define (unused) netmap variables; ixlv(4) doesn't support netmap yet.

Reported by: sergey.kozlov@intel.com
Sponsored by: Intel Corporation

7 years agoif_emac: Before generating a random MAC address, try using the SID rootkey
Emmanuel Vadot [Fri, 19 Aug 2016 23:44:07 +0000 (23:44 +0000)]
if_emac: Before generating a random MAC address, try using the SID rootkey
to generate one. This is was U-Boot does to generate a random MAC so we end
up with the same MAC address as if U-Boot did generate it.

MFC after: 1 week

7 years agoRemove the spic(4) driver for the Sony Vaoi Jogdial.
John Baldwin [Fri, 19 Aug 2016 23:39:08 +0000 (23:39 +0000)]
Remove the spic(4) driver for the Sony Vaoi Jogdial.

This hardware is not present on any modern systems.  The driver is quite
hackish (raw inb/outb instead of bus_space, and raw inb/outb to random
I/O ports to enable ACPI since it predated proper ACPI support).

Relnotes: yes

7 years agoRemove the wl(4) driver and wlconfig(8) utility.
John Baldwin [Fri, 19 Aug 2016 22:27:14 +0000 (22:27 +0000)]
Remove the wl(4) driver and wlconfig(8) utility.

The wl(4) driver supports pre-802.11 PCCard wireless adapters that
are slower than 802.11b.  They do not work with any of the 802.11
framework and the driver hasn't been reported to actually work in a
long time.

Relnotes: yes

7 years agoRemove mentions of the mcd(4), scd(4), and si(4) drivers.
John Baldwin [Fri, 19 Aug 2016 22:13:01 +0000 (22:13 +0000)]
Remove mentions of the mcd(4), scd(4), and si(4) drivers.

Relnotes: yes

7 years agoRemove stale drivers (amd(4) and asr(4)) from the SCSI controller regex.
John Baldwin [Fri, 19 Aug 2016 22:05:22 +0000 (22:05 +0000)]
Remove stale drivers (amd(4) and asr(4)) from the SCSI controller regex.

7 years agoRemove the wds(4) driver for the WD700 ISA SCSI HBA.
John Baldwin [Fri, 19 Aug 2016 21:51:42 +0000 (21:51 +0000)]
Remove the wds(4) driver for the WD700 ISA SCSI HBA.

While this driver does do DMA, it bounce buffers all transactions through
a single 64k buffer.  It also does not have a manpage.

Relnotes: yes

7 years agoRemove the si(4) driver and sicontrol(8) for Specialix serial cards.
John Baldwin [Fri, 19 Aug 2016 21:14:27 +0000 (21:14 +0000)]
Remove the si(4) driver and sicontrol(8) for Specialix serial cards.

The si(4) driver supported multiport serial adapters for ISA, EISA, and
PCI buses.  This driver does not use bus_space, instead it depends on
direct use of the pointer returned by rman_get_virtual().  It is also
still locked by Giant and calls for patch testing to convert it to use
bus_space were unanswered.

Relnotes: yes

7 years agoRemove doxygen files for mcd(4) and scd(4) drivers.
John Baldwin [Fri, 19 Aug 2016 20:53:55 +0000 (20:53 +0000)]
Remove doxygen files for mcd(4) and scd(4) drivers.

Submitted by: ak

7 years agoRemove the scd(4) driver for Sony CDU31/33 CD-ROM drives.
John Baldwin [Fri, 19 Aug 2016 19:31:55 +0000 (19:31 +0000)]
Remove the scd(4) driver for Sony CDU31/33 CD-ROM drives.

This is a driver for a pre-ATAPI ISA CD-ROM adapter.  The driver only
uses PIO.

7 years agoMove cxgb and cxgbe down to the non-mii PCI NIC section.
John Baldwin [Fri, 19 Aug 2016 18:45:42 +0000 (18:45 +0000)]
Move cxgb and cxgbe down to the non-mii PCI NIC section.

7 years agoKeep boot parameters in ARM trampoline code
Emmanuel Vadot [Fri, 19 Aug 2016 18:02:36 +0000 (18:02 +0000)]
Keep boot parameters in ARM trampoline code

Currently boot parameters (r0 - r3) are forgotten in ARM trampoline code.
This patch save them at startup and restore them before jumping into kernel
_start() routine.
This is usefull when booting with Linux ABI and/or custom bootloader.

Submitted by: Grégory Soutadé <soutade@gmail.com>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D7395

7 years agoDon't set P2_PTRACE_FSTP in a process that invokes ptrace(PT_TRACE_ME).
Mark Johnston [Fri, 19 Aug 2016 17:57:14 +0000 (17:57 +0000)]
Don't set P2_PTRACE_FSTP in a process that invokes ptrace(PT_TRACE_ME).

Such processes are stopped synchronously by a direct call to
ptracestop(SIGTRAP) upon exec. P2_PTRACE_FSTP causes the exec()ing thread
to suspend itself while waiting for a SIGSTOP that never arrives.

Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7576

7 years agoReorder sysctls so that nodes shared with the VF driver are added first.
John Baldwin [Fri, 19 Aug 2016 17:54:51 +0000 (17:54 +0000)]
Reorder sysctls so that nodes shared with the VF driver are added first.

This permits a single early return for VF devices in the routines that
add sysctl nodes.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7512

7 years agoRegenerate system call table after r304483.
Ed Schouten [Fri, 19 Aug 2016 17:54:06 +0000 (17:54 +0000)]
Regenerate system call table after r304483.

7 years agoUse the proper value for svn:keywords.
Ed Schouten [Fri, 19 Aug 2016 17:53:37 +0000 (17:53 +0000)]
Use the proper value for svn:keywords.

Pointy hat to: me

7 years agoAdjust t4_port_init() to work with VF devices.
John Baldwin [Fri, 19 Aug 2016 17:52:48 +0000 (17:52 +0000)]
Adjust t4_port_init() to work with VF devices.

Specifically, the FW_PORT_CMD may or may not work for a VF (the PF
driver can choose whether or not to permit access to this command),
so don't attempt to fetch port information on a VF if permission is
denied by the PF.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7511

7 years agoAdd missing SVN keywords keyword.
Ed Schouten [Fri, 19 Aug 2016 17:51:52 +0000 (17:51 +0000)]
Add missing SVN keywords keyword.

7 years agoAdd structures for VF-specific adapter parameters.
John Baldwin [Fri, 19 Aug 2016 17:49:49 +0000 (17:49 +0000)]
Add structures for VF-specific adapter parameters.

While here, mark which parameters are PF-specific and which are
VF-specific.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7508

7 years agoImport the new automatically generated system call table for CloudABI.
Ed Schouten [Fri, 19 Aug 2016 17:49:35 +0000 (17:49 +0000)]
Import the new automatically generated system call table for CloudABI.

Now that we've switched over to using the vDSO on CloudABI, it becomes a
lot easier for us to phase out old features. System call numbering is no
longer something that's part of the ABI. It's fully based on names. As
long as the numbering used by the kernel and the vDSO is consistent
(which it always is), it's all right.

Let's put this to the test by removing a system call (thread_tcb_set())
that's already unused for quite some time now, but was only left intact
to serve as a placeholder. Sync in the new system call table that uses
alphabetic sorting of system calls.

Obtained from: https://github.com/NuxiNL/cloudabi

7 years agoFix various nits in the aio operation manpages.
John Baldwin [Fri, 19 Aug 2016 17:37:32 +0000 (17:37 +0000)]
Fix various nits in the aio operation manpages.

- Avoid double use of "request" in a single sentence.  Instead, describe
  aio_sigevent as being used to request notification of the associated
  operation's completion.  This matches the language used to describe
  aio_sigevent in aio(4).
- Simplify the prohibition on modifying buffers while requests are in
  flight.
- Fix case mismatch.
- Drop note about not using stack variables. C programmers should be able
  to figure out if a stack variable is safe based on the later warning
  about the life cycle requirements of control blocks.
- Remove prohibition on modifying the I/O buffer for aio_fsync() since
  it does not use an I/O buffer.  For aio_mlock(), prohibit modifications
  to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not
  prohibit modifications to the memory backing the buffer (stores into
  the pages backing the buffer).

Requested by: wblock (1,2), kib (4)
Reviewed by: kib, rpokala, wblock
MFC after: 3 days
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7462

7 years agoAllwinner: Move a10_padconf.c into a10 subdirectory.
Emmanuel Vadot [Fri, 19 Aug 2016 12:48:32 +0000 (12:48 +0000)]
Allwinner: Move a10_padconf.c into a10 subdirectory.

7 years agoTEGRA: Remove forgotten debug printf.
Michal Meloun [Fri, 19 Aug 2016 11:12:59 +0000 (11:12 +0000)]
TEGRA: Remove forgotten debug printf.

7 years agoTEGRA: Implement MSI/MSIX interrupts for pcie controller.
Michal Meloun [Fri, 19 Aug 2016 10:53:17 +0000 (10:53 +0000)]
TEGRA: Implement MSI/MSIX interrupts for pcie controller.

7 years agoINTRNG: Rework handling with resources. Partially revert r301453.
Michal Meloun [Fri, 19 Aug 2016 10:52:39 +0000 (10:52 +0000)]
INTRNG: Rework handling with resources. Partially revert r301453.
 - Read interrupt properties at bus enumeration time and store
   it into global mapping table.
 - At bus_activate_resource() time, given mapping entry is resolved and
   connected to real interrupt source. A copy of mapping entry is attached
   to given resource.
 - At bus_setup_intr() time, mapping entry stored in resource is used
   for delivery of requested interrupt configuration.
 - For MSI/MSIX interrupts, mapping entry is created within
   pci_alloc_msi()/pci_alloc_msix() call.
 - For legacy PCI interrupts, mapping entry must be created within
   pcib_route_interrupt() by pcib driver itself.

Reviewed by: nwhitehorn, andrew
Differential Revision: https://reviews.freebsd.org/D7493

7 years agoHost controller is byte oriented. Fix wrong assumption on big-endian
Pyun YongHyeon [Fri, 19 Aug 2016 10:51:30 +0000 (10:51 +0000)]
Host controller is byte oriented.  Fix wrong assumption on big-endian
systems.

Pointed out by: hselasky

7 years agohyperv/hn: Move RXBUF to hn_softc
Sepherosa Ziehau [Fri, 19 Aug 2016 05:43:28 +0000 (05:43 +0000)]
hyperv/hn: Move RXBUF to hn_softc

And don't recreate RXBUF for each primary channel open, it is now
created in device_attach DEVMETHOD and destroyed in device_detach
DEVMETHOD.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7556

7 years agohyperv/hn: Remove the useless num_channel
Sepherosa Ziehau [Fri, 19 Aug 2016 05:30:39 +0000 (05:30 +0000)]
hyperv/hn: Remove the useless num_channel

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7555

7 years agohyperv/hn: Remove assign-only struct field
Sepherosa Ziehau [Fri, 19 Aug 2016 05:20:12 +0000 (05:20 +0000)]
hyperv/hn: Remove assign-only struct field

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7554

7 years agoImprove the pattern matching so that internal *'s work, as well as
Warner Losh [Fri, 19 Aug 2016 04:30:29 +0000 (04:30 +0000)]
Improve the pattern matching so that internal *'s work, as well as
[set] notation. This fixes pattern matching for recently added drives
that would set the NCQ Trim being broken incorrectly.

PR: 210686
Tested-by: Tomoaki AOKI
MFC After: 3 days

7 years agohyperv/hn: Move NVS version to softc
Sepherosa Ziehau [Fri, 19 Aug 2016 03:32:04 +0000 (03:32 +0000)]
hyperv/hn: Move NVS version to softc

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7553

7 years agoCorrect a check for P2_PTRACE_FSTP in ptracestop().
Mark Johnston [Fri, 19 Aug 2016 01:27:24 +0000 (01:27 +0000)]
Correct a check for P2_PTRACE_FSTP in ptracestop().

MFC after: 1 day

7 years agoFix build on big-endian systems.
Pyun YongHyeon [Fri, 19 Aug 2016 00:50:32 +0000 (00:50 +0000)]
Fix build on big-endian systems.

Reported by: bz

7 years agoFsck_ufs was using an int rather than a ufs2_daddr_t to store the
Kirk McKusick [Fri, 19 Aug 2016 00:03:41 +0000 (00:03 +0000)]
Fsck_ufs was using an int rather than a ufs2_daddr_t to store the
alternate superblock location when given in the -b option. When int
is 32-bits, block numbers larger than 2^32 would get truncated. This
commit changes the storage fpr the alternate superblock location
to a ufs2_daddr_t.

Submitted by: Dmitry Sivachenko <trtrmitya@gmail.com>

7 years agoFix unlocked access to ifnet address list
Ryan Stone [Thu, 18 Aug 2016 22:59:10 +0000 (22:59 +0000)]
Fix unlocked access to ifnet address list

in_broadcast() was iterating over the ifnet address list without
first taking an IF_ADDR_RLOCK.  This could cause a panic if a
concurrent operation modified the list.

Reviewed by: bz
MFC after: 2 months
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7227

7 years agoDon't check for broadcast IPs on non-bcast pkts
Ryan Stone [Thu, 18 Aug 2016 22:59:05 +0000 (22:59 +0000)]
Don't check for broadcast IPs on non-bcast pkts

in_broadcast() can be quite expensive, so skip calling it if the
incoming mbuf wasn't sent to a broadcast L2 address in the first
place.

Reviewed by: gnn
MFC after: 2 months
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7309

7 years agoDon't iterate over the ifnet addr list in ip_output()
Ryan Stone [Thu, 18 Aug 2016 22:59:00 +0000 (22:59 +0000)]
Don't iterate over the ifnet addr list in ip_output()

For almost every packet that is transmitted through ip_output(),
a call to in_broadcast() was made to decide if the destination
IP was a broadcast address.  in_broadcast() iterates over the
ifnet's address to find a source IP matching the subnet of the
destination IP, and then checks if the IP is a broadcast in that
subnet.

This is completely redundant as we have already performed the
route lookup, so the source IP is already known.  Just use that
address to directly check whether the destination IP is a
broadcast address or not.

MFC after: 2 months
Sponsored By: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7266

7 years agoAdd a SIGINFO handler for dtrace(1).
Mark Johnston [Thu, 18 Aug 2016 17:27:58 +0000 (17:27 +0000)]
Add a SIGINFO handler for dtrace(1).

Have it print the contents of aggregations, if any. Otherwise, one needs to
kill the running script to view the collected data, or add code to
periodically print it.

Discussed with: gnn
MFC after: 1 month

7 years agovt: fix old keyboard release in CONS_SETKBD
Ed Maste [Thu, 18 Aug 2016 16:22:40 +0000 (16:22 +0000)]
vt: fix old keyboard release in CONS_SETKBD

On the first switch we previously released the newly allocated keyboard
instead of the old one. Keyboard state was very confused afterwards for
further keyboard switches.

Submitted by: bde

7 years agoRemove the obsolete and unused openbsd_poll system call. (Phase 2)
George V. Neville-Neil [Thu, 18 Aug 2016 10:54:39 +0000 (10:54 +0000)]
Remove the obsolete and unused openbsd_poll system call. (Phase 2)

Reported by: brooks
Reviewed by: brooks, jhb
Differential Revision: https://reviews.freebsd.org/D7548

7 years agoRemove unusedd and obsolete openbsd_poll system call. (Phase 1)
George V. Neville-Neil [Thu, 18 Aug 2016 10:50:40 +0000 (10:50 +0000)]
Remove unusedd and obsolete openbsd_poll system call.  (Phase 1)

Reported by: brooks
Reviewed by: brooks,jhb
Differential Revision: https://reviews.freebsd.org/D7548

7 years agoTry to fix gcc compilation errors (which are right).
Bjoern A. Zeeb [Thu, 18 Aug 2016 10:26:15 +0000 (10:26 +0000)]
Try to fix gcc compilation errors (which are right).
nat64_getlasthdr() returns an int, which can be -1 in case of error,
storing the result in an uint8_t and then comparing to < 0 is not
helpful.  Do what is done in the rest of the code and make proto an
int here as well.

7 years agoFix TAB replaced with spaces in prev. commit.
Andrey A. Chernov [Thu, 18 Aug 2016 10:18:11 +0000 (10:18 +0000)]
Fix TAB replaced with spaces in prev. commit.

7 years agoAdd support for setting blocking and non-blocking mode on /dev/rdma_cm
Hans Petter Selasky [Thu, 18 Aug 2016 08:49:02 +0000 (08:49 +0000)]
Add support for setting blocking and non-blocking mode on /dev/rdma_cm
by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags
handling is done by the kern_ioctl() function.

Reported by: Alex Bowden <alex.bowden@outlook.com>
Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agoWhen device is detached make sure to stop the controller and make
Pyun YongHyeon [Thu, 18 Aug 2016 07:11:31 +0000 (07:11 +0000)]
When device is detached make sure to stop the controller and make
it return zero-length USB packet.

7 years agoIn axge_stop(), clear medium receive enable bit which will stop RX
Pyun YongHyeon [Thu, 18 Aug 2016 06:46:14 +0000 (06:46 +0000)]
In axge_stop(), clear medium receive enable bit which will stop RX
MAC operation.

7 years agoRemove <sys/types.h> from the SYNOPSIS.
Kevin Lo [Thu, 18 Aug 2016 06:39:09 +0000 (06:39 +0000)]
Remove <sys/types.h> from the SYNOPSIS.

7 years agoWhen usbd_transfer_setup() fails, don't call
Pyun YongHyeon [Thu, 18 Aug 2016 06:35:09 +0000 (06:35 +0000)]
When usbd_transfer_setup() fails, don't call
usbd_transfer_unsetup().

7 years agoIntroduce axge_rxfilter() which configures RX filtering and replace
Pyun YongHyeon [Thu, 18 Aug 2016 06:29:07 +0000 (06:29 +0000)]
Introduce axge_rxfilter() which configures RX filtering and replace
axge_setmulti()/axge_setpromisc() with axge_rxfilter().
Multicast filter programming and promiscuous mode requires
access to a common RX configuration register so there is no need to
use separate functions with added complexity.  axge_rxfilter() does
not read back AXGE_RCR register since accessing a register in USB
is too slow and we already have all knowledge of required
configuration.  Rebuilding RX filter configuration is simpler and
faster than manipulating every bits after reading back the
register.

Note, axge_rxfilter() does not set RCR_IPE(IP header alignment on
32bit boundary) to disable extra padding bytes insertion.  The
extra padding wastes ethernet to USB host bandwidth as well as
complicating RX handling logic.  Current USB framework requires
copying RX frames to mbufs so there is no need to worry about
alignment.  Previously axge_rx_frame() performed wrong bound check
due to the extra padding and it was broken when RX checksum
offloading is disabled.  See added comment in axge_rx_frame () for
actual RX packet layout.

In axge_init(), disable WOL.  It's meaningless to enable WOL in
normal operation.

In axge_rxeof(), use properly sized mbuf rather than blindly
allocating a mbuf cluster.

Use RX H/W checksum offloading only when administrator requested RX
checksum offloading. Previously it always used RX H/W checksum
offloading result regardless of RX checksum offloading state.

Separate L4 checksum offloading validation from L3 one and properly
set required offloading bits for each layer. This is to fix setting
L4 checksum offloading bits for L3 packets.

There are still lots of RX errors(probably RX FIFO overflows) under
moderate load.  Users are strongly recommended to enable ethernet
flow control.

Reviewed by: kevlo (initial version), hselasky

7 years agohyperv/kvp: Remove unnecessary function parameter.
Sepherosa Ziehau [Thu, 18 Aug 2016 06:03:55 +0000 (06:03 +0000)]
hyperv/kvp: Remove unnecessary function parameter.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7550

7 years agohyperv/hn: Get rid of the useless netvsc_packet
Sepherosa Ziehau [Thu, 18 Aug 2016 05:52:03 +0000 (05:52 +0000)]
hyperv/hn: Get rid of the useless netvsc_packet

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7544

7 years agohyperv/hn: Constify RNDIS messages on RX path.
Sepherosa Ziehau [Thu, 18 Aug 2016 05:44:58 +0000 (05:44 +0000)]
hyperv/hn: Constify RNDIS messages on RX path.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7542

7 years agohyperv/hn: Pass RX packet info to netvsc_recv.
Sepherosa Ziehau [Thu, 18 Aug 2016 05:33:58 +0000 (05:33 +0000)]
hyperv/hn: Pass RX packet info to netvsc_recv.

This paves to nuke netvsc_packet, which does not serves much
purpose now.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7541

7 years agoSwitch to TX header format rather than directly manipulating header
Pyun YongHyeon [Thu, 18 Aug 2016 05:07:02 +0000 (05:07 +0000)]
Switch to TX header format rather than directly manipulating header
structures.  This simplifies mbuf copy operation to USB buffers as
well as improving readability.  The controller supports Microsoft
LSOv1(aka TSO) but this change set does not include the support due
to copying overhead to USB buffers and large amount of memory waste.

Remove useless ZLP padding which seems to come from Linux.  Required
bits the code tried to set was not copied into USB buffer so it had
no effect.  Unlike Linux, FreeBSD USB stack automatically generates
ZLP so no explicit padding is required in driver.[1]

Micro-optimize updating IFCOUNTER_OPACKETS counter by moving it out
of TX loop since updating counter is not cheap operation as it did
long time ago and we already know how many number of packets were
queued after exiting the loop.

While here, fix a checksum offloading bug which will happen when
upper stack computes checksum while H/W checksum offloading is
active.  The controller should be notified to not recompute the
checksum in this case.

Reviewed by: kevlo (initial version), hselasky
Pointed out by: hselasky [1]

7 years agoRename cryptic RX filter constants with more readable ones.
Pyun YongHyeon [Thu, 18 Aug 2016 04:25:17 +0000 (04:25 +0000)]
Rename cryptic RX filter constants with more readable ones.
No functional change.

7 years agoDon't explicitly call MIIBUS_STATCHG() method handler. Link state
Pyun YongHyeon [Thu, 18 Aug 2016 02:14:39 +0000 (02:14 +0000)]
Don't explicitly call MIIBUS_STATCHG() method handler.  Link state
change should be handled by PHY driver.  Some broken PHY H/Ws may
need that workaround but it seems axge(4) don't use such PHYs.

7 years agoPass PHY location information and remove PHY access hack.
Pyun YongHyeon [Thu, 18 Aug 2016 01:48:58 +0000 (01:48 +0000)]
Pass PHY location information and remove PHY access hack.

7 years ago[net80211] correctly lock the ifp before accessing the lladdr.
Adrian Chadd [Thu, 18 Aug 2016 01:25:12 +0000 (01:25 +0000)]
[net80211] correctly lock the ifp before accessing the lladdr.

Tested by: dhw

7 years agoAdd SHA512, skein, large blocks support for loader zfs.
Toomas Soome [Thu, 18 Aug 2016 00:37:07 +0000 (00:37 +0000)]
Add SHA512, skein, large blocks support for loader zfs.

Updated sha512 from illumos.
Using skein from freebsd crypto tree.
Since loader itself is using 64MB memory for heap, updated zfsboot to
use same, and this also allows to support zfs large blocks.

Note, adding additional features does increate zfsboot code, therefore
this update does increase zfsboot code to 128k, also I have ported gptldr.S
update to zfsldr.S to support 64k+ code.

With this update, boot1.efi has almost reached the current limit of the size
set for it, so one of the future patches for boot1.efi will need to
increase the limit.

Currently known missing zfs features in boot loader are edonr and gzip support.

Reviewed by: delphij, imp
Approved by: imp (mentor)
Obtained from: sha256.c update and skein_zfs.c stub from illumos.
Differential Revision: https://reviews.freebsd.org/D7418

7 years agoDisable assembly sources when compiler/assembler cannot compile certain
Jung-uk Kim [Wed, 17 Aug 2016 22:13:39 +0000 (22:13 +0000)]
Disable assembly sources when compiler/assembler cannot compile certain
instructions.  For example, GCC 4.2.1 + binutils 2.17.50 does not support
AVX instructions.

Reported by: bde
MFC after: 2 weeks

7 years agoPull in r262772 from upstream clang trunk (by Simon Pilgrim):
Dimitry Andric [Wed, 17 Aug 2016 21:57:11 +0000 (21:57 +0000)]
Pull in r262772 from upstream clang trunk (by Simon Pilgrim):

  [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

  btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
  support XSAVE.

  Differential Revision: http://reviews.llvm.org/D17682

Pull in r262782 from upstream llvm trunk (by Simon Pilgrim):

  [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

  btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't
  support XSAVE.

  Differential Revision: http://reviews.llvm.org/D17683

This ensures clang does not emit AVX instructions for CPUTYPE=btver1.

Reported by: Michel Depeige <demik+freebsd@lostwave.net>
PR: 211864
MFC after: 3 days

7 years agoRename allwinner_machdep.{c.h} to aw_machdep.{c.h} as all allwinner source
Emmanuel Vadot [Wed, 17 Aug 2016 21:44:02 +0000 (21:44 +0000)]
Rename allwinner_machdep.{c.h} to aw_machdep.{c.h}  as all allwinner source
files are name aw_*

7 years agoboot1.efi Free() should check for NULL to provide consistent behavior
Toomas Soome [Wed, 17 Aug 2016 21:29:57 +0000 (21:29 +0000)]
boot1.efi Free() should check for NULL to provide consistent behavior
with libstand Free().

Reviewed by: imp
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D7497