Commit Graph

95635 Commits

Author SHA1 Message Date
Marcel Moolenaar
e3eb23c502 Use LOG2_ID_PAGE_SIZE again for the identity mapping in regions 6 & 7.
Make the default translation size the same as the PBVM page size to
avoid inserting overlapping translations in the TC. That generally is
very bad.
2013-11-01 01:32:01 +00:00
Ian Lepore
36aed22abd Add dts source for imx6 SoCs and for Wandboard boards.
The imx6.dtsi is incomplete, but has enough to support devices that work
right now.  Eventually it will need to be split into several files that
account for the differences between SoCs in the imx6 family.

The board config for Wandboard Dual is untested.  Solo and Quad work, but
one one core is turned on for the quad right now (baby steps).
2013-11-01 00:45:08 +00:00
Marcel Moolenaar
fde9169e11 The PAL_PTCE_INFO function returns the counts and strides of the
outer and inner loop as 32-bit integers mux'd in 64-bit return
values. Change our data types for the count and stride to match
and simplify/adjust accordingly.
Note that with this change the defaults of the ptc.e parameters
have changed. Since all hardware is supposed to support the PAL
call, there should be no impact. Even ski is unaffected, because
the TC is re-initialized without considering the virtual address.
So, as long as we call ptc.e at least once, we're good. That's
what the new defaults do.
Most processor implementations need but a single ptc.e to purge
the entire TC anyway...
2013-11-01 00:21:38 +00:00
Ian Lepore
034e9ed611 Add the Soc- / machine-dependent parts of imx6 support. 2013-11-01 00:21:09 +00:00
Alexander Motin
9813c936c4 Fix lock recursion, triggered by smartctl -a /dev/adaX. 2013-11-01 00:14:15 +00:00
Ian Lepore
8ef18b3b15 Convert the if/else list of compatible devices to the table-driven
ofw_bus_search_compatible() routine.  In addition to converting existing
strings to table entries, also add compat strings for the whole imx family.
2013-10-31 23:57:33 +00:00
Ian Lepore
3d9d5b4313 Add definitions for the register and data that describes the SoC type.
This isn't in the chip reference manuals, it was found in u-boot and
various old mailing list threads.
2013-10-31 23:08:30 +00:00
Marcel Moolenaar
3598d9555a Purge the translation cache of APs before we unleash them. To that
end, make pmap_invalidate_all() global and have it only handle the
local CPU -- i.e. no rendezvous. We do not use pmap_invalidate_all
other than during initialization.
Note that the BSP already purges its TC -- it was missing for APs
only. Nonetheless, this so far seems to eliminate random problems.
2013-10-31 23:06:04 +00:00
Ian Lepore
f955880f7b Revamp the SoC identity numbering scheme to be more in line with the way
Freescale numbers the chips in the ID registers.
2013-10-31 23:05:05 +00:00
Marcel Moolenaar
ec9b648ef8 Respect the kern.smp.disabled tunable. When we're scanning the MADT in
ia64_probe_sapics(), we also create PCPU structures for any Local SAPICs
we encounter. When SMP is disabled, this leaves us with partially setup
PCPU structures, which typically results in panics when we're iterating
over CPUs. When SMP is disabled, we now prevent the creation of the
PCPU structures.
2013-10-31 22:46:03 +00:00
Andreas Tobler
12e7de228a Ouch, do the shift properly. An uin64_t needs the right postfix when shifting. 2013-10-31 20:42:47 +00:00
Maksim Yevmenkin
f7a3a2a57c Rate limit (to once per minute) "Listen queue overflow" message in
sonewconn().

Reviewed by:	scottl, lstewart
Obtained from:	Netflix, Inc
MFC after:	2 weeks
2013-10-31 20:33:21 +00:00
Andre Oppermann
5b74cfe42f Make struct ifnet readable and comprehensible again by grouping
and ordering related variables, fields and locks next to each
other.  Add more comments to variables.

Over time 'ifnet' has accumlated a lot of additional pointers and
functionality in an unstructured way making it quite hard to read
and understand while obfuscating relationships between fields and
variables.

Quantify the structure size and how bloated it has become.

This is only a mechanical change in preparation for upcoming
work to make ifnet opaque to drivers and to separate out the
interface queuing.

Sponsored by:	The FreeBSD Foundation
2013-10-31 15:46:10 +00:00
Ian Lepore
7352de58e8 Add sdhci driver glue for imx family SoCs. This should support both uSDHC
(newer SoCs) and eSDHC (older SoCs), but the eSDHC support is untested and
likely to need some tweaking.
2013-10-31 15:27:39 +00:00
Ian Lepore
9808ebfa39 Add stubbed-out imx6 support for clocks and power management. This
contains little more than a few stub functions required to keep the
linker happy, but it's enough to let early imx6 development proceed.
2013-10-31 15:04:23 +00:00
Ian Lepore
c8c16b3df2 Add support for the USB PHY on imx6 SoCs. Pretty minimal at this point,
but enough to get usb host mode working.
2013-10-31 14:52:06 +00:00
Adrian Chadd
c48efaecf6 Allow the Arduino Leonardo to work by supporting CDC=0 devices.
CDC=0 simply means "no command codes", CDC=1 means "AT command codes."
There's no driver change required!  It's purely to tell the application
layer whether to speak AT commands or not.  Things are all still serial.

PR:		usb/183505
Reviewed by:	hps
MFC after:	1 week
2013-10-31 13:54:51 +00:00
Hans Petter Selasky
645826bef4 Fix a potential memory leak.
MFC after:	1 week
2013-10-31 11:03:36 +00:00
Hans Petter Selasky
35a2489852 Fix some types. Compilation for external target complains that "u_int"
is not idential to "uint32_t" when defining set channel prototype
functions. The WLAN channel range should be from 0 to 65535
inclusivly, and u_int should be fine for this purpose.
2013-10-31 09:20:30 +00:00
Neel Natu
513c8d338d Rename the VMM_CTRx() family of macros to VCPU_CTRx() to highlight that these
tracepoints are vcpu-specific.

Add support for tracepoints that are global to the virtual machine - these
tracepoints are called VM_CTRx().
2013-10-31 05:20:11 +00:00
Gleb Smirnoff
a9b3c1bf05 Provide a crutch that prevents watchdog to interrupt dumping
on a box with IPMI enabled.

Okay from:	jhb
Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-31 05:13:53 +00:00
Mark Johnston
be09cd5706 Fix some lingering build failures caused by fixing implicit inclusion of
if_var.h. Also explicitly include lock.h and mutex.h in if_kr.c rather than
depending on if_var.h to bring them in.
2013-10-31 05:00:50 +00:00
Ian Lepore
425a5c7900 Do not EOI an interrupt until the point after the filter handlers / before
threaded handlers.

It's not easy to see from the diffs of this change exactly how it
accomplishes the above.  The arm_mask_irq() and arm_unmask_irq() functions
are, respectively, the pre_thread and post_thread hooks.  Not seen in
these diffs, the arm_post_filter() routine also EOIs.  The post_filter
routine runs after filter handlers if there will be no threaded handlers,
so it just EOIs.  The pre_thread routine masks the interrupt (at the
controller, not the source) and EOIs.  So one way or another, the EOI
happens at the point where filter handlers are done.
2013-10-31 03:23:25 +00:00
Ian Lepore
adcea15135 Don't iterate through the bits of the pending interrupt register if the
whole register is zero.  Most of the registers will be zero most of the time.
2013-10-31 03:12:48 +00:00
Mark Johnston
57170f49f2 Remove references to an unused fasttrap probe hook, and remove the
corresponding x86 trap type. Userland DTrace probes are currently handled
by the other fasttrap hooks (dtrace_pid_probe_ptr and
dtrace_return_probe_ptr).

Discussed with:	rpaulo
2013-10-31 02:35:00 +00:00
Mark Johnston
9f6f3311f4 Fix a typo introduced in r257338. 2013-10-31 02:27:16 +00:00
Adrian Chadd
cea884bf7d Don't base the rate table selection based on the channel mode;
it needs to check whether there are rate entries in there or not.

PR:		kern/183428
2013-10-31 02:21:48 +00:00
Rui Paulo
74678000dc Enable USB. 2013-10-31 02:14:28 +00:00
Ian Lepore
54fe60971c Reset the timer interrupt status register at the top rather than bottom of
the interrupt handler.  If the event callback starts a new short timeout,
the timer can fire before returning from the event callback, and clearing
the interrupt status after that loses the interrupt and hangs until the
counter wraps.  Fixing all of this removes the need for the do-nothing
loop at the top of the handler which really just waited for the counter to
roll over and reach the one-shot count again.

Also add a missing return(0) in the periodic timer start case.
2013-10-31 02:11:35 +00:00
Adrian Chadd
7f0660a04b Don't treat the node as an 11n node if 11n rates are disabled.
For now, the AMRR code only knows about _either_ MCS or non-MCS rates.
It doesn't know how to downgrade (ie, doing 11b CCK rates if MCS0 isn't
reliable.)

PR:		kern/183428
2013-10-31 02:04:53 +00:00
Kevin Lo
30dfa97944 Add RT2860_BCN_OFFSET1 and RT2860_MAX_LEN_CFG register initialization to
match with the vendor driver.  While here, remove unused RT2860_DEF_MAC
definition.
2013-10-31 02:03:30 +00:00
Kevin Lo
1365315d41 Initialize BBP68 to improve rx sensitivity. 2013-10-31 02:02:14 +00:00
Kevin Lo
c513ecfd12 Enable DC filter in RT3071 Version E. 2013-10-31 02:00:58 +00:00
Ian Lepore
eb756ebd94 Expand the list of compatible devices this driver works with. Increase
the target frequency from 1 to 10 MHz because these SoCs are plenty fast
enough to benefit from the extra event timer resolution.
2013-10-31 01:45:55 +00:00
Ian Lepore
f26c810514 Rework the imx ehci driver so that it's four separate ehci units rather
than one unit with four busses attached to it.  This allows us to use
existing fdt data which describes separate devices with separate resources.
It also allows any combination of the units to be en/disabled in the
board dts files.

Adjust our dts code to match what's used by linux and u-boot now that
we're structured to do so.

Document lots of interesting stuff learned whiling doing this with a big
comment block in the driver, so I don't have to re-learn it for the next
round of changes.
2013-10-30 18:26:18 +00:00
Sergey Kandaurov
3860c4e618 Include the now missing headers after untangling if.h and if_var.h.
This fixes pc98 build.

Reviewed by:	andre
2013-10-30 17:55:31 +00:00
Andre Oppermann
a742d143c7 nclude missing net/if_var.h.
Due to header pollution it wasn't noticed before.
2013-10-30 16:56:46 +00:00
Ian Lepore
22aa1751eb Add a vendor entry for Freescale Semiconductor. 2013-10-30 16:34:26 +00:00
Ian Lepore
bc9a95c8c6 Add a "no-op" USB PHY driver for imx-family SoCs. This is used when the
phy clocks need to be enabled, but no other hardware setup is needed to
make the phy work.
2013-10-30 14:38:24 +00:00
Ian Lepore
baf7f63f9a Add some bare-bones support for enabling usb and usbphy clocks. This
is temporary code to keep imx development moving forward for now.  In
the long run we need a SoC-independant clock management API.
2013-10-30 14:33:15 +00:00
Nathan Whitehorn
abe8350519 printf() specifier updates to CAM to handle either 32-bit or 64-bit lun_id_t.
MFC after:	2 weeks
2013-10-30 14:13:15 +00:00
Nathan Whitehorn
123055f01f Adjust various SCSI drivers to handle either a 32-bit or 64-bit lun_id_t,
mostly by adjustments to debugging printf() format specifiers. For high
numbered LUNs, also switch to printing them in hex as per SAM-5.

MFC after: 2 weeks
2013-10-30 14:04:47 +00:00
Nathan Whitehorn
87cb964b92 Fix typo. Sorry! 2013-10-29 23:55:17 +00:00
Xin LI
49796c6f56 Don't reference pointer before testing whether it is
NULL.

Submitted by:	Clement Lecigne <clecigne google com>
Reviewed by:	grehan
MFC after:	3 days
2013-10-29 22:42:30 +00:00
Nathan Whitehorn
453319bf53 The ofw_bus() routines invoke the device's parent, not the device itself,
so cease iterating when the parent is NULL, not when the device is.

MFC after:	5 days
2013-10-29 21:08:20 +00:00
Nathan Whitehorn
a5c296c5c5 Panics about how things can't be attached should probably happen in the
attach method rather than probe.

Submitted by:	brooks
2013-10-29 20:38:58 +00:00
Michael Tuexen
6ed728108a Terminate a debug output with a \n. 2013-10-29 20:04:50 +00:00
Andre Oppermann
ded7d20fc5 Move all interface queue related structures, macros and definitions
from net/if_var to it own new net/ifq.h.

For now net/ifq.h is unconditionally included through net/if_var.h.

This is a mechanical change in preparation to make struct ifnet and
the individual interface queue mechanisms opaque.

Discussed with:	glebius
Sponsored by:	The FreeBSD Foundation
2013-10-29 17:48:08 +00:00
Luiz Otavio O Souza
3d02237c46 Fix the build of TP-WN1043ND kernel. Provide necessary includes and remove
unnecessary includes for rtl8366rb.

Approved by:	adrian (mentor)
2013-10-29 15:45:11 +00:00
Nathan Whitehorn
ef5758fa10 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
2013-10-29 15:36:58 +00:00
Nathan Whitehorn
cd43f427f6 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.
2013-10-29 14:44:36 +00:00
Nathan Whitehorn
e5bcdd7960 A few last BUS_PROBE_NOWILDCARDs are in order. 2013-10-29 14:32:33 +00:00
Nathan Whitehorn
feeec74df7 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.
2013-10-29 14:19:42 +00:00
Nathan Whitehorn
5543a1b98e 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
2013-10-29 14:07:31 +00:00
Nathan Whitehorn
f0919d9edf Hints-only devices should return BUS_PROBE_NOWILDCARD from their probe
methods.
2013-10-29 13:52:05 +00:00
Nathan Whitehorn
ccc1cefe83 These nexus attachments do not execute a real probe and so need
BUS_PROBE_NOWILDCARD set.
2013-10-29 13:48:41 +00:00
Nathan Whitehorn
b665cfc0f5 Hints-only devices should have BUS_PROBE_NOWILDCARD set. We probably need
a better flag for this (in the driver metadata, for example).
2013-10-29 13:43:09 +00:00
Zbigniew Bodek
bd422cef88 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
2013-10-29 13:16:05 +00:00
Randall Stewart
6f1dba186e Opps, my kirkwood fix for the dreamplug missed this. 2013-10-29 11:28:11 +00:00
Gleb Smirnoff
8d7cf9b5d4 Uninline inm_lookup_locked(). Now in_var.h doesn't dereference
fields of struct ifnet.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-29 11:21:31 +00:00
Gleb Smirnoff
66e01d73cd - Provide necessary includes.
- Remove unnecessary includes.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-29 11:17:49 +00:00
Konstantin Belousov
4ad0991f6a 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
2013-10-29 07:25:54 +00:00
Pyun YongHyeon
5aefcb0b42 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)
2013-10-29 06:37:27 +00:00
Pyun YongHyeon
c3767eab77 Add preliminary support for RTL8168EP.
Submitted by:	Edward O'Callaghan (eocallaghan <> alterapraxis dot com)
2013-10-29 05:37:05 +00:00
Pyun YongHyeon
ab9f923ebf 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.
2013-10-29 05:30:21 +00:00
Pyun YongHyeon
cd10b400a6 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.
2013-10-29 05:14:38 +00:00
Adrian Chadd
e15cc8dca6 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
2013-10-29 04:03:00 +00:00
Rui Paulo
4219857759 Digi-CCWMX53: enable ffec and uart. 2013-10-29 03:42:43 +00:00
Neel Natu
e2f5d9a129 Remove unnecessary includes of <machine/pmap.h>
Requested by:	alc@
2013-10-29 02:25:18 +00:00
Nathan Whitehorn
f7d6cb2081 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
2013-10-29 00:53:17 +00:00
Zbigniew Bodek
0efe42a2e3 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
2013-10-28 23:42:44 +00:00
Gleb Smirnoff
d6a773db08 Provide necessary includes. 2013-10-28 23:34:05 +00:00
Gleb Smirnoff
578dab364e Provide necessary includes that before came via if.h. 2013-10-28 23:17:41 +00:00
Gleb Smirnoff
104dc21415 - Provide necessary includes, that before came via if.h pollution.
- Remove unnecessary ones.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-28 22:26:03 +00:00
Zbigniew Bodek
2923b75ea3 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
2013-10-28 21:41:44 +00:00
Zbigniew Bodek
e0b4b3a74f 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.
2013-10-28 21:39:54 +00:00
Zbigniew Bodek
d7b0107591 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
2013-10-28 21:37:45 +00:00
Zbigniew Bodek
67c3c19d0a 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
2013-10-28 21:34:32 +00:00
Zbigniew Bodek
77f3266653 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
2013-10-28 21:31:12 +00:00
Gleb Smirnoff
69eb2b176c Include XEN and HyperV into amd64 LINT. 2013-10-28 21:11:28 +00:00
Gleb Smirnoff
6483a98b43 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.
2013-10-28 21:09:59 +00:00
Gleb Smirnoff
77374386a2 Include if_var.h. 2013-10-28 21:08:04 +00:00
Michael Tuexen
92dfa76cbc 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
2013-10-28 20:45:19 +00:00
Sergey Kandaurov
d5814e82fa G/c unused mountrootfsname.
It was replaced with rootdevnames in r52778.
2013-10-28 20:38:17 +00:00
Michael Tuexen
daac3e7db6 Fix compilation if SCTP_DONT_DO_PRIVADDR_SCOPE is defined.
The issue was reported by Andrew Galante.

MFC after: 3 days
2013-10-28 20:32:37 +00:00
Gleb Smirnoff
eaeb0c139a Style: s/SYS_EVENTHANDLER_H/_SYS_EVENTHANDLER_H_/g
Submitted by:	bde
2013-10-28 20:32:05 +00:00
Olivier Houchard
f431664c05 Include <sys/ktr.h>, since we need it if ATH_DEBUG is defined. 2013-10-28 20:26:34 +00:00
Brooks Davis
0a529e9cde Add a couple includes if net/if_var.h that were missed in r257176. 2013-10-28 20:15:59 +00:00
Konstantin Belousov
06d513424a 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
2013-10-28 19:30:09 +00:00
Ian Lepore
5dc7c6b4c1 Follow r257244; it's now necessary to include if_var.h. 2013-10-28 18:43:00 +00:00
Sean Bruno
da276a9179 repair build for dev/cs.
Reported by: Outback Dingo <outbackdingo@gmail.com>
2013-10-28 16:27:01 +00:00
Gleb Smirnoff
a7a36fea40 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
2013-10-28 16:21:31 +00:00
Ian Lepore
99895358c0 Sweep up a bit of arm-land fallout after r257244; include necessary
headers directly that are no longer available via accidental include.
2013-10-28 15:20:17 +00:00
Gleb Smirnoff
79e0ca6491 Remove ng_fec(4). 2013-10-28 15:17:41 +00:00
Gleb Smirnoff
f8ba95a1a8 Fix build. We need to include systm.h before if_var.h.
Pointy hat to:	glebius
2013-10-28 15:11:37 +00:00
Gleb Smirnoff
e9c347cd8c Remove ng_fec(4). 2013-10-28 14:52:08 +00:00
Konstantin Belousov
86be9f0dd5 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
2013-10-28 13:33:29 +00:00
Gleb Smirnoff
506658cc1e 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).
2013-10-28 12:47:05 +00:00
Gleb Smirnoff
1ce5620d32 - Fix VIMAGE build.
- Fix build with gcc.
2013-10-28 10:12:19 +00:00
Gleb Smirnoff
c29e1ad930 - 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.
2013-10-28 08:03:40 +00:00