]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 years agoMake userland tools honor WITHOUT_PF build option.
glebius [Tue, 29 Oct 2013 17:38:13 +0000 (17:38 +0000)]
Make userland tools honor WITHOUT_PF build option.

Tested by: dt71@gmx.com

10 years agoDon't call arc4random_stir() explicitly. To quote arc4random(3)
delphij [Tue, 29 Oct 2013 17:34:15 +0000 (17:34 +0000)]
Don't call arc4random_stir() explicitly.  To quote arc4random(3)
manual page:

    There is no need to call arc4random_stir() before using
    arc4random() functions family, since they automatically
    initialize themselves.

No objection: des
MFC after: 2 weeks

10 years agoUpdate copyright to include the author of the LPC bridge emulation code.
neel [Tue, 29 Oct 2013 17:31:16 +0000 (17:31 +0000)]
Update copyright to include the author of the LPC bridge emulation code.

10 years agoFix the build of TP-WN1043ND kernel. Provide necessary includes and remove
loos [Tue, 29 Oct 2013 15:45:11 +0000 (15:45 +0000)]
Fix the build of TP-WN1043ND kernel.  Provide necessary includes and remove
unnecessary includes for rtl8366rb.

Approved by: adrian (mentor)

10 years agoImplement extended LUN support. If PIM_EXTLUNS is set by a SIM, encode
nwhitehorn [Tue, 29 Oct 2013 15:36:58 +0000 (15:36 +0000)]
Implement extended LUN support. If PIM_EXTLUNS is set by a SIM, encode
the upper 32-bits of the LUN, if possible, into the target_lun field as
passed directly from the REPORT LUNs response. This allows extended LUN
support to work for all LUNs with zeros in the lower 32-bits, which covers
most addressing modes without breaking KBI. Behavior for drivers not
setting PIM_EXTLUNS is unchanged. No user-facing interfaces are modified.

Extended LUNs are stored with swizzled 16-bit word order so that, for
devices implementing LUN addressing (like SCSI-2), the numerical
representation of the LUN is identical with and without PIM_EXTLUNS. Thus
setting PIM_EXTLUNS keeps most behavior, and user-facing LUN IDs, unchanged.
This follows the strategy used in Solaris. A macro (CAM_EXTLUN_BYTE_SWIZZLE)
is provided to transform a lun_id_t into a uint64_t ordered for the wire.

This is the second part of work for full 64-bit extended LUN support and is
designed to a bridge for stable/10 to the final 64-bit LUN code. The
third and final part will involve widening lun_id_t to 64 bits and will
not be MFCed. This third part will break the KBI but will keep the KPI
unchanged so that all drivers that will care about this can be updated now
and not require code changes between HEAD and stable/10.

Reviewed by: scottl
MFC after: 2 weeks

10 years agoMove /etc/keys to /usr/share/keys where users are less likely to modify them.
bdrewery [Tue, 29 Oct 2013 15:07:54 +0000 (15:07 +0000)]
Move /etc/keys to /usr/share/keys where users are less likely to modify them.

Requested by: secteam (cperciva, des)
Approved by: bapt

10 years agoA last BUS_PROBE_NOWILDCARD. Move setting the postfilter function into the
nwhitehorn [Tue, 29 Oct 2013 14:44:36 +0000 (14:44 +0000)]
A last BUS_PROBE_NOWILDCARD. Move setting the postfilter function into the
attach function probe shouldn't actually set anything up but just bid
on the device.

10 years agoA few last BUS_PROBE_NOWILDCARDs are in order.
nwhitehorn [Tue, 29 Oct 2013 14:32:33 +0000 (14:32 +0000)]
A few last BUS_PROBE_NOWILDCARDs are in order.

10 years agoMore BUS_PROBE_NOWILDCARD sweeping. Some devices here (if_ath_ahb and siba)
nwhitehorn [Tue, 29 Oct 2013 14:19:42 +0000 (14:19 +0000)]
More BUS_PROBE_NOWILDCARD sweeping. Some devices here (if_ath_ahb and siba)
resist easy conversion since they implement a great deal of their attach
logic inside probe(). Some of this could be fixed by moving it to attach(),
but some requires something more subtle than BUS_PROBE_NOWILDCARD.

10 years agoFixed typo.
pluknet [Tue, 29 Oct 2013 14:15:09 +0000 (14:15 +0000)]
Fixed typo.

Submitted by: Nikolai Lifanov
Pointyhat: pluknet

10 years agoDevices that rely on hints or identify routines for discovery need to
nwhitehorn [Tue, 29 Oct 2013 14:07:31 +0000 (14:07 +0000)]
Devices that rely on hints or identify routines for discovery need to
return BUS_PROBE_NOWILDCARD from their probe routines to avoid claiming
wildcard devices on their parent bus. Do a sweep through the MIPS tree.

MFC after: 2 weeks

10 years agoHints-only devices should return BUS_PROBE_NOWILDCARD from their probe
nwhitehorn [Tue, 29 Oct 2013 13:52:05 +0000 (13:52 +0000)]
Hints-only devices should return BUS_PROBE_NOWILDCARD from their probe
methods.

10 years agoThese nexus attachments do not execute a real probe and so need
nwhitehorn [Tue, 29 Oct 2013 13:48:41 +0000 (13:48 +0000)]
These nexus attachments do not execute a real probe and so need
BUS_PROBE_NOWILDCARD set.

10 years agoOS X 10.9 added.
pluknet [Tue, 29 Oct 2013 13:44:19 +0000 (13:44 +0000)]
OS X 10.9 added.

10 years agoHints-only devices should have BUS_PROBE_NOWILDCARD set. We probably need
nwhitehorn [Tue, 29 Oct 2013 13:43:09 +0000 (13:43 +0000)]
Hints-only devices should have BUS_PROBE_NOWILDCARD set. We probably need
a better flag for this (in the driver metadata, for example).

10 years agoAdd missing ARMv6 CPU functions to ARM Makefile
zbb [Tue, 29 Oct 2013 13:16:05 +0000 (13:16 +0000)]
Add missing ARMv6 CPU functions to ARM Makefile

Will fix RPI-B kernel build failure since it adds missing
armv6_idcache_wbinv_all which was previously taken from cpufunc_asm_pj4b.S.

Reviewed by: gber

10 years agoFix build. Both clang and gcc are required on pc98.
nyan [Tue, 29 Oct 2013 12:34:11 +0000 (12:34 +0000)]
Fix build.  Both clang and gcc are required on pc98.

X-MFC with: r256915

10 years agoOpps, my kirkwood fix for the dreamplug missed this.
rrs [Tue, 29 Oct 2013 11:28:11 +0000 (11:28 +0000)]
Opps, my kirkwood fix for the dreamplug missed this.

10 years agoUninline inm_lookup_locked(). Now in_var.h doesn't dereference
glebius [Tue, 29 Oct 2013 11:21:31 +0000 (11:21 +0000)]
Uninline inm_lookup_locked(). Now in_var.h doesn't dereference
fields of struct ifnet.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years ago- Provide necessary includes.
glebius [Tue, 29 Oct 2013 11:17:49 +0000 (11:17 +0000)]
- Provide necessary includes.
- Remove unnecessary includes.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years agoSetting WARNS=6 is useless, as it is already the default
bapt [Tue, 29 Oct 2013 08:55:09 +0000 (08:55 +0000)]
Setting WARNS=6 is useless, as it is already the default

Reported by: Sascha Wildner

10 years agoChange warning level to 6
bapt [Tue, 29 Oct 2013 08:22:38 +0000 (08:22 +0000)]
Change warning level to 6

10 years agoMerge byacc 20130925
bapt [Tue, 29 Oct 2013 08:21:22 +0000 (08:21 +0000)]
Merge byacc 20130925

2 changes:
- Increase default stack-size so that used to be our default stack-size prior byacc import
- fix two loop-limits found by clang 3.3

10 years agoImport byacc version 20130925
bapt [Tue, 29 Oct 2013 08:08:57 +0000 (08:08 +0000)]
Import byacc version 20130925

10 years agoRemove redundand declaration, fixing the build with gcc.
kib [Tue, 29 Oct 2013 07:25:54 +0000 (07:25 +0000)]
Remove redundand declaration, fixing the build with gcc.

Reported and tested by: Michael Butler <imb@protected-networks.net>
Sponsored by: The FreeBSD Foundation
MFC after: 1 month

10 years agoFix regression introduced in r235816.
yongari [Tue, 29 Oct 2013 06:37:27 +0000 (06:37 +0000)]
Fix regression introduced in r235816.
r235816 triggered kernel panic or hang after warm boot.
Don't blindly restore BCE_EMAC_MODE media configuration in
bce_reset().  If driver is about to shutdown it will invoke
bce_reset() which in turn results in restoring BCE_EMAC_MODE
media configuration.  This operation seems to confuse controller
firmware.

Reported by: Paul Herman (herman <> cleverbridge dot com)
Tested by: sbruno, Paul Herman (herman <> cleverbridge dot com)

10 years agoAdd preliminary support for RTL8168EP.
yongari [Tue, 29 Oct 2013 05:37:05 +0000 (05:37 +0000)]
Add preliminary support for RTL8168EP.

Submitted by: Edward O'Callaghan (eocallaghan <> alterapraxis dot com)

10 years agoAdd preliminary support for RTL8168G, RTL8168GU and RTL8411B.
yongari [Tue, 29 Oct 2013 05:30:21 +0000 (05:30 +0000)]
Add preliminary support for RTL8168G, RTL8168GU and RTL8411B.
RTL8168GU has two variants(GMII and MII) but it uses the same chip
revision id.  Driver checks PCI device id of controller and
sets internal capability flag(i.e. jumbo frame and link speed down
in WOL).

H/W donated by: RealTek Semiconductor Corp.

10 years agoAdd support for new Gigabit PHY of RealTek.
yongari [Tue, 29 Oct 2013 05:14:38 +0000 (05:14 +0000)]
Add support for new Gigabit PHY of RealTek.
I don't have a copy of data sheet so I'm not sure exact PHY model
name. Vendor's web page indicates RTL8251 is latest PHY so I used
the name. This PHY is used with RTL8168G, RTL8168GU and RTL8411B.

10 years agobinutils/bfd: fix printf-like format strings for "bfd *" arguments
rea [Tue, 29 Oct 2013 04:25:49 +0000 (04:25 +0000)]
binutils/bfd: fix printf-like format strings for "bfd *" arguments

There is a special format argument '%B' that directly handles values
of type 'bfd *', they must be used instead of '%s'.  Manifestations
of this bug can be seen in ld(1) error messages, for example,
  http://lists.freebsd.org/pipermail/freebsd-current/2013-August/043580.html
  http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045404.html

Approved by: dim
MFC after: 2 weeks

10 years agoFix the PLCP lookup code in iwn(4) to base the 11n decision on whether
adrian [Tue, 29 Oct 2013 04:03:00 +0000 (04:03 +0000)]
Fix the PLCP lookup code in iwn(4) to base the 11n decision on whether
the rate is 11n, rather than whether the channel is 11n.

This correctly allows the PLCP lookup code to return the legacy rates
even on an 11n channel.

PR: kern/183430

10 years agoFix an off-by-one error when checking whether a given address is within
markj [Tue, 29 Oct 2013 03:52:05 +0000 (03:52 +0000)]
Fix an off-by-one error when checking whether a given address is within
the extent of a symbol.

Submitted by: Prashanth Kumar <pra_udupi@yahoo.co.in>
Reviewed by: rpaulo
MFC after: 1 week

10 years agoDigi-CCWMX53: enable ffec and uart.
rpaulo [Tue, 29 Oct 2013 03:42:43 +0000 (03:42 +0000)]
Digi-CCWMX53: enable ffec and uart.

10 years agoRevert r257248 and fix the problem in a way that doesn't violate style(9).
markj [Tue, 29 Oct 2013 03:12:31 +0000 (03:12 +0000)]
Revert r257248 and fix the problem in a way that doesn't violate style(9).

Suggested by: jmg

10 years agoRemove unnecessary includes of <machine/pmap.h>
neel [Tue, 29 Oct 2013 02:25:18 +0000 (02:25 +0000)]
Remove unnecessary includes of <machine/pmap.h>

Requested by: alc@

10 years agoReturn NOKEY instead of 0 if there are no more key presses queued. This
nwhitehorn [Tue, 29 Oct 2013 00:53:17 +0000 (00:53 +0000)]
Return NOKEY instead of 0 if there are no more key presses queued. This
worked by accident if and only if akbd was part of a kbdmux (which it
always was in practice).

MFC after: 1 week

10 years agoAdd support for PCI-to-ISA LPC bridge emulation. If the LPC bus is attached
neel [Tue, 29 Oct 2013 00:18:11 +0000 (00:18 +0000)]
Add support for PCI-to-ISA LPC bridge emulation. If the LPC bus is attached
to a virtual machine then we implicitly create COM1 and COM2 ISA devices.

Prior to this change the only way of attaching a COM port to the virtual
machine was by presenting it as a PCI device that is mapped at the legacy
I/O address 0x3F8 or 0x2F8.

There were some issues with the original approach:
- It did not work at all with UEFI because UEFI will reprogram the PCI device
  BARs and remap the COM1/COM2 ports at non-legacy addresses.
- OpenBSD GENERIC kernel does not create a /dev/console because it expects
  the uart device at the legacy 0x3F8/0x2F8 address to be an ISA device.
- It was functional with a FreeBSD guest but caused the console to appear
  on /dev/ttyu2 which was not intuitive.

The uart emulation is now independent of the bus on which it resides. Thus it
is possible to have uart devices on the PCI bus in addition to the legacy
COM1/COM2 devices behind the LPC bus.

The command line option to attach ISA COM1/COM2 ports to a virtual machine is
"-s <bus>,lpc -l com1,stdio".

The command line option to create a PCI-attached uart device is:
"-s <bus>,uart[,stdio]"

The command line option to create PCI-attached COM1/COM2 device is:
"-S <bus>,uart[,stdio]". This style of creating COM ports is deprecated.

Discussed with: grehan
Reviewed by: grehan
Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)

M    share/examples/bhyve/vmrun.sh
AM   usr.sbin/bhyve/legacy_irq.c
AM   usr.sbin/bhyve/legacy_irq.h
M    usr.sbin/bhyve/Makefile
AM   usr.sbin/bhyve/uart_emul.c
M    usr.sbin/bhyve/bhyverun.c
AM   usr.sbin/bhyve/uart_emul.h
M    usr.sbin/bhyve/pci_uart.c
M    usr.sbin/bhyve/pci_emul.c
M    usr.sbin/bhyve/inout.c
M    usr.sbin/bhyve/pci_emul.h
M    usr.sbin/bhyve/inout.h
AM   usr.sbin/bhyve/pci_lpc.c
AM   usr.sbin/bhyve/pci_lpc.h

10 years agoFix condition that determines PMAP_NEEDS_PTE_SYNC value for ARM
zbb [Mon, 28 Oct 2013 23:42:44 +0000 (23:42 +0000)]
Fix condition that determines PMAP_NEEDS_PTE_SYNC value for ARM

Use values of the correct defines to determine statement's result.
ARM_ARCH_ symbols are always defined, hence only values are relevant.

Reviewed by: cognet

10 years agoProvide necessary includes.
glebius [Mon, 28 Oct 2013 23:34:05 +0000 (23:34 +0000)]
Provide necessary includes.

10 years agoProvide necessary includes that before came via if.h.
glebius [Mon, 28 Oct 2013 23:17:41 +0000 (23:17 +0000)]
Provide necessary includes that before came via if.h.

10 years agoClean up a spurious "." in SEE ALSO.
brueffer [Mon, 28 Oct 2013 23:02:12 +0000 (23:02 +0000)]
Clean up a spurious "." in SEE ALSO.

MFC after: 3 days

10 years agoNew sentence -> new line and some mdoc cleanup.
brueffer [Mon, 28 Oct 2013 22:54:28 +0000 (22:54 +0000)]
New sentence -> new line and some mdoc cleanup.

MFC after: 3 days

10 years ago- Provide necessary includes, that before came via if.h pollution.
glebius [Mon, 28 Oct 2013 22:26:03 +0000 (22:26 +0000)]
- Provide necessary includes, that before came via if.h pollution.
- Remove unnecessary ones.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years agoSwitch off explicit broadcasting of the TLB flush operations for PJ4B CPU
zbb [Mon, 28 Oct 2013 21:41:44 +0000 (21:41 +0000)]
Switch off explicit broadcasting of the TLB flush operations for PJ4B CPU

Since CPU_MV_PJ4B describes ARMv7 compliant CPU there is no need for
sending an IPI each time when TLB is flushed in any way.

Tested by: kevlo

10 years agoRemove not working and deprecated PJ4Bv6 support
zbb [Mon, 28 Oct 2013 21:39:54 +0000 (21:39 +0000)]
Remove not working and deprecated PJ4Bv6 support

Sheeva PJ4Bv6 - based chips were only prototypes for V7 class Armada
SoC family. Current in-tree support for PJ4Bv6 will not work and also
there should be no platforms in active use that would incorporate that
CPU revision.

10 years agoChange Armada XP kernel load address to the u-boot's end address
zbb [Mon, 28 Oct 2013 21:37:45 +0000 (21:37 +0000)]
Change Armada XP kernel load address to the u-boot's end address

Loading kernel to 0xf00000 has no practical reason.
Starting it from the u-boot's highest possible end address
(2MB counting from 0x0) makes more sense.

Tested by: kevlo

10 years agoFix-up DTB for Armada XP registers' base according to the actual settings
zbb [Mon, 28 Oct 2013 21:34:32 +0000 (21:34 +0000)]
Fix-up DTB for Armada XP registers' base according to the actual settings

Depending on u-boot's flavor some boards have their SoC registers
base address configured to 0xD0000000 and other to 0xF1000000.
U-boot is passing currently set value via CP15 register.
In order to create proper mapping for SoC registers and allow further
successful initialization it is necessary to replace fdt_immr_pa with
the real value and eventually fix-up device tree blob.

Tested by: kevlo

10 years agoRemove hard-coded mappings related to Armada XP support
zbb [Mon, 28 Oct 2013 21:31:12 +0000 (21:31 +0000)]
Remove hard-coded mappings related to Armada XP support

Armada XP initialization flow requires SoC registers to be
mapped very early in order to configure Snoop Filter for SMP.
Additional mapping in locore.S is redundant as proper mapping is
made in pmap_devmap_bootstrap() prior to calling cpu_setup() which
configures the Snoop Filter.
For secondaru CPUs it is better to pass VA of the SoC
registers defined in MV_BASE and PA consistent with the value
in the Device Tree.

Tested by: kevlo

10 years agoInclude XEN and HyperV into amd64 LINT.
glebius [Mon, 28 Oct 2013 21:11:28 +0000 (21:11 +0000)]
Include XEN and HyperV into amd64 LINT.

10 years agoRemove dead function show_device(). It isn't buildable if DEBUG is
glebius [Mon, 28 Oct 2013 21:09:59 +0000 (21:09 +0000)]
Remove dead function show_device(). It isn't buildable if DEBUG is
defined, due to unknown field "xn_ifno".  The field wasn't known
since beginning of history of this file.

10 years agoInclude if_var.h.
glebius [Mon, 28 Oct 2013 21:08:04 +0000 (21:08 +0000)]
Include if_var.h.

10 years agoFis the value of *optlen when calling getsockopt() for
tuexen [Mon, 28 Oct 2013 20:45:19 +0000 (20:45 +0000)]
Fis the value of *optlen when calling getsockopt() for
SCTP_REMOTE_UDP_ENCAPS_PORT.
This issue was reported by Andrew Galante.
MFC after: 3 days

10 years agoG/c unused mountrootfsname.
pluknet [Mon, 28 Oct 2013 20:38:17 +0000 (20:38 +0000)]
G/c unused mountrootfsname.
It was replaced with rootdevnames in r52778.

10 years agoFix compilation if SCTP_DONT_DO_PRIVADDR_SCOPE is defined.
tuexen [Mon, 28 Oct 2013 20:32:37 +0000 (20:32 +0000)]
Fix compilation if SCTP_DONT_DO_PRIVADDR_SCOPE is defined.
The issue was reported by Andrew Galante.

MFC after: 3 days

10 years agoStyle: s/SYS_EVENTHANDLER_H/_SYS_EVENTHANDLER_H_/g
glebius [Mon, 28 Oct 2013 20:32:05 +0000 (20:32 +0000)]
Style: s/SYS_EVENTHANDLER_H/_SYS_EVENTHANDLER_H_/g

Submitted by: bde

10 years agoInclude <sys/ktr.h>, since we need it if ATH_DEBUG is defined.
cognet [Mon, 28 Oct 2013 20:26:34 +0000 (20:26 +0000)]
Include <sys/ktr.h>, since we need it if ATH_DEBUG is defined.

10 years agoAdd a couple includes if net/if_var.h that were missed in r257176.
brooks [Mon, 28 Oct 2013 20:15:59 +0000 (20:15 +0000)]
Add a couple includes if net/if_var.h that were missed in r257176.

10 years agoEnable the --sysroot=/foo option in ld by always building with a sysroot
brooks [Mon, 28 Oct 2013 19:56:46 +0000 (19:56 +0000)]
Enable the --sysroot=/foo option in ld by always building with a sysroot
defined. When not building as a cross linker, the sysroot is set to "/".

Exp-run by: bdrewery (ports/183206)
MFC after: 3 days

10 years agoRemove redundand assignment to error variable and check for its value [1].
kib [Mon, 28 Oct 2013 19:30:09 +0000 (19:30 +0000)]
Remove redundand assignment to error variable and check for its value [1].
Do CTR logging in the case of error as well.

Noted by: rdivacky [1]
Sponsored by: The FreeBSD Foundation
MFC after: 1 month

10 years agoFollow r257244; it's now necessary to include if_var.h.
ian [Mon, 28 Oct 2013 18:43:00 +0000 (18:43 +0000)]
Follow r257244; it's now necessary to include if_var.h.

10 years agoQueisce two category of clang warnings:
sbruno [Mon, 28 Oct 2013 18:24:31 +0000 (18:24 +0000)]
Queisce two category of clang warnings:

1.  missing explicit includes for string.h, stdio.h, etc
2.  missing explicit declaration for some common functions

I have been unable to contact the upstream maintainer for this patch,
http://www.inner.net/opie appears to be the source of truth but it
unreachable

10 years agoQuiesce warnings -Wdangling-else
sbruno [Mon, 28 Oct 2013 18:10:35 +0000 (18:10 +0000)]
Quiesce warnings -Wdangling-else

Thanks to jilles for some reviews and tips.

10 years agorepair build for dev/cs.
sbruno [Mon, 28 Oct 2013 16:27:01 +0000 (16:27 +0000)]
repair build for dev/cs.

Reported by: Outback Dingo <outbackdingo@gmail.com>

10 years agoRemove more remnants of ng_fec(4).
glebius [Mon, 28 Oct 2013 16:21:31 +0000 (16:21 +0000)]
Remove more remnants of ng_fec(4).

The ng_create_one() and ng_mkpeer() functions in network.subr are
now not used anywhere, but I left them, since they can be useful
in future in netgraph scripting.

Submitted by: pluknet

10 years agoRemove ng_fec.4
glebius [Mon, 28 Oct 2013 15:38:26 +0000 (15:38 +0000)]
Remove ng_fec.4

Submitted by: Dmitry Luhtionov <dmitryluhtionov gmail.com>

10 years agoSweep up a bit of arm-land fallout after r257244; include necessary
ian [Mon, 28 Oct 2013 15:20:17 +0000 (15:20 +0000)]
Sweep up a bit of arm-land fallout after r257244; include necessary
headers directly that are no longer available via accidental include.

10 years agoRemove ng_fec(4).
glebius [Mon, 28 Oct 2013 15:17:41 +0000 (15:17 +0000)]
Remove ng_fec(4).

10 years agoFix build. We need to include systm.h before if_var.h.
glebius [Mon, 28 Oct 2013 15:11:37 +0000 (15:11 +0000)]
Fix build. We need to include systm.h before if_var.h.

Pointy hat to: glebius

10 years agoRemove ng_fec(4).
glebius [Mon, 28 Oct 2013 14:52:08 +0000 (14:52 +0000)]
Remove ng_fec(4).

10 years agoRemove ng_fec(4).
glebius [Mon, 28 Oct 2013 14:47:33 +0000 (14:47 +0000)]
Remove ng_fec(4).

10 years agoImport the driver for VT-d DMAR hardware, as specified in the revision
kib [Mon, 28 Oct 2013 13:33:29 +0000 (13:33 +0000)]
Import the driver for VT-d DMAR hardware, as specified in the revision
1.3 of Intelб╝ Virtualization Technology for Directed I/O Architecture
Specification.  The Extended Context and PASIDs from the rev. 2.2 are
not supported, but I am not aware of any released hardware which
implements them.  Code does not use queued invalidation, see comments
for the reason, and does not provide interrupt remapping services.

Code implements the management of the guest address space per domain
and allows to establish and tear down arbitrary mappings, but not
partial unmapping.  The superpages are created as needed, but not
promoted.  Faults are recorded, fault records could be obtained
programmatically, and printed on the console.

Implement the busdma(9) using DMARs.  This busdma backend avoids
bouncing and provides security against misbehaving hardware and driver
bad programming, preventing leaks and corruption of the memory by wild
DMA accesses.

By default, the implementation is compiled into amd64 GENERIC kernel
but disabled; to enable, set hw.dmar.enable=1 loader tunable.  Code is
written to work on i386, but testing there was low priority, and
driver is not enabled in GENERIC.  Even with the DMAR turned on,
individual devices could be directed to use the bounce busdma with the
hw.busdma.pci<domain>:<bus>:<device>:<function>.bounce=1 tunable.  If
DMARs are capable of the pass-through translations, it is used,
otherwise, an identity-mapping page table is constructed.

The driver was tested on Xeon 5400/5500 chipset legacy machine,
Haswell desktop and E5 SandyBridge dual-socket boxes, with ahci(4),
ata(4), bce(4), ehci(4), mfi(4), uhci(4), xhci(4) devices.  It also
works with em(4) and igb(4), but there some fixes are needed for
drivers, which are not committed yet.  Intel GPUs do not work with
DMAR (yet).

Many thanks to John Baldwin, who explained me the newbus integration;
Peter Holm, who did all testing and helped me to discover and
understand several incredible bugs; and to Jim Harris for the access
to the EDS and BWG and for listening when I have to explain my
findings to somebody.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

10 years agong_fec(4) removed.
glebius [Mon, 28 Oct 2013 12:49:07 +0000 (12:49 +0000)]
ng_fec(4) removed.

10 years agoAxe ng_fec(4). It has never been a real netgraph(4) module, since
glebius [Mon, 28 Oct 2013 12:47:05 +0000 (12:47 +0000)]
Axe ng_fec(4). It has never been a real netgraph(4) module, since
it had no hooks. It has abused ifnet's if_afdata slot and actually
abused every subsystem it touched.

lagg(4) is a proper trunking solution at ifnet(9) layer.

ng_one2many(4) is a proper trunking solution in netgraph(4).

10 years agoFix the build with gcc.
markj [Mon, 28 Oct 2013 12:42:27 +0000 (12:42 +0000)]
Fix the build with gcc.

10 years ago- Fix VIMAGE build.
glebius [Mon, 28 Oct 2013 10:12:19 +0000 (10:12 +0000)]
- Fix VIMAGE build.
- Fix build with gcc.

10 years ago- Make the prophecy from 1997 happen and remove if_var.h inclusion
glebius [Mon, 28 Oct 2013 08:03:40 +0000 (08:03 +0000)]
- Make the prophecy from 1997 happen and remove if_var.h inclusion
  from if.h.
- Remove unnecessary includes and declarations from if.h
- Remove unnecessary includes and declarations from if_var.h [1]
- Mark some declarations that are about to be removed in near
  future with comments, explaning why this declaration is still
  necessary.
- Protect eventhandler declarations with #ifdef SYS_EVENTHANDLER_H.

Obtained from: bdeBSD [1]
Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years agoInstead of putting ifnet declaration into eventhandler.h, move
glebius [Mon, 28 Oct 2013 07:45:03 +0000 (07:45 +0000)]
Instead of putting ifnet declaration into eventhandler.h, move
bpf(4) and vlan(4) related event declarations to bpf.h and
if_vlan_var.h. To avoid dependency on eventhandler.h, protect
these declarations with ifdef SYS_EVENTHANDLER_H.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years agoInclude necessary headers that now are available due to pollution
glebius [Mon, 28 Oct 2013 07:29:16 +0000 (07:29 +0000)]
Include necessary headers that now are available due to pollution
via if_var.h.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

10 years agoRun mvs SATA driver on Armada XP instead of old mv_sata
zbb [Mon, 28 Oct 2013 07:18:24 +0000 (07:18 +0000)]
Run mvs SATA driver on Armada XP instead of old mv_sata

The mvs driver seems to be more functional than mv_sata and is not
causing random interrupt storms during boot.

10 years agoCorrect ld(1) manual page for --no-add-needed set as default after r253839
rea [Mon, 28 Oct 2013 05:55:47 +0000 (05:55 +0000)]
Correct ld(1) manual page for --no-add-needed set as default after r253839

Approved by: dim
MFC after: 2 weeks

10 years agoQuiesce warning -Wmissing-variable-declarations from buildworld, which is
sbruno [Mon, 28 Oct 2013 02:36:34 +0000 (02:36 +0000)]
Quiesce warning -Wmissing-variable-declarations from buildworld, which is
slightly unnerving.

In file included from ioctl.c:48:
/var/tmp/home/sbruno/bsd/head/tmp/usr/include/dev/lmc/if_lmc.h:939:13:
warning: no previous extern declaration for non-static variable 'ssi_cables'
[-Wmissing-variable-declarations]
const char *ssi_cables[] =

10 years agoRemove an incorrect debug printf.
markj [Mon, 28 Oct 2013 01:41:59 +0000 (01:41 +0000)]
Remove an incorrect debug printf.

10 years agoWith r247602, the "c" flag is no longer printed as a file descriptor flag.
markj [Mon, 28 Oct 2013 00:20:30 +0000 (00:20 +0000)]
With r247602, the "c" flag is no longer printed as a file descriptor flag.

Reviewed by: pjd
MFC after: 3 days

10 years agoUse the size of the MACHINE_ARCH string instead of sizeof(uint32_t). It can
cognet [Sun, 27 Oct 2013 23:48:59 +0000 (23:48 +0000)]
Use the size of the MACHINE_ARCH string instead of sizeof(uint32_t). It can
happen sizeof(MACHINE_ARCH) is more than 4 bytes, and bad things would
happen. This should make the ctors being called again on armeb.

10 years agoMake sure the PCB is aligned on 8 bytes, we may use ldrd/strd to access it,
cognet [Sun, 27 Oct 2013 22:15:50 +0000 (22:15 +0000)]
Make sure the PCB is aligned on 8 bytes, we may use ldrd/strd to access it,
which may have strong alignment requirements.

10 years agoAdd a virtual table for the busdma methods on x86, to allow different
kib [Sun, 27 Oct 2013 22:05:10 +0000 (22:05 +0000)]
Add a virtual table for the busdma methods on x86, to allow different
busdma implementations to coexist.  Copy busdma_machdep.c to
busdma_bounce.c, which is still a single implementation of the busdma
interface on x86 for now.  The busdma_machdep.c only contains common
and dispatch code.

Tested by: pho (as part of the larger patch)
Sponsored by: The FreeBSD Foundation
MFC after: 1 month

10 years agoAdd bus_dmamap_load_ma() function to load map with the array of
kib [Sun, 27 Oct 2013 21:39:16 +0000 (21:39 +0000)]
Add bus_dmamap_load_ma() function to load map with the array of
vm_pages.  Provide trivial implementation which forwards the load to
_bus_dmamap_load_phys() page by page.  Right now all architectures use
bus_dmamap_load_ma_triv().

Tested by: pho (as part of the functional patch)
Sponsored by: The FreeBSD Foundation
MFC after: 1 month

10 years agoImport pf_print_state.c 1.54 from OpenBSD
bapt [Sun, 27 Oct 2013 21:07:37 +0000 (21:07 +0000)]
Import pf_print_state.c 1.54 from OpenBSD

Original log:
pfctl -ss printed state levels for ICMPv6. Disable this the same
way it has already been done for ICMPv4.

Difference with OpenBSD:
- WITHOUT_INET6 safe

Obtained from: OpenBSD

10 years agoedquota: Don't pass fd for temporary file to editor.
jilles [Sun, 27 Oct 2013 21:06:17 +0000 (21:06 +0000)]
edquota: Don't pass fd for temporary file to editor.

The editor opens the temporary file by name.

10 years agoImport pf.c 1.638 from OpenBSD
bapt [Sun, 27 Oct 2013 20:56:23 +0000 (20:56 +0000)]
Import pf.c 1.638 from OpenBSD

Original log:
Some ICMP types that also have icmp_id, pointed out by markus@

Obtained from: OpenBSD

10 years agoImprot pf.c 1.636 from OpenBSD
bapt [Sun, 27 Oct 2013 20:52:09 +0000 (20:52 +0000)]
Improt pf.c 1.636 from OpenBSD

Original log:
Make sure pd2 has a pointer to the icmp header in the payload; fixes
panic seen with some some icmp types in icmp error message payloads.

Obtained from: OpenBSD

10 years agoImport pf.c 1.635 and pf_lb.c 1.4 from OpenBSD
bapt [Sun, 27 Oct 2013 20:44:42 +0000 (20:44 +0000)]
Import pf.c 1.635 and pf_lb.c 1.4 from OpenBSD

Stricter state checking for ICMP and ICMPv6 packets: include the ICMP type

in one port of the state key, using the type to determine which
side should be the id, and which should be the type. Also:
- Handle ICMP6 messages which are typically sent to multicast
  addresses but recieve unicast replies, by doing fallthrough lookups
  against the correct multicast address.  - Clear up some mistaken
  assumptions in the PF code:
- Not all ICMP packets have an icmp_id, so simulate
  one based on other data if we can, otherwise set it to 0.
  - Don't modify the icmp id field in NAT unless it's echo
  - Use the full range of possible id's when NATing icmp6 echoy

Difference with OpenBSD version:
- C99ify the new code
- WITHOUT_INET6 safe

Reviewed by: glebius
Obtained from: OpenBSD

10 years agoClean up the debug printing in libproc a bit. In particular:
markj [Sun, 27 Oct 2013 20:39:10 +0000 (20:39 +0000)]
Clean up the debug printing in libproc a bit. In particular:

* Don't print any error messages to stderr unless DEBUG is defined.
* Add a DPRINTFX macro for use when errno isn't set.
* Print the error string from libelf when appropriate.

10 years agoFix typo.
kib [Sun, 27 Oct 2013 18:52:09 +0000 (18:52 +0000)]
Fix typo.

MFC after: 3 days

10 years agoProvide forward declaration for struct ifnet. Consumers
glebius [Sun, 27 Oct 2013 17:27:06 +0000 (17:27 +0000)]
Provide forward declaration for struct ifnet. Consumers
of this header don't need contents of struct.

10 years agoAlmost all if_clone consumers do not care about if_clone_event.
glebius [Sun, 27 Oct 2013 17:14:33 +0000 (17:14 +0000)]
Almost all if_clone consumers do not care about if_clone_event.
Do not force them to include sys/eventhandler.h. Those who
utilize EVENTHANDLER(9), will see the declaration.

10 years agoInclude lock.h before mutex.h.
glebius [Sun, 27 Oct 2013 17:12:31 +0000 (17:12 +0000)]
Include lock.h before mutex.h.

10 years agoRemove the last dregs of trapframe_t. It turns out only arm was using
ian [Sun, 27 Oct 2013 17:09:23 +0000 (17:09 +0000)]
Remove the last dregs of trapframe_t.  It turns out only arm was using
this type, so remove it to make arm code more consistant with other
platforms.  Thanks to bde@ for pointing out only arm used trapframe_t.

10 years agoSeveral small fixes for the amd64 minidump code.
kib [Sun, 27 Oct 2013 16:31:12 +0000 (16:31 +0000)]
Several small fixes for the amd64 minidump code.

In report_progress(), use nitems(progress_track) instead of manually
hard-coding array size.  Wrap long line.

In blk_write(), code verifies that ptr and pa cannot be non-zero
simultaneously.  The later check for the page-alignment of the ptr
argument never triggers due to pa != 0 always implying ptr == NULL.  I
believe that the intent was to ensure that physicall address passed is
page-aligned, since the address is (temporary) mapped for the duration
of the page write.

Clear the progress_track.visited fields when starting minidump.  If
minidump is restarted or taken second time during the system lifetime,
progress is not printed otherwise, making operator suspectible to the
dump status.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

10 years agoMove new pf includes to the pf directory. The pfvar.h remain
glebius [Sun, 27 Oct 2013 16:25:57 +0000 (16:25 +0000)]
Move new pf includes to the pf directory. The pfvar.h remain
in net, to avoid compatibility breakage for no sake.

The future plan is to split most of non-kernel parts of
pfvar.h into pf.h, and then make pfvar.h a kernel only
include breaking compatibility.

Discussed with: bz