]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoThis is work done by Michael Tuexen and myself at the IETF. This
rrs [Thu, 7 Apr 2016 09:10:34 +0000 (09:10 +0000)]
This is work done by Michael Tuexen and myself at the IETF. This
adds the new I-Data (Interleaved Data) message. This allows a user
to be able to have complete freedom from Head Of Line blocking that
was previously there due to the in-ability to send multiple large
messages without the TSN's being in sequence. The code as been
tested with Michaels various packet drill scripts as well as
inter-networking between the IETF's location in Argentina and Germany.

8 years agoThis revision adds support to if_rt for more SoCs.
sgalabov [Thu, 7 Apr 2016 07:22:22 +0000 (07:22 +0000)]
This revision adds support to if_rt for more SoCs.

The SoCs I've tried the driver with include the following:
RT3050, RT5350, RT3662, RT3883, MT7620, MT7621, MT7688.
On boards, based on the above SoCs traffic is passing through correctly
and the boards survive a flood ping with very little or no drops (drops
may be caused elsewhere in my test setup, however).

One issue still remains and needs to be fixed in the future: if_rt does
not survive an ifconfig rt0 down/ifconfig rt0 up cycle.
This issue existed before this commit as well, however.

Reviewed by: ray
Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5864

8 years agohyperv: Use lapic_{alloc,free}_ipi to allocate private interrupt vector
sephe [Thu, 7 Apr 2016 07:12:57 +0000 (07:12 +0000)]
hyperv: Use lapic_{alloc,free}_ipi to allocate private interrupt vector

Suggested by: jhb
Reviewed by: Dexuan Cui <decui microsoft com>, Jun Su <junsu microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5850

8 years agoxen: Set ipi_{alloc,free} even for UP
sephe [Thu, 7 Apr 2016 07:00:00 +0000 (07:00 +0000)]
xen: Set ipi_{alloc,free} even for UP

This keeps XEN apic_ops aligned w/ x86's.

Suggested by: kib, jhb
Reviewed by: jhb, royger
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5871

8 years agox86: Allow interrupt vector allocation/free even on UP
sephe [Thu, 7 Apr 2016 06:36:03 +0000 (06:36 +0000)]
x86: Allow interrupt vector allocation/free even on UP

It is needed by the hypervisor FreeBSD guest to allocate/free private
interrupt vectors.

Reviewed by: kib, jhb, Dexuan Cui <decui microsoft com>
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5849

8 years agoDisable the NetBSD-specific EFAULT requirements test in gettimeofday_err
ngie [Thu, 7 Apr 2016 06:21:33 +0000 (06:21 +0000)]
Disable the NetBSD-specific EFAULT requirements test in gettimeofday_err

FreeBSD doesn't specifically list this as a supported error, and in some
configurations/versions of FreeBSD, this test will segfault as the memory
address might be evaluated in userspace, instead of in kernel space like
in NetBSD.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agohyperv: Typo in r297634
sephe [Thu, 7 Apr 2016 05:56:22 +0000 (05:56 +0000)]
hyperv: Typo in r297634

Noticed by: hiren
MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv/vmbus: Use default mtx for channel message queue
sephe [Thu, 7 Apr 2016 05:45:49 +0000 (05:45 +0000)]
hyperv/vmbus: Use default mtx for channel message queue

First of all sema_post() can't be called w/ spinlock, and the channel
message queue processing is not on hot code path, i.e. spinlock is not
necessary.

Submitted by: Jun Su <junsu microsoft com>
Reviewed by: sephe, Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5812

8 years agohyperv: Use mb() instead of atomic_thread_fence_seq_cst()
sephe [Thu, 7 Apr 2016 05:31:22 +0000 (05:31 +0000)]
hyperv: Use mb() instead of atomic_thread_fence_seq_cst()

Since atomic_thread_fence_seq_cst() will become compiler fence on UP kernel.

Reviewed by: kib, Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5852

8 years agoAdd four new RCTL resources - readbps, readiops, writebps and writeiops,
trasz [Thu, 7 Apr 2016 04:23:25 +0000 (04:23 +0000)]
Add four new RCTL resources - readbps, readiops, writebps and writeiops,
for limiting disk (actually filesystem) IO.

Note that in some cases these limits are not quite precise. It's ok,
as long as it's within some reasonable bounds.

Testing - and review of the code, in particular the VFS and VM parts - is
very welcome.

MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5080

8 years agoAdd DTrace probes for packets flagged as bad by ipfilter. All probes
cy [Thu, 7 Apr 2016 01:42:09 +0000 (01:42 +0000)]
Add DTrace probes for packets flagged as bad by ipfilter. All probes
for bad packets are named ipf_fi_bad_*.  An example of its use might be:

dtrace -n 'sdt:::ipf_fi_bad_* { stack(); }'

Reviewed by:  Darren Reed <darrenr@reed.wattle.id.au>

8 years agoFix GELIBoot support for GELI sector size is > 512
allanjude [Wed, 6 Apr 2016 23:21:44 +0000 (23:21 +0000)]
Fix GELIBoot support for GELI sector size is > 512

Add support for 4k sector GELI encrypted partitions to the bootloader
This is the default created by the installer

Because the IV is different for each sector, and the XTS tweak carries forward you can not decrypt a partial sector if the starting offset is not 0

Make boot2 and the loader read in 4k aligned chunks

Reviewed by: ed, oshogbo
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D5820

8 years agoAdd optional configuration knob NANO_CUST_FILES_MTREE. If set, it will
glebius [Wed, 6 Apr 2016 23:17:05 +0000 (23:17 +0000)]
Add optional configuration knob NANO_CUST_FILES_MTREE.  If set, it will
require an entry in custom mtree definition for every custom installed file.

Obtained from: Netflix

8 years agoConvert Allwinner port to extres clk/hwreset/regulator APIs.
jmcneill [Wed, 6 Apr 2016 23:11:03 +0000 (23:11 +0000)]
Convert Allwinner port to extres clk/hwreset/regulator APIs.

Reviewed by: andrew, gonzo, Emmanuel Vadot <manu@bidouilliste.com>
Approved by: gonzo (mentor)
Differential Revision: https://reviews.freebsd.org/D5752

8 years agoFollow-up r295924: Only sync hash-based db files open for writing when closing.
bdrewery [Wed, 6 Apr 2016 22:38:50 +0000 (22:38 +0000)]
Follow-up r295924: Only sync hash-based db files open for writing when closing.

This fixes a major performance regression when reading db files such as
the pw database during a 'pkg install'.

MFC after: 1 week
Tested by: bapt
Reviewed by: bapt
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D5868

8 years agoUpdate cust_pkgng with a simpler, more robust version. We don't need
imp [Wed, 6 Apr 2016 19:34:44 +0000 (19:34 +0000)]
Update cust_pkgng with a simpler, more robust version. We don't need
to loop for pkg, which simplifies things.

8 years agoRevert a change that sneeked with 297619
andrew [Wed, 6 Apr 2016 16:50:18 +0000 (16:50 +0000)]
Revert a change that sneeked with 297619

8 years agoDisable support for compat syscalls on arm64. These symbols were never
andrew [Wed, 6 Apr 2016 16:09:10 +0000 (16:09 +0000)]
Disable support for compat syscalls on arm64. These symbols were never
shipped since arm64 exists only on 11+.

Submitted by: brooks
Reviewed by: emaste, imp

8 years agofsck_msdosfs(8): Optimimize memsets
pfg [Wed, 6 Apr 2016 15:28:26 +0000 (15:28 +0000)]
fsck_msdosfs(8): Optimimize memsets

Obtained from: NetBSD (bin/50908)
MFC after: 2 weeks

8 years agoUse PHYS_IN_DMAP to check if a physical address is within the DMAP region.
andrew [Wed, 6 Apr 2016 14:16:37 +0000 (14:16 +0000)]
Use PHYS_IN_DMAP to check if a physical address is within the DMAP region.

Approved by: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoCleanup the early pagetable creation code in preperation for increasing
andrew [Wed, 6 Apr 2016 14:12:00 +0000 (14:12 +0000)]
Cleanup the early pagetable creation code in preperation for increasing
the size of the arm64 DMAP region.

Approved by: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoAllow vmparam.h to be included from assembly files on arm64.
andrew [Wed, 6 Apr 2016 14:08:10 +0000 (14:08 +0000)]
Allow vmparam.h to be included from assembly files on arm64.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoFix PIC lookup by device and xref. There was not taken into account
skra [Wed, 6 Apr 2016 12:48:45 +0000 (12:48 +0000)]
Fix PIC lookup by device and xref. There was not taken into account
the situation that someone has a pointer to device but not its xref.
This situation is regular now, after r297539.

8 years agoMake CloudABI's way of doing TLS more friendly to userspace emulators.
ed [Wed, 6 Apr 2016 11:11:31 +0000 (11:11 +0000)]
Make CloudABI's way of doing TLS more friendly to userspace emulators.

We're currently seeing how hard it would be to run CloudABI binaries on
operating systems cannot be modified easily (Windows, Mac OS X). The
idea is that we want to just run them without any sandboxing. Now
that CloudABI executables are PIE, this is already a bit easier, but TLS
is still problematic:

- CloudABI executables want to write to the %fs, which typically
  requires extra system calls by the emulator every time it needs to
  switch between CloudABI's and its own TLS.

- If CloudABI executables overwrite the %fs base unconditionally, it
  also becomes harder for the emulator to store a backup of the old
  value of %fs. To solve this, let's no longer overwrite %fs, but just
  %fs:0.

As CloudABI's C library does not use a TCB, this space can now be used
by an emulator to keep track of its internal state. The executable can
now safely overwrite %fs:0, as long as it makes sure that the TCB is
copied over to the new TLS area.

Ensure that there is an initial TLS area set up when the process starts,
only containing a bogus TCB. We don't really care about its contents on
FreeBSD.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D5836

8 years agoImplement dtrace_getupcstack in ARM64
wma [Wed, 6 Apr 2016 05:13:36 +0000 (05:13 +0000)]
Implement dtrace_getupcstack in ARM64

Allow using DTRACE for performance analysis of userspace
applications - the function call stack can be captured.
This is almost an exact copy of AMD64 solution.

Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           emaste, gnn, jhibbits
Differential Revision: https://reviews.freebsd.org/D5779

8 years agoRevert accidental submit of WIP as part of r297609
rpokala [Wed, 6 Apr 2016 04:58:20 +0000 (04:58 +0000)]
Revert accidental submit of WIP as part of r297609

Pointyhat to: rpokala

8 years agoStorage Controller Interface driver - typo in unimplemented macro in
rpokala [Wed, 6 Apr 2016 04:50:28 +0000 (04:50 +0000)]
Storage Controller Interface driver - typo in unimplemented macro in
scic_sds_controller_registers.h

s/contoller/controller/

PR: 207336
Submitted by: Tony Narlock <tony @ git-pull.com>

8 years agoConvert pci_delete_child() to a bus_child_deleted() method.
jhb [Wed, 6 Apr 2016 04:10:22 +0000 (04:10 +0000)]
Convert pci_delete_child() to a bus_child_deleted() method.

Instead of providing a wrapper around device_delete_child() that the PCI
bus and child bus drivers must call explicitly, move the bulk of the logic
from pci_delete_child() into a bus_child_deleted() method
(pci_child_deleted()).  This allows PCI devices to be safely deleted via
device_delete_child().
- Add a bus_child_deleted method to the ACPI PCI bus which clears the
  device_t associated with the corresponding ACPI handle in addition to
  the normal PCI bus cleanup.
- Change cardbus_detach_card to call device_delete_children() and move
  CardBus-specific delete logic into a new cardbus_child_deleted() method.
- Use device_delete_child() instead of pci_delete_child() in the SRIOV code.
- Add a bus_child_deleted method to the OpenFirmware PCI bus drivers which
  frees the OpenFirmware device info for each PCI device.

Reviewed by: imp
Tested on: amd64 (CardBus and PCI-e hotplug)
Differential Revision: https://reviews.freebsd.org/D5831

8 years ago[wlanstats] Convert rssi / signal / rate to use float.
adrian [Wed, 6 Apr 2016 03:22:39 +0000 (03:22 +0000)]
[wlanstats] Convert rssi / signal / rate to use float.

* Convert rssi/signal/rate to be a single digit precision float
* rssi is actually in 1/2 dBm units, so divide it by 2

8 years agoChase r296204 by renaming tzsetup(1) to tzsetup(8) in the tests
ngie [Wed, 6 Apr 2016 03:12:44 +0000 (03:12 +0000)]
Chase r296204 by renaming tzsetup(1) to tzsetup(8) in the tests

MFC after: 3 days
X-MFC with: r296204
Sponsored by: EMC / Isilon Storage Division

8 years ago[net80211] missed commit from last one - always cleanup superg state.
adrian [Wed, 6 Apr 2016 01:22:20 +0000 (01:22 +0000)]
[net80211] missed commit from last one - always cleanup superg state.

8 years ago[net80211] Initial A-MSDU support for testing / evaluation
adrian [Wed, 6 Apr 2016 01:21:51 +0000 (01:21 +0000)]
[net80211] Initial A-MSDU support for testing / evaluation

A-MSDU is another 11n aggregation mechanism where multiple ethernet
frames get LLC encapsulated (so they have a length field), padded,
and put in a single MPDU (802.11 MAC frame.)  This means it gets sent
out as a single frame, with a single seqno, it's acked as one frame, etc.

It turns out that, hah, atheros fast frames is almost but not quite
like this, so I'm reusing all of the current superg/fast-frames stuff
in order to actually transmit A-MSDU.  Yes, this means that A-MSDU
frames are also only aggregated two at a time, so it's not necessarily
a huge win, but it's better than nothing.

This doesn't do anything by default - the driver needs to say it does
A-MSDU as well as set the AMSDU software TX capability so this code path
gets exercised.

For now, the only driver that enables this is urtwn.  I'll enable it
for rsu at some point soon.
Tested:

* Add an amsdu encap path to aggregate two frames, same as the
  fast-frames path.

* Always do the superg init/teardown and node init/teardown stuff,
  regardless of whether the nodes are doing fast-frames (the ATH
  capability stuff.)  That way we can reuse it for amsdu.

* Don't do AMSDU for multicast/broadcast and EAPOL frames.

* If we're doing A-MPDU, then don't bother doing FF/A-MSDU.
  We can likely do both together, but I don't want to change
  behaviour.

* Teach the fast frames approx txtime logic to support the 11n
  rates.  But, since we don't currently have a full "current rate"
  support, assume it's HT20, long-gi, etc.  That way we overshoot
  on the TX time estimation, so we're always inside the requirements.
  (And we only aggregate two frames for now, so we're not really
  going to exceed that.)

* Drop the maximum FF age default down to 2ms, otherwise we end up
  with some very annoyingly large latencies.

TODO:

* We only aggregate two ethernet frames, so I'm not checking the max
  A-MSDU size.  But when it comes time to support >2 frames, we should
  obey that.

Tested:

* urtwn(4)

8 years agoFix sed functions 'i' and 'a' from discarding leading white space.
pfg [Wed, 6 Apr 2016 00:55:39 +0000 (00:55 +0000)]
Fix sed functions 'i' and 'a' from discarding leading white space.

This appears to be implementation dependent but convenient and makes
our sed behave more like GNU sed.

Given that it is not the historic behavior, bump FreeBSD_version
should userland/ports somehow depend on it.

Obtained from: NetBSD (bin/49872)

Reviewed by: bdrewery
PR: 208554
Merge after: NEVER

8 years ago[urtwn] disable doing AMPDU TX.
adrian [Wed, 6 Apr 2016 00:52:30 +0000 (00:52 +0000)]
[urtwn] disable doing AMPDU TX.

We don't do AMPDU TX for now, so don't bother setting this.

8 years ago[rsu] We don't do A-MPDU transmit right now, so don't bother registering
adrian [Wed, 6 Apr 2016 00:41:06 +0000 (00:41 +0000)]
[rsu] We don't do A-MPDU transmit right now, so don't bother registering
for it.

8 years agobhyveload: fix from loading undefined size.
pfg [Wed, 6 Apr 2016 00:01:03 +0000 (00:01 +0000)]
bhyveload: fix from loading undefined size.

We were setting an incorrect/undefined size and as it came out the st
struct was not really being used at all. This was actually a bug but
by sheer luck it had no visual effect.

CID: 1194320
Reviewed by: grehan

8 years agoAdd kern.features flags for linux and linux64 modules
bapt [Tue, 5 Apr 2016 22:36:48 +0000 (22:36 +0000)]
Add kern.features flags for linux and linux64 modules

kern.features.linux: 1 meaning linux 32 bits binaries are supported
kern.features.linux64: 1 meaning linux 64 bits binaries are supported

The goal here is to help 3rd party applications (including ports) to determine
if the host do support linux emulation

Reviewed by: dchagin
MFC after: 1 week
Relnotes: yes
Differential Revision: D5830

8 years ago[urtwn] first cut of getting the fast-frames / amsdu support in shape.
adrian [Tue, 5 Apr 2016 22:14:21 +0000 (22:14 +0000)]
[urtwn] first cut of getting the fast-frames / amsdu support in shape.

The urtwn hardware transmits FF/A-MSDU just fine - it takes an 802.11
frame and will dutifully send the thing.

So:

* bump RX queue up from 1. Why's it 1? That's really silly.
* Add the "software A-MSDU" encap capability bit.
* bump the TX buffer size up so we can at least send A-MSDU frames.
* track active frames submitted to the NIC - we can't make assumptions
  about how many are in flight in the NIC though.  For 88E parts we
  could use per-packet TX indication, but for R92 parts we can't.
  So, just fake it somewhat.
* Kick the transmit queue when we finish reception; try to avoid stalls.
* Kick the FF queue a little more regularly.

A-MSDU TX won't happen until the net80211 side is done, but atheros
fast-frames support should now work.

Tested:

* urtwn0: MAC/BB RTL8188EU, RF 6052 1T1R ; A-MSDU transmit.

8 years ago[net80211] rename 11n rate macros into a useful spot
adrian [Tue, 5 Apr 2016 22:01:56 +0000 (22:01 +0000)]
[net80211] rename 11n rate macros into a useful spot

* begin moving the 11n macros out of ieee80211_phy.c and
  into a header so they can be used elsewhere.

* rename some of them into the IEEE80211_* namespace.

* convert HT_RC_2_MCS() to work with three-stream rates.

8 years ago[net80211] note that M_FF will soon mean "fast-frames" or "A-MSDU."
adrian [Tue, 5 Apr 2016 21:54:42 +0000 (21:54 +0000)]
[net80211] note that M_FF will soon mean "fast-frames" or "A-MSDU."

8 years ago[net80211] Add a new capability flag to indicate that the stack should
adrian [Tue, 5 Apr 2016 21:54:07 +0000 (21:54 +0000)]
[net80211] Add a new capability flag to indicate that the stack should
do software A-MSDU encapsulation.

Right now there's AMSDU TX/RX capability bits and they're mostly
unused, however I'd like to maintain those as the general configuration,
not also "please software encap AMSDU."  For platforms that can do
A-MSDU in firmware (iwn, iwm, etc) then their init paths can read
this flag to configure A-MSDU.

8 years agonet80211: copy MAC address into iv_myaddr[] instead of aliasing it.
avos [Tue, 5 Apr 2016 21:29:11 +0000 (21:29 +0000)]
net80211: copy MAC address into iv_myaddr[] instead of aliasing it.

Since IF_LLADDR() returns a non-constant pointer to the MAC address
preserve a copy of it in iv_myaddr.

PR: 208505

8 years agoRemove leftover _LDSCRIPTROOT missed in r297270.
bdrewery [Tue, 5 Apr 2016 21:12:03 +0000 (21:12 +0000)]
Remove leftover _LDSCRIPTROOT missed in r297270.

Sponsored by: EMC / Isilon Storage Division

8 years agobhyve: Remove unneeded variable ncq.
pfg [Tue, 5 Apr 2016 19:30:19 +0000 (19:30 +0000)]
bhyve: Remove unneeded variable ncq.

ncq was not being inititialized properly but it was not actually
necessary either, so make the code smaller by removing it.

CID: 1248842
Reviewed by: grehan

8 years agoRemove misleading comment. musb supports host mode for more than two years now
gonzo [Tue, 5 Apr 2016 18:07:13 +0000 (18:07 +0000)]
Remove misleading comment. musb supports host mode for more than two years now

Spotted by: jmcneill

8 years agoFix typo. No functional change.
skra [Tue, 5 Apr 2016 13:56:43 +0000 (13:56 +0000)]
Fix typo. No functional change.

8 years agoAdd more DPRINTF() to the ftdi driver. Now everything that can change the
ian [Tue, 5 Apr 2016 13:47:06 +0000 (13:47 +0000)]
Add more DPRINTF() to the ftdi driver.  Now everything that can change the
chip's state has a DPRINTF, with things that happen repeatedly at debug=2
level and things that happen frequently (like per-transfer IO) at debug=3.

8 years agoRework BCM283x gpio interrupt controller for INTRNG. It's used on RPI-B
skra [Tue, 5 Apr 2016 13:45:23 +0000 (13:45 +0000)]
Rework BCM283x gpio interrupt controller for INTRNG. It's used on RPI-B
and RPI2 where INTRNG is already enabled by default.

Differential Revision: https://reviews.freebsd.org/D5810

8 years agoImplement bcm2836 interrupt controller for INTRNG and enable it
skra [Tue, 5 Apr 2016 13:41:51 +0000 (13:41 +0000)]
Implement bcm2836 interrupt controller for INTRNG and enable it
on RPI2 by default.

Differential Revision: https://reviews.freebsd.org/D5822

8 years agoRework bcm283x interrupt controller for INTRNG and enable it
skra [Tue, 5 Apr 2016 13:37:03 +0000 (13:37 +0000)]
Rework bcm283x interrupt controller for INTRNG and enable it
on RPI-B by default.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D5809

8 years agoehci_interrupt is MPSAFE code. Most drivers in tree calls bus_setup_intr
mmel [Tue, 5 Apr 2016 12:13:53 +0000 (12:13 +0000)]
ehci_interrupt is MPSAFE code. Most drivers in tree calls bus_setup_intr
with MPSAFE, some are not. Fix those.

Submitted by: Howard Su <howard0su@gmail.com>
Differential Revision: https://reviews.freebsd.org/D5755

8 years agoUse proper locking macros in RACCT in RCTL.
trasz [Tue, 5 Apr 2016 11:30:52 +0000 (11:30 +0000)]
Use proper locking macros in RACCT in RCTL.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agox86 topo: add some comments, descriptions and references to documentation
avg [Tue, 5 Apr 2016 10:36:40 +0000 (10:36 +0000)]
x86 topo: add some comments, descriptions and references to documentation

Plus a minor cosmetic change.

MFC after: 1 month

8 years agoTEGRA: Fix CPU frequency switching.
mmel [Tue, 5 Apr 2016 09:20:52 +0000 (09:20 +0000)]
TEGRA: Fix CPU frequency switching.
The PLL_X, base CPU frequency source, doesn't have a bypass switch and thus
we must use another frequency source for CPU while changing its frequency.
PLL_P is ideal for this, it runs at 480MHz and CPU can be clocked at this
frequency at any CPU voltage.

8 years agoAdd support for the Microchip mcp7941x.
jhibbits [Tue, 5 Apr 2016 03:27:33 +0000 (03:27 +0000)]
Add support for the Microchip mcp7941x.

This is compatible with the ds1307, but comparing the mcp7941x datasheet vs the
ds1307 code, appears there is one bit placement difference, so that is now
accounted for.

Relnotes: yes

8 years agoMake i2c device child auto-probe work for MPC85xx and QorIQ SoCs.
jhibbits [Tue, 5 Apr 2016 02:27:01 +0000 (02:27 +0000)]
Make i2c device child auto-probe work for MPC85xx and QorIQ SoCs.

OFW i2c probing requires a new method ofw_bus_get_node(), and the bus device is
assumed iichb.  With these changes, i2c devices attached in fdt are probed and
attached automagically.

8 years agoAdd another real-life example of setting a quirk for a USB gaming
wblock [Tue, 5 Apr 2016 01:12:56 +0000 (01:12 +0000)]
Add another real-life example of setting a quirk for a USB gaming
keyboard.  From forum thread: https://forums.freebsd.org/threads/55717/

MFC after: 1 week

8 years agoRemove a redundant check.
jhb [Tue, 5 Apr 2016 00:10:07 +0000 (00:10 +0000)]
Remove a redundant check.

cpu_suspend_map is always empty if smp_started is false.

Sponsored by: Netflix

8 years agoRemove an unneeded check.
jhb [Tue, 5 Apr 2016 00:09:19 +0000 (00:09 +0000)]
Remove an unneeded check.

CPUs with valid per-CPU data are not absent.

Sponsored by: Netflix

8 years agoDon't wakeup the fdc worker thread once a second when idle.
jhb [Tue, 5 Apr 2016 00:08:42 +0000 (00:08 +0000)]
Don't wakeup the fdc worker thread once a second when idle.

The fdc worker thread was using a one second timeout while waiting for
a new bio to arrive or for the device to detach.  However, the driver
already does a wakeup when queueing a new bio or asking the thread to
detach, so the timeout only served to waste CPU time waking up the
thread once a second just so it could go right back to sleep.  Use an
infinite timeout instead.

Discussed with: phk
Sponsored by: Netflix

8 years agoDIRDEPS_BUILD: Use 1 parameter for defining -rpath-link.
bdrewery [Mon, 4 Apr 2016 23:15:57 +0000 (23:15 +0000)]
DIRDEPS_BUILD: Use 1 parameter for defining -rpath-link.

Sponsored by: EMC / Isilon Storage Division

8 years ago[net80211] Add an A-MSDU debug output shortcut.
adrian [Mon, 4 Apr 2016 22:10:52 +0000 (22:10 +0000)]
[net80211] Add an A-MSDU debug output shortcut.

8 years agoAdd early_customize_cmd() that allows to register custom functions run
glebius [Mon, 4 Apr 2016 21:06:44 +0000 (21:06 +0000)]
Add early_customize_cmd() that allows to register custom functions run
before the build stage.

Reviewed by: imp
Obtained from: Netflix

8 years ago[net80211] teach wlanstats about the ff_encapfail field.
adrian [Mon, 4 Apr 2016 20:33:16 +0000 (20:33 +0000)]
[net80211] teach wlanstats about the ff_encapfail field.

Without this it just displays a blank, short column which is just
plainly not useful.

8 years ago[net80211] add amsdu and fast frames encap failure counters in the ioctl
adrian [Mon, 4 Apr 2016 20:32:31 +0000 (20:32 +0000)]
[net80211] add amsdu and fast frames encap failure counters in the ioctl
definition.

The code to set these will come in a subsequent commit (when I start
fleshing out A-MSDU support.)

8 years agoAdd a table to map from the FreeBSD CPUID space to the GIC CPUID space. On
andrew [Mon, 4 Apr 2016 17:04:33 +0000 (17:04 +0000)]
Add a table to map from the FreeBSD CPUID space to the GIC CPUID space. On
many SoCs these two are the same, however there is no requirement for this
to be the case, e.g. on the ARM Juno we boot on what the GIC thinks of as
CPU 2, but FreeBSD numbers it CPU 0.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agonew x86 smp topology detection code
avg [Mon, 4 Apr 2016 16:09:29 +0000 (16:09 +0000)]
new x86 smp topology detection code

Previously, the code determined a topology of processing units
(hardware threads, cores, packages) and then deduced a cache topology
using certain assumptions.  The new code builds a topology that
includes both processing units and caches using the information
provided by the hardware.

At the moment, the discovered full topology is used only to creeate
a scheduling topology for SCHED_ULE.
There is no KPI for other kernel uses.

Summary:
- based on APIC ID derivation rules for Intel and AMD CPUs
- can handle non-uniform topologies
- requires homogeneous APIC ID assignment (same bit widths for ID
  components)
- topology for dual-node AMD CPUs may not be optimal
- topology for latest AMD CPU models may not be optimal as the code is
  several years old
- supports only thread/package/core/cache nodes

Todo:
  - AMD dual-node processors
  - latest AMD processors
  - NUMA nodes
  - checking for homogeneity of the APIC ID assignment across packages
  - more flexible cache placement within topology
  - expose topology to userland, e.g., via sysctl nodes

Long term todo:
  - KPI for CPU sharing and affinity with respect to various resources
    (e.g., two logical processors may share the same FPU, etc)

Reviewed by: mav
Tested by: mav
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D2728

8 years agoSJIS encoding don't have single byte characters >= 224
ache [Mon, 4 Apr 2016 15:56:14 +0000 (15:56 +0000)]
SJIS encoding don't have single byte characters >= 224

MFC after:      1 week

8 years agoReduce the diff for when we switch to intrng. The IPI interrupts will be
andrew [Mon, 4 Apr 2016 15:13:17 +0000 (15:13 +0000)]
Reduce the diff for when we switch to intrng. The IPI interrupts will be
split out to multiple handlers.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoInclude sys/rman.h directly rather than relying on header pollution.
andrew [Mon, 4 Apr 2016 10:52:43 +0000 (10:52 +0000)]
Include sys/rman.h directly rather than relying on header pollution.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoOpenBSD 5.9 and FreeBSD 10.3 releases added.
maxim [Mon, 4 Apr 2016 10:27:48 +0000 (10:27 +0000)]
OpenBSD 5.9 and FreeBSD 10.3 releases added.

8 years agoFix a format string when uint64_t is not unsigned long long by casting
andrew [Mon, 4 Apr 2016 10:03:06 +0000 (10:03 +0000)]
Fix a format string when uint64_t is not unsigned long long by casting
through uintmax_t.

8 years agoDefine local-intc for BCM2836 platform (RPI2) and make BCM2835 intc
skra [Mon, 4 Apr 2016 09:41:22 +0000 (09:41 +0000)]
Define local-intc for BCM2836 platform (RPI2) and make BCM2835 intc
a child of it. This is done in conformity with Linux dts files and
as preparation for rework of BCM2836 interrupt controller for INTRNG.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D5807

8 years agoRework TI gpio interrupt controller for INTRNG. It's used on PANDABOARD
skra [Mon, 4 Apr 2016 09:29:30 +0000 (09:29 +0000)]
Rework TI gpio interrupt controller for INTRNG. It's used on PANDABOARD
and BEAGLEBONE where INTRNG is already enabled by default.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D5806

8 years agoRework am33xx interrupt controller for INTRNG and enable it
skra [Mon, 4 Apr 2016 09:23:21 +0000 (09:23 +0000)]
Rework am33xx interrupt controller for INTRNG and enable it
on BEAGLEBONE by default.

Reviewed by: gonzo
Differential Revision: https://reviews.freebsd.org/D5805

8 years agoRemove FDT specific parts from INTRNG. Change its interface to make it
skra [Mon, 4 Apr 2016 09:15:25 +0000 (09:15 +0000)]
Remove FDT specific parts from INTRNG. Change its interface to make it
universal.

(1) New struct intr_map_data is defined as a container for arbitrary
description of an interrupt used by a device. Typically, an interrupt
number and configuration relevant to an interrupt controller is encoded
in such description. However, any additional information may be encoded
too like a set of cpus on which an interrupt should be enabled or vendor
specific data needed for setup of an interrupt in controller. The struct
intr_map_data itself is meant to be opaque for INTRNG.

(2) An intr_map_irq() function is created which takes an interrupt
controller identification and struct intr_map_data as arguments and
returns global interrupt number which identifies an interrupt.

(3) A set of functions to be used by bus drivers is created as well as
a corresponding set of methods for interrupt controller drivers. These
sets take both struct resource and struct intr_map_data as one of the
arguments. There is a goal to keep struct intr_map_data in struct
resource, however, this way a final solution is not limited to that.

(4) Other small changes are done to reflect new situation.

This is only first step aiming to create stable interface for interrupt
controller drivers. Thus, some temporary solution is taken. Interrupt
descriptions for devices are stored in INTRNG and two specific mapping
function are created to be temporary used by bus drivers. That's why
the struct intr_map_data is not opaque for INTRNG now. This temporary
solution will be replaced by final one in next step.

Differential Revision: https://reviews.freebsd.org/D5730

8 years agoarm64: pagezero improvement
wma [Mon, 4 Apr 2016 07:16:43 +0000 (07:16 +0000)]
arm64: pagezero improvement

This change has been provided to improve pagezero call performance.

Submitted by:          Dominik Ermel <der@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           kib
Differential Revision: https://reviews.freebsd.org/D5741

8 years agoAdd bzero.S to ARM64 machdep
wma [Mon, 4 Apr 2016 07:11:33 +0000 (07:11 +0000)]
Add bzero.S to ARM64 machdep

Add fille missing from https://svnweb.freebsd.org/changeset/base/297536

8 years agoarm64: bzero optimization
wma [Mon, 4 Apr 2016 07:06:20 +0000 (07:06 +0000)]
arm64: bzero optimization

This optimization attempts to utylize as wide as possible register store instructions to zero large buffers.
The implementation, if possible, will use 'dc zva' to zero buffer by cache lines.

Speedup: 60x faster memory zeroing

Submitted by:          Dominik Ermel <der@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           kib
Differential Revision: https://reviews.freebsd.org/D5726

8 years agoRemove unused variable. It was write-only before r297139.
kib [Mon, 4 Apr 2016 06:58:59 +0000 (06:58 +0000)]
Remove unused variable.  It was write-only before r297139.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoEnable 4-byte address support for the mx25l family of SPI flash devices.
sgalabov [Mon, 4 Apr 2016 06:55:48 +0000 (06:55 +0000)]
Enable 4-byte address support for the mx25l family of SPI flash devices.

Introduce 2 new flags:
- FL_ENABLE_4B_ADDR (forces the use of 4-byte addresses)
- FL_DISABLE_4B_ADDR (forces the use of 3-byte addresses)

If an SPI flash chip is defined with FL_ENABLE_4B_ADDR in its flags,
then an 'Enter 4-byte mode' command is sent to the chip at attach time
and, later, all commands that require addressing are issued with 4-byte
addresses.
If an SPI flash chip is defined with FL_DISABLE_4B_ADDR in its flags,
then an 'Exit 4-byte mode' command is sent to the chip at attach time
and, later, all commands that require addressing are issued with 3-byte
addresses.
For chips that do not have any of these flags defined the behaviour is
unchanged.

This change also adds support for the MX25L25735F and MX25L25635E chips
(vendor id 0xc2, device id 0x2019), which support 4-byte mode and enables
4-byte mode for them. These are 256Mbit devices (32MiB) and, as such, can
only be fully addressed by using 4-byte addresses.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D5808

8 years agoEUC-type encodings don't have single byte characters >= 128
ache [Mon, 4 Apr 2016 02:43:35 +0000 (02:43 +0000)]
EUC-type encodings don't have single byte characters >= 128

This change should not be MFCed until new collate will be
MFCed first, because our old EUC tables have some hacks for
missing codesets.

8 years ago[iwn] Don't try to seamlessly recover from a firmware panic; just restart
adrian [Sun, 3 Apr 2016 23:39:58 +0000 (23:39 +0000)]
[iwn] Don't try to seamlessly recover from a firmware panic; just restart
the interface.

I know this may be unpopular, but iwn is not yet completely ready for
a transparent firmware restart.  I have this thing panic my laptop
reliably because 11n state isn't kept in sync and the TX completion
path ends up trying to free a null node reference.

8 years agoMove i386/i386/autoconf.c to sys/x86/x86 and use it on both amd64 and i386.
jhb [Sun, 3 Apr 2016 23:03:54 +0000 (23:03 +0000)]
Move i386/i386/autoconf.c to sys/x86/x86 and use it on both amd64 and i386.

8 years agoAdd a timestamp variable to the environment. This is when the event
imp [Sun, 3 Apr 2016 20:29:21 +0000 (20:29 +0000)]
Add a timestamp variable to the environment. This is when the event
was read from the kernel by devd.

8 years agoMake $_ match the docs.
imp [Sun, 3 Apr 2016 20:29:14 +0000 (20:29 +0000)]
Make $_ match the docs.

8 years agochdone(): Prevent returning uninitialized scalar value.
pfg [Sun, 3 Apr 2016 16:38:15 +0000 (16:38 +0000)]
chdone(): Prevent returning uninitialized scalar value.

If there is an error different from ERESTART, there is some
chance that we may end up accessing an uninitialized value. This
doesn't seem likely/possible but initialize announce_buf[0],
just in case.

CID: 1006486

8 years agog_sched_destroy(): prevent return of uninitialized scalar variable.
pfg [Sun, 3 Apr 2016 16:25:51 +0000 (16:25 +0000)]
g_sched_destroy(): prevent return of uninitialized scalar variable.

For the !gsp case there some chance of returning an uninitialized
return value. Prevent that from happening by initializing the
error value.

CID: 1006421

8 years agoFix indentation oops.
pfg [Sun, 3 Apr 2016 14:40:54 +0000 (14:40 +0000)]
Fix indentation oops.

8 years agowpi, iwn: fix check in find_eeprom_channel()
avos [Sun, 3 Apr 2016 14:38:26 +0000 (14:38 +0000)]
wpi, iwn: fix check in find_eeprom_channel()

Return correct eeprom_chan structure pointer for 7, 8, 11 and 12 5Ghz
channels.

8 years agoPass through some new block device features.
mav [Sun, 3 Apr 2016 11:18:20 +0000 (11:18 +0000)]
Pass through some new block device features.

MFC after: 1 month

8 years agofix zfs set canmount=off on an unmounted filesystem
avg [Sun, 3 Apr 2016 07:42:13 +0000 (07:42 +0000)]
fix zfs set canmount=off on an unmounted filesystem

Previously this operation tried to unmount and remount children.
Also see https://www.illumos.org/issues/6428.

MFC after: 2 weeks
X-Needs-Upstreaming: illumos

8 years agozfs receive: -u can be ignored sometimes
avg [Sun, 3 Apr 2016 07:40:33 +0000 (07:40 +0000)]
zfs receive: -u can be ignored sometimes

When force-receiving a filesystem that was already mounted the re-created
filesystem is mounted despite -u flag.

Also see https://www.illumos.org/issues/6412.

PR: 204705
Tested by: Vladimir Krstulja <vlad-fbsd@acheronmedia.com>
MFC after: 2 weeks
X-Needs-Upstreaming: illumos

8 years agoMove Linux specific times tests up to guarantee the values are defined.
dchagin [Sun, 3 Apr 2016 06:33:16 +0000 (06:33 +0000)]
Move Linux specific times tests up to guarantee the values are defined.

CID: 1305178
Submitted by: pfg@
MFC after: 1 week

8 years agoImprove HDMI display detection by searching the CEA-861 extension block for
jmcneill [Sat, 2 Apr 2016 16:53:12 +0000 (16:53 +0000)]
Improve HDMI display detection by searching the CEA-861 extension block for
an HDMI vendor-specific data block (VSDB) containing the HDMI 24-bit IEEE
registration ID (0x000C03).

Approved by: gonzo (mentor)

8 years agoremove emulation of VFS_HOLD and VFS_RELE from opensolaris compat
avg [Sat, 2 Apr 2016 16:25:46 +0000 (16:25 +0000)]
remove emulation of VFS_HOLD and VFS_RELE from opensolaris compat

On FreeBSD VFS_HOLD/VN_RELE were mapped to MNT_REF/MNT_REL that
manipulate mnt_ref.  But the job of properly maintaining the reference
count is already automatically performed by insmntque(9) and
delmntque(9).  So, in effect all ZFS vnodes referenced the corresponding
mountpoint twice.

That was completely harmless, but we want to be very explicit about what
FreeBSD VFS APIs are used, because illumos VFS_HOLD and FreeBSD MNT_REF
provide quite different guarantees with respect to the held vfs_t /
mountpoint.  On illumos VFS_HOLD is sufficient to guarantee that
vfs_t.vfs_data stays valid.  On the other hand, on FreeBSD MNT_REF does
*not* provide the same guarantee about mnt_data.  We have to use
vfs_busy() to get that guarantee.

Thus, the calls to VFS_HOLD/VFS_RELE on vnode init and fini are removed.
VFS_HOLD calls are replaced with vfs_busy in the ioctl handlers.

And because vfs_busy has a richer interface that can not be dumbed down
in all cases it's better to explicitly use it rather than trying to mask
it behind VFS_HOLD.

This change fixes a panic that could result from a race between
zfs_umount() and zfs_ioc_rollback().  We observed a case where
zfsvfs_free() tried to destroy data that zfsvfs_teardown() was still
using.  That happened because there was nothing to prevent unmounting of
a ZFS filesystem that was in between zfs_suspend_fs() and
zfs_resume_fs().

Reviewed by: kib, smh
MFC after: 3 weeks
Sponsored by: ClusterHQ
Differential Revision: https://reviews.freebsd.org/D2794

8 years agoAdd configurable rate limit for "log" and "devctl" actions.
trasz [Sat, 2 Apr 2016 09:11:52 +0000 (09:11 +0000)]
Add configurable rate limit for "log" and "devctl" actions.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoMFV r297506: 6738 zfs send stream padding needs documentation
mav [Sat, 2 Apr 2016 08:36:24 +0000 (08:36 +0000)]
MFV r297506: 6738 zfs send stream padding needs documentation

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Eli Rosenthal <eli.rosenthal@delphix.com>

illumos/illumos-gate@c20404ff77119516354b0d112d28b7ea0dadd303

8 years agoMFV r297505:
mav [Sat, 2 Apr 2016 08:34:15 +0000 (08:34 +0000)]
MFV r297505:
6739 userland version of cv_timedwait_hires() always assumes absolute time

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>

illumos/illumos-gate@41c6413cb54bf338d7a59ed789ec2e0e44c35e6f

8 years agoMFV r297504: 6681 zfs list burning lots of time in dodefault() via dsl_prop_*
mav [Sat, 2 Apr 2016 08:28:46 +0000 (08:28 +0000)]
MFV r297504: 6681 zfs list burning lots of time in dodefault() via dsl_prop_*

Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Alex Wilson <alex.wilson@joyent.com>

illumos/illumos-gate@d09e4475f635b6f66ee68d8c17a32bba7be17c96